X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fintellibox.cpp;h=338aed2544127844dff4de200cf7bbffc90f2a2a;hb=5a02a4f42dfc5dc6b4daef5fc02431bdfb2968d8;hp=d4129ec7535162d44deb3225de1608423d76c759;hpb=f4b1ac84400a95e1a9fe68ff00bcd52e44911cf2;p=r2c2.git diff --git a/source/libr2c2/intellibox.cpp b/source/libr2c2/intellibox.cpp index d4129ec..338aed2 100644 --- a/source/libr2c2/intellibox.cpp +++ b/source/libr2c2/intellibox.cpp @@ -114,6 +114,11 @@ void Intellibox::add_loco(unsigned addr, const string &proto_name, const Vehicle } } +void Intellibox::remove_loco(unsigned addr) +{ + locos.erase(addr); +} + void Intellibox::set_loco_speed(unsigned addr, unsigned speed) { Locomotive &loco = locos[addr]; @@ -197,6 +202,11 @@ void Intellibox::add_turnout(unsigned addr, const TrackType &type) add_turnout(addr, type.get_state_bits(), false); } +void Intellibox::remove_turnout(unsigned addr) +{ + turnouts.erase(addr); +} + void Intellibox::add_turnout(unsigned addr, unsigned bits, bool signal) { if(!turnouts.count(addr)) @@ -264,6 +274,11 @@ void Intellibox::add_signal(unsigned addr, const SignalType &) add_turnout(addr, 1, true); } +void Intellibox::remove_signal(unsigned addr) +{ + remove_turnout(addr); +} + void Intellibox::set_signal(unsigned addr, unsigned state) { set_turnout(addr, state); @@ -283,6 +298,12 @@ void Intellibox::add_sensor(unsigned addr) } } +void Intellibox::remove_sensor(unsigned addr) +{ + sensors.erase(addr); + update_sensors = true; +} + bool Intellibox::get_sensor(unsigned addr) const { map::const_iterator i = sensors.find(addr);