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 loadedFile = neteditOptions.getString(
"sumo-net-file");
88 }
else if (neteditOptions.getString(
"netecfg-file").size() > 0) {
92 loadedFile = neteditOptions.getString(
"netecfg-file");
93 }
else if (neteditOptions.getString(
"sumocfg-file").size() > 0) {
97 loadedFile = neteditOptions.getString(
"sumocfg-file");
98 }
else if (neteditOptions.getString(
"netccfg-file").size() > 0) {
102 loadedFile = neteditOptions.getString(
"netccfg-file");
103 }
else if (neteditOptions.getString(
"configuration-file").size() > 0) {
105 loadedFile = neteditOptions.getString(
"configuration-file");
154 if (neteditOptions.isDefault(
"aggregate-warnings")) {
155 neteditOptions.setDefault(
"aggregate-warnings",
"5");
176 XMLSubSys::setValidation(neteditOptions.getString(
"xml-validation"), neteditOptions.getString(
"xml-validation.net"), neteditOptions.getString(
"xml-validation.routes"));
188 if (neteditOptions.getBool(
"new")) {
196 nl.
load(neteditOptions);
203 netBuilder->
compute(neteditOptions);
207 if (neteditOptions.getBool(
"ignore-errors")) {
217 if (neteditOptions.getBool(
"lefthand")) {
222 if (neteditOptions.getString(
"prefix").size() > 0) {
232 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
237 if (net !=
nullptr) {
244 }
catch (std::exception& e) {
247 if (net !=
nullptr) {
257 return submitEndAndCleanup(type, net, loadedFile, neteditOptions.getString(
"gui-settings-file"),
258 neteditOptions.getBool(
"registry-viewport"));
264 const std::string& guiSettingsFile,
const bool viewportFromRegistry) {
278 neteditOptions.
clear();
279 neteditOptions.
addCallExample(
"--new",
TL(
"Start plain GUI with empty net"));
281 neteditOptions.
addCallExample(
"-c <CONFIGURATION>",
TL(
"Open a configuration file (netedit or netconvert config)"));
282 neteditOptions.
addCallExample(
"-sumocfg-file <CONFIGURATION>",
TL(
"Open a SUMO config file"));
305 neteditOptions.
addSynonyme(
"netecfg-file",
"netecfg");
306 neteditOptions.
addDescription(
"netecfg-file",
"Input",
TL(
"Load netedit config"));
307 neteditOptions.
addXMLDefault(
"netecfg-file",
"neteditConfiguration");
311 neteditOptions.
addSynonyme(
"sumocfg-file",
"sumocfg");
312 neteditOptions.
addDescription(
"sumocfg-file",
"Input",
TL(
"Load sumo config"));
313 neteditOptions.
addXMLDefault(
"sumocfg-file",
"sumoConfiguration");
317 neteditOptions.
addSynonyme(
"netccfg-file",
"netccfg");
318 neteditOptions.
addDescription(
"netccfg-file",
"Input",
TL(
"Load netconvert config"));
319 neteditOptions.
addXMLDefault(
"netccfg-file",
"netconvertConfiguration");
323 neteditOptions.
addSynonyme(
"additional-files",
"additional");
324 neteditOptions.
addDescription(
"additional-files",
"Input",
TL(
"Load additional and shapes descriptions from FILE(s)"));
328 neteditOptions.
addSynonyme(
"route-files",
"routes");
329 neteditOptions.
addDescription(
"route-files",
"Input",
TL(
"Load demand elements descriptions from FILE(s)"));
334 neteditOptions.
addDescription(
"data-files",
"Input",
TL(
"Load data elements descriptions from FILE(s)"));
338 neteditOptions.
addSynonyme(
"meandata-files",
"meandata");
339 neteditOptions.
addDescription(
"meandata-files",
"Input",
TL(
"Load meanData descriptions from FILE(s)"));
343 neteditOptions.
addDescription(
"ignore-missing-inputs",
"Input",
TL(
"Reset path values (additional, route, data...) after loading netedit config"));
346 neteditOptions.
addDescription(
"autosave-netconvert-file",
"Input",
TL(
"If enabled, automatically save a netconvert configuration after saving a netedit config"));
349 neteditOptions.
addDescription(
"selection-file",
"Input",
TL(
"Load element selection"));
357 neteditOptions.
addDescription(
"tls-file",
"Output",
TL(
"File in which TLS Programs must be saved"));
361 neteditOptions.
addDescription(
"edgetypes-file",
"Output",
TL(
"File in which edgeTypes must be saved"));
368 neteditOptions.
addDescription(
"new-network",
"Netedit",
TL(
"Start netedit with a new network"));
371 neteditOptions.
addDescription(
"attribute-help-output",
"Netedit",
TL(
"Write attribute help to file"));
374 neteditOptions.
addDescription(
"ignore-supermode-question",
"Netedit",
TL(
"Ignore question dialog during changing between supermodes in undo-redo"));
377 neteditOptions.
addDescription(
"ignore.additionalelements",
"Netedit",
TL(
"Ignore additional elements during loading of sumo-configs"));
380 neteditOptions.
addDescription(
"ignore.routeelements",
"Netedit",
TL(
"Ignore route elements during loading of sumo-configs"));
383 neteditOptions.
addDescription(
"e2.friendlyPos.automatic",
"Netedit",
TL(
"If the lane is shorter than the additional, automatically enable friendlyPos"));
386 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)"));
391 neteditOptions.
addDescription(
"node-prefix",
"Netedit",
TL(
"Prefix for node naming"));
394 neteditOptions.
addDescription(
"edge-prefix",
"Netedit",
TL(
"Prefix for edge naming"));
397 neteditOptions.
addDescription(
"edge-infix",
"Netedit",
TL(
"Enable edge-infix (<fromNodeID><infix><toNodeID>)"));
402 neteditOptions.
addDescription(
"busStop-prefix",
"Netedit",
TL(
"Prefix for busStop naming"));
405 neteditOptions.
addDescription(
"trainStop-prefix",
"Netedit",
TL(
"Prefix for trainStop naming"));
408 neteditOptions.
addDescription(
"containerStop-prefix",
"Netedit",
TL(
"Prefix for containerStop naming"));
411 neteditOptions.
addDescription(
"chargingStation-prefix",
"Netedit",
TL(
"Prefix for chargingStation naming"));
414 neteditOptions.
addDescription(
"parkingArea-prefix",
"Netedit",
TL(
"Prefix for parkingArea naming"));
417 neteditOptions.
addDescription(
"e1Detector-prefix",
"Netedit",
TL(
"Prefix for e1Detector naming"));
420 neteditOptions.
addDescription(
"e2Detector-prefix",
"Netedit",
TL(
"Prefix for e2Detector naming"));
423 neteditOptions.
addDescription(
"e3Detector-prefix",
"Netedit",
TL(
"Prefix for e3Detector naming"));
426 neteditOptions.
addDescription(
"e1InstantDetector-prefix",
"Netedit",
TL(
"Prefix for e1InstantDetector naming"));
429 neteditOptions.
addDescription(
"rerouter-prefix",
"Netedit",
TL(
"Prefix for rerouter naming"));
432 neteditOptions.
addDescription(
"calibrator-prefix",
"Netedit",
TL(
"Prefix for calibrator naming"));
435 neteditOptions.
addDescription(
"routeProbe-prefix",
"Netedit",
TL(
"Prefix for routeProbe naming"));
438 neteditOptions.
addDescription(
"vss-prefix",
"Netedit",
TL(
"Prefix for variable speed sign naming"));
441 neteditOptions.
addDescription(
"tractionSubstation-prefix",
"Netedit",
TL(
"Prefix for traction substation naming"));
444 neteditOptions.
addDescription(
"overheadWire-prefix",
"Netedit",
TL(
"Prefix for overhead wire naming"));
447 neteditOptions.
addDescription(
"polygon-prefix",
"Netedit",
TL(
"Prefix for polygon naming"));
450 neteditOptions.
addDescription(
"poi-prefix",
"Netedit",
TL(
"Prefix for poi naming"));
453 neteditOptions.
addDescription(
"jps.walkableArea-prefix",
"Netedit",
TL(
"Prefix for jps walkable area naming"));
456 neteditOptions.
addDescription(
"jps.obstacle-prefix",
"Netedit",
TL(
"Prefix for jps obstacle naming"));
461 neteditOptions.
addDescription(
"route-prefix",
"Netedit",
TL(
"Prefix for route naming"));
464 neteditOptions.
addDescription(
"routeDistribution-prefix",
"Netedit",
TL(
"Prefix for route distribution naming"));
467 neteditOptions.
addDescription(
"vType-prefix",
"Netedit",
TL(
"Prefix for type naming"));
470 neteditOptions.
addDescription(
"vTypeDistribution-prefix",
"Netedit",
TL(
"Prefix for type distribution naming"));
473 neteditOptions.
addDescription(
"vehicle-prefix",
"Netedit",
TL(
"Prefix for vehicle naming"));
476 neteditOptions.
addDescription(
"trip-prefix",
"Netedit",
TL(
"Prefix for trip naming"));
479 neteditOptions.
addDescription(
"flow-prefix",
"Netedit",
TL(
"Prefix for flow naming"));
482 neteditOptions.
addDescription(
"person-prefix",
"Netedit",
TL(
"Prefix for person naming"));
485 neteditOptions.
addDescription(
"personflow-prefix",
"Netedit",
TL(
"Prefix for personFlow naming"));
488 neteditOptions.
addDescription(
"container-prefix",
"Netedit",
TL(
"Prefix for container naming"));
491 neteditOptions.
addDescription(
"containerflow-prefix",
"Netedit",
TL(
"Prefix for containerFlow naming"));
496 neteditOptions.
addDescription(
"dataSet-prefix",
"Netedit",
TL(
"Prefix for dataSet naming"));
501 neteditOptions.
addDescription(
"meanDataEdge-prefix",
"Netedit",
TL(
"Prefix for meanDataEdge naming"));
504 neteditOptions.
addDescription(
"meanDataLane-prefix",
"Netedit",
TL(
"Prefix for meanDataLane naming"));
511 neteditOptions.
addDescription(
"disable-laneIcons",
"Visualisation",
TL(
"Disable icons of special lanes"));
514 neteditOptions.
addDescription(
"disable-textures",
"Visualisation",
TL(
"Disable textures"));
517 neteditOptions.
addDescription(
"gui-settings-file",
"Visualisation",
TL(
"Load visualisation settings from FILE"));
522 neteditOptions.
addDescription(
"registry-viewport",
"Visualisation",
TL(
"Load current viewport from registry"));
525 neteditOptions.
addDescription(
"window-size",
"Visualisation",
TL(
"Create initial window with the given x,y size"));
528 neteditOptions.
addDescription(
"window-pos",
"Visualisation",
TL(
"Create initial window at the given x,y position"));
533 neteditOptions.
addDescription(
"gui-testing",
"Visualisation",
TL(
"Enable overlay for screen recognition"));
536 neteditOptions.
addDescription(
"gui-testing-debug",
"Visualisation",
TL(
"Enable output messages during GUI-Testing"));
539 neteditOptions.
addDescription(
"gui-testing-debug-gl",
"Visualisation",
TL(
"Enable output messages during GUI-Testing specific of gl functions"));
542 neteditOptions.
addDescription(
"gui-testing.setting-output",
"Visualisation",
TL(
"Save gui settings in the given settings-output file"));
549 neteditOptions.
addDescription(
"begin",
"Time",
TL(
"Defines the begin time in seconds; The simulation starts at this time"));
552 neteditOptions.
addDescription(
"end",
"Time",
TL(
"Defines the end time in seconds; The simulation ends at this time"));
555 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."));
558 neteditOptions.
addDescription(
"default.speeddev",
"Processing",
TL(
"Select default speed deviation. A negative value implies vClass specific defaults (0.1 for the default passenger class)"));
576 neteditOptions.
set(
"offset.disable-normalization",
"true");
577 neteditOptions.
set(
"no-turnarounds",
"true");
598 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
617 neteditOptions.resetWritable();
618 neteditOptions.set(
"new",
"true");
#define WRITE_MESSAGE(msg)
void setDefaultFilenameFile(const FileBucket::Type type, const std::string &filename)
brief set default additional file
netconvert config handler
bool loadNetconvertConfig()
load netconvert config
bool loadNeteditConfig()
load netedit config
bool loadSumoConfig()
load SUMO config
GNEApplicationWindowHelper::FileBucketHandler * getFileBucketHandler() const
get file bucket handler
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.