Post Reply 
Setting calculator's auto shutoff
09-12-2016, 03:13 PM
Post: #2
RE: Setting calculator's auto shutoff
Here's an further version without slider action going with FW 10637:


Code:



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

EXPORT TOFF()
// Firmware 6975 // 10637
// integer systems settings are not recommended
// Number Format: Standard
// Setting the auto shutoff system-variable TOff
// limits are set between 1 minute and 1 hour
// 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
// ***** new   ***************
// ***** new   ***************
// WMWK 2016-09-12 Version 1.0
// Firmware 10637 killroyed
// steps of 0.5, 1, 2, 5, 15, 30, 60 minutes
// limits extended to 1 day / 1440 mins
// instant adjusting TOff to standard 5 minutes via 6th Softkey 
// wolfgang.kuehn@vodafone.de

BEGIN

  LOCAL m,m1,mx,my,TF, TMul;
  RECT();
 
  //TF = readout actual 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 6 buttons
  DRAWMENU("TOff +","TOff -","SET","TOff *","BYE", "5M&Go");
  //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>1440 THEN TF:=1440; 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:=15;END;
            IF TMul=15 THEN TMul:=30;END;                    
            IF TMul=30 THEN TMul:=60;END;
            IF TMul=60 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;
  // menu button 5
       IF mx>=265 AND mx<=319 THEN
          TOff:=#493E0h;     
          RETURN;
       END;
// inner loop
  END;
// outer loop
END;
END;
[/quote]

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 


Messages In This Thread
RE: Setting calculator's auto shutoff - Wolfgang - 09-12-2016 03:13 PM



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