X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Ftracktype.cpp;h=9f2979bebff80ca4112eb2c3013d6a4209da1ddf;hb=975ea87cc7be179618b06291cb2506a2523cad1f;hp=53c2bc47844c862e0a3b07db63f94aa71a37e041;hpb=258600f95f62ba4fbe745da4aebdd1a496af0050;p=r2c2.git diff --git a/source/libmarklin/tracktype.cpp b/source/libmarklin/tracktype.cpp index 53c2bc4..9f2979b 100644 --- a/source/libmarklin/tracktype.cpp +++ b/source/libmarklin/tracktype.cpp @@ -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())