+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
#ifndef LIBMARKLIN_TRAIN_H_
#define LIBMARKLIN_TRAIN_H_
std::list<BlockRef> rsv_blocks;
unsigned target_speed;
Msp::Time::TimeStamp try_reserve;
+ std::string status;
+ Msp::Time::TimeStamp last_entry_time;
+ float travel_dist;
+ unsigned real_speed;
public:
sigc::signal<void, const std::string &> signal_name_changed;
+ sigc::signal<void, const std::string &> signal_status_changed;
Train(TrafficManager &, Locomotive &);
+
void set_name(const std::string &);
void set_speed(unsigned);
const std::string &get_name() const { return name; }
Locomotive &get_locomotive() const { return loco; }
+ const std::string &get_status() const { return status; }
void place(Block *, unsigned);
bool free_block(Block *);
void tick(const Msp::Time::TimeStamp &);
private:
void sensor_event(bool, Sensor *);
- bool reserve_more();
+ unsigned reserve_more();
+ void set_status(const std::string &);
};
-typedef std::list<Train *> TrainSeq;
} // namespace Marklin