Changeset 1689 for XIOS/dev/dev_trunk_omp/src/filter
- Timestamp:
- 08/06/19 13:00:08 (5 years ago)
- Location:
- XIOS/dev/dev_trunk_omp/src/filter
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/filter/binary_arithmetic_filter.cpp
r1681 r1689 77 77 CDataPacketPtr CScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 78 78 { 79 80 79 CDataPacketPtr packet(new CDataPacket); 81 80 packet->date = data[0]->date; … … 166 165 CDataPacketPtr CFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 167 166 { 168 169 167 CDataPacketPtr packet(new CDataPacket); 170 168 packet->date = data[0]->date; … … 271 269 CDataPacketPtr CFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 272 270 { 273 274 271 CDataPacketPtr packet(new CDataPacket); 275 272 packet->date = data[0]->date; -
XIOS/dev/dev_trunk_omp/src/filter/file_server_writer_filter.cpp
r1681 r1689 28 28 return true; 29 29 } 30 31 32 30 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/file_server_writer_filter.hpp
r1679 r1689 37 37 bool virtual isDataExpected(const CDate& date) const; 38 38 39 40 39 protected: 41 40 /*! … … 49 48 CField* field; //<! The associated field 50 49 std::map<Time, CDataPacketPtr> packets; //<! The stored packets 51 52 50 }; // class CFileServerWriterFilter 53 51 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.cpp
r1685 r1689 73 73 74 74 field->sendUpdateData(dataArray); 75 76 77 78 75 } 79 76 … … 87 84 return true; 88 85 } 89 90 91 92 86 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.hpp
r1681 r1689 48 48 */ 49 49 bool virtual isDataExpected(const CDate& date) const; 50 51 52 50 53 51 protected: … … 62 60 private: 63 61 std::map<Time, CDataPacketPtr> packets; //<! The stored packets 64 65 62 }; // class CFileWriterFilter 66 63 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/filter.cpp
r1679 r1689 16 16 CDataPacketPtr outputPacket = engine->apply(data); 17 17 if (outputPacket) 18 {19 18 onOutputReady(outputPacket); 20 }21 19 } 22 20 … … 54 52 return COutputPin::isDataExpected(date); 55 53 } 56 57 58 54 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/input_pin.cpp
r1679 r1689 83 83 inputs.erase(inputs.begin(), inputs.lower_bound(timestamp)); 84 84 } 85 86 87 88 89 90 85 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/input_pin.hpp
r1677 r1689 18 18 { 19 19 public: 20 21 20 /*! 22 21 * Constructs an input pin with the specified number of slots … … 82 81 */ 83 82 void virtual invalidate(Time timestamp); 84 85 83 86 84 protected: -
XIOS/dev/dev_trunk_omp/src/filter/output_pin.cpp
r1685 r1689 5 5 namespace xios 6 6 { 7 8 9 7 COutputPin::COutputPin(CGarbageCollector& gc, bool manualTrigger /*= false*/) 10 8 : gc(gc) … … 34 32 ERROR("void COutputPin::onOutputReady(CDataPacketPtr packet)", 35 33 "The packet cannot be null."); 36 37 34 38 35 if (manualTrigger) // Don't use canBeTriggered here, this function is virtual and can be overriden -
XIOS/dev/dev_trunk_omp/src/filter/output_pin.hpp
r1685 r1689 34 34 * \param gc the garbage collector associated with this ouput pin 35 35 * \param slotsCount the number of slots 36 * \param buildWorkflowGraph indicates whether data will be visualized37 36 */ 38 37 COutputPin(CGarbageCollector& gc, bool manualTrigger = false); … … 118 117 //! Output buffer, store the packets until the output is triggered 119 118 std::map<Time, CDataPacketPtr> outputPackets; 120 121 119 }; // class COutputPin 122 120 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/pass_through_filter.cpp
r1685 r1689 18 18 if(building_graph) 19 19 { 20 std::cout<<"pass through packet->distance = "<<data[0]->distance<<std::endl;21 20 // std::cout<<"CPassThroughFilter::apply field_id = "<<this->field->getId()<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 22 21 this->filterID = InvalidableObject::filterIdGenerator++; … … 45 44 46 45 data[0]->field = this->field; 47 48 46 } 49 47 … … 53 51 return data[0]; 54 52 } 55 56 53 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/source_filter.cpp
r1681 r1689 28 28 { 29 29 bool building_graph = this->tag ? packet->timestamp >= this->field->field_graph_start && packet->timestamp <= this->field->field_graph_end : false; 30 // bool building_graph = this->tag ? packet->timestamp >= this->start_graph && packet->timestamp <= this->end_graph : false;31 32 // std::cout<<"************************************************source filter 1 : field_id = "<<this->field->getId()<<" this->start_graph = "<<this->start_graph<<" this->end_graph = "<<this->end_graph<<std::endl;33 // std::cout<<"************************************************source filter 2 : field_id = "<<this->field->getId()<<" this->field->field_graph_start = "<<this->field->field_graph_start<<" this->field->field_graph_end = "<<this->field->field_graph_end<<std::endl;34 35 30 if(building_graph) 36 31 { … … 40 35 packet->distance = 1; 41 36 42 // if(CXios::isClient) std::cout<<"source filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl;43 37 44 38 CWorkflowGraph::allocNodeEdge(); … … 52 46 } 53 47 54 // if(building_graph) std::cout<<packet->timestamp<<"************************************************ source filter : field_id = "<<this->field->getId()<<" start = "<<this->field->field_graph_start<<" end_graph = "<<this->field->field_graph_end<<std::endl;55 48 } 56 49 … … 107 100 template void CSourceFilter::streamData<7>(CDate date, const CArray<double, 7>& data); 108 101 109 110 111 102 void CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data) 112 103 { … … 157 148 onOutputReady(packet); 158 149 } 159 160 161 150 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/source_filter.hpp
r1681 r1689 75 75 const bool compression ; //!< indicates if data need to be compressed : on client side : true, on server side : false 76 76 const bool mask ; //!< indicates whether grid mask should be applied (true for clients, false for servers) 77 78 77 }; // class CSourceFilter 79 78 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp
r1685 r1689 12 12 namespace xios 13 13 { 14 CSpatialTransformFilter::CSpatialTransformFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, 15 double outputValue, size_t inputSlotsCount) 14 CSpatialTransformFilter::CSpatialTransformFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, double outputValue, size_t inputSlotsCount) 16 15 : CFilter(gc, inputSlotsCount, engine), outputDefaultValue(outputValue) 17 16 { /* Nothing to do */ } … … 43 42 44 43 std::shared_ptr<CSpatialTransformFilter> filter ; 45 if( isSpatialTemporal) 46 filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTemporalFilter(gc, engine, gridTransformation, defaultValue, inputCount)); 47 else 48 filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount)); 44 if( isSpatialTemporal) filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTemporalFilter(gc, engine, gridTransformation, defaultValue, inputCount)); 45 else filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount)); 49 46 50 47 … … 52 49 lastFilter = filter; 53 50 else 54 {55 51 filter->connectOutput(firstFilter, 0); 56 }57 52 58 53 firstFilter = filter; … … 73 68 void CSpatialTransformFilter::onInputReady(std::vector<CDataPacketPtr> data) 74 69 { 75 76 70 CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine); 77 71 CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field); 78 72 if (outputPacket) 79 {80 73 onOutputReady(outputPacket); 81 } 82 } 83 84 CSpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, 85 CGridTransformation* gridTransformation, double outputValue, 86 size_t inputSlotsCount) 74 } 75 76 CSpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount) 87 77 : CSpatialTransformFilter(gc, engine, outputValue, inputSlotsCount), record(0) 88 78 { … … 110 100 void CSpatialTemporalFilter::onInputReady(std::vector<CDataPacketPtr> data) 111 101 { 112 113 102 CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine); 114 103 CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field); … … 160 149 ERROR("CSpatialTransformFilterEngine& CSpatialTransformFilterEngine::get(CGridTransformation* gridTransformation)", 161 150 "Impossible to get the requested engine, the grid transformation is invalid."); 162 163 151 if(engines_ptr == NULL) engines_ptr = new std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> >; 164 165 152 166 153 std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> >::iterator it = engines_ptr->find(gridTransformation); … … 216 203 packet->timestamp = data[0]->timestamp; 217 204 packet->status = data[0]->status; 218 219 205 220 206 if (packet->status == CDataPacket::NO_ERROR) -
XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.hpp
r1685 r1689 73 73 * \param outputValue default value of output pin 74 74 * \param [in] inputSlotsCount number of input, by default there is only one for field src 75 *76 75 */ 77 CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, 78 double outputValue, size_t inputSlotsCount = 1); 76 CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount = 1); 79 77 80 78 -
XIOS/dev/dev_trunk_omp/src/filter/store_filter.cpp
r1685 r1689 167 167 packets.erase(packets.begin(), packets.lower_bound(timestamp)); 168 168 } 169 170 171 169 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/store_filter.hpp
r1681 r1689 100 100 const double missingValue; //!< The value to use to replace missing values 101 101 std::map<Time, CDataPacketPtr> packets; //<! The stored packets 102 103 104 102 }; // class CStoreFilter 105 103 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp
r1685 r1689 126 126 packet->data.resize(tmpData.numElements()); 127 127 packet->data = tmpData; 128 129 128 } 130 129 else … … 139 138 packet->src_filterID=this->filterID; 140 139 packet->distance = data[0]->distance+1; 141 std::cout<<"temporal packet->distance = "<<packet->distance<<std::endl;142 140 this->filterIDoutputs.clear(); 143 141 CWorkflowGraph::build_begin=true; -
XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.hpp
r1681 r1689 77 77 // CDate nextOperationDate; //!< The date of the next operation 78 78 bool isFirstOperation; //!< True before the first operation was been computed 79 80 79 }; // class CTemporalFilter 81 80 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/ternary_arithmetic_filter.cpp
r1681 r1689 76 76 CDataPacketPtr CScalarScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 77 77 { 78 79 78 CDataPacketPtr packet(new CDataPacket); 80 79 packet->date = data[0]->date; … … 166 165 CDataPacketPtr CScalarFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 167 166 { 168 169 167 CDataPacketPtr packet(new CDataPacket); 170 168 packet->date = data[0]->date; … … 270 268 CDataPacketPtr CScalarFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 271 269 { 272 273 270 CDataPacketPtr packet(new CDataPacket); 274 271 packet->date = data[0]->date; … … 368 365 CDataPacketPtr CFieldScalarScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 369 366 { 370 371 367 CDataPacketPtr packet(new CDataPacket); 372 368 packet->date = data[0]->date; … … 473 469 CDataPacketPtr CFieldScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 474 470 { 475 476 471 CDataPacketPtr packet(new CDataPacket); 477 472 packet->date = data[0]->date; … … 584 579 CDataPacketPtr CFieldFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 585 580 { 586 587 581 CDataPacketPtr packet(new CDataPacket); 588 582 packet->date = data[0]->date; … … 707 701 CDataPacketPtr CFieldFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 708 702 { 709 710 703 CDataPacketPtr packet(new CDataPacket); 711 704 packet->date = data[0]->date; -
XIOS/dev/dev_trunk_omp/src/filter/unary_arithmetic_filter.cpp
r1681 r1689 71 71 CDataPacketPtr CUnaryArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 72 72 { 73 74 73 CDataPacketPtr packet(new CDataPacket); 75 74 packet->date = data[0]->date; … … 91 90 } 92 91 } // namespace xios 93
Note: See TracChangeset
for help on using the changeset viewer.