]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/simplecontroller.h
Rename ControlModel to Controller
[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 #include "traincontrol.h"
14
15 namespace Marklin {
16
17 class SimpleController: public Controller
18 {
19 private:
20         TrainControl target_speed;
21         TrainControl reverse;
22         float accel;
23         float speed;
24
25 public:
26         SimpleController();
27
28         virtual void set_control(const std::string &, float);
29         virtual const TrainControl &get_control(const std::string &) const;
30
31         virtual float get_speed() const { return speed; }
32         virtual bool get_reverse() const { return reverse.value; }
33         virtual float get_braking_distance() const;
34
35         virtual void tick(const Msp::Time::TimeDelta &);
36 };
37
38 } // namespace Marklin
39
40 #endif