sigc::signal<void, unsigned, unsigned, bool> signal_loco_speed;
sigc::signal<void, unsigned, unsigned, bool> signal_loco_function;
sigc::signal<void, unsigned, unsigned> signal_turnout;
+ sigc::signal<void, unsigned> signal_turnout_failed;
sigc::signal<void, unsigned, unsigned> signal_signal;
sigc::signal<void, unsigned, bool> signal_sensor;
#include <cmath>
#include <msp/core/maputils.h>
+#include <msp/strings/format.h>
#include "block.h"
#include "catalogue.h"
#include "driver.h"
Driver &driver = layout.get_driver();
turnout_id = driver.add_turnout(turnout_addr, type);
driver.signal_turnout.connect(sigc::mem_fun(this, &Track::turnout_event));
+ driver.signal_turnout_failed.connect(sigc::mem_fun(this, &Track::turnout_failed));
}
}
}
}
+void Track::turnout_failed(unsigned id)
+{
+ if(id==turnout_id)
+ {
+ path_changing = false;
+ layout.emergency(format("Turnout %d failed", turnout_addr));
+ }
+}
+
Track::Loader::Loader(Track &t):
DataFile::ObjectLoader<Track>(t)
void save(std::list<Msp::DataFile::Statement> &) const;
private:
void turnout_event(unsigned, unsigned);
+ void turnout_failed(unsigned);
};
} // namespace R2C2