Post Reply 
DB48X: HP48-like RPL implementation for DM42
11-12-2024, 09:50 AM (This post was last modified: 11-12-2024 09:51 AM by raprism.)
Post: #421
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 09:39 AM)c3d Wrote:  
(11-12-2024 04:16 AM)nickapos Wrote:  Hi Christophe, do you have any examples of how to use the SI prefixes in units?

For an example I wanted to use centi liter (cL) recently but could not figure out how to do it. If I understand it correctly you can do a custom unit with the = sign be parsed as a new unit but is there any other way to do it on the fly?

Thanks and regards

It's just that I was not aware that the liter could also be spelled uppercase. For now use cl and it works. You can add it to your favorites in Quick or in the =Cycle units cycle, but otherwise, you can enter 3_cl quickly with [3][Shift][Units][Volume][l][EEX]x6

Thanks for the hint to [EEX] cycling. Is this cycle configurable? Just because µ is missing, and M and G is in some fields (concentrations, amount of substance, ... in chemistry) rarely used.
Find all posts by this user
Quote this message in a reply
11-12-2024, 10:44 AM
Post: #422
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 09:35 AM)raprism Wrote:  
(11-12-2024 04:16 AM)nickapos Wrote:  Hi Christophe, do you have any examples of how to use the SI prefixes in units?

For an example I wanted to use centi liter (cL) recently but could not figure out how to do it. If I understand it correctly you can do a custom unit with the = sign be parsed as a new unit but is there any other way to do it on the fly?

Thanks and regards

It can be inserted as 1_cl with number 1 and rest in alpha mode (or _ from Unit menu). Or input 1 and choose l in Unit->Volume and insert c in (transient) Alpha mode (after 1 left arrow action).

All prefixes can be inserted fast in transient alpha mode, only µ seem to require normal alpha mode and pressing shift twice before choosing D key. Not sure if there is already a faster way to get µ. If not, then 1_µ might be candidate for Unit->Quick menu.
Thanks for that
I managed to do 1_cl in alpha but not in transient. All i get is 1_c*l i am sure i am missing something here.

Christophe when you mention EEX i assume you are referring to x10^n button in the app?
Find all posts by this user
Quote this message in a reply
11-12-2024, 11:02 AM (This post was last modified: 11-12-2024 11:03 AM by c3d.)
Post: #423
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 10:44 AM)nickapos Wrote:  
(11-12-2024 09:35 AM)raprism Wrote:  It can be inserted as 1_cl with number 1 and rest in alpha mode (or _ from Unit menu). Or input 1 and choose l in Unit->Volume and insert c in (transient) Alpha mode (after 1 left arrow action).

All prefixes can be inserted fast in transient alpha mode, only µ seem to require normal alpha mode and pressing shift twice before choosing D key. Not sure if there is already a faster way to get µ. If not, then 1_µ might be candidate for Unit->Quick menu.
Thanks for that
I managed to do 1_cl in alpha but not in transient. All i get is 1_c*l i am sure i am missing something here.

Here is the key sequence that works for me: [1][Hold Right][-][C][L][Release Right]. The unit prefix _ is available in transient alpha for both left and right because there are both upper and lowercase units. So for example, 2_MB can be entered with [2][Hold Left][-][M][B][Release Left]. Of course, if you want 2_MiB you are out of luck and need the more touchy [2][Hold Left][-][M][Release Left][Hold Right][I][Release Right][Hold Left][B][Release Left]. Still "relatively" fast.

Let me know if it still fails for you.

Quote:Christophe when you mention EEX i assume you are referring to x10^n button in the app?

Correct.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
11-12-2024, 11:08 AM (This post was last modified: 11-12-2024 11:12 AM by c3d.)
Post: #424
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 09:50 AM)raprism Wrote:  
(11-12-2024 09:39 AM)c3d Wrote:  It's just that I was not aware that the liter could also be spelled uppercase. For now use cl and it works. You can add it to your favorites in Quick or in the =Cycle units cycle, but otherwise, you can enter 3_cl quickly with [3][Shift][Units][Volume][l][EEX]x6

Thanks for the hint to [EEX] cycling. Is this cycle configurable? Just because µ is missing, and M and G is in some fields (concentrations, amount of substance, ... in chemistry) rarely used.

Not yet configurable, but since you asked...

The easiest way to make it configurable would be with a special variable. That would also make it per-directory, which may be convenient.

So what about adding a 'UnitSIPrefixCycle' special variable containing a text with the desired sequence of SI prefixes, e.g. "cmKµ" would cycle between these four? Would that work? (Of course there is the pesky case of "da"...)

And while I'm at it, I could add a `UnitsCycle` containing a list describing unit cycles, that would work like the one in `units.csv` with the additional benefit of being per-directory.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
11-12-2024, 11:11 AM
Post: #425
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 09:35 AM)raprism Wrote:  
(11-12-2024 04:16 AM)nickapos Wrote:  Hi Christophe, do you have any examples of how to use the SI prefixes in units?

For an example I wanted to use centi liter (cL) recently but could not figure out how to do it. If I understand it correctly you can do a custom unit with the = sign be parsed as a new unit but is there any other way to do it on the fly?

Thanks and regards

It can be inserted as 1_cl with number 1 and rest in alpha mode (or _ from Unit menu). Or input 1 and choose l in Unit->Volume and insert c in (transient) Alpha mode (after 1 left arrow action).

All prefixes can be inserted fast in transient alpha mode, only µ seem to require normal alpha mode and pressing shift twice before choosing D key. Not sure if there is already a faster way to get µ. If not, then 1_µ might be candidate for Unit->Quick menu.[/code][/font]

An alternative would be to accept 'u' as a SI prefix for micro.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
11-12-2024, 11:50 AM
Post: #426
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 11:11 AM)c3d Wrote:  An alternative would be to accept 'u' as a SI prefix for micro.

'u' would clash with 'u' unit, when straightly inserting '1_u'. Not sure, if something like '1_u:' to mark a prefix input would be better. Because there is 'da', one could think about 'mu', too.

Everything else sounds fine for me.
Find all posts by this user
Quote this message in a reply
11-12-2024, 12:35 PM
Post: #427
RE: DB48X: HP48-like RPL implementation for DM42
I attempted to install DB50x V0.8..5 and my DM32 crashed when running the qspi file with a "hard fault". Pressing EXIT failed again as did pressingt the reset button on the back.

Code:

Oops, I've crashed! Please try
To reproduce it, then report the
Steps taken and following info:

Hard Fault
 R0=00020008  r1=200087c0
 R2=9002d4a8  r3=00020008
R12=ffffeeee  lr=081317e3
 Pc=0814818c psr=21000200

Press EXIT to RESET the calculator...
Have I bricked my DM32, or is there a recovery method?

Crossing my fingers.
--David
Find all posts by this user
Quote this message in a reply
11-12-2024, 12:54 PM (This post was last modified: 11-12-2024 12:56 PM by c3d.)
Post: #428
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 12:35 PM)Dashier Wrote:  I attempted to install DB50x V0.8..5 and my DM32 crashed when running the qspi file with a "hard fault". Pressing EXIT failed again as did pressingt the reset button on the back.

Code:

Oops, I've crashed! Please try
To reproduce it, then report the
Steps taken and following info:

Hard Fault
 R0=00020008  r1=200087c0
 R2=9002d4a8  r3=00020008
R12=ffffeeee  lr=081317e3
 Pc=0814818c psr=21000200

Press EXIT to RESET the calculator...
Have I bricked my DM32, or is there a recovery method?

Crossing my fingers.
--David

Aaaargh, shoot. You need to hold the F1 key while pressing the reset button on the back (you will need a paper clip or something like that). Then load the program, and it should be fine.

The problem is that the two versions, 0.8.4 and 0.8.5, are close enough that the existing DMCP checksum mechanism does not bring you back to the "load PGM" menu. Instead, after you upgraded the QSPI, it ran the 0.8.4 on it and there is an address mismatch that causes the crash. I hit that all the time during development, and I had not realized this would be a problem for the 0.8.4 and 0.8.5 releases. Sorry.

In any case, no your calculator is not broken. Just load the new PGM file and you should be good.

I need to implement a stronger checksum mechanism to avoid that scenario. And to take some rest, because I'm making mistakes.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
11-12-2024, 01:25 PM
Post: #429
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 12:54 PM)c3d Wrote:  
(11-12-2024 12:35 PM)Dashier Wrote:  I attempted to install DB50x V0.8..5 and my DM32 crashed when running the qspi file with a "hard fault". Pressing EXIT failed again as did pressingt the reset button on the back.

Code:

Oops, I've crashed! Please try
To reproduce it, then report the
Steps taken and following info:

Hard Fault
 R0=00020008  r1=200087c0
 R2=9002d4a8  r3=00020008
R12=ffffeeee  lr=081317e3
 Pc=0814818c psr=21000200

Press EXIT to RESET the calculator...
Have I bricked my DM32, or is there a recovery method?

Crossing my fingers.
--David

Aaaargh, shoot. You need to hold the F1 key while pressing the reset button on the back (you will need a paper clip or something like that). Then load the program, and it should be fine.

The problem is that the two versions, 0.8.4 and 0.8.5, are close enough that the existing DMCP checksum mechanism does not bring you back to the "load PGM" menu. Instead, after you upgraded the QSPI, it ran the 0.8.4 on it and there is an address mismatch that causes the crash. I hit that all the time during development, and I had not realized this would be a problem for the 0.8.4 and 0.8.5 releases. Sorry.

In any case, no your calculator is not broken. Just load the new PGM file and you should be good.

I need to implement a stronger checksum mechanism to avoid that scenario. And to take some rest, because I'm making mistakes.

Thank you for the fast reply! All is good now!

Would be nice if the crash report could give the magic key combo, but I assume that's in the SwissMicros firmware?

Also, out of curiosity, what does the PGM microswitch inside (below the RESET switch) do? I didn't want to press it and get into a worse state, but it was tempting. ;-)
Find all posts by this user
Quote this message in a reply
11-12-2024, 05:59 PM (This post was last modified: 11-12-2024 06:00 PM by c3d.)
Post: #430
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 01:25 PM)Dashier Wrote:  
(11-12-2024 12:54 PM)c3d Wrote:  Aaaargh, shoot. You need to hold the F1 key while pressing the reset button on the back (you will need a paper clip or something like that). Then load the program, and it should be fine.

The problem is that the two versions, 0.8.4 and 0.8.5, are close enough that the existing DMCP checksum mechanism does not bring you back to the "load PGM" menu. Instead, after you upgraded the QSPI, it ran the 0.8.4 on it and there is an address mismatch that causes the crash. I hit that all the time during development, and I had not realized this would be a problem for the 0.8.4 and 0.8.5 releases. Sorry.

In any case, no your calculator is not broken. Just load the new PGM file and you should be good.

I need to implement a stronger checksum mechanism to avoid that scenario. And to take some rest, because I'm making mistakes.

Thank you for the fast reply! All is good now!

Would be nice if the crash report could give the magic key combo, but I assume that's in the SwissMicros firmware?

Also, out of curiosity, what does the PGM microswitch inside (below the RESET switch) do? I didn't want to press it and get into a worse state, but it was tempting. ;-)

IIUC it's to reflash the operating system itself (what SwissMicros calls bootloader mode). It's something I have not used so far.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
11-12-2024, 07:44 PM (This post was last modified: 11-12-2024 07:52 PM by grbrum.)
Post: #431
CONVERT bug
Hello Christophe. I had a bug with convert function.

this simple example:
1_m/min
1_ft/s
I run << CONVERT >> from the CAT

I get correct result = 0.05468....
I get error: "Convert Error: Too few arguments"

if I run << CONVERT >> from CONV menu (2shift 5) I don't get errors.

running 0.8.3 (i did not have opportunity to install the latest version, but I read the change notes and did not see if this was reported before).


PS, I had another bug that I am trying to reproduce.
It went something like: I had a simple unit in stack, maybe other units were there as well.
such as 1_m/min

I added a name variable (I remember clearly being 'a') then I don't remember if I entered or direclty clicked STO.
the result was that all levels of the stack were populated by a. I had to restore the state file.
If I can replicate the bug I will post here.

thank you.
Find all posts by this user
Quote this message in a reply
11-12-2024, 08:00 PM
Post: #432
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 07:44 PM)grbrum Wrote:  this simple example:
1_m/min
1_ft/s
I run << CONVERT >> from the CAT

I get correct result = 0.05468....
I get error: "Convert Error: Too few arguments"

if I run << CONVERT >> from CONV menu (2shift 5) I don't get errors.

running 0.8.3 (i did not have opportunity to install the latest version, but I read the change notes and did not see if this was reported before).

With 0.8.5 this error does not occur.
Find all posts by this user
Quote this message in a reply
11-12-2024, 10:34 PM
Post: #433
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 07:44 PM)grbrum Wrote:  Hello Christophe. I had a bug with convert function.

this simple example:
1_m/min
1_ft/s
I run << CONVERT >> from the CAT

I get correct result = 0.05468....
I get error: "Convert Error: Too few arguments"

if I run << CONVERT >> from CONV menu (2shift 5) I don't get errors.

running 0.8.3 (i did not have opportunity to install the latest version, but I read the change notes and did not see if this was reported before).

This may not be obvious, but in my opinion this is most likely this one from the release note:

* Fix a problem when a garbage collection while parsing a fraction could cause a large fraction of the subsequent program to be skipped. This normally led to anomalous `Inconsistent units` messages when this caused a unit such as `254/10_mm` for `in` to be incorrectly parsed as `254/10`.

Because the problem was a maladjusted pointer, other symptoms were possible.

Quote:PS, I had another bug that I am trying to reproduce.
It went something like: I had a simple unit in stack, maybe other units were there as well.
such as 1_m/min

I added a name variable (I remember clearly being 'a') then I don't remember if I entered or direclty clicked STO.
the result was that all levels of the stack were populated by a. I had to restore the state file.
If I can replicate the bug I will post here.

thank you.

This one is extremely weird. I hope that you can replicate to give me a chance to fix it.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
11-12-2024, 10:47 PM
Post: #434
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 12:54 PM)c3d Wrote:  And to take some rest, because I'm making mistakes.

Sleep well, knowing that what you've so far created out of sleeplessness is new hope for RPL enthusiasts! A calculator that in many ways truly is better than the RPL legends we consider to be the best calculators in existence.
Find all posts by this user
Quote this message in a reply
11-12-2024, 11:17 PM
Post: #435
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 11:08 AM)c3d Wrote:  
(11-12-2024 09:50 AM)raprism Wrote:  Thanks for the hint to [EEX] cycling. Is this cycle configurable? Just because µ is missing, and M and G is in some fields (concentrations, amount of substance, ... in chemistry) rarely used.

Not yet configurable, but since you asked...

The easiest way to make it configurable would be with a special variable. That would also make it per-directory, which may be convenient.

So what about adding a 'UnitSIPrefixCycle' special variable containing a text with the desired sequence of SI prefixes, e.g. "cmKµ" would cycle between these four? Would that work? (Of course there is the pesky case of "da"...)

And while I'm at it, I could add a `UnitsCycle` containing a list describing unit cycles, that would work like the one in `units.csv` with the additional benefit of being per-directory.

Having it per directory seems more and more useful the more I think about it. Astronomy has different lengths from mechanical engineering has it different from crystallography.

But I think it may be even more useful to define the prefix cycle per unit - many units are generally used with limited and different ranges of prefixes. pF, nF, µF and that's all but the very extreme cases, then KiB, MiB, GiB, TiB, PiB, which may be a bit of a long list for cycling through so I might skip the top end depending on what I'm doing... yeah, I already have a use-case for having this too per directory, even though I was thinking this gets so large it should probably be relegated to config file.

This entire feature is a bit of a cherry on top. RPL was already the best for calculations with units and this is even better.
Find all posts by this user
Quote this message in a reply
11-16-2024, 11:04 AM
Post: #436
RE: DB48X: HP48-like RPL implementation for DM42
(11-12-2024 11:50 AM)raprism Wrote:  
(11-12-2024 11:11 AM)c3d Wrote:  An alternative would be to accept 'u' as a SI prefix for micro.

'u' would clash with 'u' unit, when straightly inserting '1_u'. Not sure, if something like '1_u:' to mark a prefix input would be better. Because there is 'da', one could think about 'mu', too.

Everything else sounds fine for me.

My assumption was wrong that only a prefix can be inserted. I saw in dev that this stupid slip was corrected in some relevant log message.

The unit cycling during input mode currently (todays dev) does only work with single letters, but not with multiletter units or e.g. Ω or °.
Find all posts by this user
Quote this message in a reply
11-16-2024, 11:13 AM
Post: #437
RE: DB48X: HP48-like RPL implementation for DM42
Is there a possibility to call Edit action of stack menu programmatically with input of var name?

Then it might be possible to create a Cst Entry EDIT to modify any variable name (like 'CST' itself ...) in any directory, edit it directly and saving it automatically in current directory (either overwriting or creating a new one, if original variable was looked up at higher directory levels).
Find all posts by this user
Quote this message in a reply
11-16-2024, 11:23 AM (This post was last modified: 11-16-2024 11:24 AM by raprism.)
Post: #438
RE: DB48X: HP48-like RPL implementation for DM42
If there is an error on DM42, EXIT kills the error state / message rather immediately. If I use the simulator on Linux (made with make sim with libraries similar to current fedora setups) I have to wait 30 seconds to be able to kill this error state (with message). How to disable this ineffective behaviour? Or is it problem not occuring on Mac or Windows?
Find all posts by this user
Quote this message in a reply
11-17-2024, 02:03 AM
Post: #439
RE: DB48X: HP48-like RPL implementation for DM42
(11-16-2024 11:23 AM)raprism Wrote:  If there is an error on DM42, EXIT kills the error state / message rather immediately. If I use the simulator on Linux (made with make sim with libraries similar to current fedora setups) I have to wait 30 seconds to be able to kill this error state (with message). How to disable this ineffective behaviour? Or is it problem not occuring on Mac or Windows?

There is a sound configuration problem causing Qt to not be able to play sound correctly in some cases, but take forever to fail. That sounds very similar to what you describe.

If that's what it is, just using the setup or UI menu to disable beep (you can use screen flash as an alternative) should fix the problem for you.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
11-17-2024, 02:14 AM
Post: #440
RE: DB48X: HP48-like RPL implementation for DM42
(11-16-2024 11:04 AM)raprism Wrote:  
(11-12-2024 11:50 AM)raprism Wrote:  'u' would clash with 'u' unit, when straightly inserting '1_u'. Not sure, if something like '1_u:' to mark a prefix input would be better. Because there is 'da', one could think about 'mu', too.

Everything else sounds fine for me.

My assumption was wrong that only a prefix can be inserted. I saw in dev that this stupid slip was corrected in some relevant log message.

The unit cycling during input mode currently (todays dev) does only work with single letters, but not with multiletter units or e.g. Ω or °.

Should be fixed on dev now.

DB48X,HP,me
Find all posts by this user
Quote this message in a reply
Post Reply 




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