GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Simple calculator by minacode · Pull Request #1483 · InfiniTimeOrg/InfiniTime Conversation
|
|
I feel like the original design from #375 was simpler and cleaner, the multifunctional +/- and */ buttons might be too much of a hassle for regular use. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
About the printing of the value, I think that doing something like what's done here should be fine:
Edit: looking at the code, seems like you're already using something like this. I would say that it would be better to use fixed width integers instead of long ints, so that it's obvious what the min and max values are. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@joseph58tech, you mean the design with two keyboard layers? @FintasticMan, I can change |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
You can either leave the format string as |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
This looks amazing, thanks for making it! The UI looks really nicely designed with a good balance of button size and ability to do most of the major operations you would need. Personally I prefer the simplicity of this app though I see advantages in both. I also love the inclusion of I would love to one of the calculator apps merged in an upcoming release and I'll probably be using it on my PT until then. It feels like the biggest thing currently "missing" from the PineTime to me. Along with the usefulness of having a calculator close by, a small part of that is probably from reminiscing about these calculator watches from childhood, haha. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you! 😊 Nice to hear that you want to try it already. This may help with finding any eventual bugs. I haven't tried the last two commits on my watch because I have another test build running right now. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looks good, I've tried this on my watch and it works quite nicely. I do think that it is better to use floats rather than doubles for the pow calculation. Why did you switch to doubles? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks! I thought I had worked through all the replacements of float for double. Where did you find a double?
From: ***@***.***>
Sent: Monday, December 12, 2022 4:44 PM
To: ***@***.***>
Cc: ***@***.***>
Subject: Re: [InfiniTimeOrg/InfiniTime] Simple calculator (PR #1483)
Looks good, I've tried this on my watch and it works quite nicely. I do think that it is better to use floats rather than doubles for the pow calculation. Why did you switch to doubles?
—
Reply to this email directly, view it on GitHub<#1483 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A3C6AGUV6STVDJILC6TNB23WM6TD3ANCNFSM6AAAAAASYQQYU4>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I thought that double matches the 64-bit integers better than float. Is that correct? 🤔 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I switched to floats instead of doubles to see if the compiler would make use of the FPU. And I was very pleased to see big performance increase (something like 10x). So I assume the FPU is in use.
From: Max ***@***.***>
Sent: Monday, December 12, 2022 5:22 PM
To: ***@***.***>
Cc: ***@***.***>; ***@***.***>
Subject: Re: [InfiniTimeOrg/InfiniTime] Simple calculator (PR #1483)
I thought that double matches the 64-bit integers better than float. Is that correct? 🤔
The workaround is necessary because I wanted to have a power function and could not find one the works with the fixed point numbers. Speed should be no concern for one calculation.
—
Reply to this email directly, view it on GitHub<#1483 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A3C6AGUHY7CZYVJSGQM3CE3WM6XR7ANCNFSM6AAAAAASYQQYU4>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Oh, and the datasheet specifies that the FPU is restricted to float.
From: Max ***@***.***>
Sent: Monday, December 12, 2022 5:22 PM
To: ***@***.***>
Cc: ***@***.***>; ***@***.***>
Subject: Re: [InfiniTimeOrg/InfiniTime] Simple calculator (PR #1483)
I thought that double matches the 64-bit integers better than float. Is that correct? 🤔
The workaround is necessary because I wanted to have a power function and could not find one the works with the fixed point numbers. Speed should be no concern for one calculation.
—
Reply to this email directly, view it on GitHub<#1483 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A3C6AGUHY7CZYVJSGQM3CE3WM6XR7ANCNFSM6AAAAAASYQQYU4>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ok, I will test both types on the watch. Thank you for the input! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
So sorry, I thought this was related to my recent pull request and responded in that context. Anyway, you might try powf() with floats.
From: Max ***@***.***>
Sent: Monday, December 12, 2022 6:27 PM
To: ***@***.***>
Cc: ***@***.***>; ***@***.***>
Subject: Re: [InfiniTimeOrg/InfiniTime] Simple calculator (PR #1483)
Ok, I will test both types on the watch. Thank you for the input!
—
Reply to this email directly, view it on GitHub<#1483 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A3C6AGQO2EACQDE7LOS6PI3WM67FHANCNFSM6AAAAAASYQQYU4>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I apologize for any confusion, I thought this was related to a pull request I made.
From: ***@***.***>
Sent: Monday, December 12, 2022 4:44 PM
To: ***@***.***>
Cc: ***@***.***>
Subject: Re: [InfiniTimeOrg/InfiniTime] Simple calculator (PR #1483)
Looks good, I've tried this on my watch and it works quite nicely. I do think that it is better to use floats rather than doubles for the pow calculation. Why did you switch to doubles?
—
Reply to this email directly, view it on GitHub<#1483 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A3C6AGUV6STVDJILC6TNB23WM6TD3ANCNFSM6AAAAAASYQQYU4>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
While doubles are 64 bits wide, that doesn't make a difference for int > float and float > int conversion. 32-bit floats will definitely have enough precision for this calculation, and as Ceimour already said, the FPU in the nRF 52832 is for 32-bit floats only, so double calculations will be done much less efficiently. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This says that there are 9 digits for float and 17 for double. 9 is not enough. That is only 6 integer digits. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey @minacode, if the variable used to store the calculated value overflows, the watch reboots... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thank you for testing this! It doesn't happen in the simulator so I wonder what makes the watch crash. Edit: I tested the last changes on the watch and it seems like a lot broke. Maybe we have to revert some of the changes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@minacode : I've been using the calculator for a little while now. Overall for most calculations it's working great, doing just what it's supposed to, and has been very useful-- gonna keep using it on my build and I would love to see it included in an upcoming milestone! Basically it has worked flawlessly for me with any small integer operations (small meaning anything not huge, like less than 10^12). Deviating from small integers, there are a few bugs to iron out:
I hope this is helpful-- FYI these are all on PineTime hardware, I haven't tested any of these in the sim! If I have time in the upcoming days, I might poke around the code and see if I can help troubleshoot the causes for some of these. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you so much for this detailed feedback! You even gave examples to reproduce. This is very helpful. There seems to be a difference in behaviour between the simulator (x86) and the watch. I am currently diving in the details to get everything a little more safer. The format strings are way less forgiving on the watch it seems. At first I ignored the issues around overflows but I get that the UX would be heavily improved by a controlled maximum value.
This is a good idea. It would also be a lot more forgiving since it would not delete the result instantly. I don't know about a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
That's usually "repeat the last operation" |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Then this shall be it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Glad it is helpful-- thanks for your diligence!
I was thinking the same thing at first: probably very few users would need to perform calculations at the level needed to cause overflow. It's more the kind of bug that comes out of the user looking for ways to break the app. But out of principle it is best to foolproof it such that the user is incapable of causing a crash with any combination of inputs, and to make it clear when the user passes into too-large territory where the calculations or interface start to break down. 🙂
Agree! That would be a more expected behavior for PS: This might be a good |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Just wanted to add briefly -- In case it is helpful with troubleshooting this one: this bug also happens with division of non-divisible integers. For example, 52/53 and 1/2 both evaluate to 0.48957. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ok, so I changed some things in the last commits. It's not done yet, but we are getting there.
All changes are only tested in the simulator for now. And I have a question: How exactly do you expect the Currently it calculates a new result and keeps the value and operation untouched. Therefore you can press it multiple times for repeated calculation. But this causes two issues:
One could use the backspace but it seems very inconvenient to me. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The last commit is an experiment for the UX. Instead of standard button presses you can now hold the touch and drag it accross the button matrix. The current button is colored with a different background. Releasing triggers the button handle. I hope that this help with pressing the correct buttons on the small screen. If anyone has a good suggestion for the focus color I will add it. I am not good with colors 😀 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Awesome, thanks for your work on this-- love the changes!! Tested new build on PineTime hardware and can confirm that:
The way Here's the way I would recommend addressing those two issues: i. I agree this is confusing. I would make it so that pressing the operation buttons never causes a calculation-- only changes the current operation. The ONLY way to cause a calculation therefore would be pressing ii. I like your solution-- when
This sounds like a great idea, excited to try it out! (Of course, feel free to take or leave any of the suggestions above at your discretion! Just my thoughts but others might think differently and it is your app 🙂) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Again thank you for the feedback! It means a lot 😊
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I did some updates:
There are some minor issues left that I will continue working on. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Awesome updates! Thanks for your work 👍 Testing latest build on PineTime hardware and all the bugs number 1-7 reported above are resolved from my end ✔️ I love the design changes like the touch/drag coloring, and coloring the currently active operation! Very clever & sleek. (Also, regarding the fixed vs floating point, that makes sense 🙂 I agree, I've become familiar with it and think fixed point is probably favorable for simplicity of design.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
by making the button labels even more const
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Haven't reviewed the mathematical part as I'm not really a fixed point expert. I've been using this for a while though and it's worked well
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: mark9064 <[email protected]>
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
All looks good to me!
(minus checking the fixed point correctness, it's beyond me :P)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Just piping in to say - thanks everyone for keeping up work on this so diligently! Would be very excited as a user to see this merged sometime! Many thanks :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
So, can we merge this now? Very cool app! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: mark9064 <[email protected]>
|
Wohoo, approval 🥳! Thanks everyone for testing and reviewing this app over the last two years! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@tituscmd I investigated the issue regarding the = buttonn further and found out that it only occurs if the background heartbeat monitoring is set to 30m :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
That's... really odd 😅 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
OK, it really seems to be an edge case. At least, I needed to try it 6 times until I had it in the video, but if you do it exactly like in the video, it seems to be 100% reproducible. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
That's really weird. Are you on stock 1.16 or is anything custom about your firmware? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I only have a sealed pinetime, so I use only stable software. I had the 1.15 with the Star Trek/LCARS Theme before and its resouces are still in the watch, but the firmware is standard 1.16 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.