Changeset 1689
- Timestamp:
- 08/06/19 13:00:08 (5 years ago)
- Location:
- XIOS/dev/dev_trunk_omp
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/inputs/vis2.html
r1685 r1689 23 23 24 24 #mynetwork { 25 width: 600px;26 height: 600px;25 width: 1000px; 26 height: 1000px; 27 27 border: 1px solid lightgray; 28 28 } 29 29 30 30 #mynetwork1 { 31 width: 600px;32 height: 600px;31 width: 200px; 32 height: 200px; 33 33 border: 1px solid lightgray; 34 34 } … … 217 217 nodes.update(allNode); 218 218 219 node = nodes.get(nodeSelected); 220 connectedEdgeArray = edges.get(network.getConnectedEdges(node.id)); 221 for (j = 0; j < connectedEdgeArray.length; j++) { 222 var edge = connectedEdgeArray[j]; 223 if (edge.from == node.id) { 224 edge.hidden = false; 225 } 226 227 } 228 edges.update(connectedEdgeArray); 229 219 230 allNode = nodes.get(); 220 231 nodes.update(allNode); 221 232 222 233 223 //network1 = new vis.Network(container1, data);234 network1 = new vis.Network(container1, data); 224 235 225 236 … … 895 906 }, 896 907 897 joinCondition: function(nodeOptions) {898 return nodeOptions.cid === 2;899 900 }901 902 908 903 909 }; … … 905 911 //================================================== 906 912 network = new vis.Network(container, data, options); 907 network1 = new vis.Network(container1, data, options);913 //network1 = new vis.Network(container1, data, options); 908 914 909 915 -
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 -
XIOS/dev/dev_trunk_omp/src/node/field.cpp
r1685 r1689 77 77 78 78 //---------------------------------------------------------------- 79 80 81 82 79 83 80 void CField::setVirtualVariableGroup(CVariableGroup* newVVariableGroup) … … 688 685 689 686 //---------------------------------------------------------------- 690 687 691 688 StdString CField::GetName(void) { return StdString("field"); } 692 689 StdString CField::GetDefName(void) { return CField::GetName(); } … … 920 917 TRY 921 918 { 922 923 919 CContext* context = CContext::getCurrent(); 924 920 bool hasClient = context->hasClient; … … 1223 1219 { 1224 1220 fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 1225 instantDataFilter->connectOutput(fileWriterFilter, 0); 1221 instantDataFilter->connectOutput(fileWriterFilter, 0); 1226 1222 } 1227 1223 } … … 1241 1237 if (!field_ref.isEmpty()) 1242 1238 { 1243 CField* fieldRef = CField::get(field_ref); 1244 CGrid* gridRef = fieldRef->grid; 1239 CGrid* gridRef = CField::get(field_ref)->grid; 1245 1240 1246 1241 if (grid && grid != gridRef && grid->hasTransform()) 1247 1242 { 1248 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, 1249 detectMissingValues, defaultValue); 1243 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, detectMissingValues, defaultValue); 1250 1244 1251 1245 filter->connectOutput(filters.first, 0); 1252 1253 1254 1246 filter = filters.second; 1255 1256 1247 } 1257 1248 } … … 1354 1345 TRY 1355 1346 { 1356 1357 1358 1359 1347 if (instantDataFilter || field_ref.isEmpty()) 1360 1348 ERROR("COutputPin* CField::getFieldReference(CGarbageCollector& gc)", … … 1510 1498 1511 1499 selfReferenceFilter = clientSourceFilter; 1512 } 1500 } 1513 1501 } 1514 1502 … … 1536 1524 CContext* context = CContext::getCurrent(); 1537 1525 1538 // Time filter_start;1539 // if(!build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = context->calendar->getInitDate()+build_workflow_graph_start;1540 // else if(build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = 0;1541 // else filter_start = -1;1542 1543 // Time filter_end;1544 // if(!build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = context->calendar->getInitDate()+build_workflow_graph_end;1545 // else if(build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = 9223372036854775807;1546 // else filter_end = -1;1547 1548 // filter_start = this->field_graph_start;1549 // filter_end = this->field_graph_end;1550 1551 // if(CXios::isClient) std::cout<<"getTemporalDataFilter field_id = "<<this->getId()<<" this->field_graph_start = "<<this->field_graph_start<<" this->field_graph_end = "<<this->field_graph_end<<std::endl;1552 1526 1553 1527 if (it == temporalDataFilters.end()) … … 1614 1588 std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 1615 1589 CContext::getCurrent()->getCalendar()->getInitDate(), 1616 freq_op, freq_offset, outFreq, 1617 detectMissingValues)); 1590 freq_op, freq_offset, outFreq, detectMissingValues)); 1618 1591 1619 1592 selfReferenceFilter->connectOutput(temporalFilter, 0);
Note: See TracChangeset
for help on using the changeset viewer.