108 new FXLabel(
this, category.c_str(),
nullptr,
GUIDesignLabel(JUSTIFY_NORMAL));
120 const std::string& parameter,
Option* option) :
122 myToolDialogParent(toolDialogParent),
124 myDefaultValue(pythonTool->getDefaultValue(parameter)) {
144 return myParameterLabel;
150 if (getValue() != myDefaultValue) {
151 return (
"-" + std::string(myParameterLabel->getText().text()) +
" " + getValue() +
" ");
160 if (myOption->isRequired()) {
161 return getValue() != myDefaultValue;
178 if (getValue() == myDefaultValue) {
179 return myResetButton->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
181 return myResetButton->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
194 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
"") {
200 myFilenameTextField->setText(myDefaultValue.c_str());
201 myOption->set(myDefaultValue, myDefaultValue,
false);
202 myOption->resetDefault();
210 if (myOption->getSubTopic() ==
"output") {
211 if (myOption->getListSeparator() !=
"") {
218 const auto xmlFileDialog =
GNEFileDialog(myToolDialogParent->getApplicationWindow(),
TL(
"XML file"),
223 myFilenameTextField->setText(xmlFileDialog.getFilename().c_str(), TRUE);
231 myOption->resetWritable();
232 if (myFilenameTextField->getText().empty()) {
235 myOption->set(myFilenameTextField->getText().text(), myFilenameTextField->getText().text(),
false);
246 const std::string& useCurrent) :
247 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
249 if (useCurrent.size() > 0) {
266 return myFilenameTextField->getText().text();
275 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
288 myEdgeVectorTextField->setText(myDefaultValue.c_str());
289 myOption->set(myDefaultValue, myDefaultValue,
false);
290 myOption->resetDefault();
296 myOption->resetWritable();
297 if (myEdgeVectorTextField->getText().empty()) {
300 myOption->set(myEdgeVectorTextField->getText().text(), myEdgeVectorTextField->getText().text(),
false);
309 const auto selectedEdges = myToolDialogParent->getApplicationWindow()->getViewNet()->getNet()->getAttributeCarriers()->getSelectedEdges();
311 std::string selectedEdgesStr;
312 for (
const auto& edge : selectedEdges) {
313 selectedEdgesStr.append(edge->getID());
314 if (edge != selectedEdges.back()) {
315 selectedEdgesStr.append(
" ");
318 myEdgeVectorTextField->setText(selectedEdgesStr.c_str(), TRUE);
326 const auto viewNet = myToolDialogParent->getApplicationWindow()->getViewNet();
327 if (viewNet ==
nullptr) {
328 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
329 }
else if (viewNet->getNet()->getAttributeCarriers()->getNumberOfSelectedEdges() == 0) {
330 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
332 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
342 return myEdgeVectorTextField->getText().text();
351 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"network")) {
359 if (myOption->getSubTopic() ==
"output") {
360 if (myOption->getListSeparator() !=
"") {
367 const auto networkFileDialog =
GNEFileDialog(myToolDialogParent->getApplicationWindow(),
TL(
"network file"),
372 myFilenameTextField->setText(networkFileDialog.getFilename().c_str(), TRUE);
387 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
388 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
390 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
392 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
405 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"additional")) {
413 if (myOption->getSubTopic() ==
"output") {
414 if (myOption->getListSeparator() !=
"") {
421 const auto additionalFileDialog =
GNEFileDialog(myToolDialogParent->getApplicationWindow(),
TL(
"Additional elements file"),
426 myFilenameTextField->setText(additionalFileDialog.getFilename().c_str(), TRUE);
441 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
442 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
444 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
446 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
459 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"route")) {
467 if (myOption->getSubTopic() ==
"output") {
468 if (myOption->getListSeparator() !=
"") {
475 const auto routeFileDialog =
GNEFileDialog(myToolDialogParent->getApplicationWindow(),
TL(
"Route elements file"),
480 myFilenameTextField->setText(routeFileDialog.getFilename().c_str(), TRUE);
495 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
496 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
498 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
500 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
513 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"data")) {
521 if (myOption->getSubTopic() ==
"output") {
522 if (myOption->getListSeparator() !=
"") {
529 const auto dataFileDialog =
GNEFileDialog(myToolDialogParent->getApplicationWindow(),
TL(
"Data elements file"),
534 myFilenameTextField->setText(dataFileDialog.getFilename().c_str(), TRUE);
549 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
550 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
552 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
554 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
567 FileNameArgument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option,
TL(
"sumo config")) {
575 if (myOption->getSubTopic() ==
"output") {
576 if (myOption->getListSeparator() !=
"") {
583 const auto sumoConfigFileDialog =
GNEFileDialog(myToolDialogParent->getApplicationWindow(),
TL(
"sumo config file"),
588 myFilenameTextField->setText(sumoConfigFileDialog.getFilename().c_str(), TRUE);
603 if (myToolDialogParent->getApplicationWindow()->getViewNet() ==
nullptr) {
604 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
606 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_DISABLE),
nullptr);
608 return sender->handle(
this, FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
621 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
631 myEdgeTextField->setText(myDefaultValue.c_str());
632 myOption->set(myDefaultValue, myDefaultValue,
false);
633 myOption->resetDefault();
639 myOption->resetWritable();
640 if (myEdgeTextField->getText().empty()) {
643 myOption->set(myEdgeTextField->getText().text(), myEdgeTextField->getText().text(),
false);
651 return myEdgeTextField->getText().text();
660 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
670 myStringTextField->setText(myDefaultValue.c_str());
671 myOption->set(myDefaultValue, myDefaultValue,
false);
672 myOption->resetDefault();
678 myOption->resetWritable();
679 if (myStringTextField->getText().empty()) {
682 myOption->set(myStringTextField->getText().text(), myStringTextField->getText().text(),
false);
690 return myStringTextField->getText().text();
699 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
709 myIntTextField->setText(myDefaultValue.c_str());
710 if (myDefaultValue.empty()) {
711 myOption->set(INVALID_INT_STR,
"",
false);
713 myOption->set(myDefaultValue, myDefaultValue,
false);
715 myOption->resetDefault();
721 myOption->resetWritable();
722 if (myIntTextField->getText().empty()) {
725 myOption->set(myIntTextField->getText().text(), myIntTextField->getText().text(),
false);
733 return myIntTextField->getText().text();
742 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
752 myFloatTextField->setText(myDefaultValue.c_str());
753 if (myDefaultValue.empty()) {
754 myOption->set(INVALID_DOUBLE_STR,
"",
false);
756 myOption->set(myDefaultValue, myDefaultValue,
false);
758 myOption->resetDefault();
764 myOption->resetWritable();
765 if (myFloatTextField->getText().empty()) {
768 myOption->set(myFloatTextField->getText().text(), myFloatTextField->getText().text(),
false);
776 return myFloatTextField->getText().text();
785 Argument(toolDialogParent, pythonTool, applicationWindow, argumentFrame, name, option) {
801 if (myDefaultValue ==
"True") {
802 myCheckButton->setCheck(TRUE);
803 myCheckButton->setText(
TL(
"true"));
805 myCheckButton->setCheck(FALSE);
806 myCheckButton->setText(
TL(
"false"));
808 myOption->set(myDefaultValue, myDefaultValue,
false);
809 myOption->resetDefault();
815 myOption->resetWritable();
816 if (myCheckButton->getCheck() == TRUE) {
817 myCheckButton->setText(
TL(
"true"));
818 myOption->set(
"True",
"True",
false);
819 if (myDefaultValue ==
"True") {
820 myOption->resetDefault();
823 myCheckButton->setText(
TL(
"false"));
824 myOption->set(
"False",
"False",
false);
825 if (myDefaultValue ==
"False") {
826 myOption->resetDefault();
835 if (myCheckButton->getCheck() == TRUE) {
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_SELECT
select element
@ MID_GNE_USE_CURRENT
use current network/additional/route/edgedata
@ MID_GNE_RESET
reset element
#define GUIDesignButtonIcon
button only with icon
#define GUIDesignTextField
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignLabel(justify)
#define GUIDesignTextFieldNCol
Num of column of text field.
#define GUIDesignTextColorBlue
blue color (for default text)
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignTextFieldRestricted(type)
text field extended over Frame with thick frame (int)
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
const double INVALID_DOUBLE
invalid double
const int INVALID_INT
invalid int
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
The main window of Netedit.
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXStaticToolTip * getStaticTooltipMenu() const
get static toolTip for menus
A class representing a single program option.
const std::string & getDescription() const
Returns the description of what this option does.
virtual const std::string & getTypeName() const
Returns the mml-type name of this option.
virtual bool getBool() const
Returns the stored boolean value.
bool isRequired() const
check if option is required
const std::string & getValueString() const
Returns the string-representation of the value.
static OptionsCont & getOptions()
Retrieves the options.
static StringBijection< SumoConfigFileExtension > SumoConfigFileExtensions
sumo config file extensions
static StringBijection< AdditionalFileExtension > AdditionalFileExtensions
additional file extensions
static StringBijection< RouteFileExtension > RouteFileExtensions
route file extensions
static StringBijection< XMLFileExtension > XMLFileExtensions
XML file Extensions.
static StringBijection< EdgeDataFileExtension > EdgeDataFileExtensions
edgedata file extensions
static StringBijection< NetFileExtension > NetFileExtensions
net file extensions