Changeset 1677 for XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp
- Timestamp:
- 06/25/19 16:14:54 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp
r1668 r1677 2 2 #include "functor_type.hpp" 3 3 #include "calendar_util.hpp" 4 #include "workflow_graph.hpp" 4 5 5 6 namespace xios … … 32 33 CDataPacketPtr CTemporalFilter::apply(std::vector<CDataPacketPtr> data) 33 34 { 35 36 if(this->tag) 37 { 38 if(this->filterIDoutputs.size()==0) this->filterID = InvalidableObject::filterIdGenerator++; 39 40 41 std::cout<<"CTemporalFilter::apply filter tag = "<<this->tag<<std::endl; 42 43 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 44 45 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 46 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 47 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 48 49 50 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 51 52 if(this->filterIDoutputs.size()==0) (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "Temporal Filter"; 53 54 this->filterIDoutputs.push_back(data[0]->src_filterID); 55 } 56 57 34 58 CDataPacketPtr packet; 35 59 … … 42 66 { 43 67 usePacket = (data[0]->date >= nextSamplingDate); 44 // outputResult = (data[0]->date + samplingFreq > nextOperationDate);45 68 outputResult = (data[0]->date > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth); 46 69 copyLess = (isInstantOperation && usePacket && outputResult); … … 79 102 80 103 isFirstOperation = false; 81 // nextOperationDate = initDate + samplingFreq + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth; 104 if(this->tag) packet->src_filterID=this->filterID; 105 packet->fieldID = this->output_field_id; 106 if(this->tag) this->filterIDoutputs.clear(); 82 107 } 83 108 }
Note: See TracChangeset
for help on using the changeset viewer.