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.

262 lines
6.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $SI = 0;
  5. $SOK = false;
  6. $FOK = false;
  7. if( isset( $_POST['SEN'] ) ) $SI = intval( $_POST['SEN'] );
  8. if( $SI ){
  9. $FOK = true;
  10. $QS = "SELECT * FROM `lrf_sensors` WHERE `id`={$SI}";
  11. $JJR = $DATABASE->Query( $QS, false );
  12. if( count( $JJR ) ){
  13. $DD = $JJR[0];
  14. //$QS = "SELECT * FROM `lrf_detection_profiles` WHERE `aux_id`={$SI} AND `profile_id`=0 AND `lrf_id`=0 AND `master`=1";
  15. $QS = "SELECT * FROM `lrf_detection_profiles` WHERE `aux_id`={$SI} AND `profile_id`=0 AND `lrf_id`=0 ORDER BY `master` DESC";
  16. $JJR = $DATABASE->Query( $QS, false );
  17. $SD = $JJR[0];
  18. if( $DD['type'] == 1 ){
  19. // Dual LRF Device (ALS)
  20. $AD = $JJR[1];
  21. };
  22. $SOK = true;
  23. } else {
  24. $MSG = 'The Sensor ID is Wrong!';
  25. };
  26. } else {
  27. $MSG = 'The Sensor ID not Set!';
  28. };
  29. $LILI=<<<_DATA_BOUNDARY
  30. ,listeners:{
  31. afterrender: function(){
  32. Ext.Msg.show({
  33. title: '{$Labels->GetLabel('_INFO_')}',
  34. msg: '{$MSG}',
  35. buttons: Ext.Msg.OK,
  36. fn: function(){
  37. var tt = Ext.getCmp('up_se_popanel');
  38. tt.removeAll( true );
  39. tt.doLayout();
  40. },
  41. icon: Ext.MessageBox.INFO
  42. });
  43. }
  44. }
  45. _DATA_BOUNDARY;
  46. $TPL=<<<_DATA_BOUNDARY
  47. {
  48. xtype: 'tabpanel',
  49. activeTab: 0,
  50. frame: true,
  51. border: true,
  52. bbar:[{
  53. text: 'Apply Settings',
  54. handler: function(){
  55. var oder = Ext.getCmp('ups_order').getValue();
  56. var oset = Ext.getCmp('ups_offset').getValue();
  57. var odel = Ext.getCmp('ups_delta').getValue();
  58. var ofli = Ext.getCmp('ups_flip').getValue();
  59. var owid = Ext.getCmp('ups_width').getValue();
  60. var osst = Ext.getCmp('ups_sst').getValue();
  61. var osun = Ext.getCmp('ups_sun').getValue();
  62. Ext.Ajax.request({
  63. url: '/lib/controller/doSensorOperation.php',
  64. params: {
  65. UID: {$UserID},
  66. SID: '{$Session}',
  67. SNID: '{$SI}',
  68. OPID: 19,
  69. OFF: oset,
  70. ORD: oder,
  71. DEL: odel,
  72. FLI: ofli,
  73. WIZ: owid,
  74. SST: osst,
  75. SUN: osun
  76. },
  77. success: function( response, opts ){
  78. Ext.Msg.show({
  79. title: 'Information',
  80. msg: 'Settings are Saved',
  81. buttons: Ext.Msg.OK,
  82. icon: Ext.MessageBox.INFO
  83. });
  84. },
  85. failure: failureAJAXFunction
  86. });
  87. }
  88. }],
  89. items:[{
  90. xtype: 'panel',
  91. id: 'up_se_popanel',
  92. border: true,
  93. title: '{$Labels->GetLabel('_MAS_LRF_DET_SET_')}',
  94. frame: false,
  95. labelWidth: 150,
  96. labelAlign: 'right',
  97. layout: 'form',
  98. height: PanelH-42,
  99. items:[{
  100. xtype: 'numberfield',
  101. id: 'm_order',
  102. fieldLabel: 'Order',
  103. value: '{$SD['order']}'
  104. },{
  105. xtype: 'numberfield',
  106. id: 'm_offset',
  107. fieldLabel: 'Offset',
  108. value: '{$SD['offset']}'
  109. },{
  110. xtype: 'numberfield',
  111. id: 'm_delta',
  112. fieldLabel: 'Delta',
  113. value: '{$SD['delta']}'
  114. },{
  115. xtype: 'numberfield',
  116. id: 'm_flip',
  117. fieldLabel: 'Flip',
  118. value: '{$SD['flip']}'
  119. },{
  120. xtype: 'numberfield',
  121. id: 'm_width',
  122. fieldLabel: 'Width',
  123. value: '{$SD['width']}'
  124. },{
  125. xtype: 'numberfield',
  126. id: 'm_sst',
  127. fieldLabel: 'SST',
  128. value: '{$SD['sst']}'
  129. },{
  130. xtype: 'numberfield',
  131. id: 'm_sun',
  132. fieldLabel: 'Sun',
  133. value: '{$SD['sun']}'
  134. }]
  135. },{
  136. xtype: 'panel',
  137. id: 'up_sse_popanel',
  138. border: true,
  139. title: '{$Labels->GetLabel('_SLV_LRF_DET_SET_')}',
  140. frame: false,
  141. labelWidth: 150,
  142. labelAlign: 'right',
  143. layout: 'form',
  144. height: PanelH-42,
  145. items:[{
  146. xtype: 'numberfield',
  147. id: 's_order',
  148. fieldLabel: 'Order',
  149. value: '{$SD['order']}'
  150. },{
  151. xtype: 'numberfield',
  152. id: 's_offset',
  153. fieldLabel: 'Offset',
  154. value: '{$SD['offset']}'
  155. },{
  156. xtype: 'numberfield',
  157. id: 's_delta',
  158. fieldLabel: 'Delta',
  159. value: '{$SD['delta']}'
  160. },{
  161. xtype: 'numberfield',
  162. id: 's_flip',
  163. fieldLabel: 'Flip',
  164. value: '{$SD['flip']}'
  165. },{
  166. xtype: 'numberfield',
  167. id: 's_width',
  168. fieldLabel: 'Width',
  169. value: '{$SD['width']}'
  170. },{
  171. xtype: 'numberfield',
  172. id: 's_sst',
  173. fieldLabel: 'SST',
  174. value: '{$SD['sst']}'
  175. },{
  176. xtype: 'numberfield',
  177. id: 's_sun',
  178. fieldLabel: 'Sun',
  179. value: '{$SD['sun']}'
  180. }]
  181. },{
  182. title: '{$Labels->GetLabel('_DET_SET_WIDTH_T_')}',
  183. height: PanelH-42,
  184. tbar:[{
  185. text: '{$Labels->GetLabel('__ADD__')}',
  186. id: 'add_btn_width_table',
  187. handler: function(){
  188. addWidthTableRecord({$SI});
  189. }
  190. },{
  191. text: '{$Labels->GetLabel('_DEL_SELECTED_')}',
  192. disabled: true,
  193. id: 'del_btn_width_table',
  194. handler: function(){
  195. }
  196. }],
  197. layout:'fit',
  198. items:{
  199. xtype: 'grid',
  200. border: false,
  201. frame: false,
  202. autoScroll: true,
  203. //width: '100%',
  204. lazyRender: true,
  205. //height: 210,
  206. ds: targetWidthTable_store,
  207. cm: new Ext.grid.ColumnModel( targetWidthTableColModel_ops ),
  208. sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
  209. viewConfig: {
  210. // forceFit: true
  211. },
  212. }
  213. },{
  214. title: '{$Labels->GetLabel('_DC_CONTROL_SET_')}',
  215. height: PanelH-42,
  216. labelWidth: 200,
  217. labelAlign: 'right',
  218. layout: 'form',
  219. items:[{
  220. xtype: 'checkbox',
  221. id: 'dc_ena',
  222. fieldLabel: '{$Labels->GetLabel('_DC_AUTO_ENA_')}',
  223. checked: true,
  224. },{
  225. xtype: 'combo',
  226. fieldLabel: '{$Labels->GetLabel('_DC_WORK_MODE_')}',
  227. id: 'dc_mode',
  228. editable: false,
  229. typeAhead: true,
  230. triggerAction: 'all',
  231. width: '100%',
  232. lazyRender:true,
  233. mode: 'local',
  234. store: new Ext.data.ArrayStore({
  235. fields: ['sid', 'snam'],
  236. data: [[0,'{$Labels->GetLabel('_DC_WM_NO_')}'], [1,'{$Labels->GetLabel('_DC_WM_NC_')}']]
  237. }),
  238. value: 0,
  239. valueField: 'sid',
  240. displayField: 'snam'
  241. },{
  242. xtype: 'numberfield',
  243. id: 'dc_window',
  244. fieldLabel: '{$Labels->GetLabel('_DC_TIME_WINDOW_')}',
  245. value: 2
  246. }]
  247. }]
  248. %%%JUMPAPA%%%
  249. }
  250. _DATA_BOUNDARY;
  251. if( $FOK && $SOK ){
  252. $TPL = str_replace('%%%JUMPAPA%%%', '', $TPL );
  253. } else {
  254. $TPL = str_replace('%%%JUMPAPA%%%', $LILI, $TPL );
  255. };
  256. echo $TPL;
  257. } else {
  258. header('location: /');
  259. };
  260. ?>