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