71 std::vector<GNENetworkElement*> invalidEdges, invalidCrossings;
73 for (
const auto& invalidNetworkElement : invalidNetworkElements) {
74 if (invalidNetworkElement->getTagProperty()->getTag() ==
SUMO_TAG_EDGE) {
75 invalidEdges.push_back(invalidNetworkElement);
76 }
else if (invalidNetworkElement->getTagProperty()->getTag() ==
SUMO_TAG_CROSSING) {
77 invalidCrossings.push_back(invalidNetworkElement);
93 if (dialogTest->
fixSolution ==
"removeInvalidCrossings") {
95 }
else if (dialogTest->
fixSolution ==
"saveInvalidCrossings") {
97 }
else if (dialogTest->
fixSolution ==
"selectInvalidCrossings") {
116 bool abortSaving =
false;
152 myInvalidElements = invalidElements;
154 myTable->setTableSize((
int)(myInvalidElements.size()), 3);
155 myTable->setSelBackColor(FXRGBA(255, 255, 255, 255));
156 myTable->setSelTextColor(FXRGBA(0, 0, 0, 255));
157 myTable->setEditable(
false);
159 myTable->setVisibleColumns(4);
161 myTable->setColumnWidth(1, 150);
162 myTable->setColumnWidth(2, 390);
163 myTable->setColumnText(0,
"");
165 myTable->setColumnText(2,
TL(
"Conflict"));
166 myTable->getRowHeader()->setWidth(0);
168 FXTableItem* item =
nullptr;
170 for (
int i = 0; i < (int)myInvalidElements.size(); i++) {
172 item =
new FXTableItem(
"", myInvalidElements.at(i)->getACIcon());
173 item->setIconPosition(FXTableItem::CENTER_X);
174 myTable->setItem(i, 0, item);
176 item =
new FXTableItem(myInvalidElements.at(i)->getID().c_str());
177 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
178 myTable->setItem(i, 1, item);
180 item =
new FXTableItem(myInvalidElements.at(i)->getNetworkElementProblem().c_str());
181 item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y);
182 myTable->setItem(i, 2, item);
185 if (invalidElements.size() > 0) {
187 toggleSaveButton(
true);
190 toggleSaveButton(
false);
198 TL(
"Save list of conflicted items"),
208 for (
const auto& invalidElement : myInvalidElements) {
209 dev << invalidElement->getID() <<
":" << invalidElement->getNetworkElementProblem() <<
"\n";
214 FXMessageBox::information(myTable, MBOX_OK,
TL(
"Saving successfully"),
"%s",
"List of conflicted items was successfully saved");
217 FXMessageBox::error(myTable, MBOX_OK,
TL(
"Saving list of conflicted items failed"),
"%s", e.what());
244 if (option == removeInvalidEdges) {
245 removeInvalidEdges->setCheck(
true);
246 saveInvalidEdges->setCheck(
false);
247 selectInvalidEdgesAndCancel->setCheck(
false);
248 }
else if (option == saveInvalidEdges) {
249 removeInvalidEdges->setCheck(
false);
250 saveInvalidEdges->setCheck(
true);
251 selectInvalidEdgesAndCancel->setCheck(
false);
252 }
else if (option == selectInvalidEdgesAndCancel) {
253 removeInvalidEdges->setCheck(
false);
254 saveInvalidEdges->setCheck(
false);
255 selectInvalidEdgesAndCancel->setCheck(
true);
262 if (myInvalidElements.size() > 0) {
263 if (removeInvalidEdges->getCheck() == TRUE) {
267 for (
const auto& invalidEdge : myInvalidElements) {
272 }
else if (selectInvalidEdgesAndCancel->getCheck() == TRUE) {
276 for (
const auto& invalidEdge : myInvalidElements) {
290 removeInvalidEdges->enable();
291 saveInvalidEdges->enable();
292 selectInvalidEdgesAndCancel->enable();
298 removeInvalidEdges->disable();
299 saveInvalidEdges->disable();
300 selectInvalidEdgesAndCancel->disable();
325 if (option == removeInvalidCrossings) {
326 removeInvalidCrossings->setCheck(
true);
327 saveInvalidCrossings->setCheck(
false);
328 selectInvalidCrossings->setCheck(
false);
329 }
else if (option == saveInvalidCrossings) {
330 removeInvalidCrossings->setCheck(
false);
331 saveInvalidCrossings->setCheck(
true);
332 selectInvalidCrossings->setCheck(
false);
333 }
else if (option == selectInvalidCrossings) {
334 removeInvalidCrossings->setCheck(
false);
335 saveInvalidCrossings->setCheck(
false);
336 selectInvalidCrossings->setCheck(
true);
343 if (myInvalidElements.size() > 0) {
344 if (removeInvalidCrossings->getCheck() == TRUE) {
348 for (
const auto& invalidCrossing : myInvalidElements) {
353 }
else if (selectInvalidCrossings->getCheck() == TRUE) {
357 for (
const auto& invalidCrossing : myInvalidElements) {
371 removeInvalidCrossings->enable();
372 saveInvalidCrossings->enable();
373 selectInvalidCrossings->enable();
379 removeInvalidCrossings->disable();
380 saveInvalidCrossings->disable();
381 selectInvalidCrossings->disable();
FXDEFMAP(GNEFixNetworkElements) GNEFixNetworkElementsMap[]
@ MID_GNE_BUTTON_CANCEL
cancel button
@ MID_CHOOSEN_OPERATION
set type of selection
@ MID_GNE_BUTTON_ACCEPT
accept button
#define GUIDesignRadioButtonFix
design for radio button with fixed height (used in fix elements dialogs)
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignAuxiliarVerticalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignTableFixElements
design for tables used in GNEFixDemandElements dialogs
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
FXString gCurrentFolder
The folder used as last.
GUIIcon
An enumeration of icons used by the gui applications.
@ SUMO_TAG_CROSSING
crossing between edges for pedestrians
@ SUMO_TAG_EDGE
begin/end of the description of an edge
@ GNE_ATTR_SELECTED
element is selected
int GUIDesignHeight
the default size for GUI elements
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
long openFixDialog()
open dialog
GNEViewNet * myViewNet
view net
Buttons * myButtons
buttons
long closeFixDialog(const bool success)
stop fix elements dialog accepting changes
groupbox for all radio buttons related with fix crossing options
FXRadioButton * saveInvalidCrossings
Option "save invalid crossings".
FixCrossingOptions(GNEFixNetworkElements *fixNetworkElementsParent, GNEViewNet *viewNet)
constructor
void fixElements(bool &abortSaving)
fix elements
FXRadioButton * removeInvalidCrossings
Option "remove invalid elements".
void enableOptions()
enable crossing options
void disableOptions()
disable crossing options
void selectOption(FXObject *option)
select option
FXRadioButton * selectInvalidCrossings
Option "Select invalid crossings and cancel".
groupbox for all radio buttons related with fix edges options
void selectOption(FXObject *option)
select option
FXRadioButton * selectInvalidEdgesAndCancel
Option "Select invalid edges and cancel".
void disableOptions()
disable edge options
void fixElements(bool &abortSaving)
fix elements
FXRadioButton * saveInvalidEdges
Option "Save invalid edges".
FXRadioButton * removeInvalidEdges
Option "Remove invalid edges".
FixEdgeOptions(GNEFixNetworkElements *fixNetworkElementsParent, GNEViewNet *viewNet)
constructor
void enableOptions()
enable edge options
bool saveContents() const
save contents
FixOptions(FXVerticalFrame *frameParent, const std::string &title, GNEViewNet *viewNet)
constructor
FXTable * myTable
Table with the network elements.
FXVerticalFrame * myLeftFrame
vertical left frame
void setInvalidElements(const std::vector< GNENetworkElement * > &invalidElements)
set invalid network elements
FXVerticalFrame * myRightFrame
vertical right frame
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
FixEdgeOptions * myFixEdgeOptions
fix edge options
FixCrossingOptions * myFixCrossingOptions
fix crossing options
long onCmdSelectOption(FXObject *obj, FXSelector, void *)
event when user select a option
FXVerticalFrame * myLeftFrame
vertical left frame
FXuint openDialog(const std::vector< GNENetworkElement * > &invalidNetworkElements)
open fix network elements dialog
long onCmdAccept(FXObject *, FXSelector, void *)
event after press accept button
~GNEFixNetworkElements()
destructor
void runInternalTest(const InternalTestStep::DialogTest *modalArguments)
run internal test
GNECrossing * retrieveCrossing(const GUIGlObject *glObject, bool hardFail=true) const
get Crossing by AC
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
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
dialog arguments (used for certain functions that opens modal dialogs)
const std::string fixSolution
solution for fix dialogs
MFXGroupBoxModule (based on FXGroupBox)
Options
GroupBoxModule options.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extensions, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
Static storage of an output device and its base (abstract) implementation.
void close()
Closes the device and removes it from the dictionary.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
static StringBijection< TXTFileExtension > TXTFileExtensions
TXT file Extensions.