40 myAllowUndoRedo(allowUndoRedo) {
52 const std::string& file,
const std::string& type,
const SUMOTime period,
const SUMOTime begin,
53 const SUMOTime end,
const bool trackVehicles,
const std::vector<std::string>& writtenAttributes,
54 const bool aggregate,
const std::vector<std::string>& edgeIDs,
const std::string& edgeFile,
55 const std::string& excludeEmpty,
const bool withInternal,
const std::vector<std::string>& detectPersons,
56 const double minSamples,
const double maxTravelTime,
const std::vector<std::string>& vTypes,
57 const double speedThreshold) {
81 }
else if ((edges.size() == edgeIDs.size()) && (attributes.size() == writtenAttributes.size())) {
83 trackVehicles, attributes, aggregate, edgeIDs, edgeFile, excludeEmpty, withInternal,
84 detectPersons, minSamples, maxTravelTime, vTypes, speedThreshold);
91 edgeMeanData->
incRef(
"buildEdgeMeanData");
102 const std::string& file,
const std::string& type,
const SUMOTime period,
const SUMOTime begin,
103 const SUMOTime end,
const bool trackVehicles,
const std::vector<std::string>& writtenAttributes,
104 const bool aggregate,
const std::vector<std::string>& edgeIDs,
const std::string& edgeFile,
105 const std::string& excludeEmpty,
const bool withInternal,
const std::vector<std::string>& detectPersons,
106 const double minSamples,
const double maxTravelTime,
const std::vector<std::string>& vTypes,
107 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) {
195 return writeWarningDuplicated(tag, meanDataElement->getID(), meanDataElement->getTagProperty()->getTag());
205 return writeWarningDuplicated(tag, meanDataElement->getID(), meanDataElement->getTagProperty()->getTag());
217 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 myOverwriteElements
overwrite elements
bool checkValidAdditionalID(const SumoXMLTag tag, const std::string &value)
check if the given additional ID is valid
FileBucket * myFileBucket
fileBucket
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
bool myRemainElements
remain elements
void updateOptions()
update options
GNEApplicationWindowHelper::FileBucketHandler * getFileBucketHandler() const
get file bucket handler
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
std::vector< SumoXMLAttr > parseAttributes(const SumoXMLTag tag, const std::vector< std::string > &attrStrs)
parse attributes
bool checkExcludeEmpty(const SumoXMLTag tag, const std::string &id, const std::string &excludeEmpty)
check if given excludeEmpty is valid
GNEMeanDataHandler()=delete
invalidate default onstructor
bool buildEdgeMeanData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &file, const std::string &type, const SUMOTime period, const SUMOTime begin, const SUMOTime end, const bool trackVehicles, const std::vector< std::string > &writtenAttributes, const bool aggregate, const std::vector< std::string > &edgeIDs, const std::string &edgeFile, const 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 edgeMeanData.
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
bool buildLaneMeanData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &id, const std::string &file, const std::string &type, const SUMOTime period, const SUMOTime begin, const SUMOTime end, const bool trackVehicles, const std::vector< std::string > &writtenAttributes, const bool aggregate, const std::vector< std::string > &edgeIDs, const std::string &edgeFile, const 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
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
void deleteMeanData(GNEMeanData *meanData, GNEUndoList *undoList)
remove generic data
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
GNEApplicationWindow * getGNEApplicationWindow() const
get tag properties database
GNEUndoList * getUndoList() const
get undo list(used for simplify code)
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...
static StringBijection< ExcludeEmpty > ExcludeEmptys
exclude empty values
static SequentialStringBijection Attrs
The names of SUMO-XML attributes for use in netbuild.