Deleted the file from the git repository
16548
mongoose-new/mongoose.c
16361
mongoose-old/mongoose.c
|
@ -1,196 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset=utf-8 />
|
||||
<title>Feakes Inc, Aqualink RS control daemon</title>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
<!--<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />-->
|
||||
<!--<meta name="viewport" content="width=device-width, user-scalable=yes, width=800"/>-->
|
||||
<!--<meta name="viewport" content="width=device-width, user-scalable=yes"/>-->
|
||||
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0"/>
|
||||
<!--<link href="aqualinkd.png" rel="apple-touch-icon" sizes="180x180" />-->
|
||||
<!--<link href="aqualinkd.png" rel="icon" sizes="128x128" />-->
|
||||
<link href="aqualinkd.png" rel="apple-touch-icon">
|
||||
<link href="aqualinkd.png" rel="icon">
|
||||
<link rel="stylesheet" href="css/small_ff.css" type="text/css">
|
||||
</head>
|
||||
|
||||
<body ontouchmove="BlockMove(event);" style="background-color:black;">
|
||||
|
||||
<div id="main_div">
|
||||
|
||||
<div id="header_div" class='bgimg'>
|
||||
<div id="line1">
|
||||
<div id="title_div">Aqualink RS8</div>
|
||||
<div id="air_temp_title_div">Air Temp:</div>
|
||||
<div id="air_temp">000 F</div>
|
||||
<div id="battery_ok_div" class="battery_image_div"><img id="battery_ok" src="" style="visibility:hidden"></div>
|
||||
<div id="battery_low_div" class="battery_image_div"><img id="battery_low" src="" style="visibility:hidden"></div>
|
||||
<div id="battery_blank_div" class="battery_image_div"><img id="battery_blank" src=""></div>
|
||||
</div>
|
||||
<div id="line2">
|
||||
<div id="net_off_div" class="net_activity_div"><img id="net_off" src="" style="visibility:visible"></div>
|
||||
<div id="net_green_div" class="net_activity_div"><img id="net_green" src="" style="visibility:hidden"></div>
|
||||
<div id="net_yellow_div" class="net_activity_div"><img id="net_yellow" src="" style="visibility:hidden"></div>
|
||||
<div id="net_red_div" class="net_activity_div"><img id="net_red" src="" style="visibility:hidden"></div>
|
||||
<div id="messages_div" align="center"></div>
|
||||
<div id="date_time">00:00 PM 00/00/00 DDD</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="body_div" class="bgimg_body">
|
||||
<div id="pool_temp_div" class="body_sub_div">
|
||||
<div id="pool_temp_title" class="temp_title_div">Pool:</div>
|
||||
<div id="pool_temp" class="temp_val_div">000 F</div>
|
||||
<div class="control_button_div">
|
||||
<div class="led_button_div" id="filter_pump">
|
||||
<div class="led_div"><img id="Filter_Pump_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="Filter_Pump_on_status" src="" style="visibility:hidden"></div>
|
||||
<div class="led_div"><img id="Filter_Pump_en_status" src="" style="visibility:hidden"></div>
|
||||
<div id="Filter_Pump" class='button black button_div' type="button" onclick="queue_command('Filter_Pump')">Filter Pump</div>
|
||||
</div>
|
||||
<div class="led_button_div" id="pool_htr">
|
||||
<div class="led_div"><img id="Pool_Heater_on_status" src="" style="visibility:hidden"></div>
|
||||
<div class="led_div"><img id="Pool_Heater_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="Pool_Heater_en_status" src="" style="visibility:hidden"></div>
|
||||
<div id="Pool_Heater" class='button black button_div' type="button" onclick="queue_command('Pool_Heater')">Heater</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pool_htr_set_pnt" class="set_pnt_val_div">000 F</div>
|
||||
<div class="set_pnt_button_div">
|
||||
<div class='button medium black set_pnt_button' type="button" onclick="incr_pool_htr('+')">+</div>
|
||||
<div class='button medium black set_pnt_button' type="button" onclick="incr_pool_htr('-')">-</div>
|
||||
</div>
|
||||
<div class="set_button_div"><div class='button black' type="button" onclick="set_temperature('POOL_HTR')">Set</div></div>
|
||||
</div>
|
||||
<div id="spa_temp_div" class="body_sub_div">
|
||||
<div id="spa_temp_title" class="temp_title_div">Spa:</div>
|
||||
<div id="spa_temp" class="temp_val_div">000 F</div>
|
||||
<div class="control_button_div">
|
||||
<div class="led_button_div" id="spa_mode">
|
||||
<div class="led_div"><img id="Spa_Mode_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="Spa_Mode_on_status" src="" style="visibility:hidden"></div>
|
||||
<div class="led_div"><img id="Spa_Mode_en_status" src="" style="visibility:hidden"></div>
|
||||
<div id="Spa_Mode" class="button black button_div" type="button" onclick="queue_command('Spa_Mode')">Spa Mode</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="led_button_div" id="aux2">
|
||||
<div class="led_div"><img id="aux2_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="aux2_on_status" src="" style="visibility:hidden"></div>
|
||||
<div id="Aux_2" class="button black button_div" type="button" onclick="queue_command('Aux_3')">Aux 2</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="led_button_div" id="aux3">
|
||||
<div class="led_div"><img id="Aux_3_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="Aux_3_on_status" src="" style="visibility:hidden"></div>
|
||||
<div class="led_div"><img id="Aux_3_en_status" src="" style="visibility:hidden"></div>
|
||||
<div id="Aux_3" class="button black button_div" type="button" onclick="queue_command('Aux_3')">Aux 3</div>
|
||||
</div>
|
||||
<div class="led_button_div" id="pool_htr">
|
||||
<div class="led_div"><img id="Spa_Heater_on_status" src="" style="visibility:hidden"></div>
|
||||
<div class="led_div"><img id="Spa_Heater_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="Spa_Heater_en_status" src="" style="visibility:hidden"></div>
|
||||
<div id="Spa_Heater" class="button black button_div" type="button" onclick="queue_command('Spa_Heater')">Heater</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="spa_htr_set_pnt" class="set_pnt_val_div">000 F</div>
|
||||
<div class="set_pnt_button_div">
|
||||
<div class='button medium black set_pnt_button' type="button" onclick="incr_spa_htr('+')">+</div>
|
||||
<div class='button medium black set_pnt_button' type="button" onclick="incr_spa_htr('-')">-</div>
|
||||
</div>
|
||||
<div class="set_button_div"><div class='button black' type="button" onclick="set_temperature('SPA_HTR')">Set</div></div>
|
||||
</div>
|
||||
|
||||
<div id="solar_htr_div" class="body_sub_div">
|
||||
<!--
|
||||
<div class="solar_led_div"><img id="Solar_Heater_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="solar_led_div"><img id="Solar_Heater_on_status" src="" style="visibility:hidden"></div>
|
||||
<div class="solar_led_div"><img id="Solar_Heater_en_status" src="" style="visibility:hidden"></div>
|
||||
<div id="Solar_Heater" onclick="queue_command('Solar_Heater')" class="button black" type="button">Solar Heater</div>
|
||||
-->
|
||||
<div class="select_pl_div">
|
||||
<select id="Light_Mode" class="select_pl_dd button black" onchange="set_light_mode(this.options[this.selectedIndex].value)">
|
||||
<option value="0">Pool Light Program</option>
|
||||
<option value="1">Voodoo Lounge - Show</option>
|
||||
<option value="2">Blue Sea</option>
|
||||
<option value="3">Royal Blue</option>
|
||||
<option value="4">Afternoon Skies</option>
|
||||
<option value="5">Aqua Green</option>
|
||||
<option value="6">Emerald</option>
|
||||
<option value="7">Cloud White</option>
|
||||
<option value="8">Warm Red</option>
|
||||
<option value="9">Flamingo</option>
|
||||
<option value="10">Vivid Violet</option>
|
||||
<option value="11">Sangria</option>
|
||||
<option value="12">Twilight - Show</option>
|
||||
<option value="13">Tranquility - Show</option>
|
||||
<option value="14">Gemstone - Show</option>
|
||||
<option value="15">USA - Show</option>
|
||||
<option value="16">Mardi Gras - Show</option>
|
||||
<option value="17">Cool Cabaret - Show</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="frz_protect_div" class="body_sub_div">
|
||||
<div id="frz_protect_title_div">Freeze Protection:</div>
|
||||
<div id="frz_protect_set_pnt">000 F</div>
|
||||
<div id="fp_set_pnt_button_div">
|
||||
<div class='button medium black set_pnt_button' type="button" onclick="incr_frz_protect('+')">+</div>
|
||||
<div class='button medium black set_pnt_button' type="button" onclick="incr_frz_protect('-')">-</div>
|
||||
</div>
|
||||
<div id="fp_set_button_div"><div class='button black' type="button" onclick="set_temperature('FRZ_PROTECT')">Set</div></div>
|
||||
</div>
|
||||
<div id="leds_div" class="body_sub_div">
|
||||
<div id="accessory_title" class="temp_title_div">Accessories:</div>
|
||||
<div class="control_button_div">
|
||||
<div class="led_button_div" id="aux1">
|
||||
<div class="led_div"><img id="Aux_1_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="Aux_1_on_status" src="" style="visibility:hidden"></div>
|
||||
<div class="led_div"><img id="Aux_1_en_status" src="" style="visibility:hidden"></div>
|
||||
<div id="Aux_1" class="button black button_div" type="button" onclick="queue_command('Aux_1')">Aux 1</div>
|
||||
</div>
|
||||
<div class="led_button_div" id="aux2">
|
||||
<div class="led_div"><img id="Aux_2_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="Aux_2_on_status" src="" style="visibility:hidden"></div>
|
||||
<div class="led_div"><img id="Aux_2_en_status" src="" style="visibility:hidden"></div>
|
||||
<div id="Aux_2" class="button black button_div" type="button" onclick="queue_command('Aux_2')">Aux 2</div>
|
||||
</div>
|
||||
<div class="led_button_div" id="aux4">
|
||||
<div class="led_div"><img id="Aux_4_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="Aux_4_on_status" src="" style="visibility:hidden"></div>
|
||||
<div class="led_div"><img id="Aux_4_en_status" src="" style="visibility:hidden"></div>
|
||||
<div id="Aux_4" class="button black button_div" type="button" onclick="queue_command('Aux_4')">Aux 4</div>
|
||||
</div>
|
||||
<div class="led_button_div" id="aux5">
|
||||
<div class="led_div"><img id="Aux_5_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="Aux_5_on_status" src="" style="visibility:hidden"></div>
|
||||
<div class="led_div"><img id="Aux_5_en_status" src="" style="visibility:hidden"></div>
|
||||
<div id="Aux_5" class="button black button_div" type="button" onclick="queue_command('Aux_5')">Aux 5</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="led_button_div" id="aux6">
|
||||
<div class="led_div"><img id="Aux_6_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="Aux_6_on_status" src="" style="visibility:hidden"></div>
|
||||
<div id="aux6_button" class="button black button_div" type="button" onclick="queue_command('KEY_AUX6')">Aux 6</div>
|
||||
</div>
|
||||
<div class="led_button_div" id="aux7">
|
||||
<div class="led_div"><img id="Aux_7_off_status" src="" style="visibility:visible"></div>
|
||||
<div class="led_div"><img id="Aux_7_on_status" src="" style="visibility:hidden"></div>
|
||||
<div id="aux7_button" class="button black button_div" type="button" onclick="queue_command('KEY_AUX7')">Aux 7</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="footer_div" class="bgimg">
|
||||
</div><!-- /footer -->
|
||||
|
||||
</div><!-- /page -->
|
||||
|
||||
<script src="js/aqualink.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,166 +0,0 @@
|
|||
|
||||
/* portrait mode (default) */
|
||||
|
||||
@media all and (orientation:portrait) {
|
||||
|
||||
#main_div{width:540px;height:550px;margin-left:0;padding:0px;}
|
||||
#body_div{position:relative;height:450px;}
|
||||
#header_div{position:relative;height:70px;}
|
||||
#footer_div{height:45px;}
|
||||
#title_div{position:absolute;top:0px;left:0px;padding:5px;}
|
||||
#air_temp_title_div{position:absolute;top:0px;right:120px;font-size:150%;}
|
||||
#air_temp{position:absolute;top:0px;right:45px;font-size:150%;}
|
||||
#messages_div{position:absolute;top:30px;left:5px;width:500px;font-size:100%;}
|
||||
#date_time{position:absolute;bottom:2px;right:5px;}
|
||||
|
||||
#pool_temp_div{position:absolute;top:5px;height:190px;width:250px;left:10px;}
|
||||
#spa_temp_div{position:absolute;top:5px;height:280px;width:250px;left:270px;}
|
||||
#leds_div{position:absolute;top:205px;height:230px;width:250px;left:10px}
|
||||
#frz_protect_div{position:absolute;top:295px;height:85px;width:250px;left:270px;}
|
||||
#solar_htr_div{position:absolute;top:390px;height:45px;width:250px;left:270px;}
|
||||
#Solar_Heater{position:absolute;bottom:5px;right:10px;width:140px;}
|
||||
#frz_protect_title_div{position:absolute;top:0px;height:50px;left:5px;font-size:125%;}
|
||||
#frz_protect_set_pnt{position:absolute;bottom:10px;height:50px;right:60px;font-size:250%;}
|
||||
#fp_set_pnt_button_div{position:absolute;bottom:20px;height:50px;right:45px;width:10px;}
|
||||
#fp_set_button_div{position:absolute;bottom:3px;left:3px;width:65px;}
|
||||
}
|
||||
/*@media only screen and (orientation:portrait){*/
|
||||
|
||||
/*@media only screen and (orientation:landscape){*/
|
||||
@media all and (orientation:landscape){
|
||||
|
||||
#main_div{width:800px;height:420px;margin-left:0;padding:0px;}
|
||||
#header_div{position:relative;height:70px;}
|
||||
#footer_div{height:45px;}
|
||||
#title_div{position:absolute;top:0;left:0;padding:5px;}
|
||||
#air_temp_title_div{position:absolute;top:0;right:215px;font-size:200%;}
|
||||
#air_temp{position:absolute;top:0;right:75px;font-size:250%;}
|
||||
#messages_div{position:absolute;bottom:2px;left:35px;width:570px;}
|
||||
#date_time{position:absolute;bottom:2px;right:5px;}
|
||||
#body_div{position:relative;height:295px;}
|
||||
#leds_div{position:absolute;top:5px;right:10px;height:230px;width:245px;}
|
||||
#pool_temp_div{position:absolute;top:5px;height:190px;width:250px;left:10px;}
|
||||
#spa_temp_div{position:absolute;top:5px;height:280px;width:250px;left:275px;}
|
||||
#solar_htr_div{position:absolute;bottom:3px;height:45px;width:245px;right:10px;}
|
||||
/*#solar_button_div{position:absolute;bottom:5px;right:10px;width:140px;}*/
|
||||
#Solar_Heater{position:absolute;bottom:5px;right:10px;width:140px;}
|
||||
#frz_protect_div{position:absolute;bottom:5px;height:85px;width:250px;left:10px;}
|
||||
#frz_protect_title_div{position:absolute;top:0px;height:50px;left:5px;font-size:125%;}
|
||||
#frz_protect_set_pnt{position:absolute;bottom:10px;height:50px;right:60px;font-size:250%;}
|
||||
#fp_set_pnt_button_div{position:absolute;bottom:20px;height:50px;right:45px;width:10px;}
|
||||
#fp_set_button_div{position:absolute;bottom:3px;left:3px;width:65px;}
|
||||
}
|
||||
|
||||
|
||||
.battery_image_div{position:absolute;top:5px;right:5px;width:30px;}
|
||||
.net_activity_div{position:absolute;bottom:2px;left:0;}
|
||||
.led_button_div{position:relative;height:37px;width:240px}
|
||||
.led_div{position:absolute;top:2px;left:15px;padding:0;}
|
||||
.button_div{position:absolute;right:0px;width:140px;}
|
||||
.control_button_div{position:absolute;top:40px;height:50px;width:245px;right:5px;}
|
||||
/*
|
||||
.htr_led_div{position:absolute;top:55px;left:15px;padding:0;}
|
||||
.htr_button_div{position:absolute;top:55px;height:45px;right:55px;width:110px;padding:0;margin:0px auto;}
|
||||
*/
|
||||
.body_sub_div{border:2px solid #a1a1a1;border-radius:15px;}
|
||||
.temp_title_div{position:absolute;top:0px;height:50px;left:5px;font-size:175%;}
|
||||
.temp_val_div{position:absolute;top:0px;height:55px;right:5px;font-size:225%;}
|
||||
.set_pnt_val_div{position:absolute;bottom:15px;height:50px;right:60px;font-size:250%;}
|
||||
.set_pnt_button_div{position:absolute;bottom:5px;height:65px;right:5px;width:50px;padding:0;}
|
||||
.set_pnt_button{position:relative;right:0px;width:5px;}
|
||||
.set_button_div{position:absolute;bottom:5px;left:5px;width:65px;}
|
||||
.solar_led_div{position:absolute;top:8px;left:10px;}
|
||||
|
||||
.select_pl_div{position:absolute;top:8px;left:10px;height:33px;width:227px;}
|
||||
.select_pl_dd{width:227px; height:33px;}
|
||||
|
||||
.button {
|
||||
display: inline-block;
|
||||
vertical-align: baseline;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
font: 16px/100% Arial, Helvetica, sans-serif;
|
||||
padding: .50em 1.5em;
|
||||
text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
|
||||
-webkit-border-radius: .5em;
|
||||
-moz-border-radius: .5em;
|
||||
border-radius: .5em;
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
|
||||
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
|
||||
}
|
||||
.button:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.button:active {
|
||||
top: 1px;
|
||||
}
|
||||
/*
|
||||
.bigrounded {
|
||||
-webkit-border-radius: 2em;
|
||||
-moz-border-radius: 2em;
|
||||
border-radius: 2em;
|
||||
}
|
||||
*/
|
||||
.medium {
|
||||
font-size: 14px;
|
||||
padding: .8em 1.5em .42em;
|
||||
}
|
||||
/*
|
||||
.small {
|
||||
font-size: 11px;
|
||||
padding: .2em 1em .275em;
|
||||
}
|
||||
*/
|
||||
.black {
|
||||
color: #d7d7d7;
|
||||
border: solid 1px #333;
|
||||
background: #333;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#000));
|
||||
background: -moz-linear-gradient(top, #666, #000);
|
||||
}
|
||||
.black:hover {
|
||||
background: #000;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#000));
|
||||
background: -moz-linear-gradient(top, #444, #000);
|
||||
}
|
||||
.black:active {
|
||||
color: #666;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#444));
|
||||
background: -moz-linear-gradient(top, #000, #444);
|
||||
}
|
||||
.bgimg {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0.15, rgb(50, 50, 50)), color-stop(0.58, rgb(0, 0, 0)), color-stop(0.79, rgb(0, 0, 0)));
|
||||
background-image: -moz-linear-gradient(top, #444, #000);
|
||||
}
|
||||
.bgimg_body {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0.15, rgb(75, 75, 75)), color-stop(0.58, rgb(50, 50, 50)), color-stop(0.79, rgb(50, 50, 50)));
|
||||
background-image: -moz-linear-gradient(top, #666, #333);
|
||||
}
|
||||
/*
|
||||
.debug_border {
|
||||
border: 2px solid #a1a1a1;
|
||||
border-radius: 15px;
|
||||
}
|
||||
*/
|
||||
div {
|
||||
border-width: 0px;
|
||||
border-style: solid;
|
||||
padding: 0px;
|
||||
}
|
||||
body, html {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: #f4f4f4;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.2 KiB |
|
@ -1 +0,0 @@
|
|||
controller.html
|
|
@ -1,535 +0,0 @@
|
|||
|
||||
if(window.innerHeight > window.innerWidth){
|
||||
orientation("portrait");
|
||||
} else {
|
||||
orientation("landscape");
|
||||
}
|
||||
|
||||
// Listen for orientation changes
|
||||
window.addEventListener("orientationchange", function() {
|
||||
// Announce the new orientation number
|
||||
//alert(window.orientation);
|
||||
if(window.innerHeight > window.innerWidth)
|
||||
orientation("portrait");
|
||||
else
|
||||
orientation("landscape");
|
||||
|
||||
}, false);
|
||||
|
||||
function orientation(or){
|
||||
//alert(or);
|
||||
viewport = document.querySelector("meta[name=viewport]");
|
||||
if (or == "landscape") {
|
||||
viewport.setAttribute('content', 'content="width=device-width, user-scalable=yes, width=800"');
|
||||
} else {
|
||||
viewport.setAttribute('content', 'content="width=device-width, user-scalable=yes, width=540"');
|
||||
}
|
||||
}
|
||||
|
||||
// aqualink.js
|
||||
|
||||
function BlockMove(event) {
|
||||
// Tell Safari not to move the window.
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
// Preload the images.
|
||||
var delay = 10;
|
||||
if (document.images) {
|
||||
//setTimeout(get_batt_ok_img, delay);
|
||||
setTimeout(loadImages, delay);
|
||||
}
|
||||
|
||||
function loadImages() {
|
||||
document.getElementById('battery_ok').src = "images/battery_ok.png";
|
||||
document.getElementById('battery_low').src = "images/battery_low.png";
|
||||
document.getElementById('battery_blank').src = "images/battery_blank.png";
|
||||
|
||||
for (var obj in aqualink_data.leds) {
|
||||
setButtonElementImage(obj+'_on_status', "images/led_on.png");
|
||||
setButtonElementImage(obj+'_off_status', "images/led_off.png");
|
||||
setButtonElementImage(obj+'_en_status', "images/led_enabled.png");
|
||||
}
|
||||
|
||||
document.getElementById('net_off').src = "images/net_off.png";
|
||||
document.getElementById('net_yellow').src = "images/net_yellow.png";
|
||||
document.getElementById('net_green').src = "images/net_green.png";
|
||||
document.getElementById('net_red').src = "images/net_red.png";
|
||||
}
|
||||
|
||||
|
||||
//function set_button_led_images
|
||||
function setButtonElementImage(element, image){
|
||||
el = document.getElementById(element);
|
||||
if (el != null) {
|
||||
el.src = image;
|
||||
}
|
||||
}
|
||||
|
||||
function LedsData() {
|
||||
this.Filter_Pump = "off";
|
||||
this.Spa_Mode = "off";
|
||||
this.Aux_1 = "off";
|
||||
//this.aux1 = "flash";
|
||||
this.Aux_2 = "off";
|
||||
this.Aux_3 = "off";
|
||||
this.Aux_4 = "off";
|
||||
this.Aux_5 = "off";
|
||||
this.Aux_6 = "off";
|
||||
this.Aux_7 = "off";
|
||||
this.Pool_Heater = "off";
|
||||
this.Spa_Heater = "off";
|
||||
this.Solar_Heater = "off";
|
||||
}
|
||||
|
||||
function AqualinkData() {
|
||||
this.version = "";
|
||||
this.date = "09/11/12 TUE";
|
||||
this.time = "10:33 AM";
|
||||
this.temp_units = "F";
|
||||
this.air_temp = "75";
|
||||
this.battery = "low";
|
||||
this.leds = new LedsData();
|
||||
}
|
||||
|
||||
function TemperatureSetPoint() {
|
||||
this.modified = false;
|
||||
this.value = 0;
|
||||
}
|
||||
|
||||
var pool_htr_set_point = new TemperatureSetPoint();
|
||||
var spa_htr_set_point = new TemperatureSetPoint();
|
||||
var freeze_protect_set_point = new TemperatureSetPoint();
|
||||
|
||||
var aqualink_data = new AqualinkData();
|
||||
var net_connection = 'red';
|
||||
|
||||
|
||||
function interval(duration, fn){
|
||||
this.baseline = undefined
|
||||
|
||||
this.run = function(){
|
||||
if(this.baseline === undefined){
|
||||
this.baseline = new Date().getTime()
|
||||
}
|
||||
fn()
|
||||
var end = new Date().getTime()
|
||||
this.baseline += duration
|
||||
|
||||
var nextTick = duration - (end - this.baseline)
|
||||
if(nextTick<0){
|
||||
nextTick = 0
|
||||
}
|
||||
(function(i){
|
||||
i.timer = setTimeout(function(){
|
||||
i.run(end)
|
||||
}, nextTick)
|
||||
}(this))
|
||||
}
|
||||
|
||||
this.stop = function(){
|
||||
clearTimeout(this.timer)
|
||||
}
|
||||
}
|
||||
|
||||
var timer = new interval(1000, function(){
|
||||
net_connection_icon();
|
||||
flash_battery_icon();
|
||||
//blink_filter_pump();
|
||||
blink_button_leds();
|
||||
})
|
||||
timer.run()
|
||||
|
||||
|
||||
function net_connection_icon() {
|
||||
if (net_connection == "red") {
|
||||
document.getElementById('messages_div').innerHTML = "Not connected!";
|
||||
document.getElementById('net_green').style.visibility = 'hidden';
|
||||
document.getElementById('net_yellow').style.visibility = 'hidden';
|
||||
if (document.getElementById('net_red').style.visibility == 'visible') {
|
||||
document.getElementById('net_red').style.visibility = 'hidden';
|
||||
} else {
|
||||
document.getElementById('net_red').style.visibility = 'visible';
|
||||
}
|
||||
} else if (net_connection == "green") {
|
||||
document.getElementById('net_green').style.visibility = 'visible';
|
||||
document.getElementById('net_red').style.visibility = 'hidden';
|
||||
document.getElementById('net_yellow').style.visibility = 'hidden';
|
||||
} else if (net_connection == "yellow") {
|
||||
document.getElementById('net_green').style.visibility = 'hidden';
|
||||
document.getElementById('net_red').style.visibility = 'hidden';
|
||||
document.getElementById('net_yellow').style.visibility = 'visible';
|
||||
}
|
||||
}
|
||||
//setInterval(net_connection_icon, 500);
|
||||
|
||||
function net_activity() {
|
||||
// Set the icon yellow.
|
||||
document.getElementById('net_green').style.visibility = 'hidden';
|
||||
document.getElementById('net_red').style.visibility = 'hidden';
|
||||
document.getElementById('net_yellow').style.visibility = 'visible';
|
||||
// Wait 10mS then set to green.
|
||||
setTimeout(function() {
|
||||
document.getElementById('net_green').style.visibility = 'visible';
|
||||
document.getElementById('net_red').style.visibility = 'hidden';
|
||||
document.getElementById('net_yellow').style.visibility = 'hidden';
|
||||
}, 50);
|
||||
}
|
||||
|
||||
function flash_battery_icon() {
|
||||
if (aqualink_data.battery == "low") {
|
||||
if (document.getElementById('battery_low').style.visibility == 'visible') {
|
||||
document.getElementById('battery_low').style.visibility = 'hidden';
|
||||
} else {
|
||||
document.getElementById('battery_low').style.visibility = 'visible';
|
||||
}
|
||||
}
|
||||
}
|
||||
//setInterval(flash_battery_icon, 500);
|
||||
/*
|
||||
function blink_filter_pump() {
|
||||
if (aqualink_data.leds.pump == "enabled") {
|
||||
document.getElementById("pump_status").src = (document.getElementById("pump_status").src.indexOf("images/led_on.png") == -1) ? "images/led_on.png" : "images/led_off.png";
|
||||
}
|
||||
}
|
||||
*/
|
||||
//setInterval(blink_filter_pump, 500);
|
||||
|
||||
|
||||
function blink_button_leds() {
|
||||
for (var obj in aqualink_data.leds) {
|
||||
if (aqualink_data.leds[obj] == "flash" && document.getElementById(obj+'_on_status') != null ) {
|
||||
if (document.getElementById(obj+'_on_status').style.visibility == 'hidden') {
|
||||
setElementVisibility(obj+'_on_status', 'visible');
|
||||
setElementVisibility(obj+'_off_status', 'hidden');
|
||||
} else {
|
||||
setElementVisibility(obj+'_on_status', 'hidden');
|
||||
setElementVisibility(obj+'_off_status', 'visible');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//setInterval(blink_aux_leds, 1500);
|
||||
|
||||
// End - Methods to Manage Flashing Images
|
||||
|
||||
// Display Update Methods
|
||||
|
||||
function update_temp(id) {
|
||||
var el = document.getElementById(id);
|
||||
var temp_string = "";
|
||||
|
||||
if (id == "air_temp") {
|
||||
temp_string = aqualink_data.air_temp;
|
||||
} else if (id == "pool_temp") {
|
||||
temp_string = aqualink_data.pool_temp;
|
||||
if (temp_string == " ") {
|
||||
temp_string = "---"
|
||||
}
|
||||
} else if (id == "spa_temp") {
|
||||
temp_string = aqualink_data.spa_temp;
|
||||
if (temp_string == " ") {
|
||||
temp_string = "---"
|
||||
}
|
||||
} else if (id == "pool_htr_set_pnt") {
|
||||
if (pool_htr_set_point.modified == true) {
|
||||
temp_string = pool_htr_set_point.value.toString();
|
||||
el.style.color = "PowderBlue";
|
||||
} else {
|
||||
temp_string = aqualink_data.pool_htr_set_pnt;
|
||||
pool_htr_set_point.value = parseInt(temp_string);
|
||||
el.style.color = "#f4f4f4";
|
||||
}
|
||||
} else if (id == "spa_htr_set_pnt") {
|
||||
if (spa_htr_set_point.modified == true) {
|
||||
temp_string = spa_htr_set_point.value.toString();
|
||||
el.style.color = "PowderBlue";
|
||||
} else {
|
||||
temp_string = aqualink_data.spa_htr_set_pnt;
|
||||
spa_htr_set_point.value = parseInt(temp_string);
|
||||
el.style.color = "#f4f4f4";
|
||||
}
|
||||
} else if (id == "frz_protect_set_pnt") {
|
||||
if (freeze_protect_set_point.modified == true) {
|
||||
temp_string = freeze_protect_set_point.value.toString();
|
||||
el.style.color = "PowderBlue";
|
||||
} else {
|
||||
temp_string = aqualink_data.frz_protect_set_pnt;
|
||||
freeze_protect_set_point.value = parseInt(temp_string);
|
||||
el.style.color = "#f4f4f4";
|
||||
}
|
||||
}
|
||||
|
||||
el.innerHTML = temp_string + "°" + aqualink_data.temp_units;
|
||||
}
|
||||
|
||||
// Adjust the Pool Heater set point. Note that its maximum value
|
||||
// is 104 and its minimum value is 0.
|
||||
function incr_pool_htr(direction) {
|
||||
if (direction == '+') {
|
||||
if (pool_htr_set_point.value < 104) {
|
||||
pool_htr_set_point.value++;
|
||||
}
|
||||
} else {
|
||||
if (pool_htr_set_point.value > 0) {
|
||||
pool_htr_set_point.value--;
|
||||
}
|
||||
}
|
||||
|
||||
if (pool_htr_set_point.value == parseInt(aqualink_data.pool_htr_set_pnt)) {
|
||||
pool_htr_set_point.modified = false;
|
||||
} else {
|
||||
pool_htr_set_point.modified = true;
|
||||
}
|
||||
|
||||
update_temp("pool_htr_set_pnt");
|
||||
}
|
||||
|
||||
// Adjust the Spa Heater set point. Note that its maximum value
|
||||
// is 104 and its minimum value is 0.
|
||||
function incr_spa_htr(direction) {
|
||||
if (direction == '+') {
|
||||
if (spa_htr_set_point.value < 104) {
|
||||
spa_htr_set_point.value++;
|
||||
}
|
||||
} else {
|
||||
if (spa_htr_set_point.value > 0) {
|
||||
spa_htr_set_point.value--;
|
||||
}
|
||||
}
|
||||
|
||||
if (spa_htr_set_point.value == parseInt(aqualink_data.spa_htr_set_pnt)) {
|
||||
spa_htr_set_point.modified = false;
|
||||
} else {
|
||||
spa_htr_set_point.modified = true;
|
||||
}
|
||||
|
||||
update_temp("spa_htr_set_pnt");
|
||||
}
|
||||
|
||||
// Adjust the Freeze Protection set point. Note that its maximum value
|
||||
// is 42 and its minimum value is 36.
|
||||
function incr_frz_protect(direction) {
|
||||
if (direction == '+') {
|
||||
if (freeze_protect_set_point.value < 42) {
|
||||
freeze_protect_set_point.value++;
|
||||
}
|
||||
} else {
|
||||
if (freeze_protect_set_point.value > 36) {
|
||||
freeze_protect_set_point.value--;
|
||||
}
|
||||
}
|
||||
|
||||
if (freeze_protect_set_point.value == parseInt(aqualink_data.frz_protect_set_pnt)) {
|
||||
freeze_protect_set_point.modified = false;
|
||||
} else {
|
||||
freeze_protect_set_point.modified = true;
|
||||
}
|
||||
|
||||
update_temp("frz_protect_set_pnt");
|
||||
}
|
||||
|
||||
function update_date_time() {
|
||||
var el = document.getElementById("date_time");
|
||||
|
||||
el.innerHTML = aqualink_data.time + " - " + aqualink_data.date;
|
||||
}
|
||||
|
||||
function setElementVisibility(element, visibility){
|
||||
//console.log("set "+element+" to "+visibility);
|
||||
el = document.getElementById(element);
|
||||
if (el != null) {
|
||||
el.style.visibility = visibility;
|
||||
//console.log("set "+element+" to "+visibility);
|
||||
}
|
||||
}
|
||||
|
||||
function update_leds() {
|
||||
//console.log("*****UPDATE LED*****");
|
||||
for (var obj in aqualink_data.leds) {
|
||||
//console.log("*****setting "+obj+" to "+aqualink_data.leds[obj]);
|
||||
if (aqualink_data.leds[obj] == "on") {
|
||||
setElementVisibility(obj+'_on_status', 'visible');
|
||||
setElementVisibility(obj+'_off_status', 'hidden');
|
||||
setElementVisibility(obj+'_en_status', 'hidden');
|
||||
} else if (aqualink_data.leds[obj] == "enabled") {
|
||||
setElementVisibility(obj+'_on_status', 'hidden');
|
||||
setElementVisibility(obj+'_off_status', 'hidden');
|
||||
setElementVisibility(obj+'_en_status', 'visible');
|
||||
} else if (aqualink_data.leds[obj] == "off") {
|
||||
setElementVisibility(obj+'_on_status', 'hidden');
|
||||
setElementVisibility(obj+'_off_status', 'visible');
|
||||
setElementVisibility(obj+'_en_status', 'hidden');
|
||||
} else if (aqualink_data.leds[obj] == "flash") {
|
||||
// Don't set any other visibility or it'll mess up the flasher timer.
|
||||
setElementVisibility(obj+'_en_status', 'hidden');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function update_status(data) {
|
||||
aqualink_data = data;
|
||||
//console.log(aqualink_data.version);
|
||||
//console.log('updating status...');
|
||||
if (aqualink_data.battery == "ok") {
|
||||
document.getElementById('battery_low').style.visibility = 'hidden';
|
||||
document.getElementById('battery_ok').style.visibility = 'visible';
|
||||
} else {
|
||||
document.getElementById('battery_ok').style.visibility = 'hidden';
|
||||
}
|
||||
|
||||
if (aqualink_data.status == "Ready") {
|
||||
document.getElementById('messages_div').innerHTML = "";
|
||||
} else if (aqualink_data.status == "Programming") {
|
||||
document.getElementById('messages_div').innerHTML = aqualink_data.status+" (please wait!)";
|
||||
} else {
|
||||
document.getElementById('messages_div').innerHTML = aqualink_data.status;
|
||||
}
|
||||
|
||||
update_temp("air_temp");
|
||||
update_temp("pool_temp");
|
||||
update_temp("spa_temp");
|
||||
update_temp("pool_htr_set_pnt");
|
||||
update_temp("spa_htr_set_pnt");
|
||||
update_temp("frz_protect_set_pnt");
|
||||
|
||||
update_date_time();
|
||||
|
||||
update_leds();
|
||||
}
|
||||
|
||||
function set_aux_button_labels(data) {
|
||||
//console.log("Aux 1=" + data.Aux_1);
|
||||
for (var obj in data) {
|
||||
//console.log("sent "+obj+" to "+data[obj]);
|
||||
button = document.getElementById(obj);
|
||||
if (button != null) {
|
||||
button.innerHTML = data[obj];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//alert(BrowserDetect.browser + ' : ' + BrowserDetect.version);
|
||||
|
||||
function get_appropriate_ws_url() {
|
||||
var pcol;
|
||||
var u = document.URL;
|
||||
|
||||
/*
|
||||
* We open the websocket encrypted if this page came on an
|
||||
* https:// url itself, otherwise unencrypted
|
||||
*/
|
||||
|
||||
if (u.substring(0, 5) == "https") {
|
||||
pcol = "wss://";
|
||||
u = u.substr(8);
|
||||
} else {
|
||||
pcol = "ws://";
|
||||
if (u.substring(0, 4) == "http")
|
||||
u = u.substr(7);
|
||||
}
|
||||
|
||||
u = u.split('/');
|
||||
|
||||
//alert (pcol + u[0] + ":6500");
|
||||
|
||||
return pcol + u[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* dumb increment protocol */
|
||||
var socket_di;
|
||||
|
||||
function startWebsockets() {
|
||||
socket_di = new WebSocket(get_appropriate_ws_url());
|
||||
/*
|
||||
if (BrowserDetect.browser == "Firefox" && BrowserDetect.version < 12) {
|
||||
//socket_di = new MozWebSocket(get_appropriate_ws_url(), "dumb-increment-protocol");
|
||||
socket_di = new MozWebSocket(get_appropriate_ws_url());
|
||||
} else {
|
||||
//socket_di = new WebSocket(get_appropriate_ws_url(), "dumb-increment-protocol");
|
||||
socket_di = new WebSocket(get_appropriate_ws_url());
|
||||
}
|
||||
*/
|
||||
try {
|
||||
socket_di.onopen = function() {
|
||||
// success!
|
||||
get_aux_labels();
|
||||
net_connection = 'green';
|
||||
}
|
||||
|
||||
socket_di.onmessage = function got_packet(msg) {
|
||||
net_activity();
|
||||
var data = JSON.parse(msg.data);
|
||||
if (data.type == 'status') {
|
||||
update_status(data);
|
||||
} else if (data.type == 'aux_labels') {
|
||||
set_aux_button_labels(data);
|
||||
}
|
||||
}
|
||||
|
||||
socket_di.onclose = function() {
|
||||
// something went wrong
|
||||
net_connection = 'red';
|
||||
// Try to reconnect every 5 seconds.
|
||||
setTimeout(function() {
|
||||
startWebsockets()
|
||||
}, 5000);
|
||||
}
|
||||
} catch (exception) {
|
||||
alert('<p>Error' + exception);
|
||||
}
|
||||
}
|
||||
|
||||
function reset() {
|
||||
socket_di.send("reset\n");
|
||||
}
|
||||
|
||||
function get_aux_labels() {
|
||||
//socket_di.send("GET_AUX_LABELS");
|
||||
var msg = {command: "GET_AUX_LABELS"};
|
||||
// Send the msg object as a JSON-formatted string.
|
||||
socket_di.send(JSON.stringify(msg));
|
||||
}
|
||||
|
||||
function queue_command(cmd) {
|
||||
var _cmd = {};
|
||||
_cmd.command = cmd;
|
||||
|
||||
socket_di.send(JSON.stringify(_cmd));
|
||||
}
|
||||
|
||||
function set_temperature(type) {
|
||||
var temperature = {};
|
||||
|
||||
if (type == "POOL_HTR") {
|
||||
temperature.parameter = type;
|
||||
temperature.value = pool_htr_set_point.value;
|
||||
pool_htr_set_point.modified = false;
|
||||
} else if (type == "SPA_HTR") {
|
||||
temperature.parameter = type;
|
||||
temperature.value = spa_htr_set_point.value;
|
||||
spa_htr_set_point.modified = false;
|
||||
} else if (type == "FRZ_PROTECT") {
|
||||
temperature.parameter = type;
|
||||
temperature.value = freeze_protect_set_point.value;
|
||||
freeze_protect_set_point.modified = false;
|
||||
}
|
||||
|
||||
socket_di.send(JSON.stringify(temperature));
|
||||
}
|
||||
|
||||
function set_light_mode(value) {
|
||||
var mode = {};
|
||||
|
||||
mode.parameter = 'POOL_LIGHT_MODE';
|
||||
mode.value = value;
|
||||
socket_di.send(JSON.stringify(mode));
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
startWebsockets();
|
||||
|
||||
}
|