Changeset 1679 for XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp
- Timestamp:
- 07/02/19 11:42:27 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp
r1677 r1679 10 10 CTemporalFilter::CTemporalFilter(CGarbageCollector& gc, const std::string& opId, 11 11 const CDate& initDate, const CDuration samplingFreq, const CDuration samplingOffset, const CDuration opFreq, 12 bool ignoreMissingValue /*= false*/ , bool buildWorkflowGraph /*= false*/)13 : CFilter(gc, 1, this , buildWorkflowGraph)12 bool ignoreMissingValue /*= false*/) 13 : CFilter(gc, 1, this) 14 14 , functor(createFunctor(opId, ignoreMissingValue, tmpData)) 15 15 , isOnceOperation(functor->timeType() == func::CFunctor::once) … … 33 33 CDataPacketPtr CTemporalFilter::apply(std::vector<CDataPacketPtr> data) 34 34 { 35 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 35 36 36 if( this->tag)37 if(building_graph) 37 38 { 38 39 if(this->filterIDoutputs.size()==0) this->filterID = InvalidableObject::filterIdGenerator++; 40 int edgeID = InvalidableObject::edgeIdGenerator++; 39 41 40 42 41 std::cout<<"CTemporalFilter::apply filter tag = "<<this->tag<< std::endl;43 std::cout<<"CTemporalFilter::apply filter tag = "<<this->tag<<" start = "<<this->start_graph<<" end = "<<this->end_graph<<std::endl; 42 44 43 if(CWorkflowGraph::mapFieldToFilters_ptr ==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int>>;45 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 44 46 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>; 47 if(CWorkflowGraph::build_begin) 48 { 51 49 52 if(this->filterIDoutputs.size()==0) (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "Temporal Filter"; 50 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 51 52 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 53 } 54 55 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 56 57 if(this->filterIDoutputs.size()==0) 58 { 59 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "Temporal Filter"; 60 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 3; 61 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 62 // (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = (initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth) / data[0]->date +1 ; 63 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb =-1; 64 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 65 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 66 } 67 53 68 54 69 this->filterIDoutputs.push_back(data[0]->src_filterID); … … 102 117 103 118 isFirstOperation = false; 104 if(this->tag) packet->src_filterID=this->filterID; 105 packet->fieldID = this->output_field_id; 106 if(this->tag) this->filterIDoutputs.clear(); 119 if(building_graph) packet->src_filterID=this->filterID; 120 packet->field = this->field; 121 if(building_graph) this->filterIDoutputs.clear(); 122 if(building_graph) CWorkflowGraph::build_begin=true; 107 123 } 108 124 }
Note: See TracChangeset
for help on using the changeset viewer.