Post Reply 
Setting calculator's auto shutoff
01-05-2015, 07:51 PM
Post: #1
Setting calculator's auto shutoff
Since FW 6940 there is the system variable TOff setting auto shutoff.
For further information please take a look at prime's help.

Attachment:
Program setting the auto shutoff.

My special comment to Fw 6975: Wonderful!

Thx to the development team.


Attached File(s)
.zip  TOff V097.zip (Size: 1.12 KB / Downloads: 62)

HP 33C 34C 11C 41CX 12C 15C HP71B 35s 50g Prime Rev. A, C, D. DM 41X, 42. TI 58C, 59, 74, 92-II, Voyage 200, nspire CX II-T, Sanyo ICC 82D and more
Find all posts by this user
Quote this message in a reply
01-05-2015, 08:41 PM
Post: #2
RE: Setting calculator's auto shutoff
(01-05-2015 07:51 PM)Wolfgang Wrote:  Since FW 6940 there is the system variable TOff setting auto shutoff.
For further information please take a look at prime's help.

Attachment:
Program setting the auto shutoff.

Thanks, Wolfgang!

Tom L

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
01-06-2015, 01:06 AM
Post: #3
RE: Setting calculator's auto shutoff
(01-05-2015 07:51 PM)Wolfgang Wrote:  Since FW 6940 there is the system variable TOff setting auto shutoff.
For further information please take a look at prime's help.

Attachment:
Program setting the auto shutoff.

My special comment to Fw 6975: Wonderful!

Thx to the development team.

When copying the source text, I get some invalid characters in the first line below the initial comment that begins //TF = readout catual...
Line 21 just below reads:
TF:=(B→R(TOff)/60000); (cannot paste exact same chars here)

These errors prevent compilation (using Emu).

The same invalid chars are in lines 21, 26
There are also similar invalid chars in lines 30, 32, 60, 61, 69, 70, 74

I presume this is some sort of language issue, but I've no idea from context what those chars should be.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
01-06-2015, 04:07 AM
Post: #4
RE: Setting calculator's auto shutoff
(01-06-2015 01:06 AM)rprosperi Wrote:  When copying the source text, I get some invalid characters in the first line below the initial comment that begins //TF = readout catual...
Line 21 just below reads:
TF:=(B→R(TOff)/60000); (cannot paste exact same chars here)

Replace every B???R with B→R, and every R???B with R→B. Somehow the "→" (right arrow) character got replaced with its three-character code. In CAS, type asc("→") (asc must be lowercase!) to see these three numbers.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
01-06-2015, 08:25 AM (This post was last modified: 01-06-2015 09:26 AM by Thomas_Sch.)
Post: #5
RE: Setting calculator's auto shutoff
(01-06-2015 01:06 AM)rprosperi Wrote:  When copying the source text, I get some invalid characters in the first line below the initial comment that begins //TF = readout catual...
Line 21 just below reads:
TF:=(B→R(TOff)/60000); (cannot paste exact same chars here)
...
The source code file is (should be) encoded in UTF-8.
Please try to change the encoding in your editor before copying.

Maybe Wolfgang can provide the source in a code block.

Thomas
Code:

#pragma mode( separator(.,;) integer(h32) )

EXPORT TOFF()
// Firmware 6975
// integer systems settings are not recommended
// Number Format: Standard
// Setting the auto shutoff system-variable TOff
// limits are set between 1 minute and 60 minutes
// Softmenu with 5 soft buttons
// selectable increment and decrement steps 
// steps of 1, 2, 5, 0.5 minutes
// WMWK 2015-01-05 Versin 0.97
// wolfgang.kuehn@vodafone.de

BEGIN

  LOCAL m,m1,mx,my,TF, TMul;
  RECT();
 
  //TF = readout catual TOff in minutes 
  TF:=(B→R(TOff)/60000);
  TEXTOUT_P("Setting Calculator's auto shutoff V 0.97",26,1,3);
  TEXTOUT_P("TOFF = ",26,50,2);
  // actual TOff
  // actual TOff in minutes
  TEXTOUT_P(B→R(TOff)/60000,65,50,2);
  TEXTOUT_P("min", 95,50,2);
  //actual TOff hex
  // 
  TEXTOUT_P(R→B(TF*60000,32,4)+"    ",139,50,2,#000000,100,#FFFFFF);
  //actual TOff decimal
  TEXTOUT_P(R→B(TF*60000,32,3)+"    ",229,50,2,#000000,100,#FFFFFF);

  // Softmenu 5 buttons
  DRAWMENU("TOff +","TOff -","SET","TOff *","BYE");
  //Multiplier incr / decr
   TMul:=1;
     
//outer loop 
While Z <= 9999 DO
 WHILE MOUSE(1)>=0 DO   END;
//inner loop
    REPEAT
      m:=MOUSE;
      m1:=m(1);
    UNTIL SIZE(m1)>0;
      
    mx:=m1(1);
    my:=m1(2);

    // query softbuttons
    IF my>=220 AND my<=239 THEN

    // menu button 1
      IF mx>=0 AND mx<=51 THEN
        TF:=TF+1*TMul;
        IF TF>60 THEN TF:=60; END; 

        TEXTOUT_P(TF+"   ",65,50,2,#000000,30,#FFFFFF);
        TEXTOUT_P(R→B(TF*60000,32,4)+"    ",139,50,2,#000000,140,#FFFFFF);
        TEXTOUT_P(R→B(TF*60000,32,3)+"    ",229,50,2,#000000,100,#FFFFFF);
      END;
      // menu button 2
      IF mx>=53 AND mx<=104 THEN
        TF:=TF-1*TMul;
        IF TF < 1 THEN TF:=1; END;

        TEXTOUT_P(TF+"   ",65,50,2,#000000,30,#FFFFFF);
        TEXTOUT_P(R→B(TF*60000,32,4)+"    ",139,50,2,#000000,140,#FFFFFF);
        TEXTOUT_P(R→B(TF*60000,32,3)+"    ",229,50,2,#000000,100,#FFFFFF);
      END;
       // menu button 3
      IF mx>=106 AND mx<=157 THEN
        TOff:=R→B(TF*60000);
        TEXTOUT_P("TOff set",112,205,1,#000000,50,#FFFFFF);
      END;     
       // menu button 4
       IF mx>=159 AND mx<=210 THEN
            CASE
                    IF TMul=1 THEN TMul:=2;END;
                    IF TMul=2 THEN TMul:=5;END;
                    IF TMul=5 THEN TMul:=0.5;END;
                    IF TMul=0.5 THEN TMul:=1;END;
             END;

                    TEXTOUT_P("TMul = "+TMul+"    ", 164,205,1,#000000,50,#FFFFFF);

      END;

        // menu button 5
       IF mx>=212 AND mx<=263 THEN
        RETURN;
      END;
// inner loop
  END;
// outer loop
END;
END;
Find all posts by this user
Quote this message in a reply
01-06-2015, 09:07 AM
Post: #6
RE: Setting calculator's auto shutoff
Strange,
i just copied the Txt content, pasted in the Emu and worked flawlessly. I didn't have to type the B->R commands myself.

Very nice program. I totally skipped this command with the last firmware.

Nice finding,

Giancarlo
Find all posts by this user
Quote this message in a reply
01-06-2015, 11:02 AM (This post was last modified: 01-06-2015 11:10 AM by Snorre.)
Post: #7
RE: Setting calculator's auto shutoff
Hello,

just a hint: since binaries get automatically converted to reals when used in real number operations, one may omit the explicit conversion, e.g.
B→R(TOff)/60000 = TOff/60000
B→R(#123h) = 1*#123h = 0+#123h

Greetings

P.S. that holds for rev. 6975 but may change eventually (don't know if it's officially documented behaviour)
Find all posts by this user
Quote this message in a reply
01-06-2015, 05:02 PM
Post: #8
RE: Setting calculator's auto shutoff
(01-06-2015 11:02 AM)Snorre Wrote:  P.S. that holds for rev. 6975 but may change eventually (don't know if it's officially documented behaviour)

That will always stay the same. Basically, there is an internal GetReal function used everywhere that will pull out a valid real from an integer, real, packed real, or complex with a 0 component in the second part.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
01-08-2015, 08:33 AM (This post was last modified: 01-08-2015 04:32 PM by Thomas_Sch.)
Post: #9
RE: Setting calculator's auto shutoff
I've added a simple graphical display to the code. (Wolfgang knows that already..)

Hints and tips are welcome.
Is there already a "construction kit" for slideres etc., so I do not reinvent the wheel?

Code moved to http://www.hpmuseum.org/forum/thread-2815.html

Thomas
Find all posts by this user
Quote this message in a reply
01-08-2015, 01:16 PM
Post: #10
RE: Setting calculator's auto shutoff
(01-08-2015 08:33 AM)Thomas_Sch Wrote:  I've added a simple graphical display to the code. (Wolfgang knows that already..)

Hints and tips are welcome.
Is there already a "construction kit" for slideres etc., so I do not reinvent the wheel?

What's the little artifact after whole numbers when the multiplier is 0.5?

Tom Lake

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
01-08-2015, 01:23 PM
Post: #11
RE: Setting calculator's auto shutoff
Thanks for testing,
I'm deleting the old text previous to re-drawing.
The box was to small. Please replace
Code:
  RECT_P(G0, xTF0-5,123, xTF0+13,133, #FFFFFF, #FFFFFF);
with
Code:
  RECT_P(G0, xTF0-5,123, xTF0+16,133, #FFFFFF, #FFFFFF);
(4th line counting from end of program).
Find all posts by this user
Quote this message in a reply
01-08-2015, 01:45 PM (This post was last modified: 01-08-2015 01:45 PM by Snorre.)
Post: #12
RE: Setting calculator's auto shutoff
Hello,

Nice work, coders.
You should post this program to the HP Prime Software Library, so it doesn't get lost on page 2ff eventually.

Greetings
Find all posts by this user
Quote this message in a reply
01-08-2015, 04:31 PM
Post: #13
RE: Setting calculator's auto shutoff
Thanks for the hint.
See http://www.hpmuseum.org/forum/thread-2815.html
Find all posts by this user
Quote this message in a reply
01-08-2015, 06:42 PM
Post: #14
RE: Setting calculator's auto shutoff
(01-08-2015 01:23 PM)Thomas_Sch Wrote:  Thanks for testing,
I'm deleting the old text previous to re-drawing.
The box was to small. Please replace
Code:
  RECT_P(G0, xTF0-5,123, xTF0+13,133, #FFFFFF, #FFFFFF);
with
Code:
  RECT_P(G0, xTF0-5,123, xTF0+16,133, #FFFFFF, #FFFFFF);
(4th line counting from end of program).

Thanks for that!
How about adding the ability to drag the slider?
(Some people are NEVER satisfied!)

Tom L

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
01-08-2015, 06:47 PM (This post was last modified: 01-09-2015 06:32 AM by Thomas_Sch.)
Post: #15
RE: Setting calculator's auto shutoff
(01-08-2015 06:42 PM)toml_12953 Wrote:  ..
How about adding the ability to drag the slider?
(Some people are NEVER satisfied!)
Tom L
You are not alone ...
At the moment you can "click" within the box changing the value, but a real slider would be fine.
I'm thinking about it, therefor my questions regarding a toolbox.
Find all posts by this user
Quote this message in a reply
01-09-2015, 03:50 AM
Post: #16
RE: Setting calculator's auto shutoff
@ All:

Thank you very much for notes, hints and help!

Is there any (in-)official documentation about HP PPL explaining the Prime's touch?

e.g. tapping and holding down == for incrementing or decrementing

I want to use touch gestures in further programs, if reasonable.


Greetings
Wolfgang

HP 33C 34C 11C 41CX 12C 15C HP71B 35s 50g Prime Rev. A, C, D. DM 41X, 42. TI 58C, 59, 74, 92-II, Voyage 200, nspire CX II-T, Sanyo ICC 82D and more
Find all posts by this user
Quote this message in a reply
01-09-2015, 07:36 AM (This post was last modified: 01-09-2015 07:44 AM by ww63.)
Post: #17
RE: Setting calculator's auto shutoff
look at Hans Graph3D app. There he as implemented some touch support (zoom). Maybe in his source you can find some info.

I think, in this Forum there was a thread about retrieving mouse inputs with the wait command. Maybe in the "brakout" game could be some Information too.

[EDIT]Take a look at this[/EDIT]

reagards Wolfgang
Find all posts by this user
Quote this message in a reply
01-12-2015, 03:05 PM (This post was last modified: 01-12-2015 03:06 PM by Wolfgang.)
Post: #18
RE: Setting calculator's auto shutoff
@ww63

Thanks for your information.

Is there any official guide relating to 'programming around the touch' in progress?


Wolfgang

HP 33C 34C 11C 41CX 12C 15C HP71B 35s 50g Prime Rev. A, C, D. DM 41X, 42. TI 58C, 59, 74, 92-II, Voyage 200, nspire CX II-T, Sanyo ICC 82D and more
Find all posts by this user
Quote this message in a reply
01-12-2015, 04:23 PM
Post: #19
RE: Setting calculator's auto shutoff
I can post a short article later this evening on what I have learned about MOUSE() and WAIT(-1) if that will help.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
01-12-2015, 04:28 PM
Post: #20
RE: Setting calculator's auto shutoff
@ Han: That would be wunderbar! :-)

Thanks a lot!

HP 33C 34C 11C 41CX 12C 15C HP71B 35s 50g Prime Rev. A, C, D. DM 41X, 42. TI 58C, 59, 74, 92-II, Voyage 200, nspire CX II-T, Sanyo ICC 82D and more
Find all posts by this user
Quote this message in a reply
Post Reply 




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