Browse Source

2.0.7.69

master
ming.hong 1 year ago
parent
commit
6b3ba9ad67
  1. 16
      Aida/airelay_init.html
  2. 142
      Aida/alarm.html
  3. 220
      Aida/alarm.js
  4. 40
      Aida/alarm_on_airelay.html
  5. 73
      Aida/alarm_on_airelay.js
  6. 115
      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. 8
      Aida/lang.js
  15. BIN
      Aida/lilin.png
  16. 2
      Aida/menu_on_nvr.html
  17. 2
      Aida/ptz.js
  18. 70
      Aida/python.html
  19. 126
      Aida/python.min.js
  20. 22
      Aida/setting.html
  21. 28
      Aida/setting_on_nvr.html
  22. 2
      Aida/speed_index.js

16
Aida/airelay_init.html

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

142
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();
//document.getElementById('IDOK').disabled = true;
@ -4455,28 +4512,35 @@
}
function func_seteventsfile(json_data) {
waitSeconds(100);
$.ajax({
url: "/seteventsfile",
method: "POST",
async: false,
data: json_data,
contentType: false,
//contentType: false,
processData: false,
timeout: 5000,
cache: false,
xhrFields: {
withCredentials: true // 設置為 true 如果需要帶上 Cookies 或其他認證
},
contentType: 'text/plain', // 傳送純文本
beforeSend: function (xmlHttp) {
xmlHttp.setRequestHeader("If-Modified-Since", "0");
xmlHttp.setRequestHeader("Cache-Control", "no-cache");
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
},
success: function () {
success: function (retdata) {
//console.info();
},
error: function () {
console.warn();
error: function (retdata) {
console.warn(retdata);
k_index++;
if (k_index <= 94) {
waitSeconds(500);
waitSeconds(1000);
func_seteventsfile(json_data);
}
}
@ -4485,27 +4549,34 @@
}
function func_setconfigfile(json_data) {
waitSeconds(100);
$.ajax({
url: "/setconfigfile",
method: "POST",
async: false,
data: json_data,
contentType: false,
//contentType: false,
processData: false,
timeout: 5000,
cache: false,
xhrFields: {
withCredentials: true // 設置為 true 如果需要帶上 Cookies 或其他認證
},
contentType: 'text/plain', // 傳送純文本
beforeSend: function (xmlHttp) {
xmlHttp.setRequestHeader("If-Modified-Since", "0");
xmlHttp.setRequestHeader("Cache-Control", "no-cache");
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
},
success: function () {
success: function (retdata) {
//console.info();
},
error: function () {
console.warn();
error: function (retdata) {
console.warn(retdata);
k_index++;
if (k_index <= 94) {
waitSeconds(500);
waitSeconds(1000);
func_setconfigfile(json_data);
}
}
@ -6814,8 +6885,11 @@
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 += '","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 += '","direction1": "' + func_get_direction(0).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(1).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(2).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(3).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(4).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(5).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(6).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(7).toString();
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 += ',"y6": ' + Math.round(points_array_7[5].y * tab_view_size[1] / image_height);
json_data += '}]}}}';
//console.log(json_data);
func_setconfigfile(json_data);
var text_checked_trigger_events = new Array(MAX_DETECTION_ZONE);

220
Aida/alarm.js

@ -309,7 +309,7 @@ function insertTrafficLightRectangle(r_left, r_top, r_width, r_height, r_direct,
if (r_name == "person") {
color_type = '#FF8C00';
}
else {
else if(r_name == "car"){
color_type = '#800080';
}
}
@ -3046,7 +3046,12 @@ function GetAlarm(alarm_data) {
var complete_data = "";
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;
if (g_enable_show_pixel === 1) {
max_protected_objects = g_max_protected_objects + 2;
}
@ -3059,6 +3064,8 @@ function GetAlarm(alarm_data) {
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) {
wait_count = 0;
clear_count = 0;
@ -3073,6 +3080,9 @@ function GetAlarm(alarm_data) {
buffer_cam_time = "";
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) {
//datas[i].replace(/\\'/g, "'");
//datas[i].replace('\"', '"');
@ -3100,6 +3110,9 @@ function GetAlarm(alarm_data) {
ai_json = JSON.parse(temp);
//ai_json = validatingJSON(temp);
// console.log("ai_json:");
// console.log(ai_json);
datas[i] = null;
//check_cam_time = 1;
@ -3154,12 +3167,15 @@ function GetAlarm(alarm_data) {
/*if (clear_count_2 >= 3) */
{
//clear_count_2 = 0;
// console.log("[WebSocket] max_protected_objects: ", max_protected_objects);
RefreshCanvasObject(max_protected_objects);
}
//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') {
counter_count_msg = "";
@ -3233,12 +3249,15 @@ function GetAlarm(alarm_data) {
insert_red_text = "FPS:" + AI_fps.toString() + ",";
}
var insert_red_text_max = "";
var insert_red_text_min = "";
if (current_state_hide_or_open_getalarmmotion == 1) {
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].parent_idx == -1) {
@ -3336,9 +3355,9 @@ function GetAlarm(alarm_data) {
continue;
}
if (canvasTripwire_all && canvasTripwire && canvasTripwire1 && canvasTripwire2 && canvasTripwire3 && canvasTripwire4 && canvasTripwire5 && canvasTripwire6 && canvasTripwire7 && canvasTripwire8) {
var translate_name = func_translate_name(plate_name);
var behavior_id = ai_json.AiEngine[i].behavior_id;
var detection_zone_id = ai_json.AiEngine[i].detection_zone_id;
var obj_dwell_time = ai_json.AiEngine[i].obj_dwell_time;
@ -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));
}
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.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));
@ -3923,6 +3949,9 @@ function GetAlarm(alarm_data) {
canvasTripwire8.getObjects()[0].stroke = "#ff0000";
}
// 11-01
func_checkZoneColor();
if (canvasTripwire_all && canvasTripwire && canvasTripwire1 && canvasTripwire2 && canvasTripwire3 && canvasTripwire4 && canvasTripwire5 && canvasTripwire6 && canvasTripwire7 && canvasTripwire8) {
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) {
@ -4190,27 +4219,6 @@ function AssignPlateObject(ai_json,i_index,plate_name) {
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);
//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;
@ -4394,16 +4402,22 @@ function RenderAllCanvas() {
function RefreshCanvasObject(max_protected_objects) {
if (typeof canvasTripwire !== 'undefined') {
//Clear all objects
// console.log(canvasTripwire.getObjects());
while (canvasTripwire.getObjects().length > 0) {
var items = canvasTripwire.getObjects();
if (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') {
//Clear all objects
// console.log(canvasTripwire1.getObjects());
while (canvasTripwire1.getObjects().length > max_protected_objects) {
var items = canvasTripwire1.getObjects();
if (items[canvasTripwire1.getObjects().length - 1]) {
@ -4411,10 +4425,14 @@ function RefreshCanvasObject(max_protected_objects) {
}
}
canvasTripwire1.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire1.getObjects());
// console.log("--------------------------");
}
if (typeof canvasTripwire2 !== 'undefined') {
// console.log(canvasTripwire2.getObjects());
//Clear all objects
while (canvasTripwire2.getObjects().length > max_protected_objects) {
var items = canvasTripwire2.getObjects();
@ -4423,10 +4441,14 @@ function RefreshCanvasObject(max_protected_objects) {
}
}
canvasTripwire2.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire2.getObjects());
// console.log("--------------------------");
}
if (typeof canvasTripwire3 !== 'undefined') {
// console.log(canvasTripwire3.getObjects());
//Clear all objects
while (canvasTripwire3.getObjects().length > max_protected_objects) {
var items = canvasTripwire3.getObjects();
@ -4435,9 +4457,13 @@ function RefreshCanvasObject(max_protected_objects) {
}
}
canvasTripwire3.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire3.getObjects());
// console.log("--------------------------");
}
if (typeof canvasTripwire4 !== 'undefined') {
// console.log(canvasTripwire4.getObjects());
//Clear all objects
while (canvasTripwire4.getObjects().length > max_protected_objects) {
var items = canvasTripwire4.getObjects();
@ -4446,9 +4472,13 @@ function RefreshCanvasObject(max_protected_objects) {
}
}
canvasTripwire4.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire4.getObjects());
// console.log("--------------------------");
}
if (typeof canvasTripwire5 !== 'undefined') {
// console.log(canvasTripwire5.getObjects());
//Clear all objects
while (canvasTripwire5.getObjects().length > max_protected_objects) {
var items = canvasTripwire5.getObjects();
@ -4457,9 +4487,13 @@ function RefreshCanvasObject(max_protected_objects) {
}
}
canvasTripwire5.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire5.getObjects());
// console.log("--------------------------");
}
if (typeof canvasTripwire6 !== 'undefined') {
// console.log(canvasTripwire6.getObjects());
//Clear all objects
while (canvasTripwire6.getObjects().length > max_protected_objects) {
var items = canvasTripwire6.getObjects();
@ -4468,9 +4502,13 @@ function RefreshCanvasObject(max_protected_objects) {
}
}
canvasTripwire6.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire6.getObjects());
// console.log("--------------------------");
}
if (typeof canvasTripwire7 !== 'undefined') {
// console.log(canvasTripwire7.getObjects());
//Clear all objects
while (canvasTripwire7.getObjects().length > max_protected_objects) {
var items = canvasTripwire7.getObjects();
@ -4479,9 +4517,12 @@ function RefreshCanvasObject(max_protected_objects) {
}
}
canvasTripwire7.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire7.getObjects());
// console.log("--------------------------");
}
if (typeof canvasTripwire8 !== 'undefined') {
// console.log(canvasTripwire8.getObjects());
//Clear all objects
while (canvasTripwire8.getObjects().length > max_protected_objects) {
var items = canvasTripwire8.getObjects();
@ -4490,20 +4531,27 @@ function RefreshCanvasObject(max_protected_objects) {
}
}
canvasTripwire8.getObjects()[0].stroke = "#ffff00";
// console.log(canvasTripwire8.getObjects());
// console.log("--------------------------");
}
if (typeof canvasTripwire_all !== 'undefined') {
// console.log("click_canvas_all:", click_canvas_all);
// console.log(canvasTripwire_all.getObjects());
//Clear all objects
while (canvasTripwire_all.getObjects().length > click_canvas_all) {
var items = canvasTripwire_all.getObjects();
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]);
}
for (var index_click = 0; index_click < click_canvas_all; index_click++) {
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(navigator.userAgent);
// Let us open a web socket
if ( navigator.userAgent.indexOf( "nvr_auth=" ) != -1 )
ws = new WebSocket("ws://" + window.location.hostname + ":" + GetUrlPort() + "/getalarmmotion?" + navigator.userAgent );
else
@ -4666,6 +4715,7 @@ function GetRequest_WebSocket() {
//console.log("WebSocket NOT supported by your Browser!");
}
}
/*
function reConnect() {
//console.log("socket 連線斷開,正在嘗試重新建立連線");
@ -4720,6 +4770,8 @@ function GetRequest_Http() {
}
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({
url: "/setconfig?coldobjects&x=" + object_x + "&y=" + object_y + "&w=" + object_w + "&h=" + object_h + "&Object=" + object_name,
method: "GET",
@ -4834,7 +4886,6 @@ function func_translate_name(translate_name) {
var label_names_zh_tw = data_zh_tw[key];
var label_names_ja_jp = data_ja_jp[key];
var label_names_it_it = data_it_it[key];
if (localStorage.getItem("events_default_version") != null && localStorage.getItem("events_default_version") == "4") {
if (translate_name == "person") {
if (G_LANG == "zh_tw")
@ -4873,7 +4924,6 @@ function func_translate_name(translate_name) {
else if (G_LANG == "it_it")
translate_name = label_names_it_it;
}
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;
}

40
Aida/alarm_on_airelay.html

@ -5,7 +5,7 @@
<meta http-equiv="cache-control"
content="max-age=0" />
<meta http-equiv="cache-control"
content="no-store, no-store, must-revalidate" />
content="no-store, must-revalidate" />
<meta http-equiv="expires"
content="-1" />
<meta http-equiv="expires"
@ -23,6 +23,7 @@
<style>
body, html {
font-family: "Arial";
}
@ -384,8 +385,8 @@
var g_times_get_bar = 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() {
clearInterval(g_Canvas_BackgroundImage);
@ -756,9 +757,9 @@
event_stream = create_canvas_stream1();
var checkH264StreamIntervalID = null;
var checkH264StreamIntervalTime = 200;
var checkH264StreamIntervalTime = 10;
var checkStreamingCounter = 0;
var checkCounterThreshold = 12;
var checkCounterThreshold = 15;
clearInterval(checkH264StreamIntervalID);
checkH264StreamIntervalID = setInterval(function () {
@ -774,7 +775,6 @@
if (checkStreamingCounter > checkCounterThreshold) {
localStorage.setItem("receivedH264", check_h264_received);
clearInterval(checkH264StreamIntervalID);
// 08-15 TODO 嘗試確認 getalarmmotion fetch 連線是否中斷
}
}, checkH264StreamIntervalTime)
@ -1047,16 +1047,13 @@
<input class="easyui-slider" style="width:100%;" id="parking_space" />
</div>
</div>
</div>
<div align="center">
<input align="center" id="IDOK" type="button" value="Set" onclick="func_setAlarmData()" class="Content_stybtn_ln" />
</div>
</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;">
<!-- <br> -->
@ -1175,7 +1172,6 @@
</div>
</div>
<div align="center">
<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,額外再加上紅線物件
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]}`);
// 比照 func_listen_to_enable_or_disable_show_direction 開啟紅線物件可見性的條件
@ -2281,6 +2276,7 @@
}
function func_listen_to_enable_or_disable_show_direction() {
if (current_trigger[get_current_index_zone()] == 4 ||
current_trigger[get_current_index_zone()] == 17 ||
current_trigger[get_current_index_zone()] == 18 ||
@ -7155,7 +7151,7 @@
// console.log("set zone 2 config");
var json_data_zone_2 = '{"view_setting":{"camera01":{';
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 += '","enable_ivs_zone": "' + enable_ivs_zone[1];
json_data_zone_2 += '","parking_line": "' + parking_line[1];
@ -7180,7 +7176,7 @@
// console.log("set zone 3 config");
var json_data_zone_3 = '{"view_setting":{"camera01":{';
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 += '","enable_ivs_zone": "' + enable_ivs_zone[2];
json_data_zone_3 += '","parking_line": "' + parking_line[2];
@ -7201,12 +7197,11 @@
func_setconfigfile(json_data_zone_3);
}
if (count_zone >= 4) {
// console.log("set zone 4 config");
var json_data_zone_4 = '{"view_setting":{"camera01":{';
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 += '","enable_ivs_zone": "' + enable_ivs_zone[3];
json_data_zone_4 += '","parking_line": "' + parking_line[3];
@ -7231,7 +7226,7 @@
// console.log("set zone 5 config");
var json_data_zone_5 = '{"view_setting":{"camera01":{';
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 += '","enable_ivs_zone": "' + enable_ivs_zone[4];
json_data_zone_5 += '","parking_line": "' + parking_line[4];
@ -7252,12 +7247,11 @@
func_setconfigfile(json_data_zone_5);
}
if (count_zone >= 6) {
// console.log("set zone 6 config");
var json_data_zone_6 = '{"view_setting":{"camera01":{';
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 += '","enable_ivs_zone": "' + enable_ivs_zone[5];
json_data_zone_6 += '","parking_line": "' + parking_line[5];
@ -7278,12 +7272,11 @@
func_setconfigfile(json_data_zone_6);
}
if (count_zone >= 7) {
// console.log("set zone 7 config");
var json_data_zone_7 = '{"view_setting":{"camera01":{';
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 += '","enable_ivs_zone": "' + enable_ivs_zone[6];
json_data_zone_7 += '","parking_line": "' + parking_line[6];
@ -7304,12 +7297,11 @@
func_setconfigfile(json_data_zone_7);
}
if (count_zone >= 8) {
// console.log("set zone 8 config");
var json_data_zone_8 = '{"view_setting":{"camera01":{';
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 += '","enable_ivs_zone": "' + enable_ivs_zone[7];
json_data_zone_8 += '","parking_line": "' + parking_line[7];
@ -7930,7 +7922,6 @@
}
}
var json_data_trigger = '{"view_setting":{"camera01":{"detection_zone":[';
for (var i = 0; i < count_zone; i++) {
if (i == count_zone - 1) {
@ -8197,9 +8188,6 @@
}
isMouseDown = false;
if (typeof canvasTripwire_all !== 'undefined') {
console.log("[onMouseUp] #metadata_mouse_coldobjects val:", $('#metadata_mouse_coldobjects').val());

73
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") {
color_type = '#FF8C00';
}
else {
else if(r_name == "car"){
color_type = '#800080';
}
}
@ -1616,7 +1616,6 @@ var red_light_zone6;
var red_light_zone7;
var red_light_zone8;
function createCanvasTrafficLight_alarm(mypoints1, mypoints2, mypoints3, mypoints4, mypoints5, mypoints6, mypoints7, mypoints8) {
currentPointPosition1 = mypoints1;
currentPointPosition2 = mypoints2;
@ -3970,6 +3969,7 @@ function GetAlarm(alarm_data) {
else {
label_word = color;
}
//console.log(label_word);
if (plate_name == "tof_point") {
if ((ai_json.AiEngine[i].max_distance != 0 && ai_json.AiEngine[i].max_height != 0) ||
@ -4595,6 +4595,7 @@ function GetAlarm(alarm_data) {
}
}
}
RenderAllCanvas();
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;
@ -6093,27 +6056,34 @@ function openIVSsettins() {
var k_count = -1;
function func_setconfigfile(json_data) {
waitSeconds(100);
$.ajax({
url: '/' + g_tcp_tunnel_token + "/setconfigfile",
method: "POST",
async: false,
data: json_data,
contentType: false,
//contentType: false,
processData: false,
timeout: 5000,
cache: false,
xhrFields: {
withCredentials: true // 設置為 true 如果需要帶上 Cookies 或其他認證
},
contentType: 'text/plain', // 傳送純文本
beforeSend: function (xmlHttp) {
xmlHttp.setRequestHeader("If-Modified-Since", "0");
xmlHttp.setRequestHeader("Cache-Control", "no-cache");
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
},
success: function () {
success: function (retdata) {
//console.info();
},
error: function () {
console.warn();
error: function (retdata) {
console.warn(retdata);
k_count++;
if (k_count <= 94) {
waitSeconds(500);
waitSeconds(1000);
func_setconfigfile(json_data);
}
}
@ -6193,9 +6163,9 @@ function func_checkTriggerZoneStatus(behavior_id)
// 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;
}
@ -6206,23 +6176,24 @@ function func_checkTriggerZoneStatus(behavior_id)
else if (behavior_id == 8) // 警戒線
{
trigger_index = 4;
}
}*/
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) {
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)

115
Aida/alarm_on_nvr.html

@ -278,8 +278,8 @@
var g_times_get_bar = 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() {
clearInterval(g_Canvas_BackgroundImage);
@ -1390,7 +1390,7 @@
// reversed:true,
// disabled:true,
min: 0,
max: 100,
max: 30,
// step:2.5,
//提示格式函数
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();
//document.getElementById('IDOK').disabled = true;
@ -4410,6 +4467,7 @@
}
}
function func_setAlarmData() {
if (lock_IDOK == 1) {
alert(IDC_STATIC_SHOW_ALL_ALERT);
@ -6773,8 +6831,11 @@
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 += '","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 += '","direction1": "' + func_get_direction(0).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(1).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(2).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(3).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(4).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(5).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(6).toString();
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 += ',"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 += '},';
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 += '","direction1": "' + func_get_direction(7).toString();
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 += ',"y6": ' + Math.round(points_array_7[5].y * tab_view_size[1] / image_height);
json_data += '}]}}}';
//console.log(json_data);
func_setconfigfile(json_data);
var text_checked_trigger_events = new Array(MAX_DETECTION_ZONE);
@ -7274,7 +7361,7 @@
//k_index = 95;
}
else if (k_index == 100) {
func_run_osd_server();
//func_run_osd_server();
$(".progress-bar").css("visibility", "hidden");
//$(".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") {
color_type = '#FF8C00';
}
else {
else if (r_name == "car") {
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") {
color_type = '#FF8C00';
}
else {
else if (r_name == "car") {
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);
}
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_162": "carrier",' +
'"LABEL_NAMES_163": "yacht",' +
'"LABEL_NAMES_164": "bridge_crane_up",' +
'"LABEL_NAMES_165": "bridge_crane_down"' +
'"LABEL_NAMES_164": "_s",' + //bridge_crane_up
'"LABEL_NAMES_165": "_s"' + //bridge_crane_down
'}],' +
'"AIFRONTBACK" : [{' +
'"LABEL_NAMES_340": "dual_headlight",' +
@ -558,8 +558,8 @@ var LABEL_NAMES_zh_tw = '{' +
'"LABEL_NAMES_161": "釣魚",' +
'"LABEL_NAMES_162": "載體",' +
'"LABEL_NAMES_163": "遊艇",' +
'"LABEL_NAMES_164": "橋式起重機運作中",' +
'"LABEL_NAMES_165": "橋式起重機停機"' +
'"LABEL_NAMES_164": "_s",' +//橋式起重機運作中
'"LABEL_NAMES_165": "_s"' +//橋式起重機停機
'}],' +
'"AIFRONTBACK" : [{' +
'"LABEL_NAMES_340": "雙車燈",' +
@ -916,8 +916,8 @@ var LABEL_NAMES_ja_jp = '{' +
'"LABEL_NAMES_161": "釣り",' +
'"LABEL_NAMES_162": "キャリア",' +
'"LABEL_NAMES_163": "ヨット",' +
'"LABEL_NAMES_164": "ブリッジクレーンアップ",' +
'"LABEL_NAMES_165": "ブリッジクレーンダウン"' +
'"LABEL_NAMES_164": "_s",' +//ブリッジクレーンアップ
'"LABEL_NAMES_165": "_s"' +//ブリッジクレーンダウン
'}],' +
'"AIFRONTBACK" : [{' +
'"LABEL_NAMES_340": "ダブルヘッドライト",' +
@ -1274,8 +1274,8 @@ var LABEL_NAMES_it_it = '{' +
'"LABEL_NAMES_161": "pesca",' +
'"LABEL_NAMES_162": "vettore",' +
'"LABEL_NAMES_163": "yacht",' +
'"LABEL_NAMES_164": "gru_a_ponte_su",' +
'"LABEL_NAMES_165": "gru_a_ponte_giù"' +
'"LABEL_NAMES_164": "_s",' +//gru_a_ponte_su
'"LABEL_NAMES_165": "_s"' +//gru_a_ponte_giù
'}],' +
'"AIFRONTBACK" : [{' +
'"LABEL_NAMES_340": "doppio_faro",' +

8
Aida/lang.js

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

70
Aida/python.html

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

126
Aida/python.min.js vendored

File diff suppressed because one or more lines are too long

22
Aida/setting.html

@ -1809,8 +1809,7 @@
&nbsp;
<textarea id="cloud_record_v2_statue" style="height: 80px;width: 450px;background-color:#F3F1F1;" readonly></textarea>
</td>
</td>
</tr>
</tbody>
</table>
</div>
@ -1977,13 +1976,13 @@
</td>
</tr>
<tr style="height: 18px;">
<td style="width: 400px; height: 18px;">
<td style="width: 450px; height: 18px;">
&nbsp;
<nobr id="IDC_STATIC_ENABLE_PYTHON_FILE"></nobr>
</td>
<td style="width: 400px; height: 18px;">
<td style="width: 500px; height: 80px;">
&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>
</tr>
</tbody>
@ -4819,10 +4818,9 @@
$('#enable_python').prop("checked", true);
else
$('#enable_python').prop("checked", false);
if (enable_python_file != null) // Ming 2024-10-01
$('#enable_python_file').val(enable_python_file);
else
$('#enable_python_file').val("No python running.");
if (enable_email_jpeg === 'Yes')
$('#enable_email_jpeg').prop("checked", true);
else
@ -5016,6 +5014,8 @@
enable_python = "No";
}
enable_python_file = $('#enable_python_file').val();
if ($('#enable_email_jpeg').is(":checked")) {
enable_email_jpeg = "Yes";
}
@ -5102,12 +5102,6 @@
}
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")) {
enable_post_only_if_both_detected = "Yes";

28
Aida/setting_on_nvr.html

@ -338,10 +338,10 @@
<td style="width: 500px; height: 18px;">
&nbsp;
<select name="getnetwork_buffer_id" id="getnetwork_buffer_id" onchange="">
<option value="0">1</option>
<option value="3">2</option>
<option value="2">3</option>
<option value="1">4</option>
<option value="0">1</option><!--0-->
<option value="1">2</option><!--3-->
<option value="2">3</option><!--2-->
<option value="3">4</option><!--1-->
</select>
</td>
</tr>
@ -398,7 +398,6 @@
<input id="enable_onvif_profile_m" type="checkbox" />
</td>
</tr>
<tr id="advanced_border_1" style="height: 18px;">
<td style="width: 350px; height: 18px;">
&nbsp;
@ -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" />
</td>
</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>
</table>
</div>
@ -2169,6 +2178,7 @@
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_FILE").innerHTML = IDC_STATIC_ENABLE_PYTHON_FILE;
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;
@ -2298,6 +2308,7 @@
var enable_email_notification = "No";
var enable_system_logs = "No";
var enable_python = "No";
var enable_python_file = "No python running"; // Ming 2024-09-27
var enable_email_jpeg = "Yes";
var email_content = "";
var email_reset_time_interval = "";
@ -4332,6 +4343,7 @@
enable_system_logs = jsonbuf["system_setting"]["enable_system_logs"];
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"];
email_reset_time_interval = jsonbuf["system_setting"]["email_reset_time_interval"];
if (email_reset_time_interval.length == 0) {
@ -4635,6 +4647,7 @@
$('#nms_thres').slider('setValue', parseInt(nms_thres, 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));
if (enable_cloud_v2 === 'Yes')
@ -4830,6 +4843,8 @@
else
$('#enable_python').prop("checked", false);
$('#enable_python_file').val(enable_python_file);
if (enable_email_jpeg === 'Yes')
$('#enable_email_jpeg').prop("checked", true);
else
@ -4981,6 +4996,7 @@
nms_thres = $('#nms_thres').slider('getValue');
tracking_id_dwell = $('#tracking_id_dwell').slider('getValue');
dwell_to_the_same_location = $('#dwell_to_the_same_location').slider('getValue');
if ($('#enable_cloud_v2').is(":checked")) {
@ -5022,6 +5038,8 @@
enable_python = "No";
}
enable_python_file = $('#enable_python_file').val();
if ($('#enable_email_jpeg').is(":checked")) {
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") {
color_type = '#FF8C00';
}
else {
else if (r_name == "car") {
color_type = '#800080';
}
}

Loading…
Cancel
Save