Web UI for ARGUS server
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.

128 lines
3.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. {
  2. xtype: 'form',
  3. labelWidth: 40, // label settings here cascade unless overridden
  4. frame: false,
  5. bodyStyle:'padding:5px 5px 0',
  6. defaultType: 'textfield',
  7. items: [{
  8. xtype: 'panel',
  9. height: 100,
  10. html: '<p align="center"><img src="/style/assets/3_node.png"><br/>%%%DEV_LABEL%%%<br/></p>'
  11. },{
  12. xtype:'fieldset',
  13. //checkboxToggle:true,
  14. collapsible: true,
  15. title: 'Device',
  16. autoHeight: true,
  17. defaults: {
  18. //width: 180
  19. },
  20. collapsed: false,
  21. items :[{
  22. xtype: 'hidden',
  23. id: 'dev_name',
  24. name: 'dev_name',
  25. value: '%%%DEV_LABEL%%%'
  26. },{
  27. xtype: 'hidden',
  28. id: 'max_range',
  29. name: 'max_range',
  30. value: %%%MAX_RANGE%%%
  31. },{
  32. xtype: 'hidden',
  33. id: 'dev_id',
  34. name: 'dev_id',
  35. value: %%%DEVICE_ID%%%
  36. },{
  37. xtype: 'panel',
  38. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Range: %%%MAX_RANGE%%%</p>'
  39. },{
  40. xtype: 'panel',
  41. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Dev Address: %%%DEVICE_ID%%%</p>'
  42. }]
  43. },{
  44. xtype: 'button',
  45. text: 'Change Settings',
  46. width: '100%',
  47. handler: function(){
  48. return LRF1D2_settings();
  49. var wAddSocket = new Ext.Window({
  50. title: 'Sensor Settings',
  51. width: 450,
  52. //height: 480,
  53. items:[{
  54. xtype: 'form',
  55. labelWidth: 120, // label settings here cascade unless overridden
  56. frame: false,
  57. bodyStyle:'padding:5px 5px 0',
  58. defaultType: 'textfield',
  59. items:[{
  60. fieldLabel: 'Device Name',
  61. id: 'ued_name'
  62. },{
  63. fieldLabel: 'Device Address',
  64. id: 'ued_address'
  65. },{
  66. fieldLabel: 'Maximal Range',
  67. id: 'ued_range'
  68. }]
  69. }],
  70. buttons:[{
  71. text: 'Cancel',
  72. handler: function(){
  73. wAddSocket.close();
  74. wAddSocket = null;
  75. }
  76. },{
  77. text: 'Apply Settings',
  78. handler: function(){
  79. var val_name = Ext.getCmp('ued_name').getValue();
  80. var val_addr = Ext.getCmp('ued_address').getValue();
  81. var val_range = Ext.getCmp('ued_range').getValue();
  82. Ext.Ajax.request({
  83. url: '/lib/controller/updateLrfSettings.php',
  84. params: {
  85. SENSOR: %%%LRF_ID%%%,
  86. SADDR: val_addr,
  87. SNAME: val_name,
  88. SRANGE: val_range
  89. },
  90. success: function( response, opts ){
  91. wAddSocket.close();
  92. wAddSocket = null;
  93. loadNodeProperties( %%%NODEID%%% );
  94. },
  95. failure: function( response, opts ) {
  96. }
  97. });
  98. }
  99. }]
  100. });
  101. wAddSocket.show();
  102. Ext.getCmp('ued_name').setValue( Ext.getCmp('dev_name').getValue());
  103. Ext.getCmp('ued_address').setValue( Ext.getCmp('dev_id').getValue());
  104. Ext.getCmp('ued_range').setValue( Ext.getCmp('max_range').getValue());
  105. }
  106. },{
  107. xtype:'fieldset',
  108. title: 'LRF Settings',
  109. collapsible: true,
  110. autoHeight: true,
  111. defaults: {
  112. //width: 168
  113. },
  114. items :[{
  115. xtype: 'panel',
  116. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Order: %%%M_ORDER%%%</p>'
  117. },{
  118. xtype: 'panel',
  119. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Offset: %%%M_OFFSET%%%</p>'
  120. },{
  121. xtype: 'panel',
  122. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Width: %%%M_WIDTH%%%</p>'
  123. },{
  124. xtype: 'panel',
  125. html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">SST: %%%M_SST%%%</p>'
  126. }]
  127. }]
  128. }