3 This file is part of the MSP Märklin suite
4 Copyright © 2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
18 void Dummy::set_power(bool p)
21 signal_power.emit(power);
24 void Dummy::add_turnout(unsigned addr)
29 void Dummy::set_turnout(unsigned addr, bool state)
31 if(turnouts[addr]!=state)
33 turnouts[addr] = state;
34 signal_turnout.emit(addr, state);
38 bool Dummy::get_turnout(unsigned addr) const
40 map<unsigned, bool>::const_iterator i = turnouts.find(addr);
46 void Dummy::set_loco_speed(unsigned addr, unsigned speed)
48 LocoState &loco = locos[addr];
50 signal_loco_speed.emit(addr, speed, loco.reverse);
53 void Dummy::set_loco_reverse(unsigned addr, bool rev)
55 LocoState &loco = locos[addr];
57 signal_loco_speed.emit(addr, loco.speed, rev);
60 void Dummy::set_loco_function(unsigned addr, unsigned func, bool state)
62 signal_loco_function.emit(addr, func, state);
65 void Dummy::set_sensor(unsigned addr, bool state)
67 if(sensors[addr]!=state)
69 sensors[addr] = state;
70 signal_sensor.emit(addr, state);
74 bool Dummy::get_sensor(unsigned addr) const
76 map<unsigned, bool>::const_iterator i = sensors.find(addr);
82 } // namespace Marklin