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.

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