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/unary_arithmetic_filter.cpp

    r643 r1677  
    11#include "unary_arithmetic_filter.hpp" 
    2  
     2#include "workflow_graph.hpp" 
    33namespace xios 
    44{ 
     
    66    : CFilter(gc, 1, this) 
    77    , op(operatorExpr.getOpField(op)) 
    8   { /* Nothing to do */ }; 
     8  {  
     9    StdString input_op_expression=op; 
     10    if(input_op_expression == "neg") 
     11      op_expression = "-"; 
     12    else if(input_op_expression == "sin") 
     13      op_expression = "sin"; 
     14    else if(input_op_expression == "cos") 
     15      op_expression = "cos"; 
     16    else if(input_op_expression == "tan") 
     17      op_expression = "tan"; 
     18    else if(input_op_expression == "exp") 
     19      op_expression = "exp"; 
     20    else if(input_op_expression == "log") 
     21      op_expression = "log"; 
     22    else if(input_op_expression == "log10") 
     23      op_expression = "log10"; 
     24    else if(input_op_expression == "sqrt") 
     25      op_expression = "sqrt"; 
     26    else 
     27      op_expression = " "; 
     28  }; 
    929 
    1030  CDataPacketPtr CUnaryArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    1131  { 
     32    if(this->tag) 
     33    { 
     34      this->filterID = InvalidableObject::filterIdGenerator++; 
     35       
     36      if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 
     37      if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 
     38 
     39 
     40      (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = op_expression +" F Filter" ; 
     41      std::cout<<"CunaryArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 
     42 
     43      StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 
     44      (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 
     45      (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID);    
     46   
     47    } 
     48 
    1249    CDataPacketPtr packet(new CDataPacket); 
    1350    packet->date = data[0]->date; 
    1451    packet->timestamp = data[0]->timestamp; 
    1552    packet->status = data[0]->status; 
     53    packet->fieldID = this->output_field_id; 
    1654 
    1755    if (packet->status == CDataPacket::NO_ERROR) 
    1856      packet->data.reference(op(data[0]->data)); 
    1957 
     58    if(this->tag) packet->src_filterID = this->filterID; 
     59 
    2060    return packet; 
    2161  } 
Note: See TracChangeset for help on using the changeset viewer.