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.

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