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.

461 lines
12 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
2 months ago
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
2 months ago
​
​
2 months ago
​
​
2 months ago
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
2 months ago
​
​
2 months ago
​
​
2 months ago
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
2 months ago
​
​
2 months ago
​
​
2 months ago
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
2 months ago
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
2 months ago
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. require_once('../php/argus/server.php');
  4. if( $CUser->Data['id'] > 1 ){
  5. $EID = intval( $_POST['MID'] );
  6. $QS = "SELECT * FROM `modbus_modules` WHERE `id`={$EID}";
  7. $Result = $DATABASE->Query( $QS, false );
  8. if( count( $Result ) ){
  9. $SC = $Result[0];
  10. $CCCV = intval( $SC['values'] );
  11. if( ( $CCCV & 0x01 ) == 0x01 ) $P1 = 'true'; else $P1 = 'false';
  12. if( ( $CCCV & 0x02 ) == 0x02 ) $P2 = 'true'; else $P2 = 'false';
  13. if( ( $CCCV & 0x04 ) == 0x04 ) $P3 = 'true'; else $P3 = 'false';
  14. if( ( $CCCV & 0x08 ) == 0x08 ) $P4 = 'true'; else $P4 = 'false';
  15. $MODBUS=<<<DATA_BOUNDARY
  16. {
  17. xtype: 'panel',
  18. l00ayout: 'table',
  19. border: false,
  20. frame: false,
  21. width: '100%',
  22. items:[{
  23. xtype: 'panel',
  24. layout: 'table',
  25. border: false,
  26. frame: false,
  27. width: '100%',
  28. defaults: { bodyStyle:'padding:10px; text-align: center;'},
  29. layoutConfig: { columns: 2 },
  30. items:[{
  31. xtype: 'panel',
  32. border: false,
  33. frame: false,
  34. width: 160,
  35. html: '<table width="128px" border=0><tr><td class="medium_prop_logo" id="adam">&nbsp;</td></tr></table>'
  36. },{
  37. xtype: 'form',
  38. border: false,
  39. frame: false,
  40. labelWidth: 100,
  41. labelAlign: 'right',
  42. width: '100%',
  43. items:[{
  44. xtype: 'panel',
  45. border: false,
  46. frame: false,
  47. html: '<table width="100%" border=0><tr><td class="small_prop_title" align="center" style="font-size: 14px; font-weight: bold;">{$Labels->GetLabel('_MODBUS_RTU_')}:{$SC['label']}</td><td><img id="scae_onl_sts" src="/style/assets/bul_gray.png"></td></tr></table>'
  48. },{
  49. xtype: 'spacer',
  50. height: 5
  51. },{
  52. xtype: 'textfield',
  53. id: 'sca_label',
  54. fieldLabel: '{$Labels->GetLabel('_NAME_LABEL_')}',
  55. maxlength: 64,
  56. value: '{$SC['label']}',
  57. listeners:{
  58. change: function( a, c, b ){
  59. doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 14, c, true );
  60. }
  61. }
  62. },{
  63. xtype: 'combo',
  64. id: 'sca_ena',
  65. fieldLabel: "{$Labels->GetLabel('_STATUS_')}",
  66. lazyRender: true,
  67. mode: 'local',
  68. forceSelection: true,
  69. triggerAction: 'all',
  70. editable: false,
  71. disableKeyFilter: true,
  72. store: new Ext.data.ArrayStore({
  73. fields: ['mode','mode_txt'],
  74. data: [
  75. ['D','{$Labels->GetLabel('__DISABLED__')}'],
  76. ['E','{$Labels->GetLabel('___ENABLED__')}']
  77. ]
  78. }),
  79. valueField: 'mode',
  80. displayField: 'mode_txt',
  81. value: '{$SC['wm']}',
  82. width: 200,
  83. listeners:{
  84. select: function( a, c, b ){
  85. doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 17, b, true );
  86. }
  87. }
  88. },{
  89. xtype: 'textfield',
  90. id: 'sca_ip',
  91. fieldLabel: '{$Labels->GetLabel('_DEVICE_IP_')}',
  92. maxlength: 64,
  93. value: '{$SC['ip4']}',
  94. listeners:{
  95. change: function( a, c, b ){
  96. doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 15, c, true );
  97. }
  98. }
  99. },{
  100. xtype: 'textfield',
  101. id: 'sca_port',
  102. fieldLabel: '{$Labels->GetLabel('_DEVICE_PORT_')}',
  103. maxlength: 2,
  104. value: '{$SC['port']}',
  105. listeners:{
  106. change: function( a, c, b ){
  107. doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 16, c, true );
  108. }
  109. }
  110. }]
  111. }]
  112. },{
  113. xtype: 'panel',
  114. layout: 'table',
  115. border: true,
  116. frame: false,
  117. width: '100%',
  118. defaults: { bodyStyle:'padding:10px; text-align: center;' },
  119. layoutConfig: { columns: 4 },
  120. items:[{
  121. xtype: 'panel',
  122. bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
  123. html: 'Upper Track'
  124. },{
  125. xtype: 'panel',
  126. bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
  127. html: 'Bottom Track'
  128. },{
  129. xtype: 'panel',
  130. bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
  131. html: 'Health Signal'
  132. },{
  133. xtype: 'panel',
  134. bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
  135. html: 'AUX Signal'
  136. },{
  137. xtype: 'combo',
  138. id: 'sce_cb_o_1',
  139. lazyRender: true,
  140. mode: 'local',
  141. forceSelection: true,
  142. triggerAction: 'all',
  143. editable: false,
  144. disableKeyFilter: true,
  145. store: new Ext.data.ArrayStore({
  146. fields: ['mode','mode_txt'],
  147. data: [
  148. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  149. [1,'Coil D1'],[2,'Coil D2'],[3,'Coil D3'],[4,'Coil D4']
  150. ]
  151. }),
  152. valueField: 'mode',
  153. displayField: 'mode_txt',
  154. value: '0',
  155. width: 120,
  156. listeners:{
  157. select: function( a, c, b ){
  158. doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 21, b, false );
  159. }
  160. }
  161. },{
  162. xtype: 'combo',
  163. id: 'sce_cb_o_2',
  164. lazyRender: true,
  165. mode: 'local',
  166. forceSelection: true,
  167. triggerAction: 'all',
  168. editable: false,
  169. disableKeyFilter: true,
  170. store: new Ext.data.ArrayStore({
  171. fields: ['mode','mode_txt'],
  172. data: [
  173. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  174. [1,'Coil D1'],[2,'Coil D2'],[3,'Coil D3'],[4,'Coil D4']
  175. ]
  176. }),
  177. valueField: 'mode',
  178. displayField: 'mode_txt',
  179. value: '0',
  180. width: 120,
  181. listeners:{
  182. select: function( a, c, b ){
  183. doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 22, b, false );
  184. }
  185. }
  186. },{
  187. xtype: 'combo',
  188. id: 'sce_cb_o_3',
  189. lazyRender: true,
  190. mode: 'local',
  191. forceSelection: true,
  192. triggerAction: 'all',
  193. editable: false,
  194. disableKeyFilter: true,
  195. store: new Ext.data.ArrayStore({
  196. fields: ['mode','mode_txt'],
  197. data: [
  198. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  199. [1,'Coil D1'],[2,'Coil D2'],[3,'Coil D3'],[4,'Coil D4']
  200. ]
  201. }),
  202. valueField: 'mode',
  203. displayField: 'mode_txt',
  204. value: '0',
  205. width: 120,
  206. listeners:{
  207. select: function( a, c, b ){
  208. doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 23, b, false );
  209. }
  210. }
  211. },{
  212. xtype: 'combo',
  213. id: 'sce_cb_o_4',
  214. lazyRender: true,
  215. mode: 'local',
  216. forceSelection: true,
  217. triggerAction: 'all',
  218. editable: false,
  219. disableKeyFilter: true,
  220. store: new Ext.data.ArrayStore({
  221. fields: ['mode','mode_txt'],
  222. data: [
  223. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  224. [1,'Coil D1'],[2,'Coil D2'],[3,'Coil D3'],[4,'Coil D4']
  225. ]
  226. }),
  227. valueField: 'mode',
  228. displayField: 'mode_txt',
  229. value: '0',
  230. width: 120,
  231. listeners:{
  232. select: function( a, c, b ){
  233. doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 24, b, false );
  234. }
  235. }
  236. },{
  237. xtype: 'spacer',
  238. height: 10,
  239. colspan: 4
  240. },{
  241. xtype: 'button',
  242. id: 'sc_tbtn_1',
  243. enableToggle: true,
  244. allowDepress: true,
  245. width: '80%',
  246. text: 'Test D1',
  247. pressed: {$P1},
  248. disabled: true,
  249. handler: function( b, e ){
  250. b.disable();
  251. if( b.pressed ){
  252. doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 1 ), false );
  253. } else {
  254. doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~1 ) ), false );
  255. };
  256. }
  257. },{
  258. xtype: 'button',
  259. id: 'sc_tbtn_2',
  260. width: '80%',
  261. enableToggle: true,
  262. allowDepress: true,
  263. text: 'Test D2',
  264. pressed: {$P2},
  265. disabled: true,
  266. handler: function( b, e ){
  267. b.disable();
  268. if( b.pressed ){
  269. doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 2 ), false );
  270. } else {
  271. doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~2 ) ), false );
  272. };
  273. }
  274. },{
  275. xtype: 'button',
  276. id: 'sc_tbtn_3',
  277. enableToggle: true,
  278. allowDepress: true,
  279. width: '80%',
  280. text: 'Test D3',
  281. pressed: {$P3},
  282. disabled: true,
  283. handler: function( b, e ){
  284. b.disable();
  285. if( b.pressed ){
  286. doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 4 ), false );
  287. } else {
  288. doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~4 ) ), false );
  289. };
  290. }
  291. },{
  292. xtype: 'button',
  293. id: 'sc_tbtn_4',
  294. enableToggle: true,
  295. allowDepress: true,
  296. width: '80%',
  297. text: 'Test D4',
  298. pressed: {$P4},
  299. disabled: true,
  300. handler: function( b, e ){
  301. b.disable();
  302. if( b.pressed ){
  303. doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 8 ), false );
  304. } else {
  305. doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~8 ) ), false );
  306. };
  307. }
  308. },{
  309. xtype: 'spacer',
  310. height: 5,
  311. colspan: 4
  312. },{
  313. xtype: 'panel',
  314. bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
  315. html: 'DI 0 <img id="sce_in_1_img" width="8px" src="/style/assets/sm_ico_gw.png">'
  316. },{
  317. xtype: 'panel',
  318. bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
  319. html: 'DI 1 <img id="sce_in_2_img" width="8px" src="/style/assets/sm_ico_gw.png">'
  320. },{
  321. xtype: 'panel',
  322. bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
  323. html: 'DI 2 <img id="sce_in_3_img" width="8px" src="/style/assets/sm_ico_gw.png">'
  324. },{
  325. xtype: 'panel',
  326. bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
  327. html: 'DI 3 <img id="sce_in_4_img" width="8px" src="/style/assets/sm_ico_gw.png">'
  328. },{
  329. xtype: 'spacer',
  330. height: 5,
  331. colspan: 4
  332. },{
  333. xtype: 'combo',
  334. id: 'sce_cb_i_1',
  335. lazyRender: true,
  336. mode: 'local',
  337. forceSelection: true,
  338. triggerAction: 'all',
  339. editable: false,
  340. disableKeyFilter: true,
  341. store: new Ext.data.ArrayStore({
  342. fields: ['mode','mode_txt'],
  343. data: [
  344. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  345. [1,'Upper Track'],[2,'Bottom Track'],[3,'Both']
  346. ]
  347. }),
  348. valueField: 'mode',
  349. displayField: 'mode_txt',
  350. value: '-1',
  351. width: 120,
  352. listeners:{
  353. select: function( a, c, b ){
  354. //doPlatformOperation( {$SC['platform_id']}, 12, b, true );
  355. }
  356. }
  357. },{
  358. xtype: 'combo',
  359. id: 'sce_cb_i_2',
  360. lazyRender: true,
  361. mode: 'local',
  362. forceSelection: true,
  363. triggerAction: 'all',
  364. editable: false,
  365. disableKeyFilter: true,
  366. store: new Ext.data.ArrayStore({
  367. fields: ['mode','mode_txt'],
  368. data: [
  369. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  370. [1,'Upper Track'],[2,'Bottom Track'],[3,'Both']
  371. ]
  372. }),
  373. valueField: 'mode',
  374. displayField: 'mode_txt',
  375. value: '-1',
  376. width: 120,
  377. listeners:{
  378. select: function( a, c, b ){
  379. //doPlatformOperation( {$SC['platform_id']}, 12, b, true );
  380. }
  381. }
  382. },{
  383. xtype: 'combo',
  384. id: 'sce_cb_i_3',
  385. lazyRender: true,
  386. mode: 'local',
  387. forceSelection: true,
  388. triggerAction: 'all',
  389. editable: false,
  390. disableKeyFilter: true,
  391. store: new Ext.data.ArrayStore({
  392. fields: ['mode','mode_txt'],
  393. data: [
  394. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  395. [1,'Upper Track'],[2,'Bottom Track'],[3,'Both']
  396. ]
  397. }),
  398. valueField: 'mode',
  399. displayField: 'mode_txt',
  400. value: '-1',
  401. width: 120,
  402. listeners:{
  403. select: function( a, c, b ){
  404. //doPlatformOperation( {$SC['platform_id']}, 12, b, true );
  405. }
  406. }
  407. },{
  408. xtype: 'combo',
  409. id: 'sce_cb_i_4',
  410. lazyRender: true,
  411. mode: 'local',
  412. forceSelection: true,
  413. triggerAction: 'all',
  414. editable: false,
  415. disableKeyFilter: true,
  416. store: new Ext.data.ArrayStore({
  417. fields: ['mode','mode_txt'],
  418. data: [
  419. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  420. [1,'Upper Track'],[2,'Bottom Track'],[3,'Both']
  421. ]
  422. }),
  423. valueField: 'mode',
  424. displayField: 'mode_txt',
  425. value: '-1',
  426. width: 120,
  427. listeners:{
  428. select: function( a, c, b ){
  429. //doPlatformOperation( {$SC['platform_id']}, 12, b, true );
  430. }
  431. }
  432. }]
  433. },{
  434. xtype: 'spacer',
  435. height: 5,
  436. colspan: 4
  437. },{
  438. xtype: 'button',
  439. text: 'Remove this Scada Module',
  440. width: '100%',
  441. handler: function(){
  442. doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 19, 'true', true );
  443. }
  444. }],
  445. listeners: {
  446. afterrender: function( panel ){
  447. fetchScadaEditorStatus();
  448. },
  449. beforedestroy: function(panel) {
  450. stopScadaEditorStatusUpdate();
  451. }
  452. }
  453. }
  454. DATA_BOUNDARY;
  455. echo $MODBUS;
  456. } else {
  457. echo '{ xtype: \'panel\', html: \'Node '.$_POST['EID'].' Loadded\'}';
  458. };
  459. } else {
  460. header('location: /');
  461. };
  462. ?>