Eclipse SUMO - Simulation of Urban MObility
GNEFrameAttributesModuls.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 // Auxiliar class for GNEFrame Moduls (only for attributes edition)
15 /****************************************************************************/
16 
17 // ===========================================================================
18 // included modules
19 // ===========================================================================
20 
21 #include <config.h>
22 
23 #include <netedit/GNENet.h>
24 #include <netedit/GNEUndoList.h>
25 #include <netedit/GNEViewNet.h>
36 
37 #include "GNEFrame.h"
39 
40 
41 // ===========================================================================
42 // FOX callback mapping
43 // ===========================================================================
44 
49 };
50 
51 FXDEFMAP(GNEFrameAttributesModuls::AttributesCreator) AttributesCreatorMap[] = {
53 };
54 
55 FXDEFMAP(GNEFrameAttributesModuls::AttributesCreatorFlow) AttributesCreatorFlowMap[] = {
58 };
59 
60 FXDEFMAP(GNEFrameAttributesModuls::AttributesEditorRow) AttributesEditorRowMap[] = {
64 };
65 
68 };
69 
70 FXDEFMAP(GNEFrameAttributesModuls::AttributesEditorFlow) AttributesEditorFlowMap[] = {
73 };
74 
75 FXDEFMAP(GNEFrameAttributesModuls::AttributesEditorExtended) AttributesEditorExtendedMap[] = {
77 };
78 
82 };
83 
88 };
89 
90 FXDEFMAP(GNEFrameAttributesModuls::NeteditAttributes) NeteditAttributesMap[] = {
93 };
94 
95 // Object implementation
96 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesCreatorRow, FXHorizontalFrame, RowCreatorMap, ARRAYNUMBER(RowCreatorMap))
97 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesCreator, FXGroupBox, AttributesCreatorMap, ARRAYNUMBER(AttributesCreatorMap))
98 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesCreatorFlow, FXGroupBox, AttributesCreatorFlowMap, ARRAYNUMBER(AttributesCreatorFlowMap))
99 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditorRow, FXHorizontalFrame, AttributesEditorRowMap, ARRAYNUMBER(AttributesEditorRowMap))
100 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditor, FXGroupBox, AttributesEditorMap, ARRAYNUMBER(AttributesEditorMap))
101 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditorFlow, FXGroupBox, AttributesEditorFlowMap, ARRAYNUMBER(AttributesEditorFlowMap))
102 FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditorExtended, FXGroupBox, AttributesEditorExtendedMap, ARRAYNUMBER(AttributesEditorExtendedMap))
103 FXIMPLEMENT(GNEFrameAttributesModuls::ParametersEditor, FXGroupBox, ParametersEditorMap, ARRAYNUMBER(ParametersEditorMap))
104 FXIMPLEMENT(GNEFrameAttributesModuls::DrawingShape, FXGroupBox, DrawingShapeMap, ARRAYNUMBER(DrawingShapeMap))
105 FXIMPLEMENT(GNEFrameAttributesModuls::NeteditAttributes, FXGroupBox, NeteditAttributesMap, ARRAYNUMBER(NeteditAttributesMap))
106 
107 
108 // ===========================================================================
109 // method definitions
110 // ===========================================================================
111 
112 // ---------------------------------------------------------------------------
113 // GNEFrameAttributesModuls::AttributesCreatorRow - methods
114 // ---------------------------------------------------------------------------
115 
116 GNEFrameAttributesModuls::AttributesCreatorRow::AttributesCreatorRow(AttributesCreator* AttributesCreatorParent, const GNEAttributeCarrier::AttributeProperties& attrProperties) :
117  FXHorizontalFrame(AttributesCreatorParent, GUIDesignAuxiliarHorizontalFrame),
118  myAttributesCreatorParent(AttributesCreatorParent),
119  myAttrProperties(attrProperties) {
120  // Create left visual elements
121  myAttributeLabel = new FXLabel(this, "name", nullptr, GUIDesignLabelAttribute);
122  myAttributeLabel->hide();
123  myAttributeCheckButton = new FXCheckButton(this, "name", this, MID_GNE_SET_ATTRIBUTE_BOOL, GUIDesignCheckButtonAttribute);
124  myAttributeCheckButton->hide();
125  myAttributeColorButton = new FXButton(this, "ColorButton", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute);
126  myAttributeColorButton->hide();
127  // Create right visual elements
128  myValueTextField = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
129  myValueTextField->hide();
130  myValueCheckButton = new FXCheckButton(this, "Disabled", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
131  myValueCheckButton->hide();
132  // by default attribute check button is true (except for until)
133  if ((attrProperties.getTagPropertyParent().isStop() || attrProperties.getTagPropertyParent().isPersonStop()) && (attrProperties.getAttr() == SUMO_ATTR_UNTIL)) {
134  myAttributeCheckButton->setCheck(FALSE);
135  } else {
136  myAttributeCheckButton->setCheck(TRUE);
137  }
138  // only create if parent was created
139  if (getParent()->id()) {
140  // create AttributesCreatorRow
141  FXHorizontalFrame::create();
142  // reset invalid value
143  myInvalidValue = "";
144  // special case for attribute ID
145  if (attrProperties.getAttr() == SUMO_ATTR_ID) {
146  // show check button and disable it
147  myAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str());
148  myAttributeCheckButton->setCheck(false);
149  myAttributeCheckButton->show();
150  // show text field and disable it
151  myValueTextField->setTextColor(FXRGB(0, 0, 0));
152  myValueTextField->disable();
153  // generate ID
154  myValueTextField->setText(generateID().c_str());
155  // show textField
156  myValueTextField->show();
157  } else {
158  // show label, button for edit colors or radio button
159  if (myAttrProperties.isColor()) {
160  myAttributeColorButton->setTextColor(FXRGB(0, 0, 0));
161  myAttributeColorButton->setText(myAttrProperties.getAttrStr().c_str());
162  myAttributeColorButton->show();
163  } else if (myAttrProperties.isActivatable()) {
164  myAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str());
165  myAttributeCheckButton->show();
166  // special case for attributes "Parking", "until" and "duration" (by default disabled)
167  if ((myAttrProperties.getTagPropertyParent().isStop() || myAttrProperties.getTagPropertyParent().isPersonStop()) &&
168  (myAttrProperties.getAttr() == SUMO_ATTR_UNTIL || myAttrProperties.getAttr() == SUMO_ATTR_EXTENSION ||
169  myAttrProperties.getAttr() == SUMO_ATTR_PARKING)) {
170  myAttributeCheckButton->setCheck(FALSE);
171  } else {
172  myAttributeCheckButton->setCheck(TRUE);
173  }
174  } else {
175  myAttributeLabel->setText(myAttrProperties.getAttrStr().c_str());
176  myAttributeLabel->show();
177  }
178  if (myAttrProperties.isBool()) {
179  if (GNEAttributeCarrier::parse<bool>(attrProperties.getDefaultValue())) {
180  myValueCheckButton->setCheck(true);
181  myValueCheckButton->setText("true");
182  } else {
183  myValueCheckButton->setCheck(false);
184  myValueCheckButton->setText("false");
185  }
186  myValueCheckButton->show();
187  // if it's associated to a label button and is disabled, then disable myValueCheckButton
188  if (myAttributeCheckButton->shown() && (myAttributeCheckButton->getCheck() == FALSE)) {
189  myValueCheckButton->disable();
190  }
191  } else {
192  myValueTextField->setTextColor(FXRGB(0, 0, 0));
193  myValueTextField->setText(attrProperties.getDefaultValue().c_str());
194  myValueTextField->show();
195  // if it's associated to a label button and is disabled, then disable myValueTextField
196  if (myAttributeCheckButton->shown() && (myAttributeCheckButton->getCheck() == FALSE)) {
197  myValueTextField->disable();
198  }
199  }
200  }
201  // show AttributesCreatorRow
202  show();
203  }
204 }
205 
206 
207 void
209  // only destroy if parent was created
210  if (getParent()->id()) {
211  FXHorizontalFrame::destroy();
212  }
213 }
214 
215 
218  return myAttrProperties;
219 }
220 
221 
222 std::string
224  if (myAttrProperties.isBool()) {
225  return (myValueCheckButton->getCheck() == 1) ? "1" : "0";
226  } else {
227  return myValueTextField->getText().text();
228  }
229 }
230 
231 
232 bool
234  if (shown()) {
235  return myAttributeCheckButton->getCheck() == TRUE;
236  } else {
237  return false;
238  }
239 }
240 
241 
242 void
244  if (shown()) {
245  // set radio button
246  myAttributeCheckButton->setCheck(value);
247  // enable or disable input fields
248  if (value) {
249  if (myAttrProperties.isBool()) {
250  myValueCheckButton->enable();
251  } else {
252  myValueTextField->enable();
253  }
254  } else {
255  if (myAttrProperties.isBool()) {
256  myValueCheckButton->disable();
257  } else {
258  myValueTextField->disable();
259  }
260  }
261  }
262 }
263 
264 
265 void
267  if (myAttrProperties.isBool()) {
268  return myValueCheckButton->enable();
269  } else {
270  return myValueTextField->enable();
271  }
272 }
273 
274 
275 void
277  if (myAttrProperties.isBool()) {
278  return myValueCheckButton->disable();
279  } else {
280  return myValueTextField->disable();
281  }
282 }
283 
284 
285 bool
287  if (!shown()) {
288  return false;
289  } else if (myAttrProperties.isBool()) {
290  return myValueCheckButton->isEnabled();
291  } else {
292  return myValueTextField->isEnabled();
293  }
294 }
295 
296 
297 void
299  // currently only row with ID attribute must be updated
300  if (myAttrProperties.getAttr() == SUMO_ATTR_ID) {
301  myValueTextField->setText(generateID().c_str());
302  }
303 }
304 
305 
306 const std::string&
308  return myInvalidValue;
309 }
310 
311 
314  return myAttributesCreatorParent;
315 }
316 
317 
318 long
320  // We assume that current value is valid
321  myInvalidValue = "";
322  // Check if format of current value of myTextField is correct
323  if (obj == myValueCheckButton) {
324  if (myValueCheckButton->getCheck()) {
325  myValueCheckButton->setText("true");
326  } else {
327  myValueCheckButton->setText("false");
328  }
329  } else if (myAttrProperties.isComplex()) {
330  // check complex attribute
331  myInvalidValue = checkComplexAttribute(myValueTextField->getText().text());
332  } else if (myAttrProperties.isInt()) {
333  // first filter int attributes
334  if (GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
335  // obtain parsed attribute
336  double parsedDouble = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
337  // check if parsed double doesn't have decimal part (or is 0)
338  if ((parsedDouble - (int)parsedDouble) == 0) {
339  myValueTextField->setText(toString((int)parsedDouble).c_str(), FALSE);
340  // Check if int value must be positive
341  if (myAttrProperties.isPositive() && (parsedDouble < 0)) {
342  myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' cannot be negative";
343  }
344  } else {
345  myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid 'int' format";
346  }
347  } else {
348  myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid 'int' format";
349  }
350 
351  } else if (myAttrProperties.getAttr() == SUMO_ATTR_ANGLE) {
352  if (GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
353  // filter angle
354  double angle = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
355  // filter if angle isn't between [0,360]
356  if ((angle < 0) || (angle > 360)) {
357  // apply modul
358  angle = fmod(angle, 360);
359  }
360  // update Textfield
361  myValueTextField->setText(toString(angle).c_str(), FALSE);
362  } else {
363  myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid 'float' format between [0, 360]";
364  }
365  } else if (myAttrProperties.isSUMOTime()) {
366  // time attributes work as positive doubles
367  if (!GNEAttributeCarrier::canParse<SUMOTime>(myValueTextField->getText().text())) {
368  myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid SUMOTime format";
369  }
370  } else if (myAttrProperties.isFloat()) {
371  if (GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
372  // convert string to double
373  double doubleValue = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
374  // Check if double value must be positive
375  if (myAttrProperties.isPositive() && (doubleValue < 0)) {
376  myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' cannot be negative";
377  // check if double value is a probability
378  } else if (myAttrProperties.isProbability() && ((doubleValue < 0) || doubleValue > 1)) {
379  myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' takes only values between 0 and 1";
380  } else if (myAttrProperties.hasAttrRange() && ((doubleValue < myAttrProperties.getMinimumRange()) || doubleValue > myAttrProperties.getMaximumRange())) {
381  myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' takes only values between " + toString(myAttrProperties.getMinimumRange()) + " and " + toString(myAttrProperties.getMaximumRange());
382  } else if ((myAttributesCreatorParent->getCurrentTagProperties().getTag() == SUMO_TAG_E2DETECTOR) && (myAttrProperties.getAttr() == SUMO_ATTR_LENGTH) && (doubleValue == 0)) {
383  myInvalidValue = "E2 length cannot be 0";
384  }
385  } else {
386  myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid 'float' format";
387  }
388  } else if (myAttrProperties.isColor()) {
389  // check if filename format is valid
390  if (GNEAttributeCarrier::canParse<RGBColor>(myValueTextField->getText().text()) == false) {
391  myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid 'RBGColor' format";
392  }
393  } else if (myAttrProperties.isFilename()) {
394  const std::string file = myValueTextField->getText().text();
395  // check if filename format is valid
396  if (SUMOXMLDefinitions::isValidFilename(file) == false) {
397  myInvalidValue = "input contains invalid characters for a filename";
398  } else if (myAttrProperties.getAttr() == SUMO_ATTR_IMGFILE) {
399  if (!file.empty()) {
400  // only load value if file exist and can be loaded
401  if (GUITexturesHelper::getTextureID(file) == -1) {
402  myInvalidValue = "doesn't exist image '" + file + "'";
403  }
404  }
405  }
406  } else if (myAttrProperties.getAttr() == SUMO_ATTR_NAME) {
407  const std::string name = myValueTextField->getText().text();
408  // check if name format is valid
409  if (SUMOXMLDefinitions::isValidAttribute(name) == false) {
410  myInvalidValue = "input contains invalid characters";
411  }
412  } else if (myAttrProperties.getAttr() == SUMO_ATTR_VTYPES) {
413  const std::string types = myValueTextField->getText().text();
414  // if list of VTypes isn't empty, check that all characters are valid
415  if (!types.empty() && !SUMOXMLDefinitions::isValidListOfTypeID(types)) {
416  myInvalidValue = "list of IDs contains invalid characters";
417  }
418  } else if (myAttrProperties.getAttr() == SUMO_ATTR_INDEX) {
419  // special case for stop indx
420  const std::string index = myValueTextField->getText().text();
421  if ((index != "fit") && (index != "end") && !GNEAttributeCarrier::canParse<int>(index)) {
422  myInvalidValue = "index isn't either 'fit' or 'end' or a valid positive int";
423  } else if (GNEAttributeCarrier::canParse<int>(index) && (GNEAttributeCarrier::parse<int>(index) < 0)) {
424  myInvalidValue = "index cannot be negative";
425  }
426  } else if ((myAttrProperties.getAttr() == SUMO_ATTR_EXPECTED) || (myAttrProperties.getAttr() == SUMO_ATTR_EXPECTED_CONTAINERS)) {
427  // check if attribute can be parsed in a list of Ids
428  std::vector<std::string> vehicleIDs = GNEAttributeCarrier::parse<std::vector<std::string> >(myValueTextField->getText().text());
429  // check every ID
430  for (const auto& i : vehicleIDs) {
432  myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr();
433  }
434  }
435  } else if (myAttrProperties.getAttr() == SUMO_ATTR_TRIP_ID) {
436  if (!SUMOXMLDefinitions::isValidVehicleID(myValueTextField->getText().text())) {
437  myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr();
438  }
439  } else if (myAttrProperties.getAttr() == SUMO_ATTR_ID) {
440  // check ID depending of tag
441  if (myAttrProperties.getTagPropertyParent().isNetElement() && !SUMOXMLDefinitions::isValidNetID(myValueTextField->getText().text())) {
442  myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr();
443  } else if (myAttrProperties.getTagPropertyParent().isDetector() && !SUMOXMLDefinitions::isValidDetectorID(myValueTextField->getText().text())) {
444  myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr();
445  } else if (myAttrProperties.getTagPropertyParent().isAdditional() && !SUMOXMLDefinitions::isValidNetID(myValueTextField->getText().text())) {
446  myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr();
447  } else if (myAttrProperties.getTagPropertyParent().isShape() && !SUMOXMLDefinitions::isValidTypeID(myValueTextField->getText().text())) {
448  myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr();
449  } else if (myAttrProperties.getTagPropertyParent().isDemandElement() && !SUMOXMLDefinitions::isValidVehicleID(myValueTextField->getText().text())) {
450  myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr();
451  }
452  }
453  // change color of text field depending of myCurrentValueValid
454  if (myInvalidValue.size() == 0) {
455  myValueTextField->setTextColor(FXRGB(0, 0, 0));
456  myValueTextField->killFocus();
457  } else {
458  // IF value of TextField isn't valid, change their color to Red
459  myValueTextField->setTextColor(FXRGB(255, 0, 0));
460  }
461  // Update aditional frame
462  update();
463  return 1;
464 }
465 
466 
467 long
469  if (myAttributeCheckButton->getCheck()) {
470  // enable input values
471  myValueCheckButton->enable();
472  myValueTextField->enable();
473  // refresh row
474  refreshRow();
475  } else {
476  // disable input values
477  myValueCheckButton->disable();
478  myValueTextField->disable();
479  }
480  return 0;
481 }
482 
483 
484 long
486  // create FXColorDialog
487  FXColorDialog colordialog(this, tr("Color Dialog"));
488  colordialog.setTarget(this);
489  // If previous attribute wasn't correct, set black as default color
490  if (GNEAttributeCarrier::canParse<RGBColor>(myValueTextField->getText().text())) {
491  colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor(myValueTextField->getText().text())));
492  } else {
493  colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor(myAttrProperties.getDefaultValue())));
494  }
495  // execute dialog to get a new color
496  if (colordialog.execute()) {
497  myValueTextField->setText(toString(MFXUtils::getRGBColor(colordialog.getRGBA())).c_str());
498  onCmdSetAttribute(nullptr, 0, nullptr);
499  }
500  return 0;
501 }
502 
503 
504 std::string
506  // declare values needed to check if given complex parameters are valid
507  std::string errorMessage;
508  DepartDefinition dd;
517  SVCPermissions mode;
518  int valueInt;
519  double valueDouble;
520  SUMOTime valueSUMOTime;
521  // check complex attribute
522  switch (myAttrProperties.getAttr()) {
523  case SUMO_ATTR_DEPART:
524  case SUMO_ATTR_BEGIN:
525  SUMOVehicleParameter::parseDepart(value, myAttrProperties.getAttrStr(), "", valueSUMOTime, dd, errorMessage);
526  break;
528  SUMOVehicleParameter::parseDepartLane(value, myAttrProperties.getAttrStr(), "", valueInt, dld, errorMessage);
529  break;
530  case SUMO_ATTR_DEPARTPOS:
531  SUMOVehicleParameter::parseDepartPos(value, myAttrProperties.getAttrStr(), "", valueDouble, dpd, errorMessage);
532  break;
534  SUMOVehicleParameter::parseDepartSpeed(value, myAttrProperties.getAttrStr(), "", valueDouble, dsd, errorMessage);
535  break;
537  SUMOVehicleParameter::parseArrivalLane(value, myAttrProperties.getAttrStr(), "", valueInt, ald, errorMessage);
538  break;
540  SUMOVehicleParameter::parseArrivalPos(value, myAttrProperties.getAttrStr(), "", valueDouble, apd, errorMessage);
541  break;
543  SUMOVehicleParameter::parseArrivalSpeed(value, myAttrProperties.getAttrStr(), "", valueDouble, asd, errorMessage);
544  break;
546  SUMOVehicleParameter::parseDepartPosLat(value, myAttrProperties.getAttrStr(), "", valueDouble, dpld, errorMessage);
547  break;
549  SUMOVehicleParameter::parseArrivalPosLat(value, myAttrProperties.getAttrStr(), "", valueDouble, apld, errorMessage);
550  break;
551  case SUMO_ATTR_MODES:
552  SUMOVehicleParameter::parsePersonModes(value, myAttrProperties.getAttrStr(), "", mode, errorMessage);
553  break;
554  default:
555  throw ProcessError("Invalid complex attribute");
556  }
557  // return error message (Will be empty if value is valid)
558  return errorMessage;
559 }
560 
561 
562 std::string
564  if (myAttrProperties.getTagPropertyParent().isShape()) {
565  return myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->generateShapeID(myAttrProperties.getTagPropertyParent().getTag());
566  } else if (myAttrProperties.getTagPropertyParent().isAdditional()) {
567  return myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->generateAdditionalID(myAttrProperties.getTagPropertyParent().getTag());
568  } else if (myAttrProperties.getTagPropertyParent().isDemandElement()) {
569  return myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->generateDemandElementID("", myAttrProperties.getTagPropertyParent().getTag());
570  } else {
571  return "";
572  }
573 }
574 
575 
576 bool
578  return (myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->retrieveAdditional(
579  myAttrProperties.getTagPropertyParent().getTag(),
580  myValueTextField->getText().text(), false) == nullptr);
581 }
582 
583 // ---------------------------------------------------------------------------
584 // GNEFrameAttributesModuls::AttributesCreator - methods
585 // ---------------------------------------------------------------------------
586 
588  FXGroupBox(frameParent->myContentFrame, "Internal attributes", GUIDesignGroupBoxFrame),
589  myFrameParent(frameParent) {
590  // resize myAttributesCreatorRows
592  // create myAttributesCreatorFlow
594  // create help button
595  myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
596 }
597 
598 
600 
601 
602 void
603 GNEFrameAttributesModuls::AttributesCreator::showAttributesCreatorModul(const GNEAttributeCarrier::TagProperties& tagProperties, const std::vector<SumoXMLAttr>& hiddenAttributes) {
604  // set current tag Properties
605  myTagProperties = tagProperties;
606  // first destroy all rows
607  for (int i = 0; i < (int)myAttributesCreatorRows.size(); i++) {
608  // destroy and delete all rows
609  if (myAttributesCreatorRows.at(i) != nullptr) {
610  myAttributesCreatorRows.at(i)->destroy();
611  delete myAttributesCreatorRows.at(i);
612  myAttributesCreatorRows.at(i) = nullptr;
613  }
614  }
615  // now declare a flag to show Flow editor
616  bool showFlowEditor = false;
617  // iterate over tag attributes and create AttributesCreatorRows for every attribute
618  for (const auto& i : myTagProperties) {
619  // declare falg to check conditions for show attribute
620  bool showAttribute = true;
621  // check that only non-unique attributes (except ID) are created (And depending of includeExtendedAttributes)
622  if (i.isUnique() && (i.getAttr() != SUMO_ATTR_ID)) {
623  showAttribute = false;
624  }
625  // check if attribute must stay hidden
626  if (std::find(hiddenAttributes.begin(), hiddenAttributes.end(), i.getAttr()) != hiddenAttributes.end()) {
627  showAttribute = false;
628  }
629  // check if attribute is a flow definitionattribute
630  if (i.isFlowDefinition()) {
631  showAttribute = false;
632  showFlowEditor = true;
633  }
634  // check special case for vaporizer IDs
635  if ((i.getAttr() == SUMO_ATTR_ID) && (i.getTagPropertyParent().getTag() == SUMO_TAG_VAPORIZER)) {
636  showAttribute = false;
637  }
638  // show attribute depending of showAttribute flag
639  if (showAttribute) {
640  myAttributesCreatorRows.at(i.getPositionListed()) = new AttributesCreatorRow(this, i);
641  }
642  }
643  // reparent help button (to place it at bottom)
644  myHelpButton->reparent(this);
645  // recalc
646  recalc();
647  // check if flow editor has to be shown
648  if (showFlowEditor) {
649  myAttributesCreatorFlow->showAttributesCreatorFlowModul();
650  } else {
651  myAttributesCreatorFlow->hideAttributesCreatorFlowModul();
652  }
653  // show
654  show();
655 }
656 
657 
658 void
660  hide();
661 }
662 
663 
664 GNEFrame*
666  return myFrameParent;
667 }
668 
669 
670 std::map<SumoXMLAttr, std::string>
672  std::map<SumoXMLAttr, std::string> values;
673  // get standard parameters
674  for (int i = 0; i < (int)myAttributesCreatorRows.size(); i++) {
675  if (myAttributesCreatorRows.at(i) && myAttributesCreatorRows.at(i)->getAttrProperties().getAttr() != SUMO_ATTR_NOTHING) {
676  // flag for row enabled
677  bool rowEnabled = myAttributesCreatorRows.at(i)->isAttributesCreatorRowEnabled();
678  // flag for default attributes
679  bool hasDefaultStaticValue = !myAttributesCreatorRows.at(i)->getAttrProperties().hasStaticDefaultValue() || (myAttributesCreatorRows.at(i)->getAttrProperties().getDefaultValue() != myAttributesCreatorRows.at(i)->getValue());
680  // flag for enablitables attributes
681  bool isFlowDefinitionAttribute = myAttributesCreatorRows.at(i)->getAttrProperties().isFlowDefinition();
682  // flag for optional attributes
683  bool isActivatableAttribute = myAttributesCreatorRows.at(i)->getAttrProperties().isActivatable() && myAttributesCreatorRows.at(i)->getAttributeCheckButtonCheck();
684  // check if flags configuration allow to include values
685  if (rowEnabled && (includeAll || hasDefaultStaticValue || isFlowDefinitionAttribute || isActivatableAttribute)) {
686  values[myAttributesCreatorRows.at(i)->getAttrProperties().getAttr()] = myAttributesCreatorRows.at(i)->getValue();
687  }
688  }
689  }
690  // add extra flow attributes (only will updated if myAttributesCreatorFlow is shown)
691  myAttributesCreatorFlow->setFlowParameters(values);
692  // return values
693  return values;
694 }
695 
696 
699  return myTagProperties;
700 }
701 
702 
703 void
705  std::string errorMessage;
706  // iterate over standar parameters
707  for (const auto& i : myTagProperties) {
708  if (errorMessage.empty() && myAttributesCreatorRows.at(i.getPositionListed())) {
709  // Return string with the error if at least one of the parameter isn't valid
710  std::string attributeValue = myAttributesCreatorRows.at(i.getPositionListed())->isAttributeValid();
711  if (attributeValue.size() != 0) {
712  errorMessage = attributeValue;
713  }
714  }
715  }
716  // show warning box if input parameters aren't invalid
717  if (extra.size() == 0) {
718  errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + errorMessage;
719  } else {
720  errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + extra;
721  }
722 
723  // set message in status bar
724  myFrameParent->myViewNet->setStatusBarText(errorMessage);
725  // Write Warning in console if we're in testing mode
726  WRITE_DEBUG(errorMessage);
727 }
728 
729 
730 bool
732  // iterate over standar parameters
733  for (auto i : myTagProperties) {
734  // Return false if error message of attriuve isn't empty
735  if (myAttributesCreatorRows.at(i.getPositionListed()) && myAttributesCreatorRows.at(i.getPositionListed())->isAttributeValid().size() != 0) {
736  return false;
737  }
738  }
739  return true;
740 }
741 
742 
743 void
745  // currently only row with attribute ID must be refresh
746  if (myTagProperties.hasAttribute(SUMO_ATTR_ID) && (myTagProperties.getTag() != SUMO_TAG_VAPORIZER)) {
747  myAttributesCreatorRows[myTagProperties.getAttributeProperties(SUMO_ATTR_ID).getPositionListed()]->refreshRow();
748  }
749 }
750 
751 long
753  // open Help attributes dialog
754  myFrameParent->openHelpAttributesDialog(myTagProperties);
755  return 1;
756 }
757 
758 // ---------------------------------------------------------------------------
759 // GNEFrameAttributesModuls::AttributesCreatorFlow - methods
760 // ---------------------------------------------------------------------------
761 
763  FXGroupBox(attributesCreatorParent->getFrameParent()->myContentFrame, "Flow attributes", GUIDesignGroupBoxFrame),
764  myAttributesCreatorParent(attributesCreatorParent),
765  myFlowParameters(VEHPARS_END_SET | VEHPARS_NUMBER_SET) {
766  // declare auxiliar horizontal frame
767  FXHorizontalFrame* auxiliarHorizontalFrame = nullptr;
768  // create elements for end attribute
769  auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
770  myAttributeEndRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_END).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
771  myValueEndTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
772  // create elements for number attribute
773  auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
774  myAttributeNumberRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_NUMBER).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
775  myValueNumberTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
776  // create elements for vehsPerHour attribute
777  auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
779  myValueVehsPerHourTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
780  // create elements for period attribute
781  auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
782  myAttributePeriodRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PERIOD).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
783  myValuePeriodTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
784  // create elements for Probability attribute
785  auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
786  myAttributeProbabilityRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PROB).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
787  myValueProbabilityTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
788  // set default values
789  myValueEndTextField->setText("3600");
790  myValueNumberTextField->setText("1800");
791  myValueVehsPerHourTextField->setText("1800");
792  myValuePeriodTextField->setText("2");
793  myValueProbabilityTextField->setText("0.5");
794  // refresh attributes
796 }
797 
798 
800 
801 
802 void
804  // show
805  show();
806 }
807 
808 
809 void
811  hide();
812 }
813 
814 
815 void
817  if (myFlowParameters & VEHPARS_END_SET) {
818  myAttributeEndRadioButton->setCheck(TRUE);
819  myValueEndTextField->enable();
820  } else {
821  myAttributeEndRadioButton->setCheck(FALSE);
822  myValueEndTextField->disable();
823  }
824  if (myFlowParameters & VEHPARS_NUMBER_SET) {
825  myAttributeNumberRadioButton->setCheck(TRUE);
826  myValueNumberTextField->enable();
827  } else {
828  myAttributeNumberRadioButton->setCheck(FALSE);
829  myValueNumberTextField->disable();
830  }
831  if (myFlowParameters & VEHPARS_VPH_SET) {
832  myAttributeVehsPerHourRadioButton->setCheck(TRUE);
833  myValueVehsPerHourTextField->enable();
834  } else {
835  myAttributeVehsPerHourRadioButton->setCheck(FALSE);
836  myValueVehsPerHourTextField->disable();
837  }
838  if (myFlowParameters & VEHPARS_PERIOD_SET) {
839  myAttributePeriodRadioButton->setCheck(TRUE);
840  myValuePeriodTextField->enable();
841  } else {
842  myAttributePeriodRadioButton->setCheck(FALSE);
843  myValuePeriodTextField->disable();
844  }
845  if (myFlowParameters & VEHPARS_PROB_SET) {
846  myAttributeProbabilityRadioButton->setCheck(TRUE);
847  myValueProbabilityTextField->enable();
848  } else {
849  myAttributeProbabilityRadioButton->setCheck(FALSE);
850  myValueProbabilityTextField->disable();
851  }
852 }
853 
854 
855 void
856 GNEFrameAttributesModuls::AttributesCreatorFlow::setFlowParameters(std::map<SumoXMLAttr, std::string>& parameters) {
857  if (myFlowParameters & VEHPARS_END_SET) {
858  parameters[SUMO_ATTR_END] = myValueEndTextField->getText().text();
859  }
860  if (myFlowParameters & VEHPARS_NUMBER_SET) {
861  parameters[SUMO_ATTR_NUMBER] = myValueNumberTextField->getText().text();
862  }
863  if (myFlowParameters & VEHPARS_VPH_SET) {
864  parameters[SUMO_ATTR_VEHSPERHOUR] = myValueVehsPerHourTextField->getText().text();
865  }
866  if (myFlowParameters & VEHPARS_PERIOD_SET) {
867  parameters[SUMO_ATTR_PERIOD] = myValuePeriodTextField->getText().text();
868  }
869  if (myFlowParameters & VEHPARS_PROB_SET) {
870  parameters[SUMO_ATTR_PROB] = myValueProbabilityTextField->getText().text();
871  }
872 }
873 
874 
875 void
877  std::string errorMessage;
878  /*
879  // iterate over standar parameters
880  for (const auto& i : myTagProperties) {
881  if (errorMessage.empty() && myAttributesCreatorRows.at(i.getPositionListed())) {
882  // Return string with the error if at least one of the parameter isn't valid
883  std::string attributeValue = myAttributesCreatorRows.at(i.getPositionListed())->isAttributeValid();
884  if (attributeValue.size() != 0) {
885  errorMessage = attributeValue;
886  }
887  }
888  }
889  // show warning box if input parameters aren't invalid
890  if (extra.size() == 0) {
891  errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + errorMessage;
892  } else {
893  errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + extra;
894  }
895  */
896  // set message in status bar
897  myAttributesCreatorParent->getFrameParent()->myViewNet->setStatusBarText(errorMessage);
898  // Write Warning in console if we're in testing mode
899  WRITE_DEBUG(errorMessage);
900 }
901 
902 
903 bool
905  // check every flow attribute
906  if (myFlowParameters & VEHPARS_END_SET) {
907  if (GNEAttributeCarrier::canParse<double>(myValueEndTextField->getText().text())) {
908  if (GNEAttributeCarrier::parse<double>(myValueEndTextField->getText().text()) < 0) {
909  return false;
910  }
911  } else {
912  return false;
913  }
914  }
915  if (myFlowParameters & VEHPARS_NUMBER_SET) {
916  if (GNEAttributeCarrier::canParse<double>(myValueNumberTextField->getText().text())) {
917  if (GNEAttributeCarrier::parse<double>(myValueNumberTextField->getText().text()) < 0) {
918  return false;
919  }
920  } else {
921  return false;
922  }
923  }
924  if (myFlowParameters & VEHPARS_VPH_SET) {
925  if (GNEAttributeCarrier::canParse<double>(myValueVehsPerHourTextField->getText().text())) {
926  if (GNEAttributeCarrier::parse<double>(myValueVehsPerHourTextField->getText().text()) < 0) {
927  return false;
928  }
929  } else {
930  return false;
931  }
932  }
933  if (myFlowParameters & VEHPARS_PERIOD_SET) {
934  if (GNEAttributeCarrier::canParse<double>(myValuePeriodTextField->getText().text())) {
935  if (GNEAttributeCarrier::parse<double>(myValuePeriodTextField->getText().text()) < 0) {
936  return false;
937  }
938  } else {
939  return false;
940  }
941  }
942  if (myFlowParameters & VEHPARS_PROB_SET) {
943  if (GNEAttributeCarrier::canParse<double>(myValueProbabilityTextField->getText().text())) {
944  if (GNEAttributeCarrier::parse<double>(myValueProbabilityTextField->getText().text()) < 0) {
945  return false;
946  }
947  } else {
948  return false;
949  }
950  }
951  return true;
952 }
953 
954 
955 long
957  // obtain clicked textfield
958  FXTextField* textField = nullptr;
959  // check what text field was pressed
960  if (obj == myValueEndTextField) {
961  textField = myValueEndTextField;
962  } else if (obj == myValueNumberTextField) {
963  textField = myValueNumberTextField;
964  } else if (obj == myValueVehsPerHourTextField) {
965  textField = myValueVehsPerHourTextField;
966  } else if (obj == myValuePeriodTextField) {
967  textField = myValuePeriodTextField;
968  } else if (obj == myValueProbabilityTextField) {
969  textField = myValueProbabilityTextField;
970  } else {
971  throw ProcessError("Invalid text field");
972  }
973  // check if value is valid
974  if (GNEAttributeCarrier::canParse<double>(textField->getText().text()) && (GNEAttributeCarrier::parse<double>(textField->getText().text()) >= 0)) {
975  textField->setTextColor(FXRGB(0, 0, 0));
976  } else {
977  textField->setTextColor(FXRGB(255, 0, 0));
978  }
979  textField->killFocus();
980  return 1;
981 }
982 
983 
984 long
986  // check what check button was pressed
987  if (obj == myAttributeEndRadioButton) {
989  } else if (obj == myAttributeNumberRadioButton) {
991  } else if (obj == myAttributeVehsPerHourRadioButton) {
993  } else if (obj == myAttributePeriodRadioButton) {
995  } else if (obj == myAttributeProbabilityRadioButton) {
997  } else {
998  throw ProcessError("Invalid Radio Button");
999  }
1000  // refresh attributes
1001  refreshAttributesCreatorFlow();
1002  return 1;
1003 }
1004 
1005 // ---------------------------------------------------------------------------
1006 // GNEFrameAttributesModuls::AttributesEditorRow - methods
1007 // ---------------------------------------------------------------------------
1008 
1010  FXHorizontalFrame(attributeEditorParent, GUIDesignAuxiliarHorizontalFrame),
1011  myAttributesEditorParent(attributeEditorParent),
1012  myACAttr(ACAttr),
1013  myMultiple(GNEAttributeCarrier::parse<std::vector<std::string>>(value).size() > 1) {
1014  // Create and hide label
1015  myAttributeLabel = new FXLabel(this, "attributeLabel", nullptr, GUIDesignLabelAttribute);
1016  myAttributeLabel->hide();
1017  // Create and hide check button
1018  myAttributeCheckButton = new FXCheckButton(this, "attributeCheckButton", this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignCheckButtonAttribute);
1019  myAttributeCheckButton->hide();
1020  // Create and hide ButtonCombinableChoices
1021  myAttributeButtonCombinableChoices = new FXButton(this, "attributeButtonCombinableChoices", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute);
1023  // create and hidde color editor
1024  myAttributeColorButton = new FXButton(this, "attributeColorButton", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute);
1025  myAttributeColorButton->hide();
1026  // Create and hide textField for string attributes
1028  myValueTextField->hide();
1029  // Create and hide ComboBox
1031  myValueComboBoxChoices->hide();
1032  // Create and hide checkButton
1033  myValueCheckButton = new FXCheckButton(this, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);
1034  myValueCheckButton->hide();
1035  // only create if parent was created
1036  if (getParent()->id()) {
1037  // create AttributesEditorRow
1038  FXHorizontalFrame::create();
1039  // start enabling all elements, depending if attribute is enabled
1040  if (attributeEnabled == false) {
1041  myValueTextField->disable();
1042  myValueComboBoxChoices->disable();
1043  myValueCheckButton->disable();
1044  } else {
1045  myValueTextField->enable();
1046  myValueComboBoxChoices->enable();
1047  myValueCheckButton->enable();
1048  }
1049  // if Tag correspond to an network element but we're in demand mode (or vice versa), disable all elements
1050  if (myACAttr.getAttr() != SUMO_ATTR_NOTHING) {
1053  myAttributeColorButton->disable();
1054  myAttributeCheckButton->disable();
1055  myValueTextField->disable();
1056  myValueComboBoxChoices->disable();
1057  myValueCheckButton->disable();
1059  } else {
1061  myAttributeColorButton->enable();
1062  myAttributeCheckButton->enable();
1063  }
1064  }
1065  // set left column
1066  if (myACAttr.isColor()) {
1067  // show color button
1068  myAttributeColorButton->setTextColor(FXRGB(0, 0, 0));
1069  myAttributeColorButton->setText(myACAttr.getAttrStr().c_str());
1070  myAttributeColorButton->show();
1071  } else if (myACAttr.isActivatable()) {
1072  // show checkbox button
1073  myAttributeCheckButton->setTextColor(FXRGB(0, 0, 0));
1074  myAttributeCheckButton->setText(myACAttr.getAttrStr().c_str());
1075  myAttributeCheckButton->show();
1076  // check or uncheck depending of attributeEnabled
1077  if (attributeEnabled) {
1078  myAttributeCheckButton->setCheck(TRUE);
1079  } else {
1080  myAttributeCheckButton->setCheck(FALSE);
1081  }
1082  } else {
1083  // Show attribute Label
1084  myAttributeLabel->setText(myACAttr.getAttrStr().c_str());
1085  myAttributeLabel->show();
1086  }
1087  // Set field depending of the type of value
1088  if (myACAttr.isBool()) {
1089  // first we need to check if all boolean values are equal
1090  bool allBooleanValuesEqual = true;
1091  // declare boolean vector
1092  std::vector<bool> booleanVector;
1093  // check if value can be parsed to a boolean vector
1094  if (GNEAttributeCarrier::canParse<std::vector<bool> >(value)) {
1095  booleanVector = GNEAttributeCarrier::parse<std::vector<bool> >(value);
1096  }
1097  // iterate over pased booleans comparing all element with the first
1098  for (const auto& i : booleanVector) {
1099  if (i != booleanVector.front()) {
1100  allBooleanValuesEqual = false;
1101  }
1102  }
1103  // use checkbox or textfield depending if all booleans are equal
1104  if (allBooleanValuesEqual) {
1105  // set check button
1106  if ((booleanVector.size() > 0) && booleanVector.front()) {
1107  myValueCheckButton->setCheck(true);
1108  myValueCheckButton->setText("true");
1109  } else {
1110  myValueCheckButton->setCheck(false);
1111  myValueCheckButton->setText("false");
1112  }
1113  // show check button
1114  myValueCheckButton->show();
1115  } else {
1116  // show list of bools (0 1)
1117  myValueTextField->setText(value.c_str());
1118  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1119  myValueTextField->show();
1120  }
1121  } else if (myACAttr.isDiscrete()) {
1122  // Check if are VClasses
1123  if ((myACAttr.getDiscreteValues().size() > 0) && myACAttr.isVClasses()) {
1124  // hide label
1125  myAttributeLabel->hide();
1126  // Show button combinable choices
1129  // Show string with the values
1130  myValueTextField->setText(value.c_str());
1131  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1132  myValueTextField->show();
1133  } else if (!myMultiple) {
1134  // fill comboBox
1135  myValueComboBoxChoices->clearItems();
1136  for (const auto& it : myACAttr.getDiscreteValues()) {
1137  myValueComboBoxChoices->appendItem(it.c_str());
1138  }
1139  // show combo box with values
1140  myValueComboBoxChoices->setNumVisible((int)myACAttr.getDiscreteValues().size());
1141  myValueComboBoxChoices->setCurrentItem(myValueComboBoxChoices->findItem(value.c_str()));
1142  myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0));
1143  myValueComboBoxChoices->show();
1144  } else {
1145  // represent combinable choices in multiple selections always with a textfield instead with a comboBox
1146  myValueTextField->setText(value.c_str());
1147  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1148  myValueTextField->show();
1149  }
1150  } else {
1151  // In any other case (String, list, etc.), show value as String
1152  myValueTextField->setText(value.c_str());
1153  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1154  myValueTextField->show();
1155  }
1156  // Show AttributesEditorRow
1157  show();
1158  }
1159 }
1160 
1161 
1162 void
1164  // only destroy if parent was created
1165  if (getParent()->id()) {
1166  FXHorizontalFrame::destroy();
1167  }
1168 }
1169 
1170 
1171 void
1172 GNEFrameAttributesModuls::AttributesEditorRow::refreshAttributesEditorRow(const std::string& value, bool forceRefresh, bool attributeEnabled) {
1173  // start enabling all elements, depending if attribute is enabled
1174  if (attributeEnabled == false) {
1175  myValueTextField->disable();
1176  myValueComboBoxChoices->disable();
1177  myValueCheckButton->disable();
1178  } else {
1179  myValueTextField->enable();
1180  myValueComboBoxChoices->enable();
1181  myValueCheckButton->enable();
1182  }
1183  // if Tag correspond to an network element but we're in demand mode (or vice versa), disable all elements
1184  if (myACAttr.getAttr() != SUMO_ATTR_NOTHING) {
1185  if (((myAttributesEditorParent->getFrameParent()->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && myACAttr.getTagPropertyParent().isDemandElement()) ||
1186  ((myAttributesEditorParent->getFrameParent()->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && !myACAttr.getTagPropertyParent().isDemandElement())) {
1187  myAttributeColorButton->disable();
1188  myAttributeCheckButton->disable();
1189  myValueTextField->disable();
1190  myValueComboBoxChoices->disable();
1191  myValueCheckButton->disable();
1192  myAttributeButtonCombinableChoices->disable();
1193  } else {
1194  myAttributeButtonCombinableChoices->enable();
1195  myAttributeColorButton->enable();
1196  myAttributeCheckButton->enable();
1197  }
1198  }
1199  // set check buton
1200  if (myAttributeCheckButton->shown()) {
1201  myAttributeCheckButton->setCheck(attributeEnabled);
1202  }
1203  if (myValueTextField->shown()) {
1204  // set last valid value and restore color if onlyValid is disabled
1205  if (myValueTextField->getTextColor() == FXRGB(0, 0, 0) || forceRefresh) {
1206  myValueTextField->setText(value.c_str());
1207  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1208  }
1209  } else if (myValueComboBoxChoices->shown()) {
1210  // fill comboBox again
1211  myValueComboBoxChoices->clearItems();
1212  for (const auto& it : myACAttr.getDiscreteValues()) {
1213  myValueComboBoxChoices->appendItem(it.c_str());
1214  }
1215  // show combo box with values
1216  myValueComboBoxChoices->setNumVisible((int)myACAttr.getDiscreteValues().size());
1217  myValueComboBoxChoices->setCurrentItem(myValueComboBoxChoices->findItem(value.c_str()));
1218  myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0));
1219  myValueComboBoxChoices->show();
1220  } else if (myValueCheckButton->shown()) {
1221  if (GNEAttributeCarrier::canParse<bool>(value)) {
1222  myValueCheckButton->setCheck(GNEAttributeCarrier::parse<bool>(value));
1223  } else {
1224  myValueCheckButton->setCheck(false);
1225  }
1226  }
1227 }
1228 
1229 
1230 bool
1232  return ((myValueTextField->getTextColor() == FXRGB(0, 0, 0)) && (myValueComboBoxChoices->getTextColor() == FXRGB(0, 0, 0)));
1233 }
1234 
1235 
1236 long
1238  if (obj == myAttributeColorButton) {
1239  // create FXColorDialog
1240  FXColorDialog colordialog(this, tr("Color Dialog"));
1241  colordialog.setTarget(this);
1242  // If previous attribute wasn't correct, set black as default color
1243  if (GNEAttributeCarrier::canParse<RGBColor>(myValueTextField->getText().text())) {
1244  colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor(myValueTextField->getText().text())));
1245  } else if (!myACAttr.getDefaultValue().empty()) {
1246  colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor(myACAttr.getDefaultValue())));
1247  } else {
1248  colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::BLACK));
1249  }
1250  // execute dialog to get a new color
1251  if (colordialog.execute()) {
1252  std::string newValue = toString(MFXUtils::getRGBColor(colordialog.getRGBA()));
1253  myValueTextField->setText(newValue.c_str());
1254  if (myAttributesEditorParent->getEditedACs().front()->isValid(myACAttr.getAttr(), newValue)) {
1255  // if its valid for the first AC than its valid for all (of the same type)
1256  if (myAttributesEditorParent->getEditedACs().size() > 1) {
1257  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_begin("Change multiple attributes");
1258  }
1259  // Set new value of attribute in all selected ACs
1260  for (const auto& it_ac : myAttributesEditorParent->getEditedACs()) {
1261  it_ac->setAttribute(myACAttr.getAttr(), newValue, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1262  }
1263  // If previously value was incorrect, change font color to black
1264  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1265  myValueTextField->killFocus();
1266  }
1267  }
1268  return 0;
1269  } else if (obj == myAttributeButtonCombinableChoices) {
1270  // if its valid for the first AC than its valid for all (of the same type)
1271  if (myAttributesEditorParent->getEditedACs().size() > 1) {
1272  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_begin("Change multiple attributes");
1273  }
1274  // open GNEAllowDisallow
1275  GNEAllowDisallow(myAttributesEditorParent->getFrameParent()->myViewNet, myAttributesEditorParent->getEditedACs().front()).execute();
1276  std::string allowed = myAttributesEditorParent->getEditedACs().front()->getAttribute(SUMO_ATTR_ALLOW);
1277  // Set new value of attribute in all selected ACs
1278  for (const auto& it_ac : myAttributesEditorParent->getEditedACs()) {
1279  it_ac->setAttribute(SUMO_ATTR_ALLOW, allowed, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1280  }
1281  // finish change multiple attributes
1282  if (myAttributesEditorParent->getEditedACs().size() > 1) {
1283  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_end();
1284  }
1285  // update frame parent after attribute sucesfully set
1286  myAttributesEditorParent->getFrameParent()->attributeUpdated();
1287  return 1;
1288  } else {
1289  throw ProcessError("Invalid call to onCmdOpenAttributeDialog");
1290  }
1291 }
1292 
1293 
1294 long
1296  // Declare changed value
1297  std::string newVal;
1298  // First, obtain the string value of the new attribute depending of their type
1299  if (myACAttr.isBool()) {
1300  // first check if we're editing boolean as a list of string or as a checkbox
1301  if (myValueCheckButton->shown()) {
1302  // Set true o false depending of the checkBox
1303  if (myValueCheckButton->getCheck()) {
1304  myValueCheckButton->setText("true");
1305  newVal = "true";
1306  } else {
1307  myValueCheckButton->setText("false");
1308  newVal = "false";
1309  }
1310  } else {
1311  // obtain boolean value of myValueTextField (because we're inspecting multiple attribute carriers with different values)
1312  newVal = myValueTextField->getText().text();
1313  }
1314  } else if (myACAttr.isDiscrete()) {
1315  // Check if are VClasses
1316  if ((myACAttr.getDiscreteValues().size() > 0) && myACAttr.isVClasses()) {
1317  // Get value obtained using AttributesEditor
1318  newVal = myValueTextField->getText().text();
1319  } else if (!myMultiple) {
1320  // Get value of ComboBox
1321  newVal = myValueComboBoxChoices->getText().text();
1322  } else {
1323  // due this is a multiple selection, obtain value of myValueTextField instead of comboBox
1324  newVal = myValueTextField->getText().text();
1325  }
1326  } else {
1327  // Check if default value of attribute must be set
1328  if (myValueTextField->getText().empty() && myACAttr.hasStaticDefaultValue()) {
1329  newVal = myACAttr.getDefaultValue();
1330  myValueTextField->setText(newVal.c_str());
1331  } else if (myACAttr.isInt() && GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
1332  // filter int attributes
1333  double doubleValue = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
1334  // check if myValueTextField has to be updated
1335  if ((doubleValue - (int)doubleValue) == 0) {
1336  newVal = toString((int)doubleValue);
1337  myValueTextField->setText(newVal.c_str(), FALSE);
1338  }
1339  } else if ((myACAttr.getAttr() == SUMO_ATTR_ANGLE) && GNEAttributeCarrier::canParse<double>(myValueTextField->getText().text())) {
1340  // filter angle
1341  double angle = GNEAttributeCarrier::parse<double>(myValueTextField->getText().text());
1342  // filter if angle isn't between [0,360]
1343  if ((angle < 0) || (angle > 360)) {
1344  // apply modul
1345  angle = fmod(angle, 360);
1346  }
1347  // set newVal
1348  newVal = toString(angle);
1349  // update Textfield
1350  myValueTextField->setText(newVal.c_str(), FALSE);
1351  } else {
1352  // obtain value of myValueTextField
1353  newVal = myValueTextField->getText().text();
1354  }
1355  }
1356  // we need a extra check for Position and Shape Values, due #2658
1357  if ((myACAttr.getAttr() == SUMO_ATTR_POSITION) || (myACAttr.getAttr() == SUMO_ATTR_SHAPE)) {
1358  newVal = stripWhitespaceAfterComma(newVal);
1359  }
1360  // Check if attribute must be changed
1361  if (myAttributesEditorParent->getEditedACs().front()->isValid(myACAttr.getAttr(), newVal)) {
1362  // if its valid for the first AC than its valid for all (of the same type)
1363  if (myAttributesEditorParent->getEditedACs().size() > 1) {
1364  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_begin("Change multiple attributes");
1365  } else if (myACAttr.getAttr() == SUMO_ATTR_ID) {
1366  // IDs attribute has to be encapsulated
1367  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_begin("change " + myACAttr.getTagPropertyParent().getTagStr() + " attribute");
1368  }
1369  // Set new value of attribute in all selected ACs
1370  for (const auto& it_ac : myAttributesEditorParent->getEditedACs()) {
1371  it_ac->setAttribute(myACAttr.getAttr(), newVal, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList());
1372  }
1373  // finish change multiple attributes or ID Attributes
1374  if (myAttributesEditorParent->getEditedACs().size() > 1) {
1375  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_end();
1376  } else if (myACAttr.getAttr() == SUMO_ATTR_ID) {
1377  myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->p_end();
1378  }
1379  // If previously value was incorrect, change font color to black
1380  if (myACAttr.isVClasses()) {
1381  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1382  myValueTextField->killFocus();
1383  // in this case, we need to refresh the other values (For example, allow/Disallow objects)
1384  myAttributesEditorParent->refreshAttributeEditor(false, false);
1385  } else if (myACAttr.isDiscrete()) {
1386  myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0));
1387  myValueComboBoxChoices->killFocus();
1388  } else if (myValueTextField != nullptr) {
1389  myValueTextField->setTextColor(FXRGB(0, 0, 0));
1390  myValueTextField->killFocus();
1391  }
1392  // update frame parent after attribute sucesfully set
1393  myAttributesEditorParent->getFrameParent()->attributeUpdated();
1394  } else {
1395  // If value of TextField isn't valid, change color to Red depending of type
1396  if (myACAttr.isVClasses()) {
1397  myValueTextField->setTextColor(FXRGB(255, 0, 0));
1398  myValueTextField->killFocus();
1399  } else if (myACAttr.isDiscrete()) {
1400  myValueComboBoxChoices->setTextColor(FXRGB(255, 0, 0));
1401  myValueComboBoxChoices->killFocus();
1402  } else if (myValueTextField != nullptr) {
1403  myValueTextField->setTextColor(FXRGB(255, 0, 0));
1404  }
1405  // Write Warning in console if we're in testing mode
1406  WRITE_DEBUG("Value '" + newVal + "' for attribute " + myACAttr.getAttrStr() + " of " + myACAttr.getTagPropertyParent().getTagStr() + " isn't valid");
1407  }
1408  return 1;
1409 }
1410 
1411 
1412 long
1414  if (myAttributeCheckButton->getCheck()) {
1415  // enable input values
1416  myValueCheckButton->enable();
1417  myValueTextField->enable();
1418  } else {
1419  // disable input values
1420  myValueCheckButton->disable();
1421  myValueTextField->disable();
1422  }
1423  return 0;
1424 }
1425 
1426 
1428  myMultiple(false) {
1429 }
1430 
1431 
1432 std::string
1434  std::string result(stringValue);
1435  while (result.find(", ") != std::string::npos) {
1436  result = StringUtils::replace(result, ", ", ",");
1437  }
1438  return result;
1439 }
1440 
1441 // ---------------------------------------------------------------------------
1442 // GNEFrameAttributesModuls::AttributesEditor - methods
1443 // ---------------------------------------------------------------------------
1444 
1446  FXGroupBox(FrameParent->myContentFrame, "Internal attributes", GUIDesignGroupBoxFrame),
1447  myFrameParent(FrameParent),
1448  myIncludeExtended(true) {
1449  // resize myAttributesEditorRows
1451  // create myAttributesFlowEditor
1453  // leave it hidden
1455  // Create help button
1456  myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular);
1457 }
1458 
1459 
1460 void
1461 GNEFrameAttributesModuls::AttributesEditor::showAttributeEditorModul(const std::vector<GNEAttributeCarrier*>& ACs, bool includeExtended, bool forceAttributeEnabled) {
1462  myEditedACs = ACs;
1463  myIncludeExtended = includeExtended;
1464  // first remove all rows
1465  for (int i = 0; i < (int)myAttributesEditorRows.size(); i++) {
1466  // destroy and delete all rows
1467  if (myAttributesEditorRows.at(i) != nullptr) {
1468  myAttributesEditorRows.at(i)->destroy();
1469  delete myAttributesEditorRows.at(i);
1470  myAttributesEditorRows.at(i) = nullptr;
1471  }
1472  }
1473  // declare flag to check if flow editor has to be shown
1474  bool showFlowEditor = false;
1475  if (myEditedACs.size() > 0) {
1476  // Iterate over attributes
1477  for (const auto& tagProperty : myEditedACs.front()->getTagProperty()) {
1478  // declare flag to show/hidde atribute
1479  bool editAttribute = true;
1480  // disable editing for unique attributes in case of multi-selection
1481  if ((myEditedACs.size() > 1) && tagProperty.isUnique()) {
1482  editAttribute = false;
1483  }
1484  // disable editing of extended attributes if includeExtended isn't enabled
1485  if (tagProperty.isExtended() && !includeExtended) {
1486  editAttribute = false;
1487  }
1488  // disable editing of flow definition attributes, but enable flow editor
1489  if (tagProperty.isFlowDefinition()) {
1490  editAttribute = false;
1491  showFlowEditor = true;
1492  }
1493  // continue if attribute is editable
1494  if (editAttribute) {
1495  // Declare a set of occuring values and insert attribute's values of item (note: We use a set to avoid repeated values)
1496  std::set<std::string> occuringValues;
1497  // iterate over edited attributes
1498  for (const auto& it_ac : myEditedACs) {
1499  occuringValues.insert(it_ac->getAttribute(tagProperty.getAttr()));
1500  }
1501  // get current value
1502  std::ostringstream oss;
1503  for (auto values = occuringValues.begin(); values != occuringValues.end(); values++) {
1504  if (values != occuringValues.begin()) {
1505  oss << " ";
1506  }
1507  oss << *values;
1508  }
1509  // obtain value to be shown in row
1510  std::string value = oss.str();
1511  // declare a flag for enabled attributes
1512  bool attributeEnabled = myEditedACs.front()->isAttributeEnabled(tagProperty.getAttr());
1513  // overwritte value if attribute is disabled (used by LinkIndex)
1514  if (attributeEnabled == false) {
1515  value = myEditedACs.front()->getAlternativeValueForDisabledAttributes(tagProperty.getAttr());
1516  }
1517  // extra check for Triggered and container Triggered
1518  if (myEditedACs.front()->getTagProperty().isStop() || myEditedACs.front()->getTagProperty().isPersonStop()) {
1519  if ((tagProperty.getAttr() == SUMO_ATTR_EXPECTED) && (myEditedACs.front()->isAttributeEnabled(SUMO_ATTR_TRIGGERED) == false)) {
1520  attributeEnabled = false;
1521  } else if ((tagProperty.getAttr() == SUMO_ATTR_EXPECTED_CONTAINERS) && (myEditedACs.front()->isAttributeEnabled(SUMO_ATTR_CONTAINER_TRIGGERED) == false)) {
1522  attributeEnabled = false;
1523  }
1524  }
1525  // if forceEnablellAttribute is enable, force attributeEnabled (except for ID)
1526  if (forceAttributeEnabled && (tagProperty.getAttr() != SUMO_ATTR_ID)) {
1527  attributeEnabled = true;
1528  }
1529  // create attribute editor row
1530  myAttributesEditorRows[tagProperty.getPositionListed()] = new AttributesEditorRow(this, tagProperty, value, attributeEnabled);
1531  }
1532  }
1533  // check if Flow editor has to be shown
1534  if (showFlowEditor) {
1535  myAttributesEditorFlow->showAttributeEditorFlowModul();
1536  } else {
1537  myAttributesEditorFlow->hideAttributesEditorFlowModul();
1538  }
1539  // show AttributesEditor
1540  show();
1541  } else {
1542  myAttributesEditorFlow->hideAttributesEditorFlowModul();
1543  }
1544  // reparent help button (to place it at bottom)
1545  myHelpButton->reparent(this);
1546 }
1547 
1548 
1549 void
1551  // clear myEditedACs
1552  myEditedACs.clear();
1553  // hide AttributesEditorFlowModul
1554  myAttributesEditorFlow->hideAttributesEditorFlowModul();
1555  // hide also AttributesEditor
1556  hide();
1557 }
1558 
1559 
1560 void
1561 GNEFrameAttributesModuls::AttributesEditor::refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition) {
1562  if (myEditedACs.size() > 0) {
1563  // Iterate over attributes
1564  for (const auto& tagProperty : myEditedACs.front()->getTagProperty()) {
1565  // declare flag to show/hidde atribute
1566  bool editAttribute = true;
1567  // disable editing for unique attributes in case of multi-selection
1568  if ((myEditedACs.size() > 1) && tagProperty.isUnique()) {
1569  editAttribute = false;
1570  }
1571  // disable editing of extended attributes if includeExtended isn't enabled
1572  if (tagProperty.isExtended() && !myIncludeExtended) {
1573  editAttribute = false;
1574  }
1575  // disable editing of flow definition attributes, but enable flow editor
1576  if (tagProperty.isFlowDefinition()) {
1577  editAttribute = false;
1578  }
1579  // continue if attribute is editable
1580  if (editAttribute) {
1581  // Declare a set of occuring values and insert attribute's values of item (note: We use a set to avoid repeated values)
1582  std::set<std::string> occuringValues;
1583  // iterate over edited attributes
1584  for (const auto& it_ac : myEditedACs) {
1585  occuringValues.insert(it_ac->getAttribute(tagProperty.getAttr()));
1586  }
1587  // get current value
1588  std::ostringstream oss;
1589  for (auto values = occuringValues.begin(); values != occuringValues.end(); values++) {
1590  if (values != occuringValues.begin()) {
1591  oss << " ";
1592  }
1593  oss << *values;
1594  }
1595  // obtain value to be shown in row
1596  std::string value = oss.str();
1597  // declare a flag for enabled attributes
1598  bool attributeEnabled = myEditedACs.front()->isAttributeEnabled(tagProperty.getAttr());
1599  // overwritte value if attribute is disabled (used by LinkIndex)
1600  if (attributeEnabled == false) {
1601  value = myEditedACs.front()->getAlternativeValueForDisabledAttributes(tagProperty.getAttr());
1602  }
1603  // extra check for Triggered and container Triggered
1604  if (myEditedACs.front()->getTagProperty().isStop() || myEditedACs.front()->getTagProperty().isPersonStop()) {
1605  if ((tagProperty.getAttr() == SUMO_ATTR_EXPECTED) && (myEditedACs.front()->isAttributeEnabled(SUMO_ATTR_TRIGGERED) == false)) {
1606  attributeEnabled = false;
1607  } else if ((tagProperty.getAttr() == SUMO_ATTR_EXPECTED_CONTAINERS) && (myEditedACs.front()->isAttributeEnabled(SUMO_ATTR_CONTAINER_TRIGGERED) == false)) {
1608  attributeEnabled = false;
1609  }
1610  }
1611  /*
1612  // if forceEnablellAttribute is enable, force attributeEnabled (except for ID)
1613  if (myForceAttributeEnabled && (tagProperty.getAttr() != SUMO_ATTR_ID)) {
1614  attributeEnabled = true;
1615  }
1616  */
1617  // Check if Position or Shape refresh has to be forced
1618  if ((tagProperty.getAttr() == SUMO_ATTR_SHAPE) && forceRefreshShape) {
1619  myAttributesEditorRows[tagProperty.getPositionListed()]->refreshAttributesEditorRow(value, true, attributeEnabled);
1620  } else if ((tagProperty.getAttr() == SUMO_ATTR_POSITION) && forceRefreshPosition) {
1621  // Refresh attributes maintain invalid values
1622  myAttributesEditorRows[tagProperty.getPositionListed()]->refreshAttributesEditorRow(value, true, attributeEnabled);
1623  } else {
1624  // Refresh attributes maintain invalid values
1625  myAttributesEditorRows[tagProperty.getPositionListed()]->refreshAttributesEditorRow(value, false, attributeEnabled);
1626  }
1627  }
1628  }
1629  // check if flow editor has to be update
1630  if (myAttributesEditorFlow->isAttributesEditorFlowModulShown()) {
1631  myAttributesEditorFlow->refreshAttributeEditorFlow();
1632  }
1633  }
1634 }
1635 
1636 
1637 GNEFrame*
1639  return myFrameParent;
1640 }
1641 
1642 
1643 const std::vector<GNEAttributeCarrier*>&
1645  return myEditedACs;
1646 }
1647 
1648 
1649 void
1651  // Only remove if there is inspected ACs
1652  if (myEditedACs.size() > 0) {
1653  // Try to find AC in myACs
1654  auto i = std::find(myEditedACs.begin(), myEditedACs.end(), AC);
1655  // if was found
1656  if (i != myEditedACs.end()) {
1657  // erase AC from inspected ACs
1658  myEditedACs.erase(i);
1659  // Write Warning in console if we're in testing mode
1660  WRITE_DEBUG("Removed inspected element from Inspected ACs. " + toString(myEditedACs.size()) + " ACs remains.");
1661  // Inspect multi selection again (To refresh Modul)
1662  showAttributeEditorModul(myEditedACs, myIncludeExtended, false);
1663  }
1664  }
1665 }
1666 
1667 
1668 long
1670  // open Help attributes dialog if there is inspected ACs
1671  if (myEditedACs.size() > 0) {
1672  // open Help attributes dialog
1673  myFrameParent->openHelpAttributesDialog(myEditedACs.front()->getTagProperty());
1674  }
1675  return 1;
1676 }
1677 
1678 // ---------------------------------------------------------------------------
1679 // GNEFrameAttributesModuls::AttributesEditorFlow - methods
1680 // ---------------------------------------------------------------------------
1681 
1683  FXGroupBox(attributesEditorParent->getFrameParent()->myContentFrame, "Flow attributes", GUIDesignGroupBoxFrame),
1684  myAttributesEditorParent(attributesEditorParent) {
1685  // declare auxiliar horizontal frame
1686  FXHorizontalFrame* auxiliarHorizontalFrame = nullptr;
1687  // create elements for end attribute
1688  auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1689  myAttributeEndRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_END).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
1690  myValueEndTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1691  // create elements for number attribute
1692  auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1693  myAttributeNumberRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_NUMBER).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
1694  myValueNumberTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1695  // create elements for vehsPerHour attribute
1696  auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1698  myValueVehsPerHourTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1699  // create elements for period attribute
1700  auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1701  myAttributePeriodRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PERIOD).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
1702  myValuePeriodTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1703  // create elements for Probability attribute
1704  auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
1705  myAttributeProbabilityRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PROB).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute);
1706  myValueProbabilityTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);
1707 }
1708 
1709 
1710 void
1712  if (myAttributesEditorParent->getEditedACs().size() > 0) {
1713  // refresh attributeEditorFlowModul
1714  refreshAttributeEditorFlow();
1715  // show flow
1716  show();
1717  } else {
1718  hide();
1719  }
1720 }
1721 
1722 
1723 void
1725  // simply hide modul
1726  hide();
1727 }
1728 
1729 
1730 bool
1732  return shown();
1733 }
1734 
1735 
1736 void
1738  if (myAttributesEditorParent->getEditedACs().size() > 0) {
1739  // simply refresh every flow attribute
1740  refreshEnd();
1741  refreshNumber();
1742  refreshVehsPerHour();
1743  refreshPeriod();
1744  refreshProbability();
1745  }
1746 }
1747 
1748 
1749 long
1751  // obtain undoList (To improve code legibly)
1752  GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList();
1754  std::string value;
1755  // check what check button was pressed
1756  if (obj == myValueEndTextField) {
1757  attr = SUMO_ATTR_END;
1758  value = myValueEndTextField->getText().text();
1759  } else if (obj == myValueNumberTextField) {
1760  attr = SUMO_ATTR_NUMBER;
1761  value = myValueNumberTextField->getText().text();
1762  } else if (obj == myValueVehsPerHourTextField) {
1763  attr = SUMO_ATTR_VEHSPERHOUR;
1764  value = myValueVehsPerHourTextField->getText().text();
1765  } else if (obj == myValuePeriodTextField) {
1766  attr = SUMO_ATTR_PERIOD;
1767  value = myValuePeriodTextField->getText().text();
1768  } else if (obj == myValueProbabilityTextField) {
1769  attr = SUMO_ATTR_PROB;
1770  value = myValueProbabilityTextField->getText().text();
1771  } else {
1772  throw ProcessError("Invalid text field");
1773  }
1774  // write debug (for Netedit tests)
1775  WRITE_DEBUG("Selected checkBox for attribute '" + toString(attr) + "'");
1776  // check if we're editing multiple attributes
1777  if (myAttributesEditorParent->getEditedACs().size() > 1) {
1778  undoList->p_begin("Change multiple " + toString(attr) + " attributes");
1779  }
1780  // enable attribute with undo/redo
1781  for (const auto& i : myAttributesEditorParent->getEditedACs()) {
1782  i->setAttribute(attr, value, undoList);
1783  }
1784  // check if we're editing multiple attributes
1785  if (myAttributesEditorParent->getEditedACs().size() > 1) {
1786  undoList->p_end();
1787  }
1788  // refresh Attributes edito parent
1789  refreshAttributeEditorFlow();
1790  return 1;
1791 }
1792 
1793 
1794 long
1796  // obtain undoList (To improve code legibly)
1797  GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList();
1799  // check what check button was pressed
1800  if (obj == myAttributeEndRadioButton) {
1801  attr = SUMO_ATTR_END;
1802  } else if (obj == myAttributeNumberRadioButton) {
1803  attr = SUMO_ATTR_NUMBER;
1804  } else if (obj == myAttributeVehsPerHourRadioButton) {
1805  attr = SUMO_ATTR_VEHSPERHOUR;
1806  } else if (obj == myAttributePeriodRadioButton) {
1807  attr = SUMO_ATTR_PERIOD;
1808  } else if (obj == myAttributeProbabilityRadioButton) {
1809  attr = SUMO_ATTR_PROB;
1810  } else {
1811  throw ProcessError("Invalid Radio Button");
1812  }
1813  // write debug (for Netedit tests)
1814  WRITE_DEBUG("Selected checkBox for attribute '" + toString(attr) + "'");
1815  // begin undo list
1816  if (myAttributesEditorParent->getEditedACs().size() > 1) {
1817  undoList->p_begin("enable multiple " + toString(attr) + " attributes");
1818  } else {
1819  undoList->p_begin("enable attribute '" + toString(attr) + "'");
1820  }
1821  // enable attribute with undo/redo
1822  for (const auto& i : myAttributesEditorParent->getEditedACs()) {
1823  i->enableAttribute(attr, undoList);
1824  }
1825  // end undoList
1826  undoList->p_end();
1827  // refresh Attributes edito parent
1828  refreshAttributeEditorFlow();
1829  return 1;
1830 }
1831 
1832 
1833 void
1835  // first we need to check if all attributes are enabled or disabled
1836  int allAttributesEnabledOrDisabled = 0;
1837  for (const auto& i : myAttributesEditorParent->getEditedACs()) {
1838  allAttributesEnabledOrDisabled += i->isAttributeEnabled(SUMO_ATTR_END);
1839  }
1840  if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getEditedACs().size()) {
1841  // Declare a set of occuring values and insert attribute's values of item
1842  std::set<std::string> occuringValues;
1843  for (const auto& values : myAttributesEditorParent->getEditedACs()) {
1844  occuringValues.insert(values->getAttribute(SUMO_ATTR_END));
1845  }
1846  // get current value
1847  std::ostringstream endValue;
1848  for (auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
1849  if (it_val != occuringValues.begin()) {
1850  endValue << " ";
1851  }
1852  endValue << *it_val;
1853  }
1854  // set radio button and text field
1855  myValueEndTextField->enable();
1856  myValueEndTextField->setText(endValue.str().c_str());
1857  myAttributeEndRadioButton->setCheck(TRUE);
1858  } else {
1859  // disable radio button and text field
1860  myValueEndTextField->disable();
1861  // check if we set an special value in textField
1862  if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getEditedACs().size() > 1)) {
1863  myValueEndTextField->setText("Different flow attributes");
1864  } else if (myAttributesEditorParent->getEditedACs().size() == 1) {
1865  myValueEndTextField->setText(myAttributesEditorParent->getEditedACs().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_END).c_str());
1866  } else {
1867  myValueEndTextField->setText("");
1868  }
1869  myAttributeEndRadioButton->setCheck(FALSE);
1870  }
1871 }
1872 
1873 
1874 void
1876  // first we need to check if all attributes are enabled or disabled
1877  int allAttributesEnabledOrDisabled = 0;
1878  for (const auto& i : myAttributesEditorParent->getEditedACs()) {
1879  allAttributesEnabledOrDisabled += i->isAttributeEnabled(SUMO_ATTR_NUMBER);
1880  }
1881  if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getEditedACs().size()) {
1882  // Declare a set of occuring values and insert attribute's values of item
1883  std::set<std::string> occuringValues;
1884  for (const auto& values : myAttributesEditorParent->getEditedACs()) {
1885  occuringValues.insert(values->getAttribute(SUMO_ATTR_NUMBER));
1886  }
1887  // get current value
1888  std::ostringstream numberValues;
1889  for (auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
1890  if (it_val != occuringValues.begin()) {
1891  numberValues << " ";
1892  }
1893  numberValues << *it_val;
1894  }
1895  // set radio button and text field
1896  myValueNumberTextField->enable();
1897  myValueNumberTextField->setText(numberValues.str().c_str());
1898  myAttributeNumberRadioButton->setCheck(TRUE);
1899  } else {
1900  // disable radio button
1901  myValueNumberTextField->disable();
1902  // check if we set an special value in textField
1903  if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getEditedACs().size() > 1)) {
1904  myValueNumberTextField->setText("Different flow attributes");
1905  } else if (myAttributesEditorParent->getEditedACs().size() == 1) {
1906  myValueNumberTextField->setText(myAttributesEditorParent->getEditedACs().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_NUMBER).c_str());
1907  } else {
1908  myValueNumberTextField->setText("");
1909  }
1910  myAttributeNumberRadioButton->setCheck(FALSE);
1911  }
1912 }
1913 
1914 
1915 void
1917  // first we need to check if all attributes are enabled or disabled
1918  int allAttributesEnabledOrDisabled = 0;
1919  for (const auto& i : myAttributesEditorParent->getEditedACs()) {
1920  allAttributesEnabledOrDisabled += i->isAttributeEnabled(SUMO_ATTR_VEHSPERHOUR);
1921  }
1922  if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getEditedACs().size()) {
1923  // Declare a set of occuring values and insert attribute's values of item
1924  std::set<std::string> occuringValues;
1925  for (const auto& values : myAttributesEditorParent->getEditedACs()) {
1926  occuringValues.insert(values->getAttribute(SUMO_ATTR_VEHSPERHOUR));
1927  }
1928  // get current value
1929  std::ostringstream vehsPerHourValues;
1930  for (auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
1931  if (it_val != occuringValues.begin()) {
1932  vehsPerHourValues << " ";
1933  }
1934  vehsPerHourValues << *it_val;
1935  }
1936  // set radio button and text field
1937  myValueVehsPerHourTextField->enable();
1938  myValueVehsPerHourTextField->setText(vehsPerHourValues.str().c_str());
1939  myAttributeVehsPerHourRadioButton->setCheck(TRUE);
1940  } else {
1941  // disable radio button
1942  myValueVehsPerHourTextField->disable();
1943  // check if we set an special value in textField
1944  if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getEditedACs().size() > 1)) {
1945  myValueVehsPerHourTextField->setText("Different flow attributes");
1946  } else if (myAttributesEditorParent->getEditedACs().size() == 1) {
1947  myValueVehsPerHourTextField->setText(myAttributesEditorParent->getEditedACs().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_VEHSPERHOUR).c_str());
1948  } else {
1949  myValueVehsPerHourTextField->setText("");
1950  }
1951  myAttributeVehsPerHourRadioButton->setCheck(FALSE);
1952  }
1953 }
1954 
1955 
1956 void
1958  // first we need to check if all attributes are enabled or disabled
1959  int allAttributesEnabledOrDisabled = 0;
1960  for (const auto& i : myAttributesEditorParent->getEditedACs()) {
1961  allAttributesEnabledOrDisabled += i->isAttributeEnabled(SUMO_ATTR_PERIOD);
1962  }
1963  if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getEditedACs().size()) {
1964  // Declare a set of occuring values and insert attribute's values of item
1965  std::set<std::string> occuringValues;
1966  for (const auto& values : myAttributesEditorParent->getEditedACs()) {
1967  occuringValues.insert(values->getAttribute(SUMO_ATTR_PERIOD));
1968  }
1969  // get current value
1970  std::ostringstream periodValues;
1971  for (auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
1972  if (it_val != occuringValues.begin()) {
1973  periodValues << " ";
1974  }
1975  periodValues << *it_val;
1976  }
1977  // set radio button and text field
1978  myValuePeriodTextField->enable();
1979  myValuePeriodTextField->setText(periodValues.str().c_str());
1980  myAttributePeriodRadioButton->setCheck(TRUE);
1981  } else {
1982  // disable radio button and text field
1983  myValuePeriodTextField->disable();
1984  // check if we set an special value in textField
1985  if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getEditedACs().size() > 1)) {
1986  myValuePeriodTextField->setText("Different flow attributes");
1987  } else if (myAttributesEditorParent->getEditedACs().size() == 1) {
1988  myValuePeriodTextField->setText(myAttributesEditorParent->getEditedACs().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_PERIOD).c_str());
1989  } else {
1990  myValuePeriodTextField->setText("");
1991  }
1992  myAttributePeriodRadioButton->setCheck(FALSE);
1993  }
1994 }
1995 
1996 
1997 void
1999  // first we need to check if all attributes are enabled or disabled
2000  int allAttributesEnabledOrDisabled = 0;
2001  for (const auto& i : myAttributesEditorParent->getEditedACs()) {
2002  allAttributesEnabledOrDisabled += i->isAttributeEnabled(SUMO_ATTR_PROB);
2003  }
2004  if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getEditedACs().size()) {
2005  // Declare a set of occuring values and insert attribute's values of item
2006  std::set<std::string> occuringValues;
2007  for (const auto& values : myAttributesEditorParent->getEditedACs()) {
2008  occuringValues.insert(values->getAttribute(SUMO_ATTR_PROB));
2009  }
2010  // get current value
2011  std::ostringstream probabilityValues;
2012  for (auto it_val = occuringValues.begin(); it_val != occuringValues.end(); it_val++) {
2013  if (it_val != occuringValues.begin()) {
2014  probabilityValues << " ";
2015  }
2016  probabilityValues << *it_val;
2017  }
2018  // set radio button and text field
2019  myValueProbabilityTextField->enable();
2020  myValueProbabilityTextField->setText(probabilityValues.str().c_str());
2021  myAttributeProbabilityRadioButton->enable();
2022  myAttributeProbabilityRadioButton->setCheck(TRUE);
2023  } else {
2024  // disable radio button and text field
2025  myValueProbabilityTextField->disable();
2026  // check if we set an special value in textField
2027  if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getEditedACs().size() > 1)) {
2028  myValueProbabilityTextField->setText("Different flow attributes");
2029  } else if (myAttributesEditorParent->getEditedACs().size() == 1) {
2030  myValueProbabilityTextField->setText(myAttributesEditorParent->getEditedACs().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_PROB).c_str());
2031  } else {
2032  myValueProbabilityTextField->setText("");
2033  }
2034  myAttributeProbabilityRadioButton->setCheck(FALSE);
2035  }
2036 }
2037 
2038 // ---------------------------------------------------------------------------
2039 // GNEFrameAttributesModuls::AttributesEditorExtended- methods
2040 // ---------------------------------------------------------------------------
2041 
2043  FXGroupBox(frameParent->myContentFrame, "Extended attributes", GUIDesignGroupBoxFrame),
2044  myFrameParent(frameParent) {
2045  // Create open dialog button
2046  new FXButton(this, "Open attributes editor", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButton);
2047 }
2048 
2049 
2051 
2052 
2053 void
2055  show();
2056 }
2057 
2058 
2059 void
2061  hide();
2062 }
2063 
2064 
2065 long
2067  // open AttributesCreator extended dialog
2068  myFrameParent->attributesEditorExtendedDialogOpened();
2069  return 1;
2070 }
2071 
2072 // ---------------------------------------------------------------------------
2073 // GNEFrameAttributesModuls::ParametersEditor - methods
2074 // ---------------------------------------------------------------------------
2075 
2077  FXGroupBox(inspectorFrameParent->myContentFrame, "Parameters", GUIDesignGroupBoxFrame),
2078  myFrameParent(inspectorFrameParent),
2079  myAC(nullptr) {
2080  // create textfield and buttons
2082  myButtonEditParameters = new FXButton(this, "Edit parameters", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButton);
2083 }
2084 
2085 
2087 
2088 
2089 void
2091  if ((AC != nullptr) && AC->getTagProperty().hasParameters()) {
2092  myAC = AC;
2093  myACs.clear();
2094  // obtain a copy of AC parameters
2095  if (myAC) {
2096  // obtain string
2097  std::string parametersStr = myAC->getAttribute(GNE_ATTR_PARAMETERS);
2098  // clear parameters
2099  myParameters.clear();
2100  // separate value in a vector of string using | as separator
2101  StringTokenizer parameters(parametersStr, "|", true);
2102  // iterate over all values
2103  while (parameters.hasNext()) {
2104  // obtain key and value and save it in myParameters
2105  const std::vector<std::string> keyValue = StringTokenizer(parameters.next(), "=", true).getVector();
2106  if (keyValue.size() == 2) {
2107  myParameters[keyValue.front()] = keyValue.back();
2108  }
2109  }
2110  }
2111  // refresh ParametersEditor
2112  refreshParametersEditor();
2113  // show groupbox
2114  show();
2115  } else {
2116  hide();
2117  }
2118 }
2119 
2120 
2121 void
2123  if ((ACs.size() > 0) && ACs.front()->getTagProperty().hasParameters()) {
2124  myAC = nullptr;
2125  myACs = ACs;
2126  // check if parameters are different
2127  bool differentsParameters = false;
2128  std::string firstParameters = myACs.front()->getAttribute(GNE_ATTR_PARAMETERS);
2129  for (auto i : myACs) {
2130  if (firstParameters != i->getAttribute(GNE_ATTR_PARAMETERS)) {
2131  differentsParameters = true;
2132  }
2133  }
2134  // set parameters editor
2135  if (differentsParameters) {
2136  myParameters.clear();
2137  } else {
2138  // obtain string
2139  std::string parametersStr = myACs.front()->getAttribute(GNE_ATTR_PARAMETERS);
2140  // clear parameters
2141  myParameters.clear();
2142  // separate value in a vector of string using | as separator
2143  std::vector<std::string> parameters = StringTokenizer(parametersStr, "|", true).getVector();
2144  // iterate over all values
2145  for (const auto& i : parameters) {
2146  // obtain key and value and save it in myParameters
2147  std::vector<std::string> keyValue = StringTokenizer(i, "=", true).getVector();
2148  myParameters[keyValue.front()] = keyValue.back();
2149  }
2150  }
2151  // refresh ParametersEditor
2152  refreshParametersEditor();
2153  // show groupbox
2154  show();
2155  } else {
2156  hide();
2157  }
2158 }
2159 
2160 
2161 void
2163  myAC = nullptr;
2164  // hide groupbox
2165  hide();
2166 }
2167 
2168 
2169 void
2171  // update text field depending of AC
2172  if (myAC) {
2173  myTextFieldParameters->setText(myAC->getAttribute(GNE_ATTR_PARAMETERS).c_str());
2174  myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
2175  // disable myTextFieldParameters if Tag correspond to an network element but we're in demand mode (or vice versa), disable all elements
2176  if (((myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && myAC->getTagProperty().isDemandElement()) ||
2177  ((myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && !myAC->getTagProperty().isDemandElement())) {
2178  myTextFieldParameters->disable();
2179  myButtonEditParameters->disable();
2180  } else {
2181  myTextFieldParameters->enable();
2182  myButtonEditParameters->enable();
2183  }
2184  } else if (myACs.size() > 0) {
2185  // check if parameters of all inspected ACs are different
2186  std::string parameters = myACs.front()->getAttribute(GNE_ATTR_PARAMETERS);
2187  for (auto i : myACs) {
2188  if (parameters != i->getAttribute(GNE_ATTR_PARAMETERS)) {
2189  parameters = "different parameters";
2190  }
2191  }
2192  myTextFieldParameters->setText(parameters.c_str());
2193  myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
2194  // disable myTextFieldParameters if we're in demand mode and inspected AC isn't a demand element (or viceversa)
2195  if (((myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && myACs.front()->getTagProperty().isDemandElement()) ||
2196  ((myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && !myACs.front()->getTagProperty().isDemandElement())) {
2197  myTextFieldParameters->disable();
2198  myButtonEditParameters->disable();
2199  } else {
2200  myTextFieldParameters->enable();
2201  myButtonEditParameters->enable();
2202  }
2203  }
2204 }
2205 
2206 
2207 const std::map<std::string, std::string>&
2209  return myParameters;
2210 }
2211 
2212 
2213 std::string
2215  std::string result;
2216  // Generate an string using the following structure: "key1=value1|key2=value2|...
2217  for (const auto& i : myParameters) {
2218  result += i.first + "=" + i.second + "|";
2219  }
2220  // remove the last "|"
2221  if (!result.empty()) {
2222  result.pop_back();
2223  }
2224  return result;
2225 }
2226 
2227 std::vector<std::pair<std::string, std::string> >
2229  std::vector<std::pair<std::string, std::string> > result;
2230  // Generate an vector string using the following structure: "<key1,value1>, <key2, value2>,...
2231  for (const auto& i : myParameters) {
2232  result.push_back(std::make_pair(i.first, i.second));
2233  }
2234  return result;
2235 }
2236 
2237 
2238 void
2239 GNEFrameAttributesModuls::ParametersEditor::setParameters(const std::vector<std::pair<std::string, std::string> >& parameters) {
2240  // declare result string
2241  std::string result;
2242  // Generate an string using the following structure: "key1=value1|key2=value2|...
2243  for (const auto& i : parameters) {
2244  result += i.first + "=" + i.second + "|";
2245  }
2246  // remove the last "|"
2247  if (!result.empty()) {
2248  result.pop_back();
2249  }
2250  // set result in textField (and call onCmdEditParameters)
2251  myTextFieldParameters->setText(result.c_str(), TRUE);
2252 }
2253 
2254 
2255 GNEFrame*
2257  return myFrameParent;
2258 }
2259 
2260 
2261 long
2263  // write debug information
2264  WRITE_DEBUG("Open parameters dialog");
2265  // edit parameters using dialog
2266  if (GNEParametersDialog(this).execute()) {
2267  // write debug information
2268  WRITE_DEBUG("Close parameters dialog");
2269  // set values edited in Parameter dialog in Edited AC
2270  if (myAC) {
2271  myAC->setAttribute(GNE_ATTR_PARAMETERS, getParametersStr(), myFrameParent->myViewNet->getUndoList());
2272  } else if (myACs.size() > 0) {
2273  myFrameParent->myViewNet->getUndoList()->p_begin("Change multiple parameters");
2274  for (auto i : myACs) {
2275  i->setAttribute(GNE_ATTR_PARAMETERS, getParametersStr(), myFrameParent->myViewNet->getUndoList());
2276  }
2277  myFrameParent->myViewNet->getUndoList()->p_end();
2278  // update frame parent after attribute sucesfully set
2279  myFrameParent->attributeUpdated();
2280  }
2281  // Refresh parameter editor
2282  refreshParametersEditor();
2283  } else {
2284  // write debug information
2285  WRITE_DEBUG("Cancel parameters dialog");
2286  }
2287  return 1;
2288 }
2289 
2290 
2291 long
2293  // check if current given string is valid
2294  if (Parameterised::areParametersValid(myTextFieldParameters->getText().text(), true) == false) {
2295  myTextFieldParameters->setTextColor(FXRGB(255, 0, 0));
2296  } else {
2297  // parsed parameters ok, then set text field black and continue
2298  myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
2299  myTextFieldParameters->killFocus();
2300  // obtain parameters "key=value"
2301  std::vector<std::string> parameters = StringTokenizer(myTextFieldParameters->getText().text(), "|", true).getVector();
2302  // clear current existent parameters and set parsed parameters
2303  myParameters.clear();
2304  // iterate over parameters
2305  for (const auto& i : parameters) {
2306  // obtain key, value
2307  std::vector<std::string> keyParam = StringTokenizer(i, "=", true).getVector();
2308  // save it in myParameters
2309  myParameters[keyParam.front()] = keyParam.back();
2310  }
2311  // overwritte myTextFieldParameters (to remove duplicated parameters
2312  myTextFieldParameters->setText(getParametersStr().c_str(), FALSE);
2313  // if we're editing parameters of an AttributeCarrier, set it
2314  if (myAC) {
2315  // begin undo list
2316  myFrameParent->myViewNet->getUndoList()->p_begin("change parameters");
2317  // set parameters
2318  myAC->setAttribute(GNE_ATTR_PARAMETERS, getParametersStr(), myFrameParent->myViewNet->getUndoList());
2319  // end undo list
2320  myFrameParent->myViewNet->getUndoList()->p_end();
2321  } else if (myACs.size() > 0) {
2322  // begin undo list
2323  myFrameParent->myViewNet->getUndoList()->p_begin("change multiple parameters");
2324  // set parameters in all ACs
2325  for (const auto& i : myACs) {
2326  i->setAttribute(GNE_ATTR_PARAMETERS, getParametersStr(), myFrameParent->myViewNet->getUndoList());
2327  }
2328  // end undo list
2329  myFrameParent->myViewNet->getUndoList()->p_end();
2330  // update frame parent after attribute sucesfully set
2331  myFrameParent->attributeUpdated();
2332  }
2333  }
2334  return 1;
2335 }
2336 
2337 // ---------------------------------------------------------------------------
2338 // GNEFrameAttributesModuls::DrawingShape - methods
2339 // ---------------------------------------------------------------------------
2340 
2342  FXGroupBox(frameParent->myContentFrame, "Drawing", GUIDesignGroupBoxFrame),
2343  myFrameParent(frameParent),
2344  myDeleteLastCreatedPoint(false) {
2345  // create start and stop buttons
2346  myStartDrawingButton = new FXButton(this, "Start drawing", 0, this, MID_GNE_STARTDRAWING, GUIDesignButton);
2347  myStopDrawingButton = new FXButton(this, "Stop drawing", 0, this, MID_GNE_STOPDRAWING, GUIDesignButton);
2348  myAbortDrawingButton = new FXButton(this, "Abort drawing", 0, this, MID_GNE_ABORTDRAWING, GUIDesignButton);
2349  // create information label
2350  std::ostringstream information;
2351  information
2352  << "- 'Start drawing' or ENTER\n"
2353  << " draws shape boundary.\n"
2354  << "- 'Stop drawing' or ENTER\n"
2355  << " creates shape.\n"
2356  << "- 'Shift + Click'removes\n"
2357  << " last created point.\n"
2358  << "- 'Abort drawing' or ESC\n"
2359  << " removes drawed shape.";
2360  myInformationLabel = new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelFrameInformation);
2361  // disable stop and abort functions as init
2362  myStopDrawingButton->disable();
2363  myAbortDrawingButton->disable();
2364 }
2365 
2366 
2368 
2369 
2371  // abort current drawing before show
2372  abortDrawing();
2373  // show FXGroupBox
2374  FXGroupBox::show();
2375 }
2376 
2377 
2379  // abort current drawing before hide
2380  abortDrawing();
2381  // show FXGroupBox
2382  FXGroupBox::hide();
2383 }
2384 
2385 
2386 void
2388  // Only start drawing if DrawingShape modul is shown
2389  if (shown()) {
2390  // change buttons
2391  myStartDrawingButton->disable();
2392  myStopDrawingButton->enable();
2393  myAbortDrawingButton->enable();
2394  }
2395 }
2396 
2397 
2398 void
2400  // try to build shape
2401  if (myFrameParent->shapeDrawed()) {
2402  // clear created points
2403  myTemporalShapeShape.clear();
2404  myFrameParent->myViewNet->update();
2405  // change buttons
2406  myStartDrawingButton->enable();
2407  myStopDrawingButton->disable();
2408  myAbortDrawingButton->disable();
2409  } else {
2410  // abort drawing if shape cannot be created
2411  abortDrawing();
2412  }
2413 }
2414 
2415 
2416 void
2418  // clear created points
2419  myTemporalShapeShape.clear();
2420  myFrameParent->myViewNet->update();
2421  // change buttons
2422  myStartDrawingButton->enable();
2423  myStopDrawingButton->disable();
2424  myAbortDrawingButton->disable();
2425 }
2426 
2427 
2428 void
2430  if (myStopDrawingButton->isEnabled()) {
2431  myTemporalShapeShape.push_back(P);
2432  } else {
2433  throw ProcessError("A new point cannot be added if drawing wasn't started");
2434  }
2435 }
2436 
2437 
2438 void
2440 
2441 }
2442 
2443 
2444 const PositionVector&
2446  return myTemporalShapeShape;
2447 }
2448 
2449 
2450 bool
2452  return myStopDrawingButton->isEnabled();
2453 }
2454 
2455 
2456 void
2458  myDeleteLastCreatedPoint = value;
2459 }
2460 
2461 
2462 bool
2464  return myDeleteLastCreatedPoint;
2465 }
2466 
2467 
2468 long
2470  startDrawing();
2471  return 0;
2472 }
2473 
2474 
2475 long
2477  stopDrawing();
2478  return 0;
2479 }
2480 
2481 
2482 long
2484  abortDrawing();
2485  return 0;
2486 }
2487 
2488 // ---------------------------------------------------------------------------
2489 // GNEFrameAttributesModuls::NeteditAttributes- methods
2490 // ---------------------------------------------------------------------------
2491 
2493  FXGroupBox(frameParent->myContentFrame, "Netedit attributes", GUIDesignGroupBoxFrame),
2494  myFrameParent(frameParent),
2495  myCurrentLengthValid(true),
2496  myActualAdditionalReferencePoint(GNE_ADDITIONALREFERENCEPOINT_LEFT) {
2497  // Create FXListBox for the reference points and fill it
2499  myReferencePointMatchBox->appendItem("reference left");
2500  myReferencePointMatchBox->appendItem("reference right");
2501  myReferencePointMatchBox->appendItem("reference center");
2502  // Create Frame for Length Label and textField
2503  myLengthFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
2506  myLengthTextField->setText("10");
2507  // Create Frame for block movement label and checkBox (By default disabled)
2508  myBlockMovementFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
2509  new FXLabel(myBlockMovementFrame, "block move", 0, GUIDesignLabelAttribute);
2511  myBlockMovementCheckButton->setCheck(false);
2512  // Create Frame for block shape label and checkBox (By default disabled)
2513  myBlockShapeFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
2514  new FXLabel(myBlockShapeFrame, "block shape", 0, GUIDesignLabelAttribute);
2516  // Create Frame for block close polygon and checkBox (By default disabled)
2517  myCloseShapeFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame);
2518  new FXLabel(myCloseShapeFrame, "Close shape", 0, GUIDesignLabelAttribute);
2520  myBlockShapeCheckButton->setCheck(false);
2521  // Create Frame for center element after creation (By default enabled)
2523  new FXLabel(myCenterViewAfterCreationFrame, "Center view", 0, GUIDesignLabelAttribute);
2525  myCenterViewAfterCreationButton->setCheck(true);
2526  // Create help button
2527  helpReferencePoint = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular);
2528  // Set visible items
2529  myReferencePointMatchBox->setNumVisible((int)myReferencePointMatchBox->getNumItems());
2530 }
2531 
2532 
2534 
2535 
2536 void
2538  // we assume that frame will not be show
2539  bool showFrame = false;
2540  // check if length text field has to be showed
2541  if (tagProperty.canMaskStartEndPos()) {
2542  myLengthFrame->show();
2543  myReferencePointMatchBox->show();
2544  showFrame = true;
2545  } else {
2546  myLengthFrame->hide();
2547  myReferencePointMatchBox->hide();
2548  }
2549  // check if block movement check button has to be show
2550  if (tagProperty.canBlockMovement()) {
2551  myBlockMovementFrame->show();
2552  showFrame = true;
2553  } else {
2554  myBlockMovementFrame->hide();
2555  }
2556  // check if block shape check button has to be show
2557  if (tagProperty.canBlockShape()) {
2558  myBlockShapeFrame->show();
2559  showFrame = true;
2560  } else {
2561  myBlockShapeFrame->hide();
2562  }
2563  // check if close shape check button has to be show
2564  if (tagProperty.canCloseShape()) {
2565  myCloseShapeFrame->show();
2566  showFrame = true;
2567  } else {
2568  myCloseShapeFrame->hide();
2569  }
2570  // check if center camera after creation check button has to be show
2571  if (tagProperty.canCenterCameraAfterCreation()) {
2572  myCenterViewAfterCreationFrame->show();
2573  showFrame = true;
2574  } else {
2575  myCenterViewAfterCreationFrame->hide();
2576  }
2577  // if at least one element is show, show modul
2578  if (showFrame) {
2579  recalc();
2580  show();
2581  } else {
2582  hide();
2583  }
2584 }
2585 
2586 
2587 void
2589  hide();
2590 }
2591 
2592 
2593 bool
2594 GNEFrameAttributesModuls::NeteditAttributes::getNeteditAttributesAndValues(std::map<SumoXMLAttr, std::string>& valuesMap, const GNELane* lane) const {
2595  // check if we need to obtain a start and end position over an edge
2596  if (myReferencePointMatchBox->shown()) {
2597  // we need a valid lane to calculate position over lane
2598  if (lane == nullptr) {
2599  return false;
2600  } else if (myCurrentLengthValid) {
2601  // Obtain position of the mouse over lane (limited over grid)
2602  double mousePositionOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->myViewNet->snapToActiveGrid(myFrameParent->myViewNet->getPositionInformation())) / lane->getLengthGeometryFactor();
2603  // check if current reference point is valid
2604  if (myActualAdditionalReferencePoint == GNE_ADDITIONALREFERENCEPOINT_INVALID) {
2605  std::string errorMessage = "Current selected reference point isn't valid";
2606  myFrameParent->myViewNet->setStatusBarText(errorMessage);
2607  // Write Warning in console if we're in testing mode
2608  WRITE_DEBUG(errorMessage);
2609  return false;
2610  } else {
2611  // obtain length
2612  double length = GNEAttributeCarrier::parse<double>(myLengthTextField->getText().text());
2613  // set start and end position
2614  valuesMap[SUMO_ATTR_STARTPOS] = toString(setStartPosition(mousePositionOverLane, length));
2615  valuesMap[SUMO_ATTR_ENDPOS] = toString(setEndPosition(mousePositionOverLane, length));
2616  }
2617  } else {
2618  return false;
2619  }
2620  }
2621  // Save block value if element can be blocked
2622  if (myBlockMovementCheckButton->shown()) {
2623  if (myBlockMovementCheckButton->getCheck() == 1) {
2624  valuesMap[GNE_ATTR_BLOCK_MOVEMENT] = "1";
2625  } else {
2626  valuesMap[GNE_ATTR_BLOCK_MOVEMENT] = "0";
2627  }
2628  }
2629  // Save block shape value if shape's element can be blocked
2630  if (myBlockShapeCheckButton->shown()) {
2631  if (myBlockShapeCheckButton->getCheck() == 1) {
2632  valuesMap[GNE_ATTR_BLOCK_SHAPE] = "1";
2633  } else {
2634  valuesMap[GNE_ATTR_BLOCK_SHAPE] = "0";
2635  }
2636  }
2637  // Save close shape value if shape's element can be closed
2638  if (myCloseShapeCheckButton->shown()) {
2639  if (myCloseShapeCheckButton->getCheck() == 1) {
2640  valuesMap[GNE_ATTR_CLOSE_SHAPE] = "1";
2641  } else {
2642  valuesMap[GNE_ATTR_CLOSE_SHAPE] = "0";
2643  }
2644  }
2645  // check center element after creation
2646  if (myCenterViewAfterCreationButton->shown() && (myCenterViewAfterCreationButton->getCheck() == 1)) {
2647  valuesMap[GNE_ATTR_CENTER_AFTER_CREATION] = "1";
2648  }
2649  // all ok, then return true to continue creating element
2650  return true;
2651 }
2652 
2653 
2654 long
2656  if (obj == myBlockMovementCheckButton) {
2657  if (myBlockMovementCheckButton->getCheck()) {
2658  myBlockMovementCheckButton->setText("true");
2659  } else {
2660  myBlockMovementCheckButton->setText("false");
2661  }
2662  } else if (obj == myBlockShapeCheckButton) {
2663  if (myBlockShapeCheckButton->getCheck()) {
2664  myBlockShapeCheckButton->setText("true");
2665  } else {
2666  myBlockShapeCheckButton->setText("false");
2667  }
2668  } else if (obj == myCloseShapeCheckButton) {
2669  if (myCloseShapeCheckButton->getCheck()) {
2670  myCloseShapeCheckButton->setText("true");
2671  } else {
2672  myCloseShapeCheckButton->setText("false");
2673  }
2674  } else if (obj == myCenterViewAfterCreationButton) {
2675  if (myCenterViewAfterCreationButton->getCheck()) {
2676  myCenterViewAfterCreationButton->setText("true");
2677  } else {
2678  myCenterViewAfterCreationButton->setText("false");
2679  }
2680  } else if (obj == myLengthTextField) {
2681  // change color of text field depending of the input length
2682  if (GNEAttributeCarrier::canParse<double>(myLengthTextField->getText().text()) &&
2683  GNEAttributeCarrier::parse<double>(myLengthTextField->getText().text()) > 0) {
2684  myLengthTextField->setTextColor(FXRGB(0, 0, 0));
2685  myLengthTextField->killFocus();
2686  myCurrentLengthValid = true;
2687  } else {
2688  myLengthTextField->setTextColor(FXRGB(255, 0, 0));
2689  myCurrentLengthValid = false;
2690  }
2691  // Update aditional frame
2692  update();
2693  } else if (obj == myReferencePointMatchBox) {
2694  // Cast actual reference point type
2695  if (myReferencePointMatchBox->getText() == "reference left") {
2696  myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2697  myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_LEFT;
2698  myLengthTextField->enable();
2699  } else if (myReferencePointMatchBox->getText() == "reference right") {
2700  myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2701  myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_RIGHT;
2702  myLengthTextField->enable();
2703  } else if (myReferencePointMatchBox->getText() == "reference center") {
2704  myLengthTextField->enable();
2705  myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0));
2706  myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_CENTER;
2707  myLengthTextField->enable();
2708  } else {
2709  myReferencePointMatchBox->setTextColor(FXRGB(255, 0, 0));
2710  myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_INVALID;
2711  myLengthTextField->disable();
2712  }
2713  }
2714 
2715  return 1;
2716 }
2717 
2718 
2719 long
2721  // Create dialog box
2722  FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(this, "Netedit Parameters Help", GUIDesignDialogBox);
2723  additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(ICON_MODEADDITIONAL));
2724  // set help text
2725  std::ostringstream help;
2726  help
2727  << "- Referece point: Mark the initial position of the additional element.\n"
2728  << " Example: If you want to create a busStop with a length of 30 in the point 100 of the lane:\n"
2729  << " - Reference Left will create it with startPos = 70 and endPos = 100.\n"
2730  << " - Reference Right will create it with startPos = 100 and endPos = 130.\n"
2731  << " - Reference Center will create it with startPos = 85 and endPos = 115.\n"
2732  << "\n"
2733  << "- Block movement: if is enabled, the created additional element will be blocked. i.e. cannot be moved with\n"
2734  << " the mouse. This option can be modified inspecting element.\n"
2735  << "- Center view: if is enabled, view will be center over created element.";
2736  // Create label with the help text
2737  new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), 0, GUIDesignLabelFrameInformation);
2738  // Create horizontal separator
2739  new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator);
2740  // Create frame for OK Button
2741  FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame);
2742  // Create Button Close (And two more horizontal frames to center it)
2743  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
2744  new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK);
2745  new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame);
2746  // Write Warning in console if we're in testing mode
2747  WRITE_DEBUG("Opening NeteditAttributes help dialog");
2748  // create Dialog
2749  additionalNeteditAttributesHelpDialog->create();
2750  // show in the given position
2751  additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR);
2752  // refresh APP
2753  getApp()->refresh();
2754  // open as modal dialog (will block all windows until stop() or stopModal() is called)
2755  getApp()->runModalFor(additionalNeteditAttributesHelpDialog);
2756  // Write Warning in console if we're in testing mode
2757  WRITE_DEBUG("Closing NeteditAttributes help dialog");
2758  return 1;
2759  /**********
2760  help from PolygonFrame
2761  << "- Block movement: If enabled, the created polygon element will be blocked. i.e. cannot be moved with\n"
2762  << " the mouse. This option can be modified inspecting element.\n"
2763  << "\n"
2764  << "- Block shape: If enabled, the shape of created polygon element will be blocked. i.e. their geometry points\n"
2765  << " cannot be edited be moved with the mouse. This option can be modified inspecting element.\n"
2766  << "\n"
2767  << "- Close shape: If enabled, the created polygon element will be closed. i.e. the last created geometry point\n"
2768  << " will be connected with the first geometry point automatically. This option can be modified inspecting element.";
2769 
2770  ****************/
2771 }
2772 
2773 
2774 double
2775 GNEFrameAttributesModuls::NeteditAttributes::setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const {
2776  switch (myActualAdditionalReferencePoint) {
2777  case GNE_ADDITIONALREFERENCEPOINT_LEFT:
2778  return positionOfTheMouseOverLane;
2779  case GNE_ADDITIONALREFERENCEPOINT_RIGHT:
2780  return positionOfTheMouseOverLane - lengthOfAdditional;
2781  case GNE_ADDITIONALREFERENCEPOINT_CENTER:
2782  return positionOfTheMouseOverLane - lengthOfAdditional / 2;
2783  default:
2784  throw InvalidArgument("Reference Point invalid");
2785  }
2786 }
2787 
2788 
2789 double
2790 GNEFrameAttributesModuls::NeteditAttributes::setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const {
2791  switch (myActualAdditionalReferencePoint) {
2792  case GNE_ADDITIONALREFERENCEPOINT_LEFT:
2793  return positionOfTheMouseOverLane + lengthOfAdditional;
2794  case GNE_ADDITIONALREFERENCEPOINT_RIGHT:
2795  return positionOfTheMouseOverLane;
2796  case GNE_ADDITIONALREFERENCEPOINT_CENTER:
2797  return positionOfTheMouseOverLane + lengthOfAdditional / 2;
2798  default:
2799  throw InvalidArgument("Reference Point invalid");
2800  }
2801 }
2802 
2803 /****************************************************************************/
GNEFrameAttributesModuls::AttributesEditorExtended::~AttributesEditorExtended
~AttributesEditorExtended()
destructor
Definition: GNEFrameAttributesModuls.cpp:2050
GNEFrameAttributesModuls::AttributesEditorFlow::refreshEnd
void refreshEnd()
refresh end
Definition: GNEFrameAttributesModuls.cpp:1834
GNEFrameAttributesModuls::AttributesEditorRow
Definition: GNEFrameAttributesModuls.h:302
GNEFrameAttributesModuls::AttributesCreatorRow::getAttributesCreatorParent
AttributesCreator * getAttributesCreatorParent() const
get AttributesCreator parent
Definition: GNEFrameAttributesModuls.cpp:313
GNEFrameAttributesModuls::AttributesCreatorFlow::myAttributeEndRadioButton
FXRadioButton * myAttributeEndRadioButton
Radio button for 'end' attribute.
Definition: GNEFrameAttributesModuls.h:265
SUMOXMLDefinitions::isValidAttribute
static bool isValidAttribute(const std::string &value)
whether the given string is a valid attribute for a certain key (for example, a name)
Definition: SUMOXMLDefinitions.cpp:995
StringUtils::replace
static std::string replace(std::string str, const char *what, const char *by)
Definition: StringUtils.cpp:105
SUMO_ATTR_ANGLE
Definition: SUMOXMLDefinitions.h:794
GUIDesignAuxiliarHorizontalFrame
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
Definition: GUIDesigns.h:273
GNEFrameAttributesModuls::AttributesCreatorFlow::myAttributeVehsPerHourRadioButton
FXRadioButton * myAttributeVehsPerHourRadioButton
Radio button for 'VehsPerHour' attribute.
Definition: GNEFrameAttributesModuls.h:277
GNEFrameAttributesModuls::AttributesEditorRow::myAttributeCheckButton
FXCheckButton * myAttributeCheckButton
pointer to attribute menu check
Definition: GNEFrameAttributesModuls.h:352
ICON_ACCEPT
Definition: GUIIcons.h:386
GNEFrameAttributesModuls::AttributesEditorFlow::myAttributeVehsPerHourRadioButton
FXRadioButton * myAttributeVehsPerHourRadioButton
Radio button for 'VehsPerHour' attribute.
Definition: GNEFrameAttributesModuls.h:497
SUMO_ATTR_DEPART
Definition: SUMOXMLDefinitions.h:431
GNEFrameAttributesModuls::NeteditAttributes::myCloseShapeFrame
FXHorizontalFrame * myCloseShapeFrame
horizontal frame for close polygon
Definition: GNEFrameAttributesModuls.h:786
GUIDesignTextFieldNCol
#define GUIDesignTextFieldNCol
Num of column of text field.
Definition: GUIDesigns.h:42
ArrivalPosDefinition
ArrivalPosDefinition
Possible ways to choose the arrival position.
Definition: SUMOVehicleParameter.h:230
GNEFrameAttributesModuls::AttributesEditorExtended::onCmdOpenDialog
long onCmdOpenDialog(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:2066
GNEAttributeCarrier::TagProperties
struct with the attribute Properties
Definition: GNEAttributeCarrier.h:317
GNEFrameAttributesModuls::AttributesCreator::~AttributesCreator
~AttributesCreator()
destructor
Definition: GNEFrameAttributesModuls.cpp:599
SUMO_ATTR_IMGFILE
Definition: SUMOXMLDefinitions.h:792
GNEFrameAttributesModuls::ParametersEditor::hideParametersEditor
void hideParametersEditor()
hide netedit attributes editor
Definition: GNEFrameAttributesModuls.cpp:2162
GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute
std::string checkComplexAttribute(const std::string &value)
check if given complex attribute is valid
Definition: GNEFrameAttributesModuls.cpp:505
GUIDesignLabelAttribute
#define GUIDesignLabelAttribute
label extended over the matrix column with thick frame and height of 23
Definition: GUIDesigns.h:170
GUIDesignRadioButtonAttribute
#define GUIDesignRadioButtonAttribute
design for radio button with fixed height
Definition: GUIDesigns.h:142
GNEFrameAttributesModuls::AttributesEditorRow::myValueTextField
FXTextField * myValueTextField
textField to modify the value of string attributes
Definition: GNEFrameAttributesModuls.h:361
GNEFrameAttributesModuls::ParametersEditor::refreshParametersEditor
void refreshParametersEditor()
refresh netedit attributes
Definition: GNEFrameAttributesModuls.cpp:2170
SUMO_ATTR_LENGTH
Definition: SUMOXMLDefinitions.h:393
GNEFrameAttributesModuls::AttributesCreatorRow
Definition: GNEFrameAttributesModuls.h:53
GNEFrameAttributesModuls::AttributesEditorFlow
Definition: GNEFrameAttributesModuls.h:433
GNEAttributeCarrier::TagProperties::canMaskStartEndPos
bool canMaskStartEndPos() const
return true if tag correspond to an element that can mask the attributes "start" and "end" position a...
Definition: GNEAttributeCarrier.cpp:895
GNEFrameAttributesModuls::AttributesEditor::getEditedACs
const std::vector< GNEAttributeCarrier * > & getEditedACs() const
get current edited ACs
Definition: GNEFrameAttributesModuls.cpp:1644
SUMOXMLDefinitions::isValidFilename
static bool isValidFilename(const std::string &value)
whether the given string is a valid attribute for a filename (for example, a name)
Definition: SUMOXMLDefinitions.cpp:1001
GNEFrameAttributesModuls::AttributesCreator::myHelpButton
FXButton * myHelpButton
help button
Definition: GNEFrameAttributesModuls.h:212
SUMO_ATTR_UNTIL
Definition: SUMOXMLDefinitions.h:668
GNEFrameAttributesModuls::AttributesEditorFlow::myAttributeNumberRadioButton
FXRadioButton * myAttributeNumberRadioButton
Radio button for 'number' attribute.
Definition: GNEFrameAttributesModuls.h:491
GNEFrameAttributesModuls::DrawingShape::addNewPoint
void addNewPoint(const Position &P)
add new point to temporal shape
Definition: GNEFrameAttributesModuls.cpp:2429
RGBColor::BLACK
static const RGBColor BLACK
Definition: RGBColor.h:197
GNEFrameAttributesModuls::AttributesCreatorFlow::setFlowParameters
void setFlowParameters(std::map< SumoXMLAttr, std::string > &parameters)
set parameters
Definition: GNEFrameAttributesModuls.cpp:856
GNEUndoList::p_end
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:79
OptionsCont.h
GNEFrameAttributesModuls::NeteditAttributes::myCloseShapeCheckButton
FXCheckButton * myCloseShapeCheckButton
checkbox to enable/disable close polygon
Definition: GNEFrameAttributesModuls.h:789
StringTokenizer::hasNext
bool hasNext()
returns the information whether further substrings exist
Definition: StringTokenizer.cpp:94
GNEFrameAttributesModuls::AttributesEditorRow::onCmdSelectCheckButton
long onCmdSelectCheckButton(FXObject *, FXSelector, void *)
called when user press a check button
Definition: GNEFrameAttributesModuls.cpp:1413
GNEFrameAttributesModuls::NeteditAttributes
Definition: GNEFrameAttributesModuls.h:714
GNEFrameAttributesModuls::ParametersEditor::myTextFieldParameters
FXTextField * myTextFieldParameters
text field for write parameters
Definition: GNEFrameAttributesModuls.h:618
GNEFrameAttributesModuls::DrawingShape::DrawingShape
DrawingShape(GNEFrame *frameParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:2341
VEHPARS_NUMBER_SET
const int VEHPARS_NUMBER_SET
Definition: SUMOVehicleParameter.h:51
GNEFrameAttributesModuls::AttributesEditor::removeEditedAC
void removeEditedAC(GNEAttributeCarrier *AC)
remove edited ACs
Definition: GNEFrameAttributesModuls.cpp:1650
GNEFrameAttributesModuls::AttributesEditor::AttributesEditor
AttributesEditor(GNEFrame *inspectorFrameParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:1445
GNEFrameAttributesModuls::AttributesCreator::getCurrentTagProperties
GNEAttributeCarrier::TagProperties getCurrentTagProperties() const
get current edited Tag Properties
Definition: GNEFrameAttributesModuls.cpp:698
SUMOVehicleParameter::parseDepartSpeed
static bool parseDepartSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, DepartSpeedDefinition &dsd, std::string &error)
Validates a given departSpeed value.
Definition: SUMOVehicleParameter.cpp:384
GNEFrameAttributesModuls::AttributesCreatorRow::enableAttributesCreatorRow
void enableAttributesCreatorRow()
enable row
Definition: GNEFrameAttributesModuls.cpp:266
SUMO_ATTR_ARRIVALPOS_LAT
Definition: SUMOXMLDefinitions.h:438
GNEFrameAttributesModuls::AttributesCreator
Definition: GNEFrameAttributesModuls.h:148
GNEFrameAttributesModuls::AttributesEditorRow::myAttributeButtonCombinableChoices
FXButton * myAttributeButtonCombinableChoices
pointer to buttonCombinableChoices
Definition: GNEFrameAttributesModuls.h:355
GNEFrameAttributesModuls::AttributesEditor::myAttributesEditorRows
std::vector< AttributesEditorRow * > myAttributesEditorRows
list of Attribute editor rows
Definition: GNEFrameAttributesModuls.h:417
SUMOVehicleParameter::parseDepartLane
static bool parseDepartLane(const std::string &val, const std::string &element, const std::string &id, int &lane, DepartLaneDefinition &dld, std::string &error)
Validates a given departLane value.
Definition: SUMOVehicleParameter.cpp:275
SUMO_ATTR_PERIOD
Definition: SUMOXMLDefinitions.h:645
DepartPosLatDefinition
DepartPosLatDefinition
Definition: SUMOVehicleParameter.h:166
GNEFrameAttributesModuls::AttributesCreator::areValuesValid
bool areValuesValid() const
check if parameters of attributes are valid
Definition: GNEFrameAttributesModuls.cpp:731
ArrivalPosLatDefinition
ArrivalPosLatDefinition
Possible ways to choose the departure position.
Definition: SUMOVehicleParameter.h:250
GNEFrameAttributesModuls::AttributesEditorRow::myAttributeLabel
FXLabel * myAttributeLabel
pointer to attribute label
Definition: GNEFrameAttributesModuls.h:349
GNEFrameAttributesModuls::AttributesCreatorFlow::showAttributesCreatorFlowModul
void showAttributesCreatorFlowModul()
show AttributesCreatorFlow modul
Definition: GNEFrameAttributesModuls.cpp:803
ICON_MODEADDITIONAL
Definition: GUIIcons.h:220
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
GUIDesignButtonOK
#define GUIDesignButtonOK
Definition: GUIDesigns.h:98
GNEFrameAttributesModuls::AttributesEditorRow::myValueComboBoxChoices
FXComboBox * myValueComboBoxChoices
pointer to combo box choices
Definition: GNEFrameAttributesModuls.h:364
GNEFrameAttributesModuls::AttributesCreatorRow::isAttributeValid
const std::string & isAttributeValid() const
returns a empty string if current value is valid, a string with information about invalid value in ot...
Definition: GNEFrameAttributesModuls.cpp:307
DepartDefinition
DepartDefinition
Possible ways to depart.
Definition: SUMOVehicleParameter.h:98
GUIDesignComboBoxNCol
#define GUIDesignComboBoxNCol
number of column of every combo box
Definition: GUIDesigns.h:217
GNEFrame
Definition: GNEFrame.h:34
GNEFrameAttributesModuls::AttributesEditorFlow::AttributesEditorFlow
AttributesEditorFlow(AttributesEditor *attributesEditorParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:1682
ArrivalLaneDefinition
ArrivalLaneDefinition
Possible ways to choose the arrival lane.
Definition: SUMOVehicleParameter.h:214
GNEFrameAttributesModuls::AttributesEditorFlow::myValuePeriodTextField
FXTextField * myValuePeriodTextField
textField for 'period' attribute
Definition: GNEFrameAttributesModuls.h:506
StringTokenizer::next
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
Definition: StringTokenizer.cpp:99
GNEFrameAttributesModuls::AttributesEditorRow::onCmdOpenAttributeDialog
long onCmdOpenAttributeDialog(FXObject *, FXSelector, void *)
open model dialog for more comfortable attribute editing
Definition: GNEFrameAttributesModuls.cpp:1237
SUMOVehicleParameter::parseArrivalPosLat
static bool parseArrivalPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosLatDefinition &apd, std::string &error)
Validates a given arrivalPosLat value.
Definition: SUMOVehicleParameter.cpp:478
GNEFrameAttributesModuls::AttributesCreator::getFrameParent
GNEFrame * getFrameParent() const
return frame parent
Definition: GNEFrameAttributesModuls.cpp:665
SUMO_ATTR_ARRIVALPOS
Definition: SUMOXMLDefinitions.h:437
SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
GNEFrameAttributesModuls::ParametersEditor::ParametersEditor
ParametersEditor(GNEFrame *frameParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:2076
GNEFrameAttributesModuls::DrawingShape::isDrawing
bool isDrawing() const
return true if currently a shape is drawed
Definition: GNEFrameAttributesModuls.cpp:2451
GUIDesigns.h
GNEFrameAttributesModuls::DrawingShape::onCmdStartDrawing
long onCmdStartDrawing(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:2469
MID_GNE_SET_ATTRIBUTE_BUTTON
attribute selected using button (radio button or checkbox)
Definition: GUIAppEnum.h:674
GNEFrameAttributesModuls::NeteditAttributes::helpReferencePoint
FXButton * helpReferencePoint
Button for help about the reference point.
Definition: GNEFrameAttributesModuls.h:798
SUMO_ATTR_ENDPOS
Definition: SUMOXMLDefinitions.h:798
SUMOVehicleParameter::parsePersonModes
static bool parsePersonModes(const std::string &modes, const std::string &element, const std::string &id, SVCPermissions &modeSet, std::string &error)
Validates a given person modes value.
Definition: SUMOVehicleParameter.cpp:550
GNEFrameAttributesModuls::DrawingShape::getTemporalShape
const PositionVector & getTemporalShape() const
get Temporal shape
Definition: GNEFrameAttributesModuls.cpp:2445
GUIDesignTextField
#define GUIDesignTextField
Definition: GUIDesigns.h:33
GNEFrameAttributesModuls::AttributesEditor::myAttributesEditorFlow
AttributesEditorFlow * myAttributesEditorFlow
pointer to attributesEditorFlow
Definition: GNEFrameAttributesModuls.h:414
MID_GNE_SET_ATTRIBUTE
attribute edited
Definition: GUIAppEnum.h:646
PositionVector
A list of positions.
Definition: PositionVector.h:45
GNE_ATTR_CENTER_AFTER_CREATION
flag to center camera after element creation
Definition: SUMOXMLDefinitions.h:1009
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:609
SUMOXMLDefinitions::isValidDetectorID
static bool isValidDetectorID(const std::string &value)
whether the given string is a valid id for an detector
Definition: SUMOXMLDefinitions.cpp:989
GNEFrameAttributesModuls::AttributesCreatorRow::isValidID
bool isValidID() const
check if current ID placed in myValueTextField is valid
Definition: GNEFrameAttributesModuls.cpp:577
GNEFrameAttributesModuls::DrawingShape::myStopDrawingButton
FXButton * myStopDrawingButton
button for stop drawing
Definition: GNEFrameAttributesModuls.h:701
GNEFrameAttributesModuls::NeteditAttributes::myBlockMovementFrame
FXHorizontalFrame * myBlockMovementFrame
horizontal frame for block movement
Definition: GNEFrameAttributesModuls.h:774
SUMOVehicleParameter::parseArrivalPos
static bool parseArrivalPos(const std::string &val, const std::string &element, const std::string &id, double &pos, ArrivalPosDefinition &apd, std::string &error)
Validates a given arrivalPos value.
Definition: SUMOVehicleParameter.cpp:448
GNEFrameAttributesModuls::AttributesCreatorFlow::onCmdSetFlowAttribute
long onCmdSetFlowAttribute(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:956
GNEFrameAttributesModuls::NeteditAttributes::~NeteditAttributes
~NeteditAttributes()
destructor
Definition: GNEFrameAttributesModuls.cpp:2533
GNEFrameAttributesModuls::AttributesCreatorFlow::myAttributeProbabilityRadioButton
FXRadioButton * myAttributeProbabilityRadioButton
Radio button for 'probability' attribute.
Definition: GNEFrameAttributesModuls.h:289
GNEFrameAttributesModuls::AttributesEditorFlow::refreshPeriod
void refreshPeriod()
refresh parameter Period
Definition: GNEFrameAttributesModuls.cpp:1957
GNEFrameAttributesModuls::ParametersEditor::myButtonEditParameters
FXButton * myButtonEditParameters
button for edit parameters using specific dialog
Definition: GNEFrameAttributesModuls.h:621
GNEFrameAttributesModuls::AttributesEditorFlow::refreshNumber
void refreshNumber()
refresh parameter number
Definition: GNEFrameAttributesModuls.cpp:1875
VEHPARS_PROB_SET
const int VEHPARS_PROB_SET
Definition: SUMOVehicleParameter.h:54
GUIDesignButton
#define GUIDesignButton
Definition: GUIDesigns.h:50
GNEFrameAttributesModuls::AttributesCreator::myAttributesCreatorFlow
AttributesCreatorFlow * myAttributesCreatorFlow
pointer to myAttributesCreatorFlow
Definition: GNEFrameAttributesModuls.h:203
MFXUtils::getRGBColor
static RGBColor getRGBColor(FXColor col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:107
GNEFrameAttributesModuls::ParametersEditor::showParametersEditor
void showParametersEditor(GNEAttributeCarrier *AC)
show netedit attributes editor (used for edit parameters of an existent AC)
Definition: GNEFrameAttributesModuls.cpp:2090
GNEFrameAttributesModuls::AttributesEditor
Definition: GNEFrameAttributesModuls.h:374
GUIAppEnum.h
SUMOVehicleParameter.h
SUMO_ATTR_BEGIN
weights: time range begin
Definition: SUMOXMLDefinitions.h:678
MID_GNE_SET_ATTRIBUTE_BOOL
bool attribute edited
Definition: GUIAppEnum.h:670
GNEFrameAttributesModuls::AttributesCreator::hideAttributesCreatorModul
void hideAttributesCreatorModul()
hide group box
Definition: GNEFrameAttributesModuls.cpp:659
GUIDesignLabelFrameInformation
#define GUIDesignLabelFrameInformation
label extended over frame without thick and with text justify to left, used to show information in fr...
Definition: GUIDesigns.h:194
GNEFrameAttributesModuls::AttributesEditorFlow::myValueProbabilityTextField
FXTextField * myValueProbabilityTextField
textField for 'probability' attribute
Definition: GNEFrameAttributesModuls.h:512
GUIDesignButtonRectangular
#define GUIDesignButtonRectangular
little button rectangular (46x23) used in frames (For example, in "help" buttons)
Definition: GUIDesigns.h:56
GNEFrameAttributesModuls::AttributesCreatorFlow::myAttributeNumberRadioButton
FXRadioButton * myAttributeNumberRadioButton
Radio button for 'number' attribute.
Definition: GNEFrameAttributesModuls.h:271
GNEAllowDisallow.h
GNEFrameAttributesModuls::AttributesCreator::getAttributesAndValues
std::map< SumoXMLAttr, std::string > getAttributesAndValues(bool includeAll) const
get attributes and their values
Definition: GNEFrameAttributesModuls.cpp:671
MID_HELP
help button
Definition: GUIAppEnum.h:553
GNEFrameAttributesModuls::NeteditAttributes::setStartPosition
double setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the Start position values of StoppingPlaces and E2 detector over the lane
Definition: GNEFrameAttributesModuls.cpp:2774
GNEFrameAttributesModuls::DrawingShape::myAbortDrawingButton
FXButton * myAbortDrawingButton
button for abort drawing
Definition: GNEFrameAttributesModuls.h:704
PositionVector::nearest_offset_to_point2D
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Definition: PositionVector.cpp:817
GNERouteHandler::setFlowParameters
static void setFlowParameters(const SumoXMLAttr attribute, int &parameters)
configure flow parameters
Definition: GNERouteHandler.cpp:1033
GNEFrameAttributesModuls::AttributesCreatorRow::getAttributeCheckButtonCheck
bool getAttributeCheckButtonCheck() const
return status of label checkbox button
Definition: GNEFrameAttributesModuls.cpp:233
GNEFrameAttributesModuls::AttributesCreatorFlow::myValueProbabilityTextField
FXTextField * myValueProbabilityTextField
textField for 'probability' attribute
Definition: GNEFrameAttributesModuls.h:292
SUMO_ATTR_ARRIVALSPEED
Definition: SUMOXMLDefinitions.h:439
SUMO_ATTR_TRIP_ID
Definition: SUMOXMLDefinitions.h:777
GNEFrameAttributesModuls::AttributesEditorFlow::isAttributesEditorFlowModulShown
bool isAttributesEditorFlowModulShown() const
check if attribute editor flow modul is shown
Definition: GNEFrameAttributesModuls.cpp:1731
GNEFrameAttributesModuls::AttributesEditorExtended
Definition: GNEFrameAttributesModuls.h:519
GNEAttributeCarrier::TagProperties::canBlockShape
bool canBlockShape() const
return true if tag correspond to an element that can block their shape
Definition: GNEAttributeCarrier.cpp:810
GNEFrameAttributesModuls::DrawingShape::removeLastPoint
void removeLastPoint()
remove last added point
Definition: GNEFrameAttributesModuls.cpp:2439
GNEFrameAttributesModuls.h
GNEFrameAttributesModuls::AttributesEditorFlow::myAttributeProbabilityRadioButton
FXRadioButton * myAttributeProbabilityRadioButton
Radio button for 'probability' attribute.
Definition: GNEFrameAttributesModuls.h:509
SUMO_ATTR_PROB
Definition: SUMOXMLDefinitions.h:629
GNEFrameAttributesModuls::AttributesEditorRow::destroy
void destroy()
destroy AttributesCreatorRow (but don't delete)
Definition: GNEFrameAttributesModuls.cpp:1163
GNEAttributeCarrier::AttributeProperties::isActivatable
bool isActivatable() const
return true if atribute is activatable
Definition: GNEAttributeCarrier.cpp:478
GNEAttributeCarrier::getTagProperty
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Definition: GNEAttributeCarrier.cpp:1273
GNEFrameAttributesModuls::AttributesEditorFlow::refreshProbability
void refreshProbability()
refresh parameter Probability
Definition: GNEFrameAttributesModuls.cpp:1998
SUMO_ATTR_STARTPOS
Definition: SUMOXMLDefinitions.h:797
SUMOVehicleParameter::parseDepartPosLat
static bool parseDepartPosLat(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosLatDefinition &dpd, std::string &error)
Validates a given departPosLat value.
Definition: SUMOVehicleParameter.cpp:348
GNEAllowDisallow
Dialog for edit rerouters.
Definition: GNEAllowDisallow.h:41
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:218
GNEAttributeCarrier::AttributeProperties
struct with the attribute Properties
Definition: GNEAttributeCarrier.h:97
GNEAttributeCarrier::AttributeProperties::isColor
bool isColor() const
return true if atribute is a color
Definition: GNEAttributeCarrier.cpp:406
GNELane::getLaneShape
const PositionVector & getLaneShape() const
Definition: GNELane.cpp:86
GNEFrameAttributesModuls::ParametersEditor::~ParametersEditor
~ParametersEditor()
destructor
Definition: GNEFrameAttributesModuls.cpp:2086
GNEFrameAttributesModuls::AttributesCreatorFlow::areValuesValid
bool areValuesValid() const
check if parameters of attributes are valid
Definition: GNEFrameAttributesModuls.cpp:904
GNEFrameAttributesModuls::AttributesEditorRow::myAttributeColorButton
FXButton * myAttributeColorButton
Button for open color editor.
Definition: GNEFrameAttributesModuls.h:358
GNEFrameAttributesModuls::DrawingShape::hideDrawingShape
void hideDrawingShape()
hide Drawing mode
Definition: GNEFrameAttributesModuls.cpp:2378
GUIDesignHorizontalSeparator
#define GUIDesignHorizontalSeparator
Definition: GUIDesigns.h:321
GNEFrameAttributesModuls::AttributesEditorRow::myMultiple
const bool myMultiple
flag to check if input element contains multiple values
Definition: GNEFrameAttributesModuls.h:346
SUMOVehicleParameter::parseArrivalLane
static bool parseArrivalLane(const std::string &val, const std::string &element, const std::string &id, int &lane, ArrivalLaneDefinition &ald, std::string &error)
Validates a given arrivalLane value.
Definition: SUMOVehicleParameter.cpp:419
GUITexturesHelper.h
StringTokenizer
Definition: StringTokenizer.h:61
GNEAttributeCarrier::TagProperties::isDemandElement
bool isDemandElement() const
return true if tag correspond to a demand element
Definition: GNEAttributeCarrier.cpp:715
GNEFrameAttributesModuls::NeteditAttributes::NeteditAttributes
NeteditAttributes(GNEFrame *frameParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:2492
SUMO_ATTR_NOTHING
invalid attribute
Definition: SUMOXMLDefinitions.h:374
SUMO_ATTR_DEPARTPOS_LAT
Definition: SUMOXMLDefinitions.h:434
GNEFrameAttributesModuls::AttributesEditor::myHelpButton
FXButton * myHelpButton
button for help
Definition: GNEFrameAttributesModuls.h:420
GNEViewNet.h
RGBColor::parseColor
static RGBColor parseColor(std::string coldef)
Parses a color information.
Definition: RGBColor.cpp:176
GNELane::getLengthGeometryFactor
double getLengthGeometryFactor() const
get length geometry factor
Definition: GNELane.cpp:1428
GNEFrameAttributesModuls::NeteditAttributes::myReferencePointMatchBox
FXComboBox * myReferencePointMatchBox
match box with the list of reference points
Definition: GNEFrameAttributesModuls.h:765
SUMO_ATTR_DEPARTSPEED
Definition: SUMOXMLDefinitions.h:435
update
GNEFrameAttributesModuls::AttributesCreatorRow::refreshRow
void refreshRow() const
refresh row
Definition: GNEFrameAttributesModuls.cpp:298
GUIDesignComboBoxAttribute
#define GUIDesignComboBoxAttribute
Combo box static (cannot be edited) extended over the matrix column.
Definition: GUIDesigns.h:211
SUMO_ATTR_DEPARTLANE
Definition: SUMOXMLDefinitions.h:432
GNEFrameAttributesModuls::DrawingShape::myInformationLabel
FXLabel * myInformationLabel
Label with information.
Definition: GNEFrameAttributesModuls.h:707
GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSelectFlowRadioButton
long onCmdSelectFlowRadioButton(FXObject *, FXSelector, void *)
called when user press a radio button
Definition: GNEFrameAttributesModuls.cpp:1795
GNEFrameAttributesModuls::AttributesCreatorRow::setAttributeCheckButtonCheck
void setAttributeCheckButtonCheck(bool value)
enable or disable label checkbox button for optional attributes
Definition: GNEFrameAttributesModuls.cpp:243
GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
Definition: SUMOXMLDefinitions.h:989
SUMO_ATTR_TRIGGERED
Definition: SUMOXMLDefinitions.h:799
GNEFrameAttributesModuls::AttributesEditorFlow::myAttributePeriodRadioButton
FXRadioButton * myAttributePeriodRadioButton
Radio button for 'period' attribute.
Definition: GNEFrameAttributesModuls.h:503
GNE_ATTR_CLOSE_SHAPE
Close shape of a polygon (Used by GNEPolys)
Definition: SUMOXMLDefinitions.h:985
GNE_SUPERMODE_NETWORK
Network mode (Edges, junctions, etc..)
Definition: GNEViewNetHelper.h:46
ProcessError
Definition: UtilExceptions.h:39
GNEViewNetHelper::EditModes::currentSupermode
Supermode currentSupermode
the current supermode
Definition: GNEViewNetHelper.h:305
GNEFrameAttributesModuls::AttributesCreatorRow::getValue
std::string getValue() const
return value
Definition: GNEFrameAttributesModuls.cpp:223
GUIDesignCheckButton
#define GUIDesignCheckButton
checkButton placed in left position
Definition: GUIDesigns.h:115
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNEFrameAttributesModuls::AttributesEditor::showAttributeEditorModul
void showAttributeEditorModul(const std::vector< GNEAttributeCarrier * > &ACs, bool includeExtended, bool forceAttributeEnabled)
show attributes of multiple ACs
Definition: GNEFrameAttributesModuls.cpp:1461
GNEAttributeCarrier::AttributeProperties::getAttrStr
const std::string & getAttrStr() const
get XML Attribute
Definition: GNEAttributeCarrier.cpp:188
MID_GNE_ABORTDRAWING
abort drawing polygon
Definition: GUIAppEnum.h:692
GNE_ATTR_BLOCK_SHAPE
block shape of a graphic element (Used mainly in GNEShapes)
Definition: SUMOXMLDefinitions.h:983
GNEFrame::myViewNet
GNEViewNet * myViewNet
View Net.
Definition: GNEFrame.h:121
GNEFrameAttributesModuls::ParametersEditor::setParameters
void setParameters(const std::vector< std::pair< std::string, std::string > > &parameters)
set parameters
Definition: GNEFrameAttributesModuls.cpp:2239
SUMOVehicleParameter::parseArrivalSpeed
static bool parseArrivalSpeed(const std::string &val, const std::string &element, const std::string &id, double &speed, ArrivalSpeedDefinition &asd, std::string &error)
Validates a given arrivalSpeed value.
Definition: SUMOVehicleParameter.cpp:508
SUMOVehicleParameter::parseDepart
static bool parseDepart(const std::string &val, const std::string &element, const std::string &id, SUMOTime &depart, DepartDefinition &dd, std::string &error)
Validates a given depart value.
Definition: SUMOVehicleParameter.cpp:244
GNEFrameAttributesModuls::DrawingShape::abortDrawing
void abortDrawing()
abort drawing
Definition: GNEFrameAttributesModuls.cpp:2417
GUIDesignGroupBoxFrame
#define GUIDesignGroupBoxFrame
Group box design extended over frame.
Definition: GUIDesigns.h:239
GNEFrameAttributesModuls::NeteditAttributes::showNeteditAttributesModul
void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties &tagValue)
show Netedit attributes modul
Definition: GNEFrameAttributesModuls.cpp:2537
GNEFrameAttributesModuls::AttributesEditor::hideAttributesEditorModul
void hideAttributesEditorModul()
hide attribute editor
Definition: GNEFrameAttributesModuls.cpp:1550
GNEFrameAttributesModuls::NeteditAttributes::myBlockShapeFrame
FXHorizontalFrame * myBlockShapeFrame
horizontal frame for block shape
Definition: GNEFrameAttributesModuls.h:780
GNEFrameAttributesModuls::AttributesCreatorRow::onCmdSelectColorButton
long onCmdSelectColorButton(FXObject *, FXSelector, void *)
called when user press the "Color" button
Definition: GNEFrameAttributesModuls.cpp:485
GNEFrameAttributesModuls::AttributesCreatorFlow::myValueVehsPerHourTextField
FXTextField * myValueVehsPerHourTextField
textField for 'VehsPerHour' attribute
Definition: GNEFrameAttributesModuls.h:280
GNEFrameAttributesModuls::AttributesCreatorFlow::myAttributePeriodRadioButton
FXRadioButton * myAttributePeriodRadioButton
Radio button for 'period' attribute.
Definition: GNEFrameAttributesModuls.h:283
GNEFrameAttributesModuls::AttributesCreatorRow::onCmdSetAttribute
long onCmdSetAttribute(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:319
GNEAttributeCarrier::AttributeProperties::getAttr
SumoXMLAttr getAttr() const
get XML Attribute
Definition: GNEAttributeCarrier.cpp:182
GNEFrameAttributesModuls::AttributesEditorFlow::hideAttributesEditorFlowModul
void hideAttributesEditorFlowModul()
hide attribute EditorFlow
Definition: GNEFrameAttributesModuls.cpp:1724
GNEFrameAttributesModuls::ParametersEditor
Definition: GNEFrameAttributesModuls.h:554
GNEParametersDialog
Dialog for edit parameters.
Definition: GNEParametersDialog.h:44
GNEFrameAttributesModuls::DrawingShape::getDeleteLastCreatedPoint
bool getDeleteLastCreatedPoint()
get flag delete last created point
Definition: GNEFrameAttributesModuls.cpp:2463
GNEFrameAttributesModuls::DrawingShape::setDeleteLastCreatedPoint
void setDeleteLastCreatedPoint(bool value)
enable or disable delete last created point
Definition: GNEFrameAttributesModuls.cpp:2457
GNEParametersDialog.h
MID_GNE_STARTDRAWING
start drawing polygon
Definition: GUIAppEnum.h:688
VEHPARS_VPH_SET
const int VEHPARS_VPH_SET
Definition: SUMOVehicleParameter.h:53
SUMO_ATTR_EXTENSION
Definition: SUMOXMLDefinitions.h:669
GNELane.h
GNEAttributeCarrier::AttributeProperties::getTagPropertyParent
const TagProperties & getTagPropertyParent() const
get reference to tagProperty parent
Definition: GNEAttributeCarrier.cpp:194
GNEAttributeCarrier::TagProperties::canCenterCameraAfterCreation
bool canCenterCameraAfterCreation() const
return true if tag correspond to an element that center camera after creation
Definition: GNEAttributeCarrier.cpp:907
GNEFrameAttributesModuls::NeteditAttributes::getNeteditAttributesAndValues
bool getNeteditAttributesAndValues(std::map< SumoXMLAttr, std::string > &valuesMap, const GNELane *lane) const
fill valuesMap with netedit attributes
Definition: GNEFrameAttributesModuls.cpp:2594
GNEAttributeCarrier::canParse
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
Definition: GNEAttributeCarrier.h:636
GNEFrameAttributesModuls::ParametersEditor::onCmdEditParameters
long onCmdEditParameters(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:2262
SUMO_ATTR_POSITION
Definition: SUMOXMLDefinitions.h:660
GNEFrameAttributesModuls::AttributesCreatorFlow::refreshAttributesCreatorFlow
void refreshAttributesCreatorFlow()
refresh AttributesCreatorFlow
Definition: GNEFrameAttributesModuls.cpp:816
GNEFrameAttributesModuls::AttributesEditorExtended::AttributesEditorExtended
AttributesEditorExtended(GNEFrame *frameParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:2042
GNEFrameAttributesModuls::AttributesCreator::AttributesCreator
AttributesCreator(GNEFrame *frameParent)
constructor
Definition: GNEFrameAttributesModuls.cpp:587
GNEFrameAttributesModuls::AttributesEditorFlow::refreshVehsPerHour
void refreshVehsPerHour()
refresh parameter VehsPerHour
Definition: GNEFrameAttributesModuls.cpp:1916
SUMO_ATTR_INDEX
Definition: SUMOXMLDefinitions.h:804
GNEAttributeCarrier::AttributeProperties::isDiscrete
bool isDiscrete() const
return true if atribute is discrete
Definition: GNEAttributeCarrier.cpp:454
GNEFrameAttributesModuls::AttributesCreatorFlow::myValueEndTextField
FXTextField * myValueEndTextField
textField for 'end' attribute
Definition: GNEFrameAttributesModuls.h:268
GNEFrameAttributesModuls::AttributesCreator::refreshRows
void refreshRows()
refresh rows (called after creating an element)
Definition: GNEFrameAttributesModuls.cpp:744
DepartLaneDefinition
DepartLaneDefinition
Possible ways to choose a lane on depart.
Definition: SUMOVehicleParameter.h:116
GNEFrameAttributesModuls::NeteditAttributes::myBlockMovementCheckButton
FXCheckButton * myBlockMovementCheckButton
checkBox for block movement
Definition: GNEFrameAttributesModuls.h:777
MID_GNE_STOPDRAWING
stop drawing polygon
Definition: GUIAppEnum.h:690
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GNEFrameAttributesModuls::NeteditAttributes::myLengthTextField
FXTextField * myLengthTextField
textField for length
Definition: GNEFrameAttributesModuls.h:771
GUIDesignCheckButtonAttribute
#define GUIDesignCheckButtonAttribute
checkButton without thick extended over the frame used for attributes
Definition: GUIDesigns.h:118
GNEFrameAttributesModuls::AttributesCreator::onCmdHelp
long onCmdHelp(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:752
GNEFrameAttributesModuls::AttributesCreatorFlow::AttributesCreatorFlow
AttributesCreatorFlow(AttributesCreator *attributesCreatorParent)
FOX-declaration.
Definition: GNEFrameAttributesModuls.cpp:762
GNEFrameAttributesModuls::NeteditAttributes::myCenterViewAfterCreationButton
FXCheckButton * myCenterViewAfterCreationButton
checkbox to enable/disable center element after creation
Definition: GNEFrameAttributesModuls.h:795
GNEAttributeCarrier::AttributeProperties::isVClasses
bool isVClasses() const
return true if atribute is a list of VClasses
Definition: GNEAttributeCarrier.cpp:460
GNEFrameAttributesModuls::AttributesCreatorFlow
Definition: GNEFrameAttributesModuls.h:219
GNEFrameAttributesModuls::AttributesEditorRow::myValueCheckButton
FXCheckButton * myValueCheckButton
pointer to menu check
Definition: GNEFrameAttributesModuls.h:367
GNEFrameAttributesModuls::AttributesCreatorRow::isAttributesCreatorRowEnabled
bool isAttributesCreatorRowEnabled() const
check if row is enabled
Definition: GNEFrameAttributesModuls.cpp:286
GNEFrameAttributesModuls::AttributesCreatorRow::destroy
void destroy()
destroy AttributesCreatorRow (but don't delete)
Definition: GNEFrameAttributesModuls.cpp:208
GNEAttributeCarrier::AttributeProperties::getDiscreteValues
const std::vector< std::string > & getDiscreteValues() const
get discrete values
Definition: GNEAttributeCarrier.cpp:293
GNEFrameAttributesModuls::AttributesEditorExtended::showAttributesEditorExtendedModul
void showAttributesEditorExtendedModul()
show AttributesEditorExtended modul
Definition: GNEFrameAttributesModuls.cpp:2054
SUMOXMLDefinitions::isValidTypeID
static bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
Definition: SUMOXMLDefinitions.cpp:979
SUMO_ATTR_EXPECTED
Definition: SUMOXMLDefinitions.h:802
GNEFrameAttributesModuls::DrawingShape::startDrawing
void startDrawing()
start drawing
Definition: GNEFrameAttributesModuls.cpp:2387
GNEFrameAttributesModuls
Definition: GNEFrameAttributesModuls.h:37
GNEFrameAttributesModuls::AttributesEditorFlow::showAttributeEditorFlowModul
void showAttributeEditorFlowModul()
show attributes editor Flow Modul
Definition: GNEFrameAttributesModuls.cpp:1711
Parameterised::areParametersValid
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
Definition: Parameterised.cpp:166
SUMO_ATTR_VTYPES
Definition: SUMOXMLDefinitions.h:632
GNEAttributeCarrier::AttributeProperties::isBool
bool isBool() const
return true if atribute is boolean
Definition: GNEAttributeCarrier.cpp:370
SUMO_ATTR_EXPECTED_CONTAINERS
Definition: SUMOXMLDefinitions.h:803
MID_GNE_SET_ATTRIBUTE_DIALOG
attribute edited trought dialog
Definition: GUIAppEnum.h:672
GNE_SUPERMODE_DEMAND
Demanding mode (Routes, Vehicles etc..)
Definition: GNEViewNetHelper.h:48
GNEFrameAttributesModuls::AttributesCreatorRow::getAttrProperties
const GNEAttributeCarrier::AttributeProperties & getAttrProperties() const
return Attr
Definition: GNEFrameAttributesModuls.cpp:217
GNEFrameAttributesModuls::DrawingShape::~DrawingShape
~DrawingShape()
destructor
Definition: GNEFrameAttributesModuls.cpp:2367
InvalidArgument
Definition: UtilExceptions.h:56
GNEAttributeCarrier::TagProperties::canBlockMovement
bool canBlockMovement() const
return true if tag correspond to an element that can block their movement
Definition: GNEAttributeCarrier.cpp:804
SUMOXMLDefinitions::isValidNetID
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
Definition: SUMOXMLDefinitions.cpp:967
SUMO_TAG_VAPORIZER
vaporizer of vehicles
Definition: SUMOXMLDefinitions.h:218
GNEFrameAttributesModuls::AttributesEditorFlow::myValueNumberTextField
FXTextField * myValueNumberTextField
textField for 'number' attribute
Definition: GNEFrameAttributesModuls.h:494
SUMOXMLDefinitions::isValidVehicleID
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
Definition: SUMOXMLDefinitions.cpp:973
SUMO_ATTR_CONTAINER_TRIGGERED
Definition: SUMOXMLDefinitions.h:800
GNE_ATTR_BLOCK_MOVEMENT
block movement of a graphic element
Definition: SUMOXMLDefinitions.h:981
GNEFrameAttributesModuls::AttributesEditor::refreshAttributeEditor
void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition)
refresh attribute editor (only the valid values will be refresh)
Definition: GNEFrameAttributesModuls.cpp:1561
GNEFrameAttributesModuls::AttributesCreatorFlow::myValuePeriodTextField
FXTextField * myValuePeriodTextField
textField for 'period' attribute
Definition: GNEFrameAttributesModuls.h:286
GNEFrameAttributesModuls::ParametersEditor::getParametersMap
const std::map< std::string, std::string > & getParametersMap() const
get parameters as map
Definition: GNEFrameAttributesModuls.cpp:2208
GNEAttributeCarrier::getAttribute
virtual std::string getAttribute(SumoXMLAttr key) const =0
GNEFrameAttributesModuls::DrawingShape::onCmdStopDrawing
long onCmdStopDrawing(FXObject *, FXSelector, void *)
Called when the user press stop drawing button.
Definition: GNEFrameAttributesModuls.cpp:2476
GUIDesignComboBox
#define GUIDesignComboBox
Definition: GUIDesigns.h:205
GNEFrameAttributesModuls::AttributesCreatorFlow::~AttributesCreatorFlow
~AttributesCreatorFlow()
destructor
Definition: GNEFrameAttributesModuls.cpp:799
GNEFrameAttributesModuls::AttributesEditor::onCmdAttributesEditorHelp
long onCmdAttributesEditorHelp(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:1669
DepartPosDefinition
DepartPosDefinition
Possible ways to choose the departure position.
Definition: SUMOVehicleParameter.h:140
SUMO_ATTR_ALLOW
Definition: SUMOXMLDefinitions.h:782
GNEFrameAttributesModuls::AttributesCreatorFlow::onCmdSelectFlowRadioButton
long onCmdSelectFlowRadioButton(FXObject *, FXSelector, void *)
called when user press a radio button
Definition: GNEFrameAttributesModuls.cpp:985
GNEFrameAttributesModuls::DrawingShape::onCmdAbortDrawing
long onCmdAbortDrawing(FXObject *, FXSelector, void *)
Called when the user press abort drawing button.
Definition: GNEFrameAttributesModuls.cpp:2483
GNEFrameAttributesModuls::AttributesEditorRow::myACAttr
const GNEAttributeCarrier::AttributeProperties myACAttr
current AC Attribute
Definition: GNEFrameAttributesModuls.h:343
GNEFrameAttributesModuls::AttributesCreatorFlow::myValueNumberTextField
FXTextField * myValueNumberTextField
textField for 'number' attribute
Definition: GNEFrameAttributesModuls.h:274
SUMO_ATTR_MODES
Definition: SUMOXMLDefinitions.h:653
GNEFrameAttributesModuls::DrawingShape::showDrawingShape
void showDrawingShape()
show Drawing mode
Definition: GNEFrameAttributesModuls.cpp:2370
GNEFrameAttributesModuls::NeteditAttributes::onCmdHelp
long onCmdHelp(FXObject *, FXSelector, void *)
Called when user press the help button.
Definition: GNEFrameAttributesModuls.cpp:2720
GNEFrameAttributesModuls::AttributesEditorRow::myAttributesEditorParent
AttributesEditor * myAttributesEditorParent
pointer to AttributesEditor parent
Definition: GNEFrameAttributesModuls.h:340
SUMO_ATTR_PARKING
Definition: SUMOXMLDefinitions.h:801
GNEAttributeCarrier::TagProperties::hasParameters
bool hasParameters() const
return true if Tag correspond to an element that supports parameters "key1=value1|key2=value2|....
Definition: GNEAttributeCarrier.cpp:858
FXDEFMAP
FXDEFMAP(GNEFrameAttributesModuls::AttributesCreatorRow) RowCreatorMap[]
GNEFrameAttributesModuls::DrawingShape::stopDrawing
void stopDrawing()
stop drawing and check if shape can be created
Definition: GNEFrameAttributesModuls.cpp:2399
GNEFrameAttributesModuls::AttributesCreatorRow::onCmdSelectCheckButton
long onCmdSelectCheckButton(FXObject *, FXSelector, void *)
called when user press a check button
Definition: GNEFrameAttributesModuls.cpp:468
StringTokenizer::getVector
std::vector< std::string > getVector()
return vector of strings
Definition: StringTokenizer.cpp:191
GNEFrameAttributesModuls::NeteditAttributes::myBlockShapeCheckButton
FXCheckButton * myBlockShapeCheckButton
checkBox for block shape
Definition: GNEFrameAttributesModuls.h:783
config.h
GNEFrameAttributesModuls::AttributesCreatorRow::generateID
std::string generateID() const
generate ID
Definition: GNEFrameAttributesModuls.cpp:563
GNEFrameAttributesModuls::AttributesEditorExtended::hideAttributesEditorExtendedModul
void hideAttributesEditorExtendedModul()
hide group box
Definition: GNEFrameAttributesModuls.cpp:2060
GNEFrameAttributesModuls::AttributesEditorFlow::myValueVehsPerHourTextField
FXTextField * myValueVehsPerHourTextField
textField for 'VehsPerHour' attribute
Definition: GNEFrameAttributesModuls.h:500
GNEFrameAttributesModuls::NeteditAttributes::myLengthFrame
FXHorizontalFrame * myLengthFrame
horizontal frame for length
Definition: GNEFrameAttributesModuls.h:768
GNEFrameAttributesModuls::AttributesEditorFlow::myValueEndTextField
FXTextField * myValueEndTextField
textField for 'end' attribute
Definition: GNEFrameAttributesModuls.h:488
StringTokenizer.h
GNEViewNet::getEditModes
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:434
SUMO_ATTR_END
weights: time range end
Definition: SUMOXMLDefinitions.h:680
GNEAttributeCarrier::TagProperties::canCloseShape
bool canCloseShape() const
return true if tag correspond to an element that can close their shape
Definition: GNEAttributeCarrier.cpp:816
GNEFrameAttributesModuls::AttributesEditorFlow::myAttributeEndRadioButton
FXRadioButton * myAttributeEndRadioButton
Radio button for 'end' attribute.
Definition: GNEFrameAttributesModuls.h:485
GNEFrameAttributesModuls::ParametersEditor::getParametersStr
std::string getParametersStr() const
get parameters as string
Definition: GNEFrameAttributesModuls.cpp:2214
DepartSpeedDefinition
DepartSpeedDefinition
Possible ways to choose the departure speed.
Definition: SUMOVehicleParameter.h:192
VEHPARS_PERIOD_SET
const int VEHPARS_PERIOD_SET
Definition: SUMOVehicleParameter.h:52
SUMO_ATTR_DEPARTPOS
Definition: SUMOXMLDefinitions.h:433
GNEFrameAttributesModuls::AttributesEditorFlow::refreshAttributeEditorFlow
void refreshAttributeEditorFlow()
refresh attribute EditorFlow (only the valid values will be refresh)
Definition: GNEFrameAttributesModuls.cpp:1737
GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow
AttributesEditorRow()
Definition: GNEFrameAttributesModuls.cpp:1427
GNEFrameAttributesModuls::AttributesEditorRow::refreshAttributesEditorRow
void refreshAttributesEditorRow(const std::string &value, bool forceRefresh, bool attributeEnabled)
refresh current row
Definition: GNEFrameAttributesModuls.cpp:1172
MFXUtils::getFXColor
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:113
GNEFrameAttributesModuls::NeteditAttributes::onCmdSetNeteditAttribute
long onCmdSetNeteditAttribute(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:2655
SUMOXMLDefinitions::isValidListOfTypeID
static bool isValidListOfTypeID(const std::string &value)
whether the given string is a valid list of ids for an edge or vehicle type (empty aren't allowed)
Definition: SUMOXMLDefinitions.cpp:1024
SUMO_ATTR_NAME
Definition: SUMOXMLDefinitions.h:380
GNEUndoList
Definition: GNEUndoList.h:48
SUMO_ATTR_VEHSPERHOUR
Definition: SUMOXMLDefinitions.h:786
SUMOVehicleParameter::parseDepartPos
static bool parseDepartPos(const std::string &val, const std::string &element, const std::string &id, double &pos, DepartPosDefinition &dpd, std::string &error)
Validates a given departPos value.
Definition: SUMOVehicleParameter.cpp:312
GUIDesignButtonAttribute
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
Definition: GUIDesigns.h:53
GNEFrameAttributesModuls::ParametersEditor::onCmdSetParameters
long onCmdSetParameters(FXObject *, FXSelector, void *)
Called when user udpate the parameter text field.
Definition: GNEFrameAttributesModuls.cpp:2292
VEHPARS_END_SET
const int VEHPARS_END_SET
Definition: SUMOVehicleParameter.h:50
GNEFrameAttributesModuls::AttributesEditorRow::onCmdSetAttribute
long onCmdSetAttribute(FXObject *, FXSelector, void *)
try to set new attribute value
Definition: GNEFrameAttributesModuls.cpp:1295
GNEFrameAttributesModuls::NeteditAttributes::hideNeteditAttributesModul
void hideNeteditAttributesModul()
hide Netedit attributes modul
Definition: GNEFrameAttributesModuls.cpp:2588
GNEUndoList::p_begin
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:72
GNEFrameAttributesModuls::NeteditAttributes::setEndPosition
double setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const
obtain the End position values of StoppingPlaces and E2 detector over the lane
Definition: GNEFrameAttributesModuls.cpp:2789
GNEFrameAttributesModuls::AttributesEditorRow::stripWhitespaceAfterComma
std::string stripWhitespaceAfterComma(const std::string &stringValue)
removed invalid spaces of Positions and shapes
Definition: GNEFrameAttributesModuls.cpp:1433
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNEFrame.h
GUITexturesHelper::getTextureID
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
Definition: GUITexturesHelper.cpp:112
SUMO_ATTR_NUMBER
Definition: SUMOXMLDefinitions.h:666
SUMO_ATTR_SHAPE
edge: the shape in xml-definition
Definition: SUMOXMLDefinitions.h:690
GNEFrameAttributesModuls::AttributesCreatorRow::disableAttributesCreatorRow
void disableAttributesCreatorRow()
disable row
Definition: GNEFrameAttributesModuls.cpp:276
GNEFrameAttributesModuls::AttributesEditor::getFrameParent
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
Definition: GNEFrameAttributesModuls.cpp:1638
SUMO_TAG_E2DETECTOR
an e2 detector
Definition: SUMOXMLDefinitions.h:67
GNEFrameAttributesModuls::ParametersEditor::getFrameParent
GNEFrame * getFrameParent() const
pointer to frame parent
Definition: GNEFrameAttributesModuls.cpp:2256
GNEFrameAttributesModuls::DrawingShape::myStartDrawingButton
FXButton * myStartDrawingButton
button for start drawing
Definition: GNEFrameAttributesModuls.h:698
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
SUMO_ATTR_ARRIVALLANE
Definition: SUMOXMLDefinitions.h:436
WRITE_DEBUG
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:284
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:54
GNEFrameAttributesModuls::AttributesEditorRow::isAttributesEditorRowValid
bool isAttributesEditorRowValid() const
check if current attribute of TextField/ComboBox is valid
Definition: GNEFrameAttributesModuls.cpp:1231
GNEFrameAttributesModuls::AttributesCreator::showAttributesCreatorModul
void showAttributesCreatorModul(const GNEAttributeCarrier::TagProperties &tagProperties, const std::vector< SumoXMLAttr > &hiddenAttributes)
show AttributesCreator modul
Definition: GNEFrameAttributesModuls.cpp:603
GNEFrameAttributesModuls::AttributesCreator::showWarningMessage
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
Definition: GNEFrameAttributesModuls.cpp:704
GNENet.h
GNEFrameAttributesModuls::AttributesCreator::myAttributesCreatorRows
std::vector< AttributesCreatorRow * > myAttributesCreatorRows
vector with the AttributesCreatorRow
Definition: GNEFrameAttributesModuls.h:209
GNEFrameAttributesModuls::AttributesCreatorFlow::hideAttributesCreatorFlowModul
void hideAttributesCreatorFlowModul()
hide group box
Definition: GNEFrameAttributesModuls.cpp:810
GNEFrameAttributesModuls::DrawingShape
Definition: GNEFrameAttributesModuls.h:628
GNERouteHandler.h
GNEAttributeCarrier::MAXNUMBEROFATTRIBUTES
static const size_t MAXNUMBEROFATTRIBUTES
max number of attributes allowed for every tag
Definition: GNEAttributeCarrier.h:605
GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSetFlowAttribute
long onCmdSetFlowAttribute(FXObject *, FXSelector, void *)
Definition: GNEFrameAttributesModuls.cpp:1750
GNEFrameAttributesModuls::AttributesCreatorFlow::showWarningMessage
void showWarningMessage(std::string extra="") const
show warning message with information about non-valid attributes
Definition: GNEFrameAttributesModuls.cpp:876
GNEUndoList.h
GNEFrameAttributesModuls::NeteditAttributes::myCenterViewAfterCreationFrame
FXHorizontalFrame * myCenterViewAfterCreationFrame
horizontal frame for center view after creation frame
Definition: GNEFrameAttributesModuls.h:792
GNEFrameAttributesModuls::ParametersEditor::getParametersVectorStr
std::vector< std::pair< std::string, std::string > > getParametersVectorStr() const
get parameters as vector of strings
Definition: GNEFrameAttributesModuls.cpp:2228
GUIDesignDialogBox
#define GUIDesignDialogBox
Definition: GUIDesigns.h:433
ArrivalSpeedDefinition
ArrivalSpeedDefinition
Possible ways to choose the arrival speed.
Definition: SUMOVehicleParameter.h:270