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 const char *Dummy::enumerate_protocols(unsigned i) const
31 unsigned Dummy::get_protocol_speed_steps(const string &) const
36 void Dummy::add_turnout(unsigned addr)
41 void Dummy::set_turnout(unsigned addr, bool state)
43 if(turnouts[addr]!=state)
45 turnouts[addr] = state;
46 signal_turnout.emit(addr, state);
50 bool Dummy::get_turnout(unsigned addr) const
52 map<unsigned, bool>::const_iterator i = turnouts.find(addr);
58 void Dummy::set_loco_speed(unsigned addr, unsigned speed)
60 LocoState &loco = locos[addr];
62 signal_loco_speed.emit(addr, speed, loco.reverse);
65 void Dummy::set_loco_reverse(unsigned addr, bool rev)
67 LocoState &loco = locos[addr];
69 signal_loco_speed.emit(addr, loco.speed, rev);
72 void Dummy::set_loco_function(unsigned addr, unsigned func, bool state)
74 signal_loco_function.emit(addr, func, state);
77 void Dummy::set_sensor(unsigned addr, bool state)
79 if(sensors[addr]!=state)
81 sensors[addr] = state;
82 signal_sensor.emit(addr, state);
86 bool Dummy::get_sensor(unsigned addr) const
88 map<unsigned, bool>::const_iterator i = sensors.find(addr);
94 } // namespace Marklin