1 #include <msp/time/utils.h>
2 #include <msp/time/units.h>
10 Sensor::Sensor(Control &c, unsigned a):
15 control.add_sensor(*this);
16 control.signal_sensor_event.connect(sigc::mem_fun(this, &Sensor::sensor_event));
19 void Sensor::sensor_event(unsigned a, bool s)
25 off_timeout=Time::TimeStamp();
29 signal_state_changed.emit(state);
33 off_timeout=Time::now()+0.5*Time::sec;
41 const Time::TimeStamp t=Time::now();
44 off_timeout=Time::TimeStamp();
48 signal_state_changed.emit(state);
54 } // namespace Marklin