#include <CigiAtmosCtrl.h>
Inheritance diagram for CigiAtmosCtrlV3:
Public Member Functions | |
CigiAtmosCtrlV3 () | |
virtual | ~CigiAtmosCtrlV3 () |
virtual int | Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const |
virtual int | Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec) |
virtual void | FillHold (CigiBaseEnvCtrl *Hold) const |
int | SetAtmosEn (const bool AtmosEnIn, bool bndchk=true) |
bool | GetAtmosEn (void) const |
int | SetHumidity (const Cigi_uint8 HumidityIn, bool bndchk=true) |
Cigi_uint8 | GetHumidity (void) const |
int | SetAirTemp (const float AirTempIn, bool bndchk=true) |
float | GetAirTemp (void) const |
int | SetVisibility (const float VisibilityIn, bool bndchk=true) |
float | GetVisibility (void) const |
int | SetHorizWindSp (const float HorizWindSpIn, bool bndchk=true) |
float | GetHorizWindSp (void) const |
int | SetVertWindSp (const float VertWindSpIn, bool bndchk=true) |
float | GetVertWindSp (void) const |
int | SetWindDir (const float WindDirIn, bool bndchk=true) |
float | GetWindDir (void) const |
int | SetBaroPress (const float BaroPressIn, bool bndchk=true) |
float | GetBaroPress (void) const |
Definition at line 57 of file CigiAtmosCtrl.h.
CigiAtmosCtrlV3::CigiAtmosCtrlV3 | ( | ) |
General Constructor
Definition at line 67 of file CigiAtmosCtrl.cpp.
References CigiBaseEnvCtrl::Aerosol, CigiBaseEnvCtrl::AirTemp, CigiBaseEnvCtrl::AtmosEn, CigiBaseEnvCtrl::BaroPress, CIGI_ATMOS_CTRL_PACKET_ID_V3, CIGI_ATMOS_CTRL_PACKET_SIZE_V3, CigiBaseEnvCtrl::DateVld, CigiBaseEnvCtrl::Day, CigiBaseEnvCtrl::EphemerisEn, CigiBaseEnvCtrl::HorizWindSp, CigiBaseEnvCtrl::Hour, CigiBaseEnvCtrl::Humidity, CigiBasePacket::MinorVersion, CigiBaseEnvCtrl::Minute, CigiBaseEnvCtrl::Month, CigiBaseEnvCtrl::MoonEn, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseEnvCtrl::StarEn, CigiBaseEnvCtrl::StarInt, CigiBaseEnvCtrl::SunEn, CigiBasePacket::Version, CigiBaseEnvCtrl::VertWindSp, CigiBaseEnvCtrl::Visibility, CigiBaseEnvCtrl::WindDir, and CigiBaseEnvCtrl::Year.
00068 { 00069 00070 PacketID = CIGI_ATMOS_CTRL_PACKET_ID_V3; 00071 PacketSize = CIGI_ATMOS_CTRL_PACKET_SIZE_V3; 00072 Version = 3; 00073 MinorVersion = 0; 00074 00075 Hour = 0; 00076 Minute = 0; 00077 Month = 1; 00078 Day = 1; 00079 Year = 2000; 00080 StarInt = 0.0; 00081 EphemerisEn = false; 00082 SunEn = false; 00083 MoonEn = false; 00084 StarEn = false; 00085 DateVld = false; 00086 AtmosEn = false; 00087 Aerosol = 0.0; 00088 Humidity = 30; 00089 AirTemp = 0.0; 00090 Visibility = 64373.76f; 00091 HorizWindSp = 0.0; 00092 VertWindSp = 0.0; 00093 WindDir = 0.0; 00094 BaroPress = 1013.25; 00095 00096 00097 }
CigiAtmosCtrlV3::~CigiAtmosCtrlV3 | ( | ) | [virtual] |
void CigiAtmosCtrlV3::FillHold | ( | CigiBaseEnvCtrl * | Hold | ) | const [virtual] |
The virtual FillHold function.
Hold | - A pointer to the Hold object. (Downcast to CigiBaseEnvCtrl) |
Implements CigiBaseEnvCtrl.
Definition at line 209 of file CigiAtmosCtrl.cpp.
References CigiBaseEnvCtrl::AirTemp, CigiBaseEnvCtrl::AtmosEn, CigiBaseEnvCtrl::BaroPress, CigiBaseEnvCtrl::HorizWindSp, CigiBaseEnvCtrl::Humidity, CigiBaseEnvCtrl::VertWindSp, CigiBaseEnvCtrl::Visibility, and CigiBaseEnvCtrl::WindDir.
00210 { 00211 Hold->AtmosEn = AtmosEn; 00212 Hold->Humidity = Humidity; 00213 Hold->AirTemp = AirTemp; 00214 Hold->Visibility = Visibility; 00215 Hold->HorizWindSp = HorizWindSp; 00216 Hold->VertWindSp = VertWindSp; 00217 Hold->WindDir = WindDir; 00218 Hold->BaroPress = BaroPress; 00219 }
float CigiAtmosCtrlV3::GetAirTemp | ( | void | ) | const [inline] |
Gets the AirTemp value.
Definition at line 173 of file CigiAtmosCtrl.h.
00173 { return(AirTemp); }
bool CigiAtmosCtrlV3::GetAtmosEn | ( | void | ) | const [inline] |
Gets the AtmosEn value.
Definition at line 135 of file CigiAtmosCtrl.h.
00135 { return(AtmosEn); }
float CigiAtmosCtrlV3::GetBaroPress | ( | void | ) | const [inline] |
Gets the BaroPress value.
Definition at line 262 of file CigiAtmosCtrl.h.
00262 { return(BaroPress); }
float CigiAtmosCtrlV3::GetHorizWindSp | ( | void | ) | const [inline] |
Gets the HorizWindSp value.
Definition at line 207 of file CigiAtmosCtrl.h.
00207 { return(HorizWindSp); }
Cigi_uint8 CigiAtmosCtrlV3::GetHumidity | ( | void | ) | const [inline] |
Gets the Humidity value.
Definition at line 152 of file CigiAtmosCtrl.h.
00152 { return(Humidity); }
float CigiAtmosCtrlV3::GetVertWindSp | ( | void | ) | const [inline] |
Gets the VertWindSp value.
Definition at line 228 of file CigiAtmosCtrl.h.
00228 { return(VertWindSp); }
float CigiAtmosCtrlV3::GetVisibility | ( | void | ) | const [inline] |
Gets the Visibility value.
Definition at line 190 of file CigiAtmosCtrl.h.
00190 { return(Visibility); }
float CigiAtmosCtrlV3::GetWindDir | ( | void | ) | const [inline] |
Gets the WindDir value.
Definition at line 245 of file CigiAtmosCtrl.h.
00245 { return(WindDir); }
int CigiAtmosCtrlV3::Pack | ( | CigiBasePacket * | Base, | |
Cigi_uint8 * | Buff, | |||
void * | Spec | |||
) | const [virtual] |
The virtual Pack function for CIGI 3
Base | - A pointer to the instance of the packet to be packed. (Downcast to CigiBasePacket) | |
Buff | - A pointer to the current pack point. | |
Spec | - A pointer to special data - This is used to point to the Environmental Control holding object when going between V3 and V1 or V2. |
Implements CigiBaseEnvCtrl.
Definition at line 114 of file CigiAtmosCtrl.cpp.
References CigiBaseEnvCtrl::AirTemp, CigiBaseEnvCtrl::AtmosEn, CigiBaseEnvCtrl::BaroPress, PackPointerUnion::c, PackPointerUnion::f, CigiBaseEnvCtrl::HorizWindSp, CigiBaseEnvCtrl::Humidity, PackPointerUnion::l, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseEnvCtrl::VertWindSp, CigiBaseEnvCtrl::Visibility, and CigiBaseEnvCtrl::WindDir.
00115 { 00116 PackPointer CDta; 00117 00118 CigiBaseEnvCtrl * Data; 00119 if(Spec == NULL) 00120 Data = ( CigiBaseEnvCtrl *)Base; 00121 else 00122 Data = ( CigiBaseEnvCtrl *)Spec; 00123 00124 CDta.c = Buff; 00125 00126 *CDta.c++ = PacketID; 00127 *CDta.c++ = PacketSize; 00128 00129 *CDta.c++ = (Data->AtmosEn) ? 0x01 : 0; 00130 00131 *CDta.c++ = Data->Humidity; 00132 *CDta.f++ = Data->AirTemp; 00133 *CDta.f++ = Data->Visibility; 00134 *CDta.f++ = Data->HorizWindSp; 00135 *CDta.f++ = Data->VertWindSp; 00136 *CDta.f++ = Data->WindDir; 00137 *CDta.f++ = Data->BaroPress; 00138 *CDta.l++ = 0; 00139 00140 return(PacketSize); 00141 00142 }
int CigiAtmosCtrlV3::SetAirTemp | ( | const float | AirTempIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the AirTemp with bound checking control
AirTempIn | - current ambient air temperature | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 164 of file CigiAtmosCtrl.h.
References CIGI_SUCCESS.
00165 { 00166 AirTemp = AirTempIn; 00167 return(CIGI_SUCCESS); 00168 }
int CigiAtmosCtrlV3::SetAtmosEn | ( | const bool | AtmosEnIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the AtmosEn with bound checking control
AtmosEnIn | - Atmospheric model enable | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 126 of file CigiAtmosCtrl.h.
References CIGI_SUCCESS.
00127 { 00128 AtmosEn = AtmosEnIn; 00129 return(CIGI_SUCCESS); 00130 }
int CigiAtmosCtrlV3::SetBaroPress | ( | const float | BaroPressIn, | |
bool | bndchk = true | |||
) |
Sets the BaroPress with bound checking control
BaroPressIn | - Current barometric pressure. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 320 of file CigiAtmosCtrl.cpp.
References CigiBaseEnvCtrl::BaroPress, CIGI_ERROR_VALUE_OUT_OF_RANGE, and CIGI_SUCCESS.
00321 { 00322 00323 #ifndef CIGI_NO_BND_CHK 00324 if(bndchk && (BaroPressIn < 0.0)) 00325 { 00326 #ifndef CIGI_NO_EXCEPT 00327 throw CigiValueOutOfRangeException("BaroPress",(float)BaroPressIn,">",0.0); 00328 #endif 00329 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00330 } 00331 #endif 00332 00333 BaroPress = BaroPressIn; 00334 return(CIGI_SUCCESS); 00335 00336 }
int CigiAtmosCtrlV3::SetHorizWindSp | ( | const float | HorizWindSpIn, | |
bool | bndchk = true | |||
) |
Sets the HorizWindSp with bound checking control
HorizWindSpIn | - Horizontal wind speed | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 276 of file CigiAtmosCtrl.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::HorizWindSp.
00277 { 00278 00279 #ifndef CIGI_NO_BND_CHK 00280 if(bndchk && (HorizWindSpIn < 0.0)) 00281 { 00282 #ifndef CIGI_NO_EXCEPT 00283 throw CigiValueOutOfRangeException("HorizWindSp",(float)HorizWindSpIn,">",0.0); 00284 #endif 00285 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00286 } 00287 #endif 00288 00289 HorizWindSp = HorizWindSpIn; 00290 return(CIGI_SUCCESS); 00291 00292 }
int CigiAtmosCtrlV3::SetHumidity | ( | const Cigi_uint8 | HumidityIn, | |
bool | bndchk = true | |||
) |
Sets the Humidity with bound checking control
HumidityIn | - Percentage humidity | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 232 of file CigiAtmosCtrl.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::Humidity.
00233 { 00234 00235 #ifndef CIGI_NO_BND_CHK 00236 if(bndchk && ((HumidityIn < 0)||(HumidityIn > 100))) 00237 { 00238 #ifndef CIGI_NO_EXCEPT 00239 throw CigiValueOutOfRangeException("Humidity",(Cigi_uint8)HumidityIn,0,100); 00240 #endif 00241 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00242 } 00243 #endif 00244 00245 Humidity = HumidityIn; 00246 return(CIGI_SUCCESS); 00247 00248 }
int CigiAtmosCtrlV3::SetVertWindSp | ( | const float | VertWindSpIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the VertWindSp with bound checking control
VertWindSpIn | - Vertical wind speed | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 219 of file CigiAtmosCtrl.h.
References CIGI_SUCCESS.
00220 { 00221 VertWindSp = VertWindSpIn; 00222 return(CIGI_SUCCESS); 00223 }
int CigiAtmosCtrlV3::SetVisibility | ( | const float | VisibilityIn, | |
bool | bndchk = true | |||
) |
Sets the Visibility with bound checking control
VisibilityIn | - Visibility range | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 254 of file CigiAtmosCtrl.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::Visibility.
00255 { 00256 00257 #ifndef CIGI_NO_BND_CHK 00258 if(bndchk && (VisibilityIn < 0.0)) 00259 { 00260 #ifndef CIGI_NO_EXCEPT 00261 throw CigiValueOutOfRangeException("Visibility",(float)VisibilityIn,">",0.0); 00262 #endif 00263 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00264 } 00265 #endif 00266 00267 Visibility = VisibilityIn; 00268 return(CIGI_SUCCESS); 00269 00270 }
int CigiAtmosCtrlV3::SetWindDir | ( | const float | WindDirIn, | |
bool | bndchk = true | |||
) |
Sets the WindDir with bound checking control
WindDirIn | - Wind direction | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 298 of file CigiAtmosCtrl.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::WindDir.
00299 { 00300 00301 #ifndef CIGI_NO_BND_CHK 00302 if(bndchk && ((WindDirIn < 0.0)||(WindDirIn > 360.0))) 00303 { 00304 #ifndef CIGI_NO_EXCEPT 00305 throw CigiValueOutOfRangeException("WindDir",(float)WindDirIn,0.0,360.0); 00306 #endif 00307 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00308 } 00309 #endif 00310 00311 WindDir = WindDirIn; 00312 return(CIGI_SUCCESS); 00313 00314 }
int CigiAtmosCtrlV3::Unpack | ( | Cigi_uint8 * | Buff, | |
bool | Swap, | |||
void * | Spec | |||
) | [virtual] |
The virtual Unpack function for CIGI 3
Buff | - A pointer to the current pack point. | |
Swap | - N/A for V1 & V2 | |
Spec | - A pointer to special data - This is used to point to the Environmental Control holding object when going between V3 and V1 or V2. |
Implements CigiBaseEnvCtrl.
Definition at line 147 of file CigiAtmosCtrl.cpp.
References CigiBaseEnvCtrl::AirTemp, CigiBaseEnvCtrl::AtmosEn, CigiBaseEnvCtrl::BaroPress, PackPointerUnion::c, CigiSwap4(), PackPointerUnion::f, CigiBaseEnvCtrl::HorizWindSp, CigiBaseEnvCtrl::Humidity, CigiBasePacket::PacketSize, CigiBaseEnvCtrl::VertWindSp, CigiBaseEnvCtrl::Visibility, and CigiBaseEnvCtrl::WindDir.
00148 { 00149 PackPointer CDta; 00150 00151 CDta.c = Buff; 00152 00153 CDta.c += 2; // Step over packet id and size 00154 00155 if(!Swap) 00156 { 00157 AtmosEn = (*CDta.c++ != 0); 00158 00159 Humidity = *CDta.c++; 00160 AirTemp = *CDta.f++; 00161 Visibility = *CDta.f++; 00162 HorizWindSp = *CDta.f++; 00163 VertWindSp = *CDta.f++; 00164 WindDir = *CDta.f++; 00165 BaroPress = *CDta.f++; 00166 } 00167 else 00168 { 00169 AtmosEn = (*CDta.c++ != 0); 00170 00171 Humidity = *CDta.c++; 00172 CigiSwap4(&AirTemp, CDta.f++); 00173 CigiSwap4(&Visibility, CDta.f++); 00174 CigiSwap4(&HorizWindSp, CDta.f++); 00175 CigiSwap4(&VertWindSp, CDta.f++); 00176 CigiSwap4(&WindDir, CDta.f++); 00177 CigiSwap4(&BaroPress, CDta.f++); 00178 } 00179 00180 if(Spec != NULL) 00181 { 00182 00183 CigiBaseEnvCtrl * Data = (CigiBaseEnvCtrl *)Spec; 00184 00185 Data->AtmosEn = AtmosEn; 00186 00187 Data->Humidity = Humidity; 00188 Data->AirTemp = AirTemp; 00189 Data->Visibility = Visibility; 00190 Data->HorizWindSp = HorizWindSp; 00191 Data->VertWindSp = VertWindSp; 00192 Data->WindDir = WindDir; 00193 Data->BaroPress = BaroPress; 00194 } 00195 00196 return(PacketSize); 00197 00198 }