44 myApplicationWindow(applicationWindow),
75 bool validInput =
false;
79 std::string loadedFile;
81 if (neteditOptions.getBool(
"new")) {
84 }
else if (neteditOptions.getString(
"osm-files").size() > 0) {
87 }
else if (neteditOptions.getString(
"net-file").size() > 0) {
90 loadedFile = neteditOptions.getString(
"net-file");
91 }
else if (neteditOptions.getString(
"sumocfg-file").size() > 0) {
93 loadedFile = neteditOptions.getString(
"sumocfg-file");
100 WRITE_ERRORF(
TL(
"Loading of sumo config file '%' failed."), loadedFile);
104 }
else if (neteditOptions.getString(
"configuration-file").size() > 0) {
106 loadedFile = neteditOptions.getString(
"configuration-file");
113 WRITE_ERRORF(
TL(
"Loading of netedit config file '%' failed."), loadedFile);
122 WRITE_ERROR(
TL(
"Invalid input network option. Load with either sumo/netedit/netconvert config or with -new option"));
127 if (neteditOptions.isDefault(
"aggregate-warnings")) {
128 neteditOptions.setDefault(
"aggregate-warnings",
"5");
155 XMLSubSys::setValidation(neteditOptions.getString(
"xml-validation"), neteditOptions.getString(
"xml-validation.net"), neteditOptions.getString(
"xml-validation.routes"));
165 if (neteditOptions.getBool(
"new")) {
167 net =
new GNENet(netBuilder);
173 nl.
load(neteditOptions);
180 netBuilder->
compute(neteditOptions);
184 if (neteditOptions.getBool(
"ignore-errors")) {
192 net =
new GNENet(netBuilder);
194 if (neteditOptions.getBool(
"lefthand")) {
199 if (neteditOptions.getString(
"prefix").size() > 0) {
209 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
214 if (net !=
nullptr) {
221 }
catch (std::exception& e) {
224 if (net !=
nullptr) {
234 submitEndAndCleanup(net, loadedFile, neteditOptions.getString(
"gui-settings-file"), neteditOptions.getBool(
"registry-viewport"));
256 neteditOptions.
clear();
257 neteditOptions.
addCallExample(
"--new",
TL(
"Start plain GUI with empty net"));
259 neteditOptions.
addCallExample(
"-c <CONFIGURATION>",
TL(
"Open a configuration file (netedit or netconvert config)"));
260 neteditOptions.
addCallExample(
"-sumocfg-file <CONFIGURATION>",
TL(
"Open a SUMO config file"));
284 neteditOptions.
addSynonyme(
"sumocfg-file",
"sumocfg");
285 neteditOptions.
addDescription(
"sumocfg-file",
"Input",
TL(
"Load sumo config"));
286 neteditOptions.
addXMLDefault(
"sumocfg-file",
"sumoConfiguration");
289 neteditOptions.
addSynonyme(
"additional-files",
"additional");
290 neteditOptions.
addDescription(
"additional-files",
"Input",
TL(
"Load additional and shapes descriptions from FILE(s)"));
293 neteditOptions.
addSynonyme(
"route-files",
"routes");
294 neteditOptions.
addDescription(
"route-files",
"Input",
TL(
"Load demand elements descriptions from FILE(s)"));
298 neteditOptions.
addDescription(
"data-files",
"Input",
TL(
"Load data elements descriptions from FILE(s)"));
301 neteditOptions.
addSynonyme(
"meandata-files",
"meandata");
302 neteditOptions.
addDescription(
"meandata-files",
"Input",
TL(
"Load meanData descriptions from FILE(s)"));
305 neteditOptions.
addDescription(
"ignore-missing-inputs",
"Input",
TL(
"Reset path values (additional, route, data...) after loading netedit config"));
308 neteditOptions.
addDescription(
"selection-file",
"Input",
TL(
"Load element selection"));
313 neteditOptions.
addDescription(
"tls-file",
"Output",
TL(
"File in which TLS Programs must be saved"));
316 neteditOptions.
addDescription(
"edgetypes-file",
"Output",
TL(
"File in which edgeTypes must be saved"));
322 neteditOptions.
addDescription(
"new-network",
"Netedit",
TL(
"Start netedit with a new network"));
325 neteditOptions.
addDescription(
"attribute-help-output",
"Netedit",
TL(
"Write attribute help to file"));
328 neteditOptions.
addDescription(
"ignore-supermode-question",
"Netedit",
TL(
"Ignore question dialog during changing between supermodes in undo-redo"));
331 neteditOptions.
addDescription(
"ignore.additionalelements",
"Netedit",
TL(
"Ignore additional elements during loading of sumo-configs"));
334 neteditOptions.
addDescription(
"ignore.routeelements",
"Netedit",
TL(
"Ignore route elements during loading of sumo-configs"));
337 neteditOptions.
addDescription(
"e2.friendlyPos.automatic",
"Netedit",
TL(
"If the lane is shorter than the additional, automatically enable friendlyPos"));
340 neteditOptions.
addDescription(
"force-saving",
"Netedit",
TL(
"If enabled, elements will be saved regardless of whether they have been edited or not"));
345 neteditOptions.
addDescription(
"node-prefix",
"Netedit",
TL(
"Prefix for node naming"));
348 neteditOptions.
addDescription(
"edge-prefix",
"Netedit",
TL(
"Prefix for edge naming"));
351 neteditOptions.
addDescription(
"edge-infix",
"Netedit",
TL(
"Enable edge-infix (<fromNodeID><infix><toNodeID>)"));
356 neteditOptions.
addDescription(
"busStop-prefix",
"Netedit",
TL(
"Prefix for busStop naming"));
359 neteditOptions.
addDescription(
"trainStop-prefix",
"Netedit",
TL(
"Prefix for trainStop naming"));
362 neteditOptions.
addDescription(
"containerStop-prefix",
"Netedit",
TL(
"Prefix for containerStop naming"));
365 neteditOptions.
addDescription(
"chargingStation-prefix",
"Netedit",
TL(
"Prefix for chargingStation naming"));
368 neteditOptions.
addDescription(
"parkingArea-prefix",
"Netedit",
TL(
"Prefix for parkingArea naming"));
371 neteditOptions.
addDescription(
"e1Detector-prefix",
"Netedit",
TL(
"Prefix for e1Detector naming"));
374 neteditOptions.
addDescription(
"e2Detector-prefix",
"Netedit",
TL(
"Prefix for e2Detector naming"));
377 neteditOptions.
addDescription(
"e3Detector-prefix",
"Netedit",
TL(
"Prefix for e3Detector naming"));
380 neteditOptions.
addDescription(
"e1InstantDetector-prefix",
"Netedit",
TL(
"Prefix for e1InstantDetector naming"));
383 neteditOptions.
addDescription(
"rerouter-prefix",
"Netedit",
TL(
"Prefix for rerouter naming"));
386 neteditOptions.
addDescription(
"calibrator-prefix",
"Netedit",
TL(
"Prefix for calibrator naming"));
389 neteditOptions.
addDescription(
"routeProbe-prefix",
"Netedit",
TL(
"Prefix for routeProbe naming"));
392 neteditOptions.
addDescription(
"vss-prefix",
"Netedit",
TL(
"Prefix for variable speed sign naming"));
395 neteditOptions.
addDescription(
"tractionSubstation-prefix",
"Netedit",
TL(
"Prefix for traction substation naming"));
398 neteditOptions.
addDescription(
"overheadWire-prefix",
"Netedit",
TL(
"Prefix for overhead wire naming"));
401 neteditOptions.
addDescription(
"polygon-prefix",
"Netedit",
TL(
"Prefix for polygon naming"));
404 neteditOptions.
addDescription(
"poi-prefix",
"Netedit",
TL(
"Prefix for poi naming"));
407 neteditOptions.
addDescription(
"jps.walkableArea-prefix",
"Netedit",
TL(
"Prefix for jps walkable area naming"));
410 neteditOptions.
addDescription(
"jps.obstacle-prefix",
"Netedit",
TL(
"Prefix for jps obstacle naming"));
415 neteditOptions.
addDescription(
"route-prefix",
"Netedit",
TL(
"Prefix for route naming"));
418 neteditOptions.
addDescription(
"routeDistribution-prefix",
"Netedit",
TL(
"Prefix for route distribution naming"));
421 neteditOptions.
addDescription(
"vType-prefix",
"Netedit",
TL(
"Prefix for type naming"));
424 neteditOptions.
addDescription(
"vTypeDistribution-prefix",
"Netedit",
TL(
"Prefix for type distribution naming"));
427 neteditOptions.
addDescription(
"vehicle-prefix",
"Netedit",
TL(
"Prefix for vehicle naming"));
430 neteditOptions.
addDescription(
"trip-prefix",
"Netedit",
TL(
"Prefix for trip naming"));
433 neteditOptions.
addDescription(
"flow-prefix",
"Netedit",
TL(
"Prefix for flow naming"));
436 neteditOptions.
addDescription(
"person-prefix",
"Netedit",
TL(
"Prefix for person naming"));
439 neteditOptions.
addDescription(
"personflow-prefix",
"Netedit",
TL(
"Prefix for personFlow naming"));
442 neteditOptions.
addDescription(
"container-prefix",
"Netedit",
TL(
"Prefix for container naming"));
445 neteditOptions.
addDescription(
"containerflow-prefix",
"Netedit",
TL(
"Prefix for containerFlow naming"));
452 neteditOptions.
addDescription(
"meanDataEdge-prefix",
"Netedit",
TL(
"Prefix for meanDataEdge naming"));
455 neteditOptions.
addDescription(
"meanDataLane-prefix",
"Netedit",
TL(
"Prefix for meanDataLane naming"));
462 neteditOptions.
addDescription(
"disable-laneIcons",
"Visualisation",
TL(
"Disable icons of special lanes"));
465 neteditOptions.
addDescription(
"disable-textures",
"Visualisation",
TL(
"Disable textures"));
468 neteditOptions.
addDescription(
"gui-settings-file",
"Visualisation",
TL(
"Load visualisation settings from FILE"));
473 neteditOptions.
addDescription(
"registry-viewport",
"Visualisation",
TL(
"Load current viewport from registry"));
476 neteditOptions.
addDescription(
"window-size",
"Visualisation",
TL(
"Create initial window with the given x,y size"));
479 neteditOptions.
addDescription(
"window-pos",
"Visualisation",
TL(
"Create initial window at the given x,y position"));
484 neteditOptions.
addDescription(
"gui-testing",
"Visualisation",
TL(
"Enable overlay for screen recognition"));
487 neteditOptions.
addDescription(
"gui-testing-debug",
"Visualisation",
TL(
"Enable output messages during GUI-Testing"));
490 neteditOptions.
addDescription(
"gui-testing-debug-gl",
"Visualisation",
TL(
"Enable output messages during GUI-Testing specific of gl functions"));
493 neteditOptions.
addDescription(
"gui-testing.setting-output",
"Visualisation",
TL(
"Save gui settings in the given settings-output file"));
500 neteditOptions.
addDescription(
"begin",
"Time",
TL(
"Defines the begin time in seconds; The simulation starts at this time"));
503 neteditOptions.
addDescription(
"end",
"Time",
TL(
"Defines the end time in seconds; The simulation ends at this time"));
506 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."));
509 neteditOptions.
addDescription(
"default.speeddev",
"Processing",
TL(
"Select default speed deviation. A negative value implies vClass specific defaults (0.1 for the default passenger class)"));
523 neteditOptions.
set(
"offset.disable-normalization",
"true");
524 neteditOptions.
set(
"no-turnarounds",
"true");
545 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
564 neteditOptions.resetWritable();
565 neteditOptions.set(
"new",
"true");
#define WRITE_ERRORF(...)
#define WRITE_MESSAGE(msg)
bool loadNeteditConfig()
load netedit config
bool loadSumoConfig()
load SUMO config
The main window of Netedit.
OptionsCont & getSumoOptions()
get SUMO options container
bool consoleOptionsLoaded()
check if console options was already loaded
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.
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
void submitEndAndCleanup(GNENet *net, const std::string &loadedFile, const std::string &guiSettingsFile="", const bool viewportFromRegistry=false)
Closes the loading process.
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
A NBNetBuilder extended by visualisation and editing capabilities.
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 * getGLDebugInstance()
Returns the instance to add GLdebug to.
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 * getDebugInstance()
Returns the instance to add debug to.
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 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 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.