43 myApplicationWindow(applicationWindow),
74 std::string loadedFile;
76 if (neteditOptions.getBool(
"new")) {
79 }
else if (neteditOptions.getString(
"osm-files").size() > 0) {
82 }
else if (neteditOptions.getString(
"sumo-net-file").size() > 0) {
85 }
else if (neteditOptions.getString(
"netecfg-file").size() > 0) {
89 loadedFile = neteditOptions.getString(
"netecfg-file");
90 }
else if (neteditOptions.getString(
"sumocfg-file").size() > 0) {
94 loadedFile = neteditOptions.getString(
"sumocfg-file");
95 }
else if (neteditOptions.getString(
"netccfg-file").size() > 0) {
99 loadedFile = neteditOptions.getString(
"netccfg-file");
100 }
else if (neteditOptions.getString(
"configuration-file").size() > 0) {
102 loadedFile = neteditOptions.getString(
"configuration-file");
151 if (neteditOptions.isDefault(
"aggregate-warnings")) {
152 neteditOptions.setDefault(
"aggregate-warnings",
"5");
173 XMLSubSys::setValidation(neteditOptions.getString(
"xml-validation"), neteditOptions.getString(
"xml-validation.net"), neteditOptions.getString(
"xml-validation.routes"));
185 if (neteditOptions.getBool(
"new")) {
193 nl.
load(neteditOptions);
200 netBuilder->
compute(neteditOptions);
204 if (neteditOptions.getBool(
"ignore-errors")) {
214 if (neteditOptions.getBool(
"lefthand")) {
219 if (neteditOptions.getString(
"prefix").size() > 0) {
229 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
234 if (net !=
nullptr) {
241 }
catch (std::exception& e) {
244 if (net !=
nullptr) {
254 return submitEndAndCleanup(type, net, loadedFile, neteditOptions.getString(
"gui-settings-file"),
255 neteditOptions.getBool(
"registry-viewport"));
261 const std::string& guiSettingsFile,
const bool viewportFromRegistry) {
275 neteditOptions.
clear();
276 neteditOptions.
addCallExample(
"--new",
TL(
"Start plain GUI with empty net"));
278 neteditOptions.
addCallExample(
"-c <CONFIGURATION>",
TL(
"Open a configuration file (netedit or netconvert config)"));
279 neteditOptions.
addCallExample(
"-sumocfg-file <CONFIGURATION>",
TL(
"Open a SUMO config file"));
302 neteditOptions.
addSynonyme(
"netecfg-file",
"netecfg");
303 neteditOptions.
addDescription(
"netecfg-file",
"Input",
TL(
"Load netedit config"));
304 neteditOptions.
addXMLDefault(
"netecfg-file",
"neteditConfiguration");
308 neteditOptions.
addSynonyme(
"sumocfg-file",
"sumocfg");
309 neteditOptions.
addDescription(
"sumocfg-file",
"Input",
TL(
"Load sumo config"));
310 neteditOptions.
addXMLDefault(
"sumocfg-file",
"sumoConfiguration");
314 neteditOptions.
addSynonyme(
"netccfg-file",
"netccfg");
315 neteditOptions.
addDescription(
"netccfg-file",
"Input",
TL(
"Load netconvert config"));
316 neteditOptions.
addXMLDefault(
"netccfg-file",
"netconvertConfiguration");
320 neteditOptions.
addSynonyme(
"additional-files",
"additional");
321 neteditOptions.
addDescription(
"additional-files",
"Input",
TL(
"Load additional and shapes descriptions from FILE(s)"));
325 neteditOptions.
addSynonyme(
"route-files",
"routes");
326 neteditOptions.
addDescription(
"route-files",
"Input",
TL(
"Load demand elements descriptions from FILE(s)"));
331 neteditOptions.
addDescription(
"data-files",
"Input",
TL(
"Load data elements descriptions from FILE(s)"));
335 neteditOptions.
addSynonyme(
"meandata-files",
"meandata");
336 neteditOptions.
addDescription(
"meandata-files",
"Input",
TL(
"Load meanData descriptions from FILE(s)"));
340 neteditOptions.
addDescription(
"ignore-missing-inputs",
"Input",
TL(
"Reset path values (additional, route, data...) after loading netedit config"));
343 neteditOptions.
addDescription(
"autosave-netconvert-file",
"Input",
TL(
"If enabled, automatically save a netconvert configuration after saving a netedit config"));
346 neteditOptions.
addDescription(
"selection-file",
"Input",
TL(
"Load element selection"));
354 neteditOptions.
addDescription(
"tls-file",
"Output",
TL(
"File in which TLS Programs must be saved"));
358 neteditOptions.
addDescription(
"edgetypes-file",
"Output",
TL(
"File in which edgeTypes must be saved"));
365 neteditOptions.
addDescription(
"new-network",
"Netedit",
TL(
"Start netedit with a new network"));
368 neteditOptions.
addDescription(
"attribute-help-output",
"Netedit",
TL(
"Write attribute help to file"));
371 neteditOptions.
addDescription(
"ignore-supermode-question",
"Netedit",
TL(
"Ignore question dialog during changing between supermodes in undo-redo"));
374 neteditOptions.
addDescription(
"ignore.additionalelements",
"Netedit",
TL(
"Ignore additional elements during loading of sumo-configs"));
377 neteditOptions.
addDescription(
"ignore.routeelements",
"Netedit",
TL(
"Ignore route elements during loading of sumo-configs"));
380 neteditOptions.
addDescription(
"e2.friendlyPos.automatic",
"Netedit",
TL(
"If the lane is shorter than the additional, automatically enable friendlyPos"));
383 neteditOptions.
addDescription(
"force-saving",
"Netedit",
TL(
"If enabled, loaded elements will be saved regardless of whether they have been edited or not (usually used in netedit test)"));
388 neteditOptions.
addDescription(
"node-prefix",
"Netedit",
TL(
"Prefix for node naming"));
391 neteditOptions.
addDescription(
"edge-prefix",
"Netedit",
TL(
"Prefix for edge naming"));
394 neteditOptions.
addDescription(
"edge-infix",
"Netedit",
TL(
"Enable edge-infix (<fromNodeID><infix><toNodeID>)"));
399 neteditOptions.
addDescription(
"busStop-prefix",
"Netedit",
TL(
"Prefix for busStop naming"));
402 neteditOptions.
addDescription(
"trainStop-prefix",
"Netedit",
TL(
"Prefix for trainStop naming"));
405 neteditOptions.
addDescription(
"containerStop-prefix",
"Netedit",
TL(
"Prefix for containerStop naming"));
408 neteditOptions.
addDescription(
"chargingStation-prefix",
"Netedit",
TL(
"Prefix for chargingStation naming"));
411 neteditOptions.
addDescription(
"parkingArea-prefix",
"Netedit",
TL(
"Prefix for parkingArea naming"));
414 neteditOptions.
addDescription(
"e1Detector-prefix",
"Netedit",
TL(
"Prefix for e1Detector naming"));
417 neteditOptions.
addDescription(
"e2Detector-prefix",
"Netedit",
TL(
"Prefix for e2Detector naming"));
420 neteditOptions.
addDescription(
"e3Detector-prefix",
"Netedit",
TL(
"Prefix for e3Detector naming"));
423 neteditOptions.
addDescription(
"e1InstantDetector-prefix",
"Netedit",
TL(
"Prefix for e1InstantDetector naming"));
426 neteditOptions.
addDescription(
"rerouter-prefix",
"Netedit",
TL(
"Prefix for rerouter naming"));
429 neteditOptions.
addDescription(
"calibrator-prefix",
"Netedit",
TL(
"Prefix for calibrator naming"));
432 neteditOptions.
addDescription(
"routeProbe-prefix",
"Netedit",
TL(
"Prefix for routeProbe naming"));
435 neteditOptions.
addDescription(
"vss-prefix",
"Netedit",
TL(
"Prefix for variable speed sign naming"));
438 neteditOptions.
addDescription(
"tractionSubstation-prefix",
"Netedit",
TL(
"Prefix for traction substation naming"));
441 neteditOptions.
addDescription(
"overheadWire-prefix",
"Netedit",
TL(
"Prefix for overhead wire naming"));
444 neteditOptions.
addDescription(
"polygon-prefix",
"Netedit",
TL(
"Prefix for polygon naming"));
447 neteditOptions.
addDescription(
"poi-prefix",
"Netedit",
TL(
"Prefix for poi naming"));
450 neteditOptions.
addDescription(
"jps.walkableArea-prefix",
"Netedit",
TL(
"Prefix for jps walkable area naming"));
453 neteditOptions.
addDescription(
"jps.obstacle-prefix",
"Netedit",
TL(
"Prefix for jps obstacle naming"));
458 neteditOptions.
addDescription(
"route-prefix",
"Netedit",
TL(
"Prefix for route naming"));
461 neteditOptions.
addDescription(
"routeDistribution-prefix",
"Netedit",
TL(
"Prefix for route distribution naming"));
464 neteditOptions.
addDescription(
"vType-prefix",
"Netedit",
TL(
"Prefix for type naming"));
467 neteditOptions.
addDescription(
"vTypeDistribution-prefix",
"Netedit",
TL(
"Prefix for type distribution naming"));
470 neteditOptions.
addDescription(
"vehicle-prefix",
"Netedit",
TL(
"Prefix for vehicle naming"));
473 neteditOptions.
addDescription(
"trip-prefix",
"Netedit",
TL(
"Prefix for trip naming"));
476 neteditOptions.
addDescription(
"flow-prefix",
"Netedit",
TL(
"Prefix for flow naming"));
479 neteditOptions.
addDescription(
"person-prefix",
"Netedit",
TL(
"Prefix for person naming"));
482 neteditOptions.
addDescription(
"personflow-prefix",
"Netedit",
TL(
"Prefix for personFlow naming"));
485 neteditOptions.
addDescription(
"container-prefix",
"Netedit",
TL(
"Prefix for container naming"));
488 neteditOptions.
addDescription(
"containerflow-prefix",
"Netedit",
TL(
"Prefix for containerFlow naming"));
493 neteditOptions.
addDescription(
"dataSet-prefix",
"Netedit",
TL(
"Prefix for dataSet naming"));
498 neteditOptions.
addDescription(
"meanDataEdge-prefix",
"Netedit",
TL(
"Prefix for meanDataEdge naming"));
501 neteditOptions.
addDescription(
"meanDataLane-prefix",
"Netedit",
TL(
"Prefix for meanDataLane naming"));
508 neteditOptions.
addDescription(
"disable-laneIcons",
"Visualisation",
TL(
"Disable icons of special lanes"));
511 neteditOptions.
addDescription(
"disable-textures",
"Visualisation",
TL(
"Disable textures"));
514 neteditOptions.
addDescription(
"gui-settings-file",
"Visualisation",
TL(
"Load visualisation settings from FILE"));
519 neteditOptions.
addDescription(
"registry-viewport",
"Visualisation",
TL(
"Load current viewport from registry"));
522 neteditOptions.
addDescription(
"window-size",
"Visualisation",
TL(
"Create initial window with the given x,y size"));
525 neteditOptions.
addDescription(
"window-pos",
"Visualisation",
TL(
"Create initial window at the given x,y position"));
530 neteditOptions.
addDescription(
"gui-testing",
"Visualisation",
TL(
"Enable overlay for screen recognition"));
533 neteditOptions.
addDescription(
"gui-testing-debug",
"Visualisation",
TL(
"Enable output messages during GUI-Testing"));
536 neteditOptions.
addDescription(
"gui-testing-debug-gl",
"Visualisation",
TL(
"Enable output messages during GUI-Testing specific of gl functions"));
539 neteditOptions.
addDescription(
"gui-testing.setting-output",
"Visualisation",
TL(
"Save gui settings in the given settings-output file"));
546 neteditOptions.
addDescription(
"begin",
"Time",
TL(
"Defines the begin time in seconds; The simulation starts at this time"));
549 neteditOptions.
addDescription(
"end",
"Time",
TL(
"Defines the end time in seconds; The simulation ends at this time"));
552 neteditOptions.
addDescription(
"default.action-step-length",
"Processing",
TL(
"Length of the default interval length between action points for the car-following and lane-change models (in seconds). If not specified, the simulation step-length is used per default. Vehicle- or VType-specific settings override the default. Must be a multiple of the simulation step-length."));
555 neteditOptions.
addDescription(
"default.speeddev",
"Processing",
TL(
"Select default speed deviation. A negative value implies vClass specific defaults (0.1 for the default passenger class)"));
573 neteditOptions.
set(
"offset.disable-normalization",
"true");
574 neteditOptions.
set(
"no-turnarounds",
"true");
595 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
614 neteditOptions.resetWritable();
615 neteditOptions.set(
"new",
"true");
#define WRITE_MESSAGE(msg)
netconvert config handler
bool loadNetconvertConfig()
load netconvert config
bool loadNeteditConfig()
load netedit config
bool loadSumoConfig()
load SUMO config
bool consoleOptionsLoaded()
check if console options was already loaded
Type
type of loaded element
MFXSynchQue< GUIEvent * > & myEventQueue
event Queue
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
FXint submitEndAndCleanup(GNEEvent_FileLoaded::Type type, GNENet *net, const std::string &loadedFile, const std::string &guiSettingsFile="", const bool viewportFromRegistry=false)
Closes the loading process.
void newNetwork()
begins the creation of an empty network
static void fillOptions(OptionsCont &neteditOptions)
clears and initializes the OptionsCont
void loadNetworkOrConfig()
begins the loading of an existent network or config
OutputDevice * myWarningRetriever
GNEApplicationWindow * myApplicationWindow
netedit application windows
bool loadConsoleOptions()
load options through console
OutputDevice * myMessageRetriever
static void setDefaultOptions(OptionsCont &neteditOptions)
sets required options for proper functioning
virtual ~GNELoadThread()
destructor
OutputDevice * myGLDebugRetriever
OutputDevice * myDebugRetriever
FXEX::MFXThreadEvent & myEventThrow
event throw
FXint run()
starts the thread. The thread ends after the net has been loaded
GNELoadThread(GNEApplicationWindow *applicationWindow, MFXSynchQue< GUIEvent * > &eq, FXEX::MFXThreadEvent &ev)
constructor
void addPrefixToJunctions(const std::string &prefix)
add prefix to all junctions
void addPrefixToEdges(const std::string &prefix)
add prefix to all edges
void computeAndUpdate(OptionsCont &neteditOptions, bool volatileOptions)
recompute the network and update lane geometries
NBNetBuilder * getNetBuilder() const
get net builder
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
static void addProjectionOptions(OptionsCont &oc)
Adds projection options to the given container.
static bool init(OptionsCont &oc)
Initialises the processing and the final instance using the given options.
static void computeFinal(bool lefthand=false)
compute the location attributes which will be used for output based on the loaded location data,...
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
static void enableDebugGLMessages(bool enable)
enable/disable gl-debug messages
static void initOutputOptions()
init output options
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
static void enableDebugMessages(bool enable)
enable/disable debug messages
virtual void clear(bool resetInformed=true)
Clears information whether an error occurred previously and print aggregated message summary.
virtual void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
@ MT_GLDEBUG
The message is GL debug output.
@ MT_DEBUG
The message is debug output.
@ MT_MESSAGE
The message is only something to show.
@ MT_ERROR
The message is an error.
@ MT_WARNING
The message is a warning.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
Encapsulates an object's method for using it as a message retriever.
void addPrefix(const std::string &prefix)
add prefix to all edges
static void fillOptions(OptionsCont &oc, bool forNetgen)
Inserts options used by the network converter.
static bool checkOptions(OptionsCont &oc)
Checks set options from the OptionsCont-singleton for being valid.
Instance responsible for building networks.
NBNodeCont & getNodeCont()
Returns a reference to the node container.
NBEdgeCont & getEdgeCont()
void applyOptions(OptionsCont &oc)
Initialises the storage by applying given options.
void compute(OptionsCont &oc, const std::set< std::string > &explicitTurnarounds=std::set< std::string >(), bool mayAddOrRemove=true)
Performs the network building steps.
void addPrefix(const std::string &prefix)
add prefix to all nodes
static bool checkOptions(OptionsCont &oc)
Checks set options for being valid.
static void fillOptions(OptionsCont &oc, bool forNetedit=false)
Inserts options used by the network importer and network building modules.
void load(OptionsCont &oc)
static void fillOptions(OptionsCont &oc, bool forNetgen)
Inserts options used by the network writer.
static bool checkOptions(OptionsCont &oc)
Checks set options for being valid.
A storage for options typed value containers)
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
void setOptionEditable(const std::string &name, const bool value)
set option editable
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
void doRegister(const std::string &name, Option *o)
Adds an option under the given name.
void clear()
Removes all information from the container.
bool set(const std::string &name, const std::string &value, const bool append=false)
Sets the given value for the named option.
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
void resetWritable()
Resets all options to be writeable.
void addXMLDefault(const std::string &name, const std::string &xmlRoot="")
Adds an XML root element to handle by default. The special root "" denotes the default handler.
static OptionsCont & getOptions()
Retrieves the options.
void addCallExample(const std::string &example, const std::string &desc)
Add a call example.
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
static void insertRandOptions(OptionsCont &oc)
Initialises the given options container with random number options.
static void initRandGlobal(SumoRNG *which=nullptr)
Reads the given random number options and initialises the random number generator in accordance.
static bool endsWith(const std::string &str, const std::string suffix)
Checks whether a given string ends with the suffix.
static bool checkOptions(OptionsCont &oc)
checks shared options and sets StdDefs
static void addConfigurationOptions(OptionsCont &oc)
Adds configuration options to the given container.
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme, const std::string &routeValidationScheme)
Enables or disables validation.