]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/simplecontroller.h
Make LCD output selectable at runtime through an extra I/O pin
[r2c2.git] / source / libmarklin / simplecontroller.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2010  Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef LIBMARKLIN_SIMPLECONTROLLER_H_
9 #define LIBMARKLIN_SIMPLECONTROLLER_H_
10
11 #include <string>
12 #include "controller.h"
13
14 namespace Marklin {
15
16 class SimpleController: public Controller
17 {
18 private:
19         Control target_speed;
20         Control reverse;
21         float accel;
22         float speed;
23
24 public:
25         SimpleController();
26
27         virtual void set_control(const std::string &, float);
28         virtual const Control &get_control(const std::string &) const;
29
30         virtual float get_speed() const { return speed; }
31         virtual bool get_reverse() const { return reverse.value; }
32         virtual float get_braking_distance() const;
33
34         virtual void tick(const Msp::Time::TimeDelta &);
35 };
36
37 } // namespace Marklin
38
39 #endif