AGRAPH and Menus

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Post Reply
Pyyy
Posts: 2
Joined: Fri May 22, 2020 9:35 pm

AGRAPH and Menus

Post by Pyyy »

Hi,
I just noticed that AGRAPH shows menu labels in the message area if a menu is active.
As far as I can tell (using free42) this should not happen.

Code: Select all

00 { 29-Byte Prgm }
01▸LBL "FOO"
02 CLMENU
03 "A"
04 KEY 1 XEQ "FOO"
05 "A"
06 AGRAPH
07 MENU
08 STOP
09 GTO "FOO"
10 END
This example program shows some dots and the x-level of the stack on free42 but on the DM42 it shows the menu instead of the x-level.
The CIRCT program from the Electrical Engineering Solutions displays circuit elements in a similar way and there the menu keys hide the values of the circuit elements...
Does someone have a workaround for this?
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: AGRAPH and Menus

Post by whuyse »

Moderator note: program surrounded by 'code' tags for compactness.

Yes, but it is a bit involved: use GETKEY to catch the menu keys.
A few things to know:
- you want GETKEY to catch only the keys you want, and do nothing on others. The simplest way is putting all key codes in ALPHA and using POSA to check for them, but I use a matrix instead (see below), as you may need the ALPHA register for AGRAPHs.
- GETKEY doesn't catch the EXIT key, which I have always found a shame; so you'll need to designate another key to exit.
- GETKEY doesn't catch the DM42 top row softkeys UNLESS a menu is present. That can be accomplished in program mode by EDITing a matrix.

The following program lets you add "A" or "B" to the screen when pressing softkey 1 or 2, repeatedly. Use key 6 to Exit. No menu labels are shown.
(this is the ONLY way I have found to interact with a graphics display; it is what I used in the matrix Viewer. Using MENU and pressing a key clears the LCD, and redrawing the whole DM42 screen takes too long for comfort.)

Code: Select all

00 { 106-Byte Prgm }
01▸LBL "AB"
02 CLLCD
03 3 @ set up the matrix of valid GETKEY codes
04 1
05 NEWMAT
06 EDIT
07 1
08 →
09 2
10 →
11 6
12 EXITALL
13 LSTO "GK"
14 EDIT @ EDIT a matrix so the top row keys work
15 1
16 ENTER
17 "÷" @ dummy AGRAPH to show the graphics screen on first GETKEY
18 AGRAPH
19▸LBL 09 @ main loop
20 CLA
21 SF 25
22▸LBL 10 @ GETKEY loop
23 GETKEY
24 RCL- "GK"
25 1/X @ causes an error when key valid, so CF 25 and LastX still contains keycode
26 R↓
27 FS? 25
28 GTO 10
29 GTO IND ST L
30▸LBL 01 @ add "A"
31 126
32 XTOA
33 9
34 XTOA
35 XTOA
36 XTOA
37 R↓
38 XTOA
39 GTO 00
40▸LBL 02 @ add "B"
41 127
42 XTOA
43 ├"III6"
44▸LBL 00
45 R↓
46 AGRAPH
47 6
48 +
49 GTO 09
50▸LBL 06 @ exit
51 EXITALL
52 CLD @ quit graphics screen
53 END
Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
JerryMartin
Posts: 1
Joined: Mon Mar 01, 2021 11:18 am

Re: AGRAPH and Menus

Post by JerryMartin »

Is there a way to fix the CIRCT program? I'm not a programmer but would like to use this set of programs.
dlachieze
Posts: 613
Joined: Thu May 04, 2017 12:20 pm
Location: France

Re: AGRAPH and Menus

Post by dlachieze »

Pyyy wrote:
Thu Jun 04, 2020 12:54 pm
I just noticed that AGRAPH shows menu labels in the message area if a menu is active.
As far as I can tell (using free42) this should not happen.
[...]
The CIRCT program from the Electrical Engineering Solutions displays circuit elements in a similar way and there the menu keys hide the values of the circuit elements...
Does someone have a workaround for this?
JerryMartin wrote:
Mon Mar 01, 2021 1:52 pm
Is there a way to fix the CIRCT program? I'm not a programmer but would like to use this set of programs.
When I published the Electrical Engineering Solutions programs for the DM42 I tested them and they were working fine with the FW that was at that time rev 3.4a.
As reported, the CIRCT program is not displaying correctly the circuits elements with the current firmware (DMCP-3.20 / DM42-3.16).
I've been able to identify the firmware revision that broke this display: DMCP-3.10 / DM42-3.10, I think this is related to the fix of the issue with multi line messages and menus in this revision. IMHO this fix is introducing another display bug that needs to be fixed for HP 42S programs using AGRAPH to work correctly with menus.

A workaround is to downgrade your DM42 to the latest working FW for this feature, which is DMCP-3.9a / DM42-3.9.1.

I used the circuit example on page 55 of the Electrical Engineering Solutions manual and here is the first circuit element correctly displayed with rev 3.9:

20210302-10341841.bmp
20210302-10341841.bmp (12.31 KiB) Viewed 1999 times

and the same circuit element incorrectly displayed with rev 3.10 (menu bar overlapping the display):

20210302-10301896.bmp
20210302-10301896.bmp (12.31 KiB) Viewed 1999 times
DM42: 00425 - DM41X: β00066 - WP43: 00042
Post Reply