www/js/mon_fermenter.js

changeset 191
fd1d7225ca6e
parent 189
6470e5c6a001
child 192
7f69b43e6084
equal deleted inserted replaced
190:77bbfdaa22e9 191:fd1d7225ca6e
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with ThermFerm; see the file COPYING. If not, write to the Free 19 * along with ThermFerm; see the file COPYING. If not, write to the Free
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *****************************************************************************/ 21 *****************************************************************************/
22
23 function createAbortElements() {
24 $('#eventWindow').jqxWindow({
25 theme: theme,
26 position: { x: 440, y: 210 },
27 width: 400,
28 height: 200,
29 resizable: false,
30 isModal: true,
31 modalOpacity: 0.4,
32 okButton: $('#delOk'),
33 cancelButton: $('#delCancel'),
34 initContent: function () {
35 $('#delOk').jqxButton({ template: "danger", width: '65px', theme: theme });
36 $('#delCancel').jqxButton({ template: "success", width: '65px', theme: theme });
37 $('#delCancel').focus();
38 }
39 });
40 $('#eventWindow').jqxWindow('hide');
41 }
22 42
23 43
24 $(document).ready(function () { 44 $(document).ready(function () {
25 45
26 var record = {}; 46 var record = {};
165 $("#gaugeContainer_chiller").jqxGauge( gaugeSmalloptions ); 185 $("#gaugeContainer_chiller").jqxGauge( gaugeSmalloptions );
166 186
167 var switchoptions = { 187 var switchoptions = {
168 height: 68, 188 height: 68,
169 width: 35, 189 width: 35,
190 onLabel:'AAN',
191 offLabel:'UIT',
170 theme: theme, 192 theme: theme,
171 thumbSize:'50%', 193 thumbSize:'50%',
172 orientation: 'vertical' 194 orientation: 'vertical'
173 }; 195 };
174 $("#fermenter_toggle1").jqxSwitchButton( switchoptions ); 196 $("#fermenter_toggle1").jqxSwitchButton( switchoptions );
610 if (record.mode == "PROFILE") { 632 if (record.mode == "PROFILE") {
611 if (record.profile_state == "OFF") { 633 if (record.profile_state == "OFF") {
612 ppayload = '{"profile":{"command":"start"}}'; 634 ppayload = '{"profile":{"command":"start"}}';
613 newProfile = true; 635 newProfile = true;
614 } else if ((record.profile_state == "RUN") || (record.profile_state == "PAUSE")) { 636 } else if ((record.profile_state == "RUN") || (record.profile_state == "PAUSE")) {
615 ppayload = '{"profile":{"command":"abort"}}'; 637 // Open a popup to confirm this action.
616 newProfile = true; 638 $('#eventWindow').jqxWindow('open');
639 $("#delOk").click(function () {
640 ppayload = '{"profile":{"command":"abort"}}';
641 newProfile = true;
642 });
617 } else if (record.profile_state == "DONE") { 643 } else if (record.profile_state == "DONE") {
618 ppayload = '{"profile":{"command":"done"}}'; 644 ppayload = '{"profile":{"command":"done"}}';
619 newProfile = true; 645 newProfile = true;
620 } 646 }
621 } 647 }
633 $("#FLog").jqxButton({ template: "primary", width: '150px', theme: theme }); 659 $("#FLog").jqxButton({ template: "primary", width: '150px', theme: theme });
634 $("#FLog").click(function () { 660 $("#FLog").click(function () {
635 var url="log_fermentation.php?code=" + record.beercode + "&name=" + record.beername; 661 var url="log_fermentation.php?code=" + record.beercode + "&name=" + record.beername;
636 window.open(url); 662 window.open(url);
637 }); 663 });
664 createAbortElements();
638 }); 665 });

mercurial