42 FXIMPLEMENT(
GNEFixAdditionalElements, FXDialogBox, GNEFixAdditionalElementsMap, ARRAYNUMBER(GNEFixAdditionalElementsMap))
56 myAdditionalList =
new AdditionalList(
this, invalidSingleLaneAdditionals, invalidMultiLaneAdditionals);
62 if (myAdditionalList->myInvalidSingleLaneAdditionals.empty()) {
63 myPositionOptions->disablePositionOptions();
66 if (myAdditionalList->myInvalidMultiLaneAdditionals.empty()) {
67 myConsecutiveLaneOptions->disableConsecutiveLaneOptions();
76 myAcceptButton->setFocus();
94 bool continueSaving =
true;
108 i->fixAdditionalProblem();
119 continueSaving =
false;
129 i->fixAdditionalProblem();
134 for (
auto i : copyOfInvalidMultiLaneAdditionals) {
135 if (!i->isAdditionalValid()) {
156 i->fixAdditionalProblem();
161 if (continueSaving) {
163 getApp()->stopModal(
this, TRUE);
166 getApp()->stopModal(
this, FALSE);
175 getApp()->stopModal(
this, FALSE);
184 FXGroupBox(fixAdditionalPositions->myMainFrame,
"Stopping places and E2 detectors with conflicts",
GUIDesignGroupBoxFrameFill),
185 myInvalidSingleLaneAdditionals(invalidSingleLaneAdditionals),
186 myInvalidMultiLaneAdditionals(invalidMultiLaneAdditionals) {
189 myTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
190 myTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
199 myTable->setColumnWidth(1, 160);
200 myTable->setColumnWidth(2, 280);
203 myTable->setColumnText(2,
"Conflict");
204 myTable->getRowHeader()->setWidth(0);
207 FXTableItem* item =
nullptr;
211 item =
new FXTableItem(
"", i->getIcon());
212 item->setIconPosition(FXTableItem::CENTER_X);
213 myTable->setItem(indexRow, 0, item);
215 item =
new FXTableItem(i->getID().c_str());
216 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
217 myTable->setItem(indexRow, 1, item);
219 item =
new FXTableItem(i->getAdditionalProblem().c_str());
220 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
221 myTable->setItem(indexRow, 2, item);
228 item =
new FXTableItem(
"", i->getIcon());
229 item->setIconPosition(FXTableItem::CENTER_X);
230 myTable->setItem(indexRow, 0, item);
232 item =
new FXTableItem(i->getID().c_str());
233 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
234 myTable->setItem(indexRow, 1, item);
236 item =
new FXTableItem((i->getAdditionalProblem()).c_str());
237 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
238 myTable->setItem(indexRow, 2, item);
254 activateFriendlyPositionAndSave =
new FXRadioButton(RadioButtonsLeft,
"Activate friendlyPos and save\t\tFriendly pos parameter will be activated in all stopping places and E2 detectors",
256 saveInvalid =
new FXRadioButton(RadioButtonsLeft,
"Save invalid positions\t\tSave stopping places and E2 detectors with invalid positions",
260 fixPositionsAndSave =
new FXRadioButton(RadioButtonsRight,
"Fix positions and save\t\tPosition of stopping places and E2 detectors will be fixed",
262 selectInvalidStopsAndCancel =
new FXRadioButton(RadioButtonsRight,
"Select invalid additionals\t\tCancel saving of additionals and select invalid stopping places and E2 detectors",
271 if (option == activateFriendlyPositionAndSave) {
272 activateFriendlyPositionAndSave->setCheck(
true);
273 fixPositionsAndSave->setCheck(
false);
274 saveInvalid->setCheck(
false);
275 selectInvalidStopsAndCancel->setCheck(
false);
276 }
else if (option == fixPositionsAndSave) {
277 activateFriendlyPositionAndSave->setCheck(
false);
278 fixPositionsAndSave->setCheck(
true);
279 saveInvalid->setCheck(
false);
280 selectInvalidStopsAndCancel->setCheck(
false);
281 }
else if (option == saveInvalid) {
282 activateFriendlyPositionAndSave->setCheck(
false);
283 fixPositionsAndSave->setCheck(
false);
284 saveInvalid->setCheck(
true);
285 selectInvalidStopsAndCancel->setCheck(
false);
286 }
else if (option == selectInvalidStopsAndCancel) {
287 activateFriendlyPositionAndSave->setCheck(
false);
288 fixPositionsAndSave->setCheck(
false);
289 saveInvalid->setCheck(
false);
290 selectInvalidStopsAndCancel->setCheck(
true);
297 activateFriendlyPositionAndSave->enable();
298 fixPositionsAndSave->enable();
299 saveInvalid->enable();
300 selectInvalidStopsAndCancel->enable();
306 activateFriendlyPositionAndSave->disable();
307 fixPositionsAndSave->disable();
308 saveInvalid->disable();
309 selectInvalidStopsAndCancel->disable();
322 buildConnectionBetweenLanes =
new FXRadioButton(RadioButtonsLeft,
"Build connections between lanes\t\tNew connections will be created between non-connected lanes",
324 removeInvalidElements =
new FXRadioButton(RadioButtonsLeft,
"Remove invalid E2 detectors\t\tRemove Multilane E2 Detectors with non-connected lanes",
330 activateFriendlyPositionAndSave =
new FXRadioButton(RadioButtonsRight,
"Activate friendlyPos and save\t\tFriendly pos parameter will be activated in all stopping places and E2 detectors",
332 fixPositionsAndSave =
new FXRadioButton(RadioButtonsRight,
"Fix positions and save\t\tPosition of stopping places and E2 detectors will be fixed",
343 if (option == buildConnectionBetweenLanes) {
344 buildConnectionBetweenLanes->setCheck(
true);
345 removeInvalidElements->setCheck(
false);
346 }
else if (option == removeInvalidElements) {
347 buildConnectionBetweenLanes->setCheck(
false);
348 removeInvalidElements->setCheck(
true);
351 if (option == activateFriendlyPositionAndSave) {
352 activateFriendlyPositionAndSave->setCheck(
true);
353 fixPositionsAndSave->setCheck(
false);
354 }
else if (option == fixPositionsAndSave) {
355 activateFriendlyPositionAndSave->setCheck(
false);
356 fixPositionsAndSave->setCheck(
true);
363 buildConnectionBetweenLanes->enable();
364 removeInvalidElements->enable();
365 activateFriendlyPositionAndSave->enable();
366 fixPositionsAndSave->enable();
372 buildConnectionBetweenLanes->disable();
373 removeInvalidElements->disable();
374 activateFriendlyPositionAndSave->disable();
375 fixPositionsAndSave->disable();
FXDEFMAP(GNEFixAdditionalElements) GNEFixAdditionalElementsMap[]
@ MID_GNE_BUTTON_CANCEL
cancel button
@ MID_CHOOSEN_OPERATION
set type of selection
@ MID_GNE_FIXSTOPPINGPLACES_CHANGE
FixStoppingPlaces dialog.
@ MID_GNE_BUTTON_ACCEPT
accept button
#define GUIDesignDialogBoxExplicit(width, height)
design for dialog box with specift width and height (for example, additional dialogs)
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
#define GUIDesignButtonAccept
Accept Button.
#define GUIDesignButtonCancel
Cancel Button.
#define GUIDesignHeight
define a standard height for all elements (Change it carefully)
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignVerticalSeparator
vertical separator
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
#define GUIDesignAuxiliarVerticalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignGroupBoxFrameFill
Group box design extended over frame (X and Y)
#define GUIDesignRadioButton
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions
#define GUIDesignHorizontalFrame
@ GNE_ATTR_SELECTED
element is selected
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
An Element which don't belongs to GNENet but has influency in the simulation.
std::vector< GNEAdditional * > myInvalidMultiLaneAdditionals
vector with the invalid multi-lane additionals
AdditionalList(GNEFixAdditionalElements *fixAdditionalPositions, const std::vector< GNEAdditional * > &invalidSingleLaneAdditionals, const std::vector< GNEAdditional * > &invalidMultiLaneAdditionals)
constructor
FXTable * myTable
list with the stoppingPlaces and detectors
std::vector< GNEAdditional * > myInvalidSingleLaneAdditionals
vector with the invalid single-lane additionals
groupbox for group all radio buttons related to additionals with consecutive lanes
FXRadioButton * activateFriendlyPositionAndSave
Option "Activate friendlyPos and save".
ConsecutiveLaneOptions(GNEFixAdditionalElements *fixAdditionalPositions)
build consecutive lane Options
FXRadioButton * removeInvalidElements
Option "remove invalid elements".
void selectOption(FXObject *option)
select option
FXRadioButton * fixPositionsAndSave
Option "Fix Positions and save".
FXRadioButton * buildConnectionBetweenLanes
Option "build connections between lanes".
void disableConsecutiveLaneOptions()
disable consecutive lane options
void enableConsecutiveLaneOptions()
enable consecutive lane options
groupbox for group all radio buttons related to additionals with single lanes
FXRadioButton * fixPositionsAndSave
Option "Fix Positions and save".
FXRadioButton * selectInvalidStopsAndCancel
Option "Select invalid stops and cancel".
FXRadioButton * activateFriendlyPositionAndSave
Option "Activate friendlyPos and save".
void disablePositionOptions()
disable position options
PositionOptions(GNEFixAdditionalElements *fixAdditionalPositions)
build Position Options
void enablePositionOptions()
enable position options
void selectOption(FXObject *option)
select option
FXRadioButton * saveInvalid
Option "Save invalid".
Dialog for edit rerouters.
~GNEFixAdditionalElements()
destructor
PositionOptions * myPositionOptions
position options
long onCmdSelectOption(FXObject *obj, FXSelector, void *)
ConsecutiveLaneOptions * myConsecutiveLaneOptions
consecutive lane options
GNEViewNet * myViewNet
view net
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
AdditionalList * myAdditionalList
Additional List.
FXVerticalFrame * myMainFrame
main
long onCmdAccept(FXObject *, FXSelector, void *)
event after press accept button
void deleteAdditional(GNEAdditional *additional, GNEUndoList *undoList)
remove additional
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...
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
GNENet * getNet() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon