43 myAllowUndoRedo(allowUndoRedo),
44 myOverwrite(overwrite) {
54 const std::vector<std::string>& writtenAttributes,
const bool aggregate,
const std::vector<std::string>& edgeIDs,
55 const std::string& edgeFile, std::string excludeEmpty,
const bool withInternal,
56 const std::vector<std::string>& detectPersons,
const double minSamples,
const double maxTravelTime,
57 const std::vector<std::string>& vTypes,
const double speedThreshold) {
64 writeError(
TL(
"Could not build meanDataEdge; ") +
TLF(
"% already exists", ID));
65 }
else if ((edges.size() == edgeIDs.size()) && (attributes.size() == writtenAttributes.size())) {
67 trackVehicles, attributes, aggregate, edgeIDs, edgeFile, excludeEmpty, withInternal,
68 detectPersons, minSamples, maxTravelTime, vTypes, speedThreshold);
74 edgeMeanData->
incRef(
"buildEdgeMeanData");
83 const std::vector<std::string>& writtenAttributes,
const bool aggregate,
const std::vector<std::string>& edgeIDs,
84 const std::string& edgeFile, std::string excludeEmpty,
const bool withInternal,
85 const std::vector<std::string>& detectPersons,
const double minSamples,
const double maxTravelTime,
86 const std::vector<std::string>& vTypes,
const double speedThreshold) {
93 writeError(
TL(
"Could not build meanDataLane; ") +
TLF(
"% already exists", ID));
94 }
else if ((edges.size() == edgeIDs.size()) && (attributes.size() == writtenAttributes.size())) {
96 trackVehicles, attributes, aggregate, edgeIDs, edgeFile, excludeEmpty, withInternal,
97 detectPersons, minSamples, maxTravelTime, vTypes, speedThreshold);
103 edgeMeanData->
incRef(
"buildEdgeMeanData");
111 std::vector<GNEEdge*> edges;
112 for (
const auto& edgeID : edgeIDs) {
115 if (edge ==
nullptr) {
116 writeError(
TLF(
"Could not build % in netedit",
toString(tag)) + std::string(
"; ") +
TL(
"Edge doesn't exist."));
120 edges.push_back(edge);
127std::vector<SumoXMLAttr>
129 std::vector<SumoXMLAttr> attrs;
130 for (
const auto& attrStr : attrStrs) {
132 writeError(
TLF(
"Could not build % in netedit",
toString(tag)) + std::string(
"; ") +
TLF(
"Attribute '%' doesn't exist.", attrStr));
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_MEANDATA_LANE
a lane based mean data detector
@ SUMO_TAG_MEANDATA_EDGE
an edge based mean data detector
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A road/street connecting two junctions (netedit-version)
GNEMeanDataHandler(GNENet *net, const bool allowUndoRedo, const bool overwrite)
Constructor.
std::vector< SumoXMLAttr > parseAttributes(const SumoXMLTag tag, const std::vector< std::string > &attrStrs)
parse attributes
void buildEdgeMeanData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &ID, const std::string &file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles, const std::vector< std::string > &writtenAttributes, const bool aggregate, const std::vector< std::string > &edgeIDs, const std::string &edgeFile, std::string excludeEmpty, const bool withInternal, const std::vector< std::string > &detectPersons, const double minSamples, const double maxTravelTime, const std::vector< std::string > &vTypes, const double speedThreshold)
virtual ~GNEMeanDataHandler()
Destructor.
const bool myAllowUndoRedo
allow undo/redo
void buildLaneMeanData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &ID, const std::string &file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles, const std::vector< std::string > &writtenAttributes, const bool aggregate, const std::vector< std::string > &edgeIDs, const std::string &edgeFile, std::string excludeEmpty, const bool withInternal, const std::vector< std::string > &detectPersons, const double minSamples, const double maxTravelTime, const std::vector< std::string > &vTypes, const double speedThreshold)
Builds laneMeanData.
std::vector< GNEEdge * > parseEdges(const SumoXMLTag tag, const std::vector< std::string > &edgeIDs)
parse edges
GNENet * myNet
pointer to GNENet
An Element which don't belong to GNENet but has influence in the simulation.
GNEMeanData * retrieveMeanData(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named meanData.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
A NBNetBuilder extended by visualisation and editing capabilities.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEViewNet * getViewNet() const
get view net
void incRef(const std::string &debugMsg="")
Increase reference.
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
GNEUndoList * getUndoList() const
get the undoList object
void writeError(const std::string &error)
write error and enable error creating element
static SequentialStringBijection Attrs
The names of SUMO-XML attributes for use in netbuild.
static SequentialStringBijection Tags
The names of SUMO-XML elements for use in netbuild.