Ignore:
Timestamp:
07/31/19 13:51:01 (5 years ago)
Author:
yushan
Message:

backup for trunk with graph

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/filter/store_filter.cpp

    r1654 r1686  
    33#include "grid.hpp" 
    44#include "timer.hpp" 
     5#include "file.hpp" 
    56 
    67namespace xios 
     
    2122      ERROR("CStoreFilter::CStoreFilter(CContext* context, CGrid* grid)", 
    2223            "Impossible to construct a store filter without providing a grid."); 
    23 //    filterId = InvalidableObject::count; 
    24 //    InvalidableObject::count++; 
    2524  } 
    2625 
     
    7877  template CDataPacket::StatusCode CStoreFilter::getData<7>(Time timestamp, CArray<double, 7>& data); 
    7978 
     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 
    80106  void CStoreFilter::onInputReady(std::vector<CDataPacketPtr> data) 
    81107  { 
     108    buildGraph(data); 
    82109 
    83110    CDataPacketPtr packet; 
     
    128155    packets.erase(packets.begin(), packets.lower_bound(timestamp)); 
    129156  } 
    130  
    131   int CStoreFilter::getFilterId(void) 
    132   { 
    133     return filterId; 
    134   } 
    135  
    136157} // namespace xios 
Note: See TracChangeset for help on using the changeset viewer.