Skip to content

Commit

Permalink
Fixed multi aspect signal setting
Browse files Browse the repository at this point in the history
  • Loading branch information
artemis-beta committed Feb 28, 2020
1 parent 5d62a5b commit a490e99
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 0 additions & 2 deletions interlocking.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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}}}
};

Expand Down
13 changes: 11 additions & 2 deletions leverframe.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{

Expand All @@ -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();
}
}

0 comments on commit a490e99

Please sign in to comment.