Eclipse SUMO - Simulation of Urban MObility
GNECalibratorDialog.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // Dialog for edit calibrators
15 /****************************************************************************/
16 
17 // ===========================================================================
18 // included modules
19 // ===========================================================================
20 #include <config.h>
21 
26 #include <netedit/GNENet.h>
27 #include <netedit/GNEViewNet.h>
28 #include <netedit/GNEUndoList.h>
33 
34 #include "GNECalibratorDialog.h"
36 #include "GNERouteDialog.h"
37 #include "GNEVehicleTypeDialog.h"
38 
39 // ===========================================================================
40 // FOX callback mapping
41 // ===========================================================================
42 
43 FXDEFMAP(GNECalibratorDialog) GNECalibratorDialogMap[] = {
50 };
51 
52 // Object implementation
53 FXIMPLEMENT(GNECalibratorDialog, GNEAdditionalDialog, GNECalibratorDialogMap, ARRAYNUMBER(GNECalibratorDialogMap))
54 
55 // ===========================================================================
56 // member method definitions
57 // ===========================================================================
58 
60  GNEAdditionalDialog(editedCalibrator, false, 640, 480) {
61 
62  // Create two columns, one for Routes and VehicleTypes, and other for Flows
63  FXHorizontalFrame* columns = new FXHorizontalFrame(myContentFrame, GUIDesignUniformHorizontalFrame);
64  FXVerticalFrame* columnLeft = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
65  FXVerticalFrame* columnRight = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
66 
67  // create add buton and label for routes
68  FXHorizontalFrame* buttonAndLabelRoute = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame);
69  myAddRoute = new FXButton(buttonAndLabelRoute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_CALIBRATORDIALOG_ADD_ROUTE, GUIDesignButtonIcon);
70  new FXLabel(buttonAndLabelRoute, ("Add new " + toString(SUMO_TAG_ROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick);
71 
72  // Create table in left frame
73  myRouteList = new FXTable(columnLeft, this, MID_GNE_CALIBRATORDIALOG_TABLE_ROUTE, GUIDesignTableAdditionals);
74  myRouteList->setSelBackColor(FXRGBA(255, 255, 255, 255));
75  myRouteList->setSelTextColor(FXRGBA(0, 0, 0, 255));
76  myRouteList->setEditable(false);
77 
78  // create add buton and label for vehicle types
79  FXHorizontalFrame* buttonAndLabelVehicleType = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame);
80  myAddVehicleType = new FXButton(buttonAndLabelVehicleType, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_CALIBRATORDIALOG_ADD_VEHICLETYPE, GUIDesignButtonIcon);
81  new FXLabel(buttonAndLabelVehicleType, ("Add new " + toString(SUMO_TAG_VTYPE) + "s").c_str(), nullptr, GUIDesignLabelThick);
82 
83  // Create table in left frame
84  myVehicleTypeList = new FXTable(columnLeft, this, MID_GNE_CALIBRATORDIALOG_TABLE_VEHICLETYPE, GUIDesignTableAdditionals);
85  myVehicleTypeList->setSelBackColor(FXRGBA(255, 255, 255, 255));
86  myVehicleTypeList->setSelTextColor(FXRGBA(0, 0, 0, 255));
87  myVehicleTypeList->setEditable(false);
88 
89  // create add buton and label for flows in right frame
90  FXHorizontalFrame* buttonAndLabelFlow = new FXHorizontalFrame(columnRight, GUIDesignAuxiliarHorizontalFrame);
91  myAddFlow = new FXButton(buttonAndLabelFlow, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_CALIBRATORDIALOG_ADD_FLOW, GUIDesignButtonIcon);
92  myLabelFlow = new FXLabel(buttonAndLabelFlow, ("Add new " + toString(SUMO_TAG_FLOW_CALIBRATOR) + "s").c_str(), nullptr, GUIDesignLabelThick);
93 
94  // Create table in right frame
95  myFlowList = new FXTable(columnRight, this, MID_GNE_CALIBRATORDIALOG_TABLE_FLOW, GUIDesignTableAdditionals);
96  myFlowList->setSelBackColor(FXRGBA(255, 255, 255, 255));
97  myFlowList->setSelTextColor(FXRGBA(0, 0, 0, 255));
98  myFlowList->setEditable(false);
99 
100  // update tables
101  updateRouteTable();
102  updateVehicleTypeTable();
103  updateFlowTable();
104 
105  // start a undo list for editing local to this additional
106  initChanges();
107 
108  // Open dialog as modal
109  openAsModalDialog();
110 }
111 
112 
114 
115 
116 long
117 GNECalibratorDialog::onCmdAccept(FXObject*, FXSelector, void*) {
118  // accept changes before closing dialog
119  acceptChanges();
120  // Stop Modal
121  getApp()->stopModal(this, TRUE);
122  return 1;
123 }
124 
125 
126 long
127 GNECalibratorDialog::onCmdCancel(FXObject*, FXSelector, void*) {
128  // cancel changes
129  cancelChanges();
130  // Stop Modal
131  getApp()->stopModal(this, FALSE);
132  return 1;
133 }
134 
135 
136 long
137 GNECalibratorDialog::onCmdReset(FXObject*, FXSelector, void*) {
138  // reset changes
139  resetChanges();
140  // update tables
143  updateFlowTable();
144  return 1;
145 }
146 
147 
148 long
149 GNECalibratorDialog::onCmdAddRoute(FXObject*, FXSelector, void*) {
150  // create nes calibrator route and configure it with GNERouteDialog
152  // update routes table
154  return 1;
155 }
156 
157 
158 long
159 GNECalibratorDialog::onCmdClickedRoute(FXObject*, FXSelector, void*) {
160  // check if some delete button was pressed
161  for (int i = 0; i < (int)myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE).size(); i++) {
162  // obtain rerouter
163  GNEDemandElement* routeToEdit = myEditedAdditional->getViewNet()->getNet()->retrieveDemandElement(SUMO_TAG_ROUTE, myRouteList->getItem(i, 0)->getText().text());
164  if (myRouteList->getItem(i, 2)->hasFocus()) {
165  // find all flows that contains route to delete as "route" parameter
166  std::vector<GNEAdditional*> calibratorFlowsToErase;
167  for (auto j : myEditedAdditional->getChildAdditionals()) {
168  if (j->getAttribute(SUMO_ATTR_ROUTE) == myRouteList->getItem(i, 0)->getText().text()) {
169  calibratorFlowsToErase.push_back(j);
170  }
171  }
172  // if there are flows that has route to remove as "route" parameter
173  if (calibratorFlowsToErase.size() > 0) {
174  // write warning if netedit is running in testing mode
175  WRITE_DEBUG("Opening FXMessageBox of type 'question'");
176  // open question dialog box
177  const std::string msg = ("Deletion of " + toString(SUMO_TAG_ROUTE) + " '" + myRouteList->getItem(i, 0)->getText().text() + "' will remove " +
178  toString(calibratorFlowsToErase.size()) + " " + toString(SUMO_TAG_FLOW_CALIBRATOR) + (calibratorFlowsToErase.size() > 1 ? ("s") : ("")) + ". Continue?");
179  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, ("Remove " + toString(SUMO_TAG_FLOW_CALIBRATOR) + "s").c_str(), "%s", msg.c_str());
180  if (answer != 1) { //1:yes, 2:no, 4:esc
181  // write warning if netedit is running in testing mode
182  if (answer == 2) {
183  WRITE_DEBUG("Closed FXMessageBox of type 'question' with 'No'");
184  } else if (answer == 4) {
185  WRITE_DEBUG("Closed FXMessageBox of type 'question' with 'ESC'");
186  }
187  // abort deletion of route
188  return 0;
189  } else {
190  // write warning if netedit is running in testing mode
191  WRITE_DEBUG("Closed FXMessageBox of type 'question' with 'Yes'");
192  // remove affected flows of calibrator flows
193  for (auto j : calibratorFlowsToErase) {
194  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(j, false), true);
195  }
196  // remove route of calibrator routes
197  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(routeToEdit, false), true);
198  // update flows and route table
199  updateFlowTable();
201  return 1;
202  }
203  } else {
204  // remove route
205  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(routeToEdit, false), true);
206  // update routes table
208  return 1;
209  }
210  } else if (myRouteList->getItem(i, 0)->hasFocus() || myRouteList->getItem(i, 1)->hasFocus()) {
211  // modify route of calibrator routes
212  GNERouteDialog(routeToEdit, true);
213  // update routes table
215  // update Flows routes also because Route ID could be changed
216  updateFlowTable();
217  return 1;
218  }
219  }
220  // nothing to do
221  return 0;
222 }
223 
224 
225 long
226 GNECalibratorDialog::onCmdAddFlow(FXObject*, FXSelector, void*) {
227  // only add flow if there is at least a GNERoute (There is always a Vehicle Type)
229  // create new calibrator and configure it with GNECalibratorFlowDialog
231  // update flows table
232  updateFlowTable();
233  return 1;
234  } else {
235  throw ProcessError("myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE) cannot be empty");
236  }
237 }
238 
239 
240 long
241 GNECalibratorDialog::onCmdClickedFlow(FXObject*, FXSelector, void*) {
242  // check if some delete button was pressed
243  for (int i = 0; i < (int)myEditedAdditional->getChildAdditionals().size(); i++) {
244  if (myFlowList->getItem(i, 2)->hasFocus()) {
245  // remove flow of calibrator flows
247  // update flows table
248  updateFlowTable();
249  return 1;
250  } else if (myFlowList->getItem(i, 0)->hasFocus() || myFlowList->getItem(i, 1)->hasFocus()) {
251  // modify flow of calibrator flows (temporal)
253  // update flows table
254  updateFlowTable();
255  return 1;
256  }
257  }
258  // nothing to do
259  return 0;
260 }
261 
262 
263 long
264 GNECalibratorDialog::onCmdAddVehicleType(FXObject*, FXSelector, void*) {
265  // create a new Vehicle Type and configure it with GNEVehicleTypeDialog
266  std::string vehicleTypeID = myEditedAdditional->getViewNet()->getNet()->generateDemandElementID("", SUMO_TAG_VTYPE);
268  // update vehicle types table
270  return 1;
271 }
272 
273 
274 long
275 GNECalibratorDialog::onCmdClickedVehicleType(FXObject*, FXSelector, void*) {
276  // check if some delete button was pressed
277  for (int i = 0; i < (int)myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VTYPE).size(); i++) {
278  // obtain vehicle type
280  // Make sure that default vehicle isn't edited
281  if ((i == 0) && (myVehicleTypeList->getItem(i, 0)->hasFocus() || myVehicleTypeList->getItem(i, 1)->hasFocus() || myVehicleTypeList->getItem(i, 2)->hasFocus())) {
282  FXMessageBox::warning(getApp(), MBOX_OK,
283  ("Error editing default " + toString(SUMO_TAG_VTYPE)).c_str(), "%s",
284  ("Default " + toString(SUMO_TAG_VTYPE) + " cannot be either edited or deleted.").c_str());
285  } else if (myVehicleTypeList->getItem(i, 2)->hasFocus()) {
286  // find all flows that contains vehicle type to delete as "vehicle type" parameter
287  std::vector<GNEAdditional*> calibratorFlowsToErase;
288  for (auto j : myEditedAdditional->getChildAdditionals()) {
289  if (j->getAttribute(SUMO_ATTR_TYPE) == myVehicleTypeList->getItem(i, 0)->getText().text()) {
290  calibratorFlowsToErase.push_back(j);
291  }
292  }
293  // if there are flows that has vehicle type to remove as "vehicle type" parameter
294  if (calibratorFlowsToErase.size() > 0) {
295  const std::string msg = ("Deletion of " + toString(SUMO_TAG_VTYPE) + " '" + myVehicleTypeList->getItem(i, 0)->getText().text() + "' will remove " +
296  toString(calibratorFlowsToErase.size()) + " " + toString(SUMO_TAG_FLOW_CALIBRATOR) + (calibratorFlowsToErase.size() > 1 ? ("s") : ("")) + ". Continue?");
297  FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, ("Remove " + toString(SUMO_TAG_FLOW_CALIBRATOR) + "s").c_str(), "%s", msg.c_str());
298  if (answer != 1) { //1:yes, 2:no, 4:esc
299  // write warning if netedit is running in testing mode
300  if (answer == 2) {
301  WRITE_DEBUG("Closed FXMessageBox of type 'question' with 'No'");
302  } else if (answer == 4) {
303  WRITE_DEBUG("Closed FXMessageBox of type 'question' with 'ESC'");
304  }
305  // abort deletion of vehicle type
306  return 0;
307  } else {
308  // write warning if netedit is running in testing mode
309  WRITE_DEBUG("Closed FXMessageBox of type 'question' with 'Yes'");
310  // remove affected flows of calibrator flows
311  for (auto j : calibratorFlowsToErase) {
312  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(j, false), true);
313  }
314  // remove vehicle type of calibrator vehicle types
315  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vType, false), true);
316  // update flows and vehicle types table
317  updateFlowTable();
319  return 1;
320  }
321  } else {
322  // remove vehicle type of calibrator vehicle types
323  myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vType, false), true);
324  // update vehicle types table
326  return 1;
327  }
328  } else if (myVehicleTypeList->getItem(i, 0)->hasFocus() || myVehicleTypeList->getItem(i, 1)->hasFocus()) {
329  // modify vehicle type
330  GNEVehicleTypeDialog(vType, true);
331  // update vehicle types table
333  // update Flows routes also because VType ID could be changed
334  updateFlowTable();
335  return 1;
336  }
337  }
338  // nothing to do
339  return 0;
340 }
341 
342 
343 void
345  // clear table
346  myRouteList->clearItems();
347  // set number of rows
349  // Configure list
350  myRouteList->setVisibleColumns(4);
351  myRouteList->setColumnWidth(0, 136);
352  myRouteList->setColumnWidth(1, 136);
353  myRouteList->setColumnWidth(2, GUIDesignTableIconCellWidth);
354  myRouteList->setColumnText(0, toString(SUMO_ATTR_ID).c_str());
355  myRouteList->setColumnText(1, toString(SUMO_ATTR_EDGES).c_str());
356  myRouteList->setColumnText(2, "");
357  myRouteList->getRowHeader()->setWidth(0);
358  // Declare index for rows and pointer to FXTableItem
359  int indexRow = 0;
360  FXTableItem* item = nullptr;
361  // iterate over routes
363  // Set ID
364  item = new FXTableItem(toString(i.second->getAttribute(SUMO_ATTR_ID)).c_str());
365  myRouteList->setItem(indexRow, 0, item);
366  // Set edges
367  item = new FXTableItem(toString(i.second->getAttribute(SUMO_ATTR_EDGES)).c_str());
368  myRouteList->setItem(indexRow, 1, item);
369  // set remove
370  item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE));
371  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
372  item->setEnabled(false);
373  myRouteList->setItem(indexRow, 2, item);
374  // Update index
375  indexRow++;
376  }
377  // enable or disable flow and label button
379 }
380 
381 
382 void
384  // clear table
385  myFlowList->clearItems();
386  // set number of rows
387  myFlowList->setTableSize(int(myEditedAdditional->getChildAdditionals().size()), 3);
388  // Configure list
389  myFlowList->setVisibleColumns(3);
390  myFlowList->setColumnWidth(0, 136);
391  myFlowList->setColumnWidth(1, 136);
392  myFlowList->setColumnWidth(2, GUIDesignTableIconCellWidth);
393  myFlowList->setColumnText(0, toString(SUMO_ATTR_TYPE).c_str());
394  myFlowList->setColumnText(1, toString(SUMO_ATTR_VCLASS).c_str());
395  myFlowList->setColumnText(2, "");
396  myFlowList->getRowHeader()->setWidth(0);
397  // Declare index for rows and pointer to FXTableItem
398  int indexRow = 0;
399  FXTableItem* item = nullptr;
400  // iterate over flows
401  for (auto i : myEditedAdditional->getChildAdditionals()) {
402  // Set vehicle type
403  item = new FXTableItem(i->getAttribute(SUMO_ATTR_TYPE).c_str());
404  myFlowList->setItem(indexRow, 0, item);
405  // Set route
406  item = new FXTableItem(i->getAttribute(SUMO_ATTR_ROUTE).c_str());
407  myFlowList->setItem(indexRow, 1, item);
408  // set remove
409  item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE));
410  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
411  item->setEnabled(false);
412  myFlowList->setItem(indexRow, 2, item);
413  // Update index
414  indexRow++;
415  }
416  // enable or disable flow and label button
418 }
419 
420 
421 void
423  // clear table
424  myVehicleTypeList->clearItems();
425  // set number of rows
427  // Configure list
428  myVehicleTypeList->setVisibleColumns(4);
429  myVehicleTypeList->setColumnWidth(0, 136);
430  myVehicleTypeList->setColumnWidth(1, 136);
432  myVehicleTypeList->setColumnText(0, toString(SUMO_ATTR_ID).c_str());
433  myVehicleTypeList->setColumnText(1, toString(SUMO_ATTR_VCLASS).c_str());
434  myVehicleTypeList->setColumnText(2, "");
435  myVehicleTypeList->getRowHeader()->setWidth(0);
436  // Declare index for rows and pointer to FXTableItem
437  int indexRow = 0;
438  FXTableItem* item = nullptr;
439  // iterate over vehicle types
441  // Set id
442  item = new FXTableItem(i.second->getAttribute(SUMO_ATTR_ID).c_str());
443  myVehicleTypeList->setItem(indexRow, 0, item);
444  // Set VClass
445  item = new FXTableItem(i.second->getAttribute(SUMO_ATTR_VCLASS).c_str());
446  myVehicleTypeList->setItem(indexRow, 1, item);
447  // set remove icon except for default vehicle type
448  if (indexRow != 0) {
449  item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE));
450  } else {
451  item = new FXTableItem("");
452  }
453  item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y);
454  item->setEnabled(false);
455  myVehicleTypeList->setItem(indexRow, 2, item);
456  // Update index
457  indexRow++;
458  }
459  // enable or disable flow and label button
461 }
462 
463 
464 void
466  // disable AddFlow button if no route is defined
468  myAddFlow->disable();
469  myFlowList->disable();
470  myLabelFlow->setText("No routes defined");
471  } else {
472  myAddFlow->enable();
473  myFlowList->enable();
474  myLabelFlow->setText(("Add new " + toString(SUMO_TAG_FLOW_CALIBRATOR) + "s").c_str());
475  }
476 }
477 
478 /****************************************************************************/
MID_GNE_CALIBRATORDIALOG_TABLE_ROUTE
@ MID_GNE_CALIBRATORDIALOG_TABLE_ROUTE
change table route
Definition: GUIAppEnum.h:1027
SUMO_ATTR_TYPE
@ SUMO_ATTR_TYPE
Definition: SUMOXMLDefinitions.h:381
GUIDesignAuxiliarHorizontalFrame
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:273
GNENet::getAttributeCarriers
const AttributeCarriers & getAttributeCarriers() const
retrieve all attribute carriers of Net
Definition: GNENet.cpp:1063
MID_GNE_CALIBRATORDIALOG_ADD_FLOW
@ MID_GNE_CALIBRATORDIALOG_ADD_FLOW
Definition: GUIAppEnum.h:1032
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:55
GUIDesignLabelThick
#define GUIDesignLabelThick
label extended over frame with thick and with text justify to left and height of 23
Definition: GUIDesigns.h:158
GNEChange_DemandElement
Definition: GNEChange_DemandElement.h:45
GNECalibratorDialog::onCmdAddRoute
long onCmdAddRoute(FXObject *, FXSelector, void *)
add new route
Definition: GNECalibratorDialog.cpp:149
GNECalibratorDialog::~GNECalibratorDialog
~GNECalibratorDialog()
destructor
Definition: GNECalibratorDialog.cpp:113
GNEChange_DemandElement.h
GNECalibratorDialog::myFlowList
FXTable * myFlowList
list with flows
Definition: GNECalibratorDialog.h:103
GUIDesignUniformHorizontalFrame
#define GUIDesignUniformHorizontalFrame
design for horizontal frame used to pack another frames with a uniform width
Definition: GUIDesigns.h:279
GNECalibratorDialog::onCmdAccept
long onCmdAccept(FXObject *, FXSelector, void *)
Definition: GNECalibratorDialog.cpp:117
GNEChange_Additional
Definition: GNEChange_Additional.h:44
GNEAdditionalDialog
Dialog to edit sequences, parameters, etc.. of Additionals.
Definition: GNEAdditionalDialog.h:44
GNECalibratorDialog::updateFlowAndLabelButton
void updateFlowAndLabelButton()
update flow and label button
Definition: GNECalibratorDialog.cpp:465
GNERoute
Definition: GNERoute.h:41
GNECalibratorFlowDialog
Dialog for edit rerouter intervals.
Definition: GNECalibratorFlowDialog.h:42
GNECalibratorDialog::updateFlowTable
void updateFlowTable()
update data table with flows
Definition: GNECalibratorDialog.cpp:383
GNENet::retrieveDemandElement
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
Definition: GNENet.cpp:2316
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
GNECalibratorDialog::onCmdReset
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
Definition: GNECalibratorDialog.cpp:137
GNECalibratorDialog::myRouteList
FXTable * myRouteList
list with routes
Definition: GNECalibratorDialog.h:94
GUIDesigns.h
SUMO_TAG_VTYPE
@ SUMO_TAG_VTYPE
description of a vehicle type
Definition: SUMOXMLDefinitions.h:121
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:609
ICON_REMOVE
@ ICON_REMOVE
Definition: GUIIcons.h:184
GUIAppEnum.h
GNEAdditionalDialog::cancelChanges
void cancelChanges()
Cancel changes did in this dialog.
Definition: GNEAdditionalDialog.cpp:135
GNECalibratorDialog::onCmdAddVehicleType
long onCmdAddVehicleType(FXObject *, FXSelector, void *)
add new vehicle type
Definition: GNECalibratorDialog.cpp:264
GNECalibratorFlow.h
GNEChange_Additional.h
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:1014
GNECalibratorFlowDialog.h
GNERoute.h
GNECalibratorDialog.h
MID_GNE_CALIBRATORDIALOG_ADD_ROUTE
@ MID_GNE_CALIBRATORDIALOG_ADD_ROUTE
add new route
Definition: GUIAppEnum.h:1029
GUIDesignTableIconCellWidth
#define GUIDesignTableIconCellWidth
width of cells that only contains an Icon
Definition: GUIDesigns.h:467
GNEVehicleTypeDialog.h
GNECalibratorDialog::updateVehicleTypeTable
void updateVehicleTypeTable()
update data table with vehicle types
Definition: GNECalibratorDialog.cpp:422
GUIDesignButtonIcon
#define GUIDesignButtonIcon
button only with icon (23x23)
Definition: GUIDesigns.h:59
MID_GNE_CALIBRATORDIALOG_TABLE_VEHICLETYPE
@ MID_GNE_CALIBRATORDIALOG_TABLE_VEHICLETYPE
change table route
Definition: GUIAppEnum.h:1034
GNECalibratorDialog::onCmdClickedFlow
long onCmdClickedFlow(FXObject *, FXSelector, void *)
remove or edit flow
Definition: GNECalibratorDialog.cpp:241
GNEVehicleType
Definition: GNEVehicleType.h:36
ICON_ADD
@ ICON_ADD
Definition: GUIIcons.h:183
GNEViewNet.h
SVC_PASSENGER
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
Definition: SUMOVehicleClass.h:159
SUMO_ATTR_ROUTE
@ SUMO_ATTR_ROUTE
Definition: SUMOXMLDefinitions.h:440
GNECalibratorDialog::myLabelFlow
FXLabel * myLabelFlow
label for flows
Definition: GNECalibratorDialog.h:97
SUMO_ATTR_EDGES
@ SUMO_ATTR_EDGES
the edges of a route
Definition: SUMOXMLDefinitions.h:427
GNECalibratorDialog::updateRouteTable
void updateRouteTable()
update data table with routes
Definition: GNECalibratorDialog.cpp:344
MID_GNE_CALIBRATORDIALOG_ADD_VEHICLETYPE
@ MID_GNE_CALIBRATORDIALOG_ADD_VEHICLETYPE
add vehicle type
Definition: GUIAppEnum.h:1036
ProcessError
Definition: UtilExceptions.h:39
GNECalibrator
Definition: GNECalibrator.h:41
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:1020
MID_GNE_CALIBRATORDIALOG_TABLE_FLOW
@ MID_GNE_CALIBRATORDIALOG_TABLE_FLOW
change table flow
Definition: GUIAppEnum.h:1031
FXDEFMAP
FXDEFMAP(GNECalibratorDialog) GNECalibratorDialogMap[]
GNENet::AttributeCarriers::demandElements
std::map< SumoXMLTag, std::map< std::string, GNEDemandElement * > > demandElements
map with the name and pointer to demand elements of net
Definition: GNENet.h:104
GNECalibratorFlow
Definition: GNECalibratorFlow.h:40
GNEAdditionalDialog::myEditedAdditional
GNEAdditional * myEditedAdditional
pointer to edited aditional
Definition: GNEAdditionalDialog.h:81
GNERouteDialog
Dialog for edit Calibrator Routes.
Definition: GNERouteDialog.h:42
GNECalibratorDialog::onCmdClickedRoute
long onCmdClickedRoute(FXObject *, FXSelector, void *)
remove or edit route
Definition: GNECalibratorDialog.cpp:159
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GNECalibratorDialog
Dialog for edit calibrators.
Definition: GNECalibratorDialog.h:45
SUMO_TAG_FLOW_CALIBRATOR
@ SUMO_TAG_FLOW_CALIBRATOR
a flow definition within in Calibrator (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:153
GNECalibratorDialog::myVehicleTypeList
FXTable * myVehicleTypeList
list with vehicle types
Definition: GNECalibratorDialog.h:109
GNEAdditionalDialog::acceptChanges
void acceptChanges()
Accept changes did in this dialog.
Definition: GNEAdditionalDialog.cpp:124
GNEVehicleTypeDialog
Dialog for edit rerouter intervals.
Definition: GNEVehicleTypeDialog.h:44
GNEAdditional::getViewNet
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
Definition: GNEAdditional.cpp:307
GNECalibratorDialog::onCmdCancel
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
Definition: GNECalibratorDialog.cpp:127
GNECalibratorDialog::onCmdAddFlow
long onCmdAddFlow(FXObject *, FXSelector, void *)
add new flow
Definition: GNECalibratorDialog.cpp:226
GNECalibrator.h
SUMO_ATTR_VCLASS
@ SUMO_ATTR_VCLASS
Definition: SUMOXMLDefinitions.h:450
GUIDesignAuxiliarFrame
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions
Definition: GUIDesigns.h:270
GNERouteDialog.h
SUMO_TAG_ROUTE
@ SUMO_TAG_ROUTE
begin/end of the description of a route
Definition: SUMOXMLDefinitions.h:125
GNECalibratorDialog::onCmdClickedVehicleType
long onCmdClickedVehicleType(FXObject *, FXSelector, void *)
remove or edit vehicle type
Definition: GNECalibratorDialog.cpp:275
config.h
GNEVehicleType.h
GUIDesignTableAdditionals
#define GUIDesignTableAdditionals
design for tables used in additional dialogs
Definition: GUIDesigns.h:464
GNENet::generateDemandElementID
std::string generateDemandElementID(const std::string &prefix, SumoXMLTag type) const
generate demand element id
Definition: GNENet.cpp:2461
WRITE_DEBUG
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:284
GNEHierarchicalChildElements::getChildAdditionals
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
Definition: GNEHierarchicalChildElements.cpp:131
GNEAdditionalDialog::resetChanges
void resetChanges()
reset changes did in this dialog.
Definition: GNEAdditionalDialog.cpp:141
GNECalibratorDialog::myAddFlow
FXButton * myAddFlow
button for add new flow
Definition: GNECalibratorDialog.h:100
GNENet.h
GNEUndoList.h