|
|
{ xtype: 'form', labelWidth: 40, // label settings here cascade unless overridden
frame: false, bodyStyle:'padding:5px 5px 0', defaultType: 'textfield', items: [{ xtype: 'panel', height: 100, html: '<p align="center"><img src="/style/assets/3_node.png"><br/>%%%DEV_LABEL%%%<br/></p>' },{ xtype:'fieldset', //checkboxToggle:true,
collapsible: true, title: 'Device', autoHeight: true, defaults: { //width: 180
}, collapsed: false, items :[{ xtype: 'hidden', id: 'dev_name', name: 'dev_name', value: '%%%DEV_LABEL%%%' },{ xtype: 'hidden', id: 'max_range', name: 'max_range', value: %%%MAX_RANGE%%% },{ xtype: 'hidden', id: 'dev_id', name: 'dev_id', value: %%%DEVICE_ID%%% },{ xtype: 'panel', html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Range: %%%MAX_RANGE%%%</p>' },{ xtype: 'panel', html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Dev Address: %%%DEVICE_ID%%%</p>' }] },{ xtype: 'button', text: 'Change Settings', width: '100%', handler: function(){ return LRF1D2_settings(); var wAddSocket = new Ext.Window({ title: 'Sensor Settings', width: 450, //height: 480,
items:[{ xtype: 'form', labelWidth: 120, // label settings here cascade unless overridden
frame: false, bodyStyle:'padding:5px 5px 0', defaultType: 'textfield', items:[{ fieldLabel: 'Device Name', id: 'ued_name' },{ fieldLabel: 'Device Address', id: 'ued_address' },{ fieldLabel: 'Maximal Range', id: 'ued_range' }] }], buttons:[{ text: 'Cancel', handler: function(){ wAddSocket.close(); wAddSocket = null; } },{ text: 'Apply Settings', handler: function(){ var val_name = Ext.getCmp('ued_name').getValue(); var val_addr = Ext.getCmp('ued_address').getValue(); var val_range = Ext.getCmp('ued_range').getValue(); Ext.Ajax.request({ url: '/lib/controller/updateLrfSettings.php', params: { SENSOR: %%%LRF_ID%%%, SADDR: val_addr, SNAME: val_name, SRANGE: val_range }, success: function( response, opts ){ wAddSocket.close(); wAddSocket = null; loadNodeProperties( %%%NODEID%%% ); }, failure: function( response, opts ) { } }); } }] }); wAddSocket.show(); Ext.getCmp('ued_name').setValue( Ext.getCmp('dev_name').getValue()); Ext.getCmp('ued_address').setValue( Ext.getCmp('dev_id').getValue()); Ext.getCmp('ued_range').setValue( Ext.getCmp('max_range').getValue()); } },{ xtype:'fieldset', title: 'LRF Settings', collapsible: true, autoHeight: true, defaults: { //width: 168
}, items :[{ xtype: 'panel', html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%M_ORDER%%%</p>' },{ xtype: 'panel', html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%M_OFFSET%%%</p>' },{ xtype: 'panel', html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%M_WIDTH%%%</p>' },{ xtype: 'panel', html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">SST: %%%M_SST%%%</p>' }] }]}
|