62 FXIMPLEMENT(
GNECalibratorDialog, FXDialogBox, GNECalibratorDialogMap, ARRAYNUMBER(GNECalibratorDialogMap))
70 myCalibratorParent(calibratorParent) {
84 myRouteList->setSelBackColor(FXRGBA(255, 255, 255, 255));
85 myRouteList->setSelTextColor(FXRGBA(0, 0, 0, 255));
86 myRouteList->setEditable(
false);
95 myVehicleTypeList->setSelBackColor(FXRGBA(255, 255, 255, 255));
96 myVehicleTypeList->setSelTextColor(FXRGBA(0, 0, 0, 255));
97 myVehicleTypeList->setEditable(
false);
106 myFlowList->setSelBackColor(FXRGBA(255, 255, 255, 255));
107 myFlowList->setSelTextColor(FXRGBA(0, 0, 0, 255));
108 myFlowList->setEditable(
false);
111 myCopyOfCalibratorRoutes = myCalibratorParent->getCalibratorRoutes();
112 myCopyOfCalibratorFlows = myCalibratorParent->getCalibratorFlows();
113 myCopyOfCalibratorVehicleTypes = myCalibratorParent->getCalibratorVehicleTypes();
118 updateVehicleTypeTable();
138 getApp()->stopModal(
this, TRUE);
150 getApp()->stopModal(
this, FALSE);
176 vehicleTypes.push_back(newRoute);
193 std::vector<GNECalibratorFlow> calibratorFlowsToErase;
195 if (j->getRoute() ==
myRouteList->getItem(i, 0)->getText().text()) {
196 calibratorFlowsToErase.push_back(*j);
200 if (calibratorFlowsToErase.size() > 0) {
208 "' will remove " +
toString(calibratorFlowsToErase.size()) +
" " +
toString(
SUMO_TAG_FLOW) + (calibratorFlowsToErase.size() > 1 ? (
"s") : (
"")) +
209 ". Continue?").c_str());
213 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'No'");
215 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'ESC'");
222 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'Yes'");
225 std::vector<GNECalibratorFlow> flowSubstraction;
227 if (std::find(calibratorFlowsToErase.begin(), calibratorFlowsToErase.end(), *j) == calibratorFlowsToErase.end()) {
228 flowSubstraction.push_back(*j);
239 vehicleTypes.erase(vehicleTypes.begin() + i);
271 vehicleTypes.push_back(newFlow);
289 flows.erase(flows.begin() + i);
321 vehicleTypes.push_back(newVehicleType);
338 std::vector<GNECalibratorFlow> calibratorFlowsToErase;
341 calibratorFlowsToErase.push_back(*j);
345 if (calibratorFlowsToErase.size() > 0) {
348 "' will remove " +
toString(calibratorFlowsToErase.size()) +
" " +
toString(
SUMO_TAG_FLOW) + (calibratorFlowsToErase.size() > 1 ? (
"s") : (
"")) +
349 ". Continue?").c_str());
353 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'No'");
355 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'ESC'");
362 WRITE_WARNING(
"Closed FXMessageBox of type 'question' with 'Yes'");
365 std::vector<GNECalibratorFlow> flowSubstraction;
367 if (std::find(calibratorFlowsToErase.begin(), calibratorFlowsToErase.end(), *j) == calibratorFlowsToErase.end()) {
368 flowSubstraction.push_back(*j);
379 vehicleTypes.erase(vehicleTypes.begin() + i);
421 FXTableItem* item = 0;
425 item =
new FXTableItem(
toString(i->getRouteID()).c_str());
428 item =
new FXTableItem(
toString(i->getEdgesIDs()).c_str());
432 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
433 item->setEnabled(
false);
462 FXTableItem* item = 0;
466 item =
new FXTableItem(
toString(i->getFlowID()).c_str());
469 item =
new FXTableItem(
toString(i->getVehicleType()).c_str());
472 item =
new FXTableItem(
toString(i->getRoute()).c_str());
476 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
477 item->setEnabled(
false);
504 FXTableItem* item = 0;
508 item =
new FXTableItem(
toString(i->getVehicleTypeID()).c_str());
511 item =
new FXTableItem(
toString(i->getVClass()).c_str());
515 item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
516 item->setEnabled(
false);
528 std::string errorMsg;
void updateFlowTable()
update data table with flows
#define GUIDesignTableIconCellWidth
width of cells that only contains an Icon
const std::vector< GNECalibratorRoute > & getCalibratorRoutes() const
get calibrator routes
description of a vehicle type
const std::vector< GNECalibratorVehicleType > & getCalibratorVehicleTypes() const
get calibrator vehicleTypes
FXButton * myAddFlow
button for add new flow
a flow definition (used by router)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
long onCmdAddVehicleType(FXObject *, FXSelector, void *)
add new vehicle type
Dialog to edit sequences, parameters, etc.. of Additionals.
long onCmdAddRoute(FXObject *, FXSelector, void *)
add new route
FXTable * myFlowList
list with flows
void updateRouteTable()
update data table with routes
~GNECalibratorDialog()
destructor
GNECalibrator * myCalibratorParent
pointer to calibrator parent
FXLabel * myLabelFlow
label for flows
begin/end of the description of a route
#define WRITE_WARNING(msg)
static OptionsCont & getOptions()
Retrieves the options.
void updateFlowAndLabelButton()
update flow and label button
std::vector< GNECalibratorVehicleType > myCopyOfCalibratorVehicleTypes
vector with a copy of calibrator vehicle types (used by reset)
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
FXTable * myRouteList
list with routes
#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
long onCmdClickedRoute(FXObject *, FXSelector, void *)
remove or edit route
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames ...
void setCalibratorVehicleTypes(const std::vector< GNECalibratorVehicleType > &calibratorVehicleType)
set calibrator vehicleTypes values
FXTable * myVehicleTypeList
list with vehicle types
Dialog for edit rerouter intervals.
long onCmdClickedFlow(FXObject *, FXSelector, void *)
remove or edit flow
void updateVehicleTypeTable()
update data table with vehicle types
long onCmdAddFlow(FXObject *, FXSelector, void *)
add new flow
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
void setCalibratorRoutes(const std::vector< GNECalibratorRoute > &calibratorRoutes)
set calibrator route values
#define GUIDesignButtonIcon
button only with icon (23x23)
std::vector< GNECalibratorRoute > myCopyOfCalibratorRoutes
vector with a copy of calibrator routes (used by reset)
Dialog for edit calibrators.
const std::vector< GNECalibratorFlow > & getCalibratorFlows() const
get calibrator flows
Dialog for edit rerouter intervals.
GNECalibrator * getCalibratorParent() const
get calibrator parent
std::vector< GNECalibratorFlow > myCopyOfCalibratorFlows
vector with a copy of calibrator flows (used by reset)
#define GUIDesignLabelThick
label extended over frame with thick and with text justify to left
FXDEFMAP(GNECalibratorDialog) GNECalibratorDialogMap[]
void setCalibratorFlows(const std::vector< GNECalibratorFlow > &calibratorFlows)
set calibrator flow values
Dialog for edit rerouter intervals.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
long onCmdClickedVehicleType(FXObject *, FXSelector, void *)
remove or edit vehicle type
long onCmdAccept(FXObject *, FXSelector, void *)