Ignore:
Timestamp:
06/25/19 16:14:54 (5 years ago)
Author:
yushan
Message:

MARK: Dynamic workflow graph developement. Branch up to date with trunk @1663.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp

    r1668 r1677  
    22#include "functor_type.hpp" 
    33#include "calendar_util.hpp" 
     4#include "workflow_graph.hpp" 
    45 
    56namespace xios 
     
    3233  CDataPacketPtr CTemporalFilter::apply(std::vector<CDataPacketPtr> data) 
    3334  { 
     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     
    3458    CDataPacketPtr packet; 
    3559 
     
    4266      { 
    4367        usePacket = (data[0]->date >= nextSamplingDate); 
    44 //        outputResult = (data[0]->date + samplingFreq > nextOperationDate); 
    4568        outputResult = (data[0]->date  > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth); 
    4669        copyLess = (isInstantOperation && usePacket && outputResult); 
     
    79102 
    80103        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(); 
    82107      } 
    83108    } 
Note: See TracChangeset for help on using the changeset viewer.