Post Reply 
DB48X: HP48-like RPL implementation for DM42
09-07-2024, 12:21 AM (This post was last modified: 09-07-2024 12:22 AM by c3d.)
Post: #290
RE: DB48X: HP48-like RPL implementation for DM42
(09-06-2024 07:05 AM)ormandj Wrote:  I do a lot of calculations in computing and am trying to figure out how to use this functionality efficiently. An example common computation would be computing how long it would take to transfer 600TB at 10gbit/s. I’m struggling to enter these units directly. The unit menu doesn’t directly support these as you mentioned, and attempting to use alpha mode isn’t working for me “600 TB” ends up showing up as 600 in stack position 2, and TB in position 1.

The next release will add several common units directly to the Computing units menu that will make this much easier to enter. Notably, both TB, TiB and Gbit/s are now in the menu. This is tracked in issue #1163

As for entering "600TB", you should use the RPL unit separator, i.e. type 600_TB. The _ characters is F1 in the Units menu (shift 5). It does display on the stack as 600 TB for readability, but when you edit it, you will see that it edits as 600_TB.

Quote:I definitely think having the common units or even just a menu option that cycles through them after selecting the base unit in the unit menu would be wonderful. So in this case it could be 600 - unit - byte <press toggle button to cycle to TB>.

Agreeing on both counts. However, the Cycle command (the key corresponding to letter O, labeled EEX or x10^n depending on keyboard overlay) preserves the value, so it does not do exactly what you want. If you enter 600_B and cycle, you will get things like 6_hbyte, which is not exactly useful.

So I believe that I need to add two new behaviours:

- Value-preserving custom cycles for computing units when they are on the stack. Those would be value preserving, since this is generally the behaviour for "Cycle". But cycling through KB/KiB/MB/MiB/GB/GiB seems to make more sense than considering normal SI prefixes like cB or hB. This is a fairly minor change, since the infrastructure supporting custom unit cycles is already in place.

- A new behaviour for that same key when editing and after a unit. If you enter 1 and type this key, you get 1E or something equivalent, to enter powers of 10. But if you entered a unit, e.g. you typed 1_B, then it would make sense that it cycles the prefix without changing the associated numerical value, i.e. to get 1_KB or 1_MB. The logic for that is not in the current codebase, and needs to be added. This will take a little longer.

Quote: The complication would be the need to support both base2 and base10 forms, since both are used. Perhaps one cycle button for each form.

The current keyboard is crowded, so I tend to overload keys based on context. I would probably overload Cycle for that, as indicated above, meaning that the cycle would be something like KB/KiB/MB/MiB/GB/GiB. Question is whether it's better to have that or KB/MB/GB/KiB/MiB/GiB. Maybe the latter corresponds more to common usage.

Quote:If there is a way to do this already I’m not understanding I’d love to know it! Thank you for all of your time and effort on this project!

There is a way, which is to add a custom cycle to your units.csv. But since I'm likely to have added this for the next release, just asking for it on this list is probably faster ;-)

⚙️,?,?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
DB48X v0.4.8 is out - c3d - 10-22-2023, 11:31 PM
Release v0.5.0: Statistics and flags - c3d - 11-20-2023, 08:57 AM
v0.6.5: Minor bug fixes - c3d - 02-11-2024, 11:23 PM
Release 0.7.1 "Whip" - Bug fixes - c3d - 03-04-2024, 12:46 AM
DB48X v0.7.4 release is out - c3d - 04-14-2024, 03:05 PM
DB48X v0.7.6: Solving menu - c3d - 05-13-2024, 12:04 AM
DB48X v0.7.7: Units in solver - c3d - 06-02-2024, 11:36 PM
v0.7.10 - Interactive stack - c3d - 07-14-2024, 11:31 PM
DB48X v0.7.13 is out - c3d - 08-05-2024, 07:31 AM
RE: DB48X: HP48-like RPL implementation for DM42 - c3d - 09-07-2024 12:21 AM
DB48X v0.7.15 - c3d - 08-25-2024, 08:45 PM
DB48X v0.7.16 - c3d - 09-02-2024, 01:36 AM
DOSUBS command - grbrum - 09-04-2024, 03:37 PM
v0.7.18 - APPLY, SUBST, WHERE - c3d - 09-15-2024, 11:58 PM
Program Editing Question - spiff72 - Yesterday, 03:27 PM



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