Browse Source

2.0.7.69

master
ming.hong 1 year ago
parent
commit
6b3ba9ad67
  1. 16
      Aida/airelay_init.html
  2. 144
      Aida/alarm.html
  3. 224
      Aida/alarm.js
  4. 46
      Aida/alarm_on_airelay.html
  5. 87
      Aida/alarm_on_airelay.js
  6. 117
      Aida/alarm_on_nvr.html
  7. 435
      Aida/codemirror.min.css
  8. 2
      Aida/cool_counter.js
  9. 2
      Aida/heatmap.js
  10. BIN
      Aida/images/blank.gif
  11. BIN
      Aida/images/loading.gif
  12. 2
      Aida/index.html
  13. 16
      Aida/label_names.js
  14. 10
      Aida/lang.js
  15. BIN
      Aida/lilin.png
  16. 2
      Aida/menu_on_nvr.html
  17. 2
      Aida/ptz.js
  18. 74
      Aida/python.html
  19. 126
      Aida/python.min.js
  20. 210
      Aida/setting.html
  21. 214
      Aida/setting_on_nvr.html
  22. 2
      Aida/speed_index.js

16
Aida/airelay_init.html

@ -147,7 +147,8 @@
script.onload = function () { script.onload = function () {
// console.log('[script ' + currentIndex + '] ' + src + ' has been successfully loaded'); // console.log('[script ' + currentIndex + '] ' + src + ' has been successfully loaded');
index++; index++;
setTimeout(loadNextScript, interval); // 加載下一個腳本之前等待一段時間 // setTimeout(loadNextScript, interval); // 加載下一個腳本之前等待一段時間
loadNextScript(); // 2024-11-05 被抱怨等太久,取消 setTimeout 機制
loadCount++; loadCount++;
}; };
@ -183,7 +184,7 @@
function preloadImagesWithDelay() { function preloadImagesWithDelay() {
var imgIndex = 0; var imgIndex = 0;
var interval = 150; // 每次迭代之間的延遲時間,單位是毫秒 var interval = 10; //150; // 每次迭代之間的延遲時間,單位是毫秒
function loadNextImage() { function loadNextImage() {
if (imgIndex < imagesToPreload.length) { if (imgIndex < imagesToPreload.length) {
@ -197,7 +198,9 @@
link.onload = function () { link.onload = function () {
// console.log('[img ' + imgIndex + '] ' + src + ' has been successfully preloaded'); // console.log('[img ' + imgIndex + '] ' + src + ' has been successfully preloaded');
imgIndex++; imgIndex++;
setTimeout(loadNextImage, interval); // 加載下一個影像之前等待一段時間
// setTimeout(loadNextImage, interval); // 加載下一個影像之前等待一段時間
loadNextImage(); // 2024-11-05 被抱怨等太久,取消 setTimeout 機制
}; };
link.onerror = function () { link.onerror = function () {
@ -352,9 +355,8 @@
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
var checkIntervalTime = 500; var checkIntervalTime = 100;
var hideLoadPageDeferTime = 1500; var hideLoadPageDeferTime = 500;//1500;
var preloadImgDisplayTime = 500;
var intervalID = null; var intervalID = null;
var checkPercentageStuckCounter = 0; var checkPercentageStuckCounter = 0;
var percentage = 0; var percentage = 0;
@ -599,7 +601,7 @@
localStorage.setItem('current_state_hide_or_open_label', 0); localStorage.setItem('current_state_hide_or_open_label', 0);
} }
else { else {
localStorage.setItem('current_state_hide_or_open_label', 1); localStorage.setItem('current_state_hide_or_open_label', 0);
} }
} }

144
Aida/alarm.html

@ -1970,7 +1970,64 @@
} }
} }
} }
click_canvas_all = count_zone;
// 08-24 確認是否有設定警戒線的 Zone,額外再加上紅線物件
var arrow_num = 0;
for (var index_zone = 0; index_zone < count_zone; index_zone++) {
// console.log(`[func_show_all_zone] check current_trigger[${index_zone}]: ${current_trigger[index_zone]}`);
// 比照 func_listen_to_enable_or_disable_show_direction 開啟紅線物件可見性的條件
if (
current_trigger[index_zone] == 4
|| current_trigger[index_zone] == 17
|| current_trigger[index_zone] == 18
|| current_trigger[index_zone] == 19
) {
arrow_num++;
var arrow_obj = null;
// ------------------------------------------------------
// 比照 clone 寫法位置會有問題,改仿照 Edit_Arrow 內部流程新增紅線物件
// if (index_zone == 0)
// {
// arrow_obj = fabric.util.object.clone(canvasTripwire1.getObjects()[1]);
// }
// else if (index_zone == 1)
// {
// arrow_obj = fabric.util.object.clone(canvasTripwire2.getObjects()[1]);
// }
// else if (index_zone == 2)
// {
// arrow_obj = fabric.util.object.clone(canvasTripwire3.getObjects()[1]);
// }
// else if (index_zone == 3)
// {
// arrow_obj = fabric.util.object.clone(canvasTripwire4.getObjects()[1]);
// }
// console.log("clone arrow_obj:");
// console.log(arrow_obj);
// ------------------------------------------------------
// 參照 Edit_Arrow
points_array = GetPointLocation(index_zone);
var index_point = g_mydirection[g_zone_id] - 1;
var next_point = index_point + 1 >= 4 ? 0 : index_point + 1;
var start_x = points_array[next_point].x;
var start_y = points_array[next_point].y;
var end_x = points_array[index_point].x;
var end_y = points_array[index_point].y;
arrow_obj = AddArrowObject(start_x, start_y, end_x, end_y)
arrow_obj.visible = true;
// ------------------------------------------------------
if (arrow_obj != null) {
canvasTripwire_all.add(arrow_obj);
}
}
}
// click_canvas_all = count_zone;
click_canvas_all = count_zone + arrow_num; // 確保多新增的紅線物件不會馬上被 RefreshCanvasObject 保護物件數量參數給清除掉
canvasTripwire_all.requestRenderAll(); canvasTripwire_all.requestRenderAll();
//document.getElementById('IDOK').disabled = true; //document.getElementById('IDOK').disabled = true;
@ -4286,7 +4343,7 @@
disabelIteraction(canvasTripwire7.getObjects()[0]); disabelIteraction(canvasTripwire7.getObjects()[0]);
Edit8(); Edit8();
} }
func_getbar(); func_getbar();
show_tof_map(); show_tof_map();
} }
@ -4455,28 +4512,35 @@
} }
function func_seteventsfile(json_data) { function func_seteventsfile(json_data) {
waitSeconds(100);
$.ajax({ $.ajax({
url: "/seteventsfile", url: "/seteventsfile",
method: "POST", method: "POST",
async: false, async: false,
data: json_data, data: json_data,
contentType: false, //contentType: false,
processData: false, processData: false,
timeout: 5000,
cache: false,
xhrFields: {
withCredentials: true // 設置為 true 如果需要帶上 Cookies 或其他認證
},
contentType: 'text/plain', // 傳送純文本
beforeSend: function (xmlHttp) { beforeSend: function (xmlHttp) {
xmlHttp.setRequestHeader("If-Modified-Since", "0"); xmlHttp.setRequestHeader("If-Modified-Since", "0");
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); xmlHttp.setRequestHeader("Cache-Control", "no-cache");
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); //xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
}, },
success: function () { success: function (retdata) {
//console.info(); //console.info();
}, },
error: function () { error: function (retdata) {
console.warn(); console.warn(retdata);
k_index++; k_index++;
if (k_index <= 94) { if (k_index <= 94) {
waitSeconds(500); waitSeconds(1000);
func_seteventsfile(json_data); func_seteventsfile(json_data);
} }
} }
@ -4485,27 +4549,34 @@
} }
function func_setconfigfile(json_data) { function func_setconfigfile(json_data) {
waitSeconds(100);
$.ajax({ $.ajax({
url: "/setconfigfile", url: "/setconfigfile",
method: "POST", method: "POST",
async: false, async: false,
data: json_data, data: json_data,
contentType: false, //contentType: false,
processData: false, processData: false,
timeout: 5000,
cache: false,
xhrFields: {
withCredentials: true // 設置為 true 如果需要帶上 Cookies 或其他認證
},
contentType: 'text/plain', // 傳送純文本
beforeSend: function (xmlHttp) { beforeSend: function (xmlHttp) {
xmlHttp.setRequestHeader("If-Modified-Since", "0"); xmlHttp.setRequestHeader("If-Modified-Since", "0");
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); xmlHttp.setRequestHeader("Cache-Control", "no-cache");
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); //xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
}, },
success: function () { success: function (retdata) {
//console.info(); //console.info();
}, },
error: function () { error: function (retdata) {
console.warn(); console.warn(retdata);
k_index++; k_index++;
if (k_index <= 94) { if (k_index <= 94) {
waitSeconds(500); waitSeconds(1000);
func_setconfigfile(json_data); func_setconfigfile(json_data);
} }
} }
@ -6814,8 +6885,11 @@
var json_data = '{"view_setting":{"camera01":{"obj_max_proportion": "' + obj_max_proportion; var json_data = '{"view_setting":{"camera01":{"obj_max_proportion": "' + obj_max_proportion;
json_data += '","obj_min_proportion": "' + obj_min_proportion + '","enable_traffic": "' + enable_traffic + '","enable_unknown_object": "' + enable_unknown_object + '","enable_track": "' + enable_track; json_data += '","obj_min_proportion": "' + obj_min_proportion + '","enable_traffic": "' + enable_traffic + '","enable_unknown_object": "' + enable_unknown_object + '","enable_track": "' + enable_track;
json_data += '","confidence2": "' + confidence_traffic + '","count_zone": ' + count_zone; json_data += '","confidence2": "' + confidence_traffic + '","count_zone": ' + count_zone;
json_data += ',"detection_zone":['; json_data += '}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{"enable_direction1": "' + enable_direction[0]; json_data += '{"enable_direction1": "' + enable_direction[0];
json_data += '","direction1": "' + func_get_direction(0).toString(); json_data += '","direction1": "' + func_get_direction(0).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[0]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[0];
@ -6842,8 +6916,12 @@
json_data += ',"y5": ' + Math.round(points_array_0[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_0[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_0[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_0[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_0[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_0[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},'
json_data += '{"enable_direction1": "' + enable_direction[1]; json_data += '{"enable_direction1": "' + enable_direction[1];
json_data += '","direction1": "' + func_get_direction(1).toString(); json_data += '","direction1": "' + func_get_direction(1).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[1]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[1];
@ -6870,8 +6948,12 @@
json_data += ',"y5": ' + Math.round(points_array_1[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_1[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_1[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_1[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_1[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_1[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},';
json_data += '{"enable_direction1": "' + enable_direction[2]; json_data += '{"enable_direction1": "' + enable_direction[2];
json_data += '","direction1": "' + func_get_direction(2).toString(); json_data += '","direction1": "' + func_get_direction(2).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[2]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[2];
@ -6898,8 +6980,12 @@
json_data += ',"y5": ' + Math.round(points_array_2[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_2[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_2[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_2[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_2[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_2[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},{},';
json_data += '{"enable_direction1": "' + enable_direction[3]; json_data += '{"enable_direction1": "' + enable_direction[3];
json_data += '","direction1": "' + func_get_direction(3).toString(); json_data += '","direction1": "' + func_get_direction(3).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[3]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[3];
@ -6926,8 +7012,12 @@
json_data += ',"y5": ' + Math.round(points_array_3[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_3[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_3[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_3[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_3[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_3[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},{},{},';
json_data += '{"enable_direction1": "' + enable_direction[4]; json_data += '{"enable_direction1": "' + enable_direction[4];
json_data += '","direction1": "' + func_get_direction(4).toString(); json_data += '","direction1": "' + func_get_direction(4).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[4]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[4];
@ -6954,8 +7044,12 @@
json_data += ',"y5": ' + Math.round(points_array_4[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_4[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_4[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_4[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_4[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_4[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},{},{},{},';
json_data += '{"enable_direction1": "' + enable_direction[5]; json_data += '{"enable_direction1": "' + enable_direction[5];
json_data += '","direction1": "' + func_get_direction(5).toString(); json_data += '","direction1": "' + func_get_direction(5).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[5]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[5];
@ -6982,8 +7076,12 @@
json_data += ',"y5": ' + Math.round(points_array_5[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_5[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_5[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_5[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_5[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_5[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},{},{},{},{},';
json_data += '{"enable_direction1": "' + enable_direction[6]; json_data += '{"enable_direction1": "' + enable_direction[6];
json_data += '","direction1": "' + func_get_direction(6).toString(); json_data += '","direction1": "' + func_get_direction(6).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[6]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[6];
@ -7010,8 +7108,12 @@
json_data += ',"y5": ' + Math.round(points_array_6[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_6[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_6[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_6[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_6[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_6[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},{},{},{},{},{},';
json_data += '{"enable_direction1": "' + enable_direction[7]; json_data += '{"enable_direction1": "' + enable_direction[7];
json_data += '","direction1": "' + func_get_direction(7).toString(); json_data += '","direction1": "' + func_get_direction(7).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[7]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[7];
@ -7039,8 +7141,6 @@
json_data += ',"x6": ' + Math.round(points_array_7[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_7[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_7[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_7[5].y * tab_view_size[1] / image_height);
json_data += '}]}}}'; json_data += '}]}}}';
//console.log(json_data);
func_setconfigfile(json_data); func_setconfigfile(json_data);
var text_checked_trigger_events = new Array(MAX_DETECTION_ZONE); var text_checked_trigger_events = new Array(MAX_DETECTION_ZONE);

224
Aida/alarm.js

@ -309,7 +309,7 @@ function insertTrafficLightRectangle(r_left, r_top, r_width, r_height, r_direct,
if (r_name == "person") { if (r_name == "person") {
color_type = '#FF8C00'; color_type = '#FF8C00';
} }
else { else if(r_name == "car"){
color_type = '#800080'; color_type = '#800080';
} }
} }
@ -3046,7 +3046,12 @@ function GetAlarm(alarm_data) {
var complete_data = ""; var complete_data = "";
var n1 = -1, n2 = -1, n2_temp = -1; var n1 = -1, n2 = -1, n2_temp = -1;
// console.log("[GetAlarm] localStorage fetchHttpGetalarm:", localStorage.getItem("fetchHttpGetalarm"));
// console.log("[GetAlarm] g_max_protected_objects:", g_max_protected_objects);
var max_protected_objects = g_max_protected_objects; var max_protected_objects = g_max_protected_objects;
if (g_enable_show_pixel === 1) { if (g_enable_show_pixel === 1) {
max_protected_objects = g_max_protected_objects + 2; max_protected_objects = g_max_protected_objects + 2;
} }
@ -3059,6 +3064,8 @@ function GetAlarm(alarm_data) {
n2 = complete_data.indexOf('}', n2_temp); n2 = complete_data.indexOf('}', n2_temp);
// console.log(`[GetAlarm] n1:${n1} , n2_temp:${n2_temp} , n2:${n2}`);
if (n1 > 0 && n2_temp > 0 && n2 > 0 && (n1 + 7) < n2_temp && n2_temp < n2) { if (n1 > 0 && n2_temp > 0 && n2 > 0 && (n1 + 7) < n2_temp && n2_temp < n2) {
wait_count = 0; wait_count = 0;
clear_count = 0; clear_count = 0;
@ -3073,6 +3080,9 @@ function GetAlarm(alarm_data) {
buffer_cam_time = ""; buffer_cam_time = "";
buffer_cam_time = datas[i].slice(); buffer_cam_time = datas[i].slice();
}*/ }*/
// console.log(`datas[${i}].length: ${datas[i].length}`);
if (datas[i].length > 12 && datas[i].substring(0, 12) == '{"AiEngine":' && datas[i].length < 8192 * 8) { if (datas[i].length > 12 && datas[i].substring(0, 12) == '{"AiEngine":' && datas[i].length < 8192 * 8) {
//datas[i].replace(/\\'/g, "'"); //datas[i].replace(/\\'/g, "'");
//datas[i].replace('\"', '"'); //datas[i].replace('\"', '"');
@ -3100,6 +3110,9 @@ function GetAlarm(alarm_data) {
ai_json = JSON.parse(temp); ai_json = JSON.parse(temp);
//ai_json = validatingJSON(temp); //ai_json = validatingJSON(temp);
// console.log("ai_json:");
// console.log(ai_json);
datas[i] = null; datas[i] = null;
//check_cam_time = 1; //check_cam_time = 1;
@ -3123,7 +3136,7 @@ function GetAlarm(alarm_data) {
} }
}*/ }*/
//console.log(ai_json); // console.log(ai_json);
if (localStorage.getItem("ToF_recognition") === "Yes"){ if (localStorage.getItem("ToF_recognition") === "Yes"){
// console.log("ai_json.AIToF:"); // console.log("ai_json.AIToF:");
@ -3154,12 +3167,15 @@ function GetAlarm(alarm_data) {
/*if (clear_count_2 >= 3) */ /*if (clear_count_2 >= 3) */
{ {
//clear_count_2 = 0; //clear_count_2 = 0;
// console.log("[WebSocket] max_protected_objects: ", max_protected_objects);
RefreshCanvasObject(max_protected_objects); RefreshCanvasObject(max_protected_objects);
} }
//console.log("bbox_count: " + bbox_count.toString()); //console.log("bbox_count: " + bbox_count.toString());
// console.log("ai_json.counter_count:", ai_json.counter_count);
if (ai_json != null && typeof ai_json.counter_count !== 'undefined') { if (ai_json != null && typeof ai_json.counter_count !== 'undefined') {
counter_count_msg = ""; counter_count_msg = "";
@ -3233,12 +3249,15 @@ function GetAlarm(alarm_data) {
insert_red_text = "FPS:" + AI_fps.toString() + ","; insert_red_text = "FPS:" + AI_fps.toString() + ",";
} }
var insert_red_text_max = ""; var insert_red_text_max = "";
var insert_red_text_min = ""; var insert_red_text_min = "";
if (current_state_hide_or_open_getalarmmotion == 1) { if (current_state_hide_or_open_getalarmmotion == 1) {
for (var i = 0; i < bbox_count /*&& i <= 10*/; i++) { for (var i = 0; i < bbox_count /*&& i <= 10*/; i++) {
// console.log(ai_json.AiEngine[i]);
if (ai_json.AiEngine[i]) { if (ai_json.AiEngine[i]) {
if (ai_json.AiEngine[i].parent_idx == -1) { if (ai_json.AiEngine[i].parent_idx == -1) {
@ -3336,8 +3355,8 @@ function GetAlarm(alarm_data) {
continue; continue;
} }
if (canvasTripwire_all && canvasTripwire && canvasTripwire1 && canvasTripwire2 && canvasTripwire3 && canvasTripwire4 && canvasTripwire5 && canvasTripwire6 && canvasTripwire7 && canvasTripwire8) { if (canvasTripwire_all && canvasTripwire && canvasTripwire1 && canvasTripwire2 && canvasTripwire3 && canvasTripwire4 && canvasTripwire5 && canvasTripwire6 && canvasTripwire7 && canvasTripwire8) {
var translate_name = func_translate_name(plate_name); var translate_name = func_translate_name(plate_name);
var behavior_id = ai_json.AiEngine[i].behavior_id; var behavior_id = ai_json.AiEngine[i].behavior_id;
var detection_zone_id = ai_json.AiEngine[i].detection_zone_id; var detection_zone_id = ai_json.AiEngine[i].detection_zone_id;
@ -3583,6 +3602,13 @@ function GetAlarm(alarm_data) {
canvasTripwire8.add(insertTrafficLightRectangle(x * 0.25, y * 0.3, w * 0.25, h * 0.3, 1, 1, plate_name, number_row)); canvasTripwire8.add(insertTrafficLightRectangle(x * 0.25, y * 0.3, w * 0.25, h * 0.3, 1, 1, plate_name, number_row));
} }
else { else {
// 11-01
// console.log("trigger any events... , behavior_id: ", behavior_id); // 禁區 0 , 久留 4, 警戒線 8
// console.log(ai_json.AiEngine[i]); // 沒有和 zone index 相關的資訊
// console.log("detection_zone_id: ", detection_zone_id); // undefined
func_checkTriggerZoneStatus(behavior_id); // 為了連動 zone polygon 變顏色
canvasTripwire_all.add(insertTrafficLightRectangle_Red(x * 0.25, y * 0.3, w * 0.25, h * 0.3, 1, 1, plate_name)); canvasTripwire_all.add(insertTrafficLightRectangle_Red(x * 0.25, y * 0.3, w * 0.25, h * 0.3, 1, 1, plate_name));
canvasTripwire.add(insertTrafficLightRectangle_Red(x * 0.25, y * 0.3, w * 0.25, h * 0.3, 1, 1, plate_name)); canvasTripwire.add(insertTrafficLightRectangle_Red(x * 0.25, y * 0.3, w * 0.25, h * 0.3, 1, 1, plate_name));
canvasTripwire1.add(insertTrafficLightRectangle_Red(x * 0.25, y * 0.3, w * 0.25, h * 0.3, 1, 1, plate_name)); canvasTripwire1.add(insertTrafficLightRectangle_Red(x * 0.25, y * 0.3, w * 0.25, h * 0.3, 1, 1, plate_name));
@ -3647,7 +3673,7 @@ function GetAlarm(alarm_data) {
} }
} }
} }
var bbox_count_short = 0; var bbox_count_short = 0;
var bbox_count_long = 0; var bbox_count_long = 0;
@ -3923,6 +3949,9 @@ function GetAlarm(alarm_data) {
canvasTripwire8.getObjects()[0].stroke = "#ff0000"; canvasTripwire8.getObjects()[0].stroke = "#ff0000";
} }
// 11-01
func_checkZoneColor();
if (canvasTripwire_all && canvasTripwire && canvasTripwire1 && canvasTripwire2 && canvasTripwire3 && canvasTripwire4 && canvasTripwire5 && canvasTripwire6 && canvasTripwire7 && canvasTripwire8) { if (canvasTripwire_all && canvasTripwire && canvasTripwire1 && canvasTripwire2 && canvasTripwire3 && canvasTripwire4 && canvasTripwire5 && canvasTripwire6 && canvasTripwire7 && canvasTripwire8) {
for (var index_zone = 0; index_zone < count_zone; index_zone++) { for (var index_zone = 0; index_zone < count_zone; index_zone++) {
if (parseInt(parking_space[index_zone], 10) >= 1 && parseInt(parking_line[index_zone], 10) >= 1) { if (parseInt(parking_space[index_zone], 10) >= 1 && parseInt(parking_line[index_zone], 10) >= 1) {
@ -4190,27 +4219,6 @@ function AssignPlateObject(ai_json,i_index,plate_name) {
var h = parseInt(ai_json.AiEngine[i_index].h, 10); var h = parseInt(ai_json.AiEngine[i_index].h, 10);
var text_y = parseInt((ai_json.AiEngine[i_index].y + ai_json.AiEngine[i_index].h), 10); var text_y = parseInt((ai_json.AiEngine[i_index].y + ai_json.AiEngine[i_index].h), 10);
//console.log(text_y); //console.log(text_y);
/*if (x * 0.25 <= 20) {
x = 80;
}
else if (x * 0.25 >= 460) {
x = 1840;
}
if (y * 0.3 <= 20) {
y = 66;
}
else if (y * 0.3 >= 300) {
y = 999;
}
if (x * 0.25 + w * 0.25 >= 460) {
w = parseInt((460 - x * 0.25) * 4, 10);
}
if (y * 0.3 + h * 0.3 >= 300) {
h = parseInt((300 - y * 0.3) * 3.33, 10);
}*/
text_y = y - 66; text_y = y - 66;
@ -4394,16 +4402,22 @@ function RenderAllCanvas() {
function RefreshCanvasObject(max_protected_objects) { function RefreshCanvasObject(max_protected_objects) {
if (typeof canvasTripwire !== 'undefined') { if (typeof canvasTripwire !== 'undefined') {
//Clear all objects //Clear all objects
// console.log(canvasTripwire.getObjects());
while (canvasTripwire.getObjects().length > 0) { while (canvasTripwire.getObjects().length > 0) {
var items = canvasTripwire.getObjects(); var items = canvasTripwire.getObjects();
if (items[canvasTripwire.getObjects().length - 1]) { if (items[canvasTripwire.getObjects().length - 1]) {
canvasTripwire.remove(items[canvasTripwire.getObjects().length - 1]); canvasTripwire.remove(items[canvasTripwire.getObjects().length - 1]);
} }
// canvasTripwire.remove(items[canvasTripwire.getObjects().length - 1]);
} }
// console.log(canvasTripwire.getObjects());
// console.log("--------------------------");
} }
if (typeof canvasTripwire1 !== 'undefined') { if (typeof canvasTripwire1 !== 'undefined') {
//Clear all objects //Clear all objects
// console.log(canvasTripwire1.getObjects());
while (canvasTripwire1.getObjects().length > max_protected_objects) { while (canvasTripwire1.getObjects().length > max_protected_objects) {
var items = canvasTripwire1.getObjects(); var items = canvasTripwire1.getObjects();
if (items[canvasTripwire1.getObjects().length - 1]) { if (items[canvasTripwire1.getObjects().length - 1]) {
@ -4411,10 +4425,14 @@ function RefreshCanvasObject(max_protected_objects) {
} }
} }
canvasTripwire1.getObjects()[0].stroke = "#ffff00"; canvasTripwire1.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire1.getObjects());
// console.log("--------------------------");
} }
if (typeof canvasTripwire2 !== 'undefined') { if (typeof canvasTripwire2 !== 'undefined') {
// console.log(canvasTripwire2.getObjects());
//Clear all objects //Clear all objects
while (canvasTripwire2.getObjects().length > max_protected_objects) { while (canvasTripwire2.getObjects().length > max_protected_objects) {
var items = canvasTripwire2.getObjects(); var items = canvasTripwire2.getObjects();
@ -4423,10 +4441,14 @@ function RefreshCanvasObject(max_protected_objects) {
} }
} }
canvasTripwire2.getObjects()[0].stroke = "#ffff00"; canvasTripwire2.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire2.getObjects());
// console.log("--------------------------");
} }
if (typeof canvasTripwire3 !== 'undefined') { if (typeof canvasTripwire3 !== 'undefined') {
// console.log(canvasTripwire3.getObjects());
//Clear all objects //Clear all objects
while (canvasTripwire3.getObjects().length > max_protected_objects) { while (canvasTripwire3.getObjects().length > max_protected_objects) {
var items = canvasTripwire3.getObjects(); var items = canvasTripwire3.getObjects();
@ -4435,9 +4457,13 @@ function RefreshCanvasObject(max_protected_objects) {
} }
} }
canvasTripwire3.getObjects()[0].stroke = "#ffff00"; canvasTripwire3.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire3.getObjects());
// console.log("--------------------------");
} }
if (typeof canvasTripwire4 !== 'undefined') { if (typeof canvasTripwire4 !== 'undefined') {
// console.log(canvasTripwire4.getObjects());
//Clear all objects //Clear all objects
while (canvasTripwire4.getObjects().length > max_protected_objects) { while (canvasTripwire4.getObjects().length > max_protected_objects) {
var items = canvasTripwire4.getObjects(); var items = canvasTripwire4.getObjects();
@ -4446,9 +4472,13 @@ function RefreshCanvasObject(max_protected_objects) {
} }
} }
canvasTripwire4.getObjects()[0].stroke = "#ffff00"; canvasTripwire4.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire4.getObjects());
// console.log("--------------------------");
} }
if (typeof canvasTripwire5 !== 'undefined') { if (typeof canvasTripwire5 !== 'undefined') {
// console.log(canvasTripwire5.getObjects());
//Clear all objects //Clear all objects
while (canvasTripwire5.getObjects().length > max_protected_objects) { while (canvasTripwire5.getObjects().length > max_protected_objects) {
var items = canvasTripwire5.getObjects(); var items = canvasTripwire5.getObjects();
@ -4457,9 +4487,13 @@ function RefreshCanvasObject(max_protected_objects) {
} }
} }
canvasTripwire5.getObjects()[0].stroke = "#ffff00"; canvasTripwire5.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire5.getObjects());
// console.log("--------------------------");
} }
if (typeof canvasTripwire6 !== 'undefined') { if (typeof canvasTripwire6 !== 'undefined') {
// console.log(canvasTripwire6.getObjects());
//Clear all objects //Clear all objects
while (canvasTripwire6.getObjects().length > max_protected_objects) { while (canvasTripwire6.getObjects().length > max_protected_objects) {
var items = canvasTripwire6.getObjects(); var items = canvasTripwire6.getObjects();
@ -4468,9 +4502,13 @@ function RefreshCanvasObject(max_protected_objects) {
} }
} }
canvasTripwire6.getObjects()[0].stroke = "#ffff00"; canvasTripwire6.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire6.getObjects());
// console.log("--------------------------");
} }
if (typeof canvasTripwire7 !== 'undefined') { if (typeof canvasTripwire7 !== 'undefined') {
// console.log(canvasTripwire7.getObjects());
//Clear all objects //Clear all objects
while (canvasTripwire7.getObjects().length > max_protected_objects) { while (canvasTripwire7.getObjects().length > max_protected_objects) {
var items = canvasTripwire7.getObjects(); var items = canvasTripwire7.getObjects();
@ -4479,9 +4517,12 @@ function RefreshCanvasObject(max_protected_objects) {
} }
} }
canvasTripwire7.getObjects()[0].stroke = "#ffff00"; canvasTripwire7.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire7.getObjects());
// console.log("--------------------------");
} }
if (typeof canvasTripwire8 !== 'undefined') { if (typeof canvasTripwire8 !== 'undefined') {
// console.log(canvasTripwire8.getObjects());
//Clear all objects //Clear all objects
while (canvasTripwire8.getObjects().length > max_protected_objects) { while (canvasTripwire8.getObjects().length > max_protected_objects) {
var items = canvasTripwire8.getObjects(); var items = canvasTripwire8.getObjects();
@ -4490,20 +4531,27 @@ function RefreshCanvasObject(max_protected_objects) {
} }
} }
canvasTripwire8.getObjects()[0].stroke = "#ffff00"; canvasTripwire8.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire8.getObjects());
// console.log("--------------------------");
} }
if (typeof canvasTripwire_all !== 'undefined') { if (typeof canvasTripwire_all !== 'undefined') {
// console.log("click_canvas_all:", click_canvas_all);
// console.log(canvasTripwire_all.getObjects());
//Clear all objects //Clear all objects
while (canvasTripwire_all.getObjects().length > click_canvas_all) { while (canvasTripwire_all.getObjects().length > click_canvas_all) {
var items = canvasTripwire_all.getObjects(); var items = canvasTripwire_all.getObjects();
if (items[canvasTripwire_all.getObjects().length - 1]) { if (items[canvasTripwire_all.getObjects().length - 1]) {
canvasTripwire_all.remove(items[canvasTripwire_all.getObjects().length - 1]); canvasTripwire_all.remove(items[canvasTripwire_all.getObjects().length - 1]);
} }
// canvasTripwire_all.remove(items[canvasTripwire_all.getObjects().length - 1]);
} }
for (var index_click = 0; index_click < click_canvas_all; index_click++) { for (var index_click = 0; index_click < click_canvas_all; index_click++) {
canvasTripwire_all.getObjects()[index_click].stroke = "#ffff00"; canvasTripwire_all.getObjects()[index_click].stroke = "#ffff00";
} }
// console.log(canvasTripwire_all.getObjects());
// console.log("--------------------------");
} }
} }
@ -4582,6 +4630,7 @@ function GetRequest_WebSocket() {
//console.log("WebSocket is supported by your Browser!"); //console.log("WebSocket is supported by your Browser!");
//console.log(navigator.userAgent); //console.log(navigator.userAgent);
// Let us open a web socket // Let us open a web socket
if ( navigator.userAgent.indexOf( "nvr_auth=" ) != -1 ) if ( navigator.userAgent.indexOf( "nvr_auth=" ) != -1 )
ws = new WebSocket("ws://" + window.location.hostname + ":" + GetUrlPort() + "/getalarmmotion?" + navigator.userAgent ); ws = new WebSocket("ws://" + window.location.hostname + ":" + GetUrlPort() + "/getalarmmotion?" + navigator.userAgent );
else else
@ -4666,6 +4715,7 @@ function GetRequest_WebSocket() {
//console.log("WebSocket NOT supported by your Browser!"); //console.log("WebSocket NOT supported by your Browser!");
} }
} }
/* /*
function reConnect() { function reConnect() {
//console.log("socket 連線斷開,正在嘗試重新建立連線"); //console.log("socket 連線斷開,正在嘗試重新建立連線");
@ -4720,6 +4770,8 @@ function GetRequest_Http() {
} }
function func_set_coldobjects(object_x, object_y, object_w, object_h, object_name) { function func_set_coldobjects(object_x, object_y, object_w, object_h, object_name) {
//console.log(`[func_set_coldobjects] obj x:${object_x} , y:${object_y} , w:${object_w} , h:${object_h} , name:${object_name}`);
$.ajax({ $.ajax({
url: "/setconfig?coldobjects&x=" + object_x + "&y=" + object_y + "&w=" + object_w + "&h=" + object_h + "&Object=" + object_name, url: "/setconfig?coldobjects&x=" + object_x + "&y=" + object_y + "&w=" + object_w + "&h=" + object_h + "&Object=" + object_name,
method: "GET", method: "GET",
@ -4834,7 +4886,6 @@ function func_translate_name(translate_name) {
var label_names_zh_tw = data_zh_tw[key]; var label_names_zh_tw = data_zh_tw[key];
var label_names_ja_jp = data_ja_jp[key]; var label_names_ja_jp = data_ja_jp[key];
var label_names_it_it = data_it_it[key]; var label_names_it_it = data_it_it[key];
if (localStorage.getItem("events_default_version") != null && localStorage.getItem("events_default_version") == "4") { if (localStorage.getItem("events_default_version") != null && localStorage.getItem("events_default_version") == "4") {
if (translate_name == "person") { if (translate_name == "person") {
if (G_LANG == "zh_tw") if (G_LANG == "zh_tw")
@ -4873,7 +4924,6 @@ function func_translate_name(translate_name) {
else if (G_LANG == "it_it") else if (G_LANG == "it_it")
translate_name = label_names_it_it; translate_name = label_names_it_it;
} }
break; break;
} }
} }
@ -5321,3 +5371,119 @@ function func_changeColorBarMinMax(tofInfo) {
} }
} }
// 11-01
var defaultPolygonColor = "#ffff00"; // 預設色號 亮黃色的 Zone
var alarmColor = "#ff0000"; // 觸發 禁區、違停、警戒線 事件時,顯示紅色的 Zone ( Polygon )
var defaultZoneAlarmStatus = {'behavior_id': 0, 'red_zone': 0, 'time_stamp': 0};
var g_zoneAlarmStatus = func_initZoneAlarmStatus(defaultZoneAlarmStatus);
var g_zoneAlarmColorDisplayTime = 2; // Unit : second
function func_checkZoneColor()
{
// console.log("g_zoneAlarmStatus: ", g_zoneAlarmStatus);
var currentTimeDiff = null;
var zoneColor = defaultPolygonColor;
for (var zoneIndex = 0; zoneIndex < MAX_DETECTION_ZONE; zoneIndex++)
{
zoneColor = defaultPolygonColor;
if (g_zoneAlarmStatus[zoneIndex]['time_stamp'] > 0)
{
currentTimeDiff = new Date().getTime() - g_zoneAlarmStatus[zoneIndex]['time_stamp'];
if (currentTimeDiff > (g_zoneAlarmColorDisplayTime * 1000))
{
// console.log(`[func_checkZoneColor] reset g_zoneAlarmStatus[${zoneIndex}]`);
g_zoneAlarmStatus[zoneIndex]['behavior_id'] = 0;
g_zoneAlarmStatus[zoneIndex]['red_zone'] = 0;
g_zoneAlarmStatus[zoneIndex]['time_stamp'] = 0;
} // else 的 zone 仍在顯示時間內,仰賴 red_zone 賦予警報顏色
if (g_zoneAlarmStatus[zoneIndex]['red_zone'] == 1)
{
zoneColor = alarmColor;
} // else 的 zone 應是剛被 reset 狀態值的,以預設顏色顯示
} // else 是 時間戳被歸零的 以預設顏色顯示
// console.log(`[func_checkZoneColor] check zone ${(zoneIndex+1)} color:${zoneColor}`);
// check all zone
// console.log("check show_all_zone: ", show_all_zone);
if (show_all_zone == 0)
{
// check which canvas is active
try
{
window["canvasTripwire"+(zoneIndex+1)].getObjects()[0].stroke = zoneColor;
}
catch (error)
{
console.log(error);
}
}
else
{
if (zoneIndex < count_zone) {
// console.log(`[func_checkZoneColor] activeZoneIndex: ${zoneIndex}`);
canvasTripwire_all.getObjects()[zoneIndex].stroke = zoneColor;
}
}
}
}
function func_checkTriggerZoneStatus(behavior_id)
{
// console.log("checked_trigger_events:");
// console.log(checked_trigger_events);
//var trigger_index = null;
/*if (behavior_id == 1) // 禁區
{
trigger_index = 0;
}
else if (behavior_id == 4) // 違停
{
trigger_index = 1;
}
else if (behavior_id == 8) // 警戒線
{
trigger_index = 4;
}*/
for (var zoneIndex = 0; zoneIndex < MAX_DETECTION_ZONE; zoneIndex++) {
for (var trigger_index = 0; trigger_index < MAX_SIZE_IDC_LIST_TRIGGER_EVENTS; trigger_index++) {
if (checked_trigger_events[zoneIndex][trigger_index] == 1) {
if (g_zoneAlarmStatus[zoneIndex]['time_stamp'] == 0) {
g_zoneAlarmStatus[zoneIndex]['behavior_id'] = behavior_id;
g_zoneAlarmStatus[zoneIndex]['time_stamp'] = new Date().getTime();
// console.log(`[func_checkTriggerZoneStatus] init g_zoneAlarmStatus[${zoneIndex}]['time_stamp']:${g_zoneAlarmStatus[zoneIndex]['time_stamp']}`);
g_zoneAlarmStatus[zoneIndex]['red_zone'] = 1;
}
break;
}
}
}
// console.log("[func_checkTriggerZoneStatus] check g_zoneAlarmStatus:");
// console.log(g_zoneAlarmStatus);
}
function func_initZoneAlarmStatus(defaultValue)
{
var array = [];
for (var i = 0; i < MAX_DETECTION_ZONE; i++)
{
// 確保每個元素都是一個新的副本,避免不同 Zone 紀載不同行為時互相干擾狀態值
array.push(JSON.parse(JSON.stringify(defaultValue)));
}
return array;
}

46
Aida/alarm_on_airelay.html

@ -5,7 +5,7 @@
<meta http-equiv="cache-control" <meta http-equiv="cache-control"
content="max-age=0" /> content="max-age=0" />
<meta http-equiv="cache-control" <meta http-equiv="cache-control"
content="no-store, no-store, must-revalidate" /> content="no-store, must-revalidate" />
<meta http-equiv="expires" <meta http-equiv="expires"
content="-1" /> content="-1" />
<meta http-equiv="expires" <meta http-equiv="expires"
@ -23,6 +23,7 @@
<style> <style>
body, html { body, html {
font-family: "Arial"; font-family: "Arial";
} }
@ -384,8 +385,8 @@
var g_times_get_bar = 0; var g_times_get_bar = 0;
var g_check_if_run_setting = 0; var g_check_if_run_setting = 0;
var DETECT_EVENT_ID_ARRAY = ["0x00000001", "0x00000004", "0x00200000", "0x00400000", "0x00000008", "0x00000010", "0x00000020", "0x10000000", "0x20000000", "0x00800000", "0x01000000", "0x02000000", "0x04000000", "0x40000000", "0x80000000", "0x00002000", "0x00004000", "0x00000400", "0x00000800", "0x00001000", "0x00008000", "0x00040000", "0x08000000"];
var DETECT_EVENT_ID_ARRAY = ["0x00000001", "0x00000004", "0x00200000", "0x00400000", "0x00000008", "0x00000010", "0x00000020", "0x10000000", "0x20000000", "0x00800000", "0x01000000", "0x02000000", "0x04000000", "0x40000000", "0x80000000", "0x00002000", "0x00004000", "0x00000400", "0x00000800", "0x00001000", "0x00008000", "0x00040000", "0x08000000"];
function update_canvas() { function update_canvas() {
clearInterval(g_Canvas_BackgroundImage); clearInterval(g_Canvas_BackgroundImage);
@ -756,9 +757,9 @@
event_stream = create_canvas_stream1(); event_stream = create_canvas_stream1();
var checkH264StreamIntervalID = null; var checkH264StreamIntervalID = null;
var checkH264StreamIntervalTime = 200; var checkH264StreamIntervalTime = 10;
var checkStreamingCounter = 0; var checkStreamingCounter = 0;
var checkCounterThreshold = 12; var checkCounterThreshold = 15;
clearInterval(checkH264StreamIntervalID); clearInterval(checkH264StreamIntervalID);
checkH264StreamIntervalID = setInterval(function () { checkH264StreamIntervalID = setInterval(function () {
@ -774,7 +775,6 @@
if (checkStreamingCounter > checkCounterThreshold) { if (checkStreamingCounter > checkCounterThreshold) {
localStorage.setItem("receivedH264", check_h264_received); localStorage.setItem("receivedH264", check_h264_received);
clearInterval(checkH264StreamIntervalID); clearInterval(checkH264StreamIntervalID);
// 08-15 TODO 嘗試確認 getalarmmotion fetch 連線是否中斷
} }
}, checkH264StreamIntervalTime) }, checkH264StreamIntervalTime)
@ -1047,16 +1047,13 @@
<input class="easyui-slider" style="width:100%;" id="parking_space" /> <input class="easyui-slider" style="width:100%;" id="parking_space" />
</div> </div>
</div> </div>
</div> </div>
<div align="center"> <div align="center">
<input align="center" id="IDOK" type="button" value="Set" onclick="func_setAlarmData()" class="Content_stybtn_ln" /> <input align="center" id="IDOK" type="button" value="Set" onclick="func_setAlarmData()" class="Content_stybtn_ln" />
</div> </div>
</div> </div>
<div id="title_counter" class="titlebox"><nobr id="TITLEBOX_PAGE09"></nobr></div> <div id="title_counter" class="titlebox"><nobr id="TITLEBOX_PAGE09"></nobr></div>
<div id="border_counter" style="border:1px gray solid; padding:10px; margin:15px 0px 4px 0px;"> <div id="border_counter" style="border:1px gray solid; padding:10px; margin:15px 0px 4px 0px;">
<!-- <br> --> <!-- <br> -->
@ -1175,7 +1172,6 @@
</div> </div>
</div> </div>
<div align="center"> <div align="center">
<input align="center" id="IDOK_counter" type="button" value="Set" onclick="func_setCounterData()" class="Content_stybtn_ln" style="display:inline-block"/> <input align="center" id="IDOK_counter" type="button" value="Set" onclick="func_setCounterData()" class="Content_stybtn_ln" style="display:inline-block"/>
@ -2157,8 +2153,7 @@
// 08-24 確認是否有設定警戒線的 Zone,額外再加上紅線物件 // 08-24 確認是否有設定警戒線的 Zone,額外再加上紅線物件
var arrow_num = 0; var arrow_num = 0;
for (var index_zone = 0; index_zone < count_zone; index_zone++) for (var index_zone = 0; index_zone < count_zone; index_zone++) {
{
// console.log(`[func_show_all_zone] check current_trigger[${index_zone}]: ${current_trigger[index_zone]}`); // console.log(`[func_show_all_zone] check current_trigger[${index_zone}]: ${current_trigger[index_zone]}`);
// 比照 func_listen_to_enable_or_disable_show_direction 開啟紅線物件可見性的條件 // 比照 func_listen_to_enable_or_disable_show_direction 開啟紅線物件可見性的條件
@ -2194,14 +2189,14 @@
// ------------------------------------------------------ // ------------------------------------------------------
// 參照 Edit_Arrow // 參照 Edit_Arrow
points_array = GetPointLocation(index_zone); points_array = GetPointLocation(index_zone);
var index_point = g_mydirection[g_zone_id] - 1; var index_point = g_mydirection[g_zone_id] - 1;
var next_point = index_point + 1 >= 4 ? 0 : index_point + 1; var next_point = index_point + 1 >= 4 ? 0 : index_point + 1;
var start_x = points_array[next_point].x; var start_x = points_array[next_point].x;
var start_y = points_array[next_point].y; var start_y = points_array[next_point].y;
var end_x = points_array[index_point].x; var end_x = points_array[index_point].x;
var end_y = points_array[index_point].y; var end_y = points_array[index_point].y;
arrow_obj = AddArrowObject(start_x, start_y, end_x, end_y) arrow_obj = AddArrowObject(start_x, start_y, end_x, end_y)
arrow_obj.visible = true; arrow_obj.visible = true;
// ------------------------------------------------------ // ------------------------------------------------------
@ -2281,6 +2276,7 @@
} }
function func_listen_to_enable_or_disable_show_direction() { function func_listen_to_enable_or_disable_show_direction() {
if (current_trigger[get_current_index_zone()] == 4 || if (current_trigger[get_current_index_zone()] == 4 ||
current_trigger[get_current_index_zone()] == 17 || current_trigger[get_current_index_zone()] == 17 ||
current_trigger[get_current_index_zone()] == 18 || current_trigger[get_current_index_zone()] == 18 ||
@ -7155,7 +7151,7 @@
// console.log("set zone 2 config"); // console.log("set zone 2 config");
var json_data_zone_2 = '{"view_setting":{"camera01":{'; var json_data_zone_2 = '{"view_setting":{"camera01":{';
json_data_zone_2 += '"detection_zone":['; json_data_zone_2 += '"detection_zone":[';
json_data_zone_2 += '{},' // 補上index之前 空的 dict,確保次序對上既有格式 json_data_zone_2 += '{},'; // 補上index之前 空的 dict,確保次序對上既有格式
json_data_zone_2 += '{"queuing_count": "' + queuing_count[1]; json_data_zone_2 += '{"queuing_count": "' + queuing_count[1];
json_data_zone_2 += '","enable_ivs_zone": "' + enable_ivs_zone[1]; json_data_zone_2 += '","enable_ivs_zone": "' + enable_ivs_zone[1];
json_data_zone_2 += '","parking_line": "' + parking_line[1]; json_data_zone_2 += '","parking_line": "' + parking_line[1];
@ -7180,7 +7176,7 @@
// console.log("set zone 3 config"); // console.log("set zone 3 config");
var json_data_zone_3 = '{"view_setting":{"camera01":{'; var json_data_zone_3 = '{"view_setting":{"camera01":{';
json_data_zone_3 += '"detection_zone":['; json_data_zone_3 += '"detection_zone":[';
json_data_zone_3 += '{},{},' // 補上index之前 空的 dict,確保次序對上既有格式 json_data_zone_3 += '{},{},'; // 補上index之前 空的 dict,確保次序對上既有格式
json_data_zone_3 += '{"queuing_count": "' + queuing_count[2]; json_data_zone_3 += '{"queuing_count": "' + queuing_count[2];
json_data_zone_3 += '","enable_ivs_zone": "' + enable_ivs_zone[2]; json_data_zone_3 += '","enable_ivs_zone": "' + enable_ivs_zone[2];
json_data_zone_3 += '","parking_line": "' + parking_line[2]; json_data_zone_3 += '","parking_line": "' + parking_line[2];
@ -7201,12 +7197,11 @@
func_setconfigfile(json_data_zone_3); func_setconfigfile(json_data_zone_3);
} }
if (count_zone >= 4) { if (count_zone >= 4) {
// console.log("set zone 4 config"); // console.log("set zone 4 config");
var json_data_zone_4 = '{"view_setting":{"camera01":{'; var json_data_zone_4 = '{"view_setting":{"camera01":{';
json_data_zone_4 += '"detection_zone":['; json_data_zone_4 += '"detection_zone":[';
json_data_zone_4 += '{},{},{},' // 補上index之前 空的 dict,確保次序對上既有格式 json_data_zone_4 += '{},{},{},'; // 補上index之前 空的 dict,確保次序對上既有格式
json_data_zone_4 += '{"queuing_count": "' + queuing_count[3]; json_data_zone_4 += '{"queuing_count": "' + queuing_count[3];
json_data_zone_4 += '","enable_ivs_zone": "' + enable_ivs_zone[3]; json_data_zone_4 += '","enable_ivs_zone": "' + enable_ivs_zone[3];
json_data_zone_4 += '","parking_line": "' + parking_line[3]; json_data_zone_4 += '","parking_line": "' + parking_line[3];
@ -7231,7 +7226,7 @@
// console.log("set zone 5 config"); // console.log("set zone 5 config");
var json_data_zone_5 = '{"view_setting":{"camera01":{'; var json_data_zone_5 = '{"view_setting":{"camera01":{';
json_data_zone_5 += '"detection_zone":['; json_data_zone_5 += '"detection_zone":[';
json_data_zone_5 += '{},{},{},{},' // 補上index之前 空的 dict,確保次序對上既有格式 json_data_zone_5 += '{},{},{},{},'; // 補上index之前 空的 dict,確保次序對上既有格式
json_data_zone_5 += '{"queuing_count": "' + queuing_count[4]; json_data_zone_5 += '{"queuing_count": "' + queuing_count[4];
json_data_zone_5 += '","enable_ivs_zone": "' + enable_ivs_zone[4]; json_data_zone_5 += '","enable_ivs_zone": "' + enable_ivs_zone[4];
json_data_zone_5 += '","parking_line": "' + parking_line[4]; json_data_zone_5 += '","parking_line": "' + parking_line[4];
@ -7252,12 +7247,11 @@
func_setconfigfile(json_data_zone_5); func_setconfigfile(json_data_zone_5);
} }
if (count_zone >= 6) { if (count_zone >= 6) {
// console.log("set zone 6 config"); // console.log("set zone 6 config");
var json_data_zone_6 = '{"view_setting":{"camera01":{'; var json_data_zone_6 = '{"view_setting":{"camera01":{';
json_data_zone_6 += '"detection_zone":['; json_data_zone_6 += '"detection_zone":[';
json_data_zone_6 += '{},{},{},{},{},' // 補上index之前 空的 dict,確保次序對上既有格式 json_data_zone_6 += '{},{},{},{},{},'; // 補上index之前 空的 dict,確保次序對上既有格式
json_data_zone_6 += '{"queuing_count": "' + queuing_count[5]; json_data_zone_6 += '{"queuing_count": "' + queuing_count[5];
json_data_zone_6 += '","enable_ivs_zone": "' + enable_ivs_zone[5]; json_data_zone_6 += '","enable_ivs_zone": "' + enable_ivs_zone[5];
json_data_zone_6 += '","parking_line": "' + parking_line[5]; json_data_zone_6 += '","parking_line": "' + parking_line[5];
@ -7277,13 +7271,12 @@
// console.log("------------------------------------------------"); // console.log("------------------------------------------------");
func_setconfigfile(json_data_zone_6); func_setconfigfile(json_data_zone_6);
} }
if (count_zone >= 7) { if (count_zone >= 7) {
// console.log("set zone 7 config"); // console.log("set zone 7 config");
var json_data_zone_7 = '{"view_setting":{"camera01":{'; var json_data_zone_7 = '{"view_setting":{"camera01":{';
json_data_zone_7 += '"detection_zone":['; json_data_zone_7 += '"detection_zone":[';
json_data_zone_7 += '{},{},{},{},{},{},' // 補上index之前 空的 dict,確保次序對上既有格式 json_data_zone_7 += '{},{},{},{},{},{},'; // 補上index之前 空的 dict,確保次序對上既有格式
json_data_zone_7 += '{"queuing_count": "' + queuing_count[6]; json_data_zone_7 += '{"queuing_count": "' + queuing_count[6];
json_data_zone_7 += '","enable_ivs_zone": "' + enable_ivs_zone[6]; json_data_zone_7 += '","enable_ivs_zone": "' + enable_ivs_zone[6];
json_data_zone_7 += '","parking_line": "' + parking_line[6]; json_data_zone_7 += '","parking_line": "' + parking_line[6];
@ -7304,12 +7297,11 @@
func_setconfigfile(json_data_zone_7); func_setconfigfile(json_data_zone_7);
} }
if (count_zone >= 8) { if (count_zone >= 8) {
// console.log("set zone 8 config"); // console.log("set zone 8 config");
var json_data_zone_8 = '{"view_setting":{"camera01":{'; var json_data_zone_8 = '{"view_setting":{"camera01":{';
json_data_zone_8 += '"detection_zone":['; json_data_zone_8 += '"detection_zone":[';
json_data_zone_8 += '{},{},{},{},{},{},{},' // 補上index之前 空的 dict,確保次序對上既有格式 json_data_zone_8 += '{},{},{},{},{},{},{},'; // 補上index之前 空的 dict,確保次序對上既有格式
json_data_zone_8 += '{"queuing_count": "' + queuing_count[7]; json_data_zone_8 += '{"queuing_count": "' + queuing_count[7];
json_data_zone_8 += '","enable_ivs_zone": "' + enable_ivs_zone[7]; json_data_zone_8 += '","enable_ivs_zone": "' + enable_ivs_zone[7];
json_data_zone_8 += '","parking_line": "' + parking_line[7]; json_data_zone_8 += '","parking_line": "' + parking_line[7];
@ -7930,7 +7922,6 @@
} }
} }
var json_data_trigger = '{"view_setting":{"camera01":{"detection_zone":['; var json_data_trigger = '{"view_setting":{"camera01":{"detection_zone":[';
for (var i = 0; i < count_zone; i++) { for (var i = 0; i < count_zone; i++) {
if (i == count_zone - 1) { if (i == count_zone - 1) {
@ -8197,9 +8188,6 @@
} }
isMouseDown = false; isMouseDown = false;
if (typeof canvasTripwire_all !== 'undefined') { if (typeof canvasTripwire_all !== 'undefined') {
console.log("[onMouseUp] #metadata_mouse_coldobjects val:", $('#metadata_mouse_coldobjects').val()); console.log("[onMouseUp] #metadata_mouse_coldobjects val:", $('#metadata_mouse_coldobjects').val());

87
Aida/alarm_on_airelay.js

@ -704,7 +704,7 @@ function insertTrafficLightRectangle(r_left, r_top, r_width, r_height, r_direct,
if (r_name == "person") { if (r_name == "person") {
color_type = '#FF8C00'; color_type = '#FF8C00';
} }
else { else if(r_name == "car"){
color_type = '#800080'; color_type = '#800080';
} }
} }
@ -1616,7 +1616,6 @@ var red_light_zone6;
var red_light_zone7; var red_light_zone7;
var red_light_zone8; var red_light_zone8;
function createCanvasTrafficLight_alarm(mypoints1, mypoints2, mypoints3, mypoints4, mypoints5, mypoints6, mypoints7, mypoints8) { function createCanvasTrafficLight_alarm(mypoints1, mypoints2, mypoints3, mypoints4, mypoints5, mypoints6, mypoints7, mypoints8) {
currentPointPosition1 = mypoints1; currentPointPosition1 = mypoints1;
currentPointPosition2 = mypoints2; currentPointPosition2 = mypoints2;
@ -3970,6 +3969,7 @@ function GetAlarm(alarm_data) {
else { else {
label_word = color; label_word = color;
} }
//console.log(label_word);
if (plate_name == "tof_point") { if (plate_name == "tof_point") {
if ((ai_json.AiEngine[i].max_distance != 0 && ai_json.AiEngine[i].max_height != 0) || if ((ai_json.AiEngine[i].max_distance != 0 && ai_json.AiEngine[i].max_height != 0) ||
@ -4021,7 +4021,7 @@ function GetAlarm(alarm_data) {
// console.log("detection_zone_id: ", detection_zone_id); // undefined // console.log("detection_zone_id: ", detection_zone_id); // undefined
func_checkTriggerZoneStatus(behavior_id); // 為了連動 zone polygon 變顏色 func_checkTriggerZoneStatus(behavior_id); // 為了連動 zone polygon 變顏色
canvasTripwire_all.add(insertTrafficLightRectangle_Red(x * G_CANVAS_WIDTH_RATIO, y * G_CANVAS_HEIGHT_RATIO, w * G_CANVAS_WIDTH_RATIO, h * G_CANVAS_HEIGHT_RATIO, 1, 1, plate_name)); canvasTripwire_all.add(insertTrafficLightRectangle_Red(x * G_CANVAS_WIDTH_RATIO, y * G_CANVAS_HEIGHT_RATIO, w * G_CANVAS_WIDTH_RATIO, h * G_CANVAS_HEIGHT_RATIO, 1, 1, plate_name));
canvasTripwire.add(insertTrafficLightRectangle_Red(x * G_CANVAS_WIDTH_RATIO, y * G_CANVAS_HEIGHT_RATIO, w * G_CANVAS_WIDTH_RATIO, h * G_CANVAS_HEIGHT_RATIO, 1, 1, plate_name)); canvasTripwire.add(insertTrafficLightRectangle_Red(x * G_CANVAS_WIDTH_RATIO, y * G_CANVAS_HEIGHT_RATIO, w * G_CANVAS_WIDTH_RATIO, h * G_CANVAS_HEIGHT_RATIO, 1, 1, plate_name));
canvasTripwire1.add(insertTrafficLightRectangle_Red(x * G_CANVAS_WIDTH_RATIO, y * G_CANVAS_HEIGHT_RATIO, w * G_CANVAS_WIDTH_RATIO, h * G_CANVAS_HEIGHT_RATIO, 1, 1, plate_name)); canvasTripwire1.add(insertTrafficLightRectangle_Red(x * G_CANVAS_WIDTH_RATIO, y * G_CANVAS_HEIGHT_RATIO, w * G_CANVAS_WIDTH_RATIO, h * G_CANVAS_HEIGHT_RATIO, 1, 1, plate_name));
@ -4594,7 +4594,8 @@ function GetAlarm(alarm_data) {
} }
} }
} }
} }
RenderAllCanvas(); RenderAllCanvas();
ai_json = null; ai_json = null;
} }
@ -5967,44 +5968,6 @@ function func_changeColorBarMinMax(tofInfo) {
} }
// JVC version
// function create_canvas_stream(specifyProfileNo) {
// console.log("[create_canvas_stream] init H264 streaming");
// //var g_profileno = GetCookie('profileno');
// var ui_width = G_VIEW_CANVAS_X;
// var ui_height = G_VIEW_CANVAS_Y;
// var l_cgi = "/websocket?";
// var l_token = "";
// //var event_uri = l_cgi + 'eventstream=' + g_profileno + l_token;
// var event_uri = l_cgi + 'eventstream=0' + l_token;
// var g_event_para = new _codec_para();
// g_event_para.worker_num = 1;
// //g_event_para.vc[0] = { width: g_setup_PROFILE_Width[g_profileno], height: g_setup_PROFILE_Height[g_profileno], id: "video_container", frameszie: 4096000 };
// g_event_para.vc[0] = { width: '1920', height: '1080', id: "CanvasBgContainer", frameszie: 4096000 };
// g_event_para.droplatencydecoded = true;
// g_event_stream = new _codec(g_event_para);
// g_event_stream.streamType = WS_WR;
// var node = document.getElementById(g_event_para.vc[0].id);
// node.appendChild(g_event_stream.get_vc_element(0));
// g_event_stream.set_vc_element_size(0, ui_width, ui_height); //display size
// g_event_stream.init_event(0, 0, event_uri);
// g_event_stream.DecodeInit('1', 5, '1920', '1080', '10', '8000', 16000);
// console.log('[create_canvas_stream] start H264 streaming');
// }
var g_event_stream = null; var g_event_stream = null;
@ -6093,27 +6056,34 @@ function openIVSsettins() {
var k_count = -1; var k_count = -1;
function func_setconfigfile(json_data) { function func_setconfigfile(json_data) {
waitSeconds(100);
$.ajax({ $.ajax({
url: '/' + g_tcp_tunnel_token + "/setconfigfile", url: '/' + g_tcp_tunnel_token + "/setconfigfile",
method: "POST", method: "POST",
async: false, async: false,
data: json_data, data: json_data,
contentType: false, //contentType: false,
processData: false, processData: false,
timeout: 5000,
cache: false,
xhrFields: {
withCredentials: true // 設置為 true 如果需要帶上 Cookies 或其他認證
},
contentType: 'text/plain', // 傳送純文本
beforeSend: function (xmlHttp) { beforeSend: function (xmlHttp) {
xmlHttp.setRequestHeader("If-Modified-Since", "0"); xmlHttp.setRequestHeader("If-Modified-Since", "0");
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); xmlHttp.setRequestHeader("Cache-Control", "no-cache");
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); //xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
}, },
success: function () { success: function (retdata) {
//console.info(); //console.info();
}, },
error: function () { error: function (retdata) {
console.warn(); console.warn(retdata);
k_count++; k_count++;
if (k_count <= 94) { if (k_count <= 94) {
waitSeconds(500); waitSeconds(1000);
func_setconfigfile(json_data); func_setconfigfile(json_data);
} }
} }
@ -6193,9 +6163,9 @@ function func_checkTriggerZoneStatus(behavior_id)
// console.log("checked_trigger_events:"); // console.log("checked_trigger_events:");
// console.log(checked_trigger_events); // console.log(checked_trigger_events);
var trigger_index = null; //var trigger_index = null;
if (behavior_id == 1) // 禁區 /*if (behavior_id == 1) // 禁區
{ {
trigger_index = 0; trigger_index = 0;
} }
@ -6206,23 +6176,24 @@ function func_checkTriggerZoneStatus(behavior_id)
else if (behavior_id == 8) // 警戒線 else if (behavior_id == 8) // 警戒線
{ {
trigger_index = 4; trigger_index = 4;
} }*/
for (var zoneIndex = 0; zoneIndex < MAX_DETECTION_ZONE; zoneIndex++) { for (var zoneIndex = 0; zoneIndex < MAX_DETECTION_ZONE; zoneIndex++) {
if (checked_trigger_events[zoneIndex][trigger_index] == 1) for (var trigger_index = 0; trigger_index < MAX_SIZE_IDC_LIST_TRIGGER_EVENTS; trigger_index++) {
{ if (checked_trigger_events[zoneIndex][trigger_index] == 1) {
if (g_zoneAlarmStatus[zoneIndex]['time_stamp'] == 0) { if (g_zoneAlarmStatus[zoneIndex]['time_stamp'] == 0) {
g_zoneAlarmStatus[zoneIndex]['behavior_id'] = behavior_id; g_zoneAlarmStatus[zoneIndex]['behavior_id'] = behavior_id;
g_zoneAlarmStatus[zoneIndex]['time_stamp'] = new Date().getTime(); g_zoneAlarmStatus[zoneIndex]['time_stamp'] = new Date().getTime();
// console.log(`[func_checkTriggerZoneStatus] init g_zoneAlarmStatus[${zoneIndex}]['time_stamp']:${g_zoneAlarmStatus[zoneIndex]['time_stamp']}`); // console.log(`[func_checkTriggerZoneStatus] init g_zoneAlarmStatus[${zoneIndex}]['time_stamp']:${g_zoneAlarmStatus[zoneIndex]['time_stamp']}`);
g_zoneAlarmStatus[zoneIndex]['red_zone'] = 1; g_zoneAlarmStatus[zoneIndex]['red_zone'] = 1;
}
break;
} }
} }
} }
// console.log("[func_checkTriggerZoneStatus] check g_zoneAlarmStatus:"); // console.log("[func_checkTriggerZoneStatus] check g_zoneAlarmStatus:");
// console.log(g_zoneAlarmStatus); // console.log(g_zoneAlarmStatus);
} }
function func_initZoneAlarmStatus(defaultValue) function func_initZoneAlarmStatus(defaultValue)

117
Aida/alarm_on_nvr.html

@ -278,8 +278,8 @@
var g_times_get_bar = 0; var g_times_get_bar = 0;
var g_check_if_run_setting = 0; var g_check_if_run_setting = 0;
var DETECT_EVENT_ID_ARRAY = ["0x00000001", "0x00000004", "0x00200000", "0x00400000", "0x00000008", "0x00000010", "0x00000020", "0x10000000", "0x20000000", "0x00800000", "0x01000000", "0x02000000", "0x04000000", "0x40000000", "0x80000000", "0x00002000", "0x00004000", "0x00000400", "0x00000800", "0x00001000", "0x00008000", "0x00040000", "0x08000000"];
var DETECT_EVENT_ID_ARRAY = ["0x00000001", "0x00000004", "0x00200000", "0x00400000", "0x00000008", "0x00000010", "0x00000020", "0x10000000", "0x20000000", "0x00800000", "0x01000000", "0x02000000", "0x04000000", "0x40000000", "0x80000000", "0x00002000", "0x00004000", "0x00000400", "0x00000800", "0x00001000", "0x00008000", "0x00040000", "0x08000000"];
function update_canvas() { function update_canvas() {
clearInterval(g_Canvas_BackgroundImage); clearInterval(g_Canvas_BackgroundImage);
@ -1390,7 +1390,7 @@
// reversed:true, // reversed:true,
// disabled:true, // disabled:true,
min: 0, min: 0,
max: 100, max: 30,
// step:2.5, // step:2.5,
//提示格式函数 //提示格式函数
tipFormatter: function (value) { tipFormatter: function (value) {
@ -1967,7 +1967,64 @@
} }
} }
} }
click_canvas_all = count_zone;
// 08-24 確認是否有設定警戒線的 Zone,額外再加上紅線物件
var arrow_num = 0;
for (var index_zone = 0; index_zone < count_zone; index_zone++) {
// console.log(`[func_show_all_zone] check current_trigger[${index_zone}]: ${current_trigger[index_zone]}`);
// 比照 func_listen_to_enable_or_disable_show_direction 開啟紅線物件可見性的條件
if (
current_trigger[index_zone] == 4
|| current_trigger[index_zone] == 17
|| current_trigger[index_zone] == 18
|| current_trigger[index_zone] == 19
) {
arrow_num++;
var arrow_obj = null;
// ------------------------------------------------------
// 比照 clone 寫法位置會有問題,改仿照 Edit_Arrow 內部流程新增紅線物件
// if (index_zone == 0)
// {
// arrow_obj = fabric.util.object.clone(canvasTripwire1.getObjects()[1]);
// }
// else if (index_zone == 1)
// {
// arrow_obj = fabric.util.object.clone(canvasTripwire2.getObjects()[1]);
// }
// else if (index_zone == 2)
// {
// arrow_obj = fabric.util.object.clone(canvasTripwire3.getObjects()[1]);
// }
// else if (index_zone == 3)
// {
// arrow_obj = fabric.util.object.clone(canvasTripwire4.getObjects()[1]);
// }
// console.log("clone arrow_obj:");
// console.log(arrow_obj);
// ------------------------------------------------------
// 參照 Edit_Arrow
points_array = GetPointLocation(index_zone);
var index_point = g_mydirection[g_zone_id] - 1;
var next_point = index_point + 1 >= 4 ? 0 : index_point + 1;
var start_x = points_array[next_point].x;
var start_y = points_array[next_point].y;
var end_x = points_array[index_point].x;
var end_y = points_array[index_point].y;
arrow_obj = AddArrowObject(start_x, start_y, end_x, end_y)
arrow_obj.visible = true;
// ------------------------------------------------------
if (arrow_obj != null) {
canvasTripwire_all.add(arrow_obj);
}
}
}
// click_canvas_all = count_zone;
click_canvas_all = count_zone + arrow_num; // 確保多新增的紅線物件不會馬上被 RefreshCanvasObject 保護物件數量參數給清除掉
canvasTripwire_all.requestRenderAll(); canvasTripwire_all.requestRenderAll();
//document.getElementById('IDOK').disabled = true; //document.getElementById('IDOK').disabled = true;
@ -4283,7 +4340,7 @@
disabelIteraction(canvasTripwire7.getObjects()[0]); disabelIteraction(canvasTripwire7.getObjects()[0]);
Edit8(); Edit8();
} }
func_getbar(); func_getbar();
show_tof_map(); show_tof_map();
} }
@ -4410,6 +4467,7 @@
} }
} }
function func_setAlarmData() { function func_setAlarmData() {
if (lock_IDOK == 1) { if (lock_IDOK == 1) {
alert(IDC_STATIC_SHOW_ALL_ALERT); alert(IDC_STATIC_SHOW_ALL_ALERT);
@ -6773,8 +6831,11 @@
var json_data = '{"view_setting":{"camera01":{"obj_max_proportion": "' + obj_max_proportion; var json_data = '{"view_setting":{"camera01":{"obj_max_proportion": "' + obj_max_proportion;
json_data += '","obj_min_proportion": "' + obj_min_proportion + '","enable_traffic": "' + enable_traffic + '","enable_unknown_object": "' + enable_unknown_object + '","enable_track": "' + enable_track; json_data += '","obj_min_proportion": "' + obj_min_proportion + '","enable_traffic": "' + enable_traffic + '","enable_unknown_object": "' + enable_unknown_object + '","enable_track": "' + enable_track;
json_data += '","confidence2": "' + confidence_traffic + '","count_zone": ' + count_zone; json_data += '","confidence2": "' + confidence_traffic + '","count_zone": ' + count_zone;
json_data += ',"detection_zone":['; json_data += '}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{"enable_direction1": "' + enable_direction[0]; json_data += '{"enable_direction1": "' + enable_direction[0];
json_data += '","direction1": "' + func_get_direction(0).toString(); json_data += '","direction1": "' + func_get_direction(0).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[0]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[0];
@ -6801,8 +6862,12 @@
json_data += ',"y5": ' + Math.round(points_array_0[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_0[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_0[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_0[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_0[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_0[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},'
json_data += '{"enable_direction1": "' + enable_direction[1]; json_data += '{"enable_direction1": "' + enable_direction[1];
json_data += '","direction1": "' + func_get_direction(1).toString(); json_data += '","direction1": "' + func_get_direction(1).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[1]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[1];
@ -6829,8 +6894,12 @@
json_data += ',"y5": ' + Math.round(points_array_1[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_1[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_1[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_1[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_1[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_1[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},';
json_data += '{"enable_direction1": "' + enable_direction[2]; json_data += '{"enable_direction1": "' + enable_direction[2];
json_data += '","direction1": "' + func_get_direction(2).toString(); json_data += '","direction1": "' + func_get_direction(2).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[2]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[2];
@ -6857,8 +6926,12 @@
json_data += ',"y5": ' + Math.round(points_array_2[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_2[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_2[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_2[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_2[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_2[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},{},';
json_data += '{"enable_direction1": "' + enable_direction[3]; json_data += '{"enable_direction1": "' + enable_direction[3];
json_data += '","direction1": "' + func_get_direction(3).toString(); json_data += '","direction1": "' + func_get_direction(3).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[3]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[3];
@ -6885,8 +6958,12 @@
json_data += ',"y5": ' + Math.round(points_array_3[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_3[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_3[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_3[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_3[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_3[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},{},{},';
json_data += '{"enable_direction1": "' + enable_direction[4]; json_data += '{"enable_direction1": "' + enable_direction[4];
json_data += '","direction1": "' + func_get_direction(4).toString(); json_data += '","direction1": "' + func_get_direction(4).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[4]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[4];
@ -6913,8 +6990,12 @@
json_data += ',"y5": ' + Math.round(points_array_4[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_4[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_4[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_4[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_4[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_4[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},{},{},{},';
json_data += '{"enable_direction1": "' + enable_direction[5]; json_data += '{"enable_direction1": "' + enable_direction[5];
json_data += '","direction1": "' + func_get_direction(5).toString(); json_data += '","direction1": "' + func_get_direction(5).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[5]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[5];
@ -6941,8 +7022,12 @@
json_data += ',"y5": ' + Math.round(points_array_5[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_5[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_5[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_5[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_5[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_5[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},{},{},{},{},';
json_data += '{"enable_direction1": "' + enable_direction[6]; json_data += '{"enable_direction1": "' + enable_direction[6];
json_data += '","direction1": "' + func_get_direction(6).toString(); json_data += '","direction1": "' + func_get_direction(6).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[6]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[6];
@ -6969,8 +7054,12 @@
json_data += ',"y5": ' + Math.round(points_array_6[4].y * tab_view_size[1] / image_height); json_data += ',"y5": ' + Math.round(points_array_6[4].y * tab_view_size[1] / image_height);
json_data += ',"x6": ' + Math.round(points_array_6[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_6[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_6[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_6[5].y * tab_view_size[1] / image_height);
json_data += '},'; json_data += '}]}}}';
func_setconfigfile(json_data);
json_data = '{"view_setting":{"camera01":{';
json_data += '"detection_zone":[';
json_data += '{},{},{},{},{},{},{},';
json_data += '{"enable_direction1": "' + enable_direction[7]; json_data += '{"enable_direction1": "' + enable_direction[7];
json_data += '","direction1": "' + func_get_direction(7).toString(); json_data += '","direction1": "' + func_get_direction(7).toString();
json_data += '","enable_ivs_zone": "' + enable_ivs_zone[7]; json_data += '","enable_ivs_zone": "' + enable_ivs_zone[7];
@ -6998,8 +7087,6 @@
json_data += ',"x6": ' + Math.round(points_array_7[5].x * tab_view_size[0] / image_width); json_data += ',"x6": ' + Math.round(points_array_7[5].x * tab_view_size[0] / image_width);
json_data += ',"y6": ' + Math.round(points_array_7[5].y * tab_view_size[1] / image_height); json_data += ',"y6": ' + Math.round(points_array_7[5].y * tab_view_size[1] / image_height);
json_data += '}]}}}'; json_data += '}]}}}';
//console.log(json_data);
func_setconfigfile(json_data); func_setconfigfile(json_data);
var text_checked_trigger_events = new Array(MAX_DETECTION_ZONE); var text_checked_trigger_events = new Array(MAX_DETECTION_ZONE);
@ -7274,7 +7361,7 @@
//k_index = 95; //k_index = 95;
} }
else if (k_index == 100) { else if (k_index == 100) {
func_run_osd_server(); //func_run_osd_server();
$(".progress-bar").css("visibility", "hidden"); $(".progress-bar").css("visibility", "hidden");
//$(".progress-bar").css("width", "0%").text("0 %"); //$(".progress-bar").css("width", "0%").text("0 %");

435
Aida/codemirror.min.css vendored

File diff suppressed because one or more lines are too long

2
Aida/cool_counter.js

@ -70,7 +70,7 @@ function insertTrafficLightRectangle(r_left, r_top, r_width, r_height, r_direct,
if (r_name == "person") { if (r_name == "person") {
color_type = '#FF8C00'; color_type = '#FF8C00';
} }
else { else if (r_name == "car") {
color_type = '#800080'; color_type = '#800080';
} }
} }

2
Aida/heatmap.js

@ -230,7 +230,7 @@ function insertTrafficLightRectangle(r_left, r_top, r_width, r_height, r_direct,
if (r_name == "person") { if (r_name == "person") {
color_type = '#FF8C00'; color_type = '#FF8C00';
} }
else { else if (r_name == "car") {
color_type = '#800080'; color_type = '#800080';
} }
} }

BIN
Aida/images/blank.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 B

BIN
Aida/images/loading.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

2
Aida/index.html

@ -1437,7 +1437,7 @@
localStorage.setItem('current_state_hide_or_open_label', 0); localStorage.setItem('current_state_hide_or_open_label', 0);
} }
else { else {
localStorage.setItem('current_state_hide_or_open_label', 1); localStorage.setItem('current_state_hide_or_open_label', 0);
} }
} }

16
Aida/label_names.js

@ -200,8 +200,8 @@ var LABEL_NAMES = '{' +
'"LABEL_NAMES_161": "fishing",' + '"LABEL_NAMES_161": "fishing",' +
'"LABEL_NAMES_162": "carrier",' + '"LABEL_NAMES_162": "carrier",' +
'"LABEL_NAMES_163": "yacht",' + '"LABEL_NAMES_163": "yacht",' +
'"LABEL_NAMES_164": "bridge_crane_up",' + '"LABEL_NAMES_164": "_s",' + //bridge_crane_up
'"LABEL_NAMES_165": "bridge_crane_down"' + '"LABEL_NAMES_165": "_s"' + //bridge_crane_down
'}],' + '}],' +
'"AIFRONTBACK" : [{' + '"AIFRONTBACK" : [{' +
'"LABEL_NAMES_340": "dual_headlight",' + '"LABEL_NAMES_340": "dual_headlight",' +
@ -558,8 +558,8 @@ var LABEL_NAMES_zh_tw = '{' +
'"LABEL_NAMES_161": "釣魚",' + '"LABEL_NAMES_161": "釣魚",' +
'"LABEL_NAMES_162": "載體",' + '"LABEL_NAMES_162": "載體",' +
'"LABEL_NAMES_163": "遊艇",' + '"LABEL_NAMES_163": "遊艇",' +
'"LABEL_NAMES_164": "橋式起重機運作中",' + '"LABEL_NAMES_164": "_s",' +//橋式起重機運作中
'"LABEL_NAMES_165": "橋式起重機停機"' + '"LABEL_NAMES_165": "_s"' +//橋式起重機停機
'}],' + '}],' +
'"AIFRONTBACK" : [{' + '"AIFRONTBACK" : [{' +
'"LABEL_NAMES_340": "雙車燈",' + '"LABEL_NAMES_340": "雙車燈",' +
@ -916,8 +916,8 @@ var LABEL_NAMES_ja_jp = '{' +
'"LABEL_NAMES_161": "釣り",' + '"LABEL_NAMES_161": "釣り",' +
'"LABEL_NAMES_162": "キャリア",' + '"LABEL_NAMES_162": "キャリア",' +
'"LABEL_NAMES_163": "ヨット",' + '"LABEL_NAMES_163": "ヨット",' +
'"LABEL_NAMES_164": "ブリッジクレーンアップ",' + '"LABEL_NAMES_164": "_s",' +//ブリッジクレーンアップ
'"LABEL_NAMES_165": "ブリッジクレーンダウン"' + '"LABEL_NAMES_165": "_s"' +//ブリッジクレーンダウン
'}],' + '}],' +
'"AIFRONTBACK" : [{' + '"AIFRONTBACK" : [{' +
'"LABEL_NAMES_340": "ダブルヘッドライト",' + '"LABEL_NAMES_340": "ダブルヘッドライト",' +
@ -1274,8 +1274,8 @@ var LABEL_NAMES_it_it = '{' +
'"LABEL_NAMES_161": "pesca",' + '"LABEL_NAMES_161": "pesca",' +
'"LABEL_NAMES_162": "vettore",' + '"LABEL_NAMES_162": "vettore",' +
'"LABEL_NAMES_163": "yacht",' + '"LABEL_NAMES_163": "yacht",' +
'"LABEL_NAMES_164": "gru_a_ponte_su",' + '"LABEL_NAMES_164": "_s",' +//gru_a_ponte_su
'"LABEL_NAMES_165": "gru_a_ponte_giù"' + '"LABEL_NAMES_165": "_s"' +//gru_a_ponte_giù
'}],' + '}],' +
'"AIFRONTBACK" : [{' + '"AIFRONTBACK" : [{' +
'"LABEL_NAMES_340": "doppio_faro",' + '"LABEL_NAMES_340": "doppio_faro",' +

10
Aida/lang.js

@ -1041,8 +1041,8 @@ var LANGUAGE = '{'+
'"IDC_STATIC_FPS": "FPS",' + '"IDC_STATIC_FPS": "FPS",' +
'"IDC_STATIC_SETTING_PORT": "通信埠 / Port #",' + '"IDC_STATIC_SETTING_PORT": "通信埠 / Port #",' +
'"IDC_STATIC_ENABLE_SYSTEM_LOGS": "開啟紀錄",' + '"IDC_STATIC_ENABLE_SYSTEM_LOGS": "開啟紀錄",' +
'"IDC_STATIC_ENABLE_PYTHON": "開啟 python",' + '"IDC_STATIC_ENABLE_PYTHON": "開啟python",' +
'"IDC_STATIC_ENABLE_PYTHON_FILE": "啟動 python 檔案",' + '"IDC_STATIC_ENABLE_PYTHON_FILE": "Python狀態",' +
'"HTTP_TITLE01": "車牌辨識",'+ '"HTTP_TITLE01": "車牌辨識",'+
'"HTTP_TITLE02": "車牌辨識清單",'+ '"HTTP_TITLE02": "車牌辨識清單",'+
'"HTTP_TITLE03": "車牌轉換表",'+ '"HTTP_TITLE03": "車牌轉換表",'+
@ -1796,7 +1796,7 @@ var LANGUAGE = '{'+
'"IDC_STATIC_SETTING_PORT": "ポート / Port #",' + '"IDC_STATIC_SETTING_PORT": "ポート / Port #",' +
'"IDC_STATIC_ENABLE_SYSTEM_LOGS": "ログを有効にする",' + '"IDC_STATIC_ENABLE_SYSTEM_LOGS": "ログを有効にする",' +
'"IDC_STATIC_ENABLE_PYTHON": "Pythonを有効にする",' + '"IDC_STATIC_ENABLE_PYTHON": "Pythonを有効にする",' +
'"IDC_STATIC_ENABLE_PYTHON_FILE": "Python アーカイブを有効にする",'+ '"IDC_STATIC_ENABLE_PYTHON_FILE": "Python",'+
'"HTTP_TITLE01": "ナンバープレート",'+ '"HTTP_TITLE01": "ナンバープレート",'+
'"HTTP_TITLE02": "LPR リスト",'+ '"HTTP_TITLE02": "LPR リスト",'+
'"HTTP_TITLE03": "リンクデータベース",'+ '"HTTP_TITLE03": "リンクデータベース",'+
@ -2536,8 +2536,8 @@ var LANGUAGE = '{'+
'"IDC_STATIC_FPS": "FPS",' + '"IDC_STATIC_FPS": "FPS",' +
'"IDC_STATIC_SETTING_PORT": "Porta #",' + '"IDC_STATIC_SETTING_PORT": "Porta #",' +
'"IDC_STATIC_ENABLE_SYSTEM_LOGS": "Abilita i log",' + '"IDC_STATIC_ENABLE_SYSTEM_LOGS": "Abilita i log",' +
'"IDC_STATIC_ENABLE_PYTHON": "Abilita Python",' + '"IDC_STATIC_ENABLE_PYTHON": "Abilita python",' +
'"IDC_STATIC_ENABLE_PYTHON_FILE": "Abilita gli archivi Python",' + '"IDC_STATIC_ENABLE_PYTHON_FILE": "Stato",' +
'"HTTP_TITLE01": "LPR",'+ '"HTTP_TITLE01": "LPR",'+
'"HTTP_TITLE02": "LPR LISTA",'+ '"HTTP_TITLE02": "LPR LISTA",'+
'"HTTP_TITLE03": "MAPPING",'+ '"HTTP_TITLE03": "MAPPING",'+

BIN
Aida/lilin.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

2
Aida/menu_on_nvr.html

@ -58,7 +58,7 @@
localStorage.setItem('current_state_hide_or_open_label', 0); localStorage.setItem('current_state_hide_or_open_label', 0);
} }
else { else {
localStorage.setItem('current_state_hide_or_open_label', 1); localStorage.setItem('current_state_hide_or_open_label', 0);
} }
} }

2
Aida/ptz.js

@ -135,7 +135,7 @@ function insertTrafficLightRectangle(r_left, r_top, r_width, r_height, r_direct,
if (r_name == "person") { if (r_name == "person") {
color_type = '#FF8C00'; color_type = '#FF8C00';
} }
else { else if (r_name == "car") {
color_type = '#800080'; color_type = '#800080';
} }
} }

74
Aida/python.html

@ -1,6 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-store" /> <meta http-equiv="cache-control" content="no-store" />
@ -9,9 +8,6 @@
<meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="pragma" content="no-cache" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="utf-8" /> <meta charset="utf-8" />
<script src="lang.js"></script> <script src="lang.js"></script>
<script src="config.js"></script> <script src="config.js"></script>
<script src="cookie.min.js"></script> <script src="cookie.min.js"></script>
@ -19,22 +15,20 @@
<script src="sweetalert2.min.js"></script> <script src="sweetalert2.min.js"></script>
<script src="jquery_3_2_1.min.js"></script> <script src="jquery_3_2_1.min.js"></script>
<script src="fabric_jquery.easyui.min_compressed_on_nvr.js"></script> <script src="fabric_jquery.easyui.min_compressed_on_nvr.js"></script>
<script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.easyui.min.js"></script> <script type="text/javascript" src="jquery.easyui.min.js"></script>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="easyui.css"> <link rel="stylesheet" type="text/css" href="easyui.css">
<link rel="stylesheet" href="css/sweetalert2.min.css"> <link rel="stylesheet" href="css/sweetalert2.min.css">
<link rel="stylesheet" href="codemirror.min.css"> <link rel="stylesheet" href="codemirror.min.css">
<script src="codemirror.min.js"></script> <script src="codemirror.min.js"></script>
<script src="python.min.js"></script> <script src="python.min.js"></script>
<script> <script>
window.onerror = function (message, url, linenumber) { window.onerror = function (message, url, linenumber) {
console.log('JavaScript error: ' + message + ' on line ' + linenumber + ' for ' + url); console.log('JavaScript error: ' + message + ' on line ' + linenumber + ' for ' + url);
if (url.search("fabric_jquery.easyui.min_compressed_on_nvr.js") >= 1) { if (url.search("fabric_jquery.easyui.min_compressed_on_nvr.js") >= 1) {
loadScript("fabric_jquery.easyui.min_compressed_on_nvr.js", function () { loadScript("fabric_jquery.easyui.min_compressed_on_nvr.js", function () {
}); });
@ -43,7 +37,6 @@
loadScript("jquery_3_2_1.min.js", function () { loadScript("jquery_3_2_1.min.js", function () {
}); });
} }
else if (url.search("config.js") >= 1) { else if (url.search("config.js") >= 1) {
loadScript("config.js", function () { loadScript("config.js", function () {
}); });
@ -72,24 +65,31 @@
loadScript("cookie.min.js", function () { loadScript("cookie.min.js", function () {
}); });
} }
else if (url.search("codemirror.min.js") >= 1) {
loadScript("codemirror.min.js", function () {
});
}
else if (url.search("python.min.js") >= 1) {
loadScript("python.min.js", function () {
});
}
else { else {
// # If an unknown error occurs, the page is reorganized // # If an unknown error occurs, the page is reorganized
// var replaceUrl = 'http://' + window.location.hostname + ':' + GetUrlPort() + '/Aida/python.html'; // var replaceUrl = 'http://' + window.location.hostname + ':' + GetUrlPort() + '/Aida/python.html';
// window.location.replace(replaceUrl); // window.location.replace(replaceUrl);
} }
} }
function GetUrlPort() { function GetUrlPort() {
var url_href = window.location.href; var url_href = window.location.href;
console.log("url_href",url_href); console.log("url_href",url_href);
var arr_url = url_href.split(":")[2].split("/")[0]; var arr_url = url_href.split(":")[2].split("/")[0];
return arr_url; return arr_url;
} }
if (window.history.replaceState) { if (window.history.replaceState) {
window.history.replaceState(null, null, window.location.href); window.history.replaceState(null, null, window.location.href);
} }
</script> </script>
<style> <style>
* { * {
box-sizing: border-box; box-sizing: border-box;
@ -115,7 +115,6 @@
max-height: 80vh; max-height: 80vh;
} }
} }
@media (max-height: 400px) { @media (max-height: 400px) {
#sidebar { #sidebar {
max-height: 70vh; max-height: 70vh;
@ -164,7 +163,6 @@
margin-top: 10px; margin-top: 10px;
line-height: normal; line-height: normal;
} }
.container { .container {
display: flex; display: flex;
height: 100vh; height: 100vh;
@ -179,15 +177,12 @@
</style> </style>
</head> </head>
<body> <body>
<div class="progress" style="background-color:white"> <div class="progress" style="background-color:white">
<div class="progress-bar progress-bar-striped" style="min-width: 20px;visibility:hidden;"></div> <div class="progress-bar progress-bar-striped" style="min-width: 20px;visibility:hidden;"></div>
</div> </div>
<div style="border:1px gray solid;padding:5px;margin:5px 5px 5px 5px;height: 560px;"> <div style="border:1px gray solid;padding:5px;margin:5px 5px 5px 5px;height: 560px;">
<div id="container" style="height: 100vh; display: flex;"> <div id="container" style="height: 100vh; display: flex;">
<div id="sidebar" style="background-color: #f9f9f9;"> <div id="sidebar" style="background-color: #f9f9f9;">
<div style="padding: 10px;"> <div style="padding: 10px;">
@ -220,7 +215,6 @@
<img src="./images/deletefile.png" alt="delete" onclick="" <img src="./images/deletefile.png" alt="delete" onclick=""
style="height: 26px; width: 26px; vertical-align: middle; margin-right: 5px;"> style="height: 26px; width: 26px; vertical-align: middle; margin-right: 5px;">
</button> </button>
</div> </div>
<table id="file-data-grid" style="height: 460px;"> <table id="file-data-grid" style="height: 460px;">
</table> </table>
@ -254,11 +248,9 @@
style="height: 26px; width: 26px; vertical-align: middle; margin-right: 5px;"> style="height: 26px; width: 26px; vertical-align: middle; margin-right: 5px;">
</button> </button>
</div> </div>
<div class="editor-container"> <div class="editor-container">
<label for="code-textarea">Program</label> <label for="code-textarea">Program</label>
</div> </div>
<div id="code-editor" style="overflow: auto;"> <div id="code-editor" style="overflow: auto;">
<textarea id="code-textarea" tabindex="0"></textarea> <textarea id="code-textarea" tabindex="0"></textarea>
</div> </div>
@ -270,7 +262,6 @@
</div> </div>
</div> </div>
</div> </div>
<script> <script>
var fileArray = []; var fileArray = [];
var BufferSize = 512; // Buffer 最大 Row 數 var BufferSize = 512; // Buffer 最大 Row 數
@ -289,11 +280,10 @@
var autoScroll = true; // Ming 2024-08-29 var autoScroll = true; // Ming 2024-08-29
var isUserScrolling = false; // Ming 2024-08-29 var isUserScrolling = false; // Ming 2024-08-29
Status_intervalId = null; Status_intervalId = null;
var loadingInterval = null;
var dots = 0; var dots = 0;
// 取得語系 // 取得語系
func_get_lang_cookie(); func_get_lang_cookie();
// 修改 window.onload 使用 async/await // 修改 window.onload 使用 async/await
window.onload = async function() { window.onload = async function() {
// 確認之前執行狀態 // 確認之前執行狀態
@ -311,11 +301,9 @@
} }
// 加載文件列表並選中 python // 加載文件列表並選中 python
func_FileGet(currentFileName); func_FileGet(currentFileName);
// 自動加載並顯示 python 的內容 // 自動加載並顯示 python 的內容
func_getFileList(currentFileName); func_getFileList(currentFileName);
}; };
// 初始化 CodeMirror // 初始化 CodeMirror
var editor = CodeMirror.fromTextArea(document.getElementById('code-textarea'), { var editor = CodeMirror.fromTextArea(document.getElementById('code-textarea'), {
lineNumbers: true, lineNumbers: true,
@ -491,7 +479,6 @@
//console.log("Delete File successfully !!!") //console.log("Delete File successfully !!!")
$('#console').append('&#13;&#10;'); // 換行 $('#console').append('&#13;&#10;'); // 換行
$('#console').append(retdata.replace(/\n/g, '<br>')); $('#console').append(retdata.replace(/\n/g, '<br>'));
currentFileName = 'hello.py'; currentFileName = 'hello.py';
func_getFileList(currentFileName); // 2024/08/22 Ming add func_getFileList(currentFileName); // 2024/08/22 Ming add
}, },
@ -503,17 +490,14 @@
// 停止 Python 檔案 // 停止 Python 檔案
function func_stopPython(file_name) { function func_stopPython(file_name) {
//console.log("func_stopPython"); //console.log("func_stopPython");
currentRunningFile = ''; // currentRunningFile = ''; //
$('#file-data-grid').datagrid('reload'); $('#file-data-grid').datagrid('reload');
var json_data = '{'; var json_data = '{';
json_data += '"system_setting": {'; json_data += '"system_setting": {';
json_data += '"enable_python_file": "' + 'No python running' + '"'; json_data += '"enable_python_file": "' + 'No python running' + '"';
json_data += '}'; json_data += '}';
json_data += '}'; json_data += '}';
func_setconfigfile(json_data); func_setconfigfile(json_data);
$.ajax({ $.ajax({
url: "/stoppython", url: "/stoppython",
method: "GET", method: "GET",
@ -529,16 +513,13 @@
var textarea = $('#console')[0]; var textarea = $('#console')[0];
textarea.scrollTop = textarea.scrollHeight; textarea.scrollTop = textarea.scrollHeight;
} }
}, },
error: function (retdata) { error: function (retdata) {
console.warn(retdata); console.warn(retdata);
} }
}); });
return false; return false;
} }
function func_convertSpecialChars(retdata) { function func_convertSpecialChars(retdata) {
// 將特殊字元轉換為 Web 可解析的形式 // 將特殊字元轉換為 Web 可解析的形式
var result = ''; var result = '';
@ -563,7 +544,6 @@
} }
return result; return result;
} }
function func_checkSpecialChar(data) { function func_checkSpecialChar(data) {
data = data.replace(/<br\/>/g, '&lt;br/&gt;'); // Show <br/> data = data.replace(/<br\/>/g, '&lt;br/&gt;'); // Show <br/>
return data.replace(/</g, "&#60;").replace(/>/g, "&#62;"); return data.replace(/</g, "&#60;").replace(/>/g, "&#62;");
@ -719,8 +699,8 @@
var json_data = "lifile_liname=" + file_name; var json_data = "lifile_liname=" + file_name;
//console.log(file_name); //console.log(file_name);
updateFileIcon();
updateFileIcon();
// 顯示 "Running" 動態點點效果 // 顯示 "Running" 動態點點效果
loadingInterval = setInterval(function() { loadingInterval = setInterval(function() {
var loadingText = "Running" + ".".repeat(dots % 4); var loadingText = "Running" + ".".repeat(dots % 4);
@ -750,7 +730,6 @@
// reject(retdata); // reject(retdata);
} }
}); });
return false; return false;
} }
@ -772,9 +751,7 @@
}, },
error: function () { error: function () {
console.warn(); console.warn();
k_index++; k_index++;
if (k_index <= 94) { if (k_index <= 94) {
waitSeconds(500); waitSeconds(500);
func_setconfigfile(json_data); func_setconfigfile(json_data);
@ -796,11 +773,14 @@
}, },
success: function (retdata) { success: function (retdata) {
var jsonbuf = JSON.parse(retdata); var jsonbuf = JSON.parse(retdata);
if ("enable_python_file" in jsonbuf["system_setting"]) { if ("enable_python_file" in jsonbuf["system_setting"]) {
currentRunningFile = jsonbuf["system_setting"]["enable_python_file"]; currentRunningFile = jsonbuf["system_setting"]["enable_python_file"];
g_isPythonRunning = 1; g_isPythonRunning = 1;
if (currentRunningFile.endsWith('.py')) { if (currentRunningFile.endsWith('.py')) {
// 顯示 "Running" 動態點點效果 // 顯示 "Running" 動態點點效果
loadingInterval = setInterval(function() { loadingInterval = setInterval(function() {
var loadingText = "Running unfinished python file" + ".".repeat(dots % 4); var loadingText = "Running unfinished python file" + ".".repeat(dots % 4);
$('#console').html(loadingText); $('#console').html(loadingText);
@ -832,9 +812,7 @@
index: 0, index: 0,
row: { filename: '<input type="text" class="new-file-name" placeholder="Enter new file name">', isNew: true } row: { filename: '<input type="text" class="new-file-name" placeholder="Enter new file name">', isNew: true }
}); });
$grid.datagrid('selectRow', 0); $grid.datagrid('selectRow', 0);
$('.new-file-name').on('keypress', function (e) { $('.new-file-name').on('keypress', function (e) {
if (e.which == 13) { // 按下 Enter if (e.which == 13) { // 按下 Enter
var newFileName = $(this).val(); var newFileName = $(this).val();
@ -846,12 +824,10 @@
} }
}); });
} }
// 自動選擇列表中的某個文件 // 自動選擇列表中的某個文件
function selectFileInDataGrid(fileName) { function selectFileInDataGrid(fileName) {
var $grid = $('#file-data-grid'); var $grid = $('#file-data-grid');
var rows = $grid.datagrid('getRows'); var rows = $grid.datagrid('getRows');
for (var i = 0; i < rows.length; i++) { for (var i = 0; i < rows.length; i++) {
if (rows[i].filename === fileName) { if (rows[i].filename === fileName) {
$grid.datagrid('selectRow', i); $grid.datagrid('selectRow', i);
@ -861,7 +837,6 @@
} }
} }
} }
$(document).ready(function () { $(document).ready(function () {
// 副檔名圖片 // 副檔名圖片
$('#file-data-grid').datagrid({ $('#file-data-grid').datagrid({
@ -890,7 +865,6 @@
} else if (value.endsWith('.zip') || value.endsWith('.rar') || value.endsWith('.7z')) { } else if (value.endsWith('.zip') || value.endsWith('.rar') || value.endsWith('.7z')) {
icon = '<img src="./images/zip.png" style="height:16px; width:16px;"/>'; icon = '<img src="./images/zip.png" style="height:16px; width:16px;"/>';
} }
return icon + ' ' + value; return icon + ' ' + value;
} }
} }
@ -899,7 +873,6 @@
fitColumns: false, // This will fit the columns to the grid width fitColumns: false, // This will fit the columns to the grid width
nowrap: true // This will prevent wrapping in a cell and possibly remove the need for horizontal scrolling nowrap: true // This will prevent wrapping in a cell and possibly remove the need for horizontal scrolling
}); });
// 選擇某檔案時,更新當前文件內容 // 選擇某檔案時,更新當前文件內容
$('#file-data-grid').datagrid({ $('#file-data-grid').datagrid({
onClickRow: function (rowIndex, rowData) { onClickRow: function (rowIndex, rowData) {
@ -917,7 +890,6 @@
func_FileSave(currentFileName); // 使用現在的文件名稱進行上傳 func_FileSave(currentFileName); // 使用現在的文件名稱進行上傳
} }
}); });
// Shift + Enter 執行 // Shift + Enter 執行
editor.on('keydown', function (instance, event) { editor.on('keydown', function (instance, event) {
if (event.shiftKey && event.which === 13) { if (event.shiftKey && event.which === 13) {
@ -928,7 +900,6 @@
func_runPython(currentFileName); // 使用現在的文件名稱執行 Python func_runPython(currentFileName); // 使用現在的文件名稱執行 Python
} }
}); });
// 設定 Textarea 可使用 Tab // 設定 Textarea 可使用 Tab
editor.setOption("extraKeys", { editor.setOption("extraKeys", {
Tab: function(cm) { Tab: function(cm) {
@ -955,13 +926,11 @@
} }
} }
}); });
// 按儲存按鈕 // 按儲存按鈕
$('#save-button').click(function (event) { $('#save-button').click(function (event) {
//console.log("Click event triggered on #save-button"); //console.log("Click event triggered on #save-button");
func_FileSave(currentFileName); // 使用現在的文件名稱進行上傳 func_FileSave(currentFileName); // 使用現在的文件名稱進行上傳
}); });
// 按刪除按鈕 // 按刪除按鈕
$('#deletefile-button').click(function () { $('#deletefile-button').click(function () {
if (currentFileName) { if (currentFileName) {
@ -976,7 +945,6 @@
}); });
} }
}); });
// 上傳按鈕 (只接受 .py 檔案) // 上傳按鈕 (只接受 .py 檔案)
$('#uploadfile-button').click(function() { $('#uploadfile-button').click(function() {
var fileInput = $('<input type="file" accept=".py">'); var fileInput = $('<input type="file" accept=".py">');
@ -994,7 +962,6 @@
} }
}); });
}); });
// 按執行按鈕 // 按執行按鈕
$('#run-button').click(function () { $('#run-button').click(function () {
$('#console').append("Running.....\n"); $('#console').append("Running.....\n");
@ -1005,19 +972,16 @@
// StartGetPythonBuffer(currentFileName) // StartGetPythonBuffer(currentFileName)
}); });
// 按暫停按鈕 // 按暫停按鈕
$('#stop-button').click(function () { $('#stop-button').click(function () {
// 開啟 「Run」& Func_funpython // 開啟 「Run」& Func_funpython
$("#run-button").prop("disabled", false); $("#run-button").prop("disabled", false);
func_stopPython(currentFileName) func_stopPython(currentFileName)
}); });
// 按清除 Console 按鈕 // 按清除 Console 按鈕
$('#ClearConsole-button').click(function () { $('#ClearConsole-button').click(function () {
$('#console').html(''); $('#console').html('');
}); });
// 將程式碼清空並上傳 // 將程式碼清空並上傳
$('#delete-button').click(function () { $('#delete-button').click(function () {
//console.log(""); //console.log("");
@ -1025,7 +989,6 @@
title: MESSAGE109, title: MESSAGE109,
icon: 'warning', icon: 'warning',
showCancelButton: true, showCancelButton: true,
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
// 清空 textarea 的内容 // 清空 textarea 的内容
@ -1035,10 +998,7 @@
} }
}); });
}); });
}); });
</script> </script>
</body> </body>
</html>
</html>

126
Aida/python.min.js vendored

File diff suppressed because one or more lines are too long

210
Aida/setting.html

@ -188,17 +188,17 @@
</td> </td>
</tr> </tr>
<!-- <!--
<tr style="height: 18px;"> <tr style="height: 18px;">
<td style="width: 450px; height: 18px;"> <td style="width: 450px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_ENABLE_OBJ_ONCE_TO_POST"></nobr> <nobr id="IDC_STATIC_ENABLE_OBJ_ONCE_TO_POST"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="ENABLE_OBJ_ONCE_TO_POST" type="checkbox" /> <input id="ENABLE_OBJ_ONCE_TO_POST" type="checkbox" />
</td> </td>
</tr> </tr>
--> -->
<tr id="low_cpu_usage_border" style="height: 18px;"> <tr id="low_cpu_usage_border" style="height: 18px;">
<td style="width: 450px; height: 18px;"> <td style="width: 450px; height: 18px;">
&nbsp; &nbsp;
@ -233,25 +233,25 @@
</td> </td>
</tr> </tr>
<!--<tr id="nav_once_border" style="height: 18px;"> <!--<tr id="nav_once_border" style="height: 18px;">
<td style="width: 450px; height: 18px;"> <td style="width: 450px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_ENABLE_NVR_ONCE_TO_GETALARMMOTION"></nobr> <nobr id="IDC_STATIC_ENABLE_NVR_ONCE_TO_GETALARMMOTION"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="enable_nvr_once_to_getalarmmotion" type="checkbox" /> <input id="enable_nvr_once_to_getalarmmotion" type="checkbox" />
</td> </td>
</tr> </tr>
<tr id="group_enable_8592" style="height: 18px;display:none;"> <tr id="group_enable_8592" style="height: 18px;display:none;">
<td style="width: 450px; height: 18px;"> <td style="width: 450px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_ENABLE_8592_ONCE_TO_GETALARMMOTION"></nobr> <nobr id="IDC_STATIC_ENABLE_8592_ONCE_TO_GETALARMMOTION"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="enable_8592_once_to_getalarmmotion" type="checkbox" /> <input id="enable_8592_once_to_getalarmmotion" type="checkbox" />
</td> </td>
</tr>--> </tr>-->
<tr id="setting_border_3" style="height: 18px;display:none;"> <tr id="setting_border_3" style="height: 18px;display:none;">
<td style="width: 450px; height: 18px;"> <td style="width: 450px; height: 18px;">
&nbsp; &nbsp;
@ -454,70 +454,70 @@
</tr> </tr>
<!-- <!--
<tr style="height: 18px;"> <tr style="height: 18px;">
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_CAMERA_IMAGE_ROTATION"></nobr> <nobr id="IDC_STATIC_CAMERA_IMAGE_ROTATION"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="button_sync_image_rotation" value="Sync." type="button" onclick="func_syncImageRotation();" style="background:#6c87d4;border-color:#6c87d4;color:white" /> <input id="button_sync_image_rotation" value="Sync." type="button" onclick="func_syncImageRotation();" style="background:#6c87d4;border-color:#6c87d4;color:white" />
</td> </td>
</tr> </tr>
--> -->
<!-- <!--
<tr style="height: 18px;"> <tr style="height: 18px;">
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_CPU_USAGE"></nobr> <nobr id="IDC_STATIC_CPU_USAGE"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="CPU_USAGE" <input id="CPU_USAGE"
type="text" type="text"
class="Disable" class="Disable"
value="100 %" style="background-color:#F3F1F1;" readonly /> value="100 %" style="background-color:#F3F1F1;" readonly />
</td> </td>
</tr> </tr>
<tr style="height: 18px;"> <tr style="height: 18px;">
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_GPU_USAGE"></nobr> <nobr id="IDC_STATIC_GPU_USAGE"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="GPU_USAGE" <input id="GPU_USAGE"
type="text" type="text"
class="Disable" class="Disable"
value="100 %" style="background-color:#F3F1F1;" readonly /> value="100 %" style="background-color:#F3F1F1;" readonly />
</td> </td>
</tr> </tr>
<tr style="height: 18px;"> <tr style="height: 18px;">
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_FPS"></nobr> <nobr id="IDC_STATIC_FPS"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="FPS" <input id="FPS"
type="text" type="text"
class="Disable" class="Disable"
value="30" style="background-color:#F3F1F1;" readonly /> value="30" style="background-color:#F3F1F1;" readonly />
</td> </td>
</tr> </tr>
--> -->
<!-- <!--
<tr style="height: 18px;"> <tr style="height: 18px;">
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_BYPASS_LOGIN"></nobr> <nobr id="IDC_STATIC_BYPASS_LOGIN"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="enable_bypass_login" type="checkbox" onchange="func_set_bypass_login_cookie()" /> <input id="enable_bypass_login" type="checkbox" onchange="func_set_bypass_login_cookie()" />
</td> </td>
</tr> </tr>
--> -->
</tbody> </tbody>
</table> </table>
</div> </div>
@ -1809,8 +1809,7 @@
&nbsp; &nbsp;
<textarea id="cloud_record_v2_statue" style="height: 80px;width: 450px;background-color:#F3F1F1;" readonly></textarea> <textarea id="cloud_record_v2_statue" style="height: 80px;width: 450px;background-color:#F3F1F1;" readonly></textarea>
</td> </td>
</td> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -1977,13 +1976,13 @@
</td> </td>
</tr> </tr>
<tr style="height: 18px;"> <tr style="height: 18px;">
<td style="width: 400px; height: 18px;"> <td style="width: 450px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_ENABLE_PYTHON_FILE"></nobr> <nobr id="IDC_STATIC_ENABLE_PYTHON_FILE"></nobr>
</td> </td>
<td style="width: 400px; height: 18px;"> <td style="width: 500px; height: 80px;">
&nbsp; &nbsp;
<input id="enable_python_file" type="text" readonly style="width: 300px;" /> <textarea id="enable_python_file" style="height: 80px;width: 450px;background-color:#F3F1F1;" readonly></textarea>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -4819,10 +4818,9 @@
$('#enable_python').prop("checked", true); $('#enable_python').prop("checked", true);
else else
$('#enable_python').prop("checked", false); $('#enable_python').prop("checked", false);
if (enable_python_file != null) // Ming 2024-10-01
$('#enable_python_file').val(enable_python_file); $('#enable_python_file').val(enable_python_file);
else
$('#enable_python_file').val("No python running.");
if (enable_email_jpeg === 'Yes') if (enable_email_jpeg === 'Yes')
$('#enable_email_jpeg').prop("checked", true); $('#enable_email_jpeg').prop("checked", true);
else else
@ -5015,6 +5013,8 @@
else { else {
enable_python = "No"; enable_python = "No";
} }
enable_python_file = $('#enable_python_file').val();
if ($('#enable_email_jpeg').is(":checked")) { if ($('#enable_email_jpeg').is(":checked")) {
enable_email_jpeg = "Yes"; enable_email_jpeg = "Yes";
@ -5102,12 +5102,6 @@
} }
ai_mirror_feature = $('#ai_mirror_feature').val(); ai_mirror_feature = $('#ai_mirror_feature').val();
if ($('#enable_python').is(":checked")) {
enable_python = "Yes";
}
else {
enable_python = "No";
}
if ($('#enable_post_only_if_both_detected').is(":checked")) { if ($('#enable_post_only_if_both_detected').is(":checked")) {
enable_post_only_if_both_detected = "Yes"; enable_post_only_if_both_detected = "Yes";

214
Aida/setting_on_nvr.html

@ -212,17 +212,17 @@
</td> </td>
</tr> </tr>
<!-- <!--
<tr style="height: 18px;"> <tr style="height: 18px;">
<td style="width: 350px; height: 18px;"> <td style="width: 350px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_ENABLE_OBJ_ONCE_TO_POST"></nobr> <nobr id="IDC_STATIC_ENABLE_OBJ_ONCE_TO_POST"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="ENABLE_OBJ_ONCE_TO_POST" type="checkbox" /> <input id="ENABLE_OBJ_ONCE_TO_POST" type="checkbox" />
</td> </td>
</tr> </tr>
--> -->
<tr id="low_cpu_usage_border" style="height: 18px;"> <tr id="low_cpu_usage_border" style="height: 18px;">
<td style="width: 350px; height: 18px;"> <td style="width: 350px; height: 18px;">
&nbsp; &nbsp;
@ -257,25 +257,25 @@
</td> </td>
</tr> </tr>
<!--<tr id="nav_once_border" style="height: 18px;"> <!--<tr id="nav_once_border" style="height: 18px;">
<td style="width: 350px; height: 18px;"> <td style="width: 350px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_ENABLE_NVR_ONCE_TO_GETALARMMOTION"></nobr> <nobr id="IDC_STATIC_ENABLE_NVR_ONCE_TO_GETALARMMOTION"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="enable_nvr_once_to_getalarmmotion" type="checkbox" /> <input id="enable_nvr_once_to_getalarmmotion" type="checkbox" />
</td> </td>
</tr> </tr>
<tr id="group_enable_8592" style="height: 18px;display:none;"> <tr id="group_enable_8592" style="height: 18px;display:none;">
<td style="width: 350px; height: 18px;"> <td style="width: 350px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_ENABLE_8592_ONCE_TO_GETALARMMOTION"></nobr> <nobr id="IDC_STATIC_ENABLE_8592_ONCE_TO_GETALARMMOTION"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="enable_8592_once_to_getalarmmotion" type="checkbox" /> <input id="enable_8592_once_to_getalarmmotion" type="checkbox" />
</td> </td>
</tr>--> </tr>-->
<tr id="setting_border_3" style="height: 18px;display:none;"> <tr id="setting_border_3" style="height: 18px;display:none;">
<td style="width: 350px; height: 18px;"> <td style="width: 350px; height: 18px;">
&nbsp; &nbsp;
@ -338,10 +338,10 @@
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<select name="getnetwork_buffer_id" id="getnetwork_buffer_id" onchange=""> <select name="getnetwork_buffer_id" id="getnetwork_buffer_id" onchange="">
<option value="0">1</option> <option value="0">1</option><!--0-->
<option value="3">2</option> <option value="1">2</option><!--3-->
<option value="2">3</option> <option value="2">3</option><!--2-->
<option value="1">4</option> <option value="3">4</option><!--1-->
</select> </select>
</td> </td>
</tr> </tr>
@ -398,7 +398,6 @@
<input id="enable_onvif_profile_m" type="checkbox" /> <input id="enable_onvif_profile_m" type="checkbox" />
</td> </td>
</tr> </tr>
<tr id="advanced_border_1" style="height: 18px;"> <tr id="advanced_border_1" style="height: 18px;">
<td style="width: 350px; height: 18px;"> <td style="width: 350px; height: 18px;">
&nbsp; &nbsp;
@ -479,70 +478,70 @@
</tr> </tr>
<!-- <!--
<tr style="height: 18px;"> <tr style="height: 18px;">
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_CAMERA_IMAGE_ROTATION"></nobr> <nobr id="IDC_STATIC_CAMERA_IMAGE_ROTATION"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="button_sync_image_rotation" value="Sync." type="button" onclick="func_syncImageRotation();" style="background:#6c87d4;border-color:#6c87d4;color:white" /> <input id="button_sync_image_rotation" value="Sync." type="button" onclick="func_syncImageRotation();" style="background:#6c87d4;border-color:#6c87d4;color:white" />
</td> </td>
</tr> </tr>
--> -->
<!--
<tr style="height: 18px;">
<td style="width: 500px; height: 18px;">
&nbsp;
<nobr id="IDC_STATIC_CPU_USAGE"></nobr>
</td>
<td style="width: 500px; height: 18px;">
&nbsp;
<input id="CPU_USAGE"
type="text"
class="Disable"
value="100 %" style="background-color:#F3F1F1;" readonly />
</td>
</tr>
<tr style="height: 18px;">
<td style="width: 500px; height: 18px;">
&nbsp;
<nobr id="IDC_STATIC_GPU_USAGE"></nobr>
</td>
<td style="width: 500px; height: 18px;">
&nbsp;
<input id="GPU_USAGE"
type="text"
class="Disable"
value="100 %" style="background-color:#F3F1F1;" readonly />
</td>
</tr>
<tr style="height: 18px;">
<td style="width: 500px; height: 18px;">
&nbsp;
<nobr id="IDC_STATIC_FPS"></nobr>
</td>
<td style="width: 500px; height: 18px;">
&nbsp;
<input id="FPS"
type="text"
class="Disable"
value="30" style="background-color:#F3F1F1;" readonly />
</td>
</tr>
-->
<!-- <!--
<tr style="height: 18px;"> <tr style="height: 18px;">
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<nobr id="IDC_STATIC_BYPASS_LOGIN"></nobr> <nobr id="IDC_STATIC_CPU_USAGE"></nobr>
</td> </td>
<td style="width: 500px; height: 18px;"> <td style="width: 500px; height: 18px;">
&nbsp; &nbsp;
<input id="enable_bypass_login" type="checkbox" onchange="func_set_bypass_login_cookie()" /> <input id="CPU_USAGE"
</td> type="text"
</tr> class="Disable"
--> value="100 %" style="background-color:#F3F1F1;" readonly />
</td>
</tr>
<tr style="height: 18px;">
<td style="width: 500px; height: 18px;">
&nbsp;
<nobr id="IDC_STATIC_GPU_USAGE"></nobr>
</td>
<td style="width: 500px; height: 18px;">
&nbsp;
<input id="GPU_USAGE"
type="text"
class="Disable"
value="100 %" style="background-color:#F3F1F1;" readonly />
</td>
</tr>
<tr style="height: 18px;">
<td style="width: 500px; height: 18px;">
&nbsp;
<nobr id="IDC_STATIC_FPS"></nobr>
</td>
<td style="width: 500px; height: 18px;">
&nbsp;
<input id="FPS"
type="text"
class="Disable"
value="30" style="background-color:#F3F1F1;" readonly />
</td>
</tr>
-->
<!--
<tr style="height: 18px;">
<td style="width: 500px; height: 18px;">
&nbsp;
<nobr id="IDC_STATIC_BYPASS_LOGIN"></nobr>
</td>
<td style="width: 500px; height: 18px;">
&nbsp;
<input id="enable_bypass_login" type="checkbox" onchange="func_set_bypass_login_cookie()" />
</td>
</tr>
-->
</tbody> </tbody>
</table> </table>
</div> </div>
@ -2000,6 +1999,16 @@
<input id="show_system_logs" type="button" onclick="func_show_python()" value="Python" style="background:#6c87d4;border-color:#6c87d4;color:white" /> <input id="show_system_logs" type="button" onclick="func_show_python()" value="Python" style="background:#6c87d4;border-color:#6c87d4;color:white" />
</td> </td>
</tr> </tr>
<tr style="height: 18px;">
<td style="width: 350px; height: 18px;">
&nbsp;
<nobr id="IDC_STATIC_ENABLE_PYTHON_FILE"></nobr>
</td>
<td style="width: 500px; height: 80px;">
&nbsp;
<textarea id="enable_python_file" style="height: 80px;width: 450px;background-color:#F3F1F1;" readonly></textarea>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -2169,6 +2178,7 @@
document.getElementById("IDC_STATIC_ENABLE_SYSTEM_LOGS").innerHTML = IDC_STATIC_ENABLE_SYSTEM_LOGS; document.getElementById("IDC_STATIC_ENABLE_SYSTEM_LOGS").innerHTML = IDC_STATIC_ENABLE_SYSTEM_LOGS;
document.getElementById("IDC_STATIC_ENABLE_PYTHON").innerHTML = IDC_STATIC_ENABLE_PYTHON; document.getElementById("IDC_STATIC_ENABLE_PYTHON").innerHTML = IDC_STATIC_ENABLE_PYTHON;
document.getElementById("IDC_STATIC_ENABLE_PYTHON_FILE").innerHTML = IDC_STATIC_ENABLE_PYTHON_FILE;
document.getElementById("IDC_STATIC_RED_LIGHT_ZONE").innerHTML = IDC_STATIC_RED_LIGHT_ZONE; document.getElementById("IDC_STATIC_RED_LIGHT_ZONE").innerHTML = IDC_STATIC_RED_LIGHT_ZONE;
document.getElementById("IDC_STATIC_NO_GIVE_WAY_TOPIC").innerHTML = IDC_STATIC_NO_GIVE_WAY_TOPIC; document.getElementById("IDC_STATIC_NO_GIVE_WAY_TOPIC").innerHTML = IDC_STATIC_NO_GIVE_WAY_TOPIC;
@ -2298,6 +2308,7 @@
var enable_email_notification = "No"; var enable_email_notification = "No";
var enable_system_logs = "No"; var enable_system_logs = "No";
var enable_python = "No"; var enable_python = "No";
var enable_python_file = "No python running"; // Ming 2024-09-27
var enable_email_jpeg = "Yes"; var enable_email_jpeg = "Yes";
var email_content = ""; var email_content = "";
var email_reset_time_interval = ""; var email_reset_time_interval = "";
@ -4332,6 +4343,7 @@
enable_system_logs = jsonbuf["system_setting"]["enable_system_logs"]; enable_system_logs = jsonbuf["system_setting"]["enable_system_logs"];
enable_python = jsonbuf["system_setting"]["enable_python"]; enable_python = jsonbuf["system_setting"]["enable_python"];
enable_python_file = jsonbuf["system_setting"]["enable_python_file"]; // Ming 2024-09-27
enable_email_jpeg = jsonbuf["system_setting"]["enable_email_jpeg"]; enable_email_jpeg = jsonbuf["system_setting"]["enable_email_jpeg"];
email_reset_time_interval = jsonbuf["system_setting"]["email_reset_time_interval"]; email_reset_time_interval = jsonbuf["system_setting"]["email_reset_time_interval"];
if (email_reset_time_interval.length == 0) { if (email_reset_time_interval.length == 0) {
@ -4635,6 +4647,7 @@
$('#nms_thres').slider('setValue', parseInt(nms_thres, 10)); $('#nms_thres').slider('setValue', parseInt(nms_thres, 10));
$('#tracking_id_dwell').slider('setValue', parseInt(tracking_id_dwell, 10)); $('#tracking_id_dwell').slider('setValue', parseInt(tracking_id_dwell, 10));
$('#dwell_to_the_same_location').slider('setValue', parseInt(dwell_to_the_same_location, 10)); $('#dwell_to_the_same_location').slider('setValue', parseInt(dwell_to_the_same_location, 10));
if (enable_cloud_v2 === 'Yes') if (enable_cloud_v2 === 'Yes')
@ -4830,6 +4843,8 @@
else else
$('#enable_python').prop("checked", false); $('#enable_python').prop("checked", false);
$('#enable_python_file').val(enable_python_file);
if (enable_email_jpeg === 'Yes') if (enable_email_jpeg === 'Yes')
$('#enable_email_jpeg').prop("checked", true); $('#enable_email_jpeg').prop("checked", true);
else else
@ -4981,6 +4996,7 @@
nms_thres = $('#nms_thres').slider('getValue'); nms_thres = $('#nms_thres').slider('getValue');
tracking_id_dwell = $('#tracking_id_dwell').slider('getValue'); tracking_id_dwell = $('#tracking_id_dwell').slider('getValue');
dwell_to_the_same_location = $('#dwell_to_the_same_location').slider('getValue'); dwell_to_the_same_location = $('#dwell_to_the_same_location').slider('getValue');
if ($('#enable_cloud_v2').is(":checked")) { if ($('#enable_cloud_v2').is(":checked")) {
@ -5021,6 +5037,8 @@
else { else {
enable_python = "No"; enable_python = "No";
} }
enable_python_file = $('#enable_python_file').val();
if ($('#enable_email_jpeg').is(":checked")) { if ($('#enable_email_jpeg').is(":checked")) {
enable_email_jpeg = "Yes"; enable_email_jpeg = "Yes";

2
Aida/speed_index.js

@ -145,7 +145,7 @@ function insertTrafficLightRectangle(r_left, r_top, r_width, r_height, r_direct,
if (r_name == "person") { if (r_name == "person") {
color_type = '#FF8C00'; color_type = '#FF8C00';
} }
else { else if (r_name == "car") {
color_type = '#800080'; color_type = '#800080';
} }
} }

Loading…
Cancel
Save