Merge branch 'release-1.34' of github.com:ZoneMinder/zoneminder into release-1.34

This commit is contained in:
Isaac Connor 2021-04-10 18:16:17 -04:00
commit cf721ae875
3 changed files with 16 additions and 17 deletions

View File

@ -91,6 +91,10 @@ std::string CameraType_Strings[] = {
"CURL", "CURL",
}; };
std::string TriggerState_Strings[] = {
"Cancel", "On", "Off"
};
std::vector<std::string> split(const std::string &s, char delim) { std::vector<std::string> split(const std::string &s, char delim) {
std::vector<std::string> elems; std::vector<std::string> elems;
@ -1403,7 +1407,8 @@ bool Monitor::Analyse() {
bool signal = shared_data->signal; bool signal = shared_data->signal;
bool signal_change = (signal != last_signal); bool signal_change = (signal != last_signal);
Debug(3, "Motion detection is enabled signal(%d) signal_change(%d)", signal, signal_change); Debug(3, "Motion detection is enabled signal(%d) signal_change(%d) trigger_state %s",
signal, signal_change, TriggerState_Strings[trigger_data->trigger_state].c_str());
if ( trigger_data->trigger_state != TRIGGER_OFF ) { if ( trigger_data->trigger_state != TRIGGER_OFF ) {
unsigned int score = 0; unsigned int score = 0;
@ -1801,7 +1806,7 @@ bool Monitor::Analyse() {
closeEvent(); closeEvent();
} }
shared_data->state = state = IDLE; shared_data->state = state = IDLE;
trigger_data->trigger_state = TRIGGER_CANCEL; //trigger_data->trigger_state = TRIGGER_CANCEL;
} // end if ( trigger_data->trigger_state != TRIGGER_OFF ) } // end if ( trigger_data->trigger_state != TRIGGER_OFF )
if ( (!signal_change && signal) && (function == MODECT || function == MOCORD) ) { if ( (!signal_change && signal) && (function == MODECT || function == MOCORD) ) {
@ -2485,8 +2490,7 @@ int Monitor::Capture() {
if ( captureResult < 0 ) { if ( captureResult < 0 ) {
Info("Return from Capture (%d), signal loss", captureResult); Info("Return from Capture (%d), signal loss", captureResult);
// Tell zma to end the event. zma will reset TRIGGER shared_data->signal = false;
trigger_data->trigger_state = TRIGGER_OFF;
// Unable to capture image for temporary reason // Unable to capture image for temporary reason
// Fake a signal loss image // Fake a signal loss image
Rgb signalcolor; Rgb signalcolor;
@ -2886,6 +2890,9 @@ bool Monitor::DumpSettings(char *output, bool verbose) {
for ( int i = 0; i < n_zones; i++ ) { for ( int i = 0; i < n_zones; i++ ) {
zones[i]->DumpSettings(output+strlen(output), verbose); zones[i]->DumpSettings(output+strlen(output), verbose);
} }
sprintf(output+strlen(output), "Recording Enabled? %s\n", enabled ? "enabled" : "disabled");
sprintf(output+strlen(output), "Events Enabled (!TRIGGER_OFF)? %s\n", trigger_data->trigger_state == TRIGGER_OFF ? "disabled" : "enabled");
sprintf(output+strlen(output), "Motion Detection Enabled? %s\n", shared_data->active ? "enabled" : "disabled");
return true; return true;
} // bool Monitor::DumpSettings(char *output, bool verbose) } // bool Monitor::DumpSettings(char *output, bool verbose)

View File

@ -11,11 +11,6 @@ function Monitor(monitorData) {
this.alarmState = STATE_IDLE; this.alarmState = STATE_IDLE;
this.lastAlarmState = STATE_IDLE; this.lastAlarmState = STATE_IDLE;
this.streamCmdParms = 'view=request&request=stream&connkey='+this.connKey; this.streamCmdParms = 'view=request&request=stream&connkey='+this.connKey;
if ( auth_hash ) {
this.streamCmdParms += '&auth='+auth_hash;
} else if ( auth_relay ) {
this.streamCmdParms += '&'+auth_relay;
}
this.streamCmdTimer = null; this.streamCmdTimer = null;
this.type = monitorData.type; this.type = monitorData.type;
this.refresh = monitorData.refresh; this.refresh = monitorData.refresh;
@ -186,7 +181,7 @@ function Monitor(monitorData) {
} }
//console.log("Starting CmdQuery for " + this.connKey ); //console.log("Starting CmdQuery for " + this.connKey );
if ( this.type != 'WebSite' ) { if ( this.type != 'WebSite' ) {
this.streamCmdReq.send(this.streamCmdParms+"&command="+CMD_QUERY); this.streamCmdReq.send(this.streamCmdParms+"&command="+CMD_QUERY+(auth_hash?'&auth='+auth_hash:'');
} }
}; };

View File

@ -442,9 +442,6 @@ function statusCmdQuery() {
if ( monitorType != 'WebSite' ) { if ( monitorType != 'WebSite' ) {
var alarmCmdParms = 'view=request&request=alarm&id='+monitorId; var alarmCmdParms = 'view=request&request=alarm&id='+monitorId;
if ( auth_hash ) {
alarmCmdParms += '&auth='+auth_hash;
}
var alarmCmdReq = new Request.JSON( { var alarmCmdReq = new Request.JSON( {
url: monitorUrl, url: monitorUrl,
method: 'get', method: 'get',
@ -461,22 +458,22 @@ function getAlarmCmdResponse(respObj, respText) {
} }
function cmdDisableAlarms() { function cmdDisableAlarms() {
alarmCmdReq.send(alarmCmdParms+"&command=disableAlarms"); alarmCmdReq.send(alarmCmdParms+auth_relay+"&command=disableAlarms");
} }
function cmdEnableAlarms() { function cmdEnableAlarms() {
alarmCmdReq.send(alarmCmdParms+"&command=enableAlarms"); alarmCmdReq.send(alarmCmdParms+auth_relay+"&command=enableAlarms");
} }
function cmdForceAlarm() { function cmdForceAlarm() {
alarmCmdReq.send(alarmCmdParms+"&command=forceAlarm"); alarmCmdReq.send(alarmCmdParms+auth_relay+"&command=forceAlarm");
if ( window.event ) { if ( window.event ) {
window.event.preventDefault(); window.event.preventDefault();
} }
} }
function cmdCancelForcedAlarm() { function cmdCancelForcedAlarm() {
alarmCmdReq.send(alarmCmdParms+"&command=cancelForcedAlarm"); alarmCmdReq.send(alarmCmdParms+auth_relay+"&command=cancelForcedAlarm");
if ( window.event ) { if ( window.event ) {
window.event.preventDefault(); window.event.preventDefault();
} }