Post Reply 
Units48 v1.0: units the 48 way
09-14-2018, 10:55 AM (This post was last modified: 10-30-2018 04:20 PM by Didier Lachieze.)
Post: #1
Units48 v1.0: units the 48 way
Leveraging the work done on Base48, Units48 is a small app to do units calculation the 48 way.

You'll find an environment with a stack, softkeys and similar function set.

After the Preview version, here is v1.0, fixing some bugs and adding support for more key functions.

One key point is that under Units48, the [Alpha] key is redefined to act as a second shift key, similar to the [Left Shift] key on the HP 48, while the [Blue Shift] key acts as the Right Shift on the HP 48. This enables units conversion with [Alpha] [unit soft key] the same way as it is done with [Left Shift] [unit soft key] on the HP 48.

Here is a list of the key functions supported under Units48:
  • Up key: main units menu
  • Left key: similar to Prev on the 48
  • Right key: similar to Next on the 48
  • [Blue Shift]: access to the keyboard keys shift functions, and similar to [Right Shift] for the soft keys
  • [Alpha]: similar to [Left Shift] for the soft keys
  • [Blue Shift][Units]: main units menu
  • [Alpha][Units]: tools menu
  • x^y, SIN, COS, Tan, LN, LOG,x^2, +/- keys: primary and shifted functions implemented
  • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, . , EEX keys: used for number input
  • [Blue Shift][3]: PI
  • [,]: swap the stack levels 1 and 2
  • ÷, x, -, + keys: standard operators
  • [Blue Shift][÷]: inverse
  • [Blue Shift][+]: either Undo or Import from Ans, depending on the app settings
  • Menu: either Import from Ans or Undo, depending on the app settings
  • Num: main app screen (to be used for ex. with the Home key to swap between Home and Units48)
  • [Blue Shift][Num]: app settings
  • [Blue Shift][App]: info about the app
  • Esc: exit the app
  • [Blue Shift][Esc]: clear the stack
    Added with v1.0:
  • [Toolbox]: subset of the Tool menu, with numeric functions that can be used within Units48
  • [Blue Shift][Esc]: clear the stack
  • [Apps], [Apps Info], [Home], [Home Settings], [Mem], [List], [Matrix], [Program], [Notes]: work as expected (press Num to return to Units48)

There is no documentation yet (you can refer to the Base48 documentation for the settings and import/export mechanism). Please report any bug found or any improvement you would like to see implemented.

Note1: one change from Base48 is that by default the latest stack level1 value is stored in the Home Ans and is available when you exit the app. This can be changed in the app settings.

Note2: the user key program to retrieve the app stack in RPN mode is slightly different from the one published in the Base48 documentation. Here is the updated one compatible with both Base48 and Units48:
Code:
KEY KS_Plus()
BEGIN
IF Entry==2 THEN
  RETURN ΣLIST(REVERSE(EXECON("STRING(&1)+\" \"",Stack)));
ELSE
  RETURN Ans;
END;
END;


Attached File(s) Thumbnail(s)
       

.zip  Units48_v1.0.zip (Size: 14.4 KB / Downloads: 216)
Find all posts by this user
Quote this message in a reply
09-14-2018, 12:33 PM (This post was last modified: 09-14-2018 12:34 PM by ekeppel.)
Post: #2
RE: Units48 Preview: units the 48 way
Very nice! It definitely speeds up conversions, which is what I tend to do a lot of. I wish it was easier with the Prime's built-in functions, but in my opinion doing it their way involves a lot of keystrokes. In RPN mode, converting 5 of one unit to another is: [5] [Shift] [Units] [Soft menu-Units] [Soft menu-Drill down and select FROM unit] [Enter] [Shift] [Units] [Soft menu-Drill down and select TO unit] [Enter] [Shift] [Unit] [Soft menu-Tools] [Convert] [Enter]. And if I want to also convert that same quantity to another unit, I have to go through much of that all over again. There isn't a simple [Shift] [Unit soft key] to hop between units on the fly as is possible in Units48 or on the 48/50 series calcs. :-(

Your app brings things back around to nearer to what I'm used to seeing on the 50g, which is about as efficient as it gets without dedicated unit keys like the 35s has. Thanks!

--

On the topic of unit conversion, does anyone know why Length and Energy are missing their key shortcuts in the Prime's [Units] soft menu? It would be nice to be able to enter [Shift] [Units] [2] [2] to get centimeters, for example, as is possible with most of the other unit types.

Eric
Find all posts by this user
Quote this message in a reply
09-15-2018, 07:12 AM
Post: #3
RE: Units48 Preview: units the 48 way
Excellent Didier! Thank you very much for such an excellent application, it was something very expected that could have the HP Prime and for some reason the conversion of units made it complicated in a native way, but now with your application it is super easy to make the conversions practically the same as in the series HP 48 and the HP 50g. I congratulate you and keep improving, and if I find an error or bug I will let you know so that you can correct it in future updates.

Thank you....!!!
Find all posts by this user
Quote this message in a reply
09-16-2018, 06:47 AM
Post: #4
RE: Units48 Preview: units the 48 way
Is there any way to put the command line in another color? Can it be changed with any parameter or color command?
Find all posts by this user
Quote this message in a reply
09-16-2018, 06:54 AM
Post: #5
RE: Units48 Preview: units the 48 way
Not currently. Why would you do that?
Find all posts by this user
Quote this message in a reply
09-16-2018, 11:07 AM
Post: #6
RE: Units48 Preview: units the 48 way
Hello Didier,
uau! that change my opinion on units Handling on the Prime and remind me my beloved 48!

Thanks for putting this incredible amount of work together.

Giancarlo
Find all posts by this user
Quote this message in a reply
10-26-2018, 10:13 PM
Post: #7
RE: Units48 Preview: units the 48 way
great app, thank you very much.



(09-14-2018 12:33 PM)ekeppel Wrote:  On the topic of unit conversion, does anyone know why Length and Energy are missing their key shortcuts in the Prime's [Units] soft menu? It would be nice to be able to enter [Shift] [Units] [2] [2] to get centimeters, for example, as is possible with most of the other unit types.

It looks like only dimensions with 16 units choices or less get key shortcuts, to fit in the 4x4 key area bounded by keys '7' & '+'.

Cambridge, UK
41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot/C47
Casio, Rockwell 18R
Find all posts by this user
Quote this message in a reply
10-30-2018, 04:24 PM
Post: #8
RE: Units48 v1.0: units the 48 way
Replacing the preview version I've updated the first post with v1.0 which includes a few bug fixes and new functions:
  • [Toolbox]: subset of the Tool menu, with numeric functions that can be used within Units48
  • [Blue Shift][Esc]: clear the stack
  • [Apps], [Apps Info], [Home], [Home Settings], [Mem], [List], [Matrix], [Program], [Notes]: work as expected (press Num to return to Units48)
Find all posts by this user
Quote this message in a reply
10-30-2018, 06:10 PM
Post: #9
RE: Units48 v1.0: units the 48 way
(10-30-2018 04:24 PM)Didier Lachieze Wrote:  Replacing the preview version I've updated the first post with v1.0 which includes a few bug fixes and new functions:

Thanks for sharing Didier, another good reason to use my Prime more often! That makes several good reasons from you. While the Prime forums abound with spellbinding code about finding the 11th Prime that is also a secondary root of this or that, I find general-purpose tools like Base48 and Units48 more to my liking. But no offense meant to those folks that like to make and read the spellbinding kinds of things noted above.

Small suggestion: when distributing in a .zip file (and btw thx for that) please also include a small text file with core documentation - nothing fancy, even just copy/paste the text from the post is good enough. This makes it easier to download something and then have it all together in one file rather than either printing the post or having to copy/paste the post body to a text file and save along with the .zip file (or even insert it into).

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
01-19-2019, 11:56 PM (This post was last modified: 01-19-2019 11:59 PM by cdmackay.)
Post: #10
RE: Units48 v1.0: units the 48 way
great app, thanks.

trivial typo; just noticed that in the Info view it says Unit38

if you're doing a future version, please consider putting the help crib from the first post into the app help? thank you…

Cambridge, UK
41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot/C47
Casio, Rockwell 18R
Find all posts by this user
Quote this message in a reply
12-02-2019, 02:35 AM
Post: #11
RE: Units48 v1.0: units the 48 way
This is a such a great tool!!! Just what I needed to make me *almost* (but not quite) forget my HP50G. Thank you very much!!!
Find all posts by this user
Quote this message in a reply
10-21-2020, 05:43 PM
Post: #12
RE: Units48 v1.0: units the 48 way
Really like this app! It gets me around the inability to assign programs (in RPL) to a softkey like I could on the 50g. :-)

One observation - it appears that when I leave this app running (in the "foreground"?), the calculator never seems to do the auto power-off. Mine is set for 5 minutes (using the TOff variable set to 300000 milliseconds). The dimming does work after 30 seconds, but power off after 5 minutes does not.

Any idea why this might be the case? I have the latest firmware on my Prime (a G2 model). If I press the Home button or the CAS button to exit out of the app, auto power off seems to work fine.

Just curious if anyone else has noticed this, or if it is just me.

Thanks!
Find all posts by this user
Quote this message in a reply
10-21-2020, 06:16 PM
Post: #13
RE: Units48 v1.0: units the 48 way
(10-21-2020 05:43 PM)spiff72 Wrote:  Really like this app! It gets me around the inability to assign programs (in RPL) to a softkey like I could on the 50g. :-)

One observation - it appears that when I leave this app running (in the "foreground"?), the calculator never seems to do the auto power-off. Mine is set for 5 minutes (using the TOff variable set to 300000 milliseconds). The dimming does work after 30 seconds, but power off after 5 minutes does not.

Any idea why this might be the case? I have the latest firmware on my Prime (a G2 model). If I press the Home button or the CAS button to exit out of the app, auto power off seems to work fine.

Just curious if anyone else has noticed this, or if it is just me.

Thanks!

To add to the mystery, I find that when I leave the Units48 app running and more than 5 minutes have passed since I interacted with it (screen will be dimmed, but not off), if I press the "On" button to brighten the screen back up, the calculator immediately shuts off. When I power it back up, it is back at my home screen (or possibly the last screen I was using prior to using Units48 - could be CAS screen then, also).

I can't confirm if ANY keypress makes it turn off when in the above state, but the On key definitely does...

Thanks!
Find all posts by this user
Quote this message in a reply
10-21-2020, 06:40 PM (This post was last modified: 10-21-2020 06:41 PM by Didier Lachieze.)
Post: #14
RE: Units48 v1.0: units the 48 way
(10-21-2020 06:16 PM)spiff72 Wrote:  One observation - it appears that when I leave this app running (in the "foreground"?), the calculator never seems to do the auto power-off.
[...]
Any idea why this might be the case?

This is normal because while a program is running the Prime doesn't power-off.

(10-21-2020 06:16 PM)spiff72 Wrote:  To add to the mystery, I find that when I leave the Units48 app running and more than 5 minutes have passed since I interacted with it (screen will be dimmed, but not off), if I press the "On" button to brighten the screen back up, the calculator immediately shuts off.

Pressing "On" exits the Units48 program, then the Prime OS detects that the TOff counter is over and so it shuts off.
Find all posts by this user
Quote this message in a reply
10-21-2020, 08:35 PM
Post: #15
RE: Units48 v1.0: units the 48 way
(10-21-2020 06:40 PM)Didier Lachieze Wrote:  
(10-21-2020 06:16 PM)spiff72 Wrote:  One observation - it appears that when I leave this app running (in the "foreground"?), the calculator never seems to do the auto power-off.
[...]
Any idea why this might be the case?

This is normal because while a program is running the Prime doesn't power-off.

(10-21-2020 06:16 PM)spiff72 Wrote:  To add to the mystery, I find that when I leave the Units48 app running and more than 5 minutes have passed since I interacted with it (screen will be dimmed, but not off), if I press the "On" button to brighten the screen back up, the calculator immediately shuts off.

Pressing "On" exits the Units48 program, then the Prime OS detects that the TOff counter is over and so it shuts off.

Ah OK - that makes sense then. I just have to remember to exit the app when I am done using it then so I don't run down the battery.
Find all posts by this user
Quote this message in a reply
02-23-2021, 05:14 AM
Post: #16
RE: Units48 v1.0: units the 48 way
Thanks for the application. I have the G2 calculator, but the program does not work, do not convert, please the following image, I do not understand why the division sign appears. only the conversion works with some units but there are few that work. Thanks for the help. green color does the conversion well, and red color does not do the conversion. thanks.

   
Find all posts by this user
Quote this message in a reply
02-23-2021, 01:55 PM (This post was last modified: 02-23-2021 01:55 PM by Didier Lachieze.)
Post: #17
RE: Units48 v1.0: units the 48 way
Hi, I don't have a G2, just a G1 and the virtual Prime on Windows and Android.
Can you explain exactly what operations you want to do? with the attached screenshot I don't know which value you entered and which units you want to convert to.
Find all posts by this user
Quote this message in a reply
03-23-2021, 09:33 PM
Post: #18
RE: Units48 v1.0: units the 48 way
Hello,

Is there a way to "customize" this at all?

As an example, if I want to convert torque values frequently (in-lbf to N-m or ft-lbf), can there be a "torque" softkey that lists some typical torque units? Currenly I have to create them manually by entering number, go to next page of softkeys, choose the "Force" softkey, pick N, then back out to the main units menu, select "Length", select m, and then repeat the process for a value of 1 ft-lbf, and use alpha-units tools menu and the convert softkey.

Just curious if this is feasible.

Thanks!
Find all posts by this user
Quote this message in a reply
03-24-2021, 02:19 AM
Post: #19
RE: Units48 v1.0: units the 48 way
(03-23-2021 09:33 PM)spiff72 Wrote:  Hello,

Is there a way to "customize" this at all?

As an example, if I want to convert torque values frequently (in-lbf to N-m or ft-lbf), can there be a "torque" softkey that lists some typical torque units? Currenly I have to create them manually by entering number, go to next page of softkeys, choose the "Force" softkey, pick N, then back out to the main units menu, select "Length", select m, and then repeat the process for a value of 1 ft-lbf, and use alpha-units tools menu and the convert softkey.

Just curious if this is feasible.

Thanks!

I put together a very simple (as in few keystrokes) units program that can be easily edited by users to add their own units:

https://www.hpmuseum.org/forum/thread-16518.html

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
03-24-2021, 05:59 PM
Post: #20
RE: Units48 v1.0: units the 48 way
(03-23-2021 09:33 PM)spiff72 Wrote:  Is there a way to "customize" this at all?

No, there is no simple way other than modifying the source code of the app.
Find all posts by this user
Quote this message in a reply
Post Reply 




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