43 myAllowUndoRedo(allowUndoRedo),
44 myOverwrite(overwrite) {
61 const std::vector<std::string>& writtenAttributes,
const bool aggregate,
const std::vector<std::string>& edgeIDs,
62 const std::string& edgeFile, std::string excludeEmpty,
const bool withInternal,
63 const std::vector<std::string>& detectPersons,
const double minSamples,
const double maxTravelTime,
64 const std::vector<std::string>& vTypes,
const double speedThreshold) {
74 }
else if ((edges.size() == edgeIDs.size()) && (attributes.size() == writtenAttributes.size())) {
76 trackVehicles, attributes, aggregate, edgeIDs, edgeFile, excludeEmpty, withInternal,
77 detectPersons, minSamples, maxTravelTime, vTypes, speedThreshold);
84 edgeMeanData->
incRef(
"buildEdgeMeanData");
96 const std::vector<std::string>& writtenAttributes,
const bool aggregate,
const std::vector<std::string>& edgeIDs,
97 const std::string& edgeFile, std::string excludeEmpty,
const bool withInternal,
98 const std::vector<std::string>& detectPersons,
const double minSamples,
const double maxTravelTime,
99 const std::vector<std::string>& vTypes,
const double speedThreshold) {
109 }
else if ((edges.size() == edgeIDs.size()) && (attributes.size() == writtenAttributes.size())) {
111 trackVehicles, attributes, aggregate, edgeIDs, edgeFile, excludeEmpty, withInternal,
112 detectPersons, minSamples, maxTravelTime, vTypes, speedThreshold);
119 edgeMeanData->
incRef(
"buildEdgeMeanData");
130 std::vector<GNEEdge*> edges;
131 for (
const auto& edgeID : edgeIDs) {
134 if (edge ==
nullptr) {
135 writeError(
TLF(
"Could not build % in netedit",
toString(tag)) + std::string(
"; ") +
TL(
"Edge doesn't exist."));
139 edges.push_back(edge);
146std::vector<SumoXMLAttr>
148 std::vector<SumoXMLAttr> attrs;
149 for (
const auto& attrStr : attrStrs) {
153 writeError(
TLF(
"Could not build % in netedit",
toString(tag)) + std::string(
"; ") +
TLF(
"Attribute '%' doesn't exist.", attrStr));
167 if (meanDataElement) {
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)
bool writeError(const std::string &error)
write error and enable error creating element
bool writeErrorDuplicated(const SumoXMLTag tag, const std::string &id, const SumoXMLTag checkedTag)
write error "duplicated additional"
bool checkValidAdditionalID(const SumoXMLTag tag, const std::string &value)
check if the given additional ID is valid
A road/street connecting two junctions (netedit-version)
bool 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.
GNEMeanDataHandler(GNENet *net, const bool allowUndoRedo, const bool overwrite)
Constructor.
bool postParserTasks()
run post parser tasks
std::vector< SumoXMLAttr > parseAttributes(const SumoXMLTag tag, const std::vector< std::string > &attrStrs)
parse attributes
bool 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)
const bool myOverwrite
check if overwrite
bool checkDuplicatedMeanDataElement(const SumoXMLTag tag, const std::string &id)
check if given ID correspond to a duplicated mean data element
virtual ~GNEMeanDataHandler()
Destructor.
const bool myAllowUndoRedo
allow undo/redo
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.
void insertMeanData(GNEMeanData *meanData)
Insert a meanData element in container.
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
A NBNetBuilder extended by visualisation and editing capabilities.
void deleteMeanData(GNEMeanData *meanData, GNEUndoList *undoList)
remove generic data
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
static SequentialStringBijection Attrs
The names of SUMO-XML attributes for use in netbuild.