Browse Source

SCADA Editor take2

Evgeny Gagua 3 months ago
parent
commit
0a80b6e985
  1. 37
      lib/controller/getScadaEditor.php
  2. 8
      lib/upgrade_database.php

37
lib/controller/getScadaEditor.php

@ -14,6 +14,26 @@
if( ( $CCCV & 0x08 ) == 0x08 ) $P4 = 'true'; else $P4 = 'false'; if( ( $CCCV & 0x08 ) == 0x08 ) $P4 = 'true'; else $P4 = 'false';
$MODBUS=<<<DATA_BOUNDARY $MODBUS=<<<DATA_BOUNDARY
{ {
xtype: 'panel',
layout: 'table',
border: false,
frame: false,
width: '100%',
defaults: {
// applied to each contained panel
bodyStyle:'padding:10px; text-align: center;'
},
layoutConfig: {
// The total column count must be specified here
columns: 2
},
items:[{
xtype: 'panel',
border: false,
frame: false,
rowspan: 2,
html: '<table width="100%" border=0><tr><td class="small_prop_logo" id="adam">&nbsp;</td></tr></table>'
},{
xtype: 'form', xtype: 'form',
labelWidth: 150, labelWidth: 150,
labelAlign: 'right', labelAlign: 'right',
@ -22,7 +42,7 @@
xtype: 'panel', xtype: 'panel',
border: false, border: false,
frame: false, frame: false,
html: '<table width="100%" border=0><tr><td class="small_prop_logo" id="adam">&nbsp;</td><td class="small_prop_title" align="center">{$Labels->GetLabel('_MODBUS_RTU_')}:{$SC['label']}</td></tr></table>'
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></tr></table>'
},{ },{
xtype: 'textfield', xtype: 'textfield',
id: 'sca_label', id: 'sca_label',
@ -98,23 +118,22 @@
}, },
items:[{ items:[{
xtype: 'panel', xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'Upper Track' html: 'Upper Track'
},{ },{
xtype: 'panel', xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'Bottom Track' html: 'Bottom Track'
},{ },{
xtype: 'panel', xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'Health Signal' html: 'Health Signal'
},{ },{
xtype: 'panel', xtype: 'panel',
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'AUX Signal' html: 'AUX Signal'
},{ },{
xtype: 'combo', xtype: 'combo',
fieldLabel: "Upper Track",
lazyRender: true, lazyRender: true,
mode: 'local', mode: 'local',
forceSelection: true, forceSelection: true,
@ -139,7 +158,6 @@
} }
},{ },{
xtype: 'combo', xtype: 'combo',
fieldLabel: "Upper Track",
lazyRender: true, lazyRender: true,
mode: 'local', mode: 'local',
forceSelection: true, forceSelection: true,
@ -164,7 +182,6 @@
} }
},{ },{
xtype: 'combo', xtype: 'combo',
fieldLabel: "Upper Track",
lazyRender: true, lazyRender: true,
mode: 'local', mode: 'local',
forceSelection: true, forceSelection: true,
@ -189,7 +206,6 @@
} }
},{ },{
xtype: 'combo', xtype: 'combo',
fieldLabel: "Upper Track",
lazyRender: true, lazyRender: true,
mode: 'local', mode: 'local',
forceSelection: true, forceSelection: true,
@ -219,7 +235,7 @@
},{ },{
xtype: 'panel', xtype: 'panel',
colspan: 4, colspan: 4,
bodyCssClass:'_infoPanel', bodyStyle: 'background-color: #000; text-align: center;',
bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;',
html: 'TEST MODBUS MODULE COILS' html: 'TEST MODBUS MODULE COILS'
},{ },{
xtype: 'spacer', xtype: 'spacer',
@ -294,6 +310,7 @@
doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 13, 'true', true ); doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 13, 'true', true );
} }
}] }]
}]
} }
DATA_BOUNDARY; DATA_BOUNDARY;
echo $MODBUS; echo $MODBUS;

8
lib/upgrade_database.php

@ -53,7 +53,7 @@ CREATE TABLE `argus`.`media_composer_queue` (
`session_id` int UNSIGNED NOT NULL, `session_id` int UNSIGNED NOT NULL,
`uuid` char(64) NOT NULL, `uuid` char(64) NOT NULL,
`status` char(1) CHARACTER SET ascii COLLATE ascii_bin NULL DEFAULT 'N', `status` char(1) CHARACTER SET ascii COLLATE ascii_bin NULL DEFAULT 'N',
`progress` tinyint(3) UNSIGNED NULL DEFAULT 0,
`process` tinyint(3) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE = MyISAM; ) ENGINE = MyISAM;
DATA_BOUNDARY; DATA_BOUNDARY;
@ -67,6 +67,12 @@ DATA_BOUNDARY;
$UPGRADE = true; $UPGRADE = true;
$DATABASE->Query( $QS ); $DATABASE->Query( $QS );
}; };
$QS = "SELECT * FROM `session_statuses` WHERE `lvl`=1";
$R = $DATABASE->Query( $QS );
if( count( $R ) == 0 ){
$QS = "INSERT INTO `session_statuses`(`lvl`,`label`,`min_access`,`class`) VALUES(1,'Dismiss by Station',3,'active_yellow')";
$DATABASE->Query( $QS );
};
if( $UPGRADE ){ if( $UPGRADE ){
echo "Upgrade Done!\n\n"; echo "Upgrade Done!\n\n";
} else { } else {

Loading…
Cancel
Save