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.

302 lines
7.2 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. 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('_EDIT_')}',
  206. id: 'edit_btn_width_table',
  207. disabled: true,
  208. handler: editWidthTableRecord
  209. }],
  210. layout:'fit',
  211. items:{
  212. xtype: 'grid',
  213. border: false,
  214. frame: false,
  215. autoScroll: true,
  216. //width: '100%',
  217. lazyRender: true,
  218. //height: 210,
  219. ds: targetWidthTable_store,
  220. cm: new Ext.grid.ColumnModel( targetWidthTableColModel_ops ),
  221. sm: new Ext.grid.RowSelectionModel( widthTableSelModel_ops ),
  222. viewConfig: {
  223. // forceFit: true
  224. },
  225. },
  226. listeners:{
  227. afterrender: function(){
  228. loadWidthTable({$SI});
  229. }
  230. }
  231. },{
  232. title: '{$Labels->GetLabel('_DC_CONTROL_SET_')}',
  233. height: PanelH-42,
  234. labelWidth: 200,
  235. labelAlign: 'right',
  236. layout: 'form',
  237. items:[{
  238. xtype: 'checkbox',
  239. id: 'dc_ena',
  240. fieldLabel: '{$Labels->GetLabel('_DC_AUTO_ENA_')}',
  241. checked: {$DD['dc_auto']},
  242. listeners:{
  243. check: function( a, c ){
  244. if( c ){
  245. doSensorOperation( {$SI}, 27, 1, true );
  246. } else {
  247. doSensorOperation( {$SI}, 27, 0, true );
  248. };
  249. }
  250. }
  251. },{
  252. xtype: 'combo',
  253. fieldLabel: '{$Labels->GetLabel('_DC_WORK_MODE_')}',
  254. id: 'dc_mode',
  255. editable: false,
  256. typeAhead: true,
  257. triggerAction: 'all',
  258. width: '100%',
  259. lazyRender:true,
  260. mode: 'local',
  261. store: new Ext.data.ArrayStore({
  262. fields: ['sid', 'snam'],
  263. data: [[0,'{$Labels->GetLabel('_DC_WM_NC_')}'], [1,'{$Labels->GetLabel('_DC_WM_NO_')}']]
  264. }),
  265. value: {$DD['dc_no']},
  266. valueField: 'sid',
  267. displayField: 'snam',listeners:{
  268. select: function( a, c, b ){
  269. doSensorOperation( {$SI}, 28, b, true );
  270. }
  271. }
  272. },{
  273. xtype: 'numberfield',
  274. id: 'dc_window',
  275. fieldLabel: '{$Labels->GetLabel('_DC_TIME_WINDOW_')}',
  276. value: {$DD['dc_window']},
  277. listeners:{
  278. change: function( a, c, b ){
  279. doSensorOperation( {$SI}, 29, c, true );
  280. }
  281. }
  282. }]
  283. }]
  284. %%%JUMPAPA%%%
  285. }
  286. _DATA_BOUNDARY;
  287. if( $DD['type'] != 1 ){
  288. $TPL = str_replace('%%%SLAVE_LRF_DET%%%', '', $TPL );
  289. } else {
  290. $TPL = str_replace('%%%SLAVE_LRF_DET%%%', $SLRFDET, $TPL );
  291. };
  292. if( $FOK && $SOK ){
  293. $TPL = str_replace('%%%JUMPAPA%%%', '', $TPL );
  294. } else {
  295. $TPL = str_replace('%%%JUMPAPA%%%', $LILI, $TPL );
  296. };
  297. echo $TPL;
  298. } else {
  299. header('location: /');
  300. };
  301. ?>