Changeset 566 for XIOS/trunk/src/node
- Timestamp:
- 03/09/15 10:04:51 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/axis.cpp
r553 r566 54 54 if (this->isChecked) return; 55 55 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"); 57 58 StdSize size = this->size.getValue(); 58 59 … … 61 62 StdSize ibegin = this->ibegin.getValue(); 62 63 if ((ibegin < 0) || (ibegin > size-1)) 63 ERROR("CAxis::checkAttributes(void)",<< "Attribut <ibegin> of the axis must be non-negative and smaller than size-1") ; 64 ERROR("CAxis::checkAttributes(void)", 65 << "Attribute <ibegin> of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be non-negative and smaller than size-1"); 64 66 } 65 67 else this->ibegin.setValue(0); … … 69 71 StdSize ni = this->ni.getValue(); 70 72 if ((ni < 0) || (ni > size)) 71 ERROR("CAxis::checkAttributes(void)",<< "Attribut <ni> of the axis must be non-negative and smaller than size") ; 73 ERROR("CAxis::checkAttributes(void)", 74 << "Attribute <ni> of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be non-negative and smaller than size"); 72 75 } 73 76 else this->ni.setValue(size); 74 77 75 StdSize zoom_begin,zoom_end, zoom_size 78 StdSize zoom_begin,zoom_end, zoom_size; 76 79 77 80 // Maybe index begins at 0 (zero) 78 zoom_begin = (this->zoom_begin.isEmpty()) ? 0 : this->zoom_begin.getValue() 79 zoom_end = (this->zoom_end.isEmpty()) ? size-1 : this->zoom_end.getValue() 80 zoom_size = (this->zoom_size.isEmpty()) ? size : this->zoom_size.getValue() 81 zoom_begin = (this->zoom_begin.isEmpty()) ? 0 : this->zoom_begin.getValue(); 82 zoom_end = (this->zoom_end.isEmpty()) ? size-1 : this->zoom_end.getValue(); 83 zoom_size = (this->zoom_size.isEmpty()) ? size : this->zoom_size.getValue(); 81 84 82 if (this->zoom_begin.isEmpty()) zoom_begin=zoom_end-zoom_size+1 83 if (this->zoom_end.isEmpty()) zoom_end=zoom_begin+zoom_size-1 84 if (this->zoom_size.isEmpty()) zoom_size=zoom_end-zoom_begin+1 85 if (this->zoom_begin.isEmpty()) zoom_begin=zoom_end-zoom_size+1; 86 if (this->zoom_end.isEmpty()) zoom_end=zoom_begin+zoom_size-1; 87 if (this->zoom_size.isEmpty()) zoom_size=zoom_end-zoom_begin+1; 85 88 86 89 if ( (zoom_begin < 0) || (zoom_begin > size-1) || (zoom_end<0) || (zoom_end>size-1) || (zoom_size<1) || (zoom_size>size) || (zoom_begin>zoom_end)) 87 ERROR("CAxis::checkAttributes(void)",<< "One or more attribut of <zoom_begin>, <zoom_end>, <zoom_size>, are not well specified") ; 90 ERROR("CAxis::checkAttributes(void)", 91 << "One or more attributes among <zoom_begin>, <zoom_end>, <zoom_size> of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified"); 88 92 89 this->zoom_begin.setValue(zoom_begin) 90 this->zoom_end.setValue(zoom_end) 91 this->zoom_size.setValue(zoom_size) 93 this->zoom_begin.setValue(zoom_begin); 94 this->zoom_end.setValue(zoom_end); 95 this->zoom_size.setValue(zoom_size); 92 96 93 97 StdSize true_size = value.numElements(); 94 98 if (size != true_size) 95 99 ERROR("CAxis::checkAttributes(void)", 96 << "The array \'value\' has a different size that the one defined by the \'size\' attribut")100 << "The array \'value\' of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] has a different size that the one defined by the \'size\' attribute"); 97 101 98 102 this->checkData(); … … 107 111 { 108 112 ERROR("CAxis::checkData(void)", 109 << "Data dimension is negative (data_n).") 113 << "Data dimension is negative (data_n)."); 110 114 } 111 115 else if (data_n.isEmpty()) … … 152 156 { // Si aucun masque n'est défini, 153 157 // on en crée un nouveau qui valide l'intégralité du domaine. 154 mask.resize(ni) 158 mask.resize(ni); 155 159 for (int i = 0; i < ni.getValue(); ++i) 156 160 {
Note: See TracChangeset
for help on using the changeset viewer.