75 FXIMPLEMENT(
GNERerouterIntervalDialog, FXDialogBox, GNERerouterIntervalDialogMap, ARRAYNUMBER(GNERerouterIntervalDialogMap))
83 myRerouterDialogParent(rerouterDialog),
84 myRerouterInterval(&rerouterInterval),
85 myBeginEndValid(true),
86 myClosingLaneReroutesValid(true),
87 myClosingReroutesValid(true),
88 myDestProbReroutesValid(true),
89 myRouteProbReroutesValid(true) {
91 changeAdditionalDialogHeader(
"Edit " +
toString(rerouterInterval.getTag()) +
" of " +
toString(rerouterInterval.getRerouterParent()->getTag()) +
92 " '" + rerouterInterval.getRerouterParent()->getID() +
"'");
107 myBeginTextField->setText(
toString(myRerouterInterval->getBegin()).c_str());
109 myEndTextField->setText(
toString(myRerouterInterval->getEnd()).c_str());
112 if (myRerouterDialogParent->findInterval(myRerouterInterval->getBegin(), myRerouterInterval->getEnd())) {
114 myBeginEndValid =
true;
117 myBeginEndValid =
false;
125 myClosingLaneRerouteList->setSelBackColor(FXRGBA(255, 255, 255, 255));
126 myClosingLaneRerouteList->setSelTextColor(FXRGBA(0, 0, 0, 255));
132 myClosingRerouteList->setSelBackColor(FXRGBA(255, 255, 255, 255));
133 myClosingRerouteList->setSelTextColor(FXRGBA(0, 0, 0, 255));
139 myDestProbRerouteList->setSelBackColor(FXRGBA(255, 255, 255, 255));
140 myDestProbRerouteList->setSelTextColor(FXRGBA(0, 0, 0, 255));
146 myRouteProbRerouteList->setSelBackColor(FXRGBA(255, 255, 255, 255));
147 myRouteProbRerouteList->setSelTextColor(FXRGBA(0, 0, 0, 255));
150 myCopyOfClosingLaneReroutes = myRerouterInterval->getClosingLaneReroutes();
151 myCopyOfClosingReroutes = myRerouterInterval->getClosingReroutes();
152 myCopyOfDestProbReroutes = myRerouterInterval->getDestProbReroutes();
153 myCopyOfRouteProbReroutes = myRerouterInterval->getRouteProbReroutes();
156 updateClosingLaneReroutesTable();
157 updateClosingReroutesTable();
158 updateDestProbReroutesTable();
159 updateRouteProbReroutesTable();
175 FXMessageBox::warning(getApp(), MBOX_OK,
183 WRITE_WARNING(
"Closed FXMessageBox of type 'warning' with 'OK'");
192 FXMessageBox::warning(getApp(), MBOX_OK,
198 WRITE_WARNING(
"Closed FXMessageBox of type 'warning' with 'OK'");
207 FXMessageBox::warning(getApp(), MBOX_OK,
213 WRITE_WARNING(
"Closed FXMessageBox of type 'warning' with 'OK'");
222 FXMessageBox::warning(getApp(), MBOX_OK,
228 WRITE_WARNING(
"Closed FXMessageBox of type 'warning' with 'OK'");
237 FXMessageBox::warning(getApp(), MBOX_OK,
243 WRITE_WARNING(
"Closed FXMessageBox of type 'warning' with 'OK'");
252 FXMessageBox::warning(getApp(), MBOX_OK,
258 WRITE_WARNING(
"Closed FXMessageBox of type 'warning' with 'OK'");
271 getApp()->stopModal(
this, TRUE);
280 getApp()->stopModal(
this, FALSE);
463 double probability = -1;
466 probability = GNEAttributeCarrier::parse<double>(
myDestProbRerouteList->getItem(i, 1)->getText().text());
472 }
else if ((probability < 0) || (probability > 1)) {
493 double probability = -1;
497 probability = GNEAttributeCarrier::parse<double>(
myRouteProbRerouteList->getItem(i, 1)->getText().text());
503 }
else if ((probability < 0) || (probability > 1)) {
524 if (GNEAttributeCarrier::canParse<double>(
myBeginTextField->getText().text()) ==
false) {
527 newBegin = GNEAttributeCarrier::parse<double>(
myBeginTextField->getText().text());
529 if (GNEAttributeCarrier::canParse<double>(
myEndTextField->getText().text()) ==
false) {
532 newEnd = GNEAttributeCarrier::parse<double>(
myEndTextField->getText().text());
568 FXTableItem* item = 0;
572 if (i->getClosedLane() != NULL) {
573 item =
new FXTableItem(i->getClosedLane()->getID().c_str());
576 item =
new FXTableItem(
"");
586 item =
new FXTableItem(
"");
592 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
593 item->setEnabled(
false);
597 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
598 item->setEnabled(
false);
627 FXTableItem* item = 0;
631 if (i->getClosedEdge() != NULL) {
632 item =
new FXTableItem(i->getClosedEdge()->getID().c_str());
635 item =
new FXTableItem(
"");
645 item =
new FXTableItem(
"");
651 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
652 item->setEnabled(
false);
656 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
657 item->setEnabled(
false);
684 FXTableItem* item = 0;
688 if (i->getNewDestination() != NULL) {
689 item =
new FXTableItem(i->getNewDestination()->getID().c_str());
692 item =
new FXTableItem(
"");
696 item =
new FXTableItem(
toString(i->getProbability()).c_str());
699 item =
new FXTableItem(
"");
705 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
706 item->setEnabled(
false);
710 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
711 item->setEnabled(
false);
738 FXTableItem* item = 0;
742 item =
new FXTableItem(i->getNewRouteId().c_str());
745 item =
new FXTableItem(
toString(i->getProbability()).c_str());
748 item =
new FXTableItem(
"");
754 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
755 item->setEnabled(
false);
759 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
760 item->setEnabled(
false);
#define GUIDesignTableIconCellWidth
width of cells that only contains an Icon
void updateDestProbReroutesTable()
update data of destiny probabilitry reroute table
std::string getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
FXTable * myRouteProbRerouteList
list with route probability reroute
long onCmdEditDestProbReroute(FXObject *, FXSelector, void *)
/edit dest prob reroute
Dialog for edit rerouter intervals.
std::vector< GNEClosingReroute > myCopyOfClosingReroutes
vector with a copy of the closingReroutes
bool myBeginEndValid
flag to check if begin an end are valid
long onCmdClickedDestProbReroute(FXObject *, FXSelector, void *)
remove dest prob reroute
lane of a reroute of type closing
FXTable * myDestProbRerouteList
list with destiny probability reroutes
#define GUIDesignLabelIcon32x32Thicked
label ticked filled only with an icon of 32x32
const std::vector< GNEClosingReroute > & getClosingReroutes() const
get closing reroutes
FXTable * myClosingRerouteList
list with closing reroutes
bool myClosingReroutesValid
flag to check if closing reroutes are valid
bool checkModifyInterval(const GNERerouterInterval &rerouterInterval, double newBegin, double newEnd) const
check if begin and end of an existent interval can be modified
~GNERerouterIntervalDialog()
destructor
Dialog to edit sequences, parameters, etc.. of Additionals.
void updateRouteProbReroutesTable()
update data of probabilitry reroutes table
std::vector< GNEClosingLaneReroute > myCopyOfClosingLaneReroutes
vector with the closingLaneReroutes
void setBegin(double begin)
set begin time
weights: time range begin
long onCmdClickedRouteProbReroute(FXObject *, FXSelector, void *)
remove route prob reroute
void updateClosingLaneReroutesTable()
update data of closing lane reroute table
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
bool myRouteProbReroutesValid
flag to check if route prob reroutes are valid
FXTextField * myBeginTextField
begin time text field
void setClosingLaneReroutes(const std::vector< GNEClosingLaneReroute > &closingLaneReroutes)
set closing reroutes
std::vector< GNERouteProbReroute > myCopyOfRouteProbReroutes
vector with a copy of the routeProbReroutes
#define WRITE_WARNING(msg)
GNERerouter * getRerouterParent() const
get rerouter parent
bool myClosingLaneReroutesValid
flag to check if closing lane reroutes are valid
bool isTestingModeEnabled() const
check if netedit is running in testing mode
long onCmdAddClosingLaneReroute(FXObject *, FXSelector, void *)
add closing lane reroute
long onCmdEditRouteProbReroute(FXObject *, FXSelector, void *)
/edit route prob reroute
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
const std::vector< GNEDestProbReroute > & getDestProbReroutes() const
get destiny probability reroutes
long onCmdAddRouteProbReroute(FXObject *, FXSelector, void *)
add route prob reroute
Dialog for edit rerouters.
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
#define GUIDesignUniformHorizontalFrame
design for horizontal frame used to pack another frames with a uniform width
void updateClosingReroutesTable()
update data of closing reroute table
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
GNELane * retrieveLane(const std::string &id, bool failHard=true)
get lane by id
const std::vector< GNEClosingLaneReroute > & getClosingLaneReroutes() const
get closing reroutes
long onCmdAddClosingReroute(FXObject *, FXSelector, void *)
add closing reroute
long onCmdEditClosingReroute(FXObject *, FXSelector, void *)
/edit closing reroute
long onCmdEditClosingLaneReroute(FXObject *, FXSelector, void *)
/edit closing lane reroute
void setRouteProbReroutes(const std::vector< GNERouteProbReroute > &rerouteProbabilityReroutes)
set reoute probability reroutes
SumoXMLTag getTag() const
get tag
GNERerouter * getRerouterParent() const
get rerouter parent
probability of route of a reroute
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
probability of destiny of a reroute
long onCmdAccept(FXObject *, FXSelector, void *)
GNERerouterDialog * myRerouterDialogParent
pointer to GNERerouterDialog parent
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
long onCmdClickedClosingLaneReroute(FXObject *, FXSelector, void *)
remove closing lane reroute
#define GUIDesignButtonIcon
button only with icon (23x23)
bool myDestProbReroutesValid
flag to check if Destiny probability reroutes are valid
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
void setEnd(double end)
set end time
A road/street connecting two junctions (netedit-version)
FXTable * myClosingLaneRerouteList
list with closing lane reroutes
#define GUIDesignTextFieldNCol
Num of column of text field.
FXTextField * myEndTextField
end time text field
long onCmdAddDestProbReroute(FXObject *, FXSelector, void *)
add dest prob reroute
FXLabel * myCheckLabel
begin/end time check label
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
long onCmdClickedClosingReroute(FXObject *, FXSelector, void *)
remove closing reroute
#define GUIDesignLabelThick
label extended over frame with thick and with text justify to left
GNENet * getNet() const
get the net object
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to Doubles/doubles
const std::vector< GNERouteProbReroute > & getRouteProbReroutes() const
get reoute probability reroutes
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
long onCmdChangeBeginEnd(FXObject *, FXSelector, void *)
called when begin or endis changed
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
#define GUIDesignLabelLeftThick
label extended over frame with thick and with text justify to left
GNERerouterInterval * myRerouterInterval
pointer to rerouter interval
std::vector< GNEDestProbReroute > myCopyOfDestProbReroutes
vector with a copy of the destProbReroutes
void setClosingReroutes(const std::vector< GNEClosingReroute > &closingReroutes)
set closing reroutes
FXDEFMAP(GNERerouterIntervalDialog) GNERerouterIntervalDialogMap[]
void setDestProbReroutes(const std::vector< GNEDestProbReroute > &destProbReroutes)
set destiny probability reroutes
SumoXMLTag getTag() const
get XML Tag assigned to this object