62 FXDialogBox(viewNet->getApp(), ("Fix additional problems"),
GUIDesignDialogBoxExplicit, 0, 0, 478, 350, 0, 0, 0, 0),
64 myInvalidSingleLaneAdditionals(invalidSingleLaneAdditionals),
65 myInvalidMultiLaneAdditionals(invalidMultiLaneAdditionals) {
74 myTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
75 myTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
76 myTable->setEditable(
false);
78 myTable->clearItems();
80 myTable->setTableSize(
int(myInvalidSingleLaneAdditionals.size() + myInvalidMultiLaneAdditionals.size()), 3);
82 myTable->setVisibleColumns(4);
84 myTable->setColumnWidth(1, 160);
85 myTable->setColumnWidth(2, 280);
86 myTable->setColumnText(0,
"");
88 myTable->setColumnText(2,
"Conflict");
89 myTable->getRowHeader()->setWidth(0);
92 FXTableItem* item =
nullptr;
94 for (
auto i : myInvalidSingleLaneAdditionals) {
96 item =
new FXTableItem(
"", i->getIcon());
97 item->setIconPosition(FXTableItem::CENTER_X);
98 myTable->setItem(indexRow, 0, item);
100 item =
new FXTableItem(i->getID().c_str());
101 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
102 myTable->setItem(indexRow, 1, item);
104 item =
new FXTableItem(i->getAdditionalProblem().c_str());
105 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
106 myTable->setItem(indexRow, 2, item);
111 for (
auto i : myInvalidMultiLaneAdditionals) {
113 item =
new FXTableItem(
"", i->getIcon());
114 item->setIconPosition(FXTableItem::CENTER_X);
115 myTable->setItem(indexRow, 0, item);
117 item =
new FXTableItem(i->getID().c_str());
118 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
119 myTable->setItem(indexRow, 1, item);
121 item =
new FXTableItem((i->getAdditionalProblem()).c_str());
122 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
123 myTable->setItem(indexRow, 2, item);
128 myPositionOptions.buildPositionOptions(
this, mainFrame);
130 if(myInvalidSingleLaneAdditionals.empty()) {
131 myPositionOptions.disablePositionOptions();
134 myConsecutiveLaneOptions.buildConsecutiveLaneOptions(
this, mainFrame);
136 if(myInvalidMultiLaneAdditionals.empty()) {
137 myConsecutiveLaneOptions.disableConsecutiveLaneOptions();
147 myAcceptButton->setFocus();
165 bool continueSaving =
true;
179 i->fixAdditionalProblem();
190 continueSaving =
false;
200 i->fixAdditionalProblem();
204 myInvalidMultiLaneAdditionals.clear();
205 for (
auto i : copyOfInvalidMultiLaneAdditionals) {
206 if(!i->isAdditionalValid()) {
207 myInvalidMultiLaneAdditionals.push_back(i);
216 myInvalidMultiLaneAdditionals.clear();
227 i->fixAdditionalProblem();
234 getApp()->stopModal(
this, TRUE);
237 getApp()->stopModal(
this, FALSE);
246 getApp()->stopModal(
this, FALSE);
259 activateFriendlyPositionAndSave =
new FXRadioButton(RadioButtonsLeft,
"Activate friendlyPos and save\t\tFriendly pos parameter will be activated in all stopping places and E2 detectors",
261 saveInvalid =
new FXRadioButton(RadioButtonsLeft,
"Save invalid positions\t\tSave stopping places and E2 detectors with invalid positions",
265 fixPositionsAndSave =
new FXRadioButton(RadioButtonsRight,
"Fix positions and save\t\tPosition of stopping places and E2 detectors will be fixed",
267 selectInvalidStopsAndCancel =
new FXRadioButton(RadioButtonsRight,
"Select invalid additionals\t\tCancel saving of additionals and select invalid stopping places and E2 detectors",
270 activateFriendlyPositionAndSave->setCheck(
true);
276 if (option == activateFriendlyPositionAndSave) {
277 activateFriendlyPositionAndSave->setCheck(
true);
278 fixPositionsAndSave->setCheck(
false);
279 saveInvalid->setCheck(
false);
280 selectInvalidStopsAndCancel->setCheck(
false);
281 }
else if (option == fixPositionsAndSave) {
282 activateFriendlyPositionAndSave->setCheck(
false);
283 fixPositionsAndSave->setCheck(
true);
284 saveInvalid->setCheck(
false);
285 selectInvalidStopsAndCancel->setCheck(
false);
286 }
else if (option == saveInvalid) {
287 activateFriendlyPositionAndSave->setCheck(
false);
288 fixPositionsAndSave->setCheck(
false);
289 saveInvalid->setCheck(
true);
290 selectInvalidStopsAndCancel->setCheck(
false);
291 }
else if (option == selectInvalidStopsAndCancel) {
292 activateFriendlyPositionAndSave->setCheck(
false);
293 fixPositionsAndSave->setCheck(
false);
294 saveInvalid->setCheck(
false);
295 selectInvalidStopsAndCancel->setCheck(
true);
302 activateFriendlyPositionAndSave->enable();
303 fixPositionsAndSave->enable();
304 saveInvalid->enable();
305 selectInvalidStopsAndCancel->enable();
311 activateFriendlyPositionAndSave->disable();
312 fixPositionsAndSave->disable();
313 saveInvalid->disable();
314 selectInvalidStopsAndCancel->disable();
326 buildConnectionBetweenLanes =
new FXRadioButton(RadioButtonsLeft,
"Build connections between lanes\t\tNew connections will be created between non-connected lanes",
328 removeInvalidElements =
new FXRadioButton(RadioButtonsLeft,
"Remove invalid E2 detectors\t\tRemove Multilane E2 Detectors with non-connected lanes",
334 activateFriendlyPositionAndSave =
new FXRadioButton(RadioButtonsRight,
"Activate friendlyPos and save\t\tFriendly pos parameter will be activated in all stopping places and E2 detectors",
336 fixPositionsAndSave =
new FXRadioButton(RadioButtonsRight,
"Fix positions and save\t\tPosition of stopping places and E2 detectors will be fixed",
339 buildConnectionBetweenLanes->setCheck(
true);
340 activateFriendlyPositionAndSave->setCheck(
true);
347 if (option == buildConnectionBetweenLanes) {
348 buildConnectionBetweenLanes->setCheck(
true);
349 removeInvalidElements->setCheck(
false);
350 }
else if (option == removeInvalidElements) {
351 buildConnectionBetweenLanes->setCheck(
false);
352 removeInvalidElements->setCheck(
true);
355 if (option == activateFriendlyPositionAndSave) {
356 activateFriendlyPositionAndSave->setCheck(
true);
357 fixPositionsAndSave->setCheck(
false);
358 }
else if (option == fixPositionsAndSave) {
359 activateFriendlyPositionAndSave->setCheck(
false);
360 fixPositionsAndSave->setCheck(
true);
367 buildConnectionBetweenLanes->enable();
368 removeInvalidElements->enable();
369 activateFriendlyPositionAndSave->enable();
370 fixPositionsAndSave->enable();
376 buildConnectionBetweenLanes->disable();
377 removeInvalidElements->disable();
378 activateFriendlyPositionAndSave->disable();
379 fixPositionsAndSave->disable();
void buildConsecutiveLaneOptions(GNEDialog_FixAdditionalPositions *fixAdditionalPositions, FXVerticalFrame *mainFrame)
build consecutive lane Options
#define GUIDesignTableIconCellWidth
width of cells that only contains an Icon
#define GUIDesignHorizontalFrame
void buildPositionOptions(GNEDialog_FixAdditionalPositions *fixAdditionalPositions, FXVerticalFrame *mainFrame)
build Position Options
void enableConsecutiveLaneOptions()
enable consecutive lane options
void enablePositionOptions()
enable position options
long onCmdAccept(FXObject *, FXSelector, void *)
event after press accept button
#define GUIDesignVerticalSeparator
vertical separator
~GNEDialog_FixAdditionalPositions()
destructor
GNEViewParent * getViewParent() const
get the net object
void disableConsecutiveLaneOptions()
disable consecutive lane options
#define GUIDesignButtonCancel
Cancel Button.
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
FXRadioButton * buildConnectionBetweenLanes
Option "build connections between lanes".
FixStoppingPlaces dialog.
GNEAdditionalFrame * getAdditionalFrame() const
get frame for GNE_MODE_ADDITIONAL
void selectOption(FXObject *option)
select option
GNEUndoList * getUndoList() const
get the undoList object
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
#define GUIDesignHorizontalSeparator
#define GUIDesignDialogBoxExplicit
design for dialog box with specift width and height (for example, additional dialogs) ...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void selectOption(FXObject *option)
select option
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
void removeAdditional(GNEAdditional *additional)
remove an additional element previously added
Dialog for edit rerouters.
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
#define GUIDesignAuxiliarVerticalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
#define GUIDesignButtonAccept
Accept Button.
FXRadioButton * activateFriendlyPositionAndSave
Option "Activate friendlyPos and save".
#define GUIDesignLabelCenterThick
label extended over frame with thick and with text justify to center and height of 23 ...
GNEViewNet * myViewNet
view net
FXRadioButton * removeInvalidElements
Option "remove invalid elements".
An Element which don't belongs to GNENet but has influency in the simulation.
PositionOptions myPositionOptions
struct with position options
ConsecutiveLaneOptions myConsecutiveLaneOptions
struct with the consecutive lane options
std::vector< GNEAdditional * > myInvalidMultiLaneAdditionals
vector with the invalid multi-lane additionals
FXDEFMAP(GNEDialog_FixAdditionalPositions) GNEDialog_FixAdditionalPositionsMap[]
FXRadioButton * fixPositionsAndSave
Option "Fix Positions and save".
FXRadioButton * selectInvalidStopsAndCancel
Option "Select invalid stops and cancel".
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
void disablePositionOptions()
disable position options
#define GUIDesignRadioButton
long onCmdSelectOption(FXObject *obj, FXSelector, void *)
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
std::vector< GNEAdditional * > myInvalidSingleLaneAdditionals
vector with the invalid single-lane additionals