CigiBaseWeatherCondResp.cpp

Go to the documentation of this file.
00001 
00049 #define _EXPORT_CCL_
00050 
00051 #include "CigiBaseWeatherCondResp.h"
00052 #include "CigiSwapping.h"
00053 #include "CigiExceptions.h"
00054 
00055 
00056 // ====================================================================
00057 // Construction/Destruction
00058 // ====================================================================
00059 
00060 
00061 // ================================================
00062 // CigiBaseWeatherCondResp
00063 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00064 CigiBaseWeatherCondResp::CigiBaseWeatherCondResp()
00065 {
00066 
00067 }
00068 
00069 
00070 
00071 // ================================================
00072 // ~CigiBaseWeatherCondResp
00073 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00074 CigiBaseWeatherCondResp::~CigiBaseWeatherCondResp()
00075 {
00076 
00077 }
00078 
00079 
00080 // ====================================================================
00081 // Conversion Control
00082 // ====================================================================
00083 
00084 
00085 // ================================================
00086 // GetCnvt
00087 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00088 int CigiBaseWeatherCondResp::GetCnvt(CigiVersionID &CnvtVersion,
00089                                      CigiCnvtInfoType::Type &CnvtInfo)
00090 {
00091    if(CnvtVersion.CigiMajorVersion < 3)
00092    {
00093       CnvtInfo.ProcID = CigiProcessType::ProcNone;
00094       CnvtInfo.CnvtPacketID = 0;
00095    }
00096    else
00097    {
00098       CnvtInfo.ProcID = CigiProcessType::ProcStd;
00099       CnvtInfo.CnvtPacketID = CIGI_WEATHER_COND_RESP_PACKET_ID_V3;
00100    }
00101 
00102    return(CIGI_SUCCESS);
00103 }
00104 
00105 // ====================================================================
00106 // Accessors
00107 // ====================================================================
00108 
00109 
00110 // ================================================
00111 // Humidity
00112 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00113 int CigiBaseWeatherCondResp::SetHumidity(const Cigi_uint8 HumidityIn, bool bndchk)
00114 {
00115 
00116 #ifndef CIGI_NO_BND_CHK
00117    if(bndchk && ((HumidityIn < 0)||(HumidityIn > 100)))
00118    {
00119 #ifndef CIGI_NO_EXCEPT
00120       throw CigiValueOutOfRangeException("Humidity",(Cigi_uint8)HumidityIn,0,100);
00121 #endif
00122       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00123    }
00124 #endif
00125 
00126    Humidity = HumidityIn;
00127    return(CIGI_SUCCESS);
00128 
00129 }
00130 
00131 
00132 // ================================================
00133 // Visibility
00134 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00135 int CigiBaseWeatherCondResp::SetVisibility(const float VisibilityIn, bool bndchk)
00136 {
00137 
00138 #ifndef CIGI_NO_BND_CHK
00139    if(bndchk && (VisibilityIn < 0.0))
00140    {
00141 #ifndef CIGI_NO_EXCEPT
00142       throw CigiValueOutOfRangeException("Visibility",(float)VisibilityIn,">",0.0);
00143 #endif
00144       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00145    }
00146 #endif
00147 
00148    Visibility = VisibilityIn;
00149    return(CIGI_SUCCESS);
00150 
00151 }
00152 
00153 
00154 // ================================================
00155 // HorizWindSp
00156 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00157 int CigiBaseWeatherCondResp::SetHorizWindSp(const float HorizWindSpIn, bool bndchk)
00158 {
00159 
00160 #ifndef CIGI_NO_BND_CHK
00161    if(bndchk && (HorizWindSpIn < 0.0))
00162    {
00163 #ifndef CIGI_NO_EXCEPT
00164       throw CigiValueOutOfRangeException("HorizWindSp",(float)HorizWindSpIn,">",0.0);
00165 #endif
00166       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00167    }
00168 #endif
00169 
00170    HorizWindSp = HorizWindSpIn;
00171    return(CIGI_SUCCESS);
00172 
00173 }
00174 
00175 
00176 // ================================================
00177 // WindDir
00178 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00179 int CigiBaseWeatherCondResp::SetWindDir(const float WindDirIn, bool bndchk)
00180 {
00181 
00182 #ifndef CIGI_NO_BND_CHK
00183    if(bndchk && ((WindDirIn < 0.0)||(WindDirIn > 360.0)))
00184    {
00185 #ifndef CIGI_NO_EXCEPT
00186       throw CigiValueOutOfRangeException("WindDir",(float)WindDirIn,0.0,360.0);
00187 #endif
00188       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00189    }
00190 #endif
00191 
00192    WindDir = WindDirIn;
00193    return(CIGI_SUCCESS);
00194 
00195 }
00196 
00197 
00198 // ================================================
00199 // BaroPress
00200 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00201 int CigiBaseWeatherCondResp::SetBaroPress(const float BaroPressIn, bool bndchk)
00202 {
00203 
00204 #ifndef CIGI_NO_BND_CHK
00205    if(bndchk && (BaroPressIn < 0.0))
00206    {
00207 #ifndef CIGI_NO_EXCEPT
00208       throw CigiValueOutOfRangeException("BaroPress",(float)BaroPressIn,">",0.0);
00209 #endif
00210       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00211    }
00212 #endif
00213 
00214    BaroPress = BaroPressIn;
00215    return(CIGI_SUCCESS);
00216 
00217 }
00218 
00219 

Generated on Wed Apr 29 08:59:58 2009 for CCL by  doxygen 1.4.7