PDA

View Full Version : calculator for s620


ghostwheel
6th April 2008, 06:39 PM
If I'm already releasing alpha software, why not this one, too...

SEE BUG REPORT AT END.

Here is a calculator for the dash. The idea is similar to Lygea 123 and 1-calc for the s620, in that it displays a replacement keyboard on the screen. This way one can use our dash almost like any other scientific calculator. Why did I make this one when the other two already exist?
Lygea 123 is not a scientific calculator, but instead just a financial/business calculator, so it didn't have the features I wanted. And I didn't like the interface of 1-calc....

It is very rough, and I'm sure has some bugs. But it is quite usable - it is the calculator that I use. The problem is that I don't have time to work on it now, but I think people might already enjoy it!

It might be a bit strange to use - it is a mixture of infix and prefix. You can use it as a regular calculator if you like, and everything should work as expected.

Here is an example of how it can be used:
say you want to calculate
2*sin(40+35)
you enter: 2 * sin ( 40 + 35 ) =
you can also enter: 2 * ( 40 + 35 ) sin =
(which would be like a regular calculator - infix)

to calculate sin(60) you can enter
60 sin =
or
sin 60 =

to calculate 1/4 +3 you can type
[1/x] 4 + 3 =
or
4 [1/x] + 3 =

Notice that because of this strange way to calculate things, the result of 4 [1/x] is only displayed when you type '+'. (maybe a later version will not have this 'problem')

the button 'ANS' recalls the last answer (the result of the last time '=' was pressed)

There is now prelimnary unit conversion. It isn't really optimal. What I'd really like is to be able to do
1 [m] + 3 [feet] =

Currently, it just switches the current number displayed. So to convert m to inches, do this:
2.5 [m] [inch]

To switch to unit conversion mode, press right. To switch back, press left.


To store in a memory location, hit STO, and then write the location. Valid locations are 0..99
memory locations 0..9 are displayed under the respective key.
STO+ STO- STO* STO/ do operations on those locations.
example:
1+4 = [STO] 9 =
memory location 9 now contains 5.
You can also do operations while doing calculations.

34 + 60 [STO] 3 =
displays 94, and 60 is stored in memory location 3.

To recall simply hit recall, and the location
34 [STO] 3 =
5 + [RCL] 3 * 9 + [RCL] 3 =
should give
5 + 34 * 9 + 34, i.e. 345.

The calculator still does not remember things across separate invocations.....


################################################
BUG:
There currently is a problem with using the calculator postfix.
So you can calculate
sin(60) by typing
60 sin =
or
sin 60 =
But there are problems with using two operations postfix.
sin(60^2) will give the wrong result if done like this:
60 [x^2] sin
but the right result if done like this:
sin [x^2] 60

So for now, if you envoke multiple functions in a row, use prefix - type the function before the operand.

This is especially annoying for RC, for doing calculations on stored values.
You have to type
sin RCL 2
and not
RCL 2 sin




------------------
update: now a cab file is available! And, new version will run only one instance at time.
------------------
update: keys have the letters on them now. Also moved keys a bit. Now / and * are in the right place.
------------------
update:
1. added a few functions (factorial, n choose k)
2. added deg-rad-grad for trigonometric functions. Switch between them with up-down
3. added preliminary unit conversion. Celsius<->Fahrenheit.
4. added preliminary unit conversion for lengths and weights. Switch between modes using left-right.
------------------
update: v2.01
The two current ugliest bugs fixed:
keys don't wander down any more on a long press (I kinda liked it...)
Pressing * twice doesn't crash any more.
In addition, a small change: You can leave the shift (yellow key) pressed when pressing another key. In this case the alternate
function is used, but the keys do not remained shifted. Pressing only shift leaves it locked.
------------------
update: v2.02
made a bit more stable. Can now calculate up to 170 factorial. Log window scrolls.
------------------
update: v2.03
Added memory functions.
To store in a memory location, hit STO, and then write the location. Valid locations are 0..99
memory locations 0..9 are displayed under the respective key.
STO+ STO- STO* STO/ do operations on those locations.
To recall, hit RCL, and then location.
------------------
update: v2.031: small cosmetic change.

littleclown
6th April 2008, 11:05 PM
I wll test it tomorrow. Good point anyway :).

ghostwheel
7th April 2008, 10:30 AM
I uploaded new file: now it is a cab file.

And, now if program is running, it will be brought into the foreground when run again (instead of running a 2nd version).

littleclown
7th April 2008, 11:10 AM
I tried, Its hard to use it coz I am not sure what button what does.
/ is the simbol on my key, but in your calc is * - why?
And when I hit * twice I have some error exepton

ghostwheel
7th April 2008, 11:20 AM
I tried, Its hard to use it coz I am not sure what button what does.

The layout on screen is supposed to be identical to the layout of the s620 keyboard. So don't look at the keyboard, only at the screen.

/ is the simbol on my key, but in your calc is * - why?

Here I'm not sure what is better. If you really look only at the screen, and not at the keys, then my layout is better, because then the keys are in logical places - otherwise '-' would be somewhere on the right, '*' at the bottom-left.

But I also get confused by the '*' vs. '/' key. Maybe I'll just switch them in the layout....



And when I hit * twice I have some error exepton
This is a bug....

littleclown
7th April 2008, 01:17 PM
Dude... its so no-user-friendly :).
In many situation I must count buttons from left to right and to right to left to find my button - you may know it, put for new users is some kind of hell :).

Can you combine this with cursor, to control with narrows some sqare to select buttons?

qaplus
7th April 2008, 03:26 PM
This is good idea to utilize Dash's keyboard, but counting which key to use makes it much harder then necessary. I suggest you can display keyboard letters on screen, in a small font or in background. It will make key-hunting much easier.

ghostwheel
7th April 2008, 05:40 PM
You are right, I'll try to add little letters to the buttons.
In the meantime - here is a hint: the numbers and the left black column are really no problem. The only problem are the middle block black of keys, such as
sin cos tan
x^2 exp 10^x

For these, you can use the top row as guides: + ( ) are all in the right place....

Profezza
7th April 2008, 07:00 PM
Very useful looking! The mental reinforcement of the glowing letters/symbols on the keypad is just too much for me to overcome, though. :D

Having '=' mapped to space is very practical, but I want to press enter. Are you up for feature requests? A base converter on one of the yet unused keys would be outstanding. bin/hex/dec? OF course, then you'd need more numeral keys... hmmm.

Or, it could be skinnable/mappable. Some shiny .png buttons, remapping options, and you would probably have the #1 Smartphone Calc. No, you definitely would.

ghostwheel
7th April 2008, 09:37 PM
I added labels with the letter to each key. This is not read from key mapping, though, so it only works correctly for QWERTY keyboard. I also moved the keys around a bit, so now / and * are in the right place.

What's the best way to read the keyboard mapping?

qaplus
7th April 2008, 10:42 PM
Much better now! Do you have time to add Memory functions and some basic unit conversion functions?

The following is a tiny calculator I wrote many years ago for REX6000. Still have that baby in my wallet today :)

http://home.comcast.net/~ceciliachen/UnitCalc/UnitCalcFace.bmp

ghostwheel
8th April 2008, 12:01 AM
Much better now! Do you have time to add Memory functions and some basic unit conversion functions?

The following is a tiny calculator I wrote many years ago for REX6000. Still have that baby in my wallet today :)

http://home.comcast.net/~ceciliachen/UnitCalc/UnitCalcFace.bmp

Wow! That is really cool! I got my wife a Rex for her birthday many years ago. Why don't they make this form factor any more? It was perfect!
Her second one died just last year :(
That's a cool calculator! If it had been my Rex, I would have installed it ;)

ghostwheel
9th April 2008, 05:23 AM
Due to popular demand, I added unit conversions. I'm still not quite happy with the result. But I'm not quite sure how it should be done.
The best would be to be able to do
1 [m] + 3 [inch] =
and then pressing [feet] will give the result in feet.
This doesn't work now.

For now, just do unit conversion on the result of calculations... not during calculations.

So, you can do
1.54 [inch][m]

or
2 + 4*6 = [feet][km]

To switch to conversion mode, press [right].
See first post for other changes.

Profezza
9th April 2008, 08:13 AM
Bugs:
The yellow square creeps down the screen if you hold alt. Fixes on relaunch.

The numeral keys do this as well.

Pressing + twice with no entry causes an exception.

This appears to happen with the * key as well.

Soft Key labels do not take Windows Button appearance. ;)

---------------------
I really like the speed with which I can get to everything. Switching to units mode is elegant and going to be very handy at work, thanks!

I am curious as to why the temp conversion is on the scientific functions page rather than the units page.

May I make more requests? Automatic save on exit of last page used would be handy. Perhaps the Alt key should say alt and flash when clicked instead of movingMaking the ! match its keyboard location would be nice, I guess, too.

ghostwheel
9th April 2008, 10:36 AM
Bugs:
The yellow square creeps down the screen if you hold alt. Fixes on relaunch.

The numeral keys do this as well.

This was quite ugly. I liked the fact that the program still worked correctly, but with a crooked keyboard...

Fixed now

Pressing + twice with no entry causes an exception.

This appears to happen with the * key as well.


This is also fixed. Now you can correct your last operation.
3 [+] 2 =
gives 6.

Soft Key labels do not take Windows Button appearance. ;)

This I don't understand. Do you mean that the shift key is not trapesoidal, like on the keyboard? Or that the key labels (i.e. the blue letters) don't move down?


I am curious as to why the temp conversion is on the scientific functions page rather than the units page.

Simply ugly programming. First I just made a F->C and C->F button like qaplus' REX6000 program. Then I added my style of units as a different function.
But there is a problem that if I want the following to work later, then
3[m] - 2[mm] =
makes sense. But
98 F - 32 F =
is something special. It is not degrees F any more, but instead a difference between degrees, in F.
So
99 [F] - 90 [F] =
[C]
should eventually show a difference of 5 degrees C, and not
9 degrees F converted to C, which is (-12.777) degrees C.


Perhaps the Alt key should say alt and flash when clicked instead of moving

It could say alt. Though on my keyboard, it is labeled FN (I have a dopod). But why flash instead of moving?
If you mean that the change shouldn't be permanent (i.e. not shift-lock), then now there are two ways to use shift:
press and hold, and press another key will not lock, just do the alternate function. Press and release shift with no interveaning keypress will lock the shift state.


Making the ! match its keyboard location would be nice, I guess, too.
This will come later, when instead of ln, exp, log, 10^, log2, 2^, I will have just one key, and you can switch the log base as you do now with rad-grad-deg.
Currently I like that they are all together.

Profezza
10th April 2008, 05:09 AM
This was quite ugly. I liked the fact that the program still worked correctly, but with a crooked keyboard...

Fixed now

This is also fixed. Now you can correct your last operation.
3 [+] 2 =
gives 6.

This I don't understand. Do you mean that the shift key is not trapesoidal, like on the keyboard? Or that the key labels (i.e. the blue letters) don't move down?

That was fast! I was making a lighthearted reference to the fact that the bottom-of-screen captions for the "soft keys", meaning the two above the home and back <- keys, don't have the shiney/glowie look that they do in the native OS screens.

I imagine this is related to the software you are developing in, and not really important anyway.



should eventually show a difference of 5 degrees C, and not
9 degrees F converted to C, which is (-12.777) degrees C.


Sounds like it will be really handy for doing several rapid temp related tasks! K would be nice too, if you can find space for it. :)



It could say alt. Though on my keyboard, it is labeled FN (I have a dopod). But why flash instead of moving?

I was just thinking of other ways to communicate it's state, I didn't realize you would be able to stop the creep-bug so fast.


If you mean that the change shouldn't be permanent (i.e. not shift-lock), then now there are two ways to use shift:
press and hold, and press another key will not lock, just do the alternate function. Press and release shift with no intervening keypress will lock the shift state.


That sounds consistent with xt9, so perfect to our existing habits.



This will come later, when instead of ln, exp, log, 10^, log2, 2^, I will have just one key, and you can switch the log base as you do now with rad-grad-deg.
Currently I like that they are all together.

Then, I will keep watching on this thread for updates. I already am using it a bit in work and home Thanks!

Profezza
10th April 2008, 05:17 PM
FYI: It works perfectly with 6.1, but throws an alert on install. "made for older version, blah blah..."

fer1962
10th April 2008, 08:25 PM
Very very good job gentelman....!!!!!!!!!!!!!

qaplus
11th April 2008, 05:58 AM
nice job! thanks!

Let me try it for several days before posting feedback/requests :)

Xka
18th December 2009, 05:21 AM
sorry for hang from your post. But will there be a financial calculator like the HP 17BII for 19bii for use with the S620?

ghostwheel
18th December 2009, 06:12 AM
sorry for hang from your post. But will there be a financial calculator like the HP 17BII for 19bii for use with the S620?

I'm not sure. Have you tried the ones at http://www.3grtech.com/Windows-mobile-Smartphone-software/ ? They have 10BII.

Xka
28th December 2009, 06:03 AM
I'm not sure. Have you tried the ones at http://www.3grtech.com/Windows-mobile-Smartphone-software/ ? They have 10BII.

I'll do, thanks. I'll tell you later. It is free?

HnAw
3rd January 2010, 03:41 AM
ghostwheel
you calc is the best calc that i used on dash until now,a favor you could add one line where the operation can be show?(like a casio calcs)

mobilis2009
3rd January 2010, 06:21 AM
Start using thousand thanks for the great job and improvements. :)

ghostwheel
3rd January 2010, 07:09 PM
ghostwheel
you calc is the best calc that i used on dash until now,a favor you could add one line where the operation can be show?(like a casio calcs)

Sure, I'll try. It'll take some time, though - I'm traveling.