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

    r1671 r1677  
    44#include "utils.hpp" 
    55#include "workflow_graph.hpp" 
     6#include "graphviz.hpp" 
     7 
     8using namespace ep_lib; 
    69 
    710namespace xios 
     
    1417      ERROR("CFileWriterFilter::CFileWriterFilter(CField* field)", 
    1518            "The field cannot be null."); 
    16     if (buildWorkflowGraph) 
    17     { 
    18       filterId = InvalidableObject::count; 
    19       InvalidableObject::count++; 
    20     } 
    2119  } 
    2220 
    2321  void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 
    2422  { 
     23    if(this->tag) 
     24    { 
     25      this->filterID = InvalidableObject::filterIdGenerator++; 
     26 
     27      if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 
     28      if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 
     29 
     30      (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "File Writer Filter"; 
     31 
     32      if(CXios::isClient) std::cout<<"CFileWriterFilter::apply filter tag = "<<this->tag<<std::endl; 
     33 
     34      if(CXios::isClient)  
     35      { 
     36        StdString str = this->output_field_id +" ts=" + to_string(data[0]->timestamp); 
     37        // StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 
     38        (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 
     39        (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID);   
     40      } 
     41    } 
     42     
    2543    const bool detectMissingValue = ( !field->default_value.isEmpty() && 
    2644                               ( (!field->detect_missing_value.isEmpty() || field->detect_missing_value == true) 
     
    4159 
    4260    field->sendUpdateData(dataArray); 
     61     
     62     
     63     
    4364  } 
    4465 
     
    5374  } 
    5475 
    55   int CFileWriterFilter::getFilterId(void) 
    56   { 
    57     return filterId; 
    58   } 
     76 
    5977 
    6078} // namespace xios 
Note: See TracChangeset for help on using the changeset viewer.