41FXIMPLEMENT(
GNEFixElementsDialog, FXDialogBox, GNEFixElementsDialogMap, ARRAYNUMBER(GNEFixElementsDialogMap))
55 myAdditionalList =
new AdditionalList(
this, invalidSingleLaneAdditionals, invalidMultiLaneAdditionals);
61 if (myAdditionalList->myInvalidSingleLaneAdditionals.empty()) {
62 myPositionOptions->disablePositionOptions();
65 if (myAdditionalList->myInvalidMultiLaneAdditionals.empty()) {
66 myConsecutiveLaneOptions->disableConsecutiveLaneOptions();
75 myKeepOldButton->setFocus();
93 bool continueSaving =
true;
106 "fix positions of invalid additionals");
109 i->fixAdditionalProblem();
114 "select invalid additionals");
121 continueSaving =
false;
127 "fix multilane additionals problems");
132 i->fixAdditionalProblem();
137 for (
auto i : copyOfInvalidMultiLaneAdditionals) {
138 if (!i->isAdditionalValid()) {
159 i->fixAdditionalProblem();
164 if (continueSaving) {
166 getApp()->stopModal(
this, TRUE);
169 getApp()->stopModal(
this, FALSE);
178 getApp()->stopModal(
this, FALSE);
187 FXGroupBox(fixAdditionalPositions->myMainFrame,
"Stopping places and E2 detectors with conflicts",
GUIDesignGroupBoxFrameFill),
188 myInvalidSingleLaneAdditionals(invalidSingleLaneAdditionals),
189 myInvalidMultiLaneAdditionals(invalidMultiLaneAdditionals) {
192 myTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
193 myTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
202 myTable->setColumnWidth(1, 160);
203 myTable->setColumnWidth(2, 280);
206 myTable->setColumnText(2,
"Conflict");
207 myTable->getRowHeader()->setWidth(0);
210 FXTableItem* item =
nullptr;
214 item =
new FXTableItem(
"", i->getACIcon());
215 item->setIconPosition(FXTableItem::CENTER_X);
216 myTable->setItem(indexRow, 0, item);
218 item =
new FXTableItem(i->getID().c_str());
219 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
220 myTable->setItem(indexRow, 1, item);
222 item =
new FXTableItem(i->getAdditionalProblem().c_str());
223 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
224 myTable->setItem(indexRow, 2, item);
231 item =
new FXTableItem(
"", i->getACIcon());
232 item->setIconPosition(FXTableItem::CENTER_X);
233 myTable->setItem(indexRow, 0, item);
235 item =
new FXTableItem(i->getID().c_str());
236 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
237 myTable->setItem(indexRow, 1, item);
239 item =
new FXTableItem((i->getAdditionalProblem()).c_str());
240 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
241 myTable->setItem(indexRow, 2, item);
274 if (option == activateFriendlyPositionAndSave) {
275 activateFriendlyPositionAndSave->setCheck(
true);
276 fixPositionsAndSave->setCheck(
false);
277 saveInvalid->setCheck(
false);
278 selectInvalidStopsAndCancel->setCheck(
false);
279 }
else if (option == fixPositionsAndSave) {
280 activateFriendlyPositionAndSave->setCheck(
false);
281 fixPositionsAndSave->setCheck(
true);
282 saveInvalid->setCheck(
false);
283 selectInvalidStopsAndCancel->setCheck(
false);
284 }
else if (option == saveInvalid) {
285 activateFriendlyPositionAndSave->setCheck(
false);
286 fixPositionsAndSave->setCheck(
false);
287 saveInvalid->setCheck(
true);
288 selectInvalidStopsAndCancel->setCheck(
false);
289 }
else if (option == selectInvalidStopsAndCancel) {
290 activateFriendlyPositionAndSave->setCheck(
false);
291 fixPositionsAndSave->setCheck(
false);
292 saveInvalid->setCheck(
false);
293 selectInvalidStopsAndCancel->setCheck(
true);
300 activateFriendlyPositionAndSave->enable();
301 fixPositionsAndSave->enable();
302 saveInvalid->enable();
303 selectInvalidStopsAndCancel->enable();
309 activateFriendlyPositionAndSave->disable();
310 fixPositionsAndSave->disable();
311 saveInvalid->disable();
312 selectInvalidStopsAndCancel->disable();
346 if (option == buildConnectionBetweenLanes) {
347 buildConnectionBetweenLanes->setCheck(
true);
348 removeInvalidElements->setCheck(
false);
349 }
else if (option == removeInvalidElements) {
350 buildConnectionBetweenLanes->setCheck(
false);
351 removeInvalidElements->setCheck(
true);
354 if (option == activateFriendlyPositionAndSave) {
355 activateFriendlyPositionAndSave->setCheck(
true);
356 fixPositionsAndSave->setCheck(
false);
357 }
else if (option == fixPositionsAndSave) {
358 activateFriendlyPositionAndSave->setCheck(
false);
359 fixPositionsAndSave->setCheck(
true);
366 buildConnectionBetweenLanes->enable();
367 removeInvalidElements->enable();
368 activateFriendlyPositionAndSave->enable();
369 fixPositionsAndSave->enable();
375 buildConnectionBetweenLanes->disable();
376 removeInvalidElements->disable();
377 activateFriendlyPositionAndSave->disable();
378 fixPositionsAndSave->disable();
FXDEFMAP(GNEFixElementsDialog) GNEFixElementsDialogMap[]
@ 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 GUIDesignTableAdditionals
design for tables used in additional dialogs
#define GUIDesignButtonAccept
Accept Button.
#define GUIDesignButtonCancel
Cancel Button.
#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) frame extended in all directions
#define GUIDesignHorizontalFrame
Horizontal frame extended over frame parent with padding and spacing.
#define GUIDesignDialogBoxExplicitStretchable(width, height)
design for dialog box with specific width and height that can be stretched (But not shrunk)
@ GNE_ATTR_SELECTED
element is selected
int GUIDesignHeight
the default size for GUI elements
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
An Element which don't belong to GNENet but has influence in the simulation.
std::vector< GNEAdditional * > myInvalidMultiLaneAdditionals
vector with the invalid multi-lane additionals
AdditionalList(GNEFixElementsDialog *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 * fixPositionsAndSave
Option "Fix Positions and save".
FXRadioButton * activateFriendlyPositionAndSave
Option "Activate friendlyPos and save".
FXRadioButton * removeInvalidElements
Option "remove invalid elements".
void enableConsecutiveLaneOptions()
enable consecutive lane options
FXRadioButton * buildConnectionBetweenLanes
Option "build connections between lanes".
void selectOption(FXObject *option)
select option
void disableConsecutiveLaneOptions()
disable consecutive lane options
ConsecutiveLaneOptions(GNEFixElementsDialog *fixAdditionalPositions)
build consecutive lane Options
groupbox for group all radio buttons related to additionals with single lanes
FXRadioButton * selectInvalidStopsAndCancel
Option "Select invalid stops and cancel".
FXRadioButton * saveInvalid
Option "Save invalid".
void selectOption(FXObject *option)
select option
FXRadioButton * fixPositionsAndSave
Option "Fix Positions and save".
FXRadioButton * activateFriendlyPositionAndSave
Option "Activate friendlyPos and save".
void enablePositionOptions()
enable position options
PositionOptions(GNEFixElementsDialog *fixAdditionalPositions)
build Position Options
void disablePositionOptions()
disable position options
GNEViewNet * myViewNet
view net
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
ConsecutiveLaneOptions * myConsecutiveLaneOptions
consecutive lane options
AdditionalList * myAdditionalList
Additional List.
FXVerticalFrame * myMainFrame
main
~GNEFixElementsDialog()
destructor
PositionOptions * myPositionOptions
position options
long onCmdSelectOption(FXObject *obj, FXSelector, void *)
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 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 FXRadioButton * buildFXRadioButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXObject *tgt, FXSelector sel, FXuint opts=RADIOBUTTON_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 radio button
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXGroupBoxModule (based on FXGroupBox)