Changeset 566 for XIOS/branchs


Ignore:
Timestamp:
03/09/15 10:04:51 (6 years ago)
Author:
rlacroix
Message:

Improve the error messages when checking the axis attributes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/branchs/xios-1.0/src/node/axis.cpp

    r501 r566  
    99 
    1010namespace xios { 
    11     
     11 
    1212   /// ////////////////////// Définitions ////////////////////// /// 
    1313 
     
    5454      if (this->isChecked) return; 
    5555      if (this->size.isEmpty()) 
    56          ERROR("CAxis::checkAttributes(void)",<< "Attribut <size> of the axis must be specified") ; 
     56         ERROR("CAxis::checkAttributes(void)", 
     57               << "Attribute <size> of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be specified"); 
    5758      StdSize size = this->size.getValue(); 
    58        
    59       StdSize zoom_begin,zoom_end, zoom_size ; 
    60        
    61       zoom_begin = (this->zoom_begin.isEmpty()) ?  1 : this->zoom_begin.getValue() ; 
    62       zoom_end = (this->zoom_end.isEmpty()) ?  size : this->zoom_end.getValue() ;  
    63       zoom_size = (this->zoom_size.isEmpty()) ?  size : this->zoom_size.getValue() ; 
    64        
    65       if (this->zoom_begin.isEmpty()) zoom_begin=zoom_end-zoom_size+1 ; 
    66       if (this->zoom_end.isEmpty()) zoom_end=zoom_begin+zoom_size-1 ; 
    67       if (this->zoom_size.isEmpty()) zoom_size=zoom_end-zoom_begin+1 ; 
    68        
     59 
     60      StdSize zoom_begin,zoom_end, zoom_size; 
     61 
     62      zoom_begin = (this->zoom_begin.isEmpty()) ?  1 : this->zoom_begin.getValue(); 
     63      zoom_end = (this->zoom_end.isEmpty()) ?  size : this->zoom_end.getValue(); 
     64      zoom_size = (this->zoom_size.isEmpty()) ?  size : this->zoom_size.getValue(); 
     65 
     66      if (this->zoom_begin.isEmpty()) zoom_begin=zoom_end-zoom_size+1; 
     67      if (this->zoom_end.isEmpty()) zoom_end=zoom_begin+zoom_size-1; 
     68      if (this->zoom_size.isEmpty()) zoom_size=zoom_end-zoom_begin+1; 
     69 
    6970      if ( (zoom_begin < 1) || (zoom_begin > size) || (zoom_end<1) || (zoom_end>size) || (zoom_size<1) || (zoom_size>size) || (zoom_begin>zoom_end)) 
    70         ERROR("CAxis::checkAttributes(void)",<< "One or more attribut of <zoom_begin>, <zoom_end>, <zoom_size>, are not well specified") ; 
    71       this->zoom_begin.setValue(zoom_begin) ; 
    72       this->zoom_end.setValue(zoom_end) ; 
    73       this->zoom_size.setValue(zoom_size) ; 
    74        
     71        ERROR("CAxis::checkAttributes(void)", 
     72              << "One or more attributes among <zoom_begin>, <zoom_end>, <zoom_size> of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified"); 
     73      this->zoom_begin.setValue(zoom_begin); 
     74      this->zoom_end.setValue(zoom_end); 
     75      this->zoom_size.setValue(zoom_size); 
     76 
    7577      StdSize true_size = value.numElements(); 
    7678      if (size != true_size) 
    7779         ERROR("CAxis::checkAttributes(void)", 
    78                << "The array \'value\' has a different size that the one defined by the \'size\' attribut") 
     80               << "The array \'value\' of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] has a different size that the one defined by the \'size\' attribute"); 
    7981 
    8082      this->isChecked = true; 
Note: See TracChangeset for help on using the changeset viewer.