diff --git a/lib/controller/data/mysqlitedb.db b/lib/controller/data/mysqlitedb.db index b28dfff..7af6d3f 100644 Binary files a/lib/controller/data/mysqlitedb.db and b/lib/controller/data/mysqlitedb.db differ diff --git a/lib/controller/data/reports.db b/lib/controller/data/reports.db index a5ee76c..d1cb0ea 100644 Binary files a/lib/controller/data/reports.db and b/lib/controller/data/reports.db differ diff --git a/lib/controller/doFilterOperation.php b/lib/controller/doFilterOperation.php index f4f4936..40a24cd 100644 --- a/lib/controller/doFilterOperation.php +++ b/lib/controller/doFilterOperation.php @@ -70,6 +70,7 @@ $QS = "UPDATE `target_filter_train` SET `TRAIN_DETECT`={$DTR},`TRAIN_WIDTH`={$WIZ},`DECISION_TIME`={$DTM},`SUSPECT_TIME`={$STM},`TRACK_TRAIN`={$TTR},`DEBUG`={$DBG} WHERE `id`={$JJ['aux_id']}"; break; }; + case 10: $QS = "UPDATE `target_filter_train` SET `DEBUG`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break; }; break; }; diff --git a/lib/controller/doSensorOperation.php b/lib/controller/doSensorOperation.php index 399687d..beaa1ee 100644 --- a/lib/controller/doSensorOperation.php +++ b/lib/controller/doSensorOperation.php @@ -185,12 +185,51 @@ break; }; case 20:{ + //Save INI to device $RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db'); $QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},130,0,'')"; $RBASE->Query( $QS, false ); $QS =''; break; }; + case 21:{ + // Enable Frozen + $QS = "UPDATE `lrf_ini_settings` SET `FREEZ_FIRST_TH`=1, `SAVE_FIRST_TH`=1 WHERE `sensor_id`={$SNID}"; + $DATABASE->Query( $QS ); + $RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db'); + $QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},130,0,'')"; + $RBASE->Query( $QS, false ); + $QS =''; + break; + }; + case 22:{ + // Disable Frozen + $QS = "UPDATE `lrf_ini_settings` SET `FREEZ_FIRST_TH`=0, `SAVE_FIRST_TH`=0 WHERE `sensor_id`={$SNID}"; + $DATABASE->Query( $QS ); + $RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db'); + $QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},130,0,'')"; + $RBASE->Query( $QS, false ); + $QS =''; + break; + }; + case 23:{ + // Delete Frozen + $QS = "UPDATE `lrf_ini_settings` SET `FREEZ_FIRST_TH`=0, `SAVE_FIRST_TH`=1 WHERE `sensor_id`={$SNID}"; + $DATABASE->Query( $QS ); + $RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db'); + $QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},130,0,'')"; + $RBASE->Query( $QS, false ); + $QS =''; + break; + }; + case 24:{ + // Finish Study Frozen + $RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db'); + $QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$CN['id']},1,0,'')"; + $RBASE->Query( $QS, false ); + $QS =''; + break; + }; case 255:{ // Delete Sensor $NID = $CN['id']; diff --git a/lib/controller/getSensorEditor.php b/lib/controller/getSensorEditor.php index 5577dba..d2d1a3c 100644 --- a/lib/controller/getSensorEditor.php +++ b/lib/controller/getSensorEditor.php @@ -43,21 +43,84 @@ JOJOKA; } else { $INI_S = array(); $INI_S['AUTORESET_ENABLE'] = 0; - $INI_S['AUTORESET_INTERLEAVE'] = 0; - $INI_S['AUTORESET_TIMEOUT'] = 0; - $INI_S['BOARD_TEMPERATURE'] = 0; + $INI_S['AUTORESET_INTERLEAVE'] = 2000; + $INI_S['AUTORESET_TIMEOUT'] = 60000; + $INI_S['BOARD_TEMPERATURE'] = 1; $INI_S['BOARD_ZEROSHIFT'] = 0; $INI_S['BOARD_SPEED'] = 4; $INI_S['RUN_DIR'] = 2; - $INI_S['NO_BLACK_TARGETS'] = 0; + $INI_S['NO_BLACK_TARGETS'] = 1; $INI_S['JUST_MOVING_TARGETS'] = 0; $INI_S['JUST_MOVING_RADIAL'] = 0; $INI_S['JUST_MOVING_DISTANCE'] = 0; - $INI_S['FREEZ_FIRST_TH'] = 0; - $INI_S['SAVE_FIRST_TH'] = 0; - $QS = "INSERT INTO `lrf_ini_settings`(`sensor_id`,`AUTORESET_ENABLE`,`AUTORESET_INTERLEAVE`,`AUTORESET_TIMEOUT`,`BOARD_TEMPERATURE`,`BOARD_ZEROSHIFT`,`BOARD_SPEED`,`RUN_DIR`,`NO_BLACK_TARGETS`,`JUST_MOVING_TARGETS`,`JUST_MOVING_RADIAL`,`JUST_MOVING_DISTANCE`,`FREEZ_FIRST_TH`,`SAVE_FIRST_TH`) VALUES({$EID},0,0,0,0,0,4,2,0,0,0,0,0,0)"; + if( stripos( $CR['version'], 'FF' )!== false ) { + $INI_S['FREEZ_FIRST_TH'] = 1; + $INI_S['SAVE_FIRST_TH'] = 1; + } else if( stripos( $CR['version'], 'FS' )!== false ){ + $INI_S['FREEZ_FIRST_TH'] = 1; + $INI_S['SAVE_FIRST_TH'] = 1; + } else if( stripos( $CR['version'], 'FD' )!== false ){ + $INI_S['FREEZ_FIRST_TH'] = 0; + $INI_S['SAVE_FIRST_TH'] = 0; + } else { + $INI_S['FREEZ_FIRST_TH'] = 0; + $INI_S['SAVE_FIRST_TH'] = 0; + }; + $QS = "INSERT INTO `lrf_ini_settings`(`sensor_id`,`AUTORESET_ENABLE`,`AUTORESET_INTERLEAVE`,`AUTORESET_TIMEOUT`,`BOARD_TEMPERATURE`,`BOARD_ZEROSHIFT`,`BOARD_SPEED`,`RUN_DIR`,`NO_BLACK_TARGETS`,`JUST_MOVING_TARGETS`,`JUST_MOVING_RADIAL`,`JUST_MOVING_DISTANCE`,`FREEZ_FIRST_TH`,`SAVE_FIRST_TH`) VALUES({$EID},0,0,0,0,0,4,2,0,0,0,0,{$INI_S['FREEZ_FIRST_TH']},{$INI_S['SAVE_FIRST_TH']})"; $DATABASE->Query( $QS ); }; + if( ( stripos( $CR['version'], 'FD' )!== false ) || ( stripos( $CR['version'], 'FS' )!== false ) || ( stripos( $CR['version'], 'FF' )!== false ) ){ + //Frozen TH + if( stripos( $CR['version'], 'FD' )!== false ){ + $THF_OPERATION = ",{ + xtype: 'button', + text: 'Enable Frozen Threshold', + width: '100%', + iconCls: 'srv_op_fth_ble', + scale: 'large', + handler: function(){ + doSensorOperation( {$CR['id']}, 21, 0, true ); + } + }"; + } else { + if( stripos( $CR['version'], 'FS' )!== false ){ + $THF_OPERATION = ",{ + xtype: 'button', + text: 'Finish Frozen Threshold Study', + width: '100%', + iconCls: 'srv_op_fth_study', + scale: 'large', + handler: function(){ + doSensorOperation( {$CR['id']}, 24, 0, true ); + } + }"; + }; + if( stripos( $CR['version'], 'FF' )!== false ){ + $THF_OPERATION = ",{ + xtype: 'button', + text: 'Delete Frozen Threshold', + width: '100%', + iconCls: 'srv_op_fth_frozen', + scale: 'large', + handler: function(){ + doSensorOperation( {$CR['id']}, 23, 0, true ); + } + }"; + }; + $THF_OPERATION .= ",{ + xtype: 'button', + text: 'Disable Frozen Threshold', + width: '100%', + iconCls: 'srv_op_fth_ble', + scale: 'large', + handler: function(){ + doSensorOperation( {$CR['id']}, 22, 0, true ); + } + }"; + }; + } else { + $THF_OPERATION = ''; + } $ED =<<getLabel('_SND_FILES2_DEV__')}', diff --git a/lib/javascript/jsapi_dynamic/mojo_reports.js b/lib/javascript/jsapi_dynamic/mojo_reports.js index f2f8b77..17bc56a 100644 --- a/lib/javascript/jsapi_dynamic/mojo_reports.js +++ b/lib/javascript/jsapi_dynamic/mojo_reports.js @@ -290,7 +290,8 @@ function BuildCalendar( ){ }; -function loadCalendarDates(){ +function loadCalendarDates(){ + ReportSelectionMode = 0; Ext.MessageBox.wait("GetLabel('_Loading_Calo_');?>","GetLabel('_Please_Wait_');?>",{ width: '100%', hidden: true, @@ -822,6 +823,7 @@ var VideoLinks = []; var cEventTSS = 0; var cEventETS = 0; function loadEventData( record ){ + ReportSelectionMode = 3; // Just One Event cEventTSS = record.ts+record.ms/1000; markEventOnRadar( record.node_id, record.az, record.r ); if( record.video_id > 0 ){ @@ -1489,6 +1491,7 @@ function loadReportSegment( bid, eid ){ }; function loadReportData( bid, eid ){ + ReportSelectionMode = 2; // Session Selected Ext.Ajax.request({ url: '/lib/controller/getHistoryEvents.php', params: { @@ -1519,6 +1522,7 @@ function loadReportData( bid, eid ){ }; function loadReportDayTree( ts ){ + ReportSelectionMode = 1;//Day Selected ReportMask = new Ext.LoadMask(Ext.getCmp('left_side_menu').getEl(), {msg:"Please wait..."}); ReportMask.show(); Ext.Ajax.request({ @@ -1610,6 +1614,7 @@ function loadReportDayTree( ts ){ }; function initReportsView(){ + ReportSelectionMode = 0; // All History if( tlInterval!= null ){ window.clearInterval( tlInterval ); tlInterval = null; diff --git a/lib/php/db/SQLite_Class.php b/lib/php/db/SQLite_Class.php index 06d9f54..474b4de 100644 --- a/lib/php/db/SQLite_Class.php +++ b/lib/php/db/SQLite_Class.php @@ -75,7 +75,7 @@ class SQLite_DB{ return unserialize($FData); } else { - $result = $this->DBLink->query( $QS ) or die (" Error during query [$QS]:".mysqli_error($this->DBLink)); + $result = $this->DBLink->query( $QS ) or die (" Error during query [{$QS}]:");// . $this->DBLink->error ); $RetVal=array(); if( ( stripos( $QS, 'insert' ) === false ) && ( stripos( $QS, 'update' ) === false ) && $result !== false && is_a( $result, 'SQLite3Result' ) ){ while( $array = $result->fetchArray( SQLITE3_ASSOC )) $RetVal[]=$array; @@ -89,7 +89,7 @@ class SQLite_DB{ return $RetVal; } } else { - $result = $this->DBLink->query( $QS ) or die (" Error during query [$QS]:".mysqli_error($this->DBLink)); + $result = $this->DBLink->query( $QS ) or die (" Error during query [{$QS}]:");// . $this->DBLink->error ); $RetVal=array(); if( ( stripos( $QS, 'insert' ) === false ) && ( stripos( $QS, 'update' ) === false ) && $result !== false && is_a( $result, 'SQLite3Result' ) ){ while( $array = $result->fetchArray( SQLITE3_ASSOC )) $RetVal[]=$array; @@ -103,7 +103,7 @@ class SQLite_DB{ return $RetVal; } } else { - $result = $this->DBLink->query( $QS ) or die (" Error during query [$QS]:".mysqli_error($this->DBLink)); + $result = $this->DBLink->query( $QS ) or die (" Error during query [{$QS}]:");// . $this->DBLink->error ); $RetVal=array(); if( ( stripos( $QS, 'insert' ) === false ) && ( stripos( $QS, 'update' ) === false ) && $result !== false && is_a( $result, 'SQLite3Result' ) ){ while( $array = $result->fetchArray( SQLITE3_ASSOC )) $RetVal[]=$array; diff --git a/style/style.css b/style/style.css index 9c56b63..402f393 100644 --- a/style/style.css +++ b/style/style.css @@ -1070,6 +1070,21 @@ A.CalendarDS:hover { width: 100% !important; text-align: left !important; } +.srv_op_fth_frozen{ + background-image: url(wicons/023.png) !important; + width: 100% !important; + text-align: left !important; +} +.srv_op_fth_study{ + background-image: url(wicons/024.png) !important; + width: 100% !important; + text-align: left !important; +} +.srv_op_fth_ble{ + background-image: url(wicons/013.png) !important; + width: 100% !important; + text-align: left !important; +} .srv_op_lock{ background-image: url(wicons/029.png) !important; width: 100% !important; diff --git a/style/wicons/013.png b/style/wicons/013.png index a15e633..ed9f796 100644 Binary files a/style/wicons/013.png and b/style/wicons/013.png differ diff --git a/style/wicons/024.png b/style/wicons/024.png index 6523d12..4d6ec83 100644 Binary files a/style/wicons/024.png and b/style/wicons/024.png differ