Changeset 1689


Ignore:
Timestamp:
08/06/19 13:00:08 (5 years ago)
Author:
yushan
Message:

dev for graph. up to date with trunk at r1684

Location:
XIOS/dev/dev_trunk_omp
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/inputs/vis2.html

    r1685 r1689  
    2323 
    2424        #mynetwork { 
    25             width: 600px; 
    26             height: 600px; 
     25            width: 1000px; 
     26            height: 1000px; 
    2727            border: 1px solid lightgray; 
    2828        } 
    2929 
    3030        #mynetwork1 { 
    31             width: 600px; 
    32             height: 600px; 
     31            width: 200px; 
     32            height: 200px; 
    3333            border: 1px solid lightgray; 
    3434        } 
     
    217217                nodes.update(allNode); 
    218218 
     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 
    219230                allNode = nodes.get(); 
    220231                nodes.update(allNode); 
    221232 
    222233 
    223                 // network1 = new vis.Network(container1, data); 
     234                network1 = new vis.Network(container1, data); 
    224235 
    225236 
     
    895906                                }, 
    896907 
    897                                 joinCondition: function(nodeOptions) { 
    898                                     return nodeOptions.cid === 2; 
    899  
    900                                 } 
    901  
    902908 
    903909                            }; 
     
    905911                            //================================================== 
    906912                            network = new vis.Network(container, data, options); 
    907                             network1 = new vis.Network(container1, data, options); 
     913                            //network1 = new vis.Network(container1, data, options); 
    908914                             
    909915 
  • XIOS/dev/dev_trunk_omp/src/filter/binary_arithmetic_filter.cpp

    r1681 r1689  
    7777  CDataPacketPtr CScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    7878  { 
    79      
    8079    CDataPacketPtr packet(new CDataPacket); 
    8180    packet->date = data[0]->date; 
     
    166165  CDataPacketPtr CFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    167166  { 
    168  
    169167    CDataPacketPtr packet(new CDataPacket); 
    170168    packet->date = data[0]->date; 
     
    271269  CDataPacketPtr CFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    272270  { 
    273  
    274271    CDataPacketPtr packet(new CDataPacket); 
    275272    packet->date = data[0]->date; 
  • XIOS/dev/dev_trunk_omp/src/filter/file_server_writer_filter.cpp

    r1681 r1689  
    2828    return true; 
    2929  } 
    30  
    31  
    3230} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/file_server_writer_filter.hpp

    r1679 r1689  
    3737      bool virtual isDataExpected(const CDate& date) const; 
    3838 
    39  
    4039    protected: 
    4140      /*! 
     
    4948      CField* field; //<! The associated field 
    5049      std::map<Time, CDataPacketPtr> packets; //<! The stored packets 
    51  
    5250  }; // class CFileServerWriterFilter 
    5351} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.cpp

    r1685 r1689  
    7373 
    7474    field->sendUpdateData(dataArray); 
    75      
    76      
    77      
    7875  } 
    7976 
     
    8784    return true; 
    8885  } 
    89  
    90  
    91  
    9286} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.hpp

    r1681 r1689  
    4848       */ 
    4949      bool virtual isDataExpected(const CDate& date) const; 
    50        
    51  
    5250 
    5351    protected: 
     
    6260    private: 
    6361      std::map<Time, CDataPacketPtr> packets; //<! The stored packets 
    64  
    6562  }; // class CFileWriterFilter 
    6663} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/filter.cpp

    r1679 r1689  
    1616    CDataPacketPtr outputPacket = engine->apply(data); 
    1717    if (outputPacket) 
    18     { 
    1918      onOutputReady(outputPacket); 
    20     }  
    2119  } 
    2220 
     
    5452    return COutputPin::isDataExpected(date); 
    5553  } 
    56  
    57    
    5854} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/input_pin.cpp

    r1679 r1689  
    8383    inputs.erase(inputs.begin(), inputs.lower_bound(timestamp)); 
    8484  } 
    85  
    86  
    87    
    88  
    89  
    9085} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/input_pin.hpp

    r1677 r1689  
    1818  { 
    1919    public: 
    20  
    2120      /*! 
    2221       * Constructs an input pin with the specified number of slots 
     
    8281       */ 
    8382      void virtual invalidate(Time timestamp); 
    84        
    8583 
    8684    protected: 
  • XIOS/dev/dev_trunk_omp/src/filter/output_pin.cpp

    r1685 r1689  
    55namespace xios 
    66{ 
    7  
    8  
    97  COutputPin::COutputPin(CGarbageCollector& gc, bool manualTrigger /*= false*/) 
    108    : gc(gc) 
     
    3432      ERROR("void COutputPin::onOutputReady(CDataPacketPtr packet)", 
    3533            "The packet cannot be null."); 
    36    
    3734 
    3835    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  
    3434       * \param gc the garbage collector associated with this ouput pin 
    3535       * \param slotsCount the number of slots 
    36        * \param buildWorkflowGraph indicates whether data will be visualized 
    3736       */ 
    3837      COutputPin(CGarbageCollector& gc, bool manualTrigger = false); 
     
    118117      //! Output buffer, store the packets until the output is triggered 
    119118      std::map<Time, CDataPacketPtr> outputPackets; 
    120  
    121119  }; // class COutputPin 
    122120} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/pass_through_filter.cpp

    r1685 r1689  
    1818    if(building_graph) 
    1919    { 
    20       std::cout<<"pass through packet->distance = "<<data[0]->distance<<std::endl; 
    2120      // std::cout<<"CPassThroughFilter::apply field_id = "<<this->field->getId()<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 
    2221      this->filterID = InvalidableObject::filterIdGenerator++; 
     
    4544 
    4645    data[0]->field = this->field; 
    47  
    4846  } 
    4947 
     
    5351    return data[0]; 
    5452  } 
    55  
    5653} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/source_filter.cpp

    r1681 r1689  
    2828  { 
    2929    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  
    3530    if(building_graph) 
    3631    { 
     
    4035      packet->distance = 1; 
    4136       
    42       // if(CXios::isClient) std::cout<<"source filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 
    4337     
    4438      CWorkflowGraph::allocNodeEdge(); 
     
    5246    } 
    5347 
    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; 
    5548  } 
    5649 
     
    107100  template void CSourceFilter::streamData<7>(CDate date, const CArray<double, 7>& data); 
    108101 
    109  
    110  
    111102  void CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data) 
    112103  { 
     
    157148    onOutputReady(packet); 
    158149  } 
    159  
    160    
    161150} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/source_filter.hpp

    r1681 r1689  
    7575      const bool compression ; //!< indicates if data need to be compressed : on client side : true, on server side : false 
    7676      const bool mask ;        //!< indicates whether grid mask should be applied (true for clients, false for servers) 
    77  
    7877  }; // class CSourceFilter 
    7978} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp

    r1685 r1689  
    1212namespace xios 
    1313{ 
    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) 
    1615    : CFilter(gc, inputSlotsCount, engine), outputDefaultValue(outputValue) 
    1716  { /* Nothing to do */ } 
     
    4342 
    4443      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)); 
    4946 
    5047       
     
    5249        lastFilter = filter; 
    5350      else 
    54       { 
    5551        filter->connectOutput(firstFilter, 0); 
    56       } 
    5752 
    5853      firstFilter = filter; 
     
    7368  void CSpatialTransformFilter::onInputReady(std::vector<CDataPacketPtr> data) 
    7469  { 
    75  
    7670    CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine); 
    7771    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field); 
    7872    if (outputPacket) 
    79     { 
    8073      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) 
    8777    : CSpatialTransformFilter(gc, engine, outputValue, inputSlotsCount), record(0) 
    8878  { 
     
    110100  void CSpatialTemporalFilter::onInputReady(std::vector<CDataPacketPtr> data) 
    111101  { 
    112  
    113102    CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine); 
    114103    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field); 
     
    160149      ERROR("CSpatialTransformFilterEngine& CSpatialTransformFilterEngine::get(CGridTransformation* gridTransformation)", 
    161150            "Impossible to get the requested engine, the grid transformation is invalid."); 
    162      
    163151    if(engines_ptr == NULL) engines_ptr = new std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> >; 
    164  
    165152 
    166153    std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> >::iterator it = engines_ptr->find(gridTransformation); 
     
    216203    packet->timestamp = data[0]->timestamp; 
    217204    packet->status = data[0]->status; 
    218      
    219205 
    220206    if (packet->status == CDataPacket::NO_ERROR) 
  • XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.hpp

    r1685 r1689  
    7373       * \param outputValue default value of output pin 
    7474       * \param [in] inputSlotsCount number of input, by default there is only one for field src 
    75        * 
    7675       */ 
    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); 
    7977 
    8078 
  • XIOS/dev/dev_trunk_omp/src/filter/store_filter.cpp

    r1685 r1689  
    167167    packets.erase(packets.begin(), packets.lower_bound(timestamp)); 
    168168  } 
    169  
    170  
    171169} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/store_filter.hpp

    r1681 r1689  
    100100      const double missingValue; //!< The value to use to replace missing values 
    101101      std::map<Time, CDataPacketPtr> packets; //<! The stored packets 
    102  
    103  
    104102  }; // class CStoreFilter 
    105103} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp

    r1685 r1689  
    126126          packet->data.resize(tmpData.numElements()); 
    127127          packet->data = tmpData; 
    128            
    129128        } 
    130129        else 
     
    139138          packet->src_filterID=this->filterID; 
    140139          packet->distance = data[0]->distance+1; 
    141           std::cout<<"temporal packet->distance = "<<packet->distance<<std::endl; 
    142140          this->filterIDoutputs.clear(); 
    143141          CWorkflowGraph::build_begin=true; 
  • XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.hpp

    r1681 r1689  
    7777//      CDate nextOperationDate; //!< The date of the next operation 
    7878      bool isFirstOperation; //!< True before the first operation was been computed 
    79  
    8079  }; // class CTemporalFilter 
    8180} // namespace xios 
  • XIOS/dev/dev_trunk_omp/src/filter/ternary_arithmetic_filter.cpp

    r1681 r1689  
    7676  CDataPacketPtr CScalarScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    7777  { 
    78    
    7978    CDataPacketPtr packet(new CDataPacket); 
    8079    packet->date = data[0]->date; 
     
    166165  CDataPacketPtr CScalarFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    167166  { 
    168  
    169167    CDataPacketPtr packet(new CDataPacket); 
    170168    packet->date = data[0]->date; 
     
    270268  CDataPacketPtr CScalarFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    271269  { 
    272  
    273270    CDataPacketPtr packet(new CDataPacket); 
    274271    packet->date = data[0]->date; 
     
    368365  CDataPacketPtr CFieldScalarScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    369366  { 
    370  
    371367    CDataPacketPtr packet(new CDataPacket); 
    372368    packet->date = data[0]->date; 
     
    473469  CDataPacketPtr CFieldScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    474470  { 
    475  
    476471    CDataPacketPtr packet(new CDataPacket); 
    477472    packet->date = data[0]->date; 
     
    584579  CDataPacketPtr CFieldFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    585580  { 
    586  
    587581    CDataPacketPtr packet(new CDataPacket); 
    588582    packet->date = data[0]->date; 
     
    707701  CDataPacketPtr CFieldFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    708702  { 
    709  
    710703    CDataPacketPtr packet(new CDataPacket); 
    711704    packet->date = data[0]->date; 
  • XIOS/dev/dev_trunk_omp/src/filter/unary_arithmetic_filter.cpp

    r1681 r1689  
    7171  CDataPacketPtr CUnaryArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
    7272  { 
    73  
    7473    CDataPacketPtr packet(new CDataPacket); 
    7574    packet->date = data[0]->date; 
     
    9190  } 
    9291} // namespace xios 
    93  
  • XIOS/dev/dev_trunk_omp/src/node/field.cpp

    r1685 r1689  
    7777 
    7878  //---------------------------------------------------------------- 
    79  
    80  
    81     
    8279 
    8380   void CField::setVirtualVariableGroup(CVariableGroup* newVVariableGroup) 
     
    688685 
    689686   //---------------------------------------------------------------- 
    690     
     687 
    691688   StdString CField::GetName(void)    { return StdString("field"); } 
    692689   StdString CField::GetDefName(void) { return CField::GetName(); } 
     
    920917   TRY 
    921918   { 
    922  
    923919     CContext* context = CContext::getCurrent(); 
    924920     bool hasClient = context->hasClient; 
     
    12231219         { 
    12241220           fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 
    1225            instantDataFilter->connectOutput(fileWriterFilter, 0);         
     1221           instantDataFilter->connectOutput(fileWriterFilter, 0); 
    12261222         } 
    12271223       } 
     
    12411237           if (!field_ref.isEmpty()) 
    12421238           { 
    1243              CField* fieldRef = CField::get(field_ref); 
    1244              CGrid* gridRef = fieldRef->grid; 
     1239             CGrid* gridRef = CField::get(field_ref)->grid; 
    12451240 
    12461241             if (grid && grid != gridRef && grid->hasTransform()) 
    12471242             { 
    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); 
    12501244 
    12511245               filter->connectOutput(filters.first, 0); 
    1252  
    1253  
    12541246               filter = filters.second; 
    1255                 
    12561247             } 
    12571248           } 
     
    13541345   TRY 
    13551346   { 
    1356  
    1357        
    1358  
    13591347     if (instantDataFilter || field_ref.isEmpty()) 
    13601348       ERROR("COutputPin* CField::getFieldReference(CGarbageCollector& gc)", 
     
    15101498 
    15111499         selfReferenceFilter = clientSourceFilter; 
    1512        }     
     1500       } 
    15131501     } 
    15141502 
     
    15361524     CContext* context = CContext::getCurrent(); 
    15371525 
    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; 
    15521526 
    15531527     if (it == temporalDataFilters.end()) 
     
    16141588       std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    16151589                                                                           CContext::getCurrent()->getCalendar()->getInitDate(), 
    1616                                                                            freq_op, freq_offset, outFreq, 
    1617                                                                            detectMissingValues)); 
     1590                                                                           freq_op, freq_offset, outFreq, detectMissingValues)); 
    16181591 
    16191592       selfReferenceFilter->connectOutput(temporalFilter, 0); 
Note: See TracChangeset for help on using the changeset viewer.