diff --git a/lib/controller/getMonitoringPlatformView.php b/lib/controller/getMonitoringPlatformView.php index aa8de9e..2eff213 100644 --- a/lib/controller/getMonitoringPlatformView.php +++ b/lib/controller/getMonitoringPlatformView.php @@ -171,7 +171,7 @@ $vcount++; }; $SCADA = "".$Labels->GetLabel('_SCADA_STATUS_')."
".$Labels->GetLabel('_MOD_STATUS_').":
".$Labels->GetLabel('_NOT_ASSIGNED_')."
 {$SCA_UT_TTL}{$SCA_BT_TTL}".$Labels->GetLabel('_HEALTH_')."AUX
 
"; - $ITEM_X="{$TOP}{$BOTTOM}{$SCADA}
".createPlatformBackground( $CR['layout'], $CID, array()/*$MDD*/ )."
"; + $ITEM_X="{$TOP}{$BOTTOM}{$SCADA}
".createPlatformBackground( $CR['layout'], $CID, array()/*$MDD*/ )."
"; $PLAT_PARTS[] = str_ireplace( '%%%PLATFORM%MAP%%%', $ITEM_X, $ITEM ); diff --git a/lib/controller/getScadaEditor.php b/lib/controller/getScadaEditor.php index ddd06f0..582dcf3 100644 --- a/lib/controller/getScadaEditor.php +++ b/lib/controller/getScadaEditor.php @@ -8,6 +8,7 @@ if( count( $Result ) ){ $SC = $Result[0]; $CCCV = intval( $SC['values'] ); + $CIVA = ( $CCCV >> 8 ) & 0xFF; if( ( $CCCV & 0x01 ) == 0x01 ) $P1 = 'true'; else $P1 = 'false'; if( ( $CCCV & 0x02 ) == 0x02 ) $P2 = 'true'; else $P2 = 'false'; if( ( $CCCV & 0x04 ) == 0x04 ) $P3 = 'true'; else $P3 = 'false'; @@ -15,32 +16,826 @@ $QS = "SELECT `left_side`,`right_side` FROM `metro_platforms` WHERE `id`={$SC['platform_id']}"; $ZZ = $DATABASE->Query( $QS, false ); $SN = $ZZ[0]; + $QS="SELECT `short` FROM `metro_tracks` WHERE `side`='U' AND `platform_id`={$SC['platform_id']}"; + $ZZ = $DATABASE->Query( $QS, false ); + $UTN = $ZZ[0]['short']; + $QS="SELECT `short` FROM `metro_tracks` WHERE `side`='B' AND `platform_id`={$SC['platform_id']}"; + $ZZ = $DATABASE->Query( $QS, false ); + $BTN = $ZZ[0]['short']; + $CBOV_A =( intval($SC['crossbar_a']) & 0x0F ); + $CBOV_B =( intval($SC['crossbar_a']) & 0x0F ); + $CBOV_C =( intval($SC['crossbar_a']) & 0x0F ); + $CBOV_D =( intval($SC['crossbar_a']) & 0x0F ); + $CBIV_A =( intval($SC['crossbar_a']) >> 4 ); + $CBIV_B =( intval($SC['crossbar_a']) >> 4 ); + $CBIV_C =( intval($SC['crossbar_a']) >> 4 ); + $CBIV_D =( intval($SC['crossbar_a']) >> 4 ); switch($SC['func']){ - case 1: $FFF=$SN['left_side'] . ' ' . $Labels->GetLabel('___SIDE__'); break; - case 2: $FFF=$SN['right_side'] . ' ' . $Labels->GetLabel('___SIDE__'); break; - case 3: $FFF='TCC ' . $Labels->GetLabel('___MODULE__'); break; - default: $FFF='Not Assignet'; + case 1: { + $FFF=$SN['left_side'] . ' ' . $Labels->GetLabel('___SIDE__'); + $OCB_SECTION=<<GetLabel('_LBL_TRACK_')}' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: '{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}' + },{ + xtype: 'spacer' + },{ + xtype: 'spacer' + },{ + xtype: 'combo', + id: 'sce_cb_o_1', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_A}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 21, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_o_2', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_B}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 22, b, false ); + } + } + },{ + xtype: 'spacer' + },{ + xtype: 'spacer' + } +DATA_BOUNDARY; + $ICB_SECTION=<<' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'DI 1 ' + },{ + xtype: 'spacer' + },{ + xtype: 'spacer' + },{ + xtype: 'spacer', + height: 5, + colspan: 4 + },{ + xtype: 'combo', + id: 'sce_cb_i_1', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_A}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_i_2', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_B}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, b, false ); + } + } + },{ + xtype: 'spacer' + },{ + xtype: 'spacer' + }] + } +DATA_BOUNDARY; + break; + }; + case 2: { + $FFF=$SN['right_side'] . ' ' . $Labels->GetLabel('___SIDE__'); + $OCB_SECTION=<<GetLabel('_LBL_TRACK_')}' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: '{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}' + },{ + xtype: 'spacer', + width: 120 + },{ + xtype: 'spacer', + width: 120 + },{ + xtype: 'combo', + id: 'sce_cb_o_1', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_A}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 21, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_o_2', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_B}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 22, b, false ); + } + } + },{ + xtype: 'spacer', + width: 120 + },{ + xtype: 'spacer', + width: 120 + } +DATA_BOUNDARY; + $ICB_SECTION=<<' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'DI 1 ' + },{ + xtype: 'spacer', + width: 120 + },{ + xtype: 'spacer', + width: 120 + },{ + xtype: 'spacer', + height: 5, + colspan: 4 + },{ + xtype: 'combo', + id: 'sce_cb_i_1', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_A}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_i_2', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_B}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, b, false ); + } + } + },{ + xtype: 'spacer', + width: 120 + },{ + xtype: 'spacer', + width: 120 + }] + } +DATA_BOUNDARY; + break; + }; + case 3: { + $FFF='TCC ' . $Labels->GetLabel('___MODULE__'); + $OCB_SECTION=<<GetLabel('_LBL_TRACK_')}' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: '{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'Health Signal' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'AUX Signal' + },{ + xtype: 'combo', + id: 'sce_cb_o_1', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_A}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 21, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_o_2', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_B}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 22, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_o_3', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_C}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 23, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_o_4', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_D}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 24, b, false ); + } + } + } +DATA_BOUNDARY; + $ICB_SECTION=<<' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'DI 1 ' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'DI 2 ' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'DI 3 ' + },{ + xtype: 'spacer', + height: 5, + colspan: 4 + },{ + xtype: 'combo', + id: 'sce_cb_i_1', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_A}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_i_2', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_B}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_i_3', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_C}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 29, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_i_4', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_D}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 30, b, false ); + } + } + }] + } +DATA_BOUNDARY; + break; + }; + default: { + $FFF='Not Assignet'; + $OCB_SECTION=<<GetLabel('_LBL_TRACK_')}' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: '{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'Health Signal' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'AUX Signal' + },{ + xtype: 'combo', + id: 'sce_cb_o_1', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_A}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 21, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_o_2', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_B}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 22, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_o_3', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_C}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 23, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_o_4', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBOV_D}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 24, b, false ); + } + } + } +DATA_BOUNDARY; + $ICB_SECTION=<<' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'DI 1 ' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'DI 2 ' + },{ + xtype: 'panel', + bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', + html: 'DI 3 ' + },{ + xtype: 'spacer', + height: 5, + colspan: 4 + },{ + xtype: 'combo', + id: 'sce_cb_i_1', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_A}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_i_2', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_B}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_i_3', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_C}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 29, b, false ); + } + } + },{ + xtype: 'combo', + id: 'sce_cb_i_4', + lazyRender: true, + mode: 'local', + forceSelection: true, + triggerAction: 'all', + editable: false, + disableKeyFilter: true, + store: new Ext.data.ArrayStore({ + fields: ['mode','mode_txt'], + data: [ + [0,'{$Labels->GetLabel('__DISABLED__')}'], + [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] + ] + }), + valueField: 'mode', + displayField: 'mode_txt', + value: '{$CBIV_D}', + width: 120, + listeners:{ + select: function( a, c, b ){ + doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 30, b, false ); + } + } + }] + } +DATA_BOUNDARY; + }; }; - $QS="SELECT `short` FROM `metro_tracks` WHERE `side`='U' AND `platform_id`={$SC['platform_id']}"; - $ZZ = $DATABASE->Query( $QS, false ); - $UTN = $ZZ[0]['short']; - $QS="SELECT `short` FROM `metro_tracks` WHERE `side`='B' AND `platform_id`={$SC['platform_id']}"; - $ZZ = $DATABASE->Query( $QS, false ); - $BTN = $ZZ[0]['short']; - $CBOV_A =( intval($SC['crossbar_a']) & 0x0F ); - $CBOV_B =( intval($SC['crossbar_a']) & 0x0F ); - $CBOV_C =( intval($SC['crossbar_a']) & 0x0F ); - $CBOV_D =( intval($SC['crossbar_a']) & 0x0F ); - $CBIV_A =( intval($SC['crossbar_a']) >> 4 ); - $CBIV_B =( intval($SC['crossbar_a']) >> 4 ); - $CBIV_C =( intval($SC['crossbar_a']) >> 4 ); - $CBIV_D =( intval($SC['crossbar_a']) >> 4 ); $MODBUS=<<GetLabel('_LBL_TRACK_')}' - },{ - xtype: 'panel', - bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', - html: '{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}' - },{ - xtype: 'panel', - bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', - html: 'Health Signal' - },{ - xtype: 'panel', - bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', - html: 'AUX Signal' - },{ - xtype: 'combo', - id: 'sce_cb_o_1', - lazyRender: true, - mode: 'local', - forceSelection: true, - triggerAction: 'all', - editable: false, - disableKeyFilter: true, - store: new Ext.data.ArrayStore({ - fields: ['mode','mode_txt'], - data: [ - [0,'{$Labels->GetLabel('__DISABLED__')}'], - [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] - ] - }), - valueField: 'mode', - displayField: 'mode_txt', - value: '{$CBOV_A}', - width: 120, - listeners:{ - select: function( a, c, b ){ - doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 21, b, false ); - } - } - },{ - xtype: 'combo', - id: 'sce_cb_o_2', - lazyRender: true, - mode: 'local', - forceSelection: true, - triggerAction: 'all', - editable: false, - disableKeyFilter: true, - store: new Ext.data.ArrayStore({ - fields: ['mode','mode_txt'], - data: [ - [0,'{$Labels->GetLabel('__DISABLED__')}'], - [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] - ] - }), - valueField: 'mode', - displayField: 'mode_txt', - value: '{$CBOV_B}', - width: 120, - listeners:{ - select: function( a, c, b ){ - doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 22, b, false ); - } - } - },{ - xtype: 'combo', - id: 'sce_cb_o_3', - lazyRender: true, - mode: 'local', - forceSelection: true, - triggerAction: 'all', - editable: false, - disableKeyFilter: true, - store: new Ext.data.ArrayStore({ - fields: ['mode','mode_txt'], - data: [ - [0,'{$Labels->GetLabel('__DISABLED__')}'], - [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] - ] - }), - valueField: 'mode', - displayField: 'mode_txt', - value: '{$CBOV_C}', - width: 120, - listeners:{ - select: function( a, c, b ){ - doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 23, b, false ); - } - } - },{ - xtype: 'combo', - id: 'sce_cb_o_4', - lazyRender: true, - mode: 'local', - forceSelection: true, - triggerAction: 'all', - editable: false, - disableKeyFilter: true, - store: new Ext.data.ArrayStore({ - fields: ['mode','mode_txt'], - data: [ - [0,'{$Labels->GetLabel('__DISABLED__')}'], - [1,'Coil D0'],[2,'Coil D1'],[3,'Coil D2'],[4,'Coil D3'] - ] - }), - valueField: 'mode', - displayField: 'mode_txt', - value: '{$CBOV_D}', - width: 120, - listeners:{ - select: function( a, c, b ){ - doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 24, b, false ); - } - } - },{ + items:[{$OCB_SECTION},{ xtype: 'spacer', height: 10, colspan: 4 @@ -288,10 +967,12 @@ disabled: true, handler: function( b, e ){ b.disable(); + var cv = Ext.getCmp('c_sca_e_panel').c_do_val; if( b.pressed ){ - doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 1 ), false ); + //{$CCCV} + doPlatformOperation( {$SC['platform_id']}, 18, (( cv | 1 )& 0xFF), false ); } else { - doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~1 ) ), false ); + doPlatformOperation( {$SC['platform_id']}, 18, (( cv & ( ~1 ) ) & 0xFF), false ); }; } },{ @@ -305,10 +986,11 @@ disabled: true, handler: function( b, e ){ b.disable(); + var cv = Ext.getCmp('c_sca_e_panel').c_do_val; if( b.pressed ){ - doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 2 ), false ); + doPlatformOperation( {$SC['platform_id']}, 18, (( cv | 2 )& 0xFF), false ); } else { - doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~2 ) ), false ); + doPlatformOperation( {$SC['platform_id']}, 18, (( cv & ( ~2 ) ) & 0xFF), false ); }; } },{ @@ -322,10 +1004,11 @@ disabled: true, handler: function( b, e ){ b.disable(); + var cv = Ext.getCmp('c_sca_e_panel').c_do_val; if( b.pressed ){ - doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 4 ), false ); + doPlatformOperation( {$SC['platform_id']}, 18, (( cv | 4 )& 0xFF), false ); } else { - doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~4 ) ), false ); + doPlatformOperation( {$SC['platform_id']}, 18, (( cv & ( ~4 ) ) & 0xFF), false ); }; } },{ @@ -339,138 +1022,18 @@ disabled: true, handler: function( b, e ){ b.disable(); + var cv = Ext.getCmp('c_sca_e_panel').c_do_val; if( b.pressed ){ - doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} | 8 ), false ); + doPlatformOperation( {$SC['platform_id']}, 18, (( cv | 8 )& 0xFF), false ); } else { - doPlatformOperation( {$SC['platform_id']}, 18, ({$CCCV} & ( ~8 ) ), false ); + doPlatformOperation( {$SC['platform_id']}, 18, (( cv & ( ~8 ) )& 0xFF ), false ); }; } },{ xtype: 'spacer', height: 5, colspan: 4 - },{ - xtype: 'panel', - bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', - html: 'DI 0 ' - },{ - xtype: 'panel', - bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', - html: 'DI 1 ' - },{ - xtype: 'panel', - bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', - html: 'DI 2 ' - },{ - xtype: 'panel', - bodyCssClass:'_infoPanel', bodyStyle: 'font-size: 10px; background-color: #000; text-align: center;', - html: 'DI 3 ' - },{ - xtype: 'spacer', - height: 5, - colspan: 4 - },{ - xtype: 'combo', - id: 'sce_cb_i_1', - lazyRender: true, - mode: 'local', - forceSelection: true, - triggerAction: 'all', - editable: false, - disableKeyFilter: true, - store: new Ext.data.ArrayStore({ - fields: ['mode','mode_txt'], - data: [ - [0,'{$Labels->GetLabel('__DISABLED__')}'], - [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] - ] - }), - valueField: 'mode', - displayField: 'mode_txt', - value: '{$CBIV_A}', - width: 120, - listeners:{ - select: function( a, c, b ){ - doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 27, b, false ); - } - } - },{ - xtype: 'combo', - id: 'sce_cb_i_2', - lazyRender: true, - mode: 'local', - forceSelection: true, - triggerAction: 'all', - editable: false, - disableKeyFilter: true, - store: new Ext.data.ArrayStore({ - fields: ['mode','mode_txt'], - data: [ - [0,'{$Labels->GetLabel('__DISABLED__')}'], - [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] - ] - }), - valueField: 'mode', - displayField: 'mode_txt', - value: '{$CBIV_B}', - width: 120, - listeners:{ - select: function( a, c, b ){ - doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 28, b, false ); - } - } - },{ - xtype: 'combo', - id: 'sce_cb_i_3', - lazyRender: true, - mode: 'local', - forceSelection: true, - triggerAction: 'all', - editable: false, - disableKeyFilter: true, - store: new Ext.data.ArrayStore({ - fields: ['mode','mode_txt'], - data: [ - [0,'{$Labels->GetLabel('__DISABLED__')}'], - [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] - ] - }), - valueField: 'mode', - displayField: 'mode_txt', - value: '{$CBIV_C}', - width: 120, - listeners:{ - select: function( a, c, b ){ - doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 29, b, false ); - } - } - },{ - xtype: 'combo', - id: 'sce_cb_i_4', - lazyRender: true, - mode: 'local', - forceSelection: true, - triggerAction: 'all', - editable: false, - disableKeyFilter: true, - store: new Ext.data.ArrayStore({ - fields: ['mode','mode_txt'], - data: [ - [0,'{$Labels->GetLabel('__DISABLED__')}'], - [1,'{$UTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[2,'{$BTN} {$Labels->GetLabel('_LBL_TRACK_')}'],[3,'Both'],[4,'TCC AUX'] - ] - }), - valueField: 'mode', - displayField: 'mode_txt', - value: '{$CBIV_D}', - width: 120, - listeners:{ - select: function( a, c, b ){ - doScadaOperation( {$SC['platform_id']}, {$SC['id']}, 30, b, false ); - } - } - }] - },{ + },{$ICB_SECTION},{ xtype: 'spacer', height: 5, colspan: 4 diff --git a/lib/controller/getScadaStatus.php b/lib/controller/getScadaStatus.php index f078505..ace704d 100644 --- a/lib/controller/getScadaStatus.php +++ b/lib/controller/getScadaStatus.php @@ -26,6 +26,7 @@ $Data['outputs'][] = ($VO & 2)?true:false; $Data['outputs'][] = ($VO & 4)?true:false; $Data['outputs'][] = ($VO & 8)?true:false; + $Data['ov'] = $VO; $VI = ($VV >> 8 ) & 0xFF; $Data['inputs']=array(); $Data['inputs'][] = ($VI & 1)?true:false; diff --git a/lib/controller/getStatus.php b/lib/controller/getStatus.php index 39d83d2..61f0c5b 100644 --- a/lib/controller/getStatus.php +++ b/lib/controller/getStatus.php @@ -254,7 +254,7 @@ $Modules[] = $LD; }; $Data['modules'] = $Modules; - $QS = "SELECT * FROM `modbus_modules` WHERE `platform_id`={$PID}"; + $QS = "SELECT * FROM `modbus_modules` WHERE `platform_id`={$PID} AND `func`=3"; $RR = $DATABASE->Query( $QS ); $Data['scada'] = array(); if( count($RR) == 0 ) { @@ -262,21 +262,35 @@ } else { $SM = $RR[0]; if( $SM['wm'] == 'D' ){ - $Data['scada']['status']=1; + $Data['scada']['status']=0; } else { $SM['status'] = intval($SM['status']); $Data['scada']['status']=$SM['status']+2; if( $SM['status'] > 0 ){ $CV = intval($SM['values']); - $Data['scada']['A']= $CV & 0x01; - $Data['scada']['B']= $CV & 0x02; - $Data['scada']['C']= $CV & 0x04; - $Data['scada']['D']= $CV & 0x08; + $Data['scada']['A']= (($CV & 0x01) == 1); + $Data['scada']['B']= (($CV & 0x02) == 2); + $Data['scada']['C']= (($CV & 0x04) == 4); + $Data['scada']['D']= (($CV & 0x08) == 8); }; }; }; $Data['train']=array( 'status'=>$TrainPos ); }; + $QS = "SELECT * FROM `metro_platforms_mboxes` WHERE `platform_id`={$PID}"; + $RR = $DATABASE->Query( $QS, false ); + $Data['poster'] = array(); + if( count( $RR ) ){ + foreach( $RR as $M ){ + $CR = array(); + $CR['id'] = intval( $M['id'] ); + $CR['status'] = intval( $M['status'] ); + $CR['msg'] = $Labels->GetLabel( $M['msg'] ); + $Data['poster'][] = $CR; + }; + } else { + + }; }; break; }; diff --git a/lib/javascript/jsapi_dynamic/argus_monitoring.js b/lib/javascript/jsapi_dynamic/argus_monitoring.js index 831d029..1ca128c 100644 --- a/lib/javascript/jsapi_dynamic/argus_monitoring.js +++ b/lib/javascript/jsapi_dynamic/argus_monitoring.js @@ -222,7 +222,8 @@ function correctPlatformView( id ){ }; tt = Ext.getCmp('plat_schematics_'+id ); if( tt != null ){ - tt.setHeight( 18 * pawi + 2 * 56 ); + //tt.setHeight( 18 * pawi + 2 * 56 ); + tt.setHeight( PanelH-130 ); }; tt = document.getElementById('plat_video_'+id+'_'+pp.getComponent(0).custom); if( tt != null ){ @@ -244,6 +245,25 @@ function correctPlatformView( id ){ tt.style.width = 16 * pawi +'px'; tt.style.height = 9 * pawi +'px'; }; + + var O = new Ext.Panel({ + renderTo: 'scada_postbox_'+id, + width: '100%', + height: 150, + layout: 'hbox', + layoutConfig: { + align: 'stretch', // Options: 'top', 'middle', 'stretch', 'stretchmax' + pack: 'start' // Options: 'start', 'center', 'end' + }, + defaults: { + flex: 1, // Automatically distributes equal width among items + bodyStyle: 'padding:10px' + }, + items: [{ + title: 'Column 1', + html: 'Content for the first column' + }] + }); }; function correctModuleView( id ){ diff --git a/lib/javascript/jsapi_dynamic/argus_settings.js b/lib/javascript/jsapi_dynamic/argus_settings.js index 79a7c3f..b62936e 100644 --- a/lib/javascript/jsapi_dynamic/argus_settings.js +++ b/lib/javascript/jsapi_dynamic/argus_settings.js @@ -1256,6 +1256,8 @@ function fetchScadaEditorStatus(){ tT.toggle( data.outputs[3] ); tT.resumeEvents(); }; + var cv = Ext.getCmp('c_sca_e_panel'); + if( cv != undefined ) cv.c_do_val = data.ov; } else { var lt = document.getElementById('scae_onl_sts'); if( lt != undefined ) lt.src = "/style/assets/bul_gray.png"; diff --git a/lib/php/argus/templates.php b/lib/php/argus/templates.php index 24295d0..8a4458b 100644 --- a/lib/php/argus/templates.php +++ b/lib/php/argus/templates.php @@ -314,8 +314,9 @@ $PLATFORM_PLATFORM_CTX=<<Query( $QS ); + if( count( $R ) == 0 ){ + $QS =<<Query( $QS ); + }; + if( $UPGRADE ){ echo "Upgrade Done!\n\n"; } else { diff --git a/style/style.css b/style/style.css index b53de5f..9bdc812 100644 --- a/style/style.css +++ b/style/style.css @@ -2365,4 +2365,7 @@ input[type="range"]:focus::-moz-range-thumb { font-weight: bold; border-radius: 10px; margin-bottom: 10px; +} +.x-table-layout-cell-top-align td.x-table-layout-cell { + vertical-align: top !important; } \ No newline at end of file