Subversion Repositories HomeAutomation

Rev

Blame | Last modification | View Log | SVN | RSS feed

  1. /* the display object who created the menu item */
  2. PIDMenuItem.prototype.parentDisplay = null;
  3. //PIDMenuItem.prototype.sensors = null;
  4. PIDMenuItem.prototype.mode = 0;
  5. PIDMenuItem.prototype.sub_mode = 0;
  6. PIDMenuItem.prototype.tempVariable = 0;
  7. PIDMenuItem.prototype.myPIDService = null;
  8.  
  9. PIDMenuItem.prototype.StoredData = null;
  10.  
  11. PIDMenuItem.prototype.tempVariableKP = 0;
  12. PIDMenuItem.prototype.tempVariableKI = 0;
  13. PIDMenuItem.prototype.tempVariableKD = 0;
  14. PIDMenuItem.prototype.tempVariableTime = 0;
  15. PIDMenuItem.prototype.tempVariableUnit = 0;
  16. PIDMenuItem.prototype.tempVariableActType = 0;
  17. PIDMenuItem.prototype.tempVariableActModId = 0;
  18. PIDMenuItem.prototype.tempVariableActId = 0;
  19. PIDMenuItem.prototype.PIDTempsensorModuleNames    = [ "DS18x20", "FOST02"];
  20.  
  21. function PIDMenuItem(parentDisplay, hd44789Object)
  22. {
  23.     var self = this;
  24.     this.parentDisplay = parentDisplay;
  25.     this.display = hd44789Object;
  26.    
  27.    
  28.     /* Get the PWM service that we want from the ServiceManager, it takes type, service name, service id */
  29.     this.myPIDService = "PID";
  30. }
  31.  
  32. /* the display object who created the menu item */
  33. PIDMenuItem.prototype.parentDisplay = null;
  34. /* the display that we are writing to */
  35. PIDMenuItem.prototype.display = null;
  36.  
  37. /* How often the display shall update [ms]*/
  38. PIDMenuItem.prototype.UpdateTime = 5000;
  39.  
  40. /* what PIDMenuItem is left of this item, if used */
  41. PIDMenuItem.prototype.LeftItem = null;
  42. /* what PIDMenuItem is right of this item, if used */
  43. PIDMenuItem.prototype.RightItem = null;
  44. /* what PIDMenuItem is after of this item, if used */
  45. PIDMenuItem.prototype.PressEnterItem = null;
  46.  
  47.  
  48. /*
  49. Standard events can be:
  50. left, right, enter, back, up, down....
  51. */
  52. PIDMenuItem.prototype.processEvent = function (event)
  53. {
  54.     switch (this.mode)
  55.     {
  56.     case 0:
  57.         switch (event)
  58.         {
  59.         case "right":
  60.             this.parentDisplay.changeToRight();
  61.             break;
  62.         case "left":
  63.             this.parentDisplay.changeToLeft();
  64.             break;
  65.         case "enter":
  66.             this.mode = 1;
  67.             this.sub_mode = 0;
  68.             var last_value_string = Storage_GetParameter("LastValues", this.myPIDService);
  69.             StoredData = eval("(" + last_value_string + ")");
  70.             Display_Clear(this.display);
  71.             break;
  72.         }
  73.         break;
  74.     case 1:
  75.         switch (event)
  76.         {
  77.         case "right":
  78.             this.sub_mode++;
  79.             if (this.sub_mode > 3) {
  80.                 this.sub_mode = 0;
  81.             }
  82.             break;
  83.         case "left":
  84.             if (this.sub_mode == 0) {
  85.                 this.sub_mode = 4;
  86.             }
  87.             this.sub_mode--;
  88.             break;
  89.         case "enter":
  90.             switch (this.sub_mode)
  91.             {
  92.             case 0:
  93.                 this.mode = 2;
  94.                 this.sub_mode = 0;
  95.                 //this.tempVariable = this.myPIDService.Reference;
  96.                 this.tempVariable = parseFloat(StoredData["PID_status"]["Reference"]);
  97.                 break;
  98.             case 1:
  99.                 this.mode = 3;
  100.                 this.sub_mode = 0;
  101.                 //this.tempVariableKP = this.myPIDService.K_P;
  102.                 //this.tempVariableKI = this.myPIDService.K_I;
  103.                 //this.tempVariableKD = this.myPIDService.K_D;
  104.                 //this.tempVariableTime = this.myPIDService.RegulatorTime;
  105.                 //this.tempVariableUnit = this.myPIDService.TimeUnit;
  106.                 this.tempVariableKP = parseInt(StoredData["Parameters"]["K_P"]);
  107.                 this.tempVariableKI = parseInt(StoredData["Parameters"]["K_I"]);
  108.                 this.tempVariableKD = parseInt(StoredData["Parameters"]["K_D"]);
  109.                 this.tempVariableTime = parseInt(StoredData["Parameters"]["RegulatorTime"]);
  110.                 this.tempVariableUnit = StoredData["Parameters"]["TimeUnit"];
  111.  
  112.                 break;
  113.             case 2:
  114.                 this.mode = 0;
  115.                 this.sub_mode = 0;
  116.                 break;
  117.             case 3:
  118.                 this.mode = 4;
  119.                 this.sub_mode = 0;
  120.                 //this.tempVariableActType = this.myPIDService.actuatorModuleType;
  121.                 //this.tempVariableActModId = this.myPIDService.actuatorModuleId;
  122.                 //this.tempVariableActId = this.myPIDService.actuatorId;
  123.                 this.tempVariableActType = parseInt(StoredData["Actuator"]["actuatorModuleType"]);
  124.                 this.tempVariableActModId = parseInt(StoredData["Actuator"]["actuatorModuleId"]);
  125.                 this.tempVariableActId = parseInt(StoredData["Actuator"]["actuatorId"]);
  126.             }
  127.             Display_Clear(this.display);
  128.             break;
  129.         }
  130.         break;
  131.     case 2:
  132.         switch (event)
  133.         {
  134.         case "right":
  135.             if (this.sub_mode == 3) {
  136.                 this.tempVariable = this.tempVariable + 0.5;
  137.             } else {
  138.                 this.sub_mode++;
  139.                 if (this.sub_mode > 2) {
  140.                     this.sub_mode = 0;
  141.                 }
  142.             }
  143.             break;
  144.         case "left":
  145.             if (this.sub_mode == 3) {
  146.                 this.tempVariable = this.tempVariable - 0.5;
  147.             } else {
  148.                 if (this.sub_mode == 0) {
  149.                     this.sub_mode = 3;
  150.                 }
  151.                 this.sub_mode--;
  152.             }
  153.             break;
  154.         case "enter":
  155.             switch (this.sub_mode)
  156.             {
  157.             case 0:
  158.                 this.sub_mode = 3;
  159.                 break;
  160.             case 1:
  161.                 //spara
  162.                 //this.myPIDService.setValue(this.tempVariable);
  163.                 PID_setValue(this.myPIDService, this.tempVariable);
  164.                 this.mode = 0;
  165.                 this.sub_mode = 0;
  166.                 break;
  167.             case 2:
  168.                 this.mode = 0;
  169.                 this.sub_mode = 0;
  170.                 break;
  171.             case 3:
  172.                 this.sub_mode = 0;
  173.                 break;
  174.             }
  175.             break;
  176.         }
  177.         break;
  178.     case 3:
  179.         switch (event)
  180.         {
  181.         case "right":
  182.             switch (this.sub_mode)
  183.             {
  184.             case 7:
  185.                 this.tempVariableKP++;
  186.                 if (this.tempVariableKP >= 65000)
  187.                     this.tempVariableKP = 0;
  188.                 break;
  189.             case 8:
  190.                 this.tempVariableKI++;
  191.                 if (this.tempVariableKI >= 65000)
  192.                     this.tempVariableKI = 0;
  193.                 break;
  194.             case 9:
  195.                 this.tempVariableKD++;
  196.                 if (this.tempVariableKD >= 65000)
  197.                     this.tempVariableKD = 0;
  198.                 break;
  199.             case 10:
  200.                 this.tempVariableTime++;
  201.                 if (this.tempVariableUnit == "s") {
  202.                     if (this.tempVariableTime > 256) {
  203.                         this.tempVariableTime = 0;
  204.                     }
  205.                 } else {
  206.                     if (this.tempVariableTime > 65000) {
  207.                         this.tempVariableTime = 0;
  208.                     }
  209.                 }
  210.    
  211.                 break;
  212.             case 11:
  213.                 if (this.tempVariableUnit == "s")
  214.                     this.tempVariableUnit = "ms"
  215.                 else
  216.                     this.tempVariableUnit = "s"
  217.                 break;
  218.             default:
  219.                 this.sub_mode++;
  220.                 if (this.sub_mode > 6) {
  221.                     this.sub_mode = 0;
  222.                 }
  223.                 break;
  224.             }
  225.             break;
  226.         case "left":
  227.             switch (this.sub_mode)
  228.             {
  229.             case 7:
  230.                 this.tempVariableKP--;
  231.                 if (this.tempVariableKP == -1)
  232.                     this.tempVariableKP = 65000;
  233.                 break;
  234.             case 8:
  235.                 this.tempVariableKI--;
  236.                 if (this.tempVariableKI == -1)
  237.                     this.tempVariableKI = 65000;
  238.                 break;
  239.             case 9:
  240.                 this.tempVariableKD--;
  241.                 if (this.tempVariableKD == -1)
  242.                     this.tempVariableKD = 65000;
  243.                 break;
  244.             case 10:
  245.                 this.tempVariableTime--;
  246.                 if (this.tempVariableTime == -1) {
  247.                     if (this.tempVariableUnit == "s")
  248.                         this.tempVariableTime = 255;
  249.                     else
  250.                         this.tempVariableTime = 65000;
  251.                 }
  252.                 break;
  253.             case 11:
  254.                 if (this.tempVariableUnit == "s")
  255.                     this.tempVariableUnit = "ms"
  256.                 else
  257.                     this.tempVariableUnit = "s"
  258.                 break;
  259.             default:
  260.                 if (this.sub_mode == 0) {
  261.                     this.sub_mode = 7;
  262.                 }
  263.                 this.sub_mode--;
  264.                 break;
  265.             }
  266.             break;
  267.         case "enter":
  268.             switch (this.sub_mode)
  269.             {
  270.             case 0: //spara
  271.                 //this.myPIDService.setParameters(this.tempVariableKP,this.tempVariableKI,this.tempVariableKD,this.tempVariableTime,this.tempVariableUnit);
  272.                 PID_setParameters(this.myPIDService,this.tempVariableKP,this.tempVariableKI,this.tempVariableKD,this.tempVariableTime,this.tempVariableUnit);
  273.                 this.mode = 0;
  274.                 this.sub_mode = 0;
  275.                 break;
  276.             case 1: //goto main
  277.                 this.mode = 0;
  278.                 this.sub_mode = 0;
  279.                 break;
  280.             case 2: //change K_P
  281.                 this.sub_mode = 7;
  282.                 break;
  283.             case 3: //change K_I
  284.                 this.sub_mode = 8;
  285.                 break;
  286.             case 4: //change K_D
  287.                 this.sub_mode = 9;
  288.                 break;
  289.             case 5: //change time
  290.                 this.sub_mode = 10;
  291.                 break;
  292.             case 6: //change time unit
  293.                 this.sub_mode = 11;
  294.                 break;
  295.             default:
  296.                 this.sub_mode = this.sub_mode - 5;
  297.                 break;
  298.             }
  299.             break;
  300.         }
  301.         break;
  302.     case 4:
  303.         switch (event)
  304.         {
  305.         case "right":
  306.             switch (this.sub_mode)
  307.             {
  308.             case 6:
  309.                 this.tempVariableActType++;
  310.                 if (this.tempVariableActType>= 255)
  311.                     this.tempVariableActType = 0;
  312.                 break;
  313.             case 7:
  314.                 this.tempVariableActModId++;
  315.                 if (this.tempVariableActModId>= 255)
  316.                     this.tempVariableActModId = 0;
  317.                 break;
  318.             case 8:
  319.                 this.tempVariableActId++;
  320.                 if (this.tempVariableActId>= 255)
  321.                     this.tempVariableActId = 0;
  322.                 break;
  323.             case 9:
  324.                 break;
  325.             default:
  326.                 this.sub_mode++;
  327.                 if (this.sub_mode > 5) {
  328.                     this.sub_mode = 0;
  329.                 }
  330.                 break;
  331.             }
  332.             break;
  333.         case "left":
  334.             switch (this.sub_mode)
  335.             {
  336.             case 6:
  337.                 this.tempVariableActType--;
  338.                 if (this.tempVariableActType == -1)
  339.                     this.tempVariableActType = 255;
  340.                 break;
  341.             case 7:
  342.                 this.tempVariableActModId--;
  343.                 if (this.tempVariableActModId == -1)
  344.                     this.tempVariableActModId = 255;
  345.                 break;
  346.             case 8:
  347.                 this.tempVariableActId--;
  348.                 if (this.tempVariableActId == -1)
  349.                     this.tempVariableActId = 255;
  350.                 break;
  351.             case 9:
  352.                 break;
  353.             default:
  354.                 this.sub_mode--;
  355.                 if (this.sub_mode == -1) {
  356.                     this.sub_mode = 5;
  357.                 }
  358.                 break;
  359.             }
  360.             break;
  361.         case "enter":
  362.             switch (this.sub_mode)
  363.             {
  364.             case 0: //spara
  365.                 //this.myPIDService.setParameters(this.tempVariableKP,this.tempVariableKI,this.tempVariableKD,this.tempVariableTime,this.tempVariableUnit);
  366.                 this.mode = 0;
  367.                 this.sub_mode = 0;
  368.                 break;
  369.             case 1: //goto main
  370.                 this.mode = 0;
  371.                 this.sub_mode = 0;
  372.                 break;
  373.             case 2: //change K_P
  374.                 this.sub_mode = 6;
  375.                 break;
  376.             case 3: //change K_I
  377.                 this.sub_mode = 7;
  378.                 break;
  379.             case 4: //change K_D
  380.                 this.sub_mode = 8;
  381.                 break;
  382.             case 5: //change time
  383.                 this.sub_mode = 9;
  384.                 break;
  385.             default:
  386.                 this.sub_mode = this.sub_mode - 4;
  387.                 break;
  388.             }
  389.             break;
  390.         }
  391.         break;
  392.  
  393.     }
  394. }
  395.  
  396. PIDMenuItem.prototype.onEnter = function ()
  397. {
  398.     this.mode = 0;
  399.     Display_Clear(this.display);
  400.     //this.myPIDService.getConfiguration();
  401.     PID_getConfiguration(this.myPIDService);
  402.    
  403.     var last_value_string = Storage_GetParameter("LastValues", this.myPIDService);
  404.     this.StoredData = eval("(" + last_value_string + ")");
  405.     //Log(this.StoredData["PID_status"]["Reference"]);
  406.            
  407. }
  408. PIDMenuItem.prototype.update = function ()
  409. {
  410.     //this.display.clearScreen();
  411.     switch (this.mode)
  412.     {
  413.     case 1:
  414.         switch (this.sub_mode)
  415.         {
  416.         case 0:
  417.             Display_Print(this.display,0, 3,"> Set Temperature");
  418.             break;
  419.         case 1:
  420.             Display_Print(this.display,0, 3,"> Settings       ");
  421.             break;
  422.         case 2:
  423.             Display_Print(this.display,0, 3,"> Tillbaka       ");
  424.             break;
  425.         case 3:
  426.             Display_Print(this.display,0, 3,"> Konfiguration  ");
  427.             break;
  428.         }
  429.         Display_Print(this.display,0, 0,"Reference:    "+parseFloat(this.StoredData["PID_status"]["Reference"]).toFixed(1).toString()+"¤C");  
  430.         Display_Print(this.display,0, 1,"Measurment:   "+parseFloat(this.StoredData["PID_status"]["Measurment"]).toFixed(1).toString()+"¤C");
  431.         Display_Print(this.display,0, 2,"Out:"+(parseFloat(this.StoredData["PID_status"]["PWM"])/100).toFixed(1).toString()+"% Sum: "+parseFloat(this.StoredData["PID_status"]["Sum"]).toFixed(0).toString());
  432.         break;
  433.     case 0:
  434.         Display_Print(this.display,0, 0,"Reference:    "+parseFloat(this.StoredData["PID_status"]["Reference"]).toFixed(1).toString()+"¤C");  
  435.         Display_Print(this.display,0, 1,"Measurment:   "+parseFloat(this.StoredData["PID_status"]["Measurment"]).toFixed(1).toString()+"¤C");
  436.         Display_Print(this.display,0, 2,"Out:"+(parseFloat(this.StoredData["PID_status"]["PWM"])/100).toFixed(1).toString()+"% Sum: "+parseFloat(this.StoredData["PID_status"]["Sum"]).toFixed(0).toString());
  437.         Display_Print(this.display,0, 3,"                    ");
  438.         break;
  439.     case 2:
  440.         Display_Print(this.display,0, 0,"Set temperature:");
  441.         switch (this.sub_mode)
  442.         {
  443.         case 0:
  444.             Display_Print(this.display,0, 1,"   > "+this.tempVariable.toFixed(1).toString()+"¤C");
  445.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  446.             break;
  447.         case 1:
  448.             Display_Print(this.display,0, 1,"     "+this.tempVariable.toFixed(1).toString()+"¤C")
  449.             Display_Print(this.display,0, 3,"> Spara     Ångra");
  450.             break;
  451.         case 2:
  452.             Display_Print(this.display,0, 1,"     "+this.tempVariable.toFixed(1).toString()+"¤C")
  453.             Display_Print(this.display,0, 3,"  Spara   > Ångra");
  454.             break;
  455.         case 3:
  456.             Display_Print(this.display,0, 1,"  <> "+this.tempVariable.toFixed(1).toString()+"¤C")
  457.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  458.             break;
  459.         }
  460.         break;
  461.     case 3:
  462.        
  463.         switch (this.sub_mode)
  464.         {
  465.         case 0: //spara
  466.             Display_Print(this.display,0, 0," K_P:  "+this.tempVariableKP);
  467.             Display_Print(this.display,10, 0," K_I:  "+this.tempVariableKI);
  468.             Display_Print(this.display,0, 1," K_D:  "+this.tempVariableKD);
  469.             Display_Print(this.display,0, 2," Time: "+this.tempVariableTime+" "+this.tempVariableUnit);
  470.             Display_Print(this.display,0, 3,"> Spara     Ångra");
  471.             break;
  472.         case 1: //goto main
  473.             Display_Print(this.display,0, 0," K_P:  "+this.tempVariableKP);
  474.             Display_Print(this.display,10, 0," K_I:  "+this.tempVariableKI);
  475.             Display_Print(this.display,0, 1," K_D:  "+this.tempVariableKD);
  476.             Display_Print(this.display,0, 2," Time: "+this.tempVariableTime+" "+this.tempVariableUnit);
  477.             Display_Print(this.display,0, 3,"  Spara   > Ångra");
  478.             break;
  479.         case 2: //change K_P
  480.             Display_Print(this.display,0, 0,">K_P:  "+this.tempVariableKP);
  481.             Display_Print(this.display,10, 0," K_I:  "+this.tempVariableKI);
  482.             Display_Print(this.display,0, 1," K_D:  "+this.tempVariableKD);
  483.             Display_Print(this.display,0, 2," Time: "+this.tempVariableTime+" "+this.tempVariableUnit);
  484.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  485.             break;
  486.         case 3: //change K_I
  487.             Display_Print(this.display,0, 0," K_P:  "+this.tempVariableKP);
  488.             Display_Print(this.display,10, 0,">K_I:  "+this.tempVariableKI);
  489.             Display_Print(this.display,0, 1," K_D:  "+this.tempVariableKD);
  490.             Display_Print(this.display,0, 2," Time: "+this.tempVariableTime+" "+this.tempVariableUnit);
  491.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  492.             break;
  493.         case 4: //change K_D
  494.             Display_Print(this.display,0, 0," K_P:  "+this.tempVariableKP);
  495.             Display_Print(this.display,10, 0," K_I:  "+this.tempVariableKI);
  496.             Display_Print(this.display,0, 1,">K_D:  "+this.tempVariableKD);
  497.             Display_Print(this.display,0, 2," Time: "+this.tempVariableTime+" "+this.tempVariableUnit);
  498.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  499.             break;
  500.         case 5: //change time
  501.             Display_Print(this.display,0, 0," K_P:  "+this.tempVariableKP);
  502.             Display_Print(this.display,10, 0," K_I:  "+this.tempVariableKI);
  503.             Display_Print(this.display,0, 1," K_D:  "+this.tempVariableKD);
  504.             Display_Print(this.display,0, 2,">Time: "+this.tempVariableTime+" "+this.tempVariableUnit);
  505.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  506.             break;
  507.         case 6: //change time unit
  508.             Display_Print(this.display,0, 0," K_P:  "+this.tempVariableKP);
  509.             Display_Print(this.display,10, 0," K_I:  "+this.tempVariableKI);
  510.             Display_Print(this.display,0, 1," K_D:  "+this.tempVariableKD);
  511.             Display_Print(this.display,0, 2," Time: "+this.tempVariableTime+">"+this.tempVariableUnit);
  512.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  513.             break;
  514.         case 7: //change K_P
  515.             Display_Print(this.display,0, 0," K_P: ["+this.tempVariableKP+"]");
  516.             Display_Print(this.display,10, 0," K_I:  "+this.tempVariableKI);
  517.             Display_Print(this.display,0, 1," K_D:  "+this.tempVariableKD);
  518.             Display_Print(this.display,0, 2," Time: "+this.tempVariableTime+" "+this.tempVariableUnit);
  519.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  520.             break;
  521.         case 8: //change K_I
  522.             Display_Print(this.display,0, 0," K_P:  "+this.tempVariableKP);
  523.             Display_Print(this.display,10, 0," K_I: ["+this.tempVariableKI+"]");
  524.             Display_Print(this.display,0, 1," K_D:  "+this.tempVariableKD);
  525.             Display_Print(this.display,0, 2," Time: "+this.tempVariableTime+" "+this.tempVariableUnit);
  526.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  527.             break;
  528.         case 9: //change K_D
  529.             Display_Print(this.display,0, 0," K_P:  "+this.tempVariableKP);
  530.             Display_Print(this.display,10, 0," K_I:  "+this.tempVariableKI);
  531.             Display_Print(this.display,0, 1," K_D: ["+this.tempVariableKD+"]");
  532.             Display_Print(this.display,0, 2," Time: "+this.tempVariableTime+" "+this.tempVariableUnit);
  533.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  534.             break;
  535.         case 10: //change time
  536.             Display_Print(this.display,0, 0," K_P:  "+this.tempVariableKP);
  537.             Display_Print(this.display,10, 0," K_I:  "+this.tempVariableKI);
  538.             Display_Print(this.display,0, 1," K_D:  "+this.tempVariableKD);
  539.             Display_Print(this.display,0, 2," Time:["+this.tempVariableTime+"]"+this.tempVariableUnit);
  540.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  541.             break;
  542.         case 11: //change time unit
  543.             Display_Print(this.display,0, 0," K_P:  "+this.tempVariableKP);
  544.             Display_Print(this.display,10, 0," K_I:  "+this.tempVariableKI);
  545.             Display_Print(this.display,0, 1," K_D:  "+this.tempVariableKD);
  546.             Display_Print(this.display,0, 2," Time: "+this.tempVariableTime+"["+this.tempVariableUnit+"]");
  547.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  548.             break;
  549.         }
  550.         break;
  551.     case 4:
  552.         switch (this.sub_mode)
  553.         {
  554.         case 0: //spara
  555.             Display_Print(this.display,0, 0," PWM: "+this.tempVariableActType+ " "+this.tempVariableActModId +" " + this.tempVariableActId);
  556.             Display_Print(this.display,0, 1," Sensor: "+getSensorName(this.myPIDService.sensorModuleType, this.myPIDService.sensorModuleId , this.myPIDService.sensorId));
  557.             Display_Print(this.display,0, 3,"> Spara     Ångra");
  558.             break;
  559.         case 1: //goto main
  560.             Display_Print(this.display,0, 0," PWM: "+this.tempVariableActType+ " "+this.tempVariableActModId +" " + this.tempVariableActId);
  561.             Display_Print(this.display,0, 1," Sensor: "+getSensorName(this.myPIDService.sensorModuleType, this.myPIDService.sensorModuleId , this.myPIDService.sensorId));
  562.             Display_Print(this.display,0, 3,"  Spara   > Ångra");
  563.             break;
  564.         case 2: //change pwm
  565.             Display_Print(this.display,0, 0,">PWM: "+this.tempVariableActType+ " "+this.tempVariableActModId +" " + this.tempVariableActId);
  566.             Display_Print(this.display,0, 1," Sensor: "+getSensorName(this.myPIDService.sensorModuleType, this.myPIDService.sensorModuleId , this.myPIDService.sensorId));
  567.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  568.             break;
  569.         case 3: //change sensor
  570.             Display_Print(this.display,0, 0," PWM: "+this.tempVariableActType+ " "+this.tempVariableActModId +" " + this.tempVariableActId);
  571.             Display_Print(this.display,0, 1,">Sensor: "+getSensorName(this.myPIDService.sensorModuleType, this.myPIDService.sensorModuleId , this.myPIDService.sensorId));
  572.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  573.             break;
  574.         case 4: //change K_D
  575.             Display_Print(this.display,0, 0," PWM:["+this.tempVariableActType+ "]"+this.tempVariableActModId +" " + this.tempVariableActId);
  576.             Display_Print(this.display,0, 1," Sensor: "+getSensorName(this.myPIDService.sensorModuleType, this.myPIDService.sensorModuleId , this.myPIDService.sensorId));
  577.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  578.             break;
  579.         case 5: //change time
  580.             Display_Print(this.display,0, 0," PWM: "+this.tempVariableActType+ "["+this.tempVariableActModId +"]" + this.tempVariableActId);
  581.             Display_Print(this.display,0, 1," Sensor: "+getSensorName(this.myPIDService.sensorModuleType, this.myPIDService.sensorModuleId , this.myPIDService.sensorId));
  582.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  583.             break;
  584.         case 6: //change time unit
  585.             Display_Print(this.display,0, 0," PWM: "+this.tempVariableActType+ " "+this.tempVariableActModId +"[" + this.tempVariableActId+"]");
  586.             Display_Print(this.display,0, 1," Sensor: "+getSensorName(this.myPIDService.sensorModuleType, this.myPIDService.sensorModuleId , this.myPIDService.sensorId));
  587.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  588.             break;
  589.         case 7: //change K_P
  590.             Display_Print(this.display,0, 0," PWM: "+this.tempVariableActType+ " "+this.tempVariableActModId +" " + this.tempVariableActId);
  591.             Display_Print(this.display,0, 1," Sensor:["+getSensorName(this.myPIDService.sensorModuleType,  this.myPIDService.sensorModuleId , this.myPIDService.sensorId)+"]");
  592.             Display_Print(this.display,0, 3,"  Spara     Ångra");
  593.             break;
  594.         }
  595.         break;
  596.  
  597.     }
  598. }
  599.  
  600.  
  601. PIDMenuItem.prototype.onExit = function ()
  602. {
  603.     this.mode = 0;
  604.     this.sub_mode = 0;
  605. }
  606.  
  607.  
  608.