49 #ifdef CHECK_MEMORY_LEAKS 78 FXIMPLEMENT(
GNERerouterIntervalDialog, FXDialogBox, GNERerouterIntervalDialogMap, ARRAYNUMBER(GNERerouterIntervalDialogMap))
86 myRerouterDialogParent(rerouterDialog),
87 myRerouterInterval(&rerouterInterval),
88 myBeginEndValid(true),
89 myClosingLaneReroutesValid(true),
90 myClosingReroutesValid(true),
91 myDestProbReroutesValid(true),
92 myRouteProbReroutesValid(true) {
94 changeAdditionalDialogHeader(
"Edit " +
toString(rerouterInterval.getTag()) +
" of " +
toString(rerouterInterval.getRerouterParent()->getTag()) +
95 " '" + rerouterInterval.getRerouterParent()->getID() +
"'");
110 myBeginTextField->setText(
toString(myRerouterInterval->getBegin()).c_str());
112 myEndTextField->setText(
toString(myRerouterInterval->getEnd()).c_str());
115 if (myRerouterDialogParent->findInterval(myRerouterInterval->getBegin(), myRerouterInterval->getEnd())) {
117 myBeginEndValid =
true;
120 myBeginEndValid =
false;
128 myClosingLaneRerouteList->setSelBackColor(FXRGBA(255, 255, 255, 255));
129 myClosingLaneRerouteList->setSelTextColor(FXRGBA(0, 0, 0, 255));
135 myClosingRerouteList->setSelBackColor(FXRGBA(255, 255, 255, 255));
136 myClosingRerouteList->setSelTextColor(FXRGBA(0, 0, 0, 255));
142 myDestProbRerouteList->setSelBackColor(FXRGBA(255, 255, 255, 255));
143 myDestProbRerouteList->setSelTextColor(FXRGBA(0, 0, 0, 255));
149 myRouteProbRerouteList->setSelBackColor(FXRGBA(255, 255, 255, 255));
150 myRouteProbRerouteList->setSelTextColor(FXRGBA(0, 0, 0, 255));
153 myCopyOfClosingLaneReroutes = myRerouterInterval->getClosingLaneReroutes();
154 myCopyOfClosingReroutes = myRerouterInterval->getClosingReroutes();
155 myCopyOfDestProbReroutes = myRerouterInterval->getDestProbReroutes();
156 myCopyOfRouteProbReroutes = myRerouterInterval->getRouteProbReroutes();
159 updateClosingLaneReroutesTable();
160 updateClosingReroutesTable();
161 updateDestProbReroutesTable();
162 updateRouteProbReroutesTable();
173 FXMessageBox::warning(getApp(), MBOX_OK,
179 FXMessageBox::warning(getApp(), MBOX_OK,
185 FXMessageBox::warning(getApp(), MBOX_OK,
191 FXMessageBox::warning(getApp(), MBOX_OK,
197 FXMessageBox::warning(getApp(), MBOX_OK,
203 FXMessageBox::warning(getApp(), MBOX_OK,
218 getApp()->stopModal(
this, TRUE);
227 getApp()->stopModal(
this, FALSE);
412 if (GNEAttributeCarrier::canParse<SUMOReal>(
myDestProbRerouteList->getItem(i, 1)->getText().text())) {
413 probability = GNEAttributeCarrier::parse<SUMOReal>(
myDestProbRerouteList->getItem(i, 1)->getText().text());
419 }
else if ((probability < 0) || (probability > 1)) {
444 probability = GNEAttributeCarrier::parse<SUMOReal>(
myRouteProbRerouteList->getItem(i, 1)->getText().text());
450 }
else if ((probability < 0) || (probability > 1)) {
468 if (GNEAttributeCarrier::canParse<SUMOReal>(
myBeginTextField->getText().text()) &&
483 if (GNEAttributeCarrier::canParse<SUMOReal>(
myEndTextField->getText().text()) &&
517 FXTableItem* item = 0;
521 if (i->getClosedLane() != NULL) {
522 item =
new FXTableItem(i->getClosedLane()->getID().c_str());
525 item =
new FXTableItem(
"");
535 item =
new FXTableItem(
"");
541 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
542 item->setEnabled(
false);
546 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
547 item->setEnabled(
false);
576 FXTableItem* item = 0;
580 if (i->getClosedEdge() != NULL) {
581 item =
new FXTableItem(i->getClosedEdge()->getID().c_str());
584 item =
new FXTableItem(
"");
594 item =
new FXTableItem(
"");
600 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
601 item->setEnabled(
false);
605 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
606 item->setEnabled(
false);
633 FXTableItem* item = 0;
637 if (i->getNewDestination() != NULL) {
638 item =
new FXTableItem(i->getNewDestination()->getID().c_str());
641 item =
new FXTableItem(
"");
645 item =
new FXTableItem(
toString(i->getProbability()).c_str());
648 item =
new FXTableItem(
"");
654 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
655 item->setEnabled(
false);
659 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
660 item->setEnabled(
false);
687 FXTableItem* item = 0;
691 item =
new FXTableItem(i->getNewRouteId().c_str());
694 item =
new FXTableItem(
toString(i->getProbability()).c_str());
697 item =
new FXTableItem(
"");
703 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
704 item->setEnabled(
false);
708 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
709 item->setEnabled(
false);
#define GUIDesignTableIconCellWidth
width of cells that only contains an Icon
void updateDestProbReroutesTable()
update data of destiny probabilitry reroute table
GNERerouter * getRerouterParent() const
get rerouter parent
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.
#define GUIDesignLabelOnlyIcon
label ticked filled only with an icon
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
const std::vector< GNEClosingLaneReroute > & getClosingLaneReroutes() const
get closing reroutes
lane of a reroute of type closing
FXTable * myDestProbRerouteList
list with destiny probability reroutes
void setEnd(SUMOReal end)
set end time
FXTable * myClosingRerouteList
list with closing reroutes
bool myClosingReroutesValid
flag to check if closing reroutes are valid
bool checkInterval(SUMOReal begin, SUMOReal end) const
check begin and end of an new interval
~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
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 setBegin(SUMOReal begin)
set begin time
void setClosingLaneReroutes(const std::vector< GNEClosingLaneReroute > &closingLaneReroutes)
set closing reroutes
const std::vector< GNEClosingReroute > & getClosingReroutes() const
get closing reroutes
std::vector< GNERouteProbReroute > myCopyOfRouteProbReroutes
vector with a copy of the routeProbReroutes
bool myClosingLaneReroutesValid
flag to check if closing lane reroutes are valid
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
long onCmdAddRouteProbReroute(FXObject *, FXSelector, void *)
add route prob reroute
SUMOReal getEnd() const
get end time
Dialog for edit rerouters.
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
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
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
long onCmdChangeBegin(FXObject *, FXSelector, void *)
called when begin is changed
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
const std::vector< GNERouteProbReroute > & getRouteProbReroutes() const
get reoute probability reroutes
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
SUMOReal getBegin() const
get begin time
std::string getVehicleClassNames(SVCPermissions permissions)
Returns the ids of the given classes, divided using a ' '.
long onCmdClickedClosingLaneReroute(FXObject *, FXSelector, void *)
remove closing lane reroute
#define GUIDesignButtonIcon
button only with icon with the same size as a Label
long onCmdChangeEnd(FXObject *, FXSelector, void *)
called when begin is changed
bool myDestProbReroutesValid
flag to check if Destiny probability reroutes are valid
const std::vector< GNEDestProbReroute > & getDestProbReroutes() const
get destiny probability reroutes
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
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
long onCmdClickedClosingReroute(FXObject *, FXSelector, void *)
remove closing reroute
#define GUIDesignLabelThick
label extended over 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/SUMOReals
SumoXMLTag getTag() const
get XML Tag assigned to this object
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
#define GUIDesignLabelLeftThick
label extended over 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