Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

303 lines
7.2 KiB

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$SI = 0;
$SOK = false;
$FOK = false;
if( isset( $_POST['SEN'] ) ) $SI = intval( $_POST['SEN'] );
if( $SI ){
$FOK = true;
$QS = "SELECT * FROM `lrf_sensors` WHERE `id`={$SI}";
$JJR = $DATABASE->Query( $QS, false );
if( count( $JJR ) ){
$DD = $JJR[0];
//$QS = "SELECT * FROM `lrf_detection_profiles` WHERE `aux_id`={$SI} AND `profile_id`=0 AND `lrf_id`=0 AND `master`=1";
$QS = "SELECT * FROM `lrf_detection_profiles` WHERE `aux_id`={$SI} AND `profile_id`=0 AND `lrf_id`=0 ORDER BY `master` DESC";
$JJR = $DATABASE->Query( $QS, false );
$SD = $JJR[0];
if( $DD['type'] == 1 ){
// Dual LRF Device (ALS)
$AD = $JJR[1];
};
$DD['dc_auto'] = intval( $DD['dc_auto'] );
$DD['dc_no'] = intval( $DD['dc_no'] );
$DD['dc_window'] = intval( $DD['dc_window'] );
$SOK = true;
} else {
$MSG = 'The Sensor ID is Wrong!';
};
} else {
$MSG = 'The Sensor ID not Set!';
};
$LILI=<<<_DATA_BOUNDARY
,listeners:{
afterrender: function(){
Ext.Msg.show({
title: '{$Labels->GetLabel('_INFO_')}',
msg: '{$MSG}',
buttons: Ext.Msg.OK,
fn: function(){
var tt = Ext.getCmp('up_se_popanel');
tt.removeAll( true );
tt.doLayout();
},
icon: Ext.MessageBox.INFO
});
}
}
_DATA_BOUNDARY;
$SLRFDET=<<<_DATA_BOUNDARY
,{
xtype: 'panel',
id: 'up_sse_popanel',
border: true,
title: '{$Labels->GetLabel('_SLV_LRF_DET_SET_')}',
frame: false,
labelWidth: 150,
labelAlign: 'right',
layout: 'form',
height: PanelH-42,
items:[{
xtype: 'numberfield',
id: 's_order',
fieldLabel: 'Order',
value: '{$AD['order']}'
},{
xtype: 'numberfield',
id: 's_offset',
fieldLabel: 'Offset',
value: '{$AD['offset']}'
},{
xtype: 'numberfield',
id: 's_delta',
fieldLabel: 'Delta',
value: '{$AD['delta']}'
},{
xtype: 'numberfield',
id: 's_flip',
fieldLabel: 'Flip',
value: '{$AD['flip']}'
},{
xtype: 'numberfield',
id: 's_width',
fieldLabel: 'Width',
value: '{$AD['width']}'
},{
xtype: 'numberfield',
id: 's_sst',
fieldLabel: 'SST',
value: '{$AD['sst']}'
},{
xtype: 'numberfield',
id: 's_sun',
fieldLabel: 'Sun',
value: '{$AD['sun']}'
}]
}
_DATA_BOUNDARY;
$TPL=<<<_DATA_BOUNDARY
{
xtype: 'tabpanel',
activeTab: 0,
frame: true,
border: true,
bbar:[{
text: 'Apply Settings',
handler: function(){
var moder = Ext.getCmp('m_order').getValue();
var moset = Ext.getCmp('m_offset').getValue();
var model = Ext.getCmp('m_delta').getValue();
var mofli = Ext.getCmp('m_flip').getValue();
var mowid = Ext.getCmp('m_width').getValue();
var mosst = Ext.getCmp('m_sst').getValue();
var mosun = Ext.getCmp('m_sun').getValue();
var soder = Ext.getCmp('s_order').getValue();
var soset = Ext.getCmp('s_offset').getValue();
var sodel = Ext.getCmp('s_delta').getValue();
var sofli = Ext.getCmp('s_flip').getValue();
var sowid = Ext.getCmp('s_width').getValue();
var sosst = Ext.getCmp('s_sst').getValue();
var sosun = Ext.getCmp('s_sun').getValue();
Ext.Ajax.request({
url: '/lib/controller/doSensorOperation.php',
params: {
UID: {$UserID},
SID: '{$Session}',
SNID: '{$SI}',
OPID: 19,
MOFF: moset,
MORD: moder,
MDEL: model,
MFLI: mofli,
MWIZ: mowid,
MSST: mosst,
MSUN: mosun,
SOFF: soset,
SORD: soder,
SDEL: sodel,
SFLI: sofli,
SWIZ: sowid,
SSST: sosst,
SSUN: sosun
},
success: function( response, opts ){
Ext.Msg.show({
title: '{$Labels->GetLabel('_INFO_')}',
msg: '{$Labels->GetLabel('_SARE_SAVED_')}',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
},
failure: failureAJAXFunction
});
}
}],
items:[{
xtype: 'panel',
id: 'up_se_popanel',
border: true,
title: '{$Labels->GetLabel('_MAS_LRF_DET_SET_')}',
frame: false,
labelWidth: 150,
labelAlign: 'right',
layout: 'form',
height: PanelH-42,
items:[{
xtype: 'numberfield',
id: 'm_order',
fieldLabel: 'Order',
value: '{$SD['order']}'
},{
xtype: 'numberfield',
id: 'm_offset',
fieldLabel: 'Offset',
value: '{$SD['offset']}'
},{
xtype: 'numberfield',
id: 'm_delta',
fieldLabel: 'Delta',
value: '{$SD['delta']}'
},{
xtype: 'numberfield',
id: 'm_flip',
fieldLabel: 'Flip',
value: '{$SD['flip']}'
},{
xtype: 'numberfield',
id: 'm_width',
fieldLabel: 'Width',
value: '{$SD['width']}'
},{
xtype: 'numberfield',
id: 'm_sst',
fieldLabel: 'SST',
value: '{$SD['sst']}'
},{
xtype: 'numberfield',
id: 'm_sun',
fieldLabel: 'Sun',
value: '{$SD['sun']}'
}]
}%%%SLAVE_LRF_DET%%%,{
title: '{$Labels->GetLabel('_DET_SET_WIDTH_T_')}',
height: PanelH-42,
tbar:[{
text: '{$Labels->GetLabel('_EDIT_')}',
id: 'edit_btn_width_table',
disabled: true,
handler: editWidthTableRecord
}],
layout:'fit',
items:{
xtype: 'grid',
border: false,
frame: false,
autoScroll: true,
//width: '100%',
lazyRender: true,
//height: 210,
ds: targetWidthTable_store,
cm: new Ext.grid.ColumnModel( targetWidthTableColModel_ops ),
sm: new Ext.grid.RowSelectionModel( widthTableSelModel_ops ),
viewConfig: {
// forceFit: true
},
},
listeners:{
afterrender: function(){
loadWidthTable({$SI});
}
}
},{
title: '{$Labels->GetLabel('_DC_CONTROL_SET_')}',
height: PanelH-42,
labelWidth: 200,
labelAlign: 'right',
layout: 'form',
items:[{
xtype: 'checkbox',
id: 'dc_ena',
fieldLabel: '{$Labels->GetLabel('_DC_AUTO_ENA_')}',
checked: {$DD['dc_auto']},
listeners:{
check: function( a, c ){
if( c ){
doSensorOperation( {$SI}, 27, 1, true );
} else {
doSensorOperation( {$SI}, 27, 0, true );
};
}
}
},{
xtype: 'combo',
fieldLabel: '{$Labels->GetLabel('_DC_WORK_MODE_')}',
id: 'dc_mode',
editable: false,
typeAhead: true,
triggerAction: 'all',
width: '100%',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['sid', 'snam'],
data: [[0,'{$Labels->GetLabel('_DC_WM_NC_')}'], [1,'{$Labels->GetLabel('_DC_WM_NO_')}']]
}),
value: {$DD['dc_no']},
valueField: 'sid',
displayField: 'snam',listeners:{
select: function( a, c, b ){
doSensorOperation( {$SI}, 28, b, true );
}
}
},{
xtype: 'numberfield',
id: 'dc_window',
fieldLabel: '{$Labels->GetLabel('_DC_TIME_WINDOW_')}',
value: {$DD['dc_window']},
listeners:{
change: function( a, c, b ){
doSensorOperation( {$SI}, 29, c, true );
}
}
}]
}]
%%%JUMPAPA%%%
}
_DATA_BOUNDARY;
if( $DD['type'] != 1 ){
$TPL = str_replace('%%%SLAVE_LRF_DET%%%', '', $TPL );
} else {
$TPL = str_replace('%%%SLAVE_LRF_DET%%%', $SLRFDET, $TPL );
};
if( $FOK && $SOK ){
$TPL = str_replace('%%%JUMPAPA%%%', '', $TPL );
} else {
$TPL = str_replace('%%%JUMPAPA%%%', $LILI, $TPL );
};
echo $TPL;
} else {
header('location: /');
};
?>