Merge branch 'master' of github.com:ZoneMinder/zoneminder
commit
0c49884956
|
@ -2534,15 +2534,10 @@ our @options = (
|
|||
the events may be shorter than the section length if an alarm
|
||||
has occurred.
|
||||
`,
|
||||
type => $types{boolean},
|
||||
type => {
|
||||
db_type =>'string',
|
||||
hint =>'time|idle|alarm',
|
||||
pattern =>qr|^([tia])|i,
|
||||
format =>q( ($1 =~ /^t/)
|
||||
? 'time'
|
||||
: ($1 =~ /^i/ ? 'idle' : 'time' )
|
||||
)
|
||||
hint =>'time|duration|idle|alarm',
|
||||
pattern =>qr/^(time|duration|idle|alarm)/,
|
||||
},
|
||||
category => 'config',
|
||||
},
|
||||
|
|
|
@ -1995,6 +1995,8 @@ bool Monitor::Analyse() {
|
|||
// Need to guard around event creation/deletion from Reload()
|
||||
std::lock_guard<std::mutex> lck(event_mutex);
|
||||
int score = 0;
|
||||
// Track this separately as alarm_frame_count messes with the logic
|
||||
int motion_score = -1;
|
||||
|
||||
// if we have been told to be OFF, then we are off and don't do any processing.
|
||||
if (trigger_data->trigger_state != TriggerState::TRIGGER_OFF) {
|
||||
|
@ -2139,7 +2141,6 @@ bool Monitor::Analyse() {
|
|||
Event::StringSet zoneSet;
|
||||
|
||||
if (snap->image) {
|
||||
int motion_score = 0;
|
||||
// decoder may not have been able to provide an image
|
||||
if (!ref_image.Buffer()) {
|
||||
Debug(1, "Assigning instead of Detecting");
|
||||
|
@ -2152,6 +2153,7 @@ bool Monitor::Analyse() {
|
|||
} else {
|
||||
// didn't assign, do motion detection maybe and blending definitely
|
||||
if (!(analysis_image_count % (motion_frame_skip+1))) {
|
||||
motion_score = 0;
|
||||
Debug(1, "Detecting motion on image %d, image %p", snap->image_index, snap->image);
|
||||
// Get new score.
|
||||
if ((analysis_image == ANALYSISIMAGE_YCHANNEL) && snap->y_image) {
|
||||
|
@ -2177,7 +2179,7 @@ bool Monitor::Analyse() {
|
|||
if (zone.AlarmImage())
|
||||
snap->analysis_image->Overlay(*(zone.AlarmImage()));
|
||||
}
|
||||
Debug(1, "Setting zone score %d to %d", zone_index, zone.Score());
|
||||
Debug(4, "Setting score for zone %d to %d", zone_index, zone.Score());
|
||||
zone_scores[zone_index] = zone.Score(); zone_index ++;
|
||||
}
|
||||
//alarm_image.Assign(*(snap->analysis_image));
|
||||
|
@ -2258,7 +2260,7 @@ bool Monitor::Analyse() {
|
|||
} else {
|
||||
Debug(1, "!score state=%s, snap->score %d", State_Strings[state].c_str(), snap->score);
|
||||
// We only go out of alarm if we actually did motion detection or aren't doing any.
|
||||
if ((snap->score >= 0) or (shared_data->analysing != ANALYSING_ALWAYS)) {
|
||||
if ((motion_score >= 0) or (shared_data->analysing != ANALYSING_ALWAYS)) {
|
||||
alert_to_alarm_frame_count = alarm_frame_count; // load same value configured for alarm_frame_count
|
||||
|
||||
if (state == ALARM) {
|
||||
|
|
|
@ -31,18 +31,27 @@ input.large {
|
|||
}
|
||||
|
||||
#sidebar {
|
||||
overflow-y: auto;
|
||||
min-width: 160px;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
#optionsContainer {
|
||||
}
|
||||
|
||||
#options {
|
||||
margin-right: -15px;
|
||||
overflow-y: auto;
|
||||
height: 100%;
|
||||
/* margin-right: -15px;*/ /* you shouldn't do this for the sake of shifting the scrool bar, it breaks the style in different places. done differently*/
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body.sticky #options {
|
||||
height: calc(100% - 50px); /* It's bad, but it's temporary */
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
body.sticky #sidebar {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#options div.col-md {
|
||||
text-align: left;
|
||||
}
|
||||
|
@ -97,14 +106,10 @@ input[name="newStorage[Url]"] {
|
|||
}
|
||||
|
||||
form {
|
||||
/* height: 100% is to make scrollbars work in #options */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* display: flex;*/
|
||||
/* flex-direction: column;*/
|
||||
height: 100%;
|
||||
/*
|
||||
* Why extra padding at top?
|
||||
padding-top: 2rem;
|
||||
*/
|
||||
}
|
||||
|
||||
@media screen and (max-width:767px) {
|
||||
|
|
|
@ -310,14 +310,15 @@ foreach (array_map('basename', glob('skins/'.$skin.'/css/*', GLOB_ONLYDIR)) as $
|
|||
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
||||
<input type="hidden" name="tab" value="<?php echo $tab ?>"/>
|
||||
<input type="hidden" name="action" value="options"/>
|
||||
<div class="row">
|
||||
<div class="row pb-2">
|
||||
<div class="col">
|
||||
<div id="contentButtons">
|
||||
<button type="submit" <?php echo $canEdit?'':' disabled="disabled"' ?>><?php echo translate('Save') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="options">
|
||||
<div class="row h-100">
|
||||
<div id="options">
|
||||
<?php
|
||||
if (!isset($configCats[$tab])) {
|
||||
echo 'There are no config entries for category '.$tab.'.<br/>';
|
||||
|
@ -327,9 +328,9 @@ foreach (array_map('basename', glob('skins/'.$skin.'/css/*', GLOB_ONLYDIR)) as $
|
|||
$optionPromptText = !empty($OLANG[$shortName])?$OLANG[$shortName]['Prompt']:$value['Prompt'];
|
||||
$optionCanEdit = $canEdit && !$value['System'];
|
||||
?>
|
||||
<div class="form-group form-row <?php echo $name ?>">
|
||||
<label for="<?php echo $name ?>" class="col-md-4 control-label text-md-right"><?php echo $shortName ?></label>
|
||||
<div class="col-md">
|
||||
<div class="form-group form-row <?php echo $name ?>">
|
||||
<label for="<?php echo $name ?>" class="col-md-4 control-label text-md-right"><?php echo $shortName ?></label>
|
||||
<div class="col-md">
|
||||
<?php
|
||||
if ($value['Type'] == 'boolean') {
|
||||
echo '<input type="checkbox" id="'.$name.'" name="newConfig['.$name.']" value="1"'.
|
||||
|
@ -362,10 +363,10 @@ foreach (array_map('basename', glob('skins/'.$skin.'/css/*', GLOB_ONLYDIR)) as $
|
|||
$optionLabel = $optionValue = $option;
|
||||
}
|
||||
?>
|
||||
<label class="font-weight-bold form-control-sm">
|
||||
<input type="radio" id="<?php echo $name.'_'.preg_replace('/[^a-zA-Z0-9]/', '', $optionValue) ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo $optionValue ?>"<?php if ( $value['Value'] == $optionValue ) { ?> checked="checked"<?php } ?><?php echo $optionCanEdit?'':' disabled="disabled"' ?>/>
|
||||
<?php echo htmlspecialchars($optionLabel) ?>
|
||||
</label>
|
||||
<label class="font-weight-bold form-control-sm">
|
||||
<input type="radio" id="<?php echo $name.'_'.preg_replace('/[^a-zA-Z0-9]/', '', $optionValue) ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo $optionValue ?>"<?php if ( $value['Value'] == $optionValue ) { ?> checked="checked"<?php } ?><?php echo $optionCanEdit?'':' disabled="disabled"' ?>/>
|
||||
<?php echo htmlspecialchars($optionLabel) ?>
|
||||
</label>
|
||||
<?php
|
||||
} # end foreach option
|
||||
} # end if count options > 3
|
||||
|
@ -387,14 +388,15 @@ foreach (array_map('basename', glob('skins/'.$skin.'/css/*', GLOB_ONLYDIR)) as $
|
|||
echo '<p class="warning">Note: This value has been overriden via configuration files in '.ZM_CONFIG. ' or ' . ZM_CONFIG_SUBDIR.'.<br/>The overriden value is: '.constant($name).'</p>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
<span class="form-text form-control-sm"><?php echo validHtmlStr($optionPromptText); echo makeHelpLink($name) ?></span>
|
||||
</div><!-- End .col-md -->
|
||||
</div><!-- End .form-group -->
|
||||
<span class="form-text form-control-sm"><?php echo validHtmlStr($optionPromptText); echo makeHelpLink($name) ?></span>
|
||||
</div><!-- End .col-md -->
|
||||
</div><!-- End .form-group -->
|
||||
<?php
|
||||
} # end foreach config entry in the category
|
||||
} # end if category exists
|
||||
} # end foreach config entry in the category
|
||||
} # end if category exists
|
||||
?>
|
||||
</div><!--options-->
|
||||
</div><!--options-->
|
||||
</div><!-- .row h-100 -->
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue