Changeset 1686 for XIOS/dev/dev_olga/src/filter/store_filter.cpp
- Timestamp:
- 07/31/19 13:51:01 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/filter/store_filter.cpp
r1654 r1686 3 3 #include "grid.hpp" 4 4 #include "timer.hpp" 5 #include "file.hpp" 5 6 6 7 namespace xios … … 21 22 ERROR("CStoreFilter::CStoreFilter(CContext* context, CGrid* grid)", 22 23 "Impossible to construct a store filter without providing a grid."); 23 // filterId = InvalidableObject::count;24 // InvalidableObject::count++;25 24 } 26 25 … … 78 77 template CDataPacket::StatusCode CStoreFilter::getData<7>(Time timestamp, CArray<double, 7>& data); 79 78 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 80 106 void CStoreFilter::onInputReady(std::vector<CDataPacketPtr> data) 81 107 { 108 buildGraph(data); 82 109 83 110 CDataPacketPtr packet; … … 128 155 packets.erase(packets.begin(), packets.lower_bound(timestamp)); 129 156 } 130 131 int CStoreFilter::getFilterId(void)132 {133 return filterId;134 }135 136 157 } // namespace xios
Note: See TracChangeset
for help on using the changeset viewer.