|
|
|
|
|
<!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: 5px 0px 0 56px; |
|
|
background: #fff; |
|
|
} |
|
|
|
|
|
.container { |
|
|
display: flex; |
|
|
} |
|
|
|
|
|
.item { |
|
|
margin: 5px; |
|
|
padding: 5px; |
|
|
} |
|
|
|
|
|
.btn_move_left_top { |
|
|
background-image: url(images/icon_1_black_left_top.png); |
|
|
} |
|
|
|
|
|
.btn_move_left_top:active { |
|
|
background-image: url(images/icon_1_blue_left_top.png); |
|
|
} |
|
|
|
|
|
.btn_move_center_top { |
|
|
background-image: url(images/icon_1_black_center_top.png); |
|
|
} |
|
|
|
|
|
.btn_move_center_top:active { |
|
|
background-image: url(images/icon_1_blue_center_top.png); |
|
|
} |
|
|
|
|
|
.btn_move_right_top { |
|
|
background-image: url(images/icon_1_black_right_top.png); |
|
|
} |
|
|
|
|
|
.btn_move_right_top:active { |
|
|
background-image: url(images/icon_1_blue_right_top.png); |
|
|
} |
|
|
|
|
|
.btn_move_left_center { |
|
|
background-image: url(images/icon_1_black_left_center.png); |
|
|
} |
|
|
|
|
|
.btn_move_left_center:active { |
|
|
background-image: url(images/icon_1_blue_left_center.png); |
|
|
} |
|
|
|
|
|
.btn_move_center_center { |
|
|
background-image: url(images/icon_2_black_center_center.png); |
|
|
} |
|
|
|
|
|
.btn_move_center_center:active { |
|
|
background-image: url(images/icon_2_blue_center_center.png); |
|
|
} |
|
|
|
|
|
.btn_move_right_center { |
|
|
background-image: url(images/icon_1_black_right_center.png); |
|
|
} |
|
|
|
|
|
.btn_move_right_center:active { |
|
|
background-image: url(images/icon_1_blue_right_center.png); |
|
|
} |
|
|
|
|
|
.btn_move_left_bottom { |
|
|
background-image: url(images/icon_1_black_left_bottom.png); |
|
|
} |
|
|
|
|
|
.btn_move_left_bottom:active { |
|
|
background-image: url(images/icon_1_blue_left_bottom.png); |
|
|
} |
|
|
|
|
|
.btn_move_center_bottom { |
|
|
background-image: url(images/icon_1_black_center_bottom.png); |
|
|
} |
|
|
|
|
|
.btn_move_center_bottom:active { |
|
|
background-image: url(images/icon_1_blue_center_bottom.png); |
|
|
} |
|
|
|
|
|
.btn_move_right_bottom { |
|
|
background-image: url(images/icon_1_black_right_bottom.png); |
|
|
} |
|
|
|
|
|
.btn_move_right_bottom:active { |
|
|
background-image: url(images/icon_1_blue_right_bottom.png); |
|
|
} |
|
|
</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("fabric_jquery.easyui.min_compressed_on_nvr.js") >= 1) { |
|
|
loadScript("fabric_jquery.easyui.min_compressed_on_nvr.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("jquery_3_2_1.min.js") >= 1) { |
|
|
loadScript("jquery_3_2_1.min.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("config.js") >= 1) { |
|
|
loadScript("config.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("ptz.js") >= 1) { |
|
|
loadScript("ptz.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("lang_cookie.js") >= 1) { |
|
|
loadScript("lang_cookie.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (message.search("slider") >= 1) { |
|
|
loadScript("fabric_jquery.easyui.min_compressed_on_nvr.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (message.search("myport") >= 1) { |
|
|
loadScript("config.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (message.search("cookie") >= 1) { |
|
|
loadScript("cookie.min.js", function () { |
|
|
}); |
|
|
} |
|
|
else { |
|
|
//location.reload(); |
|
|
var replaceUrl = 'http://' + window.location.hostname + ':' + GetUrlPort() + '/Aida/ptz.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="third_party_label_names.js"></script> |
|
|
|
|
|
<script src="lang_cookie.js"></script> |
|
|
|
|
|
<script src="ptz.js"></script> |
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="bootstrap.min.css"> |
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="easyui.css"> |
|
|
|
|
|
<script> |
|
|
var g_mouse_status = 0; |
|
|
|
|
|
var g_GetPTZStatus = null; |
|
|
|
|
|
function GetPTZStatus() { |
|
|
clearInterval(g_GetPTZStatus); |
|
|
g_GetPTZStatus = setInterval(function GetPTZStatus_set_interval() { |
|
|
var current_page = localStorage.getItem('current_page'); |
|
|
if (current_page === 'ptz') { |
|
|
func_aiautotracking_json(); |
|
|
func_get_cur_pos(); |
|
|
} |
|
|
}, 5000); |
|
|
} |
|
|
|
|
|
|
|
|
$(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 class="titlebox"><nobr id="TITLEBOX_PAGE08"></nobr></div> |
|
|
<div align="center" class="test" div style="border:1px gray solid;padding:10px;margin:15px 15px 4px 15px"> |
|
|
|
|
|
|
|
|
<div align="center" valign="center" style="border-collapse: collapse; width: 800px; height: auto; "> |
|
|
<div class="container"> |
|
|
<!--align="center"---> |
|
|
<div class="item"> |
|
|
<canvas id="CanvasTripwire_all"></canvas> |
|
|
</div> |
|
|
<div class="item"> |
|
|
<div> |
|
|
<table align="center" border="0" cellspacing="0" cellpadding="0"> |
|
|
<tbody> |
|
|
<tr> |
|
|
<td border="0" width="38" height="32"> |
|
|
<input id="move_left_top" type="button" onclick="func_ptz_move_direction(-1,1);" value=" " class="btn_move_left_top" style="border:0;background-color:transparent;width:32px;height:32px;" /> |
|
|
</td> |
|
|
<td border="0" width="38" height="32"> |
|
|
<input id="move_center_top" type="button" onclick="func_ptz_move_direction(0,1);" value=" " class="btn_move_center_top" style="border:0;background-color:transparent;width:32px;height:32px;" /> |
|
|
<br><br> |
|
|
</td> |
|
|
<td border="0" width="38" height="32"> |
|
|
<input id="move_right_top" type="button" onclick="func_ptz_move_direction(1,1);" value=" " class="btn_move_right_top" style="border:0;background-color:transparent;width:32px;height:32px;" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td border="0" width="38" height="32"> |
|
|
<input id="move_left_center" type="button" onclick="func_ptz_move_direction(-1,0);" value=" " class="btn_move_left_center" style="border:0;background-color:transparent;width:32px;height:32px;margin-left:-10px;" /> |
|
|
</td> |
|
|
<td border="0" width="38" height="32"> |
|
|
<input id="move_center_center" type="button" onclick="" value=" " class="btn_move_center_center" style="border:0;background-color:transparent;width:32px;height:32px;" /> |
|
|
</td> |
|
|
<td border="0" width="38" height="32"> |
|
|
<input id="move_right_center" type="button" onclick="func_ptz_move_direction(1,0);" value=" " class="btn_move_right_center" style="border:0;background-color:transparent;width:32px;height:32px;;margin-left:10px;" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr> |
|
|
<td border="0" width="38" height="32"> |
|
|
<input id="move_left_bottom" type="button" onclick="func_ptz_move_direction(-1,-1);" value=" " class="btn_move_left_bottom" style="border:0;background-color:transparent;width:32px;height:32px;" /> |
|
|
</td> |
|
|
<td border="0" width="38" height="32"> |
|
|
<br> |
|
|
<input id="move_center_bottom" type="button" onclick="func_ptz_move_direction(0,-1);" value=" " class="btn_move_center_bottom" style="border:0;background-color:transparent;width:32px;height:32px;" /> |
|
|
</td> |
|
|
<td border="0" width="38" height="32"> |
|
|
<input id="move_right_bottom" type="button" onclick="func_ptz_move_direction(1,-1);" value=" " class="btn_move_right_bottom" style="border:0;background-color:transparent;width:32px;height:32px;" /> |
|
|
</td> |
|
|
</tr> |
|
|
</tbody> |
|
|
</table> |
|
|
</div> |
|
|
<nobr id="current_view" style="background-color:black;color:lawngreen;border:2px solid gray;"></nobr> |
|
|
<br> |
|
|
<nobr id="IDC_STATIC_PTZ_SPEED"></nobr> |
|
|
<select name="ptz_speed" id="ptz_speed" onchange="func_setptz();"> |
|
|
<option value="1">1</option> |
|
|
<option value="2">2</option> |
|
|
<option value="3">3</option> |
|
|
<option value="4">4</option> |
|
|
<option value="5">5</option> |
|
|
<option value="6">6</option> |
|
|
<option value="7">7</option> |
|
|
</select> |
|
|
<div style="text-align:left;padding:1px;"> |
|
|
<input type="checkbox" id="enable_tracking_limits" /> <nobr id="IDC_CHECK_ENABLE_TRACKING_LIMITS"></nobr> |
|
|
<br> |
|
|
<nobr id="IDC_STATIC_PTZ_PAN_LEFT_LIMIT"></nobr> |
|
|
<input id="ptz_pan_left" style="width:35px" number="number" onkeyup="this.value=this.value.replace(/\D/g,'')" min="0" max="360" oninput="if (value < 0 || value.length==0) value = 0; if (value > 360) value = 360;" /> |
|
|
<br> |
|
|
<nobr id="IDC_STATIC_PTZ_PAN_RIGHT_LIMIT"></nobr> |
|
|
<input id="ptz_pan_right" style="width:35px" number="number" onkeyup="this.value=this.value.replace(/\D/g,'')" min="0" max="360" oninput="if (value < 0) value = 0; if (value > 360 || value.length==0) value = 360;" /> |
|
|
<br> |
|
|
<nobr id="IDC_STATIC_PTZ_TILT_UP_LIMIT"></nobr> |
|
|
<input id="ptz_tilt_up" style="width:35px" number="number" onkeyup="this.value=this.value.replace(/\D/g,'')" min="0" max="210" oninput="if (value < 0 || value.length==0) value = 0; if (value > 210) value = 210;" /> |
|
|
<br> |
|
|
<nobr id="IDC_STATIC_PTZ_TILT_DOWN_LIMIT"></nobr> |
|
|
<input id="ptz_tilt_down" style="width:35px" number="number" onkeyup="this.value=this.value.replace(/\D/g,'')" min="0" max="210" oninput="if (value < 0) value = 0; if (value > 210 || value.length==0) value = 210;" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<!-- <table valign="center" style="border-collapse: collapse; width: 400px; height: 160px;" border="0"> --> |
|
|
<table align="center" valign="center" style="border-collapse: collapse; width: 800px; height: auto; "> |
|
|
<tbody> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> <nobr id="IDC_CHECK_ENABLE_TRACKING"></nobr></td> |
|
|
<td style="width: 630px; height: 20px;"> |
|
|
<input id="IDC_STATIC_START_TRACKING" type="button" value="Start" onclick="func_ptz_start();" style="background:#6c87d4;border-color:#6c87d4;color:white;" /> |
|
|
<input id="IDC_STATIC_STOP_TRACKING" type="button" value="Stop" onclick="func_ptz_stop();" style="background:#6c87d4;border-color:#6c87d4;color:white;" /> |
|
|
<nobr id="IDC_STATIC_TRACKING_MODE"></nobr> |
|
|
|
|
|
<select name="tracking_mode" id="tracking_mode" onchange=""> |
|
|
<option value="1" id="IDC_STATIC_TRACKING_MODE_01"></option> |
|
|
<option value="2" id="IDC_STATIC_TRACKING_MODE_02"></option> |
|
|
<option value="3" id="IDC_STATIC_TRACKING_MODE_03"></option> |
|
|
</select> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> |
|
|
<nobr id="IDC_STATIC_STATE"></nobr> |
|
|
</td> |
|
|
<td style="width: 630px; height: 20px;"> |
|
|
|
|
|
<svg width="10" height="10"> |
|
|
<circle id="bar_circle" r="5" cx="5" cy="5" style="fill:blue;" /> |
|
|
</svg> |
|
|
<nobr id="ptz_state"></nobr> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> <nobr id="IDC_STATIC_DETECTION_ZONE"></nobr></td> |
|
|
<td style="width: 630px; height: 20px;"> |
|
|
<input id="dzone_1" type="button" value="1" onclick="func_set_zone_cookie1();" /> |
|
|
<input id="dzone_2" type="button" value="2" onclick="func_set_zone_cookie2();" /> |
|
|
<input id="dzone_3" type="button" value="3" onclick="func_set_zone_cookie3();" /> |
|
|
<input id="dzone_4" type="button" value="4" onclick="func_set_zone_cookie4();" /> |
|
|
<input id="dzone_5" type="button" value="5" onclick="func_set_zone_cookie5();" /> |
|
|
<input id="dzone_6" type="button" value="6" onclick="func_set_zone_cookie6();" /> |
|
|
<input id="dzone_7" type="button" value="7" onclick="func_set_zone_cookie7();" /> |
|
|
<input id="dzone_8" type="button" value="8" onclick="func_set_zone_cookie8();" /> |
|
|
|
|
|
<nobr id="IDC_CHECK_LINK_TO"></nobr> |
|
|
|
|
|
<select name="select_preset" id="select_preset" onchange="func_preset_onchange();"> |
|
|
<option value="0">No</option> |
|
|
<option value="1">Preset #1</option> |
|
|
<option value="2">Preset #2</option> |
|
|
<option value="3">Preset #3</option> |
|
|
<option value="4">Preset #4</option> |
|
|
<option value="5">Preset #5</option> |
|
|
<option value="6">Preset #6</option> |
|
|
<option value="7">Preset #7</option> |
|
|
<option value="8">Preset #8</option> |
|
|
<option value="9">Preset #9</option> |
|
|
<option value="10">Preset #10</option> |
|
|
<option value="11">Preset #11</option> |
|
|
<option value="12">Preset #12</option> |
|
|
<option value="13">Preset #13</option> |
|
|
<option value="14">Preset #14</option> |
|
|
<option value="15">Preset #15</option> |
|
|
<option value="16">Preset #16</option> |
|
|
</select> |
|
|
<input id="enable_show_zone" type="checkbox" name="enable_show_zone" /> |
|
|
<nobr id="IDC_STATIC_SHOW_ZONE"></nobr> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> <nobr id="IDC_STATIC_TRACKING_FOV"></nobr></td> |
|
|
<td style="width: 630px; height: 20px;"> |
|
|
|
|
|
<input class="easyui-slider" id="tracking_fov" style="width:550px" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> <nobr id="IDC_STATIC_SENSITIVITY"></nobr></td> |
|
|
<td style="width: 630px; height: 20px;"> |
|
|
|
|
|
<input class="easyui-slider" id="sensitivity" style="width:550px" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> <nobr id="IDC_STATIC_TRACKING_DWELL"></nobr></td> |
|
|
<td style="width: 630px; height: 20px;"> |
|
|
|
|
|
<input class="easyui-slider" id="tracking_dwell" style="width:550px" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> <img src="images/info-2-32X32.png" style="vertical-align:middle;" /><!--<nobr id="IDC_STATIC_NOTE" style="color:red;font-weight:bold;"></nobr>--></td> |
|
|
<td style="width: 630px; height: 20px;"> <nobr id="Note_ptz_tracking_1"></nobr></td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> </td> |
|
|
<td style="width: 630px; height: 20px;"> <nobr id="Note_ptz_tracking_2"></nobr></td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> <img src="images/info-2-32X32.png" style="vertical-align:middle;" /><!--<nobr id="IDC_STATIC_NOTE_2" style="color:red;font-weight:bold;"></nobr>--></td> |
|
|
<td style="width: 630px; height: 20px;"> <nobr id="Note_ptz_tracking_3"></nobr></td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> </td> |
|
|
<td style="width: 630px; height: 20px;"> <nobr id="Note_ptz_tracking_4"></nobr></td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> <img src="images/info-2-32X32.png" style="vertical-align:middle;" /><!--<nobr id="IDC_STATIC_NOTE_3" style="color:red;font-weight:bold;"></nobr>--></td> |
|
|
<td style="width: 630px; height: 20px;"> <nobr id="Note_ptz_tracking_5"></nobr></td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 170px; height: 20px;"> </td> |
|
|
<td style="width: 630px; height: 20px;"> <nobr id="Note_ptz_tracking_6"></nobr></td> |
|
|
</tr> |
|
|
</tbody> |
|
|
</table> |
|
|
</div> |
|
|
|
|
|
<div> |
|
|
<div align="center"> |
|
|
<input align="center" id="IDOK" type="button" value=" Set " onclick="func_setptz();" style="background-color:#6c87d4;color:white;height:36px;width:300px;" /> |
|
|
</div> |
|
|
</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 |
|
|
var MAX_DETECTION_ZONE = 8; |
|
|
var MAX_SIZE_POINTS = 6; |
|
|
var MAX_SIZE_POST = 9; |
|
|
|
|
|
var enable_tracking_limits = "No"; |
|
|
var ptz_pan_left_limit = "0"; |
|
|
var ptz_pan_right_limit = "360"; |
|
|
var ptz_tilt_up_limit = "0"; |
|
|
var ptz_tilt_down_limit = "210"; |
|
|
var ptz_speed = "3"; |
|
|
|
|
|
var current_dzone = "dzone_1"; |
|
|
var count_zone = 0; |
|
|
//var ptz_tracking_fov_min = "0"; |
|
|
var ptz_tracking_fov_max = "40"; |
|
|
var enable_tracking = "No"; |
|
|
var tracking_dwell = "3"; |
|
|
var sensitivity = "3"; |
|
|
var ptz_tracking_mode = "1"; |
|
|
var select_preset = new Array(MAX_DETECTION_ZONE); |
|
|
|
|
|
var points_x_config = new Array(MAX_DETECTION_ZONE); |
|
|
var points_y_config = new Array(MAX_DETECTION_ZONE); |
|
|
|
|
|
var iIsInPreset = -1; |
|
|
var iIsInAutopan = -1; |
|
|
var iIsInAutoTracking = -1; |
|
|
var iIsAtHomePOS = -1; |
|
|
|
|
|
var current_pan = "0"; |
|
|
var current_tilt = "0"; |
|
|
var current_zoom = "0"; |
|
|
|
|
|
var tab_view_size = new Array(2); |
|
|
|
|
|
{ |
|
|
for (var i = 0; i < MAX_DETECTION_ZONE; i++) { |
|
|
select_preset[i] = "0"; |
|
|
points_x_config[i] = new Array(MAX_SIZE_POINTS); |
|
|
points_y_config[i] = new Array(MAX_SIZE_POINTS); |
|
|
} |
|
|
} |
|
|
|
|
|
var image_width = GetMaxWidth(); |
|
|
var image_height = GetMaxHeight(); |
|
|
|
|
|
func_get_lang_cookie(); |
|
|
|
|
|
document.getElementById("IDC_STATIC_SHOW_ZONE").innerHTML = IDC_STATIC_SHOW_ZONE; |
|
|
|
|
|
document.getElementById("IDC_CHECK_ENABLE_TRACKING").innerHTML = IDC_CHECK_ENABLE_TRACKING; |
|
|
document.getElementById("IDC_STATIC_STATE").innerHTML = IDC_STATIC_STATE; |
|
|
document.getElementById("IDC_STATIC_TRACKING_FOV").innerHTML = IDC_STATIC_TRACKING_FOV; |
|
|
document.getElementById("IDC_STATIC_DETECTION_ZONE").innerHTML = IDC_STATIC_DETECTION_ZONE; |
|
|
document.getElementById("IDC_STATIC_TRACKING_DWELL").innerHTML = IDC_STATIC_TRACKING_DWELL; |
|
|
document.getElementById("IDC_CHECK_LINK_TO").innerHTML = IDC_CHECK_LINK_TO; |
|
|
document.getElementById("IDC_STATIC_SENSITIVITY").innerHTML = IDC_STATIC_SENSITIVITY; |
|
|
document.getElementById("IDC_STATIC_TRACKING_MODE").innerHTML = IDC_STATIC_TRACKING_MODE; |
|
|
|
|
|
document.getElementById("IDC_STATIC_TRACKING_MODE_01").text = IDC_STATIC_TRACKING_MODE_01; |
|
|
document.getElementById("IDC_STATIC_TRACKING_MODE_02").text = IDC_STATIC_TRACKING_MODE_02; |
|
|
document.getElementById("IDC_STATIC_TRACKING_MODE_03").text = IDC_STATIC_TRACKING_MODE_03; |
|
|
|
|
|
//document.getElementById("IDC_STATIC_NOTE").innerHTML = IDC_STATIC_NOTE + " 1"; |
|
|
//document.getElementById("IDC_STATIC_NOTE_2").innerHTML = IDC_STATIC_NOTE + " 2"; |
|
|
//document.getElementById("IDC_STATIC_NOTE_3").innerHTML = IDC_STATIC_NOTE + " 3"; |
|
|
document.getElementById("Note_ptz_tracking_1").innerHTML = MESSAGE82; |
|
|
document.getElementById("Note_ptz_tracking_2").innerHTML = MESSAGE83; |
|
|
document.getElementById("Note_ptz_tracking_3").innerHTML = MESSAGE84; |
|
|
document.getElementById("Note_ptz_tracking_4").innerHTML = MESSAGE85; |
|
|
document.getElementById("Note_ptz_tracking_5").innerHTML = MESSAGE86; |
|
|
document.getElementById("Note_ptz_tracking_6").innerHTML = MESSAGE87; |
|
|
|
|
|
document.getElementById("IDC_CHECK_ENABLE_TRACKING_LIMITS").innerHTML = IDC_CHECK_ENABLE_TRACKING_LIMITS; |
|
|
document.getElementById("IDC_STATIC_PTZ_PAN_LEFT_LIMIT").innerHTML = IDC_STATIC_PTZ_PAN_LEFT_LIMIT; |
|
|
document.getElementById("IDC_STATIC_PTZ_PAN_RIGHT_LIMIT").innerHTML = IDC_STATIC_PTZ_PAN_RIGHT_LIMIT; |
|
|
document.getElementById("IDC_STATIC_PTZ_TILT_UP_LIMIT").innerHTML = IDC_STATIC_PTZ_TILT_UP_LIMIT; |
|
|
document.getElementById("IDC_STATIC_PTZ_TILT_DOWN_LIMIT").innerHTML = IDC_STATIC_PTZ_TILT_DOWN_LIMIT; |
|
|
|
|
|
document.getElementById("IDC_STATIC_PTZ_SPEED").innerHTML = IDC_STATIC_PTZ_SPEED; |
|
|
|
|
|
//document.getElementById("IDC_STATIC_STATE").innerHTML = IDC_STATIC_STATE; |
|
|
document.getElementById("ptz_state").innerHTML = "Web loading"; |
|
|
|
|
|
|
|
|
$('#IDOK').val(IDOK); |
|
|
document.getElementById("TITLEBOX_PAGE08").innerHTML = TITLEBOX_PAGE08; |
|
|
$("#IDC_STATIC_START_TRACKING").val(IDC_STATIC_START_TRACKING); |
|
|
$("#IDC_STATIC_STOP_TRACKING").val(IDC_STATIC_STOP_TRACKING); |
|
|
|
|
|
var message_alert_check_if_existing_zone = MESSAGE61; |
|
|
var message_alert_check_if_set_preset = MESSAGE62; |
|
|
|
|
|
$("#tracking_fov").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: [1, 80], |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//range: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
min: 0, |
|
|
max: 80, |
|
|
// step:2.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); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
$("#sensitivity").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: [1, 80], |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//range: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
min: 1, |
|
|
max: 12, |
|
|
// step:2.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); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
$("#tracking_dwell").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: [1, 80], |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//range: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
min: 1, |
|
|
max: 150, |
|
|
// step:2.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_getptz(); |
|
|
func_get_zone_cookie(); |
|
|
|
|
|
var checkbox_enable_show_zone = document.querySelector("input[name=enable_show_zone]"); |
|
|
checkbox_enable_show_zone.addEventListener('change', function () { |
|
|
if ($('#enable_show_zone').is(":checked")) { |
|
|
func_getptz(); |
|
|
createCanvasTrafficLight_ptz([{ |
|
|
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(); |
|
|
func_show_all_zone(); |
|
|
} |
|
|
else { |
|
|
if (typeof canvasTripwire_all !== 'undefined') { |
|
|
//Clear all objects |
|
|
while (canvasTripwire_all.getObjects().length > 0) { |
|
|
var items = canvasTripwire_all.getObjects(); |
|
|
if (items[canvasTripwire_all.getObjects().length - 1]) { |
|
|
canvasTripwire_all.remove(items[canvasTripwire_all.getObjects().length - 1]); |
|
|
} |
|
|
} |
|
|
} |
|
|
click_canvas_all = 0; |
|
|
canvasTripwire_all.requestRenderAll(); |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
GetPTZStatus(); |
|
|
func_get_cur_pos(); |
|
|
|
|
|
createCanvasTrafficLight_ptz([{ |
|
|
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(); |
|
|
|
|
|
show_ptz_UI(); |
|
|
|
|
|
setInterval_check_if_count_zone_change(); |
|
|
change_color_of_button_zone(); |
|
|
|
|
|
var g_setInterval_check_if_count_zone_change = null; |
|
|
function setInterval_check_if_count_zone_change() { |
|
|
clearInterval(g_setInterval_check_if_count_zone_change); |
|
|
g_setInterval_check_if_count_zone_change = setInterval(check_if_count_zone_change, 100); |
|
|
} |
|
|
|
|
|
function check_if_count_zone_change() { |
|
|
var current_count_zone = localStorage.getItem('count_zone'); |
|
|
//console.log(current_count_zone); |
|
|
if (current_count_zone != null) { |
|
|
if (count_zone != current_count_zone) { |
|
|
count_zone = current_count_zone; |
|
|
func_getptz(); |
|
|
|
|
|
createCanvasTrafficLight_ptz([{ |
|
|
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(); |
|
|
|
|
|
show_ptz_UI(); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function func_show_all_zone() { |
|
|
|
|
|
change_color_of_button_zone(); |
|
|
|
|
|
//func_set_zone_data(); |
|
|
//func_set_zone_cookie4(); |
|
|
//func_set_zone_cookie3(); |
|
|
//func_set_zone_cookie2(); |
|
|
//func_set_zone_cookie1(); |
|
|
|
|
|
//show_all_zone = 1; |
|
|
|
|
|
if (typeof canvasTripwire_all !== 'undefined') { |
|
|
//Clear all objects |
|
|
while (canvasTripwire_all.getObjects().length > 0) { |
|
|
var items = canvasTripwire_all.getObjects(); |
|
|
if (items[canvasTripwire_all.getObjects().length - 1]) { |
|
|
canvasTripwire_all.remove(items[canvasTripwire_all.getObjects().length - 1]); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
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(); |
|
|
} |
|
|
|
|
|
var object1 = fabric.util.object.clone(canvasTripwire1.getObjects()[0]); |
|
|
var object2 = fabric.util.object.clone(canvasTripwire2.getObjects()[0]); |
|
|
var object3 = fabric.util.object.clone(canvasTripwire3.getObjects()[0]); |
|
|
var object4 = fabric.util.object.clone(canvasTripwire4.getObjects()[0]); |
|
|
var object5 = fabric.util.object.clone(canvasTripwire5.getObjects()[0]); |
|
|
var object6 = fabric.util.object.clone(canvasTripwire6.getObjects()[0]); |
|
|
var object7 = fabric.util.object.clone(canvasTripwire7.getObjects()[0]); |
|
|
var object8 = fabric.util.object.clone(canvasTripwire8.getObjects()[0]); |
|
|
if (count_zone >= 1) { |
|
|
canvasTripwire_all.add(object1); |
|
|
if (count_zone >= 2) { |
|
|
canvasTripwire_all.add(object2); |
|
|
if (count_zone >= 3) { |
|
|
canvasTripwire_all.add(object3); |
|
|
if (count_zone >= 4) { |
|
|
canvasTripwire_all.add(object4); |
|
|
if (count_zone >= 5) { |
|
|
canvasTripwire_all.add(object5); |
|
|
if (count_zone >= 6) { |
|
|
canvasTripwire_all.add(object6); |
|
|
if (count_zone >= 7) { |
|
|
canvasTripwire_all.add(object7); |
|
|
if (count_zone == 8) { |
|
|
canvasTripwire_all.add(object8); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
click_canvas_all = count_zone; |
|
|
canvasTripwire_all.requestRenderAll(); |
|
|
} |
|
|
|
|
|
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_set_zone_cookie1() { |
|
|
if (current_dzone != "dzone_1") { |
|
|
func_set_ptz_data(); |
|
|
} |
|
|
cookie("PTZ_DZONE", "dzone_1", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_1"; |
|
|
show_ptz_UI(); |
|
|
|
|
|
change_color_of_button_zone(); |
|
|
//func_set_zone_and_go_preset(0, select_preset[0]); |
|
|
func_go_preset(select_preset[0]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie2() { |
|
|
if (current_dzone != "dzone_2") { |
|
|
func_set_ptz_data(); |
|
|
} |
|
|
cookie("PTZ_DZONE", "dzone_2", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_2"; |
|
|
show_ptz_UI(); |
|
|
|
|
|
change_color_of_button_zone(); |
|
|
//func_set_zone_and_go_preset(1, select_preset[1]); |
|
|
func_go_preset(select_preset[1]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie3() { |
|
|
if (current_dzone != "dzone_3") { |
|
|
func_set_ptz_data(); |
|
|
} |
|
|
cookie("PTZ_DZONE", "dzone_3", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_3"; |
|
|
show_ptz_UI(); |
|
|
|
|
|
change_color_of_button_zone(); |
|
|
//func_set_zone_and_go_preset(2, select_preset[2]); |
|
|
func_go_preset(select_preset[2]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie4() { |
|
|
if (current_dzone != "dzone_4") { |
|
|
func_set_ptz_data(); |
|
|
} |
|
|
cookie("PTZ_DZONE", "dzone_4", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_4"; |
|
|
show_ptz_UI(); |
|
|
|
|
|
change_color_of_button_zone(); |
|
|
//func_set_zone_and_go_preset(3, select_preset[3]); |
|
|
func_go_preset(select_preset[3]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie5() { |
|
|
if (current_dzone != "dzone_5") { |
|
|
func_set_ptz_data(); |
|
|
} |
|
|
cookie("PTZ_DZONE", "dzone_5", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_5"; |
|
|
show_ptz_UI(); |
|
|
|
|
|
change_color_of_button_zone(); |
|
|
//func_set_zone_and_go_preset(4, select_preset[4]); |
|
|
func_go_preset(select_preset[4]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie6() { |
|
|
if (current_dzone != "dzone_6") { |
|
|
func_set_ptz_data(); |
|
|
} |
|
|
cookie("PTZ_DZONE", "dzone_6", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_6"; |
|
|
show_ptz_UI(); |
|
|
|
|
|
change_color_of_button_zone(); |
|
|
//func_set_zone_and_go_preset(5, select_preset[5]); |
|
|
func_go_preset(select_preset[5]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie7() { |
|
|
if (current_dzone != "dzone_7") { |
|
|
func_set_ptz_data(); |
|
|
} |
|
|
cookie("PTZ_DZONE", "dzone_7", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_7"; |
|
|
show_ptz_UI(); |
|
|
|
|
|
change_color_of_button_zone(); |
|
|
//func_set_zone_and_go_preset(6, select_preset[6]); |
|
|
func_go_preset(select_preset[6]); |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie8() { |
|
|
if (current_dzone != "dzone_8") { |
|
|
func_set_ptz_data(); |
|
|
} |
|
|
cookie("PTZ_DZONE", "dzone_8", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_8"; |
|
|
show_ptz_UI(); |
|
|
|
|
|
change_color_of_button_zone(); |
|
|
//func_set_zone_and_go_preset(7, select_preset[7]); |
|
|
func_go_preset(select_preset[7]); |
|
|
} |
|
|
|
|
|
function show_ptz_UI() { |
|
|
enable_detection_zone_button(); |
|
|
/* |
|
|
if (enable_tracking === 'Yes') |
|
|
$('#enable_tracking').prop("checked", true); |
|
|
else |
|
|
$('#enable_tracking').prop("checked", false);*/ |
|
|
|
|
|
|
|
|
if (enable_tracking === 'Yes') { |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.background = "gray"; |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.borderColor = "gray"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.background = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.borderColor = "#6c87d4"; |
|
|
} |
|
|
else { |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.background = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.background = "gray"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.borderColor = "gray"; |
|
|
} |
|
|
|
|
|
|
|
|
$('#tracking_dwell').slider('setValue', tracking_dwell); |
|
|
$('#tracking_fov').slider('setValue', ptz_tracking_fov_max); |
|
|
$('#sensitivity').slider('setValue', sensitivity); |
|
|
$('#tracking_mode').val(ptz_tracking_mode); |
|
|
|
|
|
if (enable_tracking_limits === 'Yes') |
|
|
$('#enable_tracking_limits').prop("checked", true); |
|
|
else |
|
|
$('#enable_tracking_limits').prop("checked", false); |
|
|
|
|
|
$('#ptz_pan_left').val(parseInt(ptz_pan_left_limit, 10).toString()); |
|
|
$('#ptz_pan_right').val(parseInt(ptz_pan_right_limit, 10).toString()); |
|
|
|
|
|
$('#ptz_tilt_up').val(parseInt(ptz_tilt_up_limit, 10).toString()); |
|
|
$('#ptz_tilt_down').val(parseInt(ptz_tilt_down_limit, 10).toString()); |
|
|
|
|
|
$('#ptz_speed').val(ptz_speed); |
|
|
|
|
|
|
|
|
|
|
|
var index_zone = 0; |
|
|
if (current_dzone === "dzone_1") { |
|
|
index_zone = 0; |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
index_zone = 1; |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
index_zone = 2; |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
index_zone = 3; |
|
|
} |
|
|
else if (current_dzone === "dzone_5") { |
|
|
index_zone = 4; |
|
|
} |
|
|
else if (current_dzone === "dzone_6") { |
|
|
index_zone = 5; |
|
|
} |
|
|
else if (current_dzone === "dzone_7") { |
|
|
index_zone = 6; |
|
|
} |
|
|
else if (current_dzone === "dzone_8") { |
|
|
index_zone = 7; |
|
|
} |
|
|
$("#select_preset").val(select_preset[index_zone]); |
|
|
} |
|
|
|
|
|
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_aiautotracking_json() { |
|
|
$.ajax({ |
|
|
url: "/aiautotracking_json", |
|
|
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(retdata); |
|
|
|
|
|
//console.log(jsonbuf); |
|
|
iIsInPreset = jsonbuf["iIsInPreset"]; |
|
|
iIsInAutopan = jsonbuf["iIsInAutopan"]; |
|
|
iIsInAutoTracking = jsonbuf["iIsInAutoTracking"]; |
|
|
iIsAtHomePOS = jsonbuf["iIsAtHomePOS"]; |
|
|
|
|
|
//console.log("iIsInPreset:" + iIsInPreset.toString() + ",iIsInAutopan:" + iIsInAutopan.toString() + ",iIsInAutoTracking:" + iIsInAutoTracking.toString() + ",iIsAtHomePOS:" + iIsAtHomePOS.toString()); |
|
|
|
|
|
|
|
|
if (iIsInAutoTracking == 1 && iIsInAutopan == 1) { |
|
|
document.getElementById("bar_circle").style.fill = "green"; //Tracking |
|
|
document.getElementById("ptz_state").innerHTML = "Tracking mode: on, auto pan: on"; |
|
|
} |
|
|
else if (iIsInAutoTracking == 1 && iIsInAutopan == 0) { |
|
|
document.getElementById("bar_circle").style.fill = "yellow"; // Tracking stop |
|
|
document.getElementById("ptz_state").innerHTML = "Tracking mode: on, auto pan: off"; |
|
|
} |
|
|
else if (iIsInAutoTracking == 0 && iIsInAutopan == 0) { |
|
|
if (iIsInPreset >= 1) { |
|
|
document.getElementById("bar_circle").style.fill = "red"; // Tracking close & not zero preset |
|
|
document.getElementById("ptz_state").innerHTML = "Object mode: on, tracking mode: off, auto pan: off"; |
|
|
} |
|
|
else { |
|
|
document.getElementById("bar_circle").style.fill = "#BABABA"; // Tracking close & zero preset |
|
|
document.getElementById("ptz_state").innerHTML = "Object mode: off, tracking mode: off, auto pan: off"; |
|
|
} |
|
|
} |
|
|
else { |
|
|
document.getElementById("bar_circle").style.fill = "pink"; // Other mode |
|
|
document.getElementById("ptz_state").innerHTML = "Sequence mode: on, tracking mode: off, auto pan: on"; |
|
|
} |
|
|
//console.info(retdata); |
|
|
}, |
|
|
error: function (retdata) { |
|
|
console.warn(retdata); |
|
|
document.getElementById("bar_circle").style.fill = "blue"; //Error |
|
|
document.getElementById("ptz_state").innerHTML = "Network error"; |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_get_cur_pos() { |
|
|
$.ajax({ |
|
|
url: "/get_cur_pos", |
|
|
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(retdata); |
|
|
|
|
|
current_pan = jsonbuf["pan"]; |
|
|
current_tilt = jsonbuf["tilt"]; |
|
|
current_zoom = jsonbuf["zoom"]; |
|
|
|
|
|
document.getElementById("current_view").innerHTML = " " + current_pan + " / " + current_tilt + " / " + current_zoom + "x" + " "; |
|
|
|
|
|
//console.info(retdata); |
|
|
}, |
|
|
error: function (retdata) { |
|
|
console.warn(retdata); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_getptz() { |
|
|
$.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(retdata); |
|
|
|
|
|
count_zone = jsonbuf["count_zone"]; |
|
|
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); |
|
|
|
|
|
enable_tracking_limits = jsonbuf["enable_tracking_limits"]; |
|
|
ptz_pan_left_limit = jsonbuf["ptz_pan_left_limit"]; |
|
|
ptz_pan_right_limit = jsonbuf["ptz_pan_right_limit"]; |
|
|
ptz_tilt_up_limit = jsonbuf["ptz_tilt_up_limit"]; |
|
|
ptz_tilt_down_limit = jsonbuf["ptz_tilt_down_limit"]; |
|
|
ptz_speed = jsonbuf["ptz_speed"]; |
|
|
|
|
|
//ptz_tracking_fov_min = jsonbuf["ptz_tracking_fov_min"]; |
|
|
ptz_tracking_fov_max = jsonbuf["ptz_tracking_fov_max"]; |
|
|
enable_tracking = jsonbuf["ptz_enable_tracking"]; |
|
|
tracking_dwell = jsonbuf["ptz_tracking_resume_dwell"]; |
|
|
sensitivity = jsonbuf["ptz_sensitivity"]; |
|
|
ptz_tracking_mode = jsonbuf["ptz_tracking_mode"]; |
|
|
|
|
|
if (jsonbuf != null) { |
|
|
for (var i = 0; i < MAX_DETECTION_ZONE; i++) { |
|
|
select_preset[i] = jsonbuf["detection_zone"][i]["ptz_zone_to_preset"]; |
|
|
|
|
|
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 (enable_tracking === 'Yes') { |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.background = "gray"; |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.borderColor = "gray"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.background = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.borderColor = "#6c87d4"; |
|
|
} |
|
|
else { |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.background = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.background = "gray"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.borderColor = "gray"; |
|
|
} |
|
|
//console.info(retdata); |
|
|
}, |
|
|
error: function (retdata) { |
|
|
console.warn(retdata); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_setptz() { |
|
|
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_move_ptz_stop() { |
|
|
$.ajax({ |
|
|
url: "/ptz_stop", |
|
|
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_ptz_move_direction(move_ptz_pan, move_ptz_tilt) { |
|
|
$.ajax({ |
|
|
url: "/ptz_move_direction?pan=" + move_ptz_pan.toString() + "&tilt=" + move_ptz_tilt.toString(), |
|
|
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_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_run_osd_server() { |
|
|
$.ajax({ |
|
|
url: "/run_osd_server", |
|
|
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; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
function func_ptz_start() { |
|
|
func_setptz(); |
|
|
$.ajax({ |
|
|
url: "/ptzcontrol?enable_ptz=Yes", |
|
|
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 (retdata) { |
|
|
var index_retdata = retdata.indexOf("setup"); |
|
|
if (index_retdata >= 2) { |
|
|
alert("Please setup the camera at Home position and click Start button."); |
|
|
} |
|
|
else { |
|
|
enable_tracking = "Yes"; |
|
|
} |
|
|
//console.info(); |
|
|
|
|
|
if (enable_tracking === 'Yes') { |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.background = "gray"; |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.borderColor = "gray"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.background = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.borderColor = "#6c87d4"; |
|
|
} |
|
|
else { |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.background = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.background = "gray"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.borderColor = "gray"; |
|
|
} |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_ptz_stop() { |
|
|
$.ajax({ |
|
|
url: "/ptzcontrol?enable_ptz=No", |
|
|
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(); |
|
|
enable_tracking = "No"; |
|
|
|
|
|
if (enable_tracking === 'Yes') { |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.background = "gray"; |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.borderColor = "gray"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.background = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.borderColor = "#6c87d4"; |
|
|
} |
|
|
else { |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.background = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_STOP_TRACKING").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.background = "gray"; |
|
|
document.getElementById("IDC_STATIC_START_TRACKING").style.borderColor = "gray"; |
|
|
} |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_go_preset(go_preset) { |
|
|
$.ajax({ |
|
|
url: "/ptzcontrol?go_preset=" + go_preset, |
|
|
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(); |
|
|
//func_getreload(); |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_set_zone_and_go_preset(index_zone, go_preset) { |
|
|
$.ajax({ |
|
|
url: "/ptzcontrol?set&zone=" + index_zone.toString() + "&preset=" + go_preset, |
|
|
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(); |
|
|
//func_getreload(); |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_preset_onchange() { |
|
|
func_set_ptz_data(); |
|
|
|
|
|
var index_zone = 0; |
|
|
if (current_dzone === "dzone_1") { |
|
|
index_zone = 0; |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
index_zone = 1; |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
index_zone = 2; |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
index_zone = 3; |
|
|
} |
|
|
else if (current_dzone === "dzone_5") { |
|
|
index_zone = 4; |
|
|
} |
|
|
else if (current_dzone === "dzone_6") { |
|
|
index_zone = 5; |
|
|
} |
|
|
else if (current_dzone === "dzone_7") { |
|
|
index_zone = 6; |
|
|
} |
|
|
else if (current_dzone === "dzone_8") { |
|
|
index_zone = 7; |
|
|
} |
|
|
func_set_zone_and_go_preset(index_zone, select_preset[index_zone]); |
|
|
func_setptz(); |
|
|
//func_go_preset(select_preset[index_zone]); |
|
|
} |
|
|
|
|
|
function func_get_zone_cookie() { |
|
|
var list = ''; |
|
|
var cookies = cookie(); |
|
|
|
|
|
for (var v in cookies) { |
|
|
if (v === 'PTZ_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("PTZ_DZONE", "dzone_1", "9999/12/31 12:00:00"); |
|
|
current_dzone = "dzone_1"; |
|
|
return 'dzone_1'; |
|
|
} |
|
|
|
|
|
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 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_set_ptz_data(); |
|
|
|
|
|
var json_data = '{"view_setting":{"camera01":{'; |
|
|
json_data += '"ptz_tracking_resume_dwell": "' + tracking_dwell + '",'; |
|
|
json_data += '"ptz_tracking_fov_max": "' + ptz_tracking_fov_max + '",'; |
|
|
json_data += '"enable_tracking_limits": "' + enable_tracking_limits + '",'; |
|
|
json_data += '"ptz_pan_left_limit": "' + ptz_pan_left_limit + '",'; |
|
|
json_data += '"ptz_pan_right_limit": "' + ptz_pan_right_limit + '",'; |
|
|
json_data += '"ptz_tilt_up_limit": "' + ptz_tilt_up_limit + '",'; |
|
|
json_data += '"ptz_tilt_down_limit": "' + ptz_tilt_down_limit + '",'; |
|
|
json_data += '"ptz_speed": "' + ptz_speed + '",'; |
|
|
json_data += '"ptz_tracking_mode": "' + ptz_tracking_mode + '",'; |
|
|
json_data += '"ptz_sensitivity": "' + sensitivity + '",'; |
|
|
json_data += '"detection_zone":['; |
|
|
json_data += '{'; |
|
|
json_data += '"ptz_zone_to_preset": "' + select_preset[0] + '"'; |
|
|
json_data += '},{'; |
|
|
json_data += '"ptz_zone_to_preset": "' + select_preset[1] + '"'; |
|
|
json_data += '},{'; |
|
|
json_data += '"ptz_zone_to_preset": "' + select_preset[2] + '"'; |
|
|
json_data += '},{'; |
|
|
json_data += '"ptz_zone_to_preset": "' + select_preset[3] + '"'; |
|
|
json_data += '},{'; |
|
|
json_data += '"ptz_zone_to_preset": "' + select_preset[4] + '"'; |
|
|
json_data += '},{'; |
|
|
json_data += '"ptz_zone_to_preset": "' + select_preset[5] + '"'; |
|
|
json_data += '},{'; |
|
|
json_data += '"ptz_zone_to_preset": "' + select_preset[6] + '"'; |
|
|
json_data += '},{'; |
|
|
json_data += '"ptz_zone_to_preset": "' + select_preset[7] + '"'; |
|
|
json_data += '}'; |
|
|
json_data += ']'; |
|
|
json_data += '}}}'; |
|
|
|
|
|
func_setconfigfile(json_data); |
|
|
|
|
|
k_index = 94; |
|
|
} |
|
|
else if (k_index == 95) { |
|
|
//waitSeconds(500); |
|
|
} |
|
|
else if (k_index == 100) { |
|
|
func_run_osd_server(); |
|
|
$(".progress-bar").css("visibility", "hidden"); |
|
|
//$(".progress-bar").css("width", "0%").text("0 %"); |
|
|
$(".progress-bar").css("width", "0%"); |
|
|
k_index = -1; |
|
|
|
|
|
if (count_zone == 0) { |
|
|
alert(message_alert_check_if_existing_zone); |
|
|
} |
|
|
else if (count_zone >= 1) { |
|
|
var check_no_preset = 1; |
|
|
for (var index_zone_for_preset = 0; index_zone_for_preset < count_zone; index_zone_for_preset++) { |
|
|
if (select_preset[index_zone_for_preset] >= 1) |
|
|
check_no_preset = 0; |
|
|
} |
|
|
if (check_no_preset) |
|
|
alert(message_alert_check_if_set_preset); |
|
|
} |
|
|
} |
|
|
// Wait for sometime before running this script again |
|
|
setTimeout("makeProgress()", 200); |
|
|
} |
|
|
} |
|
|
|
|
|
function func_set_ptz_data() { |
|
|
/* |
|
|
if ($('#enable_tracking').is(":checked")) { |
|
|
enable_tracking = "Yes"; |
|
|
} |
|
|
else { |
|
|
enable_tracking = "No"; |
|
|
}*/ |
|
|
tracking_dwell = $('#tracking_dwell').slider('getValue'); |
|
|
sensitivity = $('#sensitivity').slider('getValue'); |
|
|
//ptz_tracking_fov_min = $('#tracking_fov').slider('getValues')[0]; |
|
|
ptz_tracking_fov_max = $('#tracking_fov').slider('getValue'); |
|
|
|
|
|
if ($('#enable_tracking_limits').is(":checked")) { |
|
|
enable_tracking_limits = "Yes"; |
|
|
} |
|
|
else { |
|
|
enable_tracking_limits = "No"; |
|
|
} |
|
|
|
|
|
if ($('#ptz_pan_left').val().length == 0 || !parseInt($('#ptz_pan_left').val(), 10)) { |
|
|
$('#ptz_pan_left').val("0"); |
|
|
} |
|
|
|
|
|
if ($('#ptz_pan_right').val().length == 0 || !parseInt($('#ptz_pan_right').val(), 10)) { |
|
|
$('#ptz_pan_right').val("360"); |
|
|
} |
|
|
|
|
|
if ($('#ptz_tilt_up').val().length == 0 || !parseInt($('#ptz_tilt_up').val(), 10)) { |
|
|
$('#ptz_tilt_up').val("0"); |
|
|
} |
|
|
|
|
|
if ($('#ptz_tilt_down').val().length == 0 || !parseInt($('#ptz_tilt_down').val(), 10)) { |
|
|
$('#ptz_tilt_down').val("210"); |
|
|
} |
|
|
|
|
|
ptz_pan_left_limit = parseInt($('#ptz_pan_left').val(), 10).toString(); |
|
|
ptz_pan_right_limit = parseInt($('#ptz_pan_right').val(), 10).toString(); |
|
|
|
|
|
ptz_tilt_up_limit = parseInt($('#ptz_tilt_up').val(), 10).toString(); |
|
|
ptz_tilt_down_limit = parseInt($('#ptz_tilt_down').val(), 10).toString(); |
|
|
|
|
|
ptz_speed = $('#ptz_speed').val(); |
|
|
|
|
|
ptz_tracking_mode = $('#tracking_mode').val(); |
|
|
|
|
|
var index_zone = 0; |
|
|
if (current_dzone === "dzone_1") { |
|
|
index_zone = 0; |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
index_zone = 1; |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
index_zone = 2; |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
index_zone = 3; |
|
|
} |
|
|
else if (current_dzone === "dzone_5") { |
|
|
index_zone = 4; |
|
|
} |
|
|
else if (current_dzone === "dzone_6") { |
|
|
index_zone = 5; |
|
|
} |
|
|
else if (current_dzone === "dzone_7") { |
|
|
index_zone = 6; |
|
|
} |
|
|
else if (current_dzone === "dzone_8") { |
|
|
index_zone = 7; |
|
|
} |
|
|
select_preset[index_zone] = $("#select_preset").val(); |
|
|
} |
|
|
|
|
|
|
|
|
getValue(); |
|
|
|
|
|
localStorage.setItem('ptz_success', 'OK'); |
|
|
</script> |
|
|
</body> |
|
|
</html> |