image/w/js/webui.js

Fri, 30 Jul 2021 19:39:02 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 30 Jul 2021 19:39:02 +0200
changeset 117
b6d5c4cb61bb
parent 116
bafc2d6a0790
permissions
-rw-r--r--

Removed Delay Start code leftovers.

79
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
1 /* js/webui.js */
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2
79
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
3 $('#wsstatus').html('WebSocket is not connected');
78
b58e0c9897e1 Added reconnect-websocket javascript. Removed some debugging log messages.
Michiel Broek <mbroek@mbse.eu>
parents: 77
diff changeset
4 var websocket = new ReconnectingWebSocket('ws://'+location.hostname+'/ws');
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
6 var Beep= new Audio( "data:audio/wav;base64,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 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=" );
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 var BBScreen={
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9
40
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
10 Screen: -1,
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
11 Subscreen: 0,
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
12 setTimer: function(v){
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
13 $("#timer").text('');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
14 if (v == 0) {
91
255a75322212 Added 7 sgemnt fonts for the web client. Log messages in the components more compact. Added fonts mime-types to the webserver. Switched to stable esp-idf 4.2.1. Upgraded the SD-mmc card API.
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
15 $("#timer").css("font-size", "16px");
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
16 $("#timer").css("font-weight", "normal");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
17 $("#timer").css("font-family", "Verdana, Arial, sans-serif");
91
255a75322212 Added 7 sgemnt fonts for the web client. Log messages in the components more compact. Added fonts mime-types to the webserver. Switched to stable esp-idf 4.2.1. Upgraded the SD-mmc card API.
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
18 $("#timer").css("color", "#ffa400");
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
19 } else {
91
255a75322212 Added 7 sgemnt fonts for the web client. Log messages in the components more compact. Added fonts mime-types to the webserver. Switched to stable esp-idf 4.2.1. Upgraded the SD-mmc card API.
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
20 $("#timer").css("font-size", "32px");
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
21 $("#timer").css("font-weight", "bold");
91
255a75322212 Added 7 sgemnt fonts for the web client. Log messages in the components more compact. Added fonts mime-types to the webserver. Switched to stable esp-idf 4.2.1. Upgraded the SD-mmc card API.
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
22 $("#timer").css("font-family", "DSEG7-Classic, Courier New, Lucida Console");
255a75322212 Added 7 sgemnt fonts for the web client. Log messages in the components more compact. Added fonts mime-types to the webserver. Switched to stable esp-idf 4.2.1. Upgraded the SD-mmc card API.
Michiel Broek <mbroek@mbse.eu>
parents: 79
diff changeset
23 $("#timer").css("color", "#00ff00");
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
24 }
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
25 },
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
26 clearScreen: function(){
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
27 $("#mltline").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
28 $("#mlt_table").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
29 $("#mlt00").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
30 $("#mlt20").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
31 $("#mlt01").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
32 $("#mlt21").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
33 $("#midline").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
34 this.setTimer(0);
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
35 $("#mid00").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
36 $("#mid20").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
37 $("#mid00").css("background-color", "#e7e7e7");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
38 $("#mid00").css("color", "black");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
39 $("#hltline").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
40 $("#hlt_table").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
41 $("#hlt00").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
42 $("#hlt20").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
43 $("#hlt01").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
44 $("#hlt21").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
45 $("#hlt01").css("background-color", "#e7e7e7");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
46 $("#hlt01").css("color", "black");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
47 $("#row_info").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
48 $("#prompt").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
49 $("#button_nee").css("background-color", "#e7e7e7");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
50 $("#button_nee").css("color", "black");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
51 $("#note").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
52 $("#brew").hide();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
53 },
40
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
54 setScreen: function(s){
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
55 Screen = parseInt(s,10);
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
56 switch (Screen) {
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
57 case 0: this.clearScreen();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
58 $("#mltline").show();
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
59 $("#mlt_table").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
60 $("#but00").text('Hand');
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
61 $("#but20").text('Auto');
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
62 $("#mlt00").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
63 $("#mlt20").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
64 $("#midline").show();
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
65 this.setTimer(0);
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
66 $("#hltline").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
67 $("#hlt_table").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
68 $("#hlt01").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
69 $("#but04").text('Info');
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
70 // No tools button on the web.
40
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
71 break;
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
72 case 2: this.clearScreen();
40
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
73 $("#row_info").show();
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
74 break;
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
75 case 96: break; // Automaat show recipe and Stop / Start
117
b6d5c4cb61bb Removed Delay Start code leftovers.
Michiel Broek <mbroek@mbse.eu>
parents: 116
diff changeset
76 case 98: break; // Was delay start
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
77 case 99: this.clearScreen(); // heatup
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
78 $("#mltline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
79 $("#mlt_table").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
80 $("#midline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
81 $("#hltline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
82 $("#hlt_table").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
83 break;
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
84 case 100: break; // All handled at Subscreen
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
85 case 120: this.clearScreen();
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
86 $("#mltline").show(); // to boil
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
87 $("#mlt_table").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
88 $("#mlt00").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
89 $("#mlt20").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
90 $("#but00").text('+sp');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
91 $("#but20").text('-sp');
116
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
92 $("#midline").show();
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
93 $("#timer").hide();
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
94 $("#mid00").show();
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
95 $("#mid20").show();
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
96 $("#but02").text('+%');
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
97 $("#but22").text('-%');
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
98 break;
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
99 case 121: this.clearScreen();
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
100 $("#mltline").show(); // boil
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
101 $("#mlt_table").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
102 $("#mlt00").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
103 $("#mlt20").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
104 $("#but00").text('+sp');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
105 $("#but20").text('-sp');
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
106 $("#midline").show();
116
bafc2d6a0790 Fixed Hendi ON switch and now the switch moment is in a #define HENDI_SWITCH. Currently set at 6. Fixed the web page when going to boil, two buttons were missing. Changed the PWM log line, added information about the ON switch and current temperature.
Michiel Broek <mbroek@mbse.eu>
parents: 91
diff changeset
107 $("#timer").show();
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
108 $("#mid00").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
109 $("#mid20").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
110 $("#but02").text('+%');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
111 $("#but22").text('-%');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
112 this.setTimer(1);
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
113 $("#hltline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
114 $("#hlt01").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
115 $("#hlt21").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
116 $("#but04").text('+1m');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
117 $("#but24").text('-1m');
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
118 break;
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
119 case 122: // whirlpool 9
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
120 case 123: // cooling H
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
121 case 124: // whirlpool 7
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
122 case 125: // cooling M
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
123 case 126: // whirlpool 6
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
124 case 127: // cooling C
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
125 case 128: // whirlpool 2
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
126 break;
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
127 case 129: this.clearScreen();
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
128 $("#note").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
129 $("#note_msg").text('Brouwen is gereed.');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
130 break;
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
131 case 130: this.clearScreen();
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
132 $("#note").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
133 $("#note_msg").text('Brouwen is afgebroken.');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
134 break;
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
135 case 97:
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
136 case 200: this.clearScreen();
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
137 $("#prompt").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
138 break;
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
139 case 201: this.clearScreen();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
140 $("#mltline").show();
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
141 $("#but00").text('+sp');
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
142 $("#but20").text('-sp');
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
143 $("#but01").text('Pomp');
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
144 $("#but21").text('Aan');
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
145 $("#midline").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
146 $("#hltline").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
147 $("#but03").text('+sp');
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
148 $("#but23").text('-sp');
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
149 $("#but04").text('Stop');
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
150 $("#but24").text('Aan');
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
151 $("#hlt01").show();
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
152 $("#hlt01").css("background-color", "#575757");
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
153 $("#hlt01").css("color", "white");
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
154 break;
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
155 default: this.clearScreen();
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
156 console.log("this is default screen "+Screen);
40
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
157 break;
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
158 }
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
159 },
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
160 setSubscreen: function(s){
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
161 Subscreen = parseInt(s,10);
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
162 console.log("Screen:"+Screen+" Sub:"+Subscreen);
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
163 if (Screen == 96) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
164 this.clearScreen();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
165 if (Subscreen == 0) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
166 $("#prompt").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
167 $("#button_ja").text('Ja');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
168 $("#button_nee").text('Nee');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
169 } else if (Subscreen == 1) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
170 $("#brew").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
171 }
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
172 } else if ((Screen >= 100) && (Screen < 120)) {
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
173 this.clearScreen();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
174 $("#mltline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
175 $("#mlt_table").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
176 $("#midline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
177 $("#hltline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
178 $("#hlt_table").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
179 switch (Subscreen) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
180 case 0: // MASH_NONE
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
181 case 1: // MASH_WAITTEMP
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
182 $("#mlt00").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
183 $("#mlt20").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
184 $("#but00").text('+sp');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
185 $("#but20").text('-sp');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
186 break;
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
187 case 2: // MASH_REST
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
188 this.setTimer(1);
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
189 $("#mid00").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
190 $("#mid20").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
191 $("#but02").text('+1m');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
192 $("#but22").text('-1m');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
193 break;
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
194 case 3: // MASH_ADD
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
195 case 4: // MASH_IODINE
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
196 case 5: // MASH_REMOVE
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
197 case 6: // MASH_INFUSE
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
198 case 7: // MASH_DECOCT
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
199 this.setTimer(0);
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
200 $("#mid00").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
201 $("#mid00").css("background-color", "#575757");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
202 $("#mid00").css("color", "white");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
203 $("#mid20").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
204 $("#but02").text('Halt');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
205 $("#but22").text('Ok');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
206 break;
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
207 };
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
208 } else if ((Screen == 123) || (Screen == 125) || (Screen == 127)) { // cooling H,M,C
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
209 this.clearScreen();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
210 if (Subscreen == 0) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
211 $("#prompt").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
212 $("#button_ja").text('Start');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
213 $("#button_nee").text('Stop');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
214 $("#button_nee").css("background-color", "#575757");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
215 $("#button_nee").css("color", "white");
79
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
216 } else if (Subscreen >= 1) {
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
217 $("#mltline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
218 $("#mlt_table").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
219 $("#mlt00").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
220 $("#mlt20").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
221 $("#but00").text('+1');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
222 $("#but20").text('-1');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
223 $("#hltline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
224 $("#hlt01").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
225 $("#but04").text('Stop');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
226 $("#hlt01").css("background-color", "#575757");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
227 $("#hlt01").css("color", "white");
79
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
228 if (Subscreen == 1) {
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
229 $("#hlt21").hide();
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
230 $("#but24").text('');
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
231 }
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
232 if (Subscreen == 2) {
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
233 $("#hlt21").show();
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
234 $("#but24").text('Pomp');
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
235 }
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
236 }
77
66c77497d86d Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.
Michiel Broek <mbroek@mbse.eu>
parents: 42
diff changeset
237 } else if ((Screen == 122) || (Screen == 124) || (Screen == 126) || (Screen == 128)) { // whirlpools
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
238 this.clearScreen();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
239 if (Subscreen == 0) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
240 $("#prompt").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
241 $("#button_ja").text('Start');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
242 $("#button_nee").text('Stop');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
243 $("#button_nee").css("background-color", "#575757");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
244 $("#button_nee").css("color", "white");
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
245 } else if (Subscreen == 1) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
246 $("#mltline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
247 $("#mlt_table").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
248 $("#midline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
249 this.setTimer(1);
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
250 $("#mid00").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
251 $("#mid20").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
252 $("#but02").text('-1m');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
253 $("#but22").text('+1m');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
254 $("#hltline").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
255 $("#hlt21").show();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
256 $("#but24").text('Pomp');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
257 }
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
258 };
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
259 },
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
260 MLT_pv: function(s) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
261 $("#mlt_pv").text(s);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
262 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
263 MLT_sp: function(s) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
264 $("#mlt_sp").text(s);
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
265 if (Screen == 201) {
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
266 if (s != "") {
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
267 $("#mlt00").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
268 $("#mlt20").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
269 $("#mlt01").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
270 $("#mlt21").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
271 $("#mlt_table").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
272 }
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
273 }
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
274 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
275 MLT_power: function(s) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
276 $("#mlt_power").text(s);
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
277 if (Screen == 201) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
278 if (s != "") {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
279 $("#but21").text('Uit');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
280 } else {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
281 $("#but21").text('Aan');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
282 }
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
283 }
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
284 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285 MLT_led: function(s) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
286 if (s == 0)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287 $("#mlt_led").css("background-color", "#270");
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
288 else
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
289 $("#mlt_led").css("background-color", "#5E0");
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
291 Pump_led: function(s) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
292 if (s == 0)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
293 $("#pump_led").css("background-color", "#820");
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
294 else
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
295 $("#pump_led").css("background-color", "#F40");
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
296 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
297 HLT_pv: function(s) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
298 $("#hlt_pv").text(s);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
299 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
300 HLT_sp: function(s) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
301 $("#hlt_sp").text(s);
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
302 if (Screen == 201) {
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
303 if (s != "") {
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
304 $("#hlt00").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
305 $("#hlt20").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
306 $("#hlt21").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
307 $("#hlt_table").show();
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
308 }
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
309 }
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311 HLT_power: function(s) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
312 $("#hlt_power").text(s);
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
313 if (Screen == 201) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
314 if (s != "") {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
315 $("#but24").text('Uit');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
316 } else {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
317 $("#but24").text('Aan');
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
318 }
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
319 }
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
320 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
321 HLT_led: function(s) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
322 if (s == 0)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323 $("#hlt_led").css("background-color", "#270");
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
324 else
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
325 $("#hlt_led").css("background-color", "#5E0");
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327 Topmessage: function(s) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
328 $("#top_msg").text(s);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
329 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
330 Timer: function(s) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
331 $("#timer").text(s);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
332 },
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
333 Brew1: function(s) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
334 $("#brew_msg1").text(s);
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
335 },
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
336 Brew2: function(s) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
337 $("#brew_msg2").text(s);
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
338 },
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
339 Beep: function(s) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
340 var loop = parseInt(s,10);
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
341 Beep.pause();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
342 Beep.loop = false;
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
343 for (i = 0; i < loop; i++) {
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
344 Beep.play();
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
345 }
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
346 },
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
347 };
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
348
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
349 var BrewBoard = {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
350
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
351 p_msg:function(e){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
352 var b=this;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
353 var a=JSON.parse(e);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
354 var c={
40
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
355 main: function(v){
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
356 BBScreen.setScreen(v)
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
357 },
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
358 sub: function(v){
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
359 BBScreen.setSubscreen(v)
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
360 },
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
361 mlt_pv:function(v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
362 BBScreen.MLT_pv(v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
363 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
364 mlt_sp:function(v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
365 BBScreen.MLT_sp(v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
366 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
367 mlt_power:function(v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
368 BBScreen.MLT_power(v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
369 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
370 mlt_led:function(v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
371 BBScreen.MLT_led(v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
372 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
373 pump_led:function(v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
374 BBScreen.Pump_led(v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
375 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
376 hlt_pv:function(v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
377 BBScreen.HLT_pv(v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
378 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
379 hlt_sp:function(v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
380 BBScreen.HLT_sp(v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
381 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
382 hlt_power:function(v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
383 BBScreen.HLT_power(v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
384 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
385 hlt_led:function(v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
386 BBScreen.HLT_led(v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
387 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
388 top_msg:function(v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
389 BBScreen.Topmessage(v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
390 },
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
391 timer:function(v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
392 BBScreen.Timer(v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
393 },
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
394 beep:function(v){
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
395 BBScreen.Beep(v)
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
396 },
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
397 brew1:function(v){
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
398 BBScreen.Brew1(v)
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
399 },
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
400 brew2:function(v){
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
401 BBScreen.Brew2(v)
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
402 },
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
403 };
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
404 $.each(a,function(k,v){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
405 if (typeof(c[k])!="undefined"){
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
406 c[k](v)
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
407 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
408 });
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
409 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
410 };
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
411
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
412
40
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
413 function sendTouch(x, y) {
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
414 websocket.send('{"touch":{"x":'+x+',"y":'+y+'}}');
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
415 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
416
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
417
40
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
418 /* Define keys in the screens and their actions. */
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
419 $("#ok_info").click( function() { sendTouch(160,220); });
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
420 $("#ok_note").click( function() { sendTouch(160,220); });
41
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
421 $("#mlt00").click( function() { sendTouch( 35, 46); });
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
422 $("#mlt20").click( function() { sendTouch(285, 46); });
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
423 $("#mlt01").click( function() { sendTouch( 35, 96); });
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
424 $("#mlt21").click( function() { sendTouch(285, 96); });
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
425 $("#mid00").click( function() { sendTouch( 35,140); });
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
426 $("#mid20").click( function() { sendTouch(285,140); });
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
427 $("#hlt00").click( function() { sendTouch( 35,170); });
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
428 $("#hlt20").click( function() { sendTouch(285,170); });
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
429 $("#hlt01").click( function() { sendTouch( 35,220); });
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
430 $("#hlt21").click( function() { sendTouch(285,220); });
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
431 $("#button_ja").click( function() { sendTouch( 80,120); });
7639cfa6aec0 Websocket interface is working for the main screen and manual mode.
Michiel Broek <mbroek@mbse.eu>
parents: 40
diff changeset
432 $("#button_nee").click( function() { sendTouch(240,120); });
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
433 $("#button_stop").click( function() { sendTouch( 35,220); });
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
434 $("#button_start").click( function() { sendTouch(285,220); });
40
71e06f6d80fd Work on web interface using websockets.
Michiel Broek <mbroek@mbse.eu>
parents: 11
diff changeset
435
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
436 websocket.onopen = function(evt) {
42
c6a1a6ca5437 Finished websockets screens.
Michiel Broek <mbroek@mbse.eu>
parents: 41
diff changeset
437 console.log('WebSocket connection opened');
79
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
438 $('#wsstatus').html('');
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
439 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
440
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
441 /*
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
442 * Process received websocket messages.
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
443 */
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
444 websocket.onmessage = function(evt) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
445 var msg = evt.data;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
446 var value;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
447 switch (msg.charAt(0)) {
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
448 case '{':
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
449 BrewBoard.p_msg(evt.data);
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
450 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
451 default:
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
452 document.getElementById("output").innerHTML = evt.data;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
453 break;
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
454 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
455 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
456
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
457 websocket.onclose = function(evt) {
79
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
458 console.log('Websocket connection closed');
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
459 $('#wsstatus').html('WebSocket closed');
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
460 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
461
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
462 websocket.onerror = function(evt) {
79
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
463 console.log('Websocket error: ' + evt);
cb5c73a8ae90 Websocket selectors using jquery style. During cooling display the pump button on the webpage too.
Michiel Broek <mbroek@mbse.eu>
parents: 78
diff changeset
464 $('#wsstatus').html('WebSocket error ' + evt.data);
0
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
465 }
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
466
b74b0e4902c3 Initial checkin brewboard
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
467

mercurial