3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
11 #include <sigc++/trackable.h>
12 #include <msp/gltk/hslider.h>
13 #include <msp/gltk/label.h>
14 #include <msp/gltk/panel.h>
15 #include <msp/gltk/toggle.h>
16 #include "libmarklin/route.h"
17 #include "libmarklin/train.h"
21 class TrainPanel: public Msp::GLtk::Panel, public sigc::trackable
25 Marklin::Train &train;
26 Msp::GLtk::Label *lbl_addr;
27 Msp::GLtk::Label *lbl_name;
28 Msp::GLtk::HSlider *sld_speed;
29 Msp::GLtk::Label *lbl_speed;
30 Msp::GLtk::Label *lbl_route;
31 Msp::GLtk::Label *lbl_status;
32 Msp::GLtk::Toggle *tgl_forward;
33 std::map<unsigned, Msp::GLtk::Toggle *> tgl_funcs;
34 sigc::connection pick_conn;
37 TrainPanel(Engineer &, const Msp::GLtk::Resources &, Marklin::Train &);
39 void speed_slider_changed(double);
40 void train_speed_changed(unsigned);
41 void train_reverse_changed(bool);
42 void train_function_changed(unsigned, bool);
43 void train_route_changed(const Marklin::Route *);
44 void train_status_changed(const std::string &);
49 void forward_toggled(bool);
50 void func_toggled(bool, unsigned);
51 void place(Marklin::Track *, unsigned);
52 void go_to(Marklin::Track *, unsigned);