]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/tracktype.cpp
Make LCD output selectable at runtime through an extra I/O pin
[r2c2.git] / source / libmarklin / tracktype.cpp
index 53c2bc47844c862e0a3b07db63f94aa71a37e041..9f2979bebff80ca4112eb2c3013d6a4209da1ddf 100644 (file)
@@ -13,8 +13,8 @@ using namespace Msp;
 
 namespace Marklin {
 
-TrackType::TrackType(unsigned a):
-       art_nr(a),
+TrackType::TrackType(const ArticleNumber &an):
+       art_nr(an),
        double_address(false),
        autofit_preference(1)
 { }
@@ -59,6 +59,14 @@ bool TrackType::is_dead_end() const
        return endpoints.size()<2;
 }
 
+const TrackType::Endpoint &TrackType::get_endpoint(unsigned i) const
+{
+       if(i>=endpoints.size())
+               throw InvalidParameterValue("Endpoint index out of range");
+
+       return endpoints[i];
+}
+
 TrackPoint TrackType::get_point(unsigned epi, unsigned path, float d) const
 {
        if(epi>=endpoints.size())