Time and Battery Indicators
|
10-22-2017, 09:30 PM
Post: #1
|
|||
|
|||
Time and Battery Indicators
I created a completely custom INPUT replacement for a project I'm working on. The purpose is to allow mixed input types to be displayed nicely, like in the attached screen capture for example.
Is anyone aware of a call to show current time, battery, and angle indicators in the header? For that matter, also the Alpha and Shift indicators? I can make my own of course, but wondered if this was already available? If not available, is it a worthy feature request? Thanks. |
|||
10-22-2017, 10:04 PM
Post: #2
|
|||
|
|||
RE: Time and Battery Indicators
There might be some settings variables that might have some of that. I know that the battery level is not available that way. However, a while back I wrote a function to get that from the screen icon...here..
http://www.hpmuseum.org/forum/thread-8610.html |
|||
10-23-2017, 01:43 PM
Post: #3
|
|||
|
|||
RE: Time and Battery Indicators
Hello,
Nope, sorry :-( Cyrille Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP. |
|||
10-24-2017, 05:45 AM
Post: #4
|
|||
|
|||
RE: Time and Battery Indicators | |||
10-24-2017, 09:31 AM
Post: #5
|
|||
|
|||
RE: Time and Battery Indicators
You can get them by looking at the pixels set in the graphics and store them in global variables and then redraw them using the values gleaned. Look at the battery value I mentioned in a previous post on this thread.
|
|||
10-25-2017, 02:47 AM
Post: #6
|
|||
|
|||
RE: Time and Battery Indicators
(10-24-2017 09:31 AM)webmasterpdx Wrote: You can get them by looking at the pixels set in the graphics and store them in global variables and then redraw them using the values gleaned. Look at the battery value I mentioned in a previous post on this thread. Thanks, yeah I saw the previous example of obtaining the battery level by pixels, however for my purposes it isn't really suitable. At first what I did was simply "paint over" the default header and not touch the battery & time graphic area, which is probably fine for short use, but the application I'm working on could potentially be run for extended periods (hours) without exiting. I would have to periodically call a dummy command for a brief fraction of a second that would repaint the default header to update the information to make it current, which is what I wanted to avoid. The 50g had annunciator display commands that I was thinking of, different scope for those of course since they were not part of the main display area, completely different logic for modes too, etc. This falls into the "nice to have" category but certainly not critical, but I still think it would be handy to have commands that would just draw over top of whatever is on G0 the desired info in the header area. FYI, in case anyone is interested, this is what I used to draw over top of the default header: Code: // IF B→R(Theme(1))==1 THEN |
|||
10-25-2017, 05:33 AM
Post: #7
|
|||
|
|||
RE: Time and Battery Indicators
Well, I do know that you can run an app and there are system timer functions that run regardless. e.g. The LCD refresh and getting the battery value. Now, I just checked and ran a program that takes a time. It doesn't update the clock on the display, but it takes the time to display an animated hourglass in the top right (makes no sense that it'd do one and not the other). I'll ask the HP guys and see what they say.
It might be possible to direct your output to one grob and have the system output to another grob. I'll let you know what I find out. |
|||
10-25-2017, 06:11 AM
(This post was last modified: 10-25-2017 06:26 AM by webmasterpdx.)
Post: #8
|
|||
|
|||
RE: Time and Battery Indicators
Jacob, you can get the Time from the system variable called Time (case matters)...this is in CAS mode.
Get the time value and the value to the left of the decimal point is the hour (24 hour clock). Then, subtract the hour and multiply by 60 to get the minute left of decimal point. Then subtract the minute from that and multiply by 60 to get the seconds (round to nearest by adding 0.5 and getting integer of). e.g. Time 23.0669444444 11PM Ans-23 0.0669444444 Ans*60 4.016666664 11:04 PM Ans-4 0.016666663997 Ans*60 0.99999983 11:04:01 PM (1 second) In Home mode, Time is returned using degree-minute-second mode, except degrees is hours. You can access the CAS Time by using CAS.Time Note that I tried a program running and Time is updated while running. |
|||
10-25-2017, 05:38 PM
Post: #9
|
|||
|
|||
RE: Time and Battery Indicators
I was aware of the Time variable and had that part, and a date display, updating with these little programs to create the strings to display. I had not yet discovered CAS.Time, thanks for that, I saved a conversion as a result.
Code: // return 12 hour string of current time |
|||
10-25-2017, 06:02 PM
Post: #10
|
|||
|
|||
RE: Time and Battery Indicators
Just call HMS-> on the time if you want to turn that off.
LOCAL h,m,dtime:=HMS→(Time); TW Although I work for HP, the views and opinions I post here are my own. |
|||
10-25-2017, 06:46 PM
Post: #11
|
|||
|
|||
RE: Time and Battery Indicators | |||
10-25-2017, 07:03 PM
(This post was last modified: 10-25-2017 07:06 PM by Tim Wessman.)
Post: #12
|
|||
|
|||
RE: Time and Battery Indicators
Yes, it will be the fastest. HMS-> and ->HMS do nothing but flip a bit that is handled by display/calculations on the BCD encoded HP real.
The other one, it will pass the variable by name to the CAS, which then will end up calling the same exact getter code for "Time", call some conversion code to convert the BCD code HP real to a decimal double, then return back the decimal double which runs back through the converter to turn it back into a BCD encoded HP real value. So yeah, not too efficient. TW Although I work for HP, the views and opinions I post here are my own. |
|||
10-25-2017, 09:42 PM
Post: #13
|
|||
|
|||
RE: Time and Battery Indicators
I noticed that a USB plug-in incident on the physical calculator causes the top right of the screen to be repainted, approximately 38px by 20px. Now if we could make that happen from a program
|
|||
10-26-2017, 06:26 AM
Post: #14
|
|||
|
|||
RE: Time and Battery Indicators
The variable HAngle (Settings variable) will tell you the angle mode, so all you need now is the battery value or a way to get it to update the screen while running a program, so you can figure out the value.
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)