37 myAllowUndoRedo(allowUndoRedo),
38 myOverwrite(overwrite) {
55 const std::vector<std::string>& writtenAttributes,
const bool aggregate,
const std::vector<std::string>& edgeIDs,
56 const std::string& edgeFile, std::string excludeEmpty,
const bool withInternal,
57 const std::vector<std::string>& detectPersons,
const double minSamples,
const double maxTravelTime,
58 const std::vector<std::string>& vTypes,
const double speedThreshold) {
82 }
else if ((edges.size() == edgeIDs.size()) && (attributes.size() == writtenAttributes.size())) {
84 trackVehicles, attributes, aggregate, edgeIDs, edgeFile, excludeEmpty, withInternal,
85 detectPersons, minSamples, maxTravelTime, vTypes, speedThreshold);
92 edgeMeanData->
incRef(
"buildEdgeMeanData");
104 const std::vector<std::string>& writtenAttributes,
const bool aggregate,
const std::vector<std::string>& edgeIDs,
105 const std::string& edgeFile, std::string excludeEmpty,
const bool withInternal,
106 const std::vector<std::string>& detectPersons,
const double minSamples,
const double maxTravelTime,
107 const std::vector<std::string>& vTypes,
const double speedThreshold) {
131 }
else if ((edges.size() == edgeIDs.size()) && (attributes.size() == writtenAttributes.size())) {
133 trackVehicles, attributes, aggregate, edgeIDs, edgeFile, excludeEmpty, withInternal,
134 detectPersons, minSamples, maxTravelTime, vTypes, speedThreshold);
141 edgeMeanData->
incRef(
"buildEdgeMeanData");
152 std::vector<GNEEdge*> edges;
153 for (
const auto& edgeID : edgeIDs) {
156 if (edge ==
nullptr) {
157 writeError(
TLF(
"Could not build % in netedit",
toString(tag)) + std::string(
"; ") +
TL(
"Edge doesn't exist."));
161 edges.push_back(edge);
168std::vector<SumoXMLAttr>
170 std::vector<SumoXMLAttr> attrs;
171 for (
const auto& attrStr : attrStrs) {
175 writeError(
TLF(
"Could not build % in netedit",
toString(tag)) + std::string(
"; ") +
TLF(
"Attribute '%' doesn't exist.", attrStr));
189 if (meanDataElement) {
207 if (GNEAttributeCarrier::canParse<bool>(excludeEmpty)) {
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.
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_MAX_TRAVELTIME
@ SUMO_ATTR_HALTING_SPEED_THRESHOLD
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_EXCLUDE_EMPTY
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
bool writeError(const std::string &error)
write error and enable error creating element
bool writeWarningDuplicated(const SumoXMLTag tag, const std::string &id, const SumoXMLTag checkedTag)
write warning duplicated element
bool checkValidAdditionalID(const SumoXMLTag tag, const std::string &value)
check if the given additional ID is valid
const std::string myFilename
filename
bool checkNegative(const SumoXMLTag tag, const std::string &id, const SumoXMLAttr attribute, const int value, const bool canBeZero)
check if the given int value is NOT negative
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.
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)
bool checkExcludeEmpty(const SumoXMLTag tag, const std::string &id, const std::string &excludeEmpty)
check if given excludeEmpty is valid
const bool myOverwrite
check if overwrite
GNEMeanDataHandler()=delete
invalidate default onstructor
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
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
The XML-Handler for network loading.
static StringBijection< ExcludeEmpty > ExcludeEmptys
exclude empty values
static SequentialStringBijection Attrs
The names of SUMO-XML attributes for use in netbuild.