#include <msp/strings/formatter.h>
#include <msp/strings/lexicalcast.h>
#include <msp/strings/regex.h>
+#include <msp/time/units.h>
#include "libmarklin/except.h"
#include "libmarklin/tracktype.h"
#include "engineer.h"
fullscreen(false),
layout(catalogue),
layout_3d(layout),
+ server(0),
train_prop(0),
train_prop_stale(false),
placing_train(0),
bool debug = false;
string device = "/dev/ttyS0";
unsigned quality = 4;
+ bool network = false;
GetOpt getopt;
getopt.add_option('r', "resolution", res, GetOpt::REQUIRED_ARG);
getopt.add_option('d', "device", device, GetOpt::REQUIRED_ARG);
getopt.add_option('q', "quality", quality, GetOpt::REQUIRED_ARG);
getopt.add_option('s', "simulate", simulate, GetOpt::NO_ARG);
+ getopt.add_option('n', "network", network, GetOpt::NO_ARG);
getopt.add_option( "no-lighting", no_lighting, GetOpt::NO_ARG);
getopt(argc, argv);
if(FS::exists("engineer.state"))
DataFile::load(*trfc_mgr, "engineer.state");
+ if(network)
+ {
+ server = new Server(*trfc_mgr);
+ server->use_event_dispatcher(event_disp);
+ }
+
const map<unsigned, Sensor *> &sensors = control.get_sensors();
for(map<unsigned, Sensor *>::const_iterator i=sensors.begin(); i!=sensors.end(); ++i)
i->second->signal_state_changed.connect(sigc::bind(sigc::mem_fun(this, &Engineer::sensor_event), i->second));
control.tick();
trfc_mgr->tick();
+ event_disp.tick(Time::zero);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);