Ignore:
Timestamp:
09/11/19 10:22:09 (5 years ago)
Author:
yushan
Message:

Introducing the new graph functionality. Attribute build_workflow_graph=.TRUE. is used in the field definition section in the xml file to enable the workflow graph of the field and other fields referecing to it. A more detailed document will be available soon on the graph fuctionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/filter/store_filter.cpp

    r1474 r1704  
    33#include "grid.hpp" 
    44#include "timer.hpp" 
     5#include "file.hpp" 
    56 
    67namespace xios 
     
    7677  template CDataPacket::StatusCode CStoreFilter::getData<7>(Time timestamp, CArray<double, 7>& data); 
    7778 
     79  void CStoreFilter::buildGraph(std::vector<CDataPacketPtr> data) 
     80  { 
     81    bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 
     82 
     83    if(building_graph) 
     84    { 
     85      this->filterID = InvalidableObject::filterIdGenerator++; 
     86      int edgeID = InvalidableObject::edgeIdGenerator++; 
     87 
     88      CWorkflowGraph::allocNodeEdge(); 
     89  
     90      CWorkflowGraph::addNode(this->filterID, "Store Filter", 7, 0, 1, data[0]); 
     91      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = ++(data[0]->distance); 
     92      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 
     93      if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 
     94 
     95      // if(CXios::isClient) std::cout<<"CStoreFilter::apply filter tag = "<<this->tag<<std::endl; 
     96 
     97      if(CXios::isClient && CWorkflowGraph::build_begin)  
     98      { 
     99        CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]);; 
     100        (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0; 
     101      } 
     102      else CWorkflowGraph::build_begin = true; 
     103    } 
     104  } 
     105 
    78106  void CStoreFilter::onInputReady(std::vector<CDataPacketPtr> data) 
    79107  { 
     108    buildGraph(data); 
    80109 
    81110    CDataPacketPtr packet; 
Note: See TracChangeset for help on using the changeset viewer.