Ignore:
Timestamp:
07/19/19 15:28:33 (5 years ago)
Author:
yushan
Message:

MARK: Dynamic workflow graph developement. Branch up to date with trunk @1676. Bug fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/src/filter/source_filter.cpp

    r1680 r1681  
    2525  } 
    2626 
    27    
    28   template <int N> 
    29   void CSourceFilter::streamData(CDate date, const CArray<double, N>& data, const StdString field_id) 
     27  void CSourceFilter::buildGraph(CDataPacketPtr packet) 
    3028  { 
    31     date = date + offset; // this is a temporary solution, it should be part of a proper temporal filter 
    32  
    33     CDataPacketPtr packet(new CDataPacket); 
    34     packet->date = date; 
    35     packet->timestamp = date; 
    36     packet->status = CDataPacket::NO_ERROR; 
    37  
    38     packet->data.resize(grid->storeIndex_client.numElements());     
     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; 
    3931     
    40     if (compression) 
    41     { 
    42       packet->data = defaultValue; 
    43       grid->uncompressField(data, packet->data);     
    44     } 
    45     else 
    46     { 
    47       if (mask) 
    48         grid->maskField(data, packet->data); 
    49       else 
    50         grid->inputField(data, packet->data); 
    51     } 
    52     // Convert missing values to NaN 
    53     if (hasMissingValue) 
    54     { 
    55       const double nanValue = std::numeric_limits<double>::quiet_NaN(); 
    56       const size_t nbData = packet->data.numElements(); 
    57       for (size_t idx = 0; idx < nbData; ++idx) 
    58       { 
    59         if (defaultValue == packet->data(idx)) 
    60           packet->data(idx) = nanValue; 
    61       } 
    62     } 
    63  
    64      
    65     bool building_graph = this->tag ? packet->timestamp >= this->start_graph && packet->timestamp <= this->end_graph : false; 
     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; 
    6634 
    6735    if(building_graph) 
     
    7038      packet->src_filterID=this->filterID; 
    7139      packet->field = this->field; 
     40      packet->distance = 1; 
    7241       
    73       if(CXios::isClient) std::cout<<"source filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 
     42      // if(CXios::isClient) std::cout<<"source filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 
    7443     
    7544      CWorkflowGraph::allocNodeEdge(); 
    7645 
    7746      CWorkflowGraph::addNode(this->filterID, "Source Filter ", 1, 1, 0, packet); 
    78       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 
     47      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 
    7948      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].field_id = this->field->getId(); 
     49      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = 1; 
    8050 
    8151      CWorkflowGraph::build_begin = true; 
    8252    } 
    8353 
    84  
    85     onOutputReady(packet); 
     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; 
    8655  } 
    87  
    88   template void CSourceFilter::streamData<1>(CDate date, const CArray<double, 1>& data, const StdString field_id); 
    89   template void CSourceFilter::streamData<2>(CDate date, const CArray<double, 2>& data, const StdString field_id); 
    90   template void CSourceFilter::streamData<3>(CDate date, const CArray<double, 3>& data, const StdString field_id); 
    91   template void CSourceFilter::streamData<4>(CDate date, const CArray<double, 4>& data, const StdString field_id); 
    92   template void CSourceFilter::streamData<5>(CDate date, const CArray<double, 5>& data, const StdString field_id); 
    93   template void CSourceFilter::streamData<6>(CDate date, const CArray<double, 6>& data, const StdString field_id); 
    94   template void CSourceFilter::streamData<7>(CDate date, const CArray<double, 7>& data, const StdString field_id); 
    9556 
    9657 
     
    13091      } 
    13192    } 
    132     this->filterID = InvalidableObject::filterIdGenerator++; 
    133     packet->src_filterID=this->filterID; 
    13493 
    135     if(CXios::isClient) std::cout<<"source filter filter tag = "<<this->tag<<std::endl; 
     94    if(CXios::isClient) buildGraph(packet); 
     95     
     96 
    13697 
    13798    onOutputReady(packet); 
Note: See TracChangeset for help on using the changeset viewer.