X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fremote%2Ftrainpanel.h;h=02b0b06b97a5ca165774c504e7cc1a8e15a1b0eb;hb=f8873062b146028c07f55ad625d2767e45133c27;hp=1cf7151a00b39cd45474899dc803d01a57e76039;hpb=d15ac13f2e170f155b4bbd124df48400c339b644;p=r2c2.git diff --git a/source/remote/trainpanel.h b/source/remote/trainpanel.h index 1cf7151..02b0b06 100644 --- a/source/remote/trainpanel.h +++ b/source/remote/trainpanel.h @@ -1,48 +1,34 @@ #ifndef TRAINPANEL_H_ #define TRAINPANEL_H_ -#include -#include -#include -#include -#include -#include "network/client.h" +#include +#include +#include +#include #include "network/train.h" -class Remote; - -class TrainPanel: public Gtk::Expander +class TrainPanel: public Msp::GLtk::Panel, public sigc::trackable { private: - struct RouteRecord: public Gtk::TreeModelColumnRecord - { - Gtk::TreeModelColumn name; - - RouteRecord(); - }; - - Remote &remote; - R2C2::Client &client; R2C2::NetTrain &train; - Gtk::Scale *scl_speed; - Gtk::Label *lbl_status; - Gtk::CheckButton *chk_reverse; - RouteRecord route_columns; - Gtk::ComboBox *cmb_route; - std::map chk_funcs; + Msp::GLtk::Indicator *ind_forward; + Msp::GLtk::Indicator *ind_reverse; + Msp::GLtk::Slider *sld_speed; + Msp::GLtk::Label *lbl_speed; + Msp::GLtk::Label *lbl_status; + std::map tgl_functions; + bool updating; public: - TrainPanel(Remote &, R2C2::Client &, R2C2::NetTrain &); + TrainPanel(R2C2::NetTrain &); + private: - void name_changed(const std::string &); - void status_changed(const std::string &); - void control_changed(const std::string &, float); + void update_reverse(bool); + void update_speed(float); + void ui_speed_changed(float); void function_changed(unsigned, bool); - void route_changed(const std::string &); - void ui_speed_changed(); - void ui_reverse_changed(); - void ui_function_changed(unsigned); - void ui_route_changed(); + void ui_function_toggled(bool, unsigned); + void status_changed(const std::string &); }; #endif