From a490e992b4f7ee52aa6ee36485ecf015a2a89fe6 Mon Sep 17 00:00:00 2001 From: artemis-beta Date: Fri, 28 Feb 2020 14:42:26 +0000 Subject: [PATCH] Fixed multi aspect signal setting --- interlocking.cxx | 2 -- leverframe.cxx | 13 +++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/interlocking.cxx b/interlocking.cxx index bfd8fc7..0cb60dc 100644 --- a/interlocking.cxx +++ b/interlocking.cxx @@ -209,7 +209,6 @@ void EWRB::InterLocking::_create_logic_table() _logic[26] = {{EWRB::LeverState::On, // Points 26 can only be changed when SIG. 11 and SIG. 38 are ON {{11, EWRB::LeverState::Off}, // Points 26 reverse requires points 27 to be reverse {12, EWRB::LeverState::Off}, - {27, EWRB::LeverState::On}, {38, EWRB::LeverState::Off}}}, {EWRB::LeverState::Off, {{11, EWRB::LeverState::Off}, @@ -222,7 +221,6 @@ void EWRB::InterLocking::_create_logic_table() {38, EWRB::LeverState::Off}}}, {EWRB::LeverState::Off, {{37, EWRB::LeverState::Off}, - {26, EWRB::LeverState::Off}, // Points 27 normal requires Points 26 to be normal {38, EWRB::LeverState::Off}}} }; diff --git a/leverframe.cxx b/leverframe.cxx index ea0469d..ec2ce43 100644 --- a/leverframe.cxx +++ b/leverframe.cxx @@ -265,6 +265,12 @@ void EWRB::LeverFrame::update(const int& i) { qDebug() << "Running Frame Update..."; + int signal_id = i; + + if(i == 3) signal_id = 2; + else if (i == 34 || i == 35) signal_id = 33; + else if (i == 12) signal_id = 11; + if(i == -1) { @@ -281,7 +287,10 @@ void EWRB::LeverFrame::update(const int& i) else { - if(_map_indicators.contains(i))_map_indicators[i]->update(); - if(_sig_indicators.contains(i))_sig_indicators[i]->update(); + if(_map_indicators.contains(signal_id)) + { + _map_indicators[signal_id]->update(); + } + if(_sig_indicators.contains(signal_id))_sig_indicators[signal_id]->update(); } }