+ TrainPanel *tpanel = new TrainPanel(*this, ui_res, train);
+ root->add(*tpanel);
+ int y = main_panel->get_geometry().y;
+ for(list<TrainPanel *>::iterator i=train_panels.begin(); i!=train_panels.end(); ++i)
+ y -= (*i)->get_geometry().h;
+ tpanel->set_position(0, y-tpanel->get_geometry().h);
+ train_panels.push_back(tpanel);
+ tpanel->set_visible(true);
+
+ place_train(train);
+}
+
+void Engineer::sighandler(int sig)
+{
+ if(sig==SIGSEGV || sig==SIGILL || sig==SIGFPE || sig==SIGABRT)
+ {
+ signal(sig, SIG_DFL);
+ IO::print(IO::cerr, "Fatal signal received, terminating\n");
+ const map<unsigned, Locomotive *> &locos = control.get_locomotives();
+ for(map<unsigned, Locomotive *>::const_iterator i=locos.begin(); i!=locos.end(); ++i)
+ i->second->set_speed(0);
+ control.flush();
+ raise(sig);
+ }
+ else if(sig==SIGTERM || sig==SIGINT)
+ exit(0);