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.

308 lines
7.4 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
3 years ago
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. $DD['dc_auto'] = intval( $DD['dc_auto'] );
  23. $DD['dc_no'] = intval( $DD['dc_no'] );
  24. $DD['dc_window'] = intval( $DD['dc_window'] );
  25. $SOK = true;
  26. } else {
  27. $MSG = 'The Sensor ID is Wrong!';
  28. };
  29. } else {
  30. $MSG = 'The Sensor ID not Set!';
  31. };
  32. $LILI=<<<_DATA_BOUNDARY
  33. ,listeners:{
  34. afterrender: function(){
  35. Ext.Msg.show({
  36. title: '{$Labels->GetLabel('_INFO_')}',
  37. msg: '{$MSG}',
  38. buttons: Ext.Msg.OK,
  39. fn: function(){
  40. var tt = Ext.getCmp('up_se_popanel');
  41. tt.removeAll( true );
  42. tt.doLayout();
  43. },
  44. icon: Ext.MessageBox.INFO
  45. });
  46. }
  47. }
  48. _DATA_BOUNDARY;
  49. $SLRFDET=<<<_DATA_BOUNDARY
  50. ,{
  51. xtype: 'panel',
  52. id: 'up_sse_popanel',
  53. border: true,
  54. title: '{$Labels->GetLabel('_SLV_LRF_DET_SET_')}',
  55. frame: false,
  56. labelWidth: 150,
  57. labelAlign: 'right',
  58. layout: 'form',
  59. height: PanelH-42,
  60. items:[{
  61. xtype: 'numberfield',
  62. id: 's_order',
  63. fieldLabel: 'Order',
  64. value: '{$AD['order']}'
  65. },{
  66. xtype: 'numberfield',
  67. id: 's_offset',
  68. fieldLabel: 'Offset',
  69. value: '{$AD['offset']}'
  70. },{
  71. xtype: 'numberfield',
  72. id: 's_delta',
  73. fieldLabel: 'Delta',
  74. value: '{$AD['delta']}'
  75. },{
  76. xtype: 'numberfield',
  77. id: 's_flip',
  78. fieldLabel: 'Flip',
  79. value: '{$AD['flip']}'
  80. },{
  81. xtype: 'numberfield',
  82. id: 's_width',
  83. fieldLabel: 'Width',
  84. value: '{$AD['width']}'
  85. },{
  86. xtype: 'numberfield',
  87. id: 's_sst',
  88. fieldLabel: 'SST',
  89. value: '{$AD['sst']}'
  90. },{
  91. xtype: 'numberfield',
  92. id: 's_sun',
  93. fieldLabel: 'Sun',
  94. value: '{$AD['sun']}'
  95. }]
  96. }
  97. _DATA_BOUNDARY;
  98. $TPL=<<<_DATA_BOUNDARY
  99. {
  100. xtype: 'tabpanel',
  101. activeTab: 0,
  102. frame: true,
  103. border: true,
  104. bbar:[{
  105. text: 'Apply Settings',
  106. handler: function(){
  107. var moder = Ext.getCmp('m_order').getValue();
  108. var moset = Ext.getCmp('m_offset').getValue();
  109. var model = Ext.getCmp('m_delta').getValue();
  110. var mofli = Ext.getCmp('m_flip').getValue();
  111. var mowid = Ext.getCmp('m_width').getValue();
  112. var mosst = Ext.getCmp('m_sst').getValue();
  113. var mosun = Ext.getCmp('m_sun').getValue();
  114. var soder = Ext.getCmp('s_order').getValue();
  115. var soset = Ext.getCmp('s_offset').getValue();
  116. var sodel = Ext.getCmp('s_delta').getValue();
  117. var sofli = Ext.getCmp('s_flip').getValue();
  118. var sowid = Ext.getCmp('s_width').getValue();
  119. var sosst = Ext.getCmp('s_sst').getValue();
  120. var sosun = Ext.getCmp('s_sun').getValue();
  121. Ext.Ajax.request({
  122. url: '/lib/controller/doSensorOperation.php',
  123. params: {
  124. UID: {$UserID},
  125. SID: '{$Session}',
  126. SNID: '{$SI}',
  127. OPID: 19,
  128. MOFF: moset,
  129. MORD: moder,
  130. MDEL: model,
  131. MFLI: mofli,
  132. MWIZ: mowid,
  133. MSST: mosst,
  134. MSUN: mosun,
  135. SOFF: soset,
  136. SORD: soder,
  137. SDEL: sodel,
  138. SFLI: sofli,
  139. SWIZ: sowid,
  140. SSST: sosst,
  141. SSUN: sosun
  142. },
  143. success: function( response, opts ){
  144. Ext.Msg.show({
  145. title: '{$Labels->GetLabel('_INFO_')}',
  146. msg: '{$Labels->GetLabel('_SARE_SAVED_')}',
  147. buttons: Ext.Msg.OK,
  148. icon: Ext.MessageBox.INFO
  149. });
  150. },
  151. failure: failureAJAXFunction
  152. });
  153. }
  154. }],
  155. items:[{
  156. xtype: 'panel',
  157. id: 'up_se_popanel',
  158. border: true,
  159. title: '{$Labels->GetLabel('_MAS_LRF_DET_SET_')}',
  160. frame: false,
  161. labelWidth: 150,
  162. labelAlign: 'right',
  163. layout: 'form',
  164. height: PanelH-42,
  165. items:[{
  166. xtype: 'numberfield',
  167. id: 'm_order',
  168. fieldLabel: 'Order',
  169. value: '{$SD['order']}'
  170. },{
  171. xtype: 'numberfield',
  172. id: 'm_offset',
  173. fieldLabel: 'Offset',
  174. value: '{$SD['offset']}'
  175. },{
  176. xtype: 'numberfield',
  177. id: 'm_delta',
  178. fieldLabel: 'Delta',
  179. value: '{$SD['delta']}'
  180. },{
  181. xtype: 'numberfield',
  182. id: 'm_flip',
  183. fieldLabel: 'Flip',
  184. value: '{$SD['flip']}'
  185. },{
  186. xtype: 'numberfield',
  187. id: 'm_width',
  188. fieldLabel: 'Width',
  189. value: '{$SD['width']}'
  190. },{
  191. xtype: 'numberfield',
  192. id: 'm_sst',
  193. fieldLabel: 'SST',
  194. value: '{$SD['sst']}'
  195. },{
  196. xtype: 'numberfield',
  197. id: 'm_sun',
  198. fieldLabel: 'Sun',
  199. value: '{$SD['sun']}'
  200. }]
  201. }%%%SLAVE_LRF_DET%%%,{
  202. title: '{$Labels->GetLabel('_DET_SET_WIDTH_T_')}',
  203. height: PanelH-42,
  204. tbar:[{
  205. text: '{$Labels->GetLabel('__ADD__')}',
  206. id: 'add_btn_width_table',
  207. handler: function(){
  208. addWidthTableRecord({$SI});
  209. }
  210. },{
  211. text: '{$Labels->GetLabel('_DEL_SELECTED_')}',
  212. disabled: true,
  213. id: 'del_btn_width_table',
  214. handler: deleteWTRow
  215. }],
  216. layout:'fit',
  217. items:{
  218. xtype: 'grid',
  219. border: false,
  220. frame: false,
  221. autoScroll: true,
  222. //width: '100%',
  223. lazyRender: true,
  224. //height: 210,
  225. ds: targetWidthTable_store,
  226. cm: new Ext.grid.ColumnModel( targetWidthTableColModel_ops ),
  227. sm: new Ext.grid.RowSelectionModel( widthTableSelModel_ops ),
  228. viewConfig: {
  229. // forceFit: true
  230. },
  231. },
  232. listeners:{
  233. afterrender: function(){
  234. loadWidthTable({$SI});
  235. }
  236. }
  237. },{
  238. title: '{$Labels->GetLabel('_DC_CONTROL_SET_')}',
  239. height: PanelH-42,
  240. labelWidth: 200,
  241. labelAlign: 'right',
  242. layout: 'form',
  243. items:[{
  244. xtype: 'checkbox',
  245. id: 'dc_ena',
  246. fieldLabel: '{$Labels->GetLabel('_DC_AUTO_ENA_')}',
  247. checked: {$DD['dc_auto']},
  248. listeners:{
  249. check: function( a, c ){
  250. if( c ){
  251. doSensorOperation( {$SI}, 27, 1, true );
  252. } else {
  253. doSensorOperation( {$SI}, 27, 0, true );
  254. };
  255. }
  256. }
  257. },{
  258. xtype: 'combo',
  259. fieldLabel: '{$Labels->GetLabel('_DC_WORK_MODE_')}',
  260. id: 'dc_mode',
  261. editable: false,
  262. typeAhead: true,
  263. triggerAction: 'all',
  264. width: '100%',
  265. lazyRender:true,
  266. mode: 'local',
  267. store: new Ext.data.ArrayStore({
  268. fields: ['sid', 'snam'],
  269. data: [[0,'{$Labels->GetLabel('_DC_WM_NO_')}'], [1,'{$Labels->GetLabel('_DC_WM_NC_')}']]
  270. }),
  271. value: {$DD['dc_no']},
  272. valueField: 'sid',
  273. displayField: 'snam',listeners:{
  274. select: function( a, c, b ){
  275. doSensorOperation( {$SI}, 28, b, true );
  276. }
  277. }
  278. },{
  279. xtype: 'numberfield',
  280. id: 'dc_window',
  281. fieldLabel: '{$Labels->GetLabel('_DC_TIME_WINDOW_')}',
  282. value: {$DD['dc_window']},
  283. listeners:{
  284. change: function( a, c, b ){
  285. doSensorOperation( {$SI}, 29, c, true );
  286. }
  287. }
  288. }]
  289. }]
  290. %%%JUMPAPA%%%
  291. }
  292. _DATA_BOUNDARY;
  293. if( $DD['type'] != 1 ){
  294. $TPL = str_replace('%%%SLAVE_LRF_DET%%%', '', $TPL );
  295. } else {
  296. $TPL = str_replace('%%%SLAVE_LRF_DET%%%', $SLRFDET, $TPL );
  297. };
  298. if( $FOK && $SOK ){
  299. $TPL = str_replace('%%%JUMPAPA%%%', '', $TPL );
  300. } else {
  301. $TPL = str_replace('%%%JUMPAPA%%%', $LILI, $TPL );
  302. };
  303. echo $TPL;
  304. } else {
  305. header('location: /');
  306. };
  307. ?>