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
Post Reply 


Messages In This Thread
Cartesian drawing commands ? (how to add persistent graphical elements) - dg1969 - 10-28-2018 03:16 PM
RE: Cartesian drawing commands ? - eried - 10-28-2018, 04:14 PM
RE: Cartesian drawing commands ? - dg1969 - 11-01-2018, 02:14 PM



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