Add Primary Fields to Region Editor
parent
d021652078
commit
f797521d51
|
|
@ -2674,7 +2674,6 @@ module.exports = function(s,config,lang){
|
|||
"field": lang['Filter for Objects only'],
|
||||
"description": "",
|
||||
"default": "0",
|
||||
"example": "",
|
||||
"fieldType": "select",
|
||||
"form-group-class": "h_det_fil_input h_det_fil_1",
|
||||
"form-group-class-pre-layer": "h_det_input h_det_1",
|
||||
|
|
@ -5906,79 +5905,199 @@ module.exports = function(s,config,lang){
|
|||
"section": "Region Editor",
|
||||
"blocks": {
|
||||
"Regions": {
|
||||
"name": lang["Regions"],
|
||||
"headerTitle": `<span class="cord_name"> </span>
|
||||
<div class="pull-right">
|
||||
<a href=# class="btn btn-success btn-sm add"><i class="fa fa-plus"></i></a>
|
||||
<a href=# class="btn btn-danger btn-sm erase"><i class="fa fa-trash-o"></i></a>
|
||||
</div>`,
|
||||
"color": "orange",
|
||||
"section-pre-class": "col-md-6",
|
||||
"section-class": "where",
|
||||
"box-wrapper-class": "row",
|
||||
"info": [
|
||||
{
|
||||
"field": lang["Monitor"],
|
||||
"id": "region_editor_monitors",
|
||||
"fieldType": "select",
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
"id": "regions_list",
|
||||
"field": lang["Regions"],
|
||||
"fieldType": "select",
|
||||
"possible": [],
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"field": lang['Region Name'],
|
||||
},
|
||||
{
|
||||
"name": "sensitivity",
|
||||
"field": lang['Minimum Change'],
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
"name": "max_sensitivity",
|
||||
"field": lang['Maximum Change'],
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
"name": "threshold",
|
||||
"field": lang['Trigger Threshold'],
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
"name": "color_threshold",
|
||||
"field": lang['Color Threshold'],
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
hidden: true,
|
||||
id: "regions_points",
|
||||
"fieldType": "table",
|
||||
"class": 'table table-striped',
|
||||
},
|
||||
{
|
||||
"class": 'col-md-12',
|
||||
"fieldType": 'div',
|
||||
info: [
|
||||
"color": "green",
|
||||
isFormGroupGroup: true,
|
||||
"noHeader": true,
|
||||
"section-class": "col-md-6",
|
||||
"noDefaultSectionClasses": true,
|
||||
"info": [
|
||||
{
|
||||
"name": lang["Regions"],
|
||||
"headerTitle": `<span class="cord_name"> </span>
|
||||
<div class="pull-right">
|
||||
<a href=# class="btn btn-success btn-sm add"><i class="fa fa-plus"></i></a>
|
||||
<a href=# class="btn btn-danger btn-sm erase"><i class="fa fa-trash-o"></i></a>
|
||||
</div>`,
|
||||
"color": "orange",
|
||||
"box-wrapper-class": "row",
|
||||
isFormGroupGroup: true,
|
||||
"info": [
|
||||
{
|
||||
"fieldType": "btn",
|
||||
attribute: "href=#",
|
||||
"class": `btn-info toggle-region-still-image`,
|
||||
"btnContent": `<i class="fa fa-retweet"></i> ${lang['Live Stream Toggle']}`,
|
||||
"field": lang["Monitor"],
|
||||
"id": "region_editor_monitors",
|
||||
"fieldType": "select",
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
"fieldType": "btn",
|
||||
forForm: true,
|
||||
attribute: "href=#",
|
||||
"class": `btn-success`,
|
||||
"btnContent": `<i class="fa fa-check"></i> ${lang['Save']}`,
|
||||
"id": "regions_list",
|
||||
"field": lang["Regions"],
|
||||
"fieldType": "select",
|
||||
"possible": [],
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"field": lang['Region Name'],
|
||||
},
|
||||
{
|
||||
"name": "sensitivity",
|
||||
"field": lang['Minimum Change'],
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
"name": "max_sensitivity",
|
||||
"field": lang['Maximum Change'],
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
"name": "threshold",
|
||||
"field": lang['Trigger Threshold'],
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
"name": "color_threshold",
|
||||
"field": lang['Color Threshold'],
|
||||
"form-group-class": "col-md-6",
|
||||
},
|
||||
{
|
||||
hidden: true,
|
||||
id: "regions_points",
|
||||
"fieldType": "table",
|
||||
"class": 'table table-striped',
|
||||
},
|
||||
{
|
||||
"class": 'col-md-12',
|
||||
"fieldType": 'div',
|
||||
info: [
|
||||
{
|
||||
"fieldType": "btn",
|
||||
attribute: "href=#",
|
||||
"class": `btn-info toggle-region-still-image`,
|
||||
"btnContent": `<i class="fa fa-retweet"></i> ${lang['Live Stream Toggle']}`,
|
||||
},
|
||||
{
|
||||
"fieldType": "btn",
|
||||
forForm: true,
|
||||
attribute: "href=#",
|
||||
"class": `btn-success`,
|
||||
"btnContent": `<i class="fa fa-check"></i> ${lang['Save']}`,
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": lang["Primary"],
|
||||
"color": "blue",
|
||||
"section-class": "hide-box-wrapper",
|
||||
"box-wrapper-class": "row",
|
||||
isFormGroupGroup: true,
|
||||
"info": [
|
||||
{
|
||||
"name": "detail=detector_sensitivity",
|
||||
"field": lang['Minimum Change'],
|
||||
"description": "The motion confidence rating must exceed this value to be seen as a trigger. This number correlates directly to the confidence rating returned by the motion detector. This option was previously named \"Indifference\".",
|
||||
"default": "10",
|
||||
"example": "10",
|
||||
},
|
||||
{
|
||||
"name": "detail=detector_max_sensitivity",
|
||||
"field": lang["Maximum Change"],
|
||||
"description": "The motion confidence rating must be lower than this value to be seen as a trigger. Leave blank for no maximum. This option was previously named \"Max Indifference\".",
|
||||
"default": "",
|
||||
"example": "75",
|
||||
},
|
||||
{
|
||||
"name": "detail=detector_threshold",
|
||||
"field": lang["Trigger Threshold"],
|
||||
"description": lang["fieldTextDetectorThreshold"],
|
||||
"default": "1",
|
||||
"example": "3",
|
||||
"possible": "Any non-negative integer."
|
||||
},
|
||||
{
|
||||
"name": "detail=detector_color_threshold",
|
||||
"field": lang["Color Threshold"],
|
||||
"description": lang["fieldTextDetectorColorThreshold"],
|
||||
"default": "9",
|
||||
"example": "9",
|
||||
"possible": "Any non-negative integer."
|
||||
},
|
||||
{
|
||||
"name": "detail=detector_frame",
|
||||
"field": lang["Full Frame Detection"],
|
||||
"description": lang["fieldTextDetectorFrame"],
|
||||
"default": "1",
|
||||
"fieldType": "select",
|
||||
"possible": [
|
||||
{
|
||||
"name": lang.No,
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"name": lang.Yes,
|
||||
"value": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "detail=detector_motion_tile_mode",
|
||||
"field": lang['Accuracy Mode'],
|
||||
"default": "1",
|
||||
"example": "",
|
||||
"fieldType": "select",
|
||||
"possible": [
|
||||
{
|
||||
"name": lang.No,
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"name": lang.Yes,
|
||||
"value": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "detail=detector_tile_size",
|
||||
"field": lang["Tile Size"],
|
||||
"description": lang.fieldTextTileSize,
|
||||
"default": "20",
|
||||
},
|
||||
{
|
||||
"name": "detail=use_detector_filters",
|
||||
"field": lang['Event Filters'],
|
||||
"description": lang.fieldTextEventFilters,
|
||||
"default": "0",
|
||||
"fieldType": "select",
|
||||
"possible": [
|
||||
{
|
||||
"name": lang.No,
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"name": lang.Yes,
|
||||
"value": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "detail=use_detector_filters_object",
|
||||
"field": lang['Filter for Objects only'],
|
||||
"default": "0",
|
||||
"fieldType": "select",
|
||||
"possible": [
|
||||
{
|
||||
"name": lang.No,
|
||||
"value": "0"
|
||||
},
|
||||
{
|
||||
"name": lang.Yes,
|
||||
"value": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
]
|
||||
},
|
||||
"Points": {
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ $(document).ready(function(e){
|
|||
}
|
||||
}
|
||||
var loadRegionEditor = function(monitor){
|
||||
regionEditorForm.find('input').prop('disabled',false)
|
||||
var theCanvas = getRegionEditorCanvas()
|
||||
var monitorDetails = Object.assign({},monitor.details)
|
||||
var imageWidth = !isNaN(monitorDetails.detector_scale_x) ? parseInt(monitorDetails.detector_scale_x) : 640
|
||||
|
|
@ -59,6 +60,13 @@ $(document).ready(function(e){
|
|||
}
|
||||
regionViewerDetails = monitorDetails;
|
||||
initiateRegionList()
|
||||
loadPrimaryFields(monitor)
|
||||
}
|
||||
function loadPrimaryFields(monitor){
|
||||
var monitorDetails = Object.assign({},monitor.details)
|
||||
$.each(monitorDetails,function(n,v){
|
||||
regionEditorForm.find(`[detail="${n}"]`).val(v)
|
||||
})
|
||||
}
|
||||
var drawPointsTable = function(){
|
||||
var currentRegionId = getCurrentlySelectedRegionId()
|
||||
|
|
@ -90,6 +98,12 @@ $(document).ready(function(e){
|
|||
var monitorId = getCurrentlySelectedMonitorId()
|
||||
var monitorConfig = Object.assign({},loadedMonitors[monitorId])
|
||||
var regionCoordinates = Object.assign({},coorindates || regionViewerDetails.cords instanceof Object ? regionViewerDetails.cords : safeJsonParse(regionViewerDetails.cords) || {});
|
||||
regionEditorForm.find('[detail]').each(function(n,v){
|
||||
var el = $(this);
|
||||
var key = el.attr('detail')
|
||||
var value = el.val()
|
||||
monitorConfig.details[key] = value;
|
||||
});
|
||||
monitorConfig.details.cords = JSON.stringify(regionCoordinates)
|
||||
monitorConfig.details = JSON.stringify(monitorConfig.details)
|
||||
$.post(getApiPrefix(`configureMonitor`)+ '/' + monitorId,{
|
||||
|
|
@ -311,9 +325,7 @@ $(document).ready(function(e){
|
|||
}
|
||||
})
|
||||
addOnTabOpen('regionEditor', function () {
|
||||
if(!regionEditorMonitorsList.val()){
|
||||
drawMonitorListToSelector(regionEditorMonitorsList,true)
|
||||
}
|
||||
drawMonitorListToSelector(regionEditorMonitorsList,true)
|
||||
initLiveStream()
|
||||
})
|
||||
addOnTabReopen('regionEditor', function () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue