Post Reply 
Cartesian drawing commands ? (how to add persistent graphical elements)
10-28-2018, 03:16 PM (This post was last modified: 11-02-2018 06:36 PM by dg1969.)
Post: #1
Cartesian drawing commands ? (how to add persistent graphical elements)
Hi,

I have a question and a request.

I would like to add graphic elements in the drawing area of an application based on the "function" application (lines, circles respecting the scale of the drawing).

Here is a basic example to illustrate:

You must first add two functions in the symbolic view or download the sample in app format...

[Image: Test-APP.png]

Code:

#pragma mode( separator(.,;) integer(h32) )

Plot()
BEGIN
CHOOSE(A,"Choose a graph","sincard","cos");
CASE
IF A==1 THEN CHECK(1);UNCHECK(2) END;
IF A==2 THEN CHECK(2);UNCHECK(1) END;
END;
STARTVIEW(1,1);
END;

VIEW "Circle", circle()
BEGIN
  LOCAL r;
  r:=Ymax-Ymin;
  r:=218/r;
  ARC(G0,0,0,r);
  //WAIT();
END;

VIEW "Auto scale", auto()
BEGIN
  STARTVIEW(10);
END;

With this method I can add graphic elements (here a simple circle of radius 1 unit) but unfortunately if I move the graph or if I zoom (with touch screen capabilities) , the added elements are destroyed ... How to make them persistent so that it moves with the function curves plotted ?


And now a request to HP team:

Often I want (as in this basic example) to use the plot key to allow a choice between different types of plots. I then reserve the function "view" for other tasks (often those provided by default: "autoscale", etc.)
Unfortunately currently, the code contained in the block "Plot () BEGIN END" is not executed when I press the "Plot" key when the graphic view is already active ... I have to leave the graphic view so that the "Plot" key is operational. Could not we imagine a change in this behavior so that the press on the keys "Plot" "Num" etc. is taken into account even if the corresponding view is already active?

Thank you for the time you have spent reading me.


Attached File(s)
.zip  Test_APP.hpappdir.zip (Size: 1.24 KB / Downloads: 3)
Find all posts by this user
Quote this message in a reply
10-28-2018, 04:14 PM (This post was last modified: 10-28-2018 04:16 PM by eried.)
Post: #2
RE: Cartesian drawing commands ?
I think the answer is using the Geometry app, it is quite advanced (you can add functions, sliders, etc) but I haven't explored it a lot like to propose a working example

A good start would be to check
Code:
plotFunc
on the help catalog

My website: erwin.ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
11-01-2018, 02:14 PM
Post: #3
RE: Cartesian drawing commands ?
(10-28-2018 04:14 PM)eried Wrote:  I think the answer is using the Geometry app, it is quite advanced (you can add functions, sliders, etc) but I haven't explored it a lot like to propose a working example

A good start would be to check
Code:
plotFunc
on the help catalog
Thank's Eried for your answer. I have indeed already explore the geometry app... But I appreciate being able to use the commands associated with the function app (root, min max intersection etc...).

And for the request ? How is this proposal perceived by the HP team?
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)