Subversion Repositories HomeAutomation

Rev

Rev 1374 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1374 Rev 1386
Line 7... Line 7...
7
PIDMenuItem.prototype.myPIDService = null;
7
PIDMenuItem.prototype.myPIDService = null;
8
//PIDMenuItem.prototype.currentSensorItem = 0;
8
//PIDMenuItem.prototype.currentSensorItem = 0;
9
//PIDMenuItem.prototype.window_low = 0;
9
//PIDMenuItem.prototype.window_low = 0;
10
//PIDMenuItem.prototype.window_high = 3; //set to nummber of rows you want to display minus 1
10
//PIDMenuItem.prototype.window_high = 3; //set to nummber of rows you want to display minus 1
11
 
11
 
-
 
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;
12
 
20
 
13
function PIDMenuItem(parentDisplay, hd44789Object)
21
function PIDMenuItem(parentDisplay, hd44789Object)
14
{
22
{
15
    var self = this;
23
    var self = this;
16
    this.parentDisplay = parentDisplay;
24
    this.parentDisplay = parentDisplay;
Line 68... Line 76...
68
    case 1:
76
    case 1:
69
        switch (event)
77
        switch (event)
70
        {
78
        {
71
        case "right":
79
        case "right":
72
            this.sub_mode++;
80
            this.sub_mode++;
73
            if (this.sub_mode > 2) {
81
            if (this.sub_mode > 3) {
74
                this.sub_mode = 0;
82
                this.sub_mode = 0;
75
            }
83
            }
76
            break;
84
            break;
77
        case "left":
85
        case "left":
78
            if (this.sub_mode == 0) {
86
            if (this.sub_mode == 0) {
79
                this.sub_mode = 2;
87
                this.sub_mode = 4;
80
            }
88
            }
81
            this.sub_mode--;
89
            this.sub_mode--;
82
            break;
90
            break;
83
        case "enter":
91
        case "enter":
84
            switch (this.sub_mode)
92
            switch (this.sub_mode)
85
            {
93
            {
86
            case 0:
94
            case 0:
87
                this.mode = 2;
95
                this.mode = 2;
88
                this.sub_mode = 0;
96
                this.sub_mode = 0;
89
                this.tempVariable = this.myPIDService.Reference;
97
                this.tempVariable = this.myPIDService.Reference;
90
                break;
98
                break;
91
            case 1:
99
            case 1:
92
                this.mode = 3;
100
                this.mode = 3;
93
                this.sub_mode = 0;
101
                this.sub_mode = 0;
-
 
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
 
94
                break;
108
                break;
95
            case 2:
109
            case 2:
96
                this.mode = 0;
110
                this.mode = 0;
97
                this.sub_mode = 0;
111
                this.sub_mode = 0;
98
                break;
112
                break;
-
 
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;
99
            }
119
            }
100
            this.display.clearScreen();
120
            this.display.clearScreen();
101
            break;
121
            break;
102
        }
122
        }
103
        break;
123
        break;
Line 107... Line 127...
107
        case "right":
127
        case "right":
108
            if (this.sub_mode == 3) {
128
            if (this.sub_mode == 3) {
109
                this.tempVariable = this.tempVariable + 0.5;
129
                this.tempVariable = this.tempVariable + 0.5;
110
            } else {
130
            } else {
111
                this.sub_mode++;
131
                this.sub_mode++;
112
                if (this.sub_mode > 3) {
132
                if (this.sub_mode > 2) {
113
                    this.sub_mode = 0;
133
                    this.sub_mode = 0;
114
                }
134
                }
115
            }
135
            }
116
            break;
136
            break;
117
        case "left":
137
        case "left":
118
            if (this.sub_mode == 3) {
138
            if (this.sub_mode == 3) {
119
                this.tempVariable = this.tempVariable - 0.5;
139
                this.tempVariable = this.tempVariable - 0.5;
120
            } else {
140
            } else {
121
                if (this.sub_mode == 0) {
141
                if (this.sub_mode == 0) {
122
                    this.sub_mode = 3;
142
                    this.sub_mode = 3;
123
                }
143
                }
124
                this.sub_mode--;
144
                this.sub_mode--;
125
            }
145
            }
126
            break;
146
            break;
127
        case "enter":
147
        case "enter":
128
            switch (this.sub_mode)
148
            switch (this.sub_mode)
129
            {
149
            {
130
            case 0:
150
            case 0:
131
                this.sub_mode = 3;
151
                this.sub_mode = 3;
132
                break;
152
                break;
133
            case 1:
153
            case 1:
134
                //spara
154
                //spara
135
                this.myPIDService.setValue(this.tempVariable);
155
                this.myPIDService.setValue(this.tempVariable);
136
                this.mode = 0;
156
                this.mode = 0;
137
                this.sub_mode = 0;
157
                this.sub_mode = 0;
138
                break;
158
                break;
139
            case 2:
159
            case 2:
140
                this.mode = 0;
160
                this.mode = 0;
141
                this.sub_mode = 0;
161
                this.sub_mode = 0;
142
                break;
162
                break;
143
            case 3:
163
            case 3:
144
                this.sub_mode = 0;
164
                this.sub_mode = 0;
145
                break;
165
                break;
146
            }
166
            }
147
            break;
167
            break;
148
        }
168
        }
149
        break;
169
        break;
150
    case 3:
170
    case 3:
151
        switch (event)
171
        switch (event)
152
        {
172
        {
153
        case "right":
173
        case "right":
-
 
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
            }
-
 
217
            break;
-
 
218
        case "left":
-
 
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
            }
-
 
258
            break;
-
 
259
        case "enter":
-
 
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
            }
-
 
290
            break;
-
 
291
        }
-
 
292
        break;
-
 
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
            }
154
            break;
323
            break;
155
        case "left":
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
            }
156
            break;
351
            break;
157
        case "enter":
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
158
            this.mode = 0;
361
                this.mode = 0;
159
            this.sub_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
            }
160
            break;
380
            break;
161
        }
381
        }
162
        break;
382
        break;
-
 
383
 
163
    }
384
    }
164
}
385
}
165
 
386
 
166
PIDMenuItem.prototype.onEnter = function ()
387
PIDMenuItem.prototype.onEnter = function ()
167
{
388
{
168
    this.mode = 0;
389
    this.mode = 0;
169
    this.display.clearScreen();
390
    this.display.clearScreen();
-
 
391
    this.myPIDService.getConfiguration();
-
 
392
 
170
}
393
}
171
PIDMenuItem.prototype.update = function ()
394
PIDMenuItem.prototype.update = function ()
172
{
395
{
173
    //this.display.clearScreen();
396
    //this.display.clearScreen();
174
    switch (this.mode)
397
    switch (this.mode)
175
    {
398
    {
176
    case 1:
399
    case 1:
177
        switch (this.sub_mode)
400
        switch (this.sub_mode)
178
        {
401
        {
179
        case 0:
402
        case 0:
180
            this.display.printText(0, 3,"> Set Temperature");
403
            this.display.printText(0, 3,"> Set Temperature");
181
            break;
404
            break;
182
        case 1:
405
        case 1:
183
            this.display.printText(0, 3,"> Settings");
406
            this.display.printText(0, 3,"> Settings       ");
184
            break;
407
            break;
185
        case 2:
408
        case 2:
186
            this.display.printText(0, 3,"> Tillbaka");
409
            this.display.printText(0, 3,"> Tillbaka       ");
-
 
410
            break;
-
 
411
        case 3:
-
 
412
            this.display.printText(0, 3,"> Konfiguration  ");
187
            break;
413
            break;
188
        }
414
        }
-
 
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;
189
    case 0:
419
    case 0:
190
        this.display.printText(0, 0,"Reference:     "+this.myPIDService.Reference.toFixed(1).toString()+"¤C");
420
        this.display.printText(0, 0,"Reference:    "+this.myPIDService.Reference.toFixed(1).toString()+"¤C");
191
        this.display.printText(0, 1,"Measurment:    "+this.myPIDService.Reference.toFixed(1).toString()+"¤C");
421
        this.display.printText(0, 1,"Measurment:   "+this.myPIDService.Measurment.toFixed(1).toString()+"¤C");
192
        this.display.printText(0, 2,"Out: "+this.myPIDService.PWM.toFixed(1).toString()+"%   Sum: "+this.myPIDService.sum.toFixed(1).toString());
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,"                    ");
193
        break;
424
        break;
194
    case 2:
425
    case 2:
195
        this.display.printText(0, 0,"Set temperature:");
426
        this.display.printText(0, 0,"Set temperature:");
196
        switch (this.sub_mode)
427
        switch (this.sub_mode)
197
        {
428
        {
198
        case 0:
429
        case 0:
199
            this.display.printText(0, 1,"   > "+this.tempVariable.toFixed(1).toString()+"¤C");
430
            this.display.printText(0, 1,"   > "+this.tempVariable.toFixed(1).toString()+"¤C");
200
            this.display.printText(0, 3,"  Spara     Ångra");
431
            this.display.printText(0, 3,"  Spara     Ångra");
201
            break;
432
            break;
202
        case 1:
433
        case 1:
203
            this.display.printText(0, 1,"     "+this.tempVariable.toFixed(1).toString()+"¤C")
434
            this.display.printText(0, 1,"     "+this.tempVariable.toFixed(1).toString()+"¤C")
204
            this.display.printText(0, 3,"> Spara     Ångra");
435
            this.display.printText(0, 3,"> Spara     Ångra");
205
            break;
436
            break;
206
        case 2:
437
        case 2:
207
            this.display.printText(0, 1,"     "+this.tempVariable.toFixed(1).toString()+"¤C")
438
            this.display.printText(0, 1,"     "+this.tempVariable.toFixed(1).toString()+"¤C")
208
            this.display.printText(0, 3,"  Spara   > Ångra");
439
            this.display.printText(0, 3,"  Spara   > Ångra");
209
            break;
440
            break;
210
        case 3:
441
        case 3:
211
            this.display.printText(0, 1,"  <> "+this.tempVariable.toFixed(1).toString()+"¤C")
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:
-
 
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
        }
-
 
536
        break;
-
 
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));
212
            this.display.printText(0, 3,"  Spara     Ångra");
573
            this.display.printText(0, 3,"  Spara     Ångra");
213
            break;
574
            break;
214
        }
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");
215
        break;
579
            break;
216
    case 3:
580
        }
217
        this.display.printText(0, 0,"  Settings");
-
 
218
        break;
581
        break;
-
 
582
 
219
    }
583
    }
220
}
584
}
-
 
585
 
221
 
586
 
222
PIDMenuItem.prototype.onExit = function ()
587
PIDMenuItem.prototype.onExit = function ()
223
{
588
{
224
    this.mode = 0;
589
    this.mode = 0;
225
    this.sub_mode = 0;
590
    this.sub_mode = 0;