]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/trafficmanager.cpp
Allow setting sensor ID for multiple tracks at once
[r2c2.git] / source / libmarklin / trafficmanager.cpp
index 9666f12a1996bb8a41a5096ce2ad6eca347ad042..4cc186bcdebafa39174bba59b9aeae857152c942 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of the MSP Märklin suite
-Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
+Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -9,6 +9,7 @@ Distributed under the GPL
 #include <msp/time/utils.h>
 #include "control.h"
 #include "layout.h"
+#include "tracktype.h"
 #include "trafficmanager.h"
 #include "turnout.h"
 
@@ -27,7 +28,7 @@ TrafficManager::TrafficManager(Control &c, Layout &l):
        for(set<Track *>::const_iterator i=tracks.begin(); i!=tracks.end(); ++i)
        {
                if(unsigned tid=(*i)->get_turnout_id())
-                       new Turnout(control, tid);
+                       new Turnout(control, tid, (*i)->get_type().get_n_routes()>=3);
                if(unsigned sid=(*i)->get_sensor_id())
                        new Sensor(control, sid);