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;
107 "fix positions of invalid additionals");
110 i->fixAdditionalProblem();
115 "select invalid additionals");
122 continueSaving =
false;
128 "fix multilane additionals problems");
133 i->fixAdditionalProblem();
138 for (
auto i : copyOfInvalidMultiLaneAdditionals) {
139 if (!i->isAdditionalValid()) {
160 i->fixAdditionalProblem();
165 if (continueSaving) {
167 getApp()->stopModal(
this, TRUE);
170 getApp()->stopModal(
this, FALSE);
179 getApp()->stopModal(
this, FALSE);
188 FXGroupBox(fixAdditionalPositions->myMainFrame,
"Stopping places and E2 detectors with conflicts",
GUIDesignGroupBoxFrameFill),
189 myInvalidSingleLaneAdditionals(invalidSingleLaneAdditionals),
190 myInvalidMultiLaneAdditionals(invalidMultiLaneAdditionals) {
193 myTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
194 myTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
203 myTable->setColumnWidth(1, 160);
204 myTable->setColumnWidth(2, 280);
207 myTable->setColumnText(2,
"Conflict");
208 myTable->getRowHeader()->setWidth(0);
211 FXTableItem* item =
nullptr;
215 item =
new FXTableItem(
"", i->getIcon());
216 item->setIconPosition(FXTableItem::CENTER_X);
217 myTable->setItem(indexRow, 0, item);
219 item =
new FXTableItem(i->getID().c_str());
220 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
221 myTable->setItem(indexRow, 1, item);
223 item =
new FXTableItem(i->getAdditionalProblem().c_str());
224 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
225 myTable->setItem(indexRow, 2, item);
232 item =
new FXTableItem(
"", i->getIcon());
233 item->setIconPosition(FXTableItem::CENTER_X);
234 myTable->setItem(indexRow, 0, item);
236 item =
new FXTableItem(i->getID().c_str());
237 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
238 myTable->setItem(indexRow, 1, item);
240 item =
new FXTableItem((i->getAdditionalProblem()).c_str());
241 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
242 myTable->setItem(indexRow, 2, item);
258 activateFriendlyPositionAndSave =
new FXRadioButton(RadioButtonsLeft,
"Activate friendlyPos and save\t\tFriendly pos parameter will be activated in all stopping places and E2 detectors",
260 saveInvalid =
new FXRadioButton(RadioButtonsLeft,
"Save invalid positions\t\tSave stopping places and E2 detectors with invalid positions",
264 fixPositionsAndSave =
new FXRadioButton(RadioButtonsRight,
"Fix positions and save\t\tPosition of stopping places and E2 detectors will be fixed",
266 selectInvalidStopsAndCancel =
new FXRadioButton(RadioButtonsRight,
"Select invalid additionals\t\tCancel saving of additionals and select invalid stopping places and E2 detectors",
275 if (option == activateFriendlyPositionAndSave) {
276 activateFriendlyPositionAndSave->setCheck(
true);
277 fixPositionsAndSave->setCheck(
false);
278 saveInvalid->setCheck(
false);
279 selectInvalidStopsAndCancel->setCheck(
false);
280 }
else if (option == fixPositionsAndSave) {
281 activateFriendlyPositionAndSave->setCheck(
false);
282 fixPositionsAndSave->setCheck(
true);
283 saveInvalid->setCheck(
false);
284 selectInvalidStopsAndCancel->setCheck(
false);
285 }
else if (option == saveInvalid) {
286 activateFriendlyPositionAndSave->setCheck(
false);
287 fixPositionsAndSave->setCheck(
false);
288 saveInvalid->setCheck(
true);
289 selectInvalidStopsAndCancel->setCheck(
false);
290 }
else if (option == selectInvalidStopsAndCancel) {
291 activateFriendlyPositionAndSave->setCheck(
false);
292 fixPositionsAndSave->setCheck(
false);
293 saveInvalid->setCheck(
false);
294 selectInvalidStopsAndCancel->setCheck(
true);
301 activateFriendlyPositionAndSave->enable();
302 fixPositionsAndSave->enable();
303 saveInvalid->enable();
304 selectInvalidStopsAndCancel->enable();
310 activateFriendlyPositionAndSave->disable();
311 fixPositionsAndSave->disable();
312 saveInvalid->disable();
313 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",
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();
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 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)
FXGroupBoxModule (based on FXGroupBox)
Options
GroupBoxModule options.
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 end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
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