Browse Source

2.0.7.51_1017

master
ming.hong 1 year ago
parent
commit
2542b6d6bb
  1. 8
      Aida/airelay_init.html
  2. 24
      Aida/alarm.html
  3. 6
      Aida/alarm.js
  4. 24
      Aida/alarm_on_airelay.html
  5. 156
      Aida/alarm_on_airelay.js
  6. 20
      Aida/alarm_on_nvr.html
  7. 2
      Aida/cool_counter.html
  8. 6
      Aida/cool_counter.js
  9. 4
      Aida/face.js
  10. 2
      Aida/heatmap.html
  11. 6
      Aida/heatmap.js
  12. 11
      Aida/index.html
  13. 4
      Aida/index.js
  14. 6
      Aida/lang.js
  15. 8
      Aida/lang_cookie.js
  16. 11
      Aida/license.html
  17. 4
      Aida/lpr.js
  18. 8
      Aida/menu_on_nvr.html
  19. 9
      Aida/object_index.html
  20. 14
      Aida/ptz.html
  21. 6
      Aida/ptz.js
  22. 364
      Aida/python.html
  23. 79
      Aida/setting.html
  24. 6
      Aida/setting_on_nvr.html
  25. 2
      Aida/speed_index.html
  26. 6
      Aida/speed_index.js
  27. 6
      Aida_data/aiengine
  28. 3
      Aida_data/aiengine_initial
  29. 4
      Aida_data/config_custom_1.json
  30. 4
      Aida_data/config_custom_2.json
  31. 20
      Aida_data/config_custom_4.json
  32. 4
      Aida_data/config_custom_5.json
  33. 4
      Aida_data/config_install.json
  34. BIN
      Aida_data/different_version/SDK_2_5/gynet
  35. BIN
      Aida_data/different_version/SDK_3_0/gynet
  36. BIN
      Aida_data/gynet
  37. BIN
      Aida_data/libopencv_video.so.3.4
  38. BIN
      Aida_data/libopencv_video.so.3.4.6
  39. 15
      README.md

8
Aida/airelay_init.html

@ -594,6 +594,14 @@
//var jsonbuf = JSON.parse('{ "name":"John", "age":30, "city":"New York"}'); //var jsonbuf = JSON.parse('{ "name":"John", "age":30, "city":"New York"}');
var jsonbuf = JSON.parse(retdata); var jsonbuf = JSON.parse(retdata);
localStorage.setItem("events_default_version", jsonbuf["events_default_version"]); localStorage.setItem("events_default_version", jsonbuf["events_default_version"]);
if (localStorage.getItem('current_state_hide_or_open_label') == null) {
if (localStorage.getItem("events_default_version") != null && localStorage.getItem("events_default_version") == "4") {
localStorage.setItem('current_state_hide_or_open_label', 0);
}
else {
localStorage.setItem('current_state_hide_or_open_label', 1);
}
}
//console.info(retdata); //console.info(retdata);
}, },

24
Aida/alarm.html

@ -863,7 +863,7 @@
<input id="enable_only_show_metadata1" type="checkbox" onchange="func_set_only_show_metadata1_cookie()" /> <input id="enable_only_show_metadata1" type="checkbox" onchange="func_set_only_show_metadata1_cookie()" />
<nobr id="IDC_STATIC_ENABLE_ONLY_SHOW_METADATA1"></nobr> <nobr id="IDC_STATIC_ENABLE_ONLY_SHOW_METADATA1"></nobr>
&nbsp; &nbsp;
<input id="hide_open_label" type="button" onclick="func_hide_open_label()" value="T" style="background:#6c87d4;border-color:#6c87d4;color:white" /> <input id="hide_open_label" type="button" onclick="func_hide_open_label()" value="T" style="background:gray;border-color:gray;color:white" />
<input id="upload_img" type="button" onclick="onAddJPG()" value="ADD JPEG" style="background:#6c87d4;border-color:#6c87d4;color:white" /> <input id="upload_img" type="button" onclick="onAddJPG()" value="ADD JPEG" style="background:#6c87d4;border-color:#6c87d4;color:white" />
<input id="hide_open_direction" type="button" onclick="func_hide_open_direction()" value="D" style="background:gray;border-color:gray;color:white" /> <input id="hide_open_direction" type="button" onclick="func_hide_open_direction()" value="D" style="background:gray;border-color:gray;color:white" />
<input id="hide_open_speed" type="button" onclick="func_hide_open_speed()" value="S" style="background:gray;border-color:gray;color:white" /> <input id="hide_open_speed" type="button" onclick="func_hide_open_speed()" value="S" style="background:gray;border-color:gray;color:white" />
@ -880,8 +880,8 @@
<nobr id="IDC_CHECK_ENABLE_UNKNOWN_OBJECT"></nobr> <nobr id="IDC_CHECK_ENABLE_UNKNOWN_OBJECT"></nobr>
<input id="btn_object" type="button" onclick="window.open('object_index.html', '_blank', 'resizable=yes,top=0,left=0,width=900,height=400');" value="Set" style="background:#6c87d4;border-color:#6c87d4;color:white" /> <input id="btn_object" type="button" onclick="window.open('object_index.html', '_blank', 'resizable=yes,top=0,left=0,width=900,height=400');" value="Set" style="background:#6c87d4;border-color:#6c87d4;color:white" />
<input id="enable_ivs_zone" type="checkbox" /> <input id="enable_ivs_zone" type="checkbox" style="display:none;"/>
<nobr id="IDC_CHECK_ENABLE_IVS_ZONE"></nobr> <nobr id="IDC_CHECK_ENABLE_IVS_ZONE" style="display:none;"></nobr>
<svg width="10" height="10"> <svg width="10" height="10">
<circle id="bar_circle" r="5" cx="5" cy="5" style="fill:blue;" /> <circle id="bar_circle" r="5" cx="5" cy="5" style="fill:blue;" />
@ -1103,10 +1103,22 @@
//document.body.style.transform = scale;// General //document.body.style.transform = scale;// General
//document.body.style.zoom = "100%"; //document.body.style.zoom = "100%";
if (localStorage.getItem('current_state_hide_or_open_label') == null) if (localStorage.getItem('current_state_hide_or_open_label') == null) {
localStorage.setItem('current_state_hide_or_open_label', 1); localStorage.setItem('current_state_hide_or_open_label', 0);
else document.getElementById("hide_open_label").style.background = "gray";
document.getElementById("hide_open_label").style.borderColor = "gray";
}
else {
current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label'); current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label');
if (current_state_hide_or_open_label == 1) {
document.getElementById("hide_open_label").style.background = "#6c87d4";
document.getElementById("hide_open_label").style.borderColor = "#6c87d4";
}
else {
document.getElementById("hide_open_label").style.background = "gray";
document.getElementById("hide_open_label").style.borderColor = "gray";
}
}
if (localStorage.getItem('current_state_hide_or_open_direction') == null) if (localStorage.getItem('current_state_hide_or_open_direction') == null)
localStorage.setItem('current_state_hide_or_open_direction', 0); localStorage.setItem('current_state_hide_or_open_direction', 0);

6
Aida/alarm.js

@ -34,7 +34,7 @@ var MAX_WIDTH = G_VIEW_CANVAS_X;
var g_check_cross = 0; var g_check_cross = 0;
var current_state_hide_or_open_label = 1; var current_state_hide_or_open_label = 0;
var current_state_hide_or_open_direction = 0; var current_state_hide_or_open_direction = 0;
var current_state_hide_or_open_speed = 0; var current_state_hide_or_open_speed = 0;
var current_state_hide_or_open_getalarmmotion = 1; var current_state_hide_or_open_getalarmmotion = 1;
@ -3269,8 +3269,8 @@ function GetAlarm(alarm_data) {
ai_json.AiEngine[i].label_name == "barcode" || ai_json.AiEngine[i].label_name == "barcode" ||
ai_json.AiEngine[i].label_name == "L._Plate_TWN") { ai_json.AiEngine[i].label_name == "L._Plate_TWN") {
if (typeof (ai_json.AiEngine[i].properties !== 'undefined')) { if (ai_json.AiEngine[i].properties) {
if (typeof (ai_json.AiEngine[i].properties.plate !== 'undefined')) { if (ai_json.AiEngine[i].properties.plate) {
var plate_name = ""; var plate_name = "";
if (ai_json.AiEngine[i].label_name == "ambulance") if (ai_json.AiEngine[i].label_name == "ambulance")
plate_name = plate_name.concat(ai_json.AiEngine[i].label_name); plate_name = plate_name.concat(ai_json.AiEngine[i].label_name);

24
Aida/alarm_on_airelay.html

@ -869,7 +869,7 @@
&nbsp; &nbsp;
<input id="hide_open_label" type="button" onclick="func_hide_open_label()" value="T" style="background:#6c87d4;border-color:#6c87d4;color:white" /> <input id="hide_open_label" type="button" onclick="func_hide_open_label()" value="T" style="background:gray;border-color:gray;color:white" />
<input id="upload_img" type="button" onclick="onAddJPG()" value="ADD JPEG" style="background:#6c87d4;border-color:#6c87d4;color:white" /> <input id="upload_img" type="button" onclick="onAddJPG()" value="ADD JPEG" style="background:#6c87d4;border-color:#6c87d4;color:white" />
<input id="hide_open_direction" type="button" onclick="func_hide_open_direction()" value="D" style="background:gray;border-color:gray;color:white" /> <input id="hide_open_direction" type="button" onclick="func_hide_open_direction()" value="D" style="background:gray;border-color:gray;color:white" />
<input id="hide_open_speed" type="button" onclick="func_hide_open_speed()" value="S" style="background:gray;border-color:gray;color:white" /> <input id="hide_open_speed" type="button" onclick="func_hide_open_speed()" value="S" style="background:gray;border-color:gray;color:white" />
@ -1004,8 +1004,8 @@
<input id="btn_object" type="button" onclick="openIVSsettins()" value="Set" style="background:#6c87d4;border-color:#6c87d4;color:white" /> <input id="btn_object" type="button" onclick="openIVSsettins()" value="Set" style="background:#6c87d4;border-color:#6c87d4;color:white" />
<br> <br>
<input id="enable_ivs_zone" type="checkbox" /> <input id="enable_ivs_zone" type="checkbox" style="display:none;"/>
<nobr id="IDC_CHECK_ENABLE_IVS_ZONE"></nobr> <nobr id="IDC_CHECK_ENABLE_IVS_ZONE" style="display:none;"></nobr>
<svg width="10" height="10"> <svg width="10" height="10">
<circle id="bar_circle" r="5" cx="5" cy="5" style="fill:blue;" /> <circle id="bar_circle" r="5" cx="5" cy="5" style="fill:blue;" />
</svg> </svg>
@ -1259,10 +1259,22 @@
//document.body.style.transform = scale;// General //document.body.style.transform = scale;// General
//document.body.style.zoom = "100%"; //document.body.style.zoom = "100%";
if (localStorage.getItem('current_state_hide_or_open_label') == null) if (localStorage.getItem('current_state_hide_or_open_label') == null) {
localStorage.setItem('current_state_hide_or_open_label', 1); localStorage.setItem('current_state_hide_or_open_label', 0);
else document.getElementById("hide_open_label").style.background = "gray";
document.getElementById("hide_open_label").style.borderColor = "gray";
}
else {
current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label'); current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label');
if (current_state_hide_or_open_label == 1) {
document.getElementById("hide_open_label").style.background = "#6c87d4";
document.getElementById("hide_open_label").style.borderColor = "#6c87d4";
}
else {
document.getElementById("hide_open_label").style.background = "gray";
document.getElementById("hide_open_label").style.borderColor = "gray";
}
}
if (localStorage.getItem('current_state_hide_or_open_direction') == null) if (localStorage.getItem('current_state_hide_or_open_direction') == null)
localStorage.setItem('current_state_hide_or_open_direction', 0); localStorage.setItem('current_state_hide_or_open_direction', 0);

156
Aida/alarm_on_airelay.js

@ -41,7 +41,7 @@ var MAX_WIDTH = G_VIEW_CANVAS_X;
var g_check_cross = 0; var g_check_cross = 0;
var current_state_hide_or_open_label = 1; var current_state_hide_or_open_label = 0;
var current_state_hide_or_open_direction = 0; var current_state_hide_or_open_direction = 0;
var current_state_hide_or_open_speed = 0; var current_state_hide_or_open_speed = 0;
var current_state_hide_or_open_getalarmmotion = 1; var current_state_hide_or_open_getalarmmotion = 1;
@ -3704,8 +3704,8 @@ function GetAlarm(alarm_data) {
try { try {
if (typeof (ai_json.AiEngine[i].properties !== 'undefined')) { if (ai_json.AiEngine[i].properties) {
if (typeof (ai_json.AiEngine[i].properties.plate !== 'undefined')) { if (ai_json.AiEngine[i].properties.plate) {
var plate_name = ""; var plate_name = "";
if (ai_json.AiEngine[i].label_name == "ambulance") if (ai_json.AiEngine[i].label_name == "ambulance")
plate_name = plate_name.concat(ai_json.AiEngine[i].label_name); plate_name = plate_name.concat(ai_json.AiEngine[i].label_name);
@ -5179,6 +5179,10 @@ function func_checkGetRequest() {
var counter = 0; var counter = 0;
var max_retry_time = 20; var max_retry_time = 20;
if (g_getalarmmotion_last_fetch_time == null) {
g_getalarmmotion_last_fetch_time = Date.now();
}
if (checkIntervalID) { if (checkIntervalID) {
clearInterval(checkIntervalID); clearInterval(checkIntervalID);
} }
@ -5199,11 +5203,13 @@ function func_checkGetRequest() {
}, checkIntervalTime) }, checkIntervalTime)
} }
var g_decoder = new TextDecoder('utf-8');
function GetRequest_Http_80port_fetch() { function GetRequest_Http_80port_fetch() {
// console.log("[GetRequest_Http_80port_fetch] start"); // console.log("[GetRequest_Http_80port_fetch] start");
localStorage.setItem("fetchHttpGetalarm", "Yes"); localStorage.setItem("fetchHttpGetalarm", "Yes");
if (g_getalarmmotion_last_fetch_time == null) {
g_getalarmmotion_last_fetch_time = Date.now();
}
func_initCounterMsg(); func_initCounterMsg();
@ -5219,65 +5225,98 @@ function GetRequest_Http_80port_fetch() {
.then(response => { .then(response => {
// console.log(response); // console.log(response);
var reader = response.body.getReader(); var reader = response.body.getReader();
var decoder = new TextDecoder('utf-8'); var lastJsonString = '';
function read() { var camTime = '';
reader.read().then(({ done, value }) => { var check_if_start_to_receive_aiengine = 0;
// 08-24 以當前傳輸間隔換算1秒能傳的次數,沒物件資訊時,以 noJsonStringCounter 判斷是否須清除殘留物件 var count_end = 0;
var fetchIntervalTime = (Date.now() - g_getalarmmotion_last_fetch_time); var check_if_receive_ok = 0;
var refreshCounterThreshold = 1000 / fetchIntervalTime; //var g_fetchIntervalTime = 50;
// console.log(`fetchIntervalTime : ${fetchIntervalTime} , refreshCounterThreshold : ${refreshCounterThreshold} , check noJsonStringCounter : ${noJsonStringCounter}`);
function read()
// 紀錄最後收到資訊的時間,以供斷線重連檢查用 {
g_getalarmmotion_last_fetch_time = Date.now(); //console.log("Date:" + Date.now());
reader.read().then(({ done, value }) => {
if (done) { if (done) {
// console.log('http getalarmmotion complete'); // console.log('http getalarmmotion complete');
return; //return;
} }
else {
// 08-24 以當前傳輸間隔換算1秒能傳的次數,沒物件資訊時,以 noJsonStringCounter 判斷是否須清除殘留物件
var fetchIntervalTime = (Date.now() - g_getalarmmotion_last_fetch_time);
//g_fetchIntervalTime = fetchIntervalTime;
var refreshCounterThreshold = 1000 / fetchIntervalTime;
// console.log(`fetchIntervalTime : ${fetchIntervalTime} , refreshCounterThreshold : ${refreshCounterThreshold} , check noJsonStringCounter : ${noJsonStringCounter}`);
g_getalarmmotion_last_fetch_time = Date.now();
// 紀錄最後收到資訊的時間,以供斷線重連檢查用
// 處理收到的資料
var chunk = g_decoder.decode(value, { stream: true });
// console.log('Received chunk:', chunk);
var lines = chunk.split(/\r?\n/);
lines.forEach(line => {
if (line.startsWith('CamTime:')) {
lastJsonString = '';
check_if_start_to_receive_aiengine = 0;
count_end = 0;
camTime = line;
check_if_receive_ok = 0;
}
else if (line.startsWith('{"AiEngine"')) {
lastJsonString = line;
check_if_start_to_receive_aiengine = 1;
}
else if (line.length >= 2 && check_if_start_to_receive_aiengine == 1) {
lastJsonString += line;
}
else if (check_if_start_to_receive_aiengine == 1) {
count_end++;
}
});
// 處理收到的資料 if (count_end == 2) {
var chunk = decoder.decode(value, { stream: true }); check_if_receive_ok = 1;
// console.log('Received chunk:', chunk);
var lines = chunk.split(/\r?\n/);
var lastJsonString = '';
var camTime = '';
lines.forEach(line => {
if (line.startsWith('CamTime:')) {
camTime = line;
} else if (line.startsWith('{') && line.endsWith('}')) {
lastJsonString = line;
} }
});
// 不論有無 Json 字串都可能用到
var max_protected_objects = g_max_protected_objects;
if (g_enable_show_pixel === 1) {
max_protected_objects = g_max_protected_objects + 2;
}
if (lastJsonString) { // 不論有無 Json 字串都可能用到
// 80 port getalarmmotion 有物件才會有JSON字串,清理 canvas 要提早到這邊 var max_protected_objects = g_max_protected_objects;
// 加入 click_mouse_set 條件,避免導致 Cold zone 設定過程取不到座標 if (g_enable_show_pixel === 1) {
if (localStorage.getItem("fetchHttpGetalarm") == "Yes" && click_mouse_set == 0) { max_protected_objects = g_max_protected_objects + 2;
// console.log("g_max_protected_objects:", g_max_protected_objects);
RefreshCanvasObject(max_protected_objects);
noJsonStringCounter = 0;
// console.log(`--- RefreshCanvasObject for normal getalarmmotion procedure and reset noJsonStringCounter : ${noJsonStringCounter}`);
} }
var data = `${camTime}\r\n\r\n${lastJsonString}`; // 銜接原 WebSocket 傳 GetAlarm 格式
// console.log('data:\n', data); if (check_if_receive_ok == 1) {
GetAlarm(data); // 80 port getalarmmotion 有物件才會有JSON字串,清理 canvas 要提早到這邊
} else { // 加入 click_mouse_set 條件,避免導致 Cold zone 設定過程取不到座標
// 記錄沒傳 Json 字串的次數,判斷是否滿足約1秒能傳的次數,做 refresh 清除殘留物件 if (localStorage.getItem("fetchHttpGetalarm") == "Yes" && click_mouse_set == 0) {
noJsonStringCounter++; // console.log("g_max_protected_objects:", g_max_protected_objects);
if (noJsonStringCounter > refreshCounterThreshold && localStorage.getItem("fetchHttpGetalarm") == "Yes" && click_mouse_set == 0) { RefreshCanvasObject(max_protected_objects);
RefreshCanvasObject(max_protected_objects); noJsonStringCounter = 0;
noJsonStringCounter = 0; // console.log(`--- RefreshCanvasObject for normal getalarmmotion procedure and reset noJsonStringCounter : ${noJsonStringCounter}`);
// console.log(`=== RefreshCanvasObject for residual boxes and reset noJsonStringCounter : ${noJsonStringCounter}`); }
var data = `${camTime}\r\n\r\n${lastJsonString}`; // 銜接原 WebSocket 傳 GetAlarm 格式
// console.log('data:\n', data);
GetAlarm(data);
lastJsonString = '';
camTime = '';
check_if_start_to_receive_aiengine = 0;
count_end = 0;
check_if_receive_ok = 0;
} else {
if (localStorage.getItem("events_default_version") != "4")
{
// 非 Live View 版本的 udp 傳輸機制不同,要偵測沒物件情況清理 canvas
// 記錄沒傳 Json 字串的次數,判斷是否滿足約1秒能傳的次數,做 refresh 清除殘留物件
noJsonStringCounter++;
if (noJsonStringCounter > refreshCounterThreshold && localStorage.getItem("fetchHttpGetalarm") == "Yes" && click_mouse_set == 0) {
RefreshCanvasObject(max_protected_objects);
noJsonStringCounter = 0;
console.log(`=== RefreshCanvasObject for residual boxes and reset noJsonStringCounter : ${noJsonStringCounter}`);
}
}
} }
} }
read(); read();
}); });
} }
@ -5285,11 +5324,8 @@ function GetRequest_Http_80port_fetch() {
}) })
.catch(error => { .catch(error => {
// 發生錯誤後稍等一段時間再重試 // 發生錯誤後稍等一段時間再重試
try { console.error("Fetch error:", error);
setTimeout(GetRequest_Http_80port_fetch, 3000); setTimeout(GetRequest_Http_80port_fetch, 2000);
} catch (error) {
console.error(error);
}
}); });
} }

20
Aida/alarm_on_nvr.html

@ -886,7 +886,7 @@
<input id="enable_only_show_metadata1" type="checkbox" onchange="func_set_only_show_metadata1_cookie()" /> <input id="enable_only_show_metadata1" type="checkbox" onchange="func_set_only_show_metadata1_cookie()" />
<nobr id="IDC_STATIC_ENABLE_ONLY_SHOW_METADATA1"></nobr> <nobr id="IDC_STATIC_ENABLE_ONLY_SHOW_METADATA1"></nobr>
&nbsp; &nbsp;
<input id="hide_open_label" type="button" onclick="func_hide_open_label()" value="T" style="background:#6c87d4;border-color:#6c87d4;color:white;display:none;" /> <input id="hide_open_label" type="button" onclick="func_hide_open_label()" value="T" style="background:gray;border-color:gray;color:white;display:none;" />
<input id="hide_open_direction" type="button" onclick="func_hide_open_direction()" value="D" style="background:gray;border-color:gray;color:white;display:none;" /> <input id="hide_open_direction" type="button" onclick="func_hide_open_direction()" value="D" style="background:gray;border-color:gray;color:white;display:none;" />
<input id="hide_open_speed" type="button" onclick="func_hide_open_speed()" value="S" style="background:gray;border-color:gray;color:white;display:none;" /> <input id="hide_open_speed" type="button" onclick="func_hide_open_speed()" value="S" style="background:gray;border-color:gray;color:white;display:none;" />
&nbsp; &nbsp;
@ -1124,10 +1124,22 @@
//document.body.style.transform = scale;// General //document.body.style.transform = scale;// General
//document.body.style.zoom = "100%"; //document.body.style.zoom = "100%";
if (localStorage.getItem('current_state_hide_or_open_label') == null) if (localStorage.getItem('current_state_hide_or_open_label') == null) {
localStorage.setItem('current_state_hide_or_open_label', 1); localStorage.setItem('current_state_hide_or_open_label', 0);
else document.getElementById("hide_open_label").style.background = "gray";
document.getElementById("hide_open_label").style.borderColor = "gray";
}
else {
current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label'); current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label');
if (current_state_hide_or_open_label == 1) {
document.getElementById("hide_open_label").style.background = "#6c87d4";
document.getElementById("hide_open_label").style.borderColor = "#6c87d4";
}
else {
document.getElementById("hide_open_label").style.background = "gray";
document.getElementById("hide_open_label").style.borderColor = "gray";
}
}
if (localStorage.getItem('current_state_hide_or_open_direction') == null) if (localStorage.getItem('current_state_hide_or_open_direction') == null)
localStorage.setItem('current_state_hide_or_open_direction', 0); localStorage.setItem('current_state_hide_or_open_direction', 0);

2
Aida/cool_counter.html

@ -451,7 +451,7 @@
<script> <script>
if (localStorage.getItem('current_state_hide_or_open_label') == null) if (localStorage.getItem('current_state_hide_or_open_label') == null)
localStorage.setItem('current_state_hide_or_open_label', 1); localStorage.setItem('current_state_hide_or_open_label', 0);
else else
current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label'); current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label');

6
Aida/cool_counter.js

@ -12,7 +12,7 @@ var MAX_WIDTH = G_VIEW_CANVAS_X;
var g_max_protected_objects = 0; var g_max_protected_objects = 0;
var current_state_hide_or_open_label = 1; var current_state_hide_or_open_label = 0;
var current_state_hide_or_open_direction = 0; var current_state_hide_or_open_direction = 0;
var current_state_hide_or_open_speed = 0; var current_state_hide_or_open_speed = 0;
@ -777,8 +777,8 @@ function GetAlarm(alarm_data) {
ai_json.AiEngine[i].label_name == "barcode" || ai_json.AiEngine[i].label_name == "barcode" ||
ai_json.AiEngine[i].label_name == "L._Plate_TWN") { ai_json.AiEngine[i].label_name == "L._Plate_TWN") {
if (typeof (ai_json.AiEngine[i].properties !== 'undefined')) { if (ai_json.AiEngine[i].properties) {
if (typeof (ai_json.AiEngine[i].properties.plate !== 'undefined')) { if (ai_json.AiEngine[i].properties.plate) {
var plate_name = ""; var plate_name = "";
if (ai_json.AiEngine[i].label_name == "ambulance") if (ai_json.AiEngine[i].label_name == "ambulance")
plate_name = plate_name.concat(ai_json.AiEngine[i].label_name); plate_name = plate_name.concat(ai_json.AiEngine[i].label_name);

4
Aida/face.js

@ -1687,8 +1687,8 @@ function GetAnpr() {
ai_json.AiEngine[i].label_name == "barcode" || ai_json.AiEngine[i].label_name == "barcode" ||
ai_json.AiEngine[i].label_name == "L._Plate_TWN") { ai_json.AiEngine[i].label_name == "L._Plate_TWN") {
if (typeof (ai_json.AiEngine[i].properties !== 'undefined')) { if (ai_json.AiEngine[i].properties) {
if (typeof (ai_json.AiEngine[i].properties.plate !== 'undefined')) { if (ai_json.AiEngine[i].properties.plate) {
var plate_name = ""; var plate_name = "";
if (ai_json.AiEngine[i].label_name == "ambulance") if (ai_json.AiEngine[i].label_name == "ambulance")
plate_name = plate_name.concat(ai_json.AiEngine[i].label_name); plate_name = plate_name.concat(ai_json.AiEngine[i].label_name);

2
Aida/heatmap.html

@ -379,7 +379,7 @@
<script> <script>
if (localStorage.getItem('current_state_hide_or_open_label') == null) if (localStorage.getItem('current_state_hide_or_open_label') == null)
localStorage.setItem('current_state_hide_or_open_label', 1); localStorage.setItem('current_state_hide_or_open_label', 0);
else else
current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label'); current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label');

6
Aida/heatmap.js

@ -30,7 +30,7 @@ var MAX_WIDTH = G_VIEW_CANVAS_X;
var g_check_cross = 0; var g_check_cross = 0;
var current_state_hide_or_open_label = 1; var current_state_hide_or_open_label = 0;
var current_state_hide_or_open_direction = 0; var current_state_hide_or_open_direction = 0;
var current_state_hide_or_open_speed = 0; var current_state_hide_or_open_speed = 0;
@ -2334,8 +2334,8 @@ function GetAlarm(alarm_data) {
ai_json.AiEngine[i].label_name == "barcode" || ai_json.AiEngine[i].label_name == "barcode" ||
ai_json.AiEngine[i].label_name == "L._Plate_TWN") { ai_json.AiEngine[i].label_name == "L._Plate_TWN") {
if (typeof (ai_json.AiEngine[i].properties !== 'undefined')) { if (ai_json.AiEngine[i].properties) {
if (typeof (ai_json.AiEngine[i].properties.plate !== 'undefined')) { if (ai_json.AiEngine[i].properties.plate) {
var plate_name = ""; var plate_name = "";
if (ai_json.AiEngine[i].label_name == "ambulance") if (ai_json.AiEngine[i].label_name == "ambulance")
plate_name = plate_name.concat(ai_json.AiEngine[i].label_name); plate_name = plate_name.concat(ai_json.AiEngine[i].label_name);

11
Aida/index.html

@ -674,8 +674,6 @@
if (localStorage.getItem('face_list_success') == null) if (localStorage.getItem('face_list_success') == null)
localStorage.setItem('face_list_success', 'Null'); localStorage.setItem('face_list_success', 'Null');
if (localStorage.getItem('current_state_hide_or_open_label') == null)
localStorage.setItem('current_state_hide_or_open_label', 1);
if (localStorage.getItem('current_state_hide_or_open_direction') == null) if (localStorage.getItem('current_state_hide_or_open_direction') == null)
localStorage.setItem('current_state_hide_or_open_direction', 0); localStorage.setItem('current_state_hide_or_open_direction', 0);
if (localStorage.getItem('current_state_hide_or_open_speed') == null) if (localStorage.getItem('current_state_hide_or_open_speed') == null)
@ -1434,6 +1432,15 @@
localStorage.setItem("events_default_version", jsonbuf["events_default_version"]); localStorage.setItem("events_default_version", jsonbuf["events_default_version"]);
if (localStorage.getItem('current_state_hide_or_open_label') == null) {
if (localStorage.getItem("events_default_version") != null && localStorage.getItem("events_default_version") == "4") {
localStorage.setItem('current_state_hide_or_open_label', 0);
}
else {
localStorage.setItem('current_state_hide_or_open_label', 1);
}
}
if ((index_mismatch >= 2 || index_expired >= 2 || index_error >= 2 || index_empty <= 2 || index_invalid >= 2) && index_third_party <= 2 && index_radar <= 0 && index_tof < 0 && index_face <= 0) { if ((index_mismatch >= 2 || index_expired >= 2 || index_error >= 2 || index_empty <= 2 || index_invalid >= 2) && index_third_party <= 2 && index_radar <= 0 && index_tof < 0 && index_face <= 0) {
check_key_false = 1; check_key_false = 1;
} }

4
Aida/index.js

@ -1690,8 +1690,8 @@ function GetAnpr() {
ai_json.AiEngine[i].label_name == "barcode" || ai_json.AiEngine[i].label_name == "barcode" ||
ai_json.AiEngine[i].label_name == "L._Plate_TWN") { ai_json.AiEngine[i].label_name == "L._Plate_TWN") {
if (typeof (ai_json.AiEngine[i].properties !== 'undefined')) { if (ai_json.AiEngine[i].properties) {
if (typeof (ai_json.AiEngine[i].properties.plate !== 'undefined')) { if (ai_json.AiEngine[i].properties.plate) {
var plate_name = ""; var plate_name = "";
if (ai_json.AiEngine[i].label_name == "ambulance") if (ai_json.AiEngine[i].label_name == "ambulance")
plate_name = plate_name.concat(ai_json.AiEngine[i].label_name); plate_name = plate_name.concat(ai_json.AiEngine[i].label_name);

6
Aida/lang.js

@ -281,6 +281,7 @@ var LANGUAGE = '{'+
'"IDC_STATIC_SETTING_PORT": "Port #",' + '"IDC_STATIC_SETTING_PORT": "Port #",' +
'"IDC_STATIC_ENABLE_SYSTEM_LOGS": "Enable logs",' + '"IDC_STATIC_ENABLE_SYSTEM_LOGS": "Enable logs",' +
'"IDC_STATIC_ENABLE_PYTHON": "Enable python",' + '"IDC_STATIC_ENABLE_PYTHON": "Enable python",' +
'"IDC_STATIC_ENABLE_PYTHON_FILE": "Enable python file",' +
'"HTTP_TITLE01": "LPR",'+ '"HTTP_TITLE01": "LPR",'+
'"HTTP_TITLE02": "LPR LIST",'+ '"HTTP_TITLE02": "LPR LIST",'+
'"HTTP_TITLE03": "MAPPING",'+ '"HTTP_TITLE03": "MAPPING",'+
@ -1036,7 +1037,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 檔案",' +
'"HTTP_TITLE01": "車牌辨識",'+ '"HTTP_TITLE01": "車牌辨識",'+
'"HTTP_TITLE02": "車牌辨識清單",'+ '"HTTP_TITLE02": "車牌辨識清單",'+
'"HTTP_TITLE03": "車牌轉換表",'+ '"HTTP_TITLE03": "車牌轉換表",'+
@ -1788,6 +1790,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 アーカイブを有効にする",'+
'"HTTP_TITLE01": "ナンバープレート",'+ '"HTTP_TITLE01": "ナンバープレート",'+
'"HTTP_TITLE02": "LPR リスト",'+ '"HTTP_TITLE02": "LPR リスト",'+
'"HTTP_TITLE03": "リンクデータベース",'+ '"HTTP_TITLE03": "リンクデータベース",'+
@ -2526,6 +2529,7 @@ var LANGUAGE = '{'+
'"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",' +
'"HTTP_TITLE01": "LPR",'+ '"HTTP_TITLE01": "LPR",'+
'"HTTP_TITLE02": "LPR LISTA",'+ '"HTTP_TITLE02": "LPR LISTA",'+
'"HTTP_TITLE03": "MAPPING",'+ '"HTTP_TITLE03": "MAPPING",'+

8
Aida/lang_cookie.js

@ -240,6 +240,7 @@ var select_lang = '';
var IDC_STATIC_ENABLE_SYSTEM_LOGS = ''; var IDC_STATIC_ENABLE_SYSTEM_LOGS = '';
var IDC_STATIC_ENABLE_PYTHON = ''; var IDC_STATIC_ENABLE_PYTHON = '';
var IDC_STATIC_ENABLE_PYTHON_FILE = '';
var MESSAGE08 = ''; var MESSAGE08 = '';
var MESSAGE59 = ''; var MESSAGE59 = '';
@ -449,7 +450,7 @@ var IDC_STATIC_COLUMN_B_MAPPING_TABLE = '';
var IDC_STATIC_EXPORT_LPR_MAPPING_LIST = ''; var IDC_STATIC_EXPORT_LPR_MAPPING_LIST = '';
var IDC_STATIC_IMPORT_LPR_MAPPING_LIST = ''; var IDC_STATIC_IMPORT_LPR_MAPPING_LIST = '';
var MAX_SIZE_IDC_LIST_TRIGGER_EVENTS = 23;//¹w³] 21 //15 //10 var MAX_SIZE_IDC_LIST_TRIGGER_EVENTS = 23;//<EFBFBD>w<EFBFBD>] 21 //15 //10
var IDC_LIST_TRIGGER_EVENTS = new Array(MAX_SIZE_IDC_LIST_TRIGGER_EVENTS); var IDC_LIST_TRIGGER_EVENTS = new Array(MAX_SIZE_IDC_LIST_TRIGGER_EVENTS);
var MAX_BORDER_UNIT = 5; var MAX_BORDER_UNIT = 5;
@ -882,6 +883,7 @@ function func_get_lang_cookie() {
IDC_STATIC_ENABLE_SYSTEM_LOGS = json_lang.en_gb[0].IDC_STATIC_ENABLE_SYSTEM_LOGS; IDC_STATIC_ENABLE_SYSTEM_LOGS = json_lang.en_gb[0].IDC_STATIC_ENABLE_SYSTEM_LOGS;
IDC_STATIC_ENABLE_PYTHON = json_lang.en_gb[0].IDC_STATIC_ENABLE_PYTHON; IDC_STATIC_ENABLE_PYTHON = json_lang.en_gb[0].IDC_STATIC_ENABLE_PYTHON;
IDC_STATIC_ENABLE_PYTHON_FILE = json_lang.en_gb[0].IDC_STATIC_ENABLE_PYTHON_FILE;
MESSAGE08 = json_lang.en_gb[0].MESSAGE08; MESSAGE08 = json_lang.en_gb[0].MESSAGE08;
MESSAGE59 = json_lang.en_gb[0].MESSAGE59; MESSAGE59 = json_lang.en_gb[0].MESSAGE59;
@ -1526,6 +1528,7 @@ function func_get_lang_cookie() {
IDC_STATIC_ENABLE_SYSTEM_LOGS = json_lang.zh_tw[0].IDC_STATIC_ENABLE_SYSTEM_LOGS; IDC_STATIC_ENABLE_SYSTEM_LOGS = json_lang.zh_tw[0].IDC_STATIC_ENABLE_SYSTEM_LOGS;
IDC_STATIC_ENABLE_PYTHON = json_lang.zh_tw[0].IDC_STATIC_ENABLE_PYTHON; IDC_STATIC_ENABLE_PYTHON = json_lang.zh_tw[0].IDC_STATIC_ENABLE_PYTHON;
IDC_STATIC_ENABLE_PYTHON_FILE = json_lang.zh_tw[0].IDC_STATIC_ENABLE_PYTHON_FILE;
MESSAGE08 = json_lang.zh_tw[0].MESSAGE08; MESSAGE08 = json_lang.zh_tw[0].MESSAGE08;
MESSAGE59 = json_lang.zh_tw[0].MESSAGE59; MESSAGE59 = json_lang.zh_tw[0].MESSAGE59;
@ -2148,6 +2151,7 @@ function func_get_lang_cookie() {
IDC_STATIC_ENABLE_SYSTEM_LOGS = json_lang.ja_jp[0].IDC_STATIC_ENABLE_SYSTEM_LOGS; IDC_STATIC_ENABLE_SYSTEM_LOGS = json_lang.ja_jp[0].IDC_STATIC_ENABLE_SYSTEM_LOGS;
IDC_STATIC_ENABLE_PYTHON = json_lang.ja_jp[0].IDC_STATIC_ENABLE_PYTHON; IDC_STATIC_ENABLE_PYTHON = json_lang.ja_jp[0].IDC_STATIC_ENABLE_PYTHON;
IDC_STATIC_ENABLE_PYTHON_FILE = json_lang.ja_jp[0].IDC_STATIC_ENABLE_PYTHON_FILE;
MESSAGE08 = json_lang.ja_jp[0].MESSAGE08; MESSAGE08 = json_lang.ja_jp[0].MESSAGE08;
MESSAGE59 = json_lang.ja_jp[0].MESSAGE59; MESSAGE59 = json_lang.ja_jp[0].MESSAGE59;
@ -2770,6 +2774,7 @@ function func_get_lang_cookie() {
IDC_STATIC_ENABLE_SYSTEM_LOGS = json_lang.it_it[0].IDC_STATIC_ENABLE_SYSTEM_LOGS; IDC_STATIC_ENABLE_SYSTEM_LOGS = json_lang.it_it[0].IDC_STATIC_ENABLE_SYSTEM_LOGS;
IDC_STATIC_ENABLE_PYTHON = json_lang.it_it[0].IDC_STATIC_ENABLE_PYTHON; IDC_STATIC_ENABLE_PYTHON = json_lang.it_it[0].IDC_STATIC_ENABLE_PYTHON;
IDC_STATIC_ENABLE_PYTHON_FILE = json_lang.it_it[0].IDC_STATIC_ENABLE_PYTHON_FILE;
MESSAGE08 = json_lang.it_it[0].MESSAGE08; MESSAGE08 = json_lang.it_it[0].MESSAGE08;
MESSAGE59 = json_lang.it_it[0].MESSAGE59; MESSAGE59 = json_lang.it_it[0].MESSAGE59;
@ -3377,6 +3382,7 @@ function func_get_lang_cookie() {
IDC_STATIC_ENABLE_SYSTEM_LOGS = json_lang.en_gb[0].IDC_STATIC_ENABLE_SYSTEM_LOGS; IDC_STATIC_ENABLE_SYSTEM_LOGS = json_lang.en_gb[0].IDC_STATIC_ENABLE_SYSTEM_LOGS;
IDC_STATIC_ENABLE_PYTHON = json_lang.en_gb[0].IDC_STATIC_ENABLE_PYTHON; IDC_STATIC_ENABLE_PYTHON = json_lang.en_gb[0].IDC_STATIC_ENABLE_PYTHON;
IDC_STATIC_ENABLE_PYTHON_FILE = json_lang.en_gb[0].IDC_STATIC_ENABLE_PYTHON_FILE;
MESSAGE08 = json_lang.en_gb[0].MESSAGE08; MESSAGE08 = json_lang.en_gb[0].MESSAGE08;
MESSAGE59 = json_lang.en_gb[0].MESSAGE59; MESSAGE59 = json_lang.en_gb[0].MESSAGE59;

11
Aida/license.html

@ -256,8 +256,13 @@
//func_getOTAinfo(); //func_getOTAinfo();
function func_getaboutinfo() { function func_getaboutinfo() {
if (localStorage.getItem("unlock_key") == "auto") {
$('#unlocking_key').val("");
}
else {
$('#unlocking_key').val(localStorage.getItem("unlock_key"));
}
$('#unlocking_key').val(localStorage.getItem("unlock_key"));
$('#sys_id').val(localStorage.getItem("sys_id")); $('#sys_id').val(localStorage.getItem("sys_id"));
$('#dataset_ver').val(localStorage.getItem("dataset_ver")); $('#dataset_ver').val(localStorage.getItem("dataset_ver"));
@ -370,6 +375,10 @@
function func_setkeyinfo() { function func_setkeyinfo() {
var data = new Object(); var data = new Object();
data.unlocking_key = $('#unlocking_key').val().trim(); data.unlocking_key = $('#unlocking_key').val().trim();
if (data.unlocking_key.length == 0) {
data.unlocking_key = "auto";
}
/* /*
if (data.unlocking_key.length <= 4) { if (data.unlocking_key.length <= 4) {
data.unlocking_key = "None"; data.unlocking_key = "None";

4
Aida/lpr.js

@ -266,8 +266,8 @@ function GetAnpr() {
ai_json.AiEngine[i].label_name == "barcode" || ai_json.AiEngine[i].label_name == "barcode" ||
ai_json.AiEngine[i].label_name == "L._Plate_TWN") { ai_json.AiEngine[i].label_name == "L._Plate_TWN") {
if (typeof (ai_json.AiEngine[i].properties !== 'undefined')) { if (ai_json.AiEngine[i].properties) {
if (typeof (ai_json.AiEngine[i].properties.plate !== 'undefined')) { if (ai_json.AiEngine[i].properties.plate) {
var plate_name = ""; var plate_name = "";
if (ai_json.AiEngine[i].label_name == "ambulance") if (ai_json.AiEngine[i].label_name == "ambulance")
plate_name = plate_name.concat(ai_json.AiEngine[i].label_name); plate_name = plate_name.concat(ai_json.AiEngine[i].label_name);

8
Aida/menu_on_nvr.html

@ -53,6 +53,14 @@
var index_tof = license_type_temp.indexOf("ToF"); var index_tof = license_type_temp.indexOf("ToF");
localStorage.setItem("events_default_version", jsonbuf["events_default_version"]); localStorage.setItem("events_default_version", jsonbuf["events_default_version"]);
if (localStorage.getItem('current_state_hide_or_open_label') == null) {
if (localStorage.getItem("events_default_version") != null && localStorage.getItem("events_default_version") == "4") {
localStorage.setItem('current_state_hide_or_open_label', 0);
}
else {
localStorage.setItem('current_state_hide_or_open_label', 1);
}
}
if ((index_mismatch >= 2 || index_expired >= 2 || index_error >= 2 || index_empty <= 2 || index_invalid >= 2) && index_third_party <= 2 && index_radar <= 0 && index_tof < 0) { if ((index_mismatch >= 2 || index_expired >= 2 || index_error >= 2 || index_empty <= 2 || index_invalid >= 2) && index_third_party <= 2 && index_radar <= 0 && index_tof < 0) {
check_key_false = 1; check_key_false = 1;

9
Aida/object_index.html

@ -277,13 +277,13 @@
<!-- <table valign="center" style="border-collapse: collapse; width: 300px; height: 160px;" border="0"> --> <!-- <table valign="center" style="border-collapse: collapse; width: 300px; height: 160px;" border="0"> -->
<table align="center" valign="center" style="border-collapse: collapse; width: 500px; height: auto; "> <table align="center" valign="center" style="border-collapse: collapse; width: 500px; height: auto; ">
<tbody> <tbody>
<tr style="height: 20px;"> <tr style="height: 20px;display:none;">
<td style="width: 200px; height: 20px;" id="IDC_CHECK_ENABLE_SHOW_UNKNOWN_OBJECT">&nbsp;</td> <td style="width: 200px; height: 20px;" id="IDC_CHECK_ENABLE_SHOW_UNKNOWN_OBJECT">&nbsp;</td>
<td style="width: 300px; height: 20px;"> <td style="width: 300px; height: 20px;">
&nbsp;<input id="enable_show_unknown_object" type="checkbox" /> &nbsp;<input id="enable_show_unknown_object" type="checkbox" />
</td> </td>
</tr> </tr>
<tr style="height: 20px;"> <tr style="height: 20px;display:none;">
<td style="width: 200px; height: 20px;" id="IDC_CHECK_ENABLE_IVS_AND_AI">&nbsp;</td> <td style="width: 200px; height: 20px;" id="IDC_CHECK_ENABLE_IVS_AND_AI">&nbsp;</td>
<td style="width: 300px; height: 20px;"> <td style="width: 300px; height: 20px;">
&nbsp;<input id="enable_ivs_and_ai" type="checkbox" /> &nbsp;<input id="enable_ivs_and_ai" type="checkbox" />
@ -331,6 +331,7 @@
<option value="0">IVS Fusion Mode</option> <option value="0">IVS Fusion Mode</option>
<option value="1">Thermal Mode</option> <option value="1">Thermal Mode</option>
<option value="2">Ex</option> <option value="2">Ex</option>
<option value="3">MOG2</option>
</select> </select>
</td> </td>
</tr> </tr>
@ -485,7 +486,7 @@
var enable_ivs_and_ai = "No"; var enable_ivs_and_ai = "No";
var enable_ivs_person_detection = "No"; var enable_ivs_person_detection = "No";
var enable_ivs_fix_mode = "No"; var enable_ivs_fix_mode = "No";
var unknown_object_max_proportion = "10"; var unknown_object_max_proportion = "20";
var unknown_object_min_proportion = "0"; var unknown_object_min_proportion = "0";
var confidence_unknown_object = "0"; var confidence_unknown_object = "0";
var confidence2_unknown_object = "0"; var confidence2_unknown_object = "0";
@ -512,7 +513,7 @@
var no_parking_time = new Array(MAX_DETECTION_ZONE); var no_parking_time = new Array(MAX_DETECTION_ZONE);
var assign_ivs_object_to = "NULL"; var assign_ivs_object_to = "NULL";
var ivs_mode = "0"; var ivs_mode = "3";
{ {
for (var i = 0; i < MAX_DETECTION_ZONE; i++) { for (var i = 0; i < MAX_DETECTION_ZONE; i++) {

14
Aida/ptz.html

@ -481,7 +481,7 @@
} }
if (localStorage.getItem('current_state_hide_or_open_label') == null) if (localStorage.getItem('current_state_hide_or_open_label') == null)
localStorage.setItem('current_state_hide_or_open_label', 1); localStorage.setItem('current_state_hide_or_open_label', 0);
else else
current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label'); current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label');
@ -1765,6 +1765,18 @@
} }
} }
if (enable_tracking === 'Yes') {
document.getElementById("IDC_STATIC_STOP_TRACKING").style.background = "gray";
document.getElementById("IDC_STATIC_STOP_TRACKING").style.borderColor = "gray";
document.getElementById("IDC_STATIC_START_TRACKING").style.background = "#6c87d4";
document.getElementById("IDC_STATIC_START_TRACKING").style.borderColor = "#6c87d4";
}
else {
document.getElementById("IDC_STATIC_STOP_TRACKING").style.background = "#6c87d4";
document.getElementById("IDC_STATIC_STOP_TRACKING").style.borderColor = "#6c87d4";
document.getElementById("IDC_STATIC_START_TRACKING").style.background = "gray";
document.getElementById("IDC_STATIC_START_TRACKING").style.borderColor = "gray";
}
//console.info(retdata); //console.info(retdata);
}, },
error: function (retdata) { error: function (retdata) {

6
Aida/ptz.js

@ -28,7 +28,7 @@ var G_VIEW_CANVAS_Y = 320;
var MAX_HEIGHT = G_VIEW_CANVAS_Y; var MAX_HEIGHT = G_VIEW_CANVAS_Y;
var MAX_WIDTH = G_VIEW_CANVAS_X; var MAX_WIDTH = G_VIEW_CANVAS_X;
var current_state_hide_or_open_label = 1; var current_state_hide_or_open_label = 0;
var current_state_hide_or_open_direction = 0; var current_state_hide_or_open_direction = 0;
var current_state_hide_or_open_speed = 0; var current_state_hide_or_open_speed = 0;
@ -1696,8 +1696,8 @@ function Getptz() {
ai_json.AiEngine[i].label_name == "barcode" || ai_json.AiEngine[i].label_name == "barcode" ||
ai_json.AiEngine[i].label_name == "L._Plate_TWN") { ai_json.AiEngine[i].label_name == "L._Plate_TWN") {
if (typeof (ai_json.AiEngine[i].properties !== 'undefined')) { if (ai_json.AiEngine[i].properties) {
if (typeof (ai_json.AiEngine[i].properties.plate !== 'undefined')) { if (ai_json.AiEngine[i].properties.plate) {
var plate_name = ""; var plate_name = "";
if (ai_json.AiEngine[i].label_name == "ambulance") if (ai_json.AiEngine[i].label_name == "ambulance")
plate_name = plate_name.concat(ai_json.AiEngine[i].label_name); plate_name = plate_name.concat(ai_json.AiEngine[i].label_name);

364
Aida/python.html

@ -200,7 +200,7 @@
<button id="uploadfile-button" <button id="uploadfile-button"
style="color: white; border: none; text-align: center; cursor: pointer;" style="color: white; border: none; text-align: center; cursor: pointer;"
title="Upload File"> title="Upload File">
<img src="./images/uploadfile.png" alt="Upload" onclick="func_FileUpload()" <img src="./images/uploadfile.png" alt="Upload"
style="height: 26px; width: 26px; vertical-align: middle; margin-right: 5px;"> style="height: 26px; width: 26px; vertical-align: middle; margin-right: 5px;">
</button> </button>
<button id="refreshfile-button" <button id="refreshfile-button"
@ -273,27 +273,46 @@
</div> </div>
<script> <script>
var BufferSize = 512; // Buffer 最大 Row 數
var getPythonBufferIntervalTime = 50;
var getPythonStatusIntervalTime = 50;
var receivedCountThreshold = 37500 / getPythonStatusIntervalTime
var dataReceivedCount = 0;
var getPythonBufferSize = 64;
var getBufferStatusTemp = null;
var getBufferSignal = null;
//var displayDataCounter = 0;
var currentRunningFile = ''; // temp running file name
var g_isPythonRunning = 0;
var pythoncode = ""
var currentFileName = '';
// 初始化為 null,確保 intervalId 定義過
var intervalId = null; // Ming add 2024/08/22
var autoScroll = true; // Ming 2024-08-29
var isUserScrolling = false; // Ming 2024-08-29
Status_intervalId = null;
// 取得語系 // 取得語系
func_get_lang_cookie(); func_get_lang_cookie();
// 檔案列表
func_getFileList(null);
// func_getPythonStatus();
// 當網頁加載完成後自動載入 hello.py // 當網頁加載完成後自動載入 hello.py
window.onload = function() { // Ming add 2024/08/22 window.onload = function() { // Ming add 2024/08/22
// 自動加載並顯示 hello.py 的內容 // 自動加載並顯示 hello.py 的內容
currentFileName = 'hello.py'; currentFileName = 'hello.py';
func_FileGet(currentFileName); func_FileGet(currentFileName);
// 加載文件列表並選中 hello.py // 加載文件列表並選中 hello.py
func_getFileList(currentFileName); func_getFileList(currentFileName);
// func_getPythonBuffer();
// 確認之前執行狀態
func_enablePythonfile();
// 確認有無回傳的資料
func_getPythonStatus();
}; };
var currentFileName = '';
// 初始化為 null,確保 intervalId 定義過
var intervalId = null; // Ming add 2024/08/22
var autoScroll = true; // Ming 2024-08-29
var isUserScrolling = false; // Ming 2024-08-29
// 取得資料夾中的所有檔案名稱 // 取得資料夾中的所有檔案名稱
function func_getFileList(pyFileName) { function func_getFileList(pyFileName) {
console.log('in get file list'); console.log('in get file list');
@ -350,10 +369,45 @@
} }
}); });
} }
// 儲存文件內容
function func_FileSave(file_name) {
var pyFileName = file_name;
pythoncode = $('#code-editor textarea').val();
var encoded = encodeURIComponent(pythoncode);
console.log("func_FileSave pyFileName ---------- ",pyFileName)
$.ajax({
url: "/pythonsave?file=" + pyFileName + "&code=" + encoded,
method: "GET",
async: true,
beforeSend: function (xmlHttp) {
xmlHttp.setRequestHeader("If-Modified-Since", "0");
xmlHttp.setRequestHeader("Cache-Control", "no-cache");
},
success: function (response) {
console.log("response: ", response);
// 如果更新成功,則更新列表
if (response === "File save successfully") {
$('#console').append("Saving successfully");
$('#console').append('&#13;&#10;'); // 換行
func_getFileList(pyFileName);
} else {
Swal.fire({
title: 'Error!',
text: response,
icon: 'error',
confirmButtonText: 'OK'
});
}
},
error: function () {
console.warn(retdata);
}
});
return false;
}
// 更新文件內容 // 更新文件內容
function func_FileUpload(file_name) { function func_FileUpload(file_name) {
var pyFileName = file_name; var pyFileName = file_name;
var pythoncode = $('#code-editor textarea').val();
var encoded = encodeURIComponent(pythoncode); var encoded = encodeURIComponent(pythoncode);
console.log("func_FileUpload pyFileName ---------- ",pyFileName) console.log("func_FileUpload pyFileName ---------- ",pyFileName)
$.ajax({ $.ajax({
@ -396,13 +450,14 @@
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); xmlHttp.setRequestHeader("Cache-Control", "no-cache");
}, },
success: function (retdata) { success: function (retdata) {
currentFileName = '';
// 直接刷新文件列表,無需指定 Index 刪除行 // 直接刷新文件列表,無需指定 Index 刪除行
func_getFileList(pyFileNmae); // 2024/08/22 Ming add
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';
func_getFileList(currentFileName); // 2024/08/22 Ming add
}, },
error: function () { error: function () {
console.warn(); console.warn();
@ -412,6 +467,23 @@
// 停止 Python 檔案 // 停止 Python 檔案
function func_stopPython(file_name) { function func_stopPython(file_name) {
console.log("func_stopPython"); 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);
var rows = $('#file-data-grid').datagrid('getRows'); // 取得所有行的資料
rows.forEach(function (row, index) {
var $row = $('#file-data-grid').datagrid('getPanel').find('tr[datagrid-row-index="' + index + '"]');
$row.find('td[field="filename"] img').attr('src', './images/py.png');
});
$.ajax({ $.ajax({
url: "/stoppython", url: "/stoppython",
method: "GET", method: "GET",
@ -441,7 +513,6 @@
function func_convertSpecialChars(retdata) { function func_convertSpecialChars(retdata) {
// 將特殊字元轉換為 Web 可解析的形式 // 將特殊字元轉換為 Web 可解析的形式
var result = ''; var result = '';
for (var i = 0; i < retdata.length; i++) { for (var i = 0; i < retdata.length; i++) {
const char = retdata[i]; const char = retdata[i];
@ -469,25 +540,22 @@
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;");
} }
var BufferSize = 512; // Buffer 最大 Row 數
var getPythonBufferIntervalTime = 50;
var getPythonStatusIntervalTime = 50;
var receivedCountThreshold = 1000 / getPythonStatusIntervalTime
var dataReceivedCount = 0;
var getPythonBufferSize = 64;
var getBufferStatusTemp = null;
var getBufferSignal = null;
//var displayDataCounter = 0;
// 取得 Python 執行狀態 // 取得 Python 執行狀態
function func_getPythonStatus(){ function func_getPythonStatus(){
console.log("func_getPythonStatus"); console.log("func_getPythonStatus");
if (Status_intervalId !== null) {
clearInterval(Status_intervalId);
Status_intervalId = null;
}
Status_intervalId = setInterval(function () { Status_intervalId = setInterval(function () {
$.ajax({ $.ajax({
url: "/pythongetstatus", url: "/pythongetstatus",
method: "GET", method: "GET",
async: true, async: true,
success: function (retdata) { success: function (retdata) {
console.log("-------------------",currentRunningFile);
updateFileIcon();
// console.log("GET Status Succeeded."); // console.log("GET Status Succeeded.");
// console.log("--------------dataReceivedCount--------------",dataReceivedCount) // console.log("--------------dataReceivedCount--------------",dataReceivedCount)
if (dataReceivedCount >= receivedCountThreshold) { if (dataReceivedCount >= receivedCountThreshold) {
@ -497,35 +565,39 @@
g_isPythonRunning = 0; g_isPythonRunning = 0;
clearInterval(Status_intervalId); clearInterval(Status_intervalId);
Status_intervalId = null; Status_intervalId = null;
// 開啟 Run // 開啟 Run
$("#run-button").prop("disabled", false); $("#run-button").prop("disabled", false);
} }
dataReceivedCount = 0; dataReceivedCount = 0;
} }
try
if (g_isPythonRunning == 1) {
{
var existData = $('#console').html(); var existData = $('#console').html();
console.log("Get Status: ", retdata); console.log("Get Status: ", retdata);
var displayData = func_convertSpecialChars(retdata); var displayData = func_convertSpecialChars(retdata);
//console.log("Get displayData: ", displayData); var data = JSON.parse(displayData);
try { getBufferStatusTemp = parseInt(data['status']);
var data = JSON.parse(displayData); getBufferSignal = parseInt(data['bufferSignal']);
getBufferStatusTemp = parseInt(data['status']); console.log('getBufferStatusTemp',getBufferStatusTemp);
getBufferSignal = parseInt(data['bufferSignal']); console.log('getBufferSignal',getBufferSignal);
console.log('getBufferStatusTemp',getBufferStatusTemp);
console.log('getBufferSignal',getBufferSignal); } catch (error) {
if (getBufferStatusTemp == 2) console.log(error);
{ }
func_getPythonBuffer(); if (g_isPythonRunning == 1 || getBufferStatusTemp == 2)
} {
func_getPythonBuffer();
} catch (error) { }
console.log(error); else if (g_isPythonRunning = 0 || getBufferSignal == 0) // python finish or stop need to clear file
} {
var json_data = '{';
} json_data += '"system_setting": {';
json_data += '"enable_python_file": "' + 'No python running' + '"';
json_data += '}';
json_data += '}';
func_setconfigfile(json_data);
currentRunningFile = ''
}
dataReceivedCount++; dataReceivedCount++;
}, },
error: function (xhr, textStatus, errorThrown) { error: function (xhr, textStatus, errorThrown) {
@ -594,23 +666,45 @@
} }
} }
var g_isPythonRunning = 0;
Status_intervalId = null; // 更改檔案圖示
function updateFileIcon() {
var rows = $('#file-data-grid').datagrid('getRows'); // 取得所有行的資料
rows.forEach(function (row, index) {
var $row = $('#file-data-grid').datagrid('getPanel').find('tr[datagrid-row-index="' + index + '"]');
if (row.filename.endsWith('.py')) { // 只對 .py 檔案進行操作
if (row.filename === currentRunningFile) {
// 如果是正在執行的檔案,顯示播放圖示
$row.find('td[field="filename"] img').attr('src', './images/play.png');
} else {
// 否則,顯示 py.png 圖示
$row.find('td[field="filename"] img').attr('src', './images/py.png');
}
}
});
}
function func_runPython(file_name) { function func_runPython(file_name) {
func_getPythonStatus(); func_getPythonStatus();
g_isPythonRunning = 1;
currentRunningFile = file_name;
console.log("currentFileName",currentFileName);
var json_data = '{';
json_data += '"system_setting": {';
json_data += '"enable_python_file": "' + currentRunningFile + '"';
json_data += '}';
json_data += '}';
func_setconfigfile(json_data);
console.log("func_runPython"); console.log("func_runPython");
autoScroll = true; autoScroll = true;
var python_content = $('#code-textarea').val(); var python_content = $('#code-textarea').val();
var json_data = "lifile_liname=" + file_name + ",lipython_licontent=" + python_content; var json_data = "lifile_liname=" + file_name;
console.log(file_name); console.log(file_name);
var emptyCount = 0; updateFileIcon();
var previousData = [];
g_isPythonRunning = 1;
$.ajax({ $.ajax({
url: "/sendpycode", url: "/sendpycode",
method: "POST", method: "POST",
@ -625,9 +719,9 @@
success: function (retdata) { success: function (retdata) {
console.log("[/sendpycode] retdata:", retdata); // 2024/08/21 console.log("[/sendpycode] retdata:", retdata); // 2024/08/21
// resolve(retdata); // resolve(retdata);
// $('#console').text("Running.....\n"); // $('#console').text("Running.....\n");
}, },
error: function (retdata) { error: function (retdata) {
console.error("GET request failed: ", retdata); //2024/08/21 console.error("GET request failed: ", retdata); //2024/08/21
// reject(retdata); // reject(retdata);
@ -636,52 +730,77 @@
return false; return false;
} }
function func_setconfigfile(json_data) {
$.ajax({
url: "/setconfigfile",
method: "POST",
async: false,
data: json_data,
contentType: false,
processData: false,
beforeSend: function (xmlHttp) {
xmlHttp.setRequestHeader("If-Modified-Since", "0");
xmlHttp.setRequestHeader("Cache-Control", "no-cache");
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
},
success: function () {
//console.info();
},
error: function () {
console.warn();
k_index++;
if (k_index <= 94) {
waitSeconds(500);
func_setconfigfile(json_data);
}
}
});
return false;
}
// enable_python = "Yes" 則開啟上次未執行完成的 python file
function func_enablePythonfile() { // Ming 2024-10-04
$.ajax({
url: "/getconfigfile?ch=all",
type: "GET",
async: true,
beforeSend: function (xmlHttp) {
xmlHttp.setRequestHeader("If-Modified-Since", "0");
xmlHttp.setRequestHeader("Cache-Control", "no-cache");
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
},
success: function (retdata) {
var jsonbuf = JSON.parse(retdata);
if ("enable_python_file" in jsonbuf["system_setting"]) {
currentRunningFile = jsonbuf["system_setting"]["enable_python_file"];
g_isPythonRunning = 1;
if (currentRunningFile.endsWith('.py'))
{
$('#console').html("Execute unfinished python file !!");
$('#console').append('&#13;&#10;'); // 換行
$('#console').append("Running...");
$('#console').append('&#13;&#10;'); // 換行
console.log("找到可執行 Python 檔案 !!!!!!!!!!!!!! ");
}
else
{
console.log("未找到可執行 Python 檔案 !!!!!!!!!!!!!! ");
}
} else {
console.log("未找到 enable_python_file 設置");
}
},
error: function (retdata) {
// setTimeout(func_enablePythonfile(), 3000);
console.warn(retdata);
}
});
}
// 新建檔案
// upload python file (uncomplete)
function addNewFile() { function addNewFile() {
var $grid = $('#file-data-grid'); var $grid = $('#file-data-grid');
var rows = $grid.datagrid('getRows'); var rows = $grid.datagrid('getRows');
@ -701,6 +820,7 @@
if (e.which == 13) { // 按下 Enter if (e.which == 13) { // 按下 Enter
var newFileName = $(this).val(); var newFileName = $(this).val();
if (newFileName) { if (newFileName) {
pythoncode = ""
func_FileUpload(newFileName); func_FileUpload(newFileName);
} }
$grid.datagrid('deleteRow', 0); $grid.datagrid('deleteRow', 0);
@ -724,7 +844,6 @@
} }
$(document).ready(function () { $(document).ready(function () {
// 副檔名圖片 // 副檔名圖片
$('#file-data-grid').datagrid({ $('#file-data-grid').datagrid({
title: 'Files', title: 'Files',
@ -767,14 +886,17 @@
onClickRow: function (rowIndex, rowData) { onClickRow: function (rowIndex, rowData) {
currentFileName = rowData.filename; currentFileName = rowData.filename;
func_FileGet(currentFileName); func_FileGet(currentFileName);
// func_stopPython(); // Ming 2024-09-27 switch file need to stop python
} }
}); });
// 按 Ctrl + S // 按 Ctrl + S
$(document).keydown(function (event) { $(document).keydown(function (event) {
if (event.ctrlKey && event.which === 83) { if (event.ctrlKey && event.which === 83) {
event.preventDefault(); event.preventDefault();
func_FileUpload(currentFileName); // 使用現在的文件名稱進行上傳 func_FileSave(currentFileName); // 使用現在的文件名稱進行上傳
} }
}); });
// 按 SHIFT + ENTER 執行 // 按 SHIFT + ENTER 執行
@ -789,18 +911,18 @@
} }
}); });
// 設定 Textarea 可使用 Tab // 設定 Textarea 可使用 Tab
/*$('#code-textarea').on('keydown', function(e) { $('#code-textarea').on('keydown', function(e) {
if (e.key === 'Tab') { if (e.key === 'Tab') {
e.preventDefault(); e.preventDefault();
var start = this.selectionStart; var start = this.selectionStart;
var end = this.selectionEnd; var end = this.selectionEnd;
this.value = this.value.substring(0, start) + '\t' + this.value.substring(end); this.value = this.value.substring(0, start) + ' ' + ' ' + ' ' + ' ' + this.value.substring(end);
this.selectionStart = this.selectionEnd = start + 1; this.selectionStart = this.selectionEnd = start + 4;
} }
});*/ });
$('#console').on('mousedown', function() { $('#console').on('mousedown', function() {
isUserScrolling = true; isUserScrolling = true;
@ -824,7 +946,7 @@
// 按儲存按鈕 // 按儲存按鈕
$('#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_FileUpload(currentFileName); // 使用現在的文件名稱進行上傳 func_FileSave(currentFileName); // 使用現在的文件名稱進行上傳
}); });
// 按刪除按鈕 // 按刪除按鈕
$('#deletefile-button').click(function () { $('#deletefile-button').click(function () {
@ -840,7 +962,23 @@
}); });
} }
}); });
// 上傳按鈕 (只接受 .py 檔案)
$('#uploadfile-button').click(function() {
var fileInput = $('<input type="file" accept=".py">');
fileInput.click();
fileInput.on('change', function(e) {
var file = e.target.files[0];
if (file) {
var reader = new FileReader();
reader.onload = function(e) {
pythoncode = e.target.result;
var fileName = file.name;
func_FileUpload(fileName);
};
reader.readAsText(file);
}
});
});
// 按執行按鈕 // 按執行按鈕
$('#run-button').click(function () { $('#run-button').click(function () {
$('#console').append("Running.....\n"); $('#console').append("Running.....\n");

79
Aida/setting.html

@ -1929,6 +1929,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: 400px; height: 18px;">
&nbsp;
<nobr id="IDC_STATIC_ENABLE_PYTHON_FILE"></nobr>
</td>
<td style="width: 400px; height: 18px;">
&nbsp;
<input id="enable_python_file" type="text" readonly style="width: 300px;" />
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -2097,6 +2107,8 @@
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;
@ -2225,6 +2237,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 = "";
@ -4256,6 +4269,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) {
@ -4438,6 +4452,8 @@
//document.getElementById("report_border").style.display = "block"; //document.getElementById("report_border").style.display = "block";
//document.getElementById("IDOK_report").style.display = "block"; //document.getElementById("IDOK_report").style.display = "block";
document.getElementById("system_python_border").style.display = "";
document.getElementById("IDOK_python").style.display = "";
document.getElementById("ID_DEFAULT").style.top = ""; document.getElementById("ID_DEFAULT").style.top = "";
@ -4734,7 +4750,10 @@
$('#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);
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
@ -4784,45 +4803,45 @@
var check_if_double_mode_1 = dataset_ver_1.indexOf("RAFFIC"); var check_if_double_mode_1 = dataset_ver_1.indexOf("RAFFIC");
var check_if_double_mode_2 = dataset_ver_2.indexOf("RAFFIC"); var check_if_double_mode_2 = dataset_ver_2.indexOf("RAFFIC");
if (check_if_double_mode_1 >= 1 && check_if_double_mode_2 >= 1) { if (check_if_double_mode_1 >= 1 && check_if_double_mode_2 >= 1) {
const selectElement = document.getElementById('getnetwork_buffer_id'); const selectElement = document.getElementById('getnetwork_buffer_id');
// 假設我們想改變所有選項的顯示文本 // 假設我們想改變所有選項的顯示文本
for (var i = 0; i < selectElement.options.length; i++) { for (var i = 0; i < selectElement.options.length; i++) {
const option_select = selectElement.options[i]; const option_select = selectElement.options[i];
if (i <= 1) { if (i <= 1) {
option_select.text = (i + 1) + " (RGB)"; // 改變文本內容 option_select.text = (i + 1) + " (RGB)"; // 改變文本內容
} }
else { else {
option_select.text = (i + 1) + " (Thermal)"; // 改變文本內容 option_select.text = (i + 1) + " (Thermal)"; // 改變文本內容
} }
} }
const selectElement_2 = document.getElementById('getimage_encoder_id'); const selectElement_2 = document.getElementById('getimage_encoder_id');
for (var i = 0; i < selectElement_2.options.length; i++) { for (var i = 0; i < selectElement_2.options.length; i++) {
const option_select = selectElement_2.options[i]; const option_select = selectElement_2.options[i];
if (i <= 0) { if (i <= 0) {
option_select.text = (i + 2) + " (RGB)"; // 改變文本內容 option_select.text = (i + 2) + " (RGB)"; // 改變文本內容
} }
else { else {
option_select.text = (i + 2) + " (Thermal)"; // 改變文本內容 option_select.text = (i + 2) + " (Thermal)"; // 改變文本內容
} }
} }
const selectElement_3 = document.getElementById('getimage_encoder_id_HD'); const selectElement_3 = document.getElementById('getimage_encoder_id_HD');
for (var i = 0; i < selectElement_3.options.length; i++) { for (var i = 0; i < selectElement_3.options.length; i++) {
const option_select = selectElement_3.options[i]; const option_select = selectElement_3.options[i];
if (i <= 0) { if (i <= 0) {
option_select.text = "None"; // 改變文本內容 option_select.text = "None"; // 改變文本內容
} }
else if (i == 1) { else if (i == 1) {
option_select.text = (i + 1) + " (RGB)"; // 改變文本內容 option_select.text = (i + 1) + " (RGB)"; // 改變文本內容
} }
else { else {
option_select.text = (i + 1) + " (Thermal)"; // 改變文本內容 option_select.text = (i + 1) + " (Thermal)"; // 改變文本內容
} }
} }
} }
} }
@ -4998,6 +5017,12 @@
} }
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";

6
Aida/setting_on_nvr.html

@ -1937,7 +1937,7 @@
</div> </div>
</div> </div>
<div id="system_python_border" class="system_python_border" style="border:1px gray solid;padding:20px;margin:15px 15px 15px 15px;"> <div id="system_python_border" class="system_python_border" style="border:1px gray solid;padding:20px;margin:15px 15px 15px 15px;display:none;">
<div class="titlebox"><nobr id="TITLEBOX_PAGE22"></nobr></div> <div class="titlebox"><nobr id="TITLEBOX_PAGE22"></nobr></div>
<table align="center" valign="center" style="border-collapse: collapse; width: 850px; height: auto; "> <table align="center" valign="center" style="border-collapse: collapse; width: 850px; height: auto; ">
<tbody> <tbody>
@ -1960,7 +1960,7 @@
<div> <div>
<div align="center"> <div align="center">
<input align="center" id="IDOK_python" type="button" value=" Set " onclick="func_setPythonData()" style="background-color:#6c87d4;color:white;height:36px;width:300px;" /> <input align="center" id="IDOK_python" type="button" value=" Set " onclick="func_setPythonData()" style="background-color:#6c87d4;color:white;height:36px;width:300px;display:none;" />
</div> </div>
</div> </div>
@ -4463,6 +4463,8 @@
//document.getElementById("report_border").style.display = "block"; //document.getElementById("report_border").style.display = "block";
//document.getElementById("IDOK_report").style.display = "block"; //document.getElementById("IDOK_report").style.display = "block";
document.getElementById("system_python_border").style.display = "";
document.getElementById("IDOK_python").style.display = "";
document.getElementById("ID_DEFAULT").style.top = ""; document.getElementById("ID_DEFAULT").style.top = "";

2
Aida/speed_index.html

@ -355,7 +355,7 @@
} }
if (localStorage.getItem('current_state_hide_or_open_label') == null) if (localStorage.getItem('current_state_hide_or_open_label') == null)
localStorage.setItem('current_state_hide_or_open_label', 1); localStorage.setItem('current_state_hide_or_open_label', 0);
else else
current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label'); current_state_hide_or_open_label = localStorage.getItem('current_state_hide_or_open_label');

6
Aida/speed_index.js

@ -27,7 +27,7 @@ var MAX_WIDTH = G_VIEW_CANVAS_X;
var g_check_cross = 0; var g_check_cross = 0;
var current_state_hide_or_open_label = 1; var current_state_hide_or_open_label = 0;
var current_state_hide_or_open_direction = 0; var current_state_hide_or_open_direction = 0;
var current_state_hide_or_open_speed = 0; var current_state_hide_or_open_speed = 0;
@ -1855,8 +1855,8 @@ function GetSpeed(speed_data) {
ai_json.AiEngine[i].label_name == "barcode" || ai_json.AiEngine[i].label_name == "barcode" ||
ai_json.AiEngine[i].label_name == "L._Plate_TWN") { ai_json.AiEngine[i].label_name == "L._Plate_TWN") {
if (typeof (ai_json.AiEngine[i].properties !== 'undefined')) { if (ai_json.AiEngine[i].properties) {
if (typeof (ai_json.AiEngine[i].properties.plate !== 'undefined')) { if (ai_json.AiEngine[i].properties.plate) {
var plate_name = ""; var plate_name = "";
if (ai_json.AiEngine[i].label_name == "ambulance") if (ai_json.AiEngine[i].label_name == "ambulance")
plate_name = plate_name.concat(ai_json.AiEngine[i].label_name); plate_name = plate_name.concat(ai_json.AiEngine[i].label_name);

6
Aida_data/aiengine

@ -12,9 +12,9 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":/emmc/plugin/python/lib:/emmc/plugin/p
case ${1} in case ${1} in
start) start)
rm "/www/airelay";rm "/airelay" rm "/www/airelay";rm "/airelay"
killall -15 mon; killall -9 mon;
killall -15 osd_server; killall -9 osd_server;
killall -15 gynet; killall -9 gynet;
#if is_running; then #if is_running; then
#echo "Service is already running.";exit 1; #echo "Service is already running.";exit 1;
#fi #fi

3
Aida_data/aiengine_initial

@ -7,6 +7,9 @@ cd /emmc/plugin/
modprobe cavalry modprobe cavalry
/usr/local/bin/cavalry_load -f /lib/firmware/cavalry.bin -r /usr/local/bin/cavalry_load -f /lib/firmware/cavalry.bin -r
cp /emmc/plugin/Aida_data/libopencv_video.so.3.4.6 /usr/lib/libopencv_video.so.3.4.6
cp /emmc/plugin/Aida_data/libopencv_video.so.3.4 /usr/lib/libopencv_video.so.3.4
rmmod /lib/modules/5.4.199/kernel/drivers/video/fbdev/ambarella/ambarella_fb.ko rmmod /lib/modules/5.4.199/kernel/drivers/video/fbdev/ambarella/ambarella_fb.ko
rmmod /lib/modules/4.14.164/kernel/drivers/video/fbdev/ambarella/ambarella_fb.ko rmmod /lib/modules/4.14.164/kernel/drivers/video/fbdev/ambarella/ambarella_fb.ko
modprobe ambarella_fb resolution=3840x2160 mode=clut8bpp modprobe ambarella_fb resolution=3840x2160 mode=clut8bpp

4
Aida_data/config_custom_1.json

@ -57,7 +57,7 @@
"enable_ivs_and_ai": "No", "enable_ivs_and_ai": "No",
"enable_lpr_upon_triggered": "No", "enable_lpr_upon_triggered": "No",
"dwell_lpr_upon_triggered": "10", "dwell_lpr_upon_triggered": "10",
"unknown_object_max_proportion": "10", "unknown_object_max_proportion": "20",
"unknown_object_min_proportion": "0", "unknown_object_min_proportion": "0",
"confidence_unknown_object": "0", "confidence_unknown_object": "0",
"confidence2_unknown_object": "0", "confidence2_unknown_object": "0",
@ -78,7 +78,7 @@
"ptz_tilt_up_limit": "0", "ptz_tilt_up_limit": "0",
"ptz_tilt_down_limit": "210", "ptz_tilt_down_limit": "210",
"ptz_speed": "3", "ptz_speed": "3",
"ivs_mode": "0", "ivs_mode": "3",
"detection_zone": [ "detection_zone": [
{ {
"obj_max_proportion_in_zone": "80", "obj_max_proportion_in_zone": "80",

4
Aida_data/config_custom_2.json

@ -57,7 +57,7 @@
"enable_ivs_and_ai": "No", "enable_ivs_and_ai": "No",
"enable_lpr_upon_triggered": "No", "enable_lpr_upon_triggered": "No",
"dwell_lpr_upon_triggered": "10", "dwell_lpr_upon_triggered": "10",
"unknown_object_max_proportion": "10", "unknown_object_max_proportion": "20",
"unknown_object_min_proportion": "0", "unknown_object_min_proportion": "0",
"confidence_unknown_object": "0", "confidence_unknown_object": "0",
"confidence2_unknown_object": "0", "confidence2_unknown_object": "0",
@ -78,7 +78,7 @@
"ptz_tilt_up_limit": "0", "ptz_tilt_up_limit": "0",
"ptz_tilt_down_limit": "210", "ptz_tilt_down_limit": "210",
"ptz_speed": "3", "ptz_speed": "3",
"ivs_mode": "0", "ivs_mode": "3",
"detection_zone": [ "detection_zone": [
{ {
"obj_max_proportion_in_zone": "80", "obj_max_proportion_in_zone": "80",

20
Aida_data/config_custom_4.json

@ -31,7 +31,7 @@
"confidence4": "30", "confidence4": "30",
"getnetwork_buffer_id": "3", "getnetwork_buffer_id": "3",
"tab_view_size": "889x500", "tab_view_size": "889x500",
"count_zone": 3, "count_zone": 2,
"enable_lpr_db": "Yes", "enable_lpr_db": "Yes",
"enable_PTZ": "No", "enable_PTZ": "No",
"enable_track": "No", "enable_track": "No",
@ -57,7 +57,7 @@
"enable_ivs_and_ai": "Yes", "enable_ivs_and_ai": "Yes",
"enable_lpr_upon_triggered": "No", "enable_lpr_upon_triggered": "No",
"dwell_lpr_upon_triggered": "10", "dwell_lpr_upon_triggered": "10",
"unknown_object_max_proportion": "10", "unknown_object_max_proportion": "20",
"unknown_object_min_proportion": "0", "unknown_object_min_proportion": "0",
"confidence_unknown_object": "0", "confidence_unknown_object": "0",
"confidence2_unknown_object": "0", "confidence2_unknown_object": "0",
@ -78,7 +78,7 @@
"ptz_tilt_up_limit": "0", "ptz_tilt_up_limit": "0",
"ptz_tilt_down_limit": "210", "ptz_tilt_down_limit": "210",
"ptz_speed": "3", "ptz_speed": "3",
"ivs_mode": "0", "ivs_mode": "3",
"detection_zone": [ "detection_zone": [
{ {
"obj_max_proportion_in_zone": "80", "obj_max_proportion_in_zone": "80",
@ -330,7 +330,7 @@
"world_distance_side1": "10", "world_distance_side1": "10",
"world_distance_side2": "10", "world_distance_side2": "10",
"world_time_unit": "KPH", "world_time_unit": "KPH",
"metadata1": "person", "metadata1": "person,car",
"metadata2": "", "metadata2": "",
"metadata_stop": "", "metadata_stop": "",
"no_parking_time": "5", "no_parking_time": "5",
@ -552,7 +552,7 @@
"enable_social_distance": "", "enable_social_distance": "",
"enable_speed": "No", "enable_speed": "No",
"enable_radar_speed": "No", "enable_radar_speed": "No",
"enable_ivs_zone": "Yes", "enable_ivs_zone": "No",
"parking_space": "0", "parking_space": "0",
"parking_line": "0", "parking_line": "0",
"set_distance": "10", "set_distance": "10",
@ -560,7 +560,7 @@
"world_distance_side1": "10", "world_distance_side1": "10",
"world_distance_side2": "10", "world_distance_side2": "10",
"world_time_unit": "KPH", "world_time_unit": "KPH",
"metadata1": "person,car", "metadata1": "",
"metadata2": "", "metadata2": "",
"metadata_stop": "", "metadata_stop": "",
"no_parking_time": "5", "no_parking_time": "5",
@ -758,17 +758,17 @@
], ],
"point_number": 6, "point_number": 6,
"x1": 19, "x1": 19,
"y1": 125, "y1": 16,
"x2": 19, "x2": 19,
"y2": 250, "y2": 250,
"x3": 19, "x3": 19,
"y3": 375, "y3": 484,
"x4": 870, "x4": 870,
"y4": 375, "y4": 484,
"x5": 870, "x5": 870,
"y5": 250, "y5": 250,
"x6": 870, "x6": 870,
"y6": 125 "y6": 16
}, },
{ {
"obj_max_proportion_in_zone": "80", "obj_max_proportion_in_zone": "80",

4
Aida_data/config_custom_5.json

@ -57,7 +57,7 @@
"enable_ivs_and_ai": "No", "enable_ivs_and_ai": "No",
"enable_lpr_upon_triggered": "No", "enable_lpr_upon_triggered": "No",
"dwell_lpr_upon_triggered": "10", "dwell_lpr_upon_triggered": "10",
"unknown_object_max_proportion": "10", "unknown_object_max_proportion": "20",
"unknown_object_min_proportion": "0", "unknown_object_min_proportion": "0",
"confidence_unknown_object": "0", "confidence_unknown_object": "0",
"confidence2_unknown_object": "0", "confidence2_unknown_object": "0",
@ -78,7 +78,7 @@
"ptz_tilt_up_limit": "0", "ptz_tilt_up_limit": "0",
"ptz_tilt_down_limit": "210", "ptz_tilt_down_limit": "210",
"ptz_speed": "3", "ptz_speed": "3",
"ivs_mode": "0", "ivs_mode": "3",
"detection_zone": [ "detection_zone": [
{ {
"obj_max_proportion_in_zone": "80", "obj_max_proportion_in_zone": "80",

4
Aida_data/config_install.json

@ -57,7 +57,7 @@
"enable_ivs_and_ai": "No", "enable_ivs_and_ai": "No",
"enable_lpr_upon_triggered": "No", "enable_lpr_upon_triggered": "No",
"dwell_lpr_upon_triggered": "10", "dwell_lpr_upon_triggered": "10",
"unknown_object_max_proportion": "10", "unknown_object_max_proportion": "20",
"unknown_object_min_proportion": "0", "unknown_object_min_proportion": "0",
"confidence_unknown_object": "0", "confidence_unknown_object": "0",
"confidence2_unknown_object": "0", "confidence2_unknown_object": "0",
@ -78,7 +78,7 @@
"ptz_tilt_up_limit": "0", "ptz_tilt_up_limit": "0",
"ptz_tilt_down_limit": "210", "ptz_tilt_down_limit": "210",
"ptz_speed": "3", "ptz_speed": "3",
"ivs_mode": "0", "ivs_mode": "3",
"detection_zone": [ "detection_zone": [
{ {
"obj_max_proportion_in_zone": "80", "obj_max_proportion_in_zone": "80",

BIN
Aida_data/different_version/SDK_2_5/gynet

Binary file not shown.

BIN
Aida_data/different_version/SDK_3_0/gynet

Binary file not shown.

BIN
Aida_data/gynet

Binary file not shown.

BIN
Aida_data/libopencv_video.so.3.4

Binary file not shown.

BIN
Aida_data/libopencv_video.so.3.4.6

Binary file not shown.

15
README.md

@ -1,9 +1,16 @@
同樣也適用於 darknet_3 同樣也適用於 darknet_3
目前只修改 - 主要修改以下
- /Aida/python.html:直接替換成自己的版本 - darknet_2_5 & darknet_3
- /Aida/image/stop.png, clear.png:新增部分圖片 - /pythonR.c, /pythonR.h:直接替換成自己的版本
- /Aida_data/python_code:新增部分 PY 檔案 - /nweb.c, /nweb.h, /detector.c:修改部分程式
- emmc_ori
- /Aida/python.html:直接替換成自己的版本
- /Aida/image/stop.png, clear.png:新增部分圖片
- /Aida_data/python_code:新增部分 PY 檔案
- /Aida/setting.html : 修改部分程式
- /Aida_data/config_install.json:修改部分程式
- /Aida/lang_cookie.js, /Aida/lang.js:修改部分程式
Ming 資料夾結構 Ming 資料夾結構
/emmc_python/ /emmc_python/

Loading…
Cancel
Save