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.

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