|
|
|
|
|
<!DOCTYPE html> |
|
|
<html> |
|
|
<head> |
|
|
<meta http-equiv="cache-control" |
|
|
content="max-age=0" /> |
|
|
<meta http-equiv="cache-control" |
|
|
content="no-store" /> |
|
|
<meta http-equiv="expires" |
|
|
content="-1" /> |
|
|
<meta http-equiv="expires" |
|
|
content="Tue, 01 Jan 1980 1:00:00 GMT" /> |
|
|
<meta http-equiv="pragma" |
|
|
content="no-cache" /> |
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
|
|
<!--meta http-equiv="refresh" content="300" />--> <!--Refresh each 5s--> |
|
|
<meta charset="utf-8" /> |
|
|
|
|
|
<style> |
|
|
|
|
|
body, html { |
|
|
font-family: "Arial"; |
|
|
} |
|
|
|
|
|
.titlebox { |
|
|
float: left; |
|
|
padding: 0 5px; |
|
|
margin: -30px 0 0 20px; |
|
|
background: #fff; |
|
|
} |
|
|
|
|
|
.div-relative { |
|
|
position: relative; |
|
|
color: #000000; |
|
|
width: 480px; |
|
|
height: 320px; |
|
|
} |
|
|
|
|
|
.div-a { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
|
|
|
.div-b { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
|
|
|
.div-c { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
|
|
|
.div-d { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
|
|
|
.div-e { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
|
|
|
.div-f { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
|
|
|
.div-g { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
|
|
|
.div-h { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
</style> |
|
|
|
|
|
<!--meta http-equiv="refresh" content="300" />--> <!--Refresh each 5s--> |
|
|
|
|
|
<title>AI Engine</title> |
|
|
|
|
|
<script src="jquery_3_2_1.min.js"></script> |
|
|
<script src="fabric_jquery.easyui.min_compressed_on_nvr.js"></script> |
|
|
<script src="config.js"></script> |
|
|
<script> |
|
|
window.onerror = function (message, url, linenumber) { |
|
|
|
|
|
console.log('JavaScript error: ' + message + ' on line ' + linenumber + ' for ' + url); |
|
|
|
|
|
if (url.search("config.js") >= 1) { |
|
|
loadScript("config.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("fabric_jquery.easyui.min_compressed_on_nvr.js") >= 1) { |
|
|
loadScript("fabric_jquery.easyui.min_compressed_on_nvr.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (message.search("slider") >= 1) { |
|
|
loadScript("fabric_jquery.easyui.min_compressed_on_nvr.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("cookie.min.js") >= 1) { |
|
|
loadScript("cookie.min.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("lang.js") >= 1) { |
|
|
loadScript("lang.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("label_names.js") >= 1) { |
|
|
loadScript("label_names.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("lang_cookie.js") >= 1) { |
|
|
loadScript("lang_cookie.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (message.search("myport") >= 1) { |
|
|
loadScript("config.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("speed_index.js") >= 1) { |
|
|
loadScript("speed_index.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (message.search("cookie") >= 1) { |
|
|
loadScript("cookie.min.js", function () { |
|
|
}); |
|
|
} |
|
|
else { |
|
|
//location.reload(); |
|
|
var replaceUrl = 'http://' + window.location.hostname + ':' + GetUrlPort() + '/Aida/speed_index.html'; |
|
|
//alert(replaceUrl); |
|
|
window.location.replace(replaceUrl); |
|
|
} |
|
|
} |
|
|
function GetUrlPort() { |
|
|
var url_href = window.location.href; |
|
|
var arr_url = url_href.split(":")[2].split("/")[0]; |
|
|
|
|
|
return arr_url; |
|
|
} |
|
|
if (window.history.replaceState) { |
|
|
window.history.replaceState(null, null, window.location.href); |
|
|
} |
|
|
</script> |
|
|
<script src="cookie.min.js"></script> |
|
|
|
|
|
<script src="lang.js"></script> |
|
|
<script src="label_names.js"></script> |
|
|
|
|
|
<script src="lang_cookie.js"></script> |
|
|
|
|
|
<script src="speed_index.js"></script> |
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="bootstrap.min.css"> |
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="easyui.css"> |
|
|
|
|
|
<script> |
|
|
|
|
|
$(document).ready(function () { |
|
|
|
|
|
}); |
|
|
|
|
|
</script> |
|
|
</head> |
|
|
|
|
|
<body onContextMenu="window.event.returnValue=false"> |
|
|
|
|
|
<div class="progress" style="background-color:white"> |
|
|
<div class="progress-bar progress-bar-striped" style="min-width: 20px;visibility:hidden;"></div> |
|
|
</div> |
|
|
<div align="center" class="test" div style="border:1px gray solid;padding:20px;margin:15px 15px 15px 15px"> |
|
|
<div class="titlebox"><nobr id="TITLEBOX_PAGE12"></nobr></div> |
|
|
|
|
|
<div class="div-relative"> |
|
|
<div class="div-a"> |
|
|
<canvas id="CanvasTripwire1"></canvas> |
|
|
</div> |
|
|
<div class="div-b"> |
|
|
<canvas id="CanvasTripwire2"></canvas> |
|
|
</div> |
|
|
<div class="div-c"> |
|
|
<canvas id="CanvasTripwire3"></canvas> |
|
|
</div> |
|
|
<div class="div-d"> |
|
|
<canvas id="CanvasTripwire4"></canvas> |
|
|
</div> |
|
|
<div class="div-e"> |
|
|
<canvas id="CanvasTripwire5"></canvas> |
|
|
</div> |
|
|
<div class="div-f"> |
|
|
<canvas id="CanvasTripwire6"></canvas> |
|
|
</div> |
|
|
<div class="div-g"> |
|
|
<canvas id="CanvasTripwire7"></canvas> |
|
|
</div> |
|
|
<div class="div-h"> |
|
|
<canvas id="CanvasTripwire8"></canvas> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- <table valign="center" style="border-collapse: collapse; width: 300px; height: 160px;" border="0"> --> |
|
|
<table align="center" valign="center" style="border-collapse: collapse; width: 450px; height: auto; "> |
|
|
<tbody> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 350px; height: 20px;"> <nobr id="IDC_STATIC_DETECTION_ZONE"></nobr></td> |
|
|
<td style="width: 500px; height: 20px;"> |
|
|
|
|
|
<input id="dzone_1" type="button" onclick="func_set_zone_cookie1();" value="1" /> |
|
|
<input id="dzone_2" type="button" onclick="func_set_zone_cookie2();" value="2" /> |
|
|
<input id="dzone_3" type="button" onclick="func_set_zone_cookie3();" value="3" /> |
|
|
<input id="dzone_4" type="button" onclick="func_set_zone_cookie4();" value="4" /> |
|
|
<input id="dzone_5" type="button" onclick="func_set_zone_cookie5();" value="5" /> |
|
|
<input id="dzone_6" type="button" onclick="func_set_zone_cookie6();" value="6" /> |
|
|
<input id="dzone_7" type="button" onclick="func_set_zone_cookie7();" value="7" /> |
|
|
<input id="dzone_8" type="button" onclick="func_set_zone_cookie8();" value="8" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 350px; height: 20px;"> <nobr id="IDC_CHECK_ENABLE_SPEED"></nobr></td> |
|
|
<td style="width: 500px; height: 20px;"> |
|
|
<input id="enable_speed" type="checkbox" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;display:none"> |
|
|
<td style="width: 350px; height: 20px;"> <nobr id="IDC_CHECK_ENABLE_RADAR_SPEED"></nobr></td> |
|
|
<td style="width: 500px; height: 20px;"> |
|
|
<input id="enable_radar_speed" type="checkbox" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 350px; height: 20px;"> <nobr id="IDC_STATIC_OVERSPEED"></nobr><nobr id="SPEED_UNIT"></nobr></td> |
|
|
<td style="width: 500px; height: 20px;"> |
|
|
|
|
|
<input class="easyui-slider" id="overspeed" style="width:300px" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 350px; height: 20px;"> <nobr id="IDC_STATIC_BORDER_1"></nobr></td> |
|
|
<td style="width: 500px; height: 20px;"> |
|
|
|
|
|
<input class="easyui-slider" id="border_1" style="width:300px" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 350px; height: 20px;"> <nobr id="IDC_STATIC_BORDER_2"></nobr></td> |
|
|
<td style="width: 500px; height: 20px;"> |
|
|
|
|
|
<input class="easyui-slider" id="border_2" style="width:300px" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 350px; height: 20px;"> <nobr id="IDC_STATIC_BORDER_UNIT"></nobr></td> |
|
|
<td style="width: 500px; height: 20px;"> |
|
|
|
|
|
<select name="border_unit" id="border_unit" onchange=""> |
|
|
<option value="meter"></option> |
|
|
<!--<option value="kilometer"></option>--> |
|
|
<option value="foot"></option> |
|
|
<!--<option value="yard"></option>--> |
|
|
<!--<option value="mile"></option>--> |
|
|
</select> |
|
|
</td> |
|
|
</tr> |
|
|
<!-- |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 150px; height: 20px;" id="IDC_STATIC_TIME_UNIT"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
|
|
|
<select name="time_unit" id="time_unit" onchange=""> |
|
|
<option value="KPH"></option> |
|
|
<option value="MPH"></option> |
|
|
</select> |
|
|
</td> |
|
|
</tr>--> |
|
|
</tbody> |
|
|
</table> |
|
|
</div> |
|
|
|
|
|
<div> |
|
|
<div align="center"> |
|
|
<input align="center" id="IDOK" type="button" value=" Set " onclick="func_setspeed()" style="background-color:#6c87d4;color:white;height:36px;width:300px;" /> |
|
|
</div> |
|
|
</div> |
|
|
<!-- <div> |
|
|
<textarea style="width: 1700px; height: 500px;" id="test_txtbox"></textarea> |
|
|
</div> --> |
|
|
|
|
|
<script> |
|
|
/* |
|
|
loadScript("config.js", function () { |
|
|
loadScript("cookie.min.js", function () { |
|
|
loadScript("lang.js", function () { |
|
|
loadScript("lang_cookie.js", function () { |
|
|
//alert("all load"); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
});*/ |
|
|
|
|
|
function loadScript(url, callback) { |
|
|
var script = document.createElement("Script"); |
|
|
script.type = "text/javascript"; |
|
|
|
|
|
//IE 验证脚本是否下载完成 |
|
|
if (script.readyState) { |
|
|
script.onreadystatechange = function () { |
|
|
//readyState属性有5种取值 |
|
|
//uninitialized:初始状态 |
|
|
//loading:开始下载 |
|
|
//interactive:数据完成下载但尚不可用 |
|
|
//complete:数据已经准备就绪 |
|
|
//实际使用时,readyState的值并不像我们预想的那样有规律,实践发现使用readyState |
|
|
//最靠谱的方式是同时检查以下2个状态,只要其中1个触发,就认为脚本下载完成。 |
|
|
if (script.readyState == "loaded" || script.readyState == "complete") { |
|
|
//移除事件处理器,确保事件不会处理2次 |
|
|
script.onreadystatechange = null; |
|
|
callback(); |
|
|
} |
|
|
}; |
|
|
} |
|
|
|
|
|
//其他浏览器 |
|
|
else { |
|
|
script.onload = function () { |
|
|
callback(); |
|
|
}; |
|
|
} |
|
|
|
|
|
script.src = url; |
|
|
//把新建的<Script>添加到<head>里比添加到<body>里更保险。 |
|
|
document.getElementsByTagName("head")[0].appendChild(script); |
|
|
} |
|
|
|
|
|
if (localStorage.getItem('current_state_hide_or_open_label') == null) |
|
|
localStorage.setItem('current_state_hide_or_open_label', 0); |
|
|
else |
|
|
current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label'); |
|
|
|
|
|
if (localStorage.getItem('current_state_hide_or_open_direction') == null) |
|
|
localStorage.setItem('current_state_hide_or_open_direction', 0); |
|
|
else |
|
|
current_state_hide_or_open_direction = localStorage.getItem('current_state_hide_or_open_direction'); |
|
|
|
|
|
if (localStorage.getItem('current_state_hide_or_open_speed') == null) |
|
|
localStorage.setItem('current_state_hide_or_open_speed', 0); |
|
|
else |
|
|
current_state_hide_or_open_speed = localStorage.getItem('current_state_hide_or_open_speed'); |
|
|
|
|
|
//UI Interface |
|
|
|
|
|
func_get_zone_cookie(); |
|
|
func_get_lang_cookie(); |
|
|
|
|
|
document.getElementById("IDC_CHECK_ENABLE_SPEED").innerHTML = IDC_CHECK_ENABLE_SPEED; |
|
|
document.getElementById("IDC_CHECK_ENABLE_RADAR_SPEED").innerHTML = IDC_CHECK_ENABLE_RADAR_SPEED; |
|
|
document.getElementById("IDC_STATIC_BORDER_1").innerHTML = IDC_STATIC_BORDER_1; |
|
|
document.getElementById("IDC_STATIC_BORDER_2").innerHTML = IDC_STATIC_BORDER_2; |
|
|
document.getElementById("IDC_STATIC_OVERSPEED").innerHTML = IDC_STATIC_OVERSPEED; |
|
|
document.getElementById("IDC_STATIC_BORDER_UNIT").innerHTML = IDC_STATIC_BORDER_UNIT; |
|
|
//document.getElementById("IDC_STATIC_TIME_UNIT").innerHTML = IDC_STATIC_TIME_UNIT; |
|
|
$('#IDOK').val(IDOK); |
|
|
document.getElementById("TITLEBOX_PAGE12").innerHTML = TITLEBOX_PAGE12; |
|
|
|
|
|
document.getElementById("SPEED_UNIT").innerHTML = ""; |
|
|
document.getElementById("IDC_STATIC_DETECTION_ZONE").innerHTML = IDC_STATIC_DETECTION_ZONE; |
|
|
// document.getElementById("IDC_STATIC_SPEED_NOTICE").innerHTML = IDC_STATIC_SPEED_NOTICE; |
|
|
|
|
|
var current_dzone = "dzone_1"; |
|
|
|
|
|
var count_zone = 0; |
|
|
|
|
|
var points_x_config = new Array(MAX_DETECTION_ZONE); |
|
|
var points_y_config = new Array(MAX_DETECTION_ZONE); |
|
|
|
|
|
var tab_view_size = new Array(2); |
|
|
|
|
|
var enable_speed = new Array(MAX_DETECTION_ZONE); |
|
|
var enable_radar_speed = new Array(MAX_DETECTION_ZONE); |
|
|
var set_distance = new Array(MAX_DETECTION_ZONE); |
|
|
var world_distance_unit = new Array(MAX_DETECTION_ZONE); |
|
|
var world_distance_side1 = new Array(MAX_DETECTION_ZONE); |
|
|
var world_distance_side2 = new Array(MAX_DETECTION_ZONE); |
|
|
var world_time_unit = new Array(MAX_DETECTION_ZONE); |
|
|
|
|
|
var enable_direction = new Array(MAX_DETECTION_ZONE); |
|
|
|
|
|
{ |
|
|
for (var i = 0; i < MAX_DETECTION_ZONE; i++) { |
|
|
points_x_config[i] = new Array(MAX_SIZE_POINTS); |
|
|
points_y_config[i] = new Array(MAX_SIZE_POINTS); |
|
|
enable_speed[i] = "No"; |
|
|
enable_radar_speed[i] = "No"; |
|
|
set_distance[i] = "10"; |
|
|
world_distance_unit[i] = "meter"; |
|
|
world_distance_side1[i] = "10"; |
|
|
world_distance_side2[i] = "10"; |
|
|
world_time_unit[i] = "KPH"; |
|
|
} |
|
|
} |
|
|
|
|
|
var image_width = GetMaxWidth(); |
|
|
var image_height = GetMaxHeight(); |
|
|
//var index_min_yes = -1; |
|
|
|
|
|
|
|
|
func_getZoneData(); |
|
|
func_getSpeedData(); |
|
|
enable_detection_zone_button(); |
|
|
change_color_of_button_zone(); |
|
|
|
|
|
createCanvasTrafficLight_speed([{ |
|
|
x: Math.round(points_x_config[0][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[0][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[0][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[0][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][3] * image_height / tab_view_size[1]) |
|
|
}/*, { |
|
|
x: Math.round(points_x_config[0][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[0][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][5] * image_height / tab_view_size[1]) |
|
|
}*/], |
|
|
[{ |
|
|
x: Math.round(points_x_config[1][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[1][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[1][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[1][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][3] * image_height / tab_view_size[1]) |
|
|
}/*, { |
|
|
x: Math.round(points_x_config[1][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[1][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][5] * image_height / tab_view_size[1]) |
|
|
}*/], |
|
|
[{ |
|
|
x: Math.round(points_x_config[2][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[2][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[2][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[2][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][3] * image_height / tab_view_size[1]) |
|
|
}/*, { |
|
|
x: Math.round(points_x_config[2][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[2][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][5] * image_height / tab_view_size[1]) |
|
|
}*/], |
|
|
[{ |
|
|
x: Math.round(points_x_config[3][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[3][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[3][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[3][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][3] * image_height / tab_view_size[1]) |
|
|
}/*, { |
|
|
x: Math.round(points_x_config[3][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[3][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][5] * image_height / tab_view_size[1]) |
|
|
}*/], |
|
|
[{ |
|
|
x: Math.round(points_x_config[4][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[4][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[4][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[4][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[4][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[4][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[4][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[4][3] * image_height / tab_view_size[1]) |
|
|
}/*, { |
|
|
x: Math.round(points_x_config[4][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[4][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[4][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[4][5] * image_height / tab_view_size[1]) |
|
|
}*/], |
|
|
[{ |
|
|
x: Math.round(points_x_config[5][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[5][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[5][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[5][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[5][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[5][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[5][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[5][3] * image_height / tab_view_size[1]) |
|
|
}/*, { |
|
|
x: Math.round(points_x_config[5][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[5][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[5][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[5][5] * image_height / tab_view_size[1]) |
|
|
}*/], |
|
|
[{ |
|
|
x: Math.round(points_x_config[6][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[6][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[6][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[6][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[6][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[6][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[6][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[6][3] * image_height / tab_view_size[1]) |
|
|
}/*, { |
|
|
x: Math.round(points_x_config[6][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[6][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[6][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[6][5] * image_height / tab_view_size[1]) |
|
|
}*/], |
|
|
[{ |
|
|
x: Math.round(points_x_config[7][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[7][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[7][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[7][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[7][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[7][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[7][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[7][3] * image_height / tab_view_size[1]) |
|
|
}/*, { |
|
|
x: Math.round(points_x_config[7][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[7][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[7][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[7][5] * image_height / tab_view_size[1]) |
|
|
}*/]); |
|
|
createCanvasTrafficLight(); |
|
|
update_canvas(); |
|
|
|
|
|
{ |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
disabelIteraction(canvasTripwire5.getObjects()[0]); |
|
|
disabelIteraction(canvasTripwire6.getObjects()[0]); |
|
|
disabelIteraction(canvasTripwire7.getObjects()[0]); |
|
|
disabelIteraction(canvasTripwire8.getObjects()[0]); |
|
|
} |
|
|
|
|
|
if (current_dzone === "dzone_1") { |
|
|
set_g_zone_id(0); |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
set_g_zone_id(1); |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
set_g_zone_id(2); |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
set_g_zone_id(3); |
|
|
} |
|
|
else if (current_dzone === "dzone_5") { |
|
|
set_g_zone_id(4); |
|
|
} |
|
|
else if (current_dzone === "dzone_6") { |
|
|
set_g_zone_id(5); |
|
|
} |
|
|
else if (current_dzone === "dzone_7") { |
|
|
set_g_zone_id(6); |
|
|
} |
|
|
else { |
|
|
set_g_zone_id(7); |
|
|
} |
|
|
|
|
|
$("#overspeed").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: 12, |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
min: 1, |
|
|
max: 100, |
|
|
step:0.5, |
|
|
//提示格式函数 |
|
|
tipFormatter: function (value) { |
|
|
// return '['+value+']'; |
|
|
return value; |
|
|
}, |
|
|
onChange: function (newValue, oldValue) { |
|
|
// alert(newValue+" | "+oldValue); |
|
|
}, |
|
|
onSlideStart: function (value) { |
|
|
// alert(value); |
|
|
}, |
|
|
onSlideEnd: function (value) { |
|
|
// alert(value); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
$("#border_1").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: [1, 30], |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//range: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
min: 1, |
|
|
max: 100, |
|
|
step:0.5, |
|
|
//提示格式函数 |
|
|
tipFormatter: function (value) { |
|
|
// return '['+value+']'; |
|
|
return value; |
|
|
}, |
|
|
onChange: function (newValue, oldValue) { |
|
|
// alert(newValue+" | "+oldValue); |
|
|
}, |
|
|
onSlideStart: function (value) { |
|
|
// alert(value); |
|
|
}, |
|
|
onSlideEnd: function (value) { |
|
|
// alert(value); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
$("#border_2").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: [1, 30], |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//range: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
min: 1, |
|
|
max: 100, |
|
|
step: 0.5, |
|
|
//提示格式函数 |
|
|
tipFormatter: function (value) { |
|
|
// return '['+value+']'; |
|
|
return value; |
|
|
}, |
|
|
onChange: function (newValue, oldValue) { |
|
|
// alert(newValue+" | "+oldValue); |
|
|
}, |
|
|
onSlideStart: function (value) { |
|
|
// alert(value); |
|
|
}, |
|
|
onSlideEnd: function (value) { |
|
|
// alert(value); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
func_hide_not_direction_zone(); |
|
|
func_showSpeedData(); |
|
|
|
|
|
if (current_dzone === "dzone_1") { |
|
|
show_pixels_for_zone(world_distance_side1[0], world_distance_side2[0]); |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
show_pixels_for_zone(world_distance_side1[1], world_distance_side2[1]); |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
show_pixels_for_zone(world_distance_side1[2], world_distance_side2[2]); |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
show_pixels_for_zone(world_distance_side1[3], world_distance_side2[3]); |
|
|
} |
|
|
else if (current_dzone === "dzone_5") { |
|
|
show_pixels_for_zone(world_distance_side1[4], world_distance_side2[4]); |
|
|
} |
|
|
else if (current_dzone === "dzone_6") { |
|
|
show_pixels_for_zone(world_distance_side1[5], world_distance_side2[5]); |
|
|
} |
|
|
else if (current_dzone === "dzone_7") { |
|
|
show_pixels_for_zone(world_distance_side1[6], world_distance_side2[6]); |
|
|
} |
|
|
else if (current_dzone === "dzone_8") { |
|
|
show_pixels_for_zone(world_distance_side1[7], world_distance_side2[7]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie1() { |
|
|
if (current_dzone != "dzone_1") { |
|
|
func_setSpeedData(); |
|
|
} |
|
|
|
|
|
cookie("DZONE", "dzone_1", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_1"; |
|
|
change_color_of_button_zone(); |
|
|
func_showSpeedData(); |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
|
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit5() === 1) { |
|
|
disabelIteraction(canvasTripwire5.getObjects()[0]); |
|
|
Edit5(); |
|
|
} |
|
|
|
|
|
if (get_check_edit6() === 1) { |
|
|
disabelIteraction(canvasTripwire6.getObjects()[0]); |
|
|
Edit6(); |
|
|
} |
|
|
|
|
|
if (get_check_edit7() === 1) { |
|
|
disabelIteraction(canvasTripwire7.getObjects()[0]); |
|
|
Edit7(); |
|
|
} |
|
|
|
|
|
if (get_check_edit8() === 1) { |
|
|
disabelIteraction(canvasTripwire8.getObjects()[0]); |
|
|
Edit8(); |
|
|
} |
|
|
|
|
|
set_g_zone_id(0); |
|
|
|
|
|
/* |
|
|
if (get_check_edit1() === 0) { |
|
|
enableIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
}*/ |
|
|
show_pixels_for_zone(world_distance_side1[0], world_distance_side2[0]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie2() { |
|
|
if (current_dzone != "dzone_2") { |
|
|
func_setSpeedData(); |
|
|
} |
|
|
|
|
|
cookie("DZONE", "dzone_2", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_2"; |
|
|
change_color_of_button_zone(); |
|
|
func_showSpeedData(); |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
|
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
|
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
|
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit5() === 1) { |
|
|
disabelIteraction(canvasTripwire5.getObjects()[0]); |
|
|
Edit5(); |
|
|
} |
|
|
|
|
|
if (get_check_edit6() === 1) { |
|
|
disabelIteraction(canvasTripwire6.getObjects()[0]); |
|
|
Edit6(); |
|
|
} |
|
|
|
|
|
if (get_check_edit7() === 1) { |
|
|
disabelIteraction(canvasTripwire7.getObjects()[0]); |
|
|
Edit7(); |
|
|
} |
|
|
|
|
|
if (get_check_edit8() === 1) { |
|
|
disabelIteraction(canvasTripwire8.getObjects()[0]); |
|
|
Edit8(); |
|
|
} |
|
|
|
|
|
set_g_zone_id(1); |
|
|
|
|
|
/* |
|
|
if (get_check_edit2() === 0) { |
|
|
enableIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
}*/ |
|
|
show_pixels_for_zone(world_distance_side1[1], world_distance_side2[1]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie3() { |
|
|
if (current_dzone != "dzone_3") { |
|
|
func_setSpeedData(); |
|
|
} |
|
|
|
|
|
cookie("DZONE", "dzone_3", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_3"; |
|
|
change_color_of_button_zone(); |
|
|
func_showSpeedData(); |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
|
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
|
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit5() === 1) { |
|
|
disabelIteraction(canvasTripwire5.getObjects()[0]); |
|
|
Edit5(); |
|
|
} |
|
|
|
|
|
if (get_check_edit6() === 1) { |
|
|
disabelIteraction(canvasTripwire6.getObjects()[0]); |
|
|
Edit6(); |
|
|
} |
|
|
|
|
|
if (get_check_edit7() === 1) { |
|
|
disabelIteraction(canvasTripwire7.getObjects()[0]); |
|
|
Edit7(); |
|
|
} |
|
|
|
|
|
if (get_check_edit8() === 1) { |
|
|
disabelIteraction(canvasTripwire8.getObjects()[0]); |
|
|
Edit8(); |
|
|
} |
|
|
|
|
|
set_g_zone_id(2); |
|
|
|
|
|
/* |
|
|
if (get_check_edit3() === 0) { |
|
|
enableIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
}*/ |
|
|
show_pixels_for_zone(world_distance_side1[2], world_distance_side2[2]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie4() { |
|
|
if (current_dzone != "dzone_4") { |
|
|
func_setSpeedData(); |
|
|
} |
|
|
|
|
|
cookie("DZONE", "dzone_4", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_4"; |
|
|
change_color_of_button_zone(); |
|
|
func_showSpeedData(); |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
|
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit5() === 1) { |
|
|
disabelIteraction(canvasTripwire5.getObjects()[0]); |
|
|
Edit5(); |
|
|
} |
|
|
|
|
|
if (get_check_edit6() === 1) { |
|
|
disabelIteraction(canvasTripwire6.getObjects()[0]); |
|
|
Edit6(); |
|
|
} |
|
|
|
|
|
if (get_check_edit7() === 1) { |
|
|
disabelIteraction(canvasTripwire7.getObjects()[0]); |
|
|
Edit7(); |
|
|
} |
|
|
|
|
|
if (get_check_edit8() === 1) { |
|
|
disabelIteraction(canvasTripwire8.getObjects()[0]); |
|
|
Edit8(); |
|
|
} |
|
|
|
|
|
set_g_zone_id(3); |
|
|
|
|
|
/* |
|
|
if (get_check_edit4() === 0) { |
|
|
enableIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
}*/ |
|
|
show_pixels_for_zone(world_distance_side1[3], world_distance_side2[3]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie5() { |
|
|
if (current_dzone != "dzone_5") { |
|
|
func_setSpeedData(); |
|
|
} |
|
|
|
|
|
cookie("DZONE", "dzone_5", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_5"; |
|
|
change_color_of_button_zone(); |
|
|
func_showSpeedData(); |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
|
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit5() === 1) { |
|
|
disabelIteraction(canvasTripwire5.getObjects()[0]); |
|
|
Edit5(); |
|
|
} |
|
|
|
|
|
if (get_check_edit6() === 1) { |
|
|
disabelIteraction(canvasTripwire6.getObjects()[0]); |
|
|
Edit6(); |
|
|
} |
|
|
|
|
|
if (get_check_edit7() === 1) { |
|
|
disabelIteraction(canvasTripwire7.getObjects()[0]); |
|
|
Edit7(); |
|
|
} |
|
|
|
|
|
if (get_check_edit8() === 1) { |
|
|
disabelIteraction(canvasTripwire8.getObjects()[0]); |
|
|
Edit8(); |
|
|
} |
|
|
|
|
|
set_g_zone_id(4); |
|
|
|
|
|
/* |
|
|
if (get_check_edit5() === 0) { |
|
|
enableIteraction(canvasTripwire5.getObjects()[0]); |
|
|
Edit5(); |
|
|
}*/ |
|
|
show_pixels_for_zone(world_distance_side1[4], world_distance_side2[4]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie6() { |
|
|
if (current_dzone != "dzone_6") { |
|
|
func_setSpeedData(); |
|
|
} |
|
|
|
|
|
cookie("DZONE", "dzone_6", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_6"; |
|
|
change_color_of_button_zone(); |
|
|
func_showSpeedData(); |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
|
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit5() === 1) { |
|
|
disabelIteraction(canvasTripwire5.getObjects()[0]); |
|
|
Edit5(); |
|
|
} |
|
|
|
|
|
if (get_check_edit6() === 1) { |
|
|
disabelIteraction(canvasTripwire6.getObjects()[0]); |
|
|
Edit6(); |
|
|
} |
|
|
|
|
|
if (get_check_edit7() === 1) { |
|
|
disabelIteraction(canvasTripwire7.getObjects()[0]); |
|
|
Edit7(); |
|
|
} |
|
|
|
|
|
if (get_check_edit8() === 1) { |
|
|
disabelIteraction(canvasTripwire8.getObjects()[0]); |
|
|
Edit8(); |
|
|
} |
|
|
|
|
|
set_g_zone_id(5); |
|
|
|
|
|
/* |
|
|
if (get_check_edit6() === 0) { |
|
|
enableIteraction(canvasTripwire6.getObjects()[0]); |
|
|
Edit6(); |
|
|
}*/ |
|
|
show_pixels_for_zone(world_distance_side1[5], world_distance_side2[5]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie7() { |
|
|
if (current_dzone != "dzone_7") { |
|
|
func_setSpeedData(); |
|
|
} |
|
|
|
|
|
cookie("DZONE", "dzone_7", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_7"; |
|
|
change_color_of_button_zone(); |
|
|
func_showSpeedData(); |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
|
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit5() === 1) { |
|
|
disabelIteraction(canvasTripwire5.getObjects()[0]); |
|
|
Edit5(); |
|
|
} |
|
|
|
|
|
if (get_check_edit6() === 1) { |
|
|
disabelIteraction(canvasTripwire6.getObjects()[0]); |
|
|
Edit6(); |
|
|
} |
|
|
|
|
|
if (get_check_edit7() === 1) { |
|
|
disabelIteraction(canvasTripwire7.getObjects()[0]); |
|
|
Edit7(); |
|
|
} |
|
|
|
|
|
if (get_check_edit8() === 1) { |
|
|
disabelIteraction(canvasTripwire8.getObjects()[0]); |
|
|
Edit8(); |
|
|
} |
|
|
|
|
|
set_g_zone_id(6); |
|
|
|
|
|
/* |
|
|
if (get_check_edit7() === 0) { |
|
|
enableIteraction(canvasTripwire7.getObjects()[0]); |
|
|
Edit7(); |
|
|
}*/ |
|
|
show_pixels_for_zone(world_distance_side1[6], world_distance_side2[6]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie8() { |
|
|
if (current_dzone != "dzone_8") { |
|
|
func_setSpeedData(); |
|
|
} |
|
|
|
|
|
cookie("DZONE", "dzone_8", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_8"; |
|
|
change_color_of_button_zone(); |
|
|
func_showSpeedData(); |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
|
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit5() === 1) { |
|
|
disabelIteraction(canvasTripwire5.getObjects()[0]); |
|
|
Edit5(); |
|
|
} |
|
|
|
|
|
if (get_check_edit6() === 1) { |
|
|
disabelIteraction(canvasTripwire6.getObjects()[0]); |
|
|
Edit6(); |
|
|
} |
|
|
|
|
|
if (get_check_edit7() === 1) { |
|
|
disabelIteraction(canvasTripwire7.getObjects()[0]); |
|
|
Edit7(); |
|
|
} |
|
|
|
|
|
if (get_check_edit8() === 1) { |
|
|
disabelIteraction(canvasTripwire8.getObjects()[0]); |
|
|
Edit8(); |
|
|
} |
|
|
|
|
|
set_g_zone_id(7); |
|
|
|
|
|
/* |
|
|
if (get_check_edit8() === 0) { |
|
|
enableIteraction(canvasTripwire8.getObjects()[0]); |
|
|
Edit8(); |
|
|
}*/ |
|
|
show_pixels_for_zone(world_distance_side1[7], world_distance_side2[7]); |
|
|
} |
|
|
|
|
|
|
|
|
function change_color_of_button_zone() { |
|
|
if (current_dzone === "dzone_1") { |
|
|
document.getElementById("dzone_1").style.background = "#6c87d4"; |
|
|
document.getElementById("dzone_2").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.background = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.borderColor = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "white"; |
|
|
document.getElementById("dzone_2").style.color = "black"; |
|
|
document.getElementById("dzone_3").style.color = "black"; |
|
|
document.getElementById("dzone_4").style.color = "black"; |
|
|
document.getElementById("dzone_5").style.color = "black"; |
|
|
document.getElementById("dzone_6").style.color = "black"; |
|
|
document.getElementById("dzone_7").style.color = "black"; |
|
|
document.getElementById("dzone_8").style.color = "black"; |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
document.getElementById("dzone_1").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.background = "#6c87d4"; |
|
|
document.getElementById("dzone_3").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.background = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.borderColor = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "black"; |
|
|
document.getElementById("dzone_2").style.color = "white"; |
|
|
document.getElementById("dzone_3").style.color = "black"; |
|
|
document.getElementById("dzone_4").style.color = "black"; |
|
|
document.getElementById("dzone_5").style.color = "black"; |
|
|
document.getElementById("dzone_6").style.color = "black"; |
|
|
document.getElementById("dzone_7").style.color = "black"; |
|
|
document.getElementById("dzone_8").style.color = "black"; |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
document.getElementById("dzone_1").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.background = "#6c87d4"; |
|
|
document.getElementById("dzone_4").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.background = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.borderColor = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "black"; |
|
|
document.getElementById("dzone_2").style.color = "black"; |
|
|
document.getElementById("dzone_3").style.color = "white"; |
|
|
document.getElementById("dzone_4").style.color = "black"; |
|
|
document.getElementById("dzone_5").style.color = "black"; |
|
|
document.getElementById("dzone_6").style.color = "black"; |
|
|
document.getElementById("dzone_7").style.color = "black"; |
|
|
document.getElementById("dzone_8").style.color = "black"; |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
document.getElementById("dzone_1").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.background = "#6c87d4"; |
|
|
document.getElementById("dzone_5").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.background = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("dzone_5").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.borderColor = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "black"; |
|
|
document.getElementById("dzone_2").style.color = "black"; |
|
|
document.getElementById("dzone_3").style.color = "black"; |
|
|
document.getElementById("dzone_4").style.color = "white"; |
|
|
document.getElementById("dzone_5").style.color = "black"; |
|
|
document.getElementById("dzone_6").style.color = "black"; |
|
|
document.getElementById("dzone_7").style.color = "black"; |
|
|
document.getElementById("dzone_8").style.color = "black"; |
|
|
} |
|
|
else if (current_dzone === "dzone_5") { |
|
|
document.getElementById("dzone_1").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.background = "#6c87d4"; |
|
|
document.getElementById("dzone_6").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.background = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("dzone_6").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.borderColor = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "black"; |
|
|
document.getElementById("dzone_2").style.color = "black"; |
|
|
document.getElementById("dzone_3").style.color = "black"; |
|
|
document.getElementById("dzone_4").style.color = "black"; |
|
|
document.getElementById("dzone_5").style.color = "white"; |
|
|
document.getElementById("dzone_6").style.color = "black"; |
|
|
document.getElementById("dzone_7").style.color = "black"; |
|
|
document.getElementById("dzone_8").style.color = "black"; |
|
|
} |
|
|
else if (current_dzone === "dzone_6") { |
|
|
document.getElementById("dzone_1").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.background = "#6c87d4"; |
|
|
document.getElementById("dzone_7").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.background = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("dzone_7").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.borderColor = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "black"; |
|
|
document.getElementById("dzone_2").style.color = "black"; |
|
|
document.getElementById("dzone_3").style.color = "black"; |
|
|
document.getElementById("dzone_4").style.color = "black"; |
|
|
document.getElementById("dzone_5").style.color = "black"; |
|
|
document.getElementById("dzone_6").style.color = "white"; |
|
|
document.getElementById("dzone_7").style.color = "black"; |
|
|
document.getElementById("dzone_8").style.color = "black"; |
|
|
} |
|
|
else if (current_dzone === "dzone_7") { |
|
|
document.getElementById("dzone_1").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.background = "#6c87d4"; |
|
|
document.getElementById("dzone_8").style.background = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("dzone_8").style.borderColor = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "black"; |
|
|
document.getElementById("dzone_2").style.color = "black"; |
|
|
document.getElementById("dzone_3").style.color = "black"; |
|
|
document.getElementById("dzone_4").style.color = "black"; |
|
|
document.getElementById("dzone_5").style.color = "black"; |
|
|
document.getElementById("dzone_6").style.color = "black"; |
|
|
document.getElementById("dzone_7").style.color = "white"; |
|
|
document.getElementById("dzone_8").style.color = "black"; |
|
|
} |
|
|
else if (current_dzone === "dzone_8") { |
|
|
document.getElementById("dzone_1").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.background = "#6c87d4"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_5").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_6").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_7").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_8").style.borderColor = "#6c87d4"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "black"; |
|
|
document.getElementById("dzone_2").style.color = "black"; |
|
|
document.getElementById("dzone_3").style.color = "black"; |
|
|
document.getElementById("dzone_4").style.color = "black"; |
|
|
document.getElementById("dzone_5").style.color = "black"; |
|
|
document.getElementById("dzone_6").style.color = "black"; |
|
|
document.getElementById("dzone_7").style.color = "black"; |
|
|
document.getElementById("dzone_8").style.color = "white"; |
|
|
} |
|
|
} |
|
|
|
|
|
function func_get_zone_cookie() { |
|
|
var list = ''; |
|
|
var cookies = cookie(); |
|
|
|
|
|
for (var v in cookies) { |
|
|
if (v === 'DZONE') |
|
|
list += cookies[v]; |
|
|
} |
|
|
|
|
|
if (list.length >= 1) { |
|
|
if (list === "dzone_1") { |
|
|
current_dzone = "dzone_1"; |
|
|
} |
|
|
else if (list === "dzone_2") { |
|
|
current_dzone = "dzone_2"; |
|
|
} |
|
|
else if (list === "dzone_3") { |
|
|
current_dzone = "dzone_3"; |
|
|
} |
|
|
else if (list === "dzone_4") { |
|
|
current_dzone = "dzone_4"; |
|
|
} |
|
|
else if (list === "dzone_5") { |
|
|
current_dzone = "dzone_5"; |
|
|
} |
|
|
else if (list === "dzone_6") { |
|
|
current_dzone = "dzone_6"; |
|
|
} |
|
|
else if (list === "dzone_7") { |
|
|
current_dzone = "dzone_7"; |
|
|
} |
|
|
else if (list === "dzone_8") { |
|
|
current_dzone = "dzone_8"; |
|
|
} |
|
|
return list; |
|
|
} |
|
|
cookie("DZONE", "dzone_1", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_1"; |
|
|
return 'dzone_1'; |
|
|
} |
|
|
|
|
|
function func_getSpeedData() { |
|
|
$.ajax({ |
|
|
url: "/getconfig?ch=01", |
|
|
type: "GET", |
|
|
async: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
success: function (retdata) { |
|
|
var jsonbuf = validatingJSON(retdata); |
|
|
|
|
|
if (jsonbuf != null) { |
|
|
for (var i = 0; i < MAX_DETECTION_ZONE; i++) { |
|
|
enable_speed[i] = jsonbuf["detection_zone"][i]["enable_speed"]; |
|
|
enable_radar_speed[i] = jsonbuf["detection_zone"][i]["enable_radar_speed"]; |
|
|
func_set_direction(parseInt(jsonbuf["detection_zone"][i]["direction1"], 10), i); |
|
|
|
|
|
const reg2 = /(?:\.0*|(\.\d+?)0+)$/; |
|
|
|
|
|
set_distance[i] = jsonbuf["detection_zone"][i]["set_distance"].replace(reg2, '$1'); |
|
|
world_distance_unit[i] = jsonbuf["detection_zone"][i]["world_distance_unit"]; |
|
|
world_distance_side1[i] = jsonbuf["detection_zone"][i]["world_distance_side1"].replace(reg2, '$1'); |
|
|
world_distance_side2[i] = jsonbuf["detection_zone"][i]["world_distance_side2"].replace(reg2, '$1'); |
|
|
world_time_unit[i] = jsonbuf["detection_zone"][i]["world_time_unit"]; |
|
|
|
|
|
enable_direction[i] = jsonbuf["detection_zone"][i]["enable_direction1"]; |
|
|
} |
|
|
} |
|
|
|
|
|
//console.info(retdata); |
|
|
}, |
|
|
error: function (retdata) { |
|
|
console.warn(retdata); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_hide_not_direction_zone() { |
|
|
for (var i = 0; i < MAX_DETECTION_ZONE; i++) { |
|
|
|
|
|
if (i < count_zone) { |
|
|
document.getElementById("dzone_" + (i + 1).toString()).style.visibility = "visible"; |
|
|
} |
|
|
else { |
|
|
document.getElementById("dzone_" + (i + 1).toString()).style.visibility = "hidden"; |
|
|
} |
|
|
|
|
|
/* |
|
|
if (enable_direction[i] != "Yes") { |
|
|
document.getElementById("dzone_" + (i + 1).toString()).style.visibility = "hidden"; |
|
|
} |
|
|
else if (enable_direction[i] == "Yes") { |
|
|
document.getElementById("dzone_" + (i + 1).toString()).style.visibility = "visible"; |
|
|
if (index_min_yes == -1) { |
|
|
index_min_yes = i; |
|
|
} |
|
|
}*/ |
|
|
} |
|
|
|
|
|
/* |
|
|
if (index_min_yes != -1) { |
|
|
current_dzone = "dzone_" + (index_min_yes + 1).toString(); |
|
|
}*/ |
|
|
} |
|
|
|
|
|
function func_showSpeedData() { |
|
|
|
|
|
//if (index_min_yes != -1) |
|
|
{ |
|
|
|
|
|
document.getElementById("border_unit").readOnly = false; |
|
|
//document.getElementById("time_unit").readOnly = false; |
|
|
document.getElementById("enable_speed").style.visibility = "visible"; |
|
|
document.getElementById("enable_radar_speed").style.visibility = "visible"; |
|
|
document.getElementById("border_unit").style.visibility = "visible"; |
|
|
//document.getElementById("time_unit").style.visibility = "visible"; |
|
|
|
|
|
$('#overspeed').slider({ disabled: false }); |
|
|
$('#border_1').slider({ disabled: false }); |
|
|
$('#border_2').slider({ disabled: false }); |
|
|
|
|
|
var index_dzone = 0; |
|
|
if (current_dzone === "dzone_1") { |
|
|
index_dzone = 0; |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
index_dzone = 1; |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
index_dzone = 2; |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
index_dzone = 3; |
|
|
} |
|
|
else if (current_dzone === "dzone_5") { |
|
|
index_dzone = 4; |
|
|
} |
|
|
else if (current_dzone === "dzone_6") { |
|
|
index_dzone = 5; |
|
|
} |
|
|
else if (current_dzone === "dzone_7") { |
|
|
index_dzone = 6; |
|
|
} |
|
|
else if (current_dzone === "dzone_8") { |
|
|
index_dzone = 7; |
|
|
} |
|
|
$('select[id="border_unit"] option[value="meter"]').text(IDC_LIST_BORDER_UNIT[0]); |
|
|
$('select[id="border_unit"] option[value="kilometer"]').text(IDC_LIST_BORDER_UNIT[1]); |
|
|
$('select[id="border_unit"] option[value="foot"]').text(IDC_LIST_BORDER_UNIT[2]); |
|
|
$('select[id="border_unit"] option[value="yard"]').text(IDC_LIST_BORDER_UNIT[3]); |
|
|
$('select[id="border_unit"] option[value="mile"]').text(IDC_LIST_BORDER_UNIT[4]); |
|
|
|
|
|
//$('select[id="time_unit"] option[value="sec"]').text(IDC_LIST_TIME_UNIT[0]); |
|
|
//$('select[id="time_unit"] option[value="min"]').text(IDC_LIST_TIME_UNIT[1]); |
|
|
//$('select[id="time_unit"] option[value="hour"]').text(IDC_LIST_TIME_UNIT[2]); |
|
|
//$('select[id="time_unit"] option[value="KPH"]').text("KPH(km/h)"); |
|
|
//$('select[id="time_unit"] option[value="MPH"]').text("MPH(mi/h)"); |
|
|
|
|
|
if (enable_speed[index_dzone] === 'Yes') |
|
|
$('#enable_speed').prop("checked", true); |
|
|
else |
|
|
$('#enable_speed').prop("checked", false); |
|
|
|
|
|
if (enable_radar_speed[index_dzone] === 'Yes') |
|
|
$('#enable_radar_speed').prop("checked", true); |
|
|
else |
|
|
$('#enable_radar_speed').prop("checked", false); |
|
|
|
|
|
$('#overspeed').slider('setValue', set_distance[index_dzone]); |
|
|
$('#border_1').slider('setValue', world_distance_side1[index_dzone]); |
|
|
$('#border_2').slider('setValue', world_distance_side2[index_dzone]); |
|
|
$("#border_unit").val(world_distance_unit[index_dzone]); |
|
|
//$("#time_unit").val(world_time_unit[index_dzone]); |
|
|
|
|
|
var text_border = $('select[id="border_unit"] option[value="' + $("#border_unit").val() + '"]').text(); |
|
|
//var text_time = $('select[id="time_unit"] option[value="' + $("#time_unit").val() + '"]').text(); |
|
|
//console.log(text_border); |
|
|
//console.log(text_time); |
|
|
|
|
|
if (world_distance_unit[index_dzone] == "meter") { |
|
|
document.getElementById("SPEED_UNIT").innerHTML = " KPH(km/h)"; |
|
|
} |
|
|
else if (world_distance_unit[index_dzone] == "foot") { |
|
|
document.getElementById("SPEED_UNIT").innerHTML = " MPH(mi/h)"; |
|
|
} |
|
|
|
|
|
/* |
|
|
if ($("#time_unit").val() == "KPH") { |
|
|
document.getElementById("SPEED_UNIT").innerHTML = "KPH(km/h)"; |
|
|
} |
|
|
else if ($("#time_unit").val() == "MPH") { |
|
|
document.getElementById("SPEED_UNIT").innerHTML = "MPH(mi/h)"; |
|
|
}*/ |
|
|
/* |
|
|
if ($("#border_unit").val() == "kilometer" && $("#time_unit").val() == "hour") { |
|
|
document.getElementById("SPEED_UNIT").innerHTML = "KPH(km/h)"; |
|
|
} |
|
|
else if ($("#border_unit").val() == "mile" && $("#time_unit").val() == "hour") { |
|
|
document.getElementById("SPEED_UNIT").innerHTML = "MPH"; |
|
|
} |
|
|
else { |
|
|
document.getElementById("SPEED_UNIT").innerHTML = "(" + text_border + "/" + text_time + ")"; |
|
|
}*/ |
|
|
} |
|
|
|
|
|
/* |
|
|
else { |
|
|
document.getElementById("border_unit").readOnly = true; |
|
|
//document.getElementById("time_unit").readOnly = true; |
|
|
document.getElementById("enable_speed").style.visibility = "hidden"; |
|
|
document.getElementById("border_unit").style.visibility = "hidden"; |
|
|
//document.getElementById("time_unit").style.visibility = "hidden"; |
|
|
|
|
|
$('#overspeed').slider({ disabled: true }); |
|
|
$('#border_1').slider({ disabled: true }); |
|
|
$('#border_2').slider({ disabled: true }); |
|
|
}*/ |
|
|
} |
|
|
|
|
|
function func_setSpeedData() { |
|
|
var index_dzone = 0; |
|
|
if (current_dzone === "dzone_1") { |
|
|
index_dzone = 0; |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
index_dzone = 1; |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
index_dzone = 2; |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
index_dzone = 3; |
|
|
} |
|
|
else if (current_dzone === "dzone_5") { |
|
|
index_dzone = 4; |
|
|
} |
|
|
else if (current_dzone === "dzone_6") { |
|
|
index_dzone = 5; |
|
|
} |
|
|
else if (current_dzone === "dzone_7") { |
|
|
index_dzone = 6; |
|
|
} |
|
|
else if (current_dzone === "dzone_8") { |
|
|
index_dzone = 7; |
|
|
} |
|
|
if ($('#enable_speed').is(":checked")) { |
|
|
enable_speed[index_dzone] = "Yes"; |
|
|
} |
|
|
else { |
|
|
enable_speed[index_dzone] = "No"; |
|
|
} |
|
|
|
|
|
if ($('#enable_radar_speed').is(":checked")) { |
|
|
enable_radar_speed[index_dzone] = "Yes"; |
|
|
} |
|
|
else { |
|
|
enable_radar_speed[index_dzone] = "No"; |
|
|
} |
|
|
|
|
|
set_distance[index_dzone] = $('#overspeed').slider('getValue'); |
|
|
world_distance_side1[index_dzone] = $('#border_1').slider('getValue'); |
|
|
world_distance_side2[index_dzone] = $('#border_2').slider('getValue'); |
|
|
world_distance_unit[0] = $("#border_unit").val(); |
|
|
world_distance_unit[1] = $("#border_unit").val(); |
|
|
world_distance_unit[2] = $("#border_unit").val(); |
|
|
world_distance_unit[3] = $("#border_unit").val(); |
|
|
if ($("#border_unit").val() == "meter") { |
|
|
world_time_unit[index_dzone] = "KPH"; |
|
|
} |
|
|
else if ($("#border_unit").val() == "foot") { |
|
|
world_time_unit[index_dzone] = "MPH"; |
|
|
} |
|
|
//world_time_unit[index_dzone] = $("#time_unit").val(); |
|
|
} |
|
|
|
|
|
function validatingJSON(json) { |
|
|
|
|
|
var checkedjson; |
|
|
try { |
|
|
checkedjson = JSON.parse(json); //JSON parse only for try catch |
|
|
//console.log("json OK"); |
|
|
//console.log(json); |
|
|
} catch (e) { |
|
|
checkedjson = null; |
|
|
console.log(e);//the character would be drop sometimes, for example the label "class_id" may be "clas_id". |
|
|
//console.log(json); |
|
|
} |
|
|
return checkedjson; |
|
|
} |
|
|
|
|
|
function func_getZoneData() { |
|
|
|
|
|
$.ajax({ |
|
|
url: "/getconfig?ch=01", |
|
|
type: "GET", |
|
|
async: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
success: function (retdata) { |
|
|
//var jsonbuf = JSON.parse('{ "name":"John", "age":30, "city":"New York"}'); |
|
|
var jsonbuf = validatingJSON(retdata); |
|
|
|
|
|
tab_view_size = jsonbuf["tab_view_size"].split("x"); |
|
|
tab_view_size[0] = parseInt(tab_view_size[0], 10); |
|
|
tab_view_size[1] = parseInt(tab_view_size[1], 10); |
|
|
count_zone = jsonbuf["count_zone"]; |
|
|
|
|
|
if (jsonbuf != null) { |
|
|
for (var i = 0; i < MAX_DETECTION_ZONE; i++) { |
|
|
|
|
|
for (var j = 0; j < MAX_SIZE_POINTS; j++) { |
|
|
points_x_config[i][j] = jsonbuf["detection_zone"][i]["x" + (j + 1).toString()]; |
|
|
points_y_config[i][j] = jsonbuf["detection_zone"][i]["y" + (j + 1).toString()]; |
|
|
|
|
|
/* |
|
|
if (j == MAX_SIZE_POINTS - 2) { |
|
|
points_x_config[i][j] = (points_x_config[i][3] * 2 + points_x_config[i][0] * 1) / 3; |
|
|
points_y_config[i][j] = (points_y_config[i][3] * 2 + points_y_config[i][0] * 1) / 3; |
|
|
} |
|
|
else if (j == MAX_SIZE_POINTS - 1) { |
|
|
points_x_config[i][j] = (points_x_config[i][3] * 1 + points_x_config[i][0] * 2) / 3; |
|
|
points_y_config[i][j] = (points_y_config[i][3] * 1 + points_y_config[i][0] * 2) / 3; |
|
|
}*/ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
//console.info(retdata); |
|
|
}, |
|
|
error: function (retdata) { |
|
|
console.warn(retdata); |
|
|
} |
|
|
}); |
|
|
} |
|
|
|
|
|
function enable_detection_zone_button() { |
|
|
if (count_zone === 0) { |
|
|
document.getElementById("dzone_1").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_2").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_3").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_4").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_5").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_6").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_7").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_8").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 1) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_3").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_4").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_5").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_6").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_7").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_8").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 2) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "visible"; |
|
|
document.getElementById("dzone_3").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_4").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_5").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_6").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_7").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_8").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 3) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "visible"; |
|
|
document.getElementById("dzone_3").style.visibility = "visible"; |
|
|
document.getElementById("dzone_4").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_5").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_6").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_7").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_8").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 4) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "visible"; |
|
|
document.getElementById("dzone_3").style.visibility = "visible"; |
|
|
document.getElementById("dzone_4").style.visibility = "visible"; |
|
|
document.getElementById("dzone_5").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_6").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_7").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_8").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 5) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "visible"; |
|
|
document.getElementById("dzone_3").style.visibility = "visible"; |
|
|
document.getElementById("dzone_4").style.visibility = "visible"; |
|
|
document.getElementById("dzone_5").style.visibility = "visible"; |
|
|
document.getElementById("dzone_6").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_7").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_8").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 6) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "visible"; |
|
|
document.getElementById("dzone_3").style.visibility = "visible"; |
|
|
document.getElementById("dzone_4").style.visibility = "visible"; |
|
|
document.getElementById("dzone_5").style.visibility = "visible"; |
|
|
document.getElementById("dzone_6").style.visibility = "visible"; |
|
|
document.getElementById("dzone_7").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_8").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 7) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "visible"; |
|
|
document.getElementById("dzone_3").style.visibility = "visible"; |
|
|
document.getElementById("dzone_4").style.visibility = "visible"; |
|
|
document.getElementById("dzone_5").style.visibility = "visible"; |
|
|
document.getElementById("dzone_6").style.visibility = "visible"; |
|
|
document.getElementById("dzone_7").style.visibility = "visible"; |
|
|
document.getElementById("dzone_8").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 8) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "visible"; |
|
|
document.getElementById("dzone_3").style.visibility = "visible"; |
|
|
document.getElementById("dzone_4").style.visibility = "visible"; |
|
|
document.getElementById("dzone_5").style.visibility = "visible"; |
|
|
document.getElementById("dzone_6").style.visibility = "visible"; |
|
|
document.getElementById("dzone_7").style.visibility = "visible"; |
|
|
document.getElementById("dzone_8").style.visibility = "visible"; |
|
|
} |
|
|
} |
|
|
|
|
|
function func_setspeed() { |
|
|
k_index = 0; |
|
|
makeProgress(); |
|
|
} |
|
|
|
|
|
function sleep(milliseconds) { |
|
|
var start = new Date().getTime(); |
|
|
for (var i = 0; i < 1e7; i++) { |
|
|
if ((new Date().getTime() - start) > milliseconds) { |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function func_setconfigfile(json_data) { |
|
|
$.ajax({ |
|
|
url: "/setconfigfile", |
|
|
method: "POST", |
|
|
async: false, |
|
|
data: json_data, |
|
|
contentType: false, |
|
|
processData: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
success: function () { |
|
|
//console.info(); |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
|
|
|
k_index++; |
|
|
|
|
|
if (k_index <= 94) { |
|
|
waitSeconds(500); |
|
|
func_setconfigfile(json_data); |
|
|
} |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_setelement_detection_zone(name_, value_, zone_) { |
|
|
$.ajax({ |
|
|
url: "/setconfig?ch=1&detection_zone=" + zone_ + "&" + name_ + "=" + value_, |
|
|
method: "GET", |
|
|
async: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
success: function () { |
|
|
//console.info(); |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_setelement(name_, value_) { |
|
|
$.ajax({ |
|
|
url: "/setconfig?ch=1&" + name_ + "=" + value_, |
|
|
method: "GET", |
|
|
async: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
success: function () { |
|
|
//console.info(); |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
var count_reload = 0; |
|
|
function func_getreload() { |
|
|
$.ajax({ |
|
|
url: "/getconfig?reload=1", |
|
|
method: "GET", |
|
|
async: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
//data : JSON.stringify(data), |
|
|
success: function (retdata) { |
|
|
count_reload++; |
|
|
if (retdata === "Reload OK.") { |
|
|
count_reload = 0; |
|
|
//console.log("Reload OK."); |
|
|
} |
|
|
else { |
|
|
if (count_reload <= 3) { |
|
|
setTimeout(func_getreload(), 2000); |
|
|
} |
|
|
else { |
|
|
count_reload = 0; |
|
|
} |
|
|
} |
|
|
//console.info(); |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function waitSeconds(iMilliSeconds) { |
|
|
|
|
|
var counter = 0 |
|
|
|
|
|
, start = new Date().getTime() |
|
|
|
|
|
, end = 0; |
|
|
|
|
|
while (counter < iMilliSeconds) { |
|
|
|
|
|
end = new Date().getTime(); |
|
|
|
|
|
counter = end - start; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
var k_index = -1; |
|
|
$(".progress-bar").css("visibility", "hidden"); |
|
|
function makeProgress() { |
|
|
if (k_index < 100 && k_index >= 0) { |
|
|
k_index = k_index + 1; |
|
|
$(".progress-bar").css("visibility","visible"); |
|
|
//$(".progress-bar").css("width", k_index + "%").text(k_index + " %"); |
|
|
$(".progress-bar").css("width", k_index + "%"); |
|
|
|
|
|
if (k_index == 1) { |
|
|
$('html, body').scrollTop(0); |
|
|
|
|
|
func_setSpeedData(); |
|
|
|
|
|
for (var index_zone = 0; index_zone < MAX_DETECTION_ZONE; index_zone++) { |
|
|
if (world_distance_unit[index_zone] == "meter") { |
|
|
world_time_unit[index_zone] = "KPH"; |
|
|
} |
|
|
else if (world_distance_unit[index_zone] == "foot") { |
|
|
world_time_unit[index_zone] = "MPH"; |
|
|
} |
|
|
} |
|
|
|
|
|
var json_data = '{"view_setting":{"camera01":{"detection_zone":['; |
|
|
for (var index_zone = 0; index_zone < MAX_DETECTION_ZONE; index_zone++) { |
|
|
json_data += '{'; |
|
|
json_data += '"enable_speed": "' + enable_speed[index_zone] + '",'; |
|
|
json_data += '"enable_radar_speed": "' + enable_radar_speed[index_zone] + '",'; |
|
|
json_data += '"set_distance": "' + set_distance[index_zone] + '",'; |
|
|
json_data += '"world_distance_side1": "' + world_distance_side1[index_zone] + '",'; |
|
|
json_data += '"world_distance_side2": "' + world_distance_side2[index_zone] + '",'; |
|
|
json_data += '"world_distance_unit": "' + world_distance_unit[index_zone] + '",'; |
|
|
json_data += '"world_time_unit": "' + world_time_unit[index_zone] + '"'; |
|
|
if (index_zone < MAX_DETECTION_ZONE - 1) |
|
|
json_data += '},'; |
|
|
else |
|
|
json_data += '}]}}}'; |
|
|
} |
|
|
|
|
|
func_setconfigfile(json_data); |
|
|
k_index = 94; |
|
|
} |
|
|
else if (k_index == 95) { |
|
|
//waitSeconds(500); |
|
|
func_showSpeedData(); |
|
|
if (current_dzone === "dzone_1") { |
|
|
show_pixels_for_zone(world_distance_side1[0], world_distance_side2[0]); |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
show_pixels_for_zone(world_distance_side1[1], world_distance_side2[1]); |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
show_pixels_for_zone(world_distance_side1[2], world_distance_side2[2]); |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
show_pixels_for_zone(world_distance_side1[3], world_distance_side2[3]); |
|
|
} |
|
|
else if (current_dzone === "dzone_5") { |
|
|
show_pixels_for_zone(world_distance_side1[4], world_distance_side2[4]); |
|
|
} |
|
|
else if (current_dzone === "dzone_6") { |
|
|
show_pixels_for_zone(world_distance_side1[5], world_distance_side2[5]); |
|
|
} |
|
|
else if (current_dzone === "dzone_7") { |
|
|
show_pixels_for_zone(world_distance_side1[6], world_distance_side2[6]); |
|
|
} |
|
|
else if (current_dzone === "dzone_8") { |
|
|
show_pixels_for_zone(world_distance_side1[7], world_distance_side2[7]); |
|
|
} |
|
|
} |
|
|
else if (k_index == 100) { |
|
|
$(".progress-bar").css("visibility", "hidden"); |
|
|
//$(".progress-bar").css("width", "0%").text("0 %"); |
|
|
$(".progress-bar").css("width", "0%"); |
|
|
k_index = -1; |
|
|
} |
|
|
// Wait for sometime before running this script again |
|
|
setTimeout("makeProgress()", 200); |
|
|
} |
|
|
} |
|
|
|
|
|
localStorage.setItem('speed_index_success', 'OK'); |
|
|
</script> |
|
|
</body> |
|
|
</html> |