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.

321 lines
7.8 KiB

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