SUMO - Simulation of Urban MObility
GNECalibratorFlowDialog.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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // Dialog for edit calibrator flows
18 /****************************************************************************/
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #ifdef _MSC_VER
24 #include <windows_config.h>
25 #else
26 #include <config.h>
27 #endif
28 
29 #include <iostream>
34 
36 #include "GNECalibrator.h"
37 #include "GNEEdge.h"
38 #include "GNELane.h"
39 #include "GNEViewNet.h"
40 #include "GNENet.h"
41 #include "GNECalibratorFlow.h"
42 #include "GNECalibratorRoute.h"
44 #include "GNECalibrator.h"
45 #include "GNEUndoList.h"
47 
48 
49 // ===========================================================================
50 // FOX callback mapping
51 // ===========================================================================
52 
53 FXDEFMAP(GNECalibratorFlowDialog) GNECalibratorFlowDialogMap[] = {
59 };
60 
61 // Object implementation
62 FXIMPLEMENT(GNECalibratorFlowDialog, GNEAdditionalDialog, GNECalibratorFlowDialogMap, ARRAYNUMBER(GNECalibratorFlowDialogMap))
63 
64 // ===========================================================================
65 // member method definitions
66 // ===========================================================================
67 
68 GNECalibratorFlowDialog::GNECalibratorFlowDialog(GNECalibratorFlow* editedCalibratorFlow, bool updatingElement) :
69  GNEAdditionalDialog(editedCalibratorFlow->getCalibratorParent(), 600, 300),
70  myEditedCalibratorFlow(editedCalibratorFlow),
71  myUpdatingElement(updatingElement),
72  myCalibratorFlowValid(true) {
73  // change default header
74  std::string typeOfOperation = myUpdatingElement ? "Edit " + toString(myEditedCalibratorFlow->getTag()) + " of " : "Create " + toString(myEditedCalibratorFlow->getTag()) + " for ";
75  changeAdditionalDialogHeader(typeOfOperation + toString(myEditedCalibratorFlow->getCalibratorParent()->getTag()) + " '" + myEditedCalibratorFlow->getCalibratorParent()->getID() + "'");
76 
77  // Create auxiliar frames for tables
78  FXHorizontalFrame* columns = new FXHorizontalFrame(myContentFrame, GUIDesignUniformHorizontalFrame);
79  FXVerticalFrame* columnLeftLabel = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
80  FXVerticalFrame* columnLeftValue = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
81  FXVerticalFrame* columnRightLabel = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
82  FXVerticalFrame* columnRightValue = new FXVerticalFrame(columns, GUIDesignAuxiliarFrame);
83 
84  // 1 create textfield for flowID
85  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ID).c_str(), 0, GUIDesignLabelThick);
86  myTextFieldFlowID = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
87  // 2 create combobox for type
88  new FXLabel(columnLeftLabel, toString(SUMO_TAG_VTYPE).c_str(), 0, GUIDesignLabelThick);
89  myComboBoxVehicleType = new FXComboBox(columnLeftValue, GUIDesignComboBoxNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignComboBox);
90  // 3 create combobox for route
91  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ROUTE).c_str(), 0, GUIDesignLabelThick);
92  myComboBoxRoute = new FXComboBox(columnLeftValue, GUIDesignComboBoxNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignComboBox);
93  // 4 create textfield for color
94  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_COLOR).c_str(), 0, GUIDesignLabelThick);
95  myTextFieldColor = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
96  // 5 create textfield for lane
97  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_DEPARTLANE).c_str(), 0, GUIDesignLabelThick);
98  myTextFieldDepartLane = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
99  // 6 create textfield for pos
100  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_DEPARTPOS).c_str(), 0, GUIDesignLabelThick);
101  myTextFieldDepartPos = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
102  // 7 create textfield for speed
103  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_DEPARTSPEED).c_str(), 0, GUIDesignLabelThick);
104  myTextFieldDepartSpeed = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
105  // 8 create textfield for lane
106  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ARRIVALLANE).c_str(), 0, GUIDesignLabelThick);
107  myTextFieldArrivalLane = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
108  // 9 create textfield for arrival pos
109  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ARRIVALPOS).c_str(), 0, GUIDesignLabelThick);
110  myTextFieldArrivalPos = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
111  // 10 create textfield for arrival speed
112  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ARRIVALSPEED).c_str(), 0, GUIDesignLabelThick);
113  myTextFieldArrivalSpeed = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
114  // 11 create textfield for arrival line
115  new FXLabel(columnLeftLabel, toString(SUMO_ATTR_LINE).c_str(), 0, GUIDesignLabelThick);
116  myTextFieldLine = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
117  // 1 create textfield for person number
118  new FXLabel(columnRightLabel, toString(SUMO_ATTR_PERSON_NUMBER).c_str(), 0, GUIDesignLabelThick);
119  myTextFieldPersonNumber = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldInt);
120  // 2 create textfield for container number
121  new FXLabel(columnRightLabel, toString(SUMO_ATTR_CONTAINER_NUMBER).c_str(), 0, GUIDesignLabelThick);
122  myTextFieldContainerNumber = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldInt);
123  // 3 create textfield for reroute
124  new FXLabel(columnRightLabel, toString(SUMO_ATTR_REROUTE).c_str(), 0, GUIDesignLabelThick);
125  myRerouteCheckButton = new FXCheckButton(columnRightValue, "false", this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignCheckButtonAttribute);
126  // 4 create textfield for depart pos lat
127  new FXLabel(columnRightLabel, toString(SUMO_ATTR_DEPARTPOS_LAT).c_str(), 0, GUIDesignLabelThick);
128  myTextFieldDepartPosLat = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
129  // 5 create textfield for arrival pos lat
130  new FXLabel(columnRightLabel, toString(SUMO_ATTR_ARRIVALPOS_LAT).c_str(), 0, GUIDesignLabelThick);
131  myTextFieldArrivalPosLat = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField);
132  // 6 create textfield for begin
133  new FXLabel(columnRightLabel, toString(SUMO_ATTR_BEGIN).c_str(), 0, GUIDesignLabelThick);
134  myTextFieldBegin = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
135  // 7 create textfield for end
136  new FXLabel(columnRightLabel, toString(SUMO_ATTR_END).c_str(), 0, GUIDesignLabelThick);
137  myTextFieldEnd = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
138  // 8 create textfield for vehicle number
139  new FXLabel(columnRightLabel, toString(SUMO_ATTR_NUMBER).c_str(), 0, GUIDesignLabelThick);
140  myTextFieldNumber = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldInt);
141  // 9 create textfield for vehs per hour
142  myRadioButtonVehsPerHour = new FXRadioButton(columnRightLabel, toString(SUMO_ATTR_VEHSPERHOUR).c_str(), this, MID_GNE_CALIBRATORDIALOG_SET_FLOWTYPE, GUIDesignRadioButtonAttribute);
143  myTextFieldVehsPerHour = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
144  // 10 create textfield for period
145  myRadioButtonPeriod = new FXRadioButton(columnRightLabel, toString(SUMO_ATTR_PERIOD).c_str(), this, MID_GNE_CALIBRATORDIALOG_SET_FLOWTYPE, GUIDesignRadioButtonAttribute);
146  myTextFieldPeriod = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
147  // 11 create textfield for probability
148  myRadioButtonProbability = new FXRadioButton(columnRightLabel, toString(SUMO_ATTR_PROB).c_str(), this, MID_GNE_CALIBRATORDIALOG_SET_FLOWTYPE, GUIDesignRadioButtonAttribute);
149  myTextFieldProbability = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextFieldReal);
150 
151  // fill comboBox of VTypes
152  for (auto i : myEditedCalibratorFlow->getCalibratorParent()->getCalibratorVehicleTypes()) {
153  myComboBoxVehicleType->appendItem(i->getID().c_str());
154  }
155  myComboBoxVehicleType->setNumVisible((int)myEditedCalibratorFlow->getCalibratorParent()->getCalibratorVehicleTypes().size());
156 
157  // fill comboBox of Routes
158  for (auto i : myEditedCalibratorFlow->getCalibratorParent()->getCalibratorRoutes()) {
159  myComboBoxRoute->appendItem(i->getID().c_str());
160  }
161  myComboBoxRoute->setNumVisible((int)myEditedCalibratorFlow->getCalibratorParent()->getCalibratorRoutes().size());
162 
163  // update tables
164  updateCalibratorFlowValues();
165 
166  // start a undo list for editing local to this additional
167  initChanges();
168 
169  // add element if we aren't updating an existent element
170  if (myUpdatingElement == false) {
171  myEditedCalibratorFlow->getCalibratorParent()->getViewNet()->getUndoList()->add(new GNEChange_CalibratorItem(myEditedCalibratorFlow, true), true);
172  }
173 
174  // open as modal dialog
175  openAsModalDialog();
176 }
177 
178 
180 
181 
182 long
183 GNECalibratorFlowDialog::onCmdAccept(FXObject*, FXSelector, void*) {
184  if (myCalibratorFlowValid == false) {
185  // write warning if netedit is running in testing mode
186  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
187  WRITE_WARNING("Opening FXMessageBox of type 'warning'");
188  }
189  std::string operation1 = myUpdatingElement ? ("updating") : ("creating");
190  std::string operation2 = myUpdatingElement ? ("updated") : ("created");
191  std::string parentTagString = toString(myEditedCalibratorFlow->getCalibratorParent()->getTag());
192  std::string tagString = toString(myEditedCalibratorFlow->getTag());
193  // open warning dialog box
194  FXMessageBox::warning(getApp(), MBOX_OK,
195  ("Error " + operation1 + " " + parentTagString + "'s " + tagString).c_str(), "%s",
196  (parentTagString + "'s " + tagString + " cannot be " + operation2 +
197  " because parameter " + toString(myInvalidAttr) +
198  " is invalid.").c_str());
199  // write warning if netedit is running in testing mode
200  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
201  WRITE_WARNING("Closed FXMessageBox of type 'warning' with 'OK'");
202  }
203  return 0;
204  } else {
205  // accept changes before closing dialog
206  acceptChanges();
207  // stop dialgo sucesfully
208  getApp()->stopModal(this, TRUE);
209  return 1;
210  }
211 }
212 
213 
214 long
215 GNECalibratorFlowDialog::onCmdCancel(FXObject*, FXSelector, void*) {
216  // cancel changes
217  cancelChanges();
218  // Stop Modal
219  getApp()->stopModal(this, FALSE);
220  return 1;
221 }
222 
223 
224 long
225 GNECalibratorFlowDialog::onCmdReset(FXObject*, FXSelector, void*) {
226  // reset changes
227  resetChanges();
228  // update tables
230  return 1;
231 }
232 
233 
234 long
235 GNECalibratorFlowDialog::onCmdSetVariable(FXObject*, FXSelector, void*) {
236  // At start we assumed, that all values are valid
237  myCalibratorFlowValid = true;
239  // get pointer to undo list (Only for code legilibity)
241  // set color of myTextFieldFlowID, depending if current value is valid or not
242  if (myEditedCalibratorFlow->getID() == myTextFieldFlowID->getText().text()) {
243  myTextFieldFlowID->setTextColor(FXRGB(0, 0, 0));
244  myEditedCalibratorFlow->setAttribute(SUMO_ATTR_ID, myTextFieldFlowID->getText().text(), undoList);
245  } else if (myEditedCalibratorFlow->isValid(SUMO_ATTR_ID, myTextFieldFlowID->getText().text())) {
246  myTextFieldFlowID->setTextColor(FXRGB(0, 0, 0));
247  myEditedCalibratorFlow->setAttribute(SUMO_ATTR_ID, myTextFieldFlowID->getText().text(), undoList);
248  } else {
249  myTextFieldFlowID->setTextColor(FXRGB(255, 0, 0));
250  myCalibratorFlowValid = false;
252  }
253  // set color of myComboBoxVehicleType, depending if current value is valid or not
255  myComboBoxVehicleType->setTextColor(FXRGB(0, 0, 0));
257  } else {
258  myComboBoxVehicleType->setTextColor(FXRGB(255, 0, 0));
259  myCalibratorFlowValid = false;
261  }
262  // set color of myComboBoxRoute, depending if current value is valid or not
264  myComboBoxRoute->setTextColor(FXRGB(0, 0, 0));
266  } else {
267  myComboBoxRoute->setTextColor(FXRGB(255, 0, 0));
268  myCalibratorFlowValid = false;
270  }
271  // set color of myTextFieldColor, depending if current value is valid or not
273  myTextFieldColor->setTextColor(FXRGB(0, 0, 0));
275  } else {
276  myTextFieldColor->setTextColor(FXRGB(255, 0, 0));
277  myCalibratorFlowValid = false;
279  }
280  // set color of myTextFieldDepartLane, depending if current value is valid or not
282  myTextFieldDepartLane->setTextColor(FXRGB(0, 0, 0));
284  } else {
285  myTextFieldDepartLane->setTextColor(FXRGB(255, 0, 0));
286  myCalibratorFlowValid = false;
288  }
289  // set color of myTextFieldDepartPos, depending if current value is valid or not
291  myTextFieldDepartPos->setTextColor(FXRGB(0, 0, 0));
293  } else {
294  myTextFieldDepartPos->setTextColor(FXRGB(255, 0, 0));
295  myCalibratorFlowValid = false;
297  }
298  // set color of setDepartSpeed, depending if current value is valid or not
300  myTextFieldDepartSpeed->setTextColor(FXRGB(0, 0, 0));
302  } else {
303  myTextFieldDepartSpeed->setTextColor(FXRGB(255, 0, 0));
304  myCalibratorFlowValid = false;
306  }
307  // set color of myTextFieldArrivalLane, depending if current value is valid or not
309  myTextFieldArrivalLane->setTextColor(FXRGB(0, 0, 0));
311  } else {
312  myTextFieldArrivalLane->setTextColor(FXRGB(255, 0, 0));
313  myCalibratorFlowValid = false;
315  }
316  // set color of myTextFieldArrivalPos, depending if current value is valid or not
318  myTextFieldArrivalPos->setTextColor(FXRGB(0, 0, 0));
320  } else {
321  myTextFieldArrivalPos->setTextColor(FXRGB(255, 0, 0));
322  myCalibratorFlowValid = false;
324  }
325  // set color of setArrivalSpeed, depending if current value is valid or not
327  myTextFieldArrivalSpeed->setTextColor(FXRGB(0, 0, 0));
329  } else {
330  myTextFieldArrivalSpeed->setTextColor(FXRGB(255, 0, 0));
331  myCalibratorFlowValid = false;
333  }
334  // set color of myTextFieldLine, depending if current value is valid or not
336  myTextFieldLine->setTextColor(FXRGB(0, 0, 0));
337  myEditedCalibratorFlow->setAttribute(SUMO_ATTR_LINE, myTextFieldLine->getText().text(), undoList);
338  } else {
339  myTextFieldLine->setTextColor(FXRGB(255, 0, 0));
340  myCalibratorFlowValid = false;
342  }
343  // set color of myTextFieldPersonNumber, depending if current value is valid or not
345  myTextFieldPersonNumber->setTextColor(FXRGB(0, 0, 0));
347  } else {
348  myTextFieldPersonNumber->setTextColor(FXRGB(255, 0, 0));
349  myCalibratorFlowValid = false;
351  }
352  // set color of myTextFieldContainerNumber, depending if current value is valid or not
354  myTextFieldContainerNumber->setTextColor(FXRGB(0, 0, 0));
356  } else {
357  myTextFieldContainerNumber->setTextColor(FXRGB(255, 0, 0));
358  myCalibratorFlowValid = false;
360  }
361  // set reroute
362  if (myRerouteCheckButton->getCheck()) {
364  myRerouteCheckButton->setText("true");
365  } else {
367  myRerouteCheckButton->setText("false");
368  }
369  // set color of myTextFieldDepartPosLat, depending if current value is valid or not
371  myTextFieldDepartPosLat->setTextColor(FXRGB(0, 0, 0));
373  } else {
374  myTextFieldDepartPosLat->setTextColor(FXRGB(255, 0, 0));
375  myCalibratorFlowValid = false;
377  }
378  // set color of myTextFieldArrivalPosLat, depending if current value is valid or not
380  myTextFieldArrivalPosLat->setTextColor(FXRGB(0, 0, 0));
382  } else {
383  myTextFieldArrivalPosLat->setTextColor(FXRGB(255, 0, 0));
384  myCalibratorFlowValid = false;
386  }
387  // set color of myTextFieldBegin, depending if current value is valid or not
389  myTextFieldBegin->setTextColor(FXRGB(0, 0, 0));
391  } else {
392  myTextFieldBegin->setTextColor(FXRGB(255, 0, 0));
393  myCalibratorFlowValid = false;
395  }
396  // set color of myTextFieldEnd, depending if current value is valid or not
397  if (myEditedCalibratorFlow->isValid(SUMO_ATTR_END, myTextFieldEnd->getText().text())) {
398  myTextFieldEnd->setTextColor(FXRGB(0, 0, 0));
399  myEditedCalibratorFlow->setAttribute(SUMO_ATTR_END, myTextFieldEnd->getText().text(), undoList);
400  } else {
401  myTextFieldEnd->setTextColor(FXRGB(255, 0, 0));
402  myCalibratorFlowValid = false;
404  }
405  // set color of myTextFieldNumber, depending if current value is valid or not
407  myTextFieldNumber->setTextColor(FXRGB(0, 0, 0));
409  } else {
410  myTextFieldNumber->setTextColor(FXRGB(255, 0, 0));
411  myCalibratorFlowValid = false;
413  }
414  // set color of myTextFieldVehsPerHour, depending if current value is valid or not
416  myTextFieldVehsPerHour->setTextColor(FXRGB(0, 0, 0));
418  } else if (myRadioButtonVehsPerHour->getCheck()) {
419  myTextFieldVehsPerHour->setTextColor(FXRGB(255, 0, 0));
420  myCalibratorFlowValid = false;
422  } else {
423  // if radio button is disabled, set default color
424  myTextFieldVehsPerHour->setTextColor(FXRGB(0, 0, 0));
425  }
426  // set color of myTextFieldPeriod, depending if current value is valid or not
428  myTextFieldPeriod->setTextColor(FXRGB(0, 0, 0));
430  } else if (myRadioButtonPeriod->getCheck()) {
431  myTextFieldPeriod->setTextColor(FXRGB(255, 0, 0));
432  myCalibratorFlowValid = false;
434  } else {
435  // if radio button is disabled, set default color
436  myTextFieldPeriod->setTextColor(FXRGB(0, 0, 0));
437  }
438  // set color of myTextFieldProbability, depending if current value is valid or not
440  myTextFieldProbability->setTextColor(FXRGB(0, 0, 0));
442  } else if (myRadioButtonProbability->getCheck()) {
443  myTextFieldProbability->setTextColor(FXRGB(255, 0, 0));
444  myCalibratorFlowValid = false;
446  } else {
447  // if radio button is disabled, set default color
448  myTextFieldProbability->setTextColor(FXRGB(0, 0, 0));
449  }
450  return 1;
451 }
452 
453 
454 long
455 GNECalibratorFlowDialog::onCmdSetTypeOfFlow(FXObject* radioButton, FXSelector, void*) {
456  if (radioButton == myRadioButtonVehsPerHour) {
457  myRadioButtonVehsPerHour->setCheck(true);
458  myTextFieldVehsPerHour->enable();
460  // disable other options
461  myRadioButtonPeriod->setCheck(false);
462  myTextFieldPeriod->disable();
463  myRadioButtonProbability->setCheck(false);
464  myTextFieldProbability->disable();
465  onCmdSetVariable(0, 0, 0);
466  return 1;
467  } else if (radioButton == myRadioButtonPeriod) {
468  myRadioButtonPeriod->setCheck(true);
469  myTextFieldPeriod->enable();
471  // disable other options
472  myRadioButtonVehsPerHour->setCheck(false);
473  myTextFieldVehsPerHour->disable();
474  myRadioButtonProbability->setCheck(false);
475  myTextFieldProbability->disable();
476  onCmdSetVariable(0, 0, 0);
477  return 1;
478  } else if (radioButton == myRadioButtonProbability) {
479  myRadioButtonProbability->setCheck(true);
480  myTextFieldProbability->enable();
482  // disable other options
483  myRadioButtonVehsPerHour->setCheck(false);
484  myTextFieldVehsPerHour->disable();
485  myRadioButtonPeriod->setCheck(false);
486  myTextFieldPeriod->disable();
487  onCmdSetVariable(0, 0, 0);
488  return 1;
489  } else {
490  return 0;
491  }
492 }
493 
494 
495 void
497  // update fields
511  myRerouteCheckButton->setCheck(GNEAttributeCarrier::parse<bool>(myEditedCalibratorFlow->getAttribute(SUMO_ATTR_REROUTE).c_str()));
520  // upsate type of flow
527  }
528 }
529 
530 
531 /****************************************************************************/
FXTextField * myTextFieldDepartPos
TextField for Depart Pos.
void resetChanges()
reset changes did in this dialog.
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:199
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
Definition: GUIDesigns.h:116
description of a vehicle type
FXCheckButton * myRerouteCheckButton
checkButton for Reroute
FXTextField * myTextFieldDepartLane
TextField for Depart Lane.
bool isValid(SumoXMLAttr key, const std::string &value)
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
FXTextField * myTextFieldNumber
TextField for Number.
Dialog to edit sequences, parameters, etc.. of Additionals.
FXTextField * myTextFieldPeriod
TextField for Period.
weights: time range begin
void setFlowType(GNECalibratorFlow::TypeOfFlow type)
set type of flow
FXTextField * myTextFieldBegin
TextField for Begin.
FXDEFMAP(GNECalibratorFlowDialog) GNECalibratorFlowDialogMap[]
FXTextField * myTextFieldArrivalPos
TextField for Arrival Pos.
FXTextField * myTextFieldArrivalPosLat
TextField for ArrivalPosLat.
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:199
FXRadioButton * myRadioButtonPeriod
RadioButton for Period.
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:64
#define GUIDesignComboBox
Definition: GUIDesigns.h:189
long onCmdSetTypeOfFlow(FXObject *radioButton, FXSelector, void *)
event after change type of flow
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
FXTextField * myTextFieldColor
TextField for Color.
FXRadioButton * myRadioButtonVehsPerHour
RadioButton for VehsPerHour.
GNEUndoList * getUndoList() const
get the undoList object
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frames used to pack another frames extended in all directions ...
Definition: GUIDesigns.h:243
FXComboBox * myComboBoxRoute
TextField for Route.
#define GUIDesignTextField
Definition: GUIDesigns.h:40
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
#define GUIDesignUniformHorizontalFrame
design for horizontal frame used to pack another frames with a uniform width
Definition: GUIDesigns.h:252
FXRadioButton * myRadioButtonProbability
RadioButton for Probability.
FXTextField * myTextFieldDepartPosLat
TextField for DepartPosLat.
FXTextField * myTextFieldArrivalLane
TextField for Arrival Lane.
invalid attribute
bool myCalibratorFlowValid
flag to check if current calibrator flow is valid
bool myUpdatingElement
flag to indicate if flow are being created or modified
FXTextField * myTextFieldEnd
TextField for End.
const std::string getID() const
function to support debugging
FXTextField * myTextFieldLine
TextField for Line.
FXComboBox * myComboBoxVehicleType
ComboBox for Type.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
GNECalibrator * getCalibratorParent() const
get pointer to calibrator parent
long onCmdAccept(FXObject *, FXSelector, void *)
FXTextField * myTextFieldArrivalSpeed
TextField for Arrival Speed.
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:49
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which additional element is located.
void acceptChanges()
Accept changes did in this dialog.
FXTextField * myTextFieldDepartSpeed
TextField for Depart Speed.
weights: time range end
void cancelChanges()
Cancel changes did in this dialog.
#define GUIDesignLabelThick
label extended over frame with thick and with text justify to left and height of 23 ...
Definition: GUIDesigns.h:152
#define GUIDesignTextFieldInt
text field extended over Frame with thick frame and limited to Integers
Definition: GUIDesigns.h:43
#define GUIDesignTextFieldReal
text field extended over Frame with thick frame and limited to Doubles/doubles
Definition: GUIDesigns.h:46
SumoXMLAttr myInvalidAttr
current sumo attribute invalid
void updateCalibratorFlowValues()
update data fields
long onCmdSetVariable(FXObject *, FXSelector, void *)
event after change value
GNECalibratorFlow::TypeOfFlow getFlowType() const
get type of flow
FXTextField * myTextFieldPersonNumber
TextField for PersonNumber.
FXTextField * myTextFieldVehsPerHour
TextField for VehsPerHour.
GNECalibratorFlow * myEditedCalibratorFlow
interator to edited calibrator flow
Dialog for edit rerouter intervals.
FXTextField * myTextFieldContainerNumber
TextField for Container Number.
#define GUIDesignRadioButtonAttribute
design for radio button with fixed height
Definition: GUIDesigns.h:136
A color information.
FXTextField * myTextFieldProbability
TextField for Probability.
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
SumoXMLTag getTag() const
get XML Tag assigned to this object
FXTextField * myTextFieldFlowID
TextField for flow ID.