]> git.tdb.fi Git - r2c2.git/commitdiff
Full vehicle unification
authorMikko Rasa <tdb@tdb.fi>
Sun, 26 Sep 2010 09:28:16 +0000 (09:28 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sun, 26 Sep 2010 09:28:16 +0000 (09:28 +0000)
Add controls for adding vehicles to TrainProperties

19 files changed:
locos.dat
source/engineer/trainpanel.cpp
source/engineer/trainproperties.cpp
source/engineer/trainproperties.h
source/libmarklin/catalogue.cpp
source/libmarklin/catalogue.h
source/libmarklin/layout.cpp
source/libmarklin/locotype.cpp [deleted file]
source/libmarklin/locotype.h [deleted file]
source/libmarklin/train.cpp
source/libmarklin/train.h
source/libmarklin/vehicle.cpp
source/libmarklin/vehicletype.cpp
source/libmarklin/vehicletype.h
source/network/server.cpp
source/network/train.cpp
source/network/train.h
source/remote/trainpanel.cpp
tracks.dat

index c8a435f53c07ca549009c19cb47b7976d622bcbd..9f05b8eb52ae77d52120fab681756ea21529ae57 100644 (file)
--- a/locos.dat
+++ b/locos.dat
@@ -3,9 +3,10 @@
 scale 1 87;
 gauge 16.5;
 
-locomotive 39230
+vehicle 39230
 {
        name "BR 23";
+       locomotive true;
        function 0 "light";
        function 1 "smke";
        function 2 "sfx";
@@ -32,9 +33,10 @@ locomotive 39230
        };
 };
 
-locomotive 37844
+vehicle 37844
 {
        name "BR 50";
+       locomotive true;
        function 0 "light";
        function 1 "smke";
        function 2 "telex";
@@ -59,9 +61,10 @@ locomotive 37844
        axle { position -50; wheel_diameter 16; powered true; };
 };
 
-locomotive 33961
+vehicle 33961
 {
        name "BR 86";
+       locomotive true;
        function 0 "light";
        function 2 "telex";
 
@@ -85,9 +88,10 @@ locomotive 33961
        };
 };
 
-locomotive 36850
+vehicle 36850
 {
        name "BR 185";
+       locomotive true;
        function 0 "light";
 
        length 218;
@@ -110,9 +114,10 @@ locomotive 36850
        };
 };
 
-locomotive 37225
+vehicle 37225
 {
        name "BR 194";
+       locomotive true;
        function 0 "light";
 
        length 212;
index 590f1cd49e5537568b659c893e782a9370d46132..7177489be5e990574ed8be934b33ea169d0d863a 100644 (file)
@@ -8,8 +8,8 @@ Distributed under the GPL
 #include <cmath>
 #include <msp/gltk/button.h>
 #include <msp/strings/formatter.h>
-#include "libmarklin/locotype.h"
 #include "libmarklin/timetable.h"
+#include "libmarklin/vehicletype.h"
 #include "engineer.h"
 #include "routeselect.h"
 #include "timetabledialog.h"
index 4596000724a204bff97b9c53a685d973318cf511..bdd39fb97622f2e3c2f707ec892796abc0958ea2 100644 (file)
@@ -5,11 +5,11 @@ Copyright © 2006-2010  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
-#include <msp/gltk/button.h>
 #include <msp/gltk/label.h>
 #include <msp/strings/formatter.h>
 #include <msp/strings/lexicalcast.h>
-#include "libmarklin/locotype.h"
+#include "libmarklin/vehicle.h"
+#include "libmarklin/vehicletype.h"
 #include "engineer.h"
 #include "trainproperties.h"
 
@@ -23,23 +23,23 @@ TrainProperties::TrainProperties(Engineer &e, const GLtk::Resources &r, Train *t
        engineer(e),
        train(t)
 {
-       set_size(200, 145);
+       set_size(200, 275);
 
        GLtk::Label *label;
-       add(*(label=new GLtk::Label(res, "Train properties")));
+       add(*(label = new GLtk::Label(res, "Train properties")));
        label->set_geometry(GLtk::Geometry(10, geom.h-25, geom.w-20, 20));
 
-       add(*(ent_addr=new GLtk::Entry(res)));
+       add(*(ent_addr = new GLtk::Entry(res)));
        ent_addr->set_geometry(GLtk::Geometry(10, geom.h-50, 40, 20));
 
-       add(*(drp_type=new GLtk::Dropdown(res)));
+       add(*(drp_type = new GLtk::Dropdown(res)));
        drp_type->set_geometry(GLtk::Geometry(60, geom.h-50, geom.w-70, 20));
 
        const map<unsigned, VehicleType *> &vehs = engineer.get_catalogue().get_vehicles();
        unsigned n = 0;
        for(map<unsigned, VehicleType *>::const_iterator i=vehs.begin(); i!=vehs.end(); ++i, ++n)
        {
-               if(!dynamic_cast<LocoType *>(i->second))
+               if(!i->second->is_locomotive())
                        continue;
 
                drp_type->append(format("%d %s", i->second->get_article_number(), i->second->get_name()));
@@ -47,10 +47,10 @@ TrainProperties::TrainProperties(Engineer &e, const GLtk::Resources &r, Train *t
                        drp_type->set_selected_index(n);
        }
 
-       add(*(ent_name=new GLtk::Entry(res)));
+       add(*(ent_name = new GLtk::Entry(res)));
        ent_name->set_geometry(GLtk::Geometry(10, geom.h-75, geom.w-20, 20));
 
-       add(*(drp_priority=new GLtk::Dropdown(res)));
+       add(*(drp_priority = new GLtk::Dropdown(res)));
        drp_priority->set_geometry(GLtk::Geometry(10, geom.h-100, geom.w-20, 20));
        drp_priority->append("Standard freight");
        drp_priority->append("Express freight");
@@ -58,11 +58,34 @@ TrainProperties::TrainProperties(Engineer &e, const GLtk::Resources &r, Train *t
        drp_priority->append("Standard passenger");
        drp_priority->append("Express passenger");
 
+       add(*(lst_vehicles = new GLtk::List(res)));
+       lst_vehicles->set_geometry(GLtk::Geometry(10, geom.h-205, geom.w-20, 100));
+
+       add(*(drp_new_vehicle = new GLtk::Dropdown(res)));
+       drp_new_vehicle->set_geometry(GLtk::Geometry(10, geom.h-230, geom.w-20, 20));
+       drp_new_vehicle->append("(new vehicle)");
+       drp_new_vehicle->set_selected_index(0);
+       for(map<unsigned, VehicleType *>::const_iterator i=vehs.begin(); i!=vehs.end(); ++i)
+       {
+               if(i->second->is_locomotive())
+                       continue;
+
+               drp_new_vehicle->append(format("%d %s", i->second->get_article_number(), i->second->get_name()));
+       }
+       drp_new_vehicle->signal_item_selected.connect(sigc::mem_fun(this, &TrainProperties::new_vehicle_selected));
+
        if(train)
        {
                ent_addr->set_text(lexical_cast(train->get_address()));
                ent_name->set_text(train->get_name());
                drp_priority->set_selected_index(train->get_priority()+2);
+
+               unsigned n_vehicles = train->get_n_vehicles();
+               for(unsigned i=1; i<n_vehicles; ++i)
+               {
+                       const VehicleType &type = train->get_vehicle(i).get_type();
+                       lst_vehicles->append(format("%d %s", type.get_article_number(), type.get_name()));
+               }
        }
        else
        {
@@ -75,22 +98,44 @@ void TrainProperties::on_ok_clicked()
 {
        if(!train)
        {
-               const map<unsigned, VehicleType *> &vehs = engineer.get_catalogue().get_vehicles();
-               map<unsigned, VehicleType *>::const_iterator i = vehs.begin();
-               unsigned n = drp_type->get_selected_index();
-               while(!dynamic_cast<LocoType *>(i->second))
-                       ++i;
-               while(n)
-               {
-                       if(dynamic_cast<LocoType *>(i->second))
-                               --n;
-                       ++i;
-               }
-
+               const VehicleType &type = get_vehicle_type(drp_type->get_selected_index(), true);
                unsigned addr = lexical_cast<unsigned>(ent_addr->get_text());
-               train = new Train(engineer.get_layout(), *dynamic_cast<LocoType *>(i->second), addr);
+               train = new Train(engineer.get_layout(), type, addr);
        }
 
        train->set_name(ent_name->get_text());
        train->set_priority(drp_priority->get_selected_index()-2);
+
+       for(vector<const VehicleType *>::const_iterator i=add_vehicles.begin(); i!=add_vehicles.end(); ++i)
+               train->add_vehicle(**i);
+}
+
+void TrainProperties::new_vehicle_selected(unsigned n, const string &)
+{
+       if(n==0)
+               return;
+
+       const VehicleType &type = get_vehicle_type(n-1, false);
+       add_vehicles.push_back(&type);
+       lst_vehicles->append(format("%d %s", type.get_article_number(), type.get_name()));
+
+       drp_new_vehicle->set_selected_index(0);
+}
+
+const VehicleType &TrainProperties::get_vehicle_type(unsigned n, bool loco)
+{
+       const map<unsigned, VehicleType *> &vehs = engineer.get_catalogue().get_vehicles();
+       map<unsigned, VehicleType *>::const_iterator i = vehs.begin();
+       while(i!=vehs.end())
+       {
+               if(i->second->is_locomotive()==loco)
+               {
+                       if(!n)
+                               return *i->second;
+                       --n;
+               }
+               ++i;
+       }
+
+       throw InvalidParameterValue("Vehicle type index out of range");
 }
index 3c1a372fe606fed9801ce1ea069fbebe38903f10..c75015b08f4b27f8c5b009af0af17aa572352713 100644 (file)
@@ -24,11 +24,16 @@ private:
        Msp::GLtk::Dropdown *drp_type;
        Msp::GLtk::Entry *ent_name;
        Msp::GLtk::Dropdown *drp_priority;
+       Msp::GLtk::List *lst_vehicles;
+       Msp::GLtk::Dropdown *drp_new_vehicle;
+       std::vector<const Marklin::VehicleType *> add_vehicles;
 
 public:
        TrainProperties(Engineer &, const Msp::GLtk::Resources &, Marklin::Train *);
 private:
        virtual void on_ok_clicked();
+       void new_vehicle_selected(unsigned, const std::string &);
+       const Marklin::VehicleType &get_vehicle_type(unsigned, bool);
 };
 
 #endif
index 286407cc09326818973d5a7c18593ac81108efb9..fca6045fc38da36c5613758fd205f95c1a5f791a 100644 (file)
@@ -8,8 +8,8 @@ Distributed under the GPL
 #include <msp/core/refptr.h>
 #include <msp/datafile/parser.h>
 #include "catalogue.h"
-#include "locotype.h"
 #include "tracktype.h"
+#include "vehicletype.h"
 
 using namespace std;
 using namespace Msp;
@@ -66,15 +66,6 @@ const VehicleType &Catalogue::get_vehicle(unsigned art_nr) const
        return *i->second;
 }
 
-const LocoType &Catalogue::get_locomotive(unsigned art_nr) const
-{
-       const VehicleType &veh = get_vehicle(art_nr);
-       if(const LocoType *loco = dynamic_cast<const LocoType *>(&veh))
-               return *loco;
-       
-       throw Exception("Vehicle is not a locomotive");
-}
-
 
 Catalogue::Loader::Loader(Catalogue &c):
        DataFile::BasicLoader<Catalogue>(c)
@@ -82,7 +73,6 @@ Catalogue::Loader::Loader(Catalogue &c):
        add("ballast_profile", &Loader::ballast_profile);
        add("gauge", &Loader::gauge);
        add("layout", &Loader::layout);
-       add("locomotive", &Loader::locomotive);
        add("rail_profile", &Loader::rail_profile);
        add("scale", &Loader::scale);
        add("track", &Loader::track);
@@ -107,14 +97,6 @@ void Catalogue::Loader::layout()
        load_sub(obj.layout);
 }
 
-void Catalogue::Loader::locomotive(unsigned art_nr)
-{
-       RefPtr<LocoType> loco = new LocoType(art_nr);
-       load_sub(*loco);
-       obj.add_vehicle(*loco);
-       loco.release();
-}
-
 void Catalogue::Loader::rail_profile()
 {
        load_sub(obj.rail_profile);
index 524d3f2b56a6593cb82c859af044dfbf027838d9..d529cfc07969e18f8c17983359aadc5cd543e45b 100644 (file)
@@ -15,7 +15,6 @@ Distributed under the GPL
 
 namespace Marklin {
 
-class LocoType;
 class TrackType;
 class VehicleType;
 
@@ -30,7 +29,6 @@ public:
                void ballast_profile();
                void gauge(float);
                void layout();
-               void locomotive(unsigned);
                void rail_profile();
                void scale(float, float);
                void track(unsigned);
@@ -66,7 +64,6 @@ public:
 
        void add_vehicle(VehicleType &);
        const VehicleType &get_vehicle(unsigned) const;
-       const LocoType &get_locomotive(unsigned) const;
        const std::map<unsigned, VehicleType *> &get_vehicles() const { return vehicles; }
 
        Layout &get_layout() { return layout; }
index 97297410c25d4188b7e54d6e13c5c7e77ee9d3ad..1448a1d76eef08085e76f4604c29fc2586b43e04 100644 (file)
@@ -15,11 +15,11 @@ Distributed under the GPL
 #include "catalogue.h"
 #include "driver.h"
 #include "layout.h"
-#include "locotype.h"
 #include "route.h"
 #include "track.h"
 #include "tracktype.h"
 #include "train.h"
+#include "vehicletype.h"
 
 using namespace std;
 using namespace Msp;
@@ -414,7 +414,7 @@ void Layout::Loader::track(unsigned art_nr)
 
 void Layout::Loader::train(unsigned art_nr, unsigned addr)
 {
-       Train *trn = new Train(obj, obj.catalogue.get_locomotive(art_nr), addr);
+       Train *trn = new Train(obj, obj.catalogue.get_vehicle(art_nr), addr);
        load_sub(*trn);
 }
 
diff --git a/source/libmarklin/locotype.cpp b/source/libmarklin/locotype.cpp
deleted file mode 100644 (file)
index c00f7d3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/* $Id$
-
-This file is part of the MSP Märklin suite
-Copyright © 2006-2009  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
-#include "locotype.h"
-
-using namespace std;
-
-namespace Marklin {
-
-LocoType::LocoType(unsigned an):
-       VehicleType(an)
-{ }
-
-unsigned LocoType::get_max_function() const
-{
-       if(funcs.empty())
-               return 0;
-       return (--funcs.end())->first;
-}
-
-
-LocoType::Loader::Loader(LocoType &lt):
-       VehicleType::Loader(lt)
-{
-       add("function", &Loader::function);
-}
-
-void LocoType::Loader::function(unsigned i, const string &f)
-{
-       static_cast<LocoType &>(obj).funcs[i] = f;
-}
-
-} // namespace Marklin
diff --git a/source/libmarklin/locotype.h b/source/libmarklin/locotype.h
deleted file mode 100644 (file)
index 8234c4f..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/* $Id$
-
-This file is part of the MSP Märklin suite
-Copyright © 2006-2009  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
-#ifndef LIBMARKLIN_LOCOTYPE_H_
-#define LIBMARKLIN_LOCOTYPE_H_
-
-#include "vehicletype.h"
-
-namespace Marklin {
-
-class LocoType: public VehicleType
-{
-public:
-       class Loader: public VehicleType::Loader
-       {
-       public:
-               Loader(LocoType &);
-       private:
-               void function(unsigned, const std::string &);
-       };
-
-private:
-       unsigned art_nr;
-       std::string name;
-       std::map<unsigned, std::string> funcs;
-
-public:
-       LocoType(unsigned);
-       unsigned get_max_function() const;
-       const std::map<unsigned, std::string> &get_functions() const { return funcs; }
-};
-
-} // namespace Marklin
-
-#endif
index a6fd46d1e40519381c9723058b7252736a5f3b98..eadc37de3d460a136ed8e94f0ebd108e9d258a53 100644 (file)
@@ -13,20 +13,20 @@ Distributed under the GPL
 #include "catalogue.h"
 #include "driver.h"
 #include "layout.h"
-#include "locotype.h"
 #include "route.h"
 #include "simplephysics.h"
 #include "timetable.h"
 #include "tracktype.h"
 #include "train.h"
 #include "vehicle.h"
+#include "vehicletype.h"
 
 using namespace std;
 using namespace Msp;
 
 namespace Marklin {
 
-Train::Train(Layout &l, const LocoType &t, unsigned a):
+Train::Train(Layout &l, const VehicleType &t, unsigned a):
        layout(l),
        loco_type(t),
        address(a),
@@ -49,6 +49,9 @@ Train::Train(Layout &l, const LocoType &t, unsigned a):
        accurate_position(false),
        overshoot_dist(false)
 {
+       if(!loco_type.is_locomotive())
+               throw InvalidParameterValue("Initial vehicle must be a locomotive");
+
        vehicles.push_back(new Vehicle(layout, loco_type));
 
        layout.add_train(*this);
@@ -87,6 +90,30 @@ void Train::set_priority(int p)
        priority = p;
 }
 
+void Train::add_vehicle(const VehicleType &vt)
+{
+       Vehicle *veh = new Vehicle(layout, vt);
+       vehicles.back()->attach_back(*veh);
+       vehicles.push_back(veh);
+}
+
+void Train::remove_vehicle(unsigned i)
+{
+       if(i>=vehicles.size())
+               throw InvalidParameterValue("Vehicle index out of range");
+       if(i==0)
+               throw InvalidParameterValue("Can't remove the locomotive");
+       delete vehicles[i];
+       vehicles.erase(vehicles.begin()+i);
+       if(i<vehicles.size())
+               vehicles[i-1]->attach_back(*vehicles[i]);
+}
+
+unsigned Train::get_n_vehicles() const
+{
+       return vehicles.size();
+}
+
 Vehicle &Train::get_vehicle(unsigned i)
 {
        if(i>=vehicles.size())
index ccfcbec1058f0dd6c12ab5409ad66415e4c27298..e8785f5e5994deb4ae275e670a0187676dd03534 100644 (file)
@@ -16,10 +16,10 @@ Distributed under the GPL
 namespace Marklin {
 
 class ControlModel;
-class LocoType;
 class Route;
 class Timetable;
 class Vehicle;
+class VehicleType;
 
 class Train: public sigc::trackable
 {
@@ -28,6 +28,7 @@ public:
        {
        private:
                Block *prev_block;
+               bool blocks_valid;
 
        public:
                Loader(Train &);
@@ -68,7 +69,7 @@ private:
        };
 
        Layout &layout;
-       const LocoType &loco_type;
+       const VehicleType &loco_type;
        unsigned address;
        std::string name;
        int priority;
@@ -97,11 +98,11 @@ private:
        float overshoot_dist;
 
 public:
-       Train(Layout &, const LocoType &, unsigned);
+       Train(Layout &, const VehicleType &, unsigned);
        ~Train();
 
        Layout &get_layout() const { return layout; }
-       const LocoType &get_locomotive_type() const { return loco_type; }
+       const VehicleType &get_locomotive_type() const { return loco_type; }
        unsigned get_address() const { return address; }
        void set_name(const std::string &);
        const std::string &get_name() const { return name; }
@@ -109,6 +110,9 @@ public:
        int get_priority() const { return priority; }
        ControlModel &get_control() const { return *control; }
 
+       void add_vehicle(const VehicleType &);
+       void remove_vehicle(unsigned);
+       unsigned get_n_vehicles() const;
        Vehicle &get_vehicle(unsigned);
        const Vehicle &get_vehicle(unsigned) const;
 
index 1f3d3ec178e56a771987264a495b5c20982d80b9..109c3f420d91621a44f427b70fae241669dfce71 100644 (file)
@@ -31,6 +31,10 @@ Vehicle::Vehicle(Layout &l, const VehicleType &t):
 
 Vehicle::~Vehicle()
 {
+       if(next)
+               detach_back();
+       if(prev)
+               detach_front();
        layout.remove_vehicle(*this);
 }
 
index 0c057e26203b79075eb1207f2c4b6c4b7bbda2f3..dd15b48f964794b2291775f98fae9cb6dadc8d44 100644 (file)
@@ -7,6 +7,7 @@ Distributed under the GPL
 
 #include "vehicletype.h"
 
+using namespace std;
 using namespace Msp;
 
 namespace Marklin {
@@ -18,6 +19,13 @@ VehicleType::VehicleType(unsigned n):
        height(0)
 { }
 
+unsigned VehicleType::get_max_function() const
+{
+       if(functions.empty())
+               return 0;
+       return (--functions.end())->first;
+}
+
 
 VehicleType::Axle::Axle():
        position(0),
@@ -35,13 +43,15 @@ VehicleType::Bogie::Bogie():
 VehicleType::Loader::Loader(VehicleType &vt):
        DataFile::ObjectLoader<VehicleType>(vt)
 {
-       add("axle",   &Loader::axle);
-       add("bogie",  &Loader::bogie);
-       add("height", &Loader::height);
-       add("length", &Loader::length);
-       add("object", &VehicleType::object);
-       add("name",   &VehicleType::name);
-       add("width",  &Loader::width);
+       add("axle",       &Loader::axle);
+       add("bogie",      &Loader::bogie);
+       add("function",   &Loader::function);
+       add("height",     &Loader::height);
+       add("length",     &Loader::length);
+       add("locomotive", &VehicleType::locomotive);
+       add("object",     &VehicleType::object);
+       add("name",       &VehicleType::name);
+       add("width",      &Loader::width);
 }
 
 void VehicleType::Loader::axle()
@@ -58,6 +68,11 @@ void VehicleType::Loader::bogie()
        obj.bogies.push_back(bog);
 }
 
+void VehicleType::Loader::function(unsigned i, const string &f)
+{
+       obj.functions[i] = f;
+}
+
 void VehicleType::Loader::height(float h)
 {
        obj.height = h/1000;
index 65f69e766d54ca66d48d3bb9000a6f68ab2bad22..2edf3bf55fee5242a11c73cb363327fcd70f4f61 100644 (file)
@@ -22,6 +22,7 @@ public:
        private:
                void axle();
                void bogie();
+               void function(unsigned, const std::string &);
                void height(float);
                void length(float);
                void width(float);
@@ -67,6 +68,8 @@ public:
 private:
        unsigned art_nr;
        std::string name;
+       bool locomotive;
+       std::map<unsigned, std::string> functions;
        float length;
        float width;
        float height;
@@ -76,10 +79,12 @@ private:
 
 public:
        VehicleType(unsigned);
-       virtual ~VehicleType() { } // XXX temporary
 
        unsigned get_article_number() const { return art_nr; }
        const std::string &get_name() const { return name; }
+       bool is_locomotive() const { return locomotive; }
+       unsigned get_max_function() const;
+       const std::map<unsigned, std::string> &get_functions() const { return functions; }
        float get_length() const { return length; }
        float get_width() const { return width; }
        float get_height() const { return height; }
index dd0dd8b927bde2a43ea9522d30aaef3f99cd912a..8db68717ddf27743b903d85c94976df10a605f83 100644 (file)
@@ -6,9 +6,9 @@ Distributed under the GPL
 */
 
 #include <msp/net/inet.h>
-#include "libmarklin/locotype.h"
 #include "libmarklin/route.h"
 #include "libmarklin/train.h"
+#include "libmarklin/vehicletype.h"
 #include "server.h"
 
 using namespace std;
index 5c4b457bad9bb3093edb962887d567798e6d8777..6a0c3a8b8fa99006c56275e9382618f05998b962 100644 (file)
@@ -14,7 +14,7 @@ namespace Marklin {
 
 NetTrain::NetTrain(Client &c, const TrainInfoPacket &pkt):
        client(c),
-       loco_type(client.get_catalogue().get_locomotive(pkt.loco_type)),
+       loco_type(client.get_catalogue().get_vehicle(pkt.loco_type)),
        address(pkt.address),
        name(pkt.name),
        functions(0)
index 74c6ccb6cae38d28d3216f0ed6d6dd53cc5dd7b7..3de4f7d38303bc067f55f4a83a1e070f01ccc07a 100644 (file)
@@ -9,7 +9,7 @@ Distributed under the GPL
 #define MARKLINNET_TRAIN_H_
 
 #include <sigc++/signal.h>
-#include "libmarklin/locotype.h"
+#include "libmarklin/vehicletype.h"
 #include "packets.h"
 
 namespace Marklin {
@@ -27,7 +27,7 @@ public:
 
 private:
        Client &client;
-       const LocoType &loco_type;
+       const VehicleType &loco_type;
        unsigned address;
        std::string name;
        std::map<std::string, float> controls;
@@ -38,7 +38,7 @@ private:
 public:
        NetTrain(Client &, const TrainInfoPacket &);
 
-       const LocoType &get_loco_type() const { return loco_type; }
+       const VehicleType &get_loco_type() const { return loco_type; }
        unsigned get_address() const { return address; }
        const std::string &get_name() const { return name; }
        void set_control(const std::string &, float);
index 37d75afba7273e36c8bb496f5e688cc1bfffb65e..45435d56fa1ebd4d8a65748a0843aecc1c00fa1b 100644 (file)
@@ -7,7 +7,6 @@ Distributed under the GPL
 
 #include <gtkmm/box.h>
 #include <gtkmm/liststore.h>
-#include "libmarklin/locotype.h"
 #include "remote.h"
 #include "trainpanel.h"
 
index 7a2c07a354523d886217c9f5e843c386faecaa26..fac3dfc8e676375e1188d1c74377686ac8aed576 100644 (file)
@@ -442,7 +442,7 @@ track 24977
        description "Bumper";
        part
        {
-               length 94.2;
+               length 77.5;
                dead_end true;
        };
 };