CigiEnvCtrlV2 Class Reference

#include <CigiEnvCtrlV2.h>

Inheritance diagram for CigiEnvCtrlV2:

CigiBaseEnvCtrl CigiBasePacket List of all members.

Public Member Functions

 CigiEnvCtrlV2 ()
virtual ~CigiEnvCtrlV2 ()
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 SetHour (const Cigi_uint8 HourIn, bool bndchk=true)
Cigi_uint8 GetHour (void) const
int SetMinute (const Cigi_uint8 MinuteIn, bool bndchk=true)
Cigi_uint8 GetMinute (void) const
int SetMonth (const Cigi_uint8 MonthIn, bool bndchk=true)
Cigi_uint8 GetMonth (void) const
int SetDay (const Cigi_uint8 DayIn, bool bndchk=true)
Cigi_uint8 GetDay (void) const
int SetYear (const Cigi_uint16 YearIn, bool bndchk=true)
Cigi_uint16 GetYear (void) const
int SetEphemerisEn (const bool EphemerisEnIn, bool bndchk=true)
bool GetEphemerisEn (void) const
int SetHumidity (const Cigi_uint8 HumidityIn, bool bndchk=true)
Cigi_uint8 GetHumidity (void) const
int SetAtmosEn (const bool AtmosEnIn, bool bndchk=true)
bool GetAtmosEn (void) const
int SetAerosol (const float AerosolIn, bool bndchk=true)
float GetAerosol (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 SetWindDir (const float WindDirIn, bool bndchk=true)
float GetWindDir (void) const
int SetBaroPress (const float BaroPressIn, bool bndchk=true)
float GetBaroPress (void) const

Detailed Description

Definition at line 61 of file CigiEnvCtrlV2.h.


Constructor & Destructor Documentation

CigiEnvCtrlV2::CigiEnvCtrlV2 (  ) 

General Constructor

Definition at line 90 of file CigiEnvCtrlV2.cpp.

References CigiBaseEnvCtrl::Aerosol, CigiBaseEnvCtrl::AirTemp, CigiBaseEnvCtrl::AtmosEn, CigiBaseEnvCtrl::BaroPress, CIGI_ENV_CTRL_PACKET_ID_V2, CIGI_ENV_CTRL_PACKET_SIZE_V2, 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.

00091 {
00092 
00093    PacketID = CIGI_ENV_CTRL_PACKET_ID_V2;
00094    PacketSize = CIGI_ENV_CTRL_PACKET_SIZE_V2;
00095    Version = 2;
00096    MinorVersion = 0;
00097 
00098    Hour = 0;
00099    Minute = 0;
00100    Month = 1;
00101    Day = 1;
00102    Year = 2000;
00103    StarInt = 0.0;
00104    EphemerisEn = false;
00105    SunEn = false;
00106    MoonEn = false;
00107    StarEn = false;
00108    DateVld = true;
00109    AtmosEn = false;
00110    Aerosol = 0.0;
00111    Humidity = 30;
00112    AirTemp = 0.0;
00113    Visibility = 64373.76f;
00114    HorizWindSp = 0.0;
00115    VertWindSp = 0.0;
00116    WindDir = 0.0;
00117    BaroPress = 1013.25;
00118 
00119 }

CigiEnvCtrlV2::~CigiEnvCtrlV2 (  )  [virtual]

General Destructor

Definition at line 124 of file CigiEnvCtrlV2.cpp.

00125 {
00126 
00127 }


Member Function Documentation

void CigiEnvCtrlV2::FillHold ( CigiBaseEnvCtrl Hold  )  const [virtual]

The virtual FillHold function.

Parameters:
Hold - A pointer to the Hold object. (Downcast to CigiBaseEnvCtrl)

Implements CigiBaseEnvCtrl.

Definition at line 243 of file CigiEnvCtrlV2.cpp.

References CigiBaseEnvCtrl::Aerosol, CigiBaseEnvCtrl::AirTemp, CigiBaseEnvCtrl::AtmosEn, CigiBaseEnvCtrl::BaroPress, CigiBaseEnvCtrl::DateVld, CigiBaseEnvCtrl::Day, CigiBaseEnvCtrl::EphemerisEn, CigiBaseEnvCtrl::HorizWindSp, CigiBaseEnvCtrl::Hour, CigiBaseEnvCtrl::Humidity, CigiBaseEnvCtrl::Minute, CigiBaseEnvCtrl::Month, CigiBaseEnvCtrl::MoonEn, CigiBaseEnvCtrl::StarEn, CigiBaseEnvCtrl::SunEn, CigiBaseEnvCtrl::Visibility, CigiBaseEnvCtrl::WindDir, and CigiBaseEnvCtrl::Year.

00244 {
00245    Hold->Hour = Hour;
00246    Hold->Minute = Minute;
00247    Hold->EphemerisEn = EphemerisEn;
00248    Hold->SunEn = SunEn;
00249    Hold->MoonEn = MoonEn;
00250    Hold->StarEn = StarEn;
00251    Hold->DateVld = DateVld;
00252    Hold->AtmosEn = AtmosEn;
00253    Hold->Humidity = Humidity;
00254    Hold->Month = Month;
00255    Hold->Day = Day;
00256    Hold->Year = Year;
00257    Hold->AirTemp = AirTemp;
00258    Hold->Visibility = Visibility;
00259    Hold->HorizWindSp = HorizWindSp;
00260    Hold->WindDir = WindDir;
00261    Hold->BaroPress = BaroPress;
00262    Hold->Aerosol = Aerosol;
00263 }

float CigiEnvCtrlV2::GetAerosol ( void   )  const [inline]

Gets the Aerosol value.

Returns:
the current Aerosol.

Definition at line 285 of file CigiEnvCtrlV2.h.

00285 { return(Aerosol); }

float CigiEnvCtrlV2::GetAirTemp ( void   )  const [inline]

Gets the AirTemp value.

Returns:
the current AirTemp.

Definition at line 306 of file CigiEnvCtrlV2.h.

00306 { return(AirTemp); }

bool CigiEnvCtrlV2::GetAtmosEn ( void   )  const [inline]

Gets the AtmosEn value.

Returns:
the current AtmosEn.

Definition at line 268 of file CigiEnvCtrlV2.h.

00268 { return(AtmosEn); }

float CigiEnvCtrlV2::GetBaroPress ( void   )  const [inline]

Gets the BaroPress value.

Returns:
the current BaroPress.

Definition at line 374 of file CigiEnvCtrlV2.h.

00374 { return(BaroPress); }

Cigi_uint8 CigiEnvCtrlV2::GetDay ( void   )  const [inline]

Gets the Day value.

Returns:
the current Day.

Definition at line 186 of file CigiEnvCtrlV2.h.

00186 { return(Day); }

bool CigiEnvCtrlV2::GetEphemerisEn ( void   )  const [inline]

Gets the EphemerisEn value.

Returns:
the current EphemerisEn.

Definition at line 229 of file CigiEnvCtrlV2.h.

00229 { return(EphemerisEn); }

float CigiEnvCtrlV2::GetHorizWindSp ( void   )  const [inline]

Gets the HorizWindSp value.

Returns:
the current HorizWindSp.

Definition at line 340 of file CigiEnvCtrlV2.h.

00340 { return(HorizWindSp); }

Cigi_uint8 CigiEnvCtrlV2::GetHour ( void   )  const [inline]

Gets the Hour value.

Returns:
the current Hour.

Definition at line 135 of file CigiEnvCtrlV2.h.

00135 { return(Hour); }

Cigi_uint8 CigiEnvCtrlV2::GetHumidity ( void   )  const [inline]

Gets the Humidity value.

Returns:
the current Humidity.

Definition at line 246 of file CigiEnvCtrlV2.h.

00246 { return(Humidity); }

Cigi_uint8 CigiEnvCtrlV2::GetMinute ( void   )  const [inline]

Gets the Minute value.

Returns:
the current Minute.

Definition at line 152 of file CigiEnvCtrlV2.h.

00152 { return(Minute); }

Cigi_uint8 CigiEnvCtrlV2::GetMonth ( void   )  const [inline]

Gets the Month value.

Returns:
the current Month.

Definition at line 169 of file CigiEnvCtrlV2.h.

00169 { return(Month); }

float CigiEnvCtrlV2::GetVisibility ( void   )  const [inline]

Gets the Visibility value.

Returns:
the current Visibility.

Definition at line 323 of file CigiEnvCtrlV2.h.

00323 { return(Visibility); }

float CigiEnvCtrlV2::GetWindDir ( void   )  const [inline]

Gets the WindDir value.

Returns:
the current WindDir.

Definition at line 357 of file CigiEnvCtrlV2.h.

00357 { return(WindDir); }

Cigi_uint16 CigiEnvCtrlV2::GetYear ( void   )  const [inline]

Gets the Year value.

Returns:
the current Year.

Definition at line 207 of file CigiEnvCtrlV2.h.

00207 { return(Year); }

int CigiEnvCtrlV2::Pack ( CigiBasePacket Base,
Cigi_uint8 Buff,
void *  Spec 
) const [virtual]

The virtual Pack function for CIGI 2

Parameters:
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 V2 and V3.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseEnvCtrl.

Definition at line 136 of file CigiEnvCtrlV2.cpp.

References CigiBaseEnvCtrl::Aerosol, CigiBaseEnvCtrl::AirTemp, CigiBaseEnvCtrl::AtmosEn, CigiBaseEnvCtrl::BaroPress, PackPointerUnion::c, CIGI_ENV_CTRL_PACKET_SIZE_V2, CIGI_SCOPY4, PackPointerUnion::d, CigiBaseEnvCtrl::Day, CigiBaseEnvCtrl::EphemerisEn, PackPointerUnion::f, CigiBaseEnvCtrl::HorizWindSp, CigiBaseEnvCtrl::Hour, CigiBaseEnvCtrl::Humidity, PackPointerUnion::l, CigiBaseEnvCtrl::Minute, CigiBaseEnvCtrl::Month, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, PackPointerUnion::s, CigiBaseEnvCtrl::Visibility, CigiBaseEnvCtrl::WindDir, and CigiBaseEnvCtrl::Year.

00137 {
00138    double DBuf[6];
00139 
00140    Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf;
00141 
00142    PackPointer CDta;
00143 
00144    CigiBaseEnvCtrl * Data = ( CigiBaseEnvCtrl *)Base;
00145 
00146    CDta.d = DBuf;
00147 
00148    *CDta.c++ = PacketID;
00149    *CDta.c++ = PacketSize;
00150 
00151    *CDta.c++ = Data->Hour;
00152    *CDta.c++ = Data->Minute;
00153 
00154    *CDta.c++ = ((Data->Humidity) & 0x7f) | ((Data->EphemerisEn) ? 0x80 : 0);
00155 
00156    *CDta.c++ = (Data->AtmosEn) ? 0x80 : 0;
00157 
00158    *CDta.s++ = 0;
00159 
00160    // Determine date
00161    Cigi_uint32 date = ((Cigi_uint32)Data->Month * 1000000) +
00162                         ((Cigi_uint32)Data->Day   *   10000) + (Cigi_uint32)Data->Year;
00163    CIGI_SCOPY4(CDta.l++, &date);
00164 
00165    CIGI_SCOPY4(CDta.f++, &Data->AirTemp);
00166    CIGI_SCOPY4(CDta.f++, &Data->Visibility);
00167    CIGI_SCOPY4(CDta.f++, &Data->HorizWindSp);
00168    CIGI_SCOPY4(CDta.f++, &Data->WindDir);
00169    CIGI_SCOPY4(CDta.f++, &Data->BaroPress);
00170    CIGI_SCOPY4(CDta.f++, &Data->Aerosol);
00171 
00172 
00173    memcpy(Buff,tBuf,CIGI_ENV_CTRL_PACKET_SIZE_V2);
00174 
00175    return(PacketSize);
00176 
00177 }

int CigiEnvCtrlV2::SetAerosol ( const float  AerosolIn,
bool  bndchk = true 
)

Sets the Aerosol with bound checking control

Parameters:
AerosolIn - percentage Aerosol content of the air.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 385 of file CigiEnvCtrlV2.cpp.

References CigiBaseEnvCtrl::Aerosol, CIGI_ERROR_VALUE_OUT_OF_RANGE, and CIGI_SUCCESS.

00386 {
00387 
00388 #ifndef CIGI_NO_BND_CHK
00389    if(bndchk && (AerosolIn < 0.0))
00390    {
00391 #ifndef CIGI_NO_EXCEPT
00392       throw CigiValueOutOfRangeException("Aerosol",(float)AerosolIn,">",0.0);
00393 #endif
00394       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00395    }
00396 #endif
00397 
00398    Aerosol = AerosolIn;
00399    return(CIGI_SUCCESS);
00400 
00401 }

int CigiEnvCtrlV2::SetAirTemp ( const float  AirTempIn,
bool  bndchk = true 
) [inline]

Sets the AirTemp with bound checking control

Parameters:
AirTempIn - Current ambient air temperature.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 297 of file CigiEnvCtrlV2.h.

References CIGI_SUCCESS.

00298    {
00299       AirTemp = AirTempIn;
00300       return(CIGI_SUCCESS);
00301    }

int CigiEnvCtrlV2::SetAtmosEn ( const bool  AtmosEnIn,
bool  bndchk = true 
) [inline]

Sets the AtmosEn with bound checking control

Parameters:
AtmosEnIn - Enable (true) or disable (false) the atmospheric effects model
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 259 of file CigiEnvCtrlV2.h.

References CIGI_SUCCESS.

00260    {
00261       AtmosEn = AtmosEnIn;
00262       return(CIGI_SUCCESS);
00263    }

int CigiEnvCtrlV2::SetBaroPress ( const float  BaroPressIn,
bool  bndchk = true 
)

Sets the BaroPress with bound checking control

Parameters:
BaroPressIn - Current barometric pressure
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 473 of file CigiEnvCtrlV2.cpp.

References CigiBaseEnvCtrl::BaroPress, CIGI_ERROR_VALUE_OUT_OF_RANGE, and CIGI_SUCCESS.

00474 {
00475 
00476 #ifndef CIGI_NO_BND_CHK
00477    if(bndchk && (BaroPressIn < 0.0))
00478    {
00479 #ifndef CIGI_NO_EXCEPT
00480       throw CigiValueOutOfRangeException("BaroPress",(float)BaroPressIn,">",0.0);
00481 #endif
00482       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00483    }
00484 #endif
00485 
00486    BaroPress = BaroPressIn;
00487    return(CIGI_SUCCESS);
00488 
00489 }

int CigiEnvCtrlV2::SetDay ( const Cigi_uint8  DayIn,
bool  bndchk = true 
)

Sets the Day with bound checking control

Parameters:
DayIn - Current day
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 363 of file CigiEnvCtrlV2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::Day.

00364 {
00365 
00366 #ifndef CIGI_NO_BND_CHK
00367    if(bndchk && ((DayIn < 1)||(DayIn > 31)))
00368    {
00369 #ifndef CIGI_NO_EXCEPT
00370       throw CigiValueOutOfRangeException("Day",(Cigi_uint8)DayIn,1,31);
00371 #endif
00372       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00373    }
00374 #endif
00375 
00376    Day = DayIn;
00377    return(CIGI_SUCCESS);
00378 
00379 }

int CigiEnvCtrlV2::SetEphemerisEn ( const bool  EphemerisEnIn,
bool  bndchk = true 
) [inline]

Sets the EphemerisEn with bound checking control

Parameters:
EphemerisEnIn - Enable (true) or disable (false) ephereris model.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 220 of file CigiEnvCtrlV2.h.

References CIGI_SUCCESS.

00221    {
00222       EphemerisEn = EphemerisEnIn;
00223       return(CIGI_SUCCESS);
00224    }

int CigiEnvCtrlV2::SetHorizWindSp ( const float  HorizWindSpIn,
bool  bndchk = true 
)

Sets the HorizWindSp with bound checking control

Parameters:
HorizWindSpIn - Wind speed
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 429 of file CigiEnvCtrlV2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::HorizWindSp.

00430 {
00431 
00432 #ifndef CIGI_NO_BND_CHK
00433    if(bndchk && (HorizWindSpIn < 0.0))
00434    {
00435 #ifndef CIGI_NO_EXCEPT
00436       throw CigiValueOutOfRangeException("HorizWindSp",(float)HorizWindSpIn,">",0.0);
00437 #endif
00438       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00439    }
00440 #endif
00441 
00442    HorizWindSp = HorizWindSpIn;
00443    return(CIGI_SUCCESS);
00444 
00445 }

int CigiEnvCtrlV2::SetHour ( const Cigi_uint8  HourIn,
bool  bndchk = true 
)

Sets the Hour with bound checking control

Parameters:
HourIn - Current hour
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 275 of file CigiEnvCtrlV2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::Hour.

00276 {
00277 
00278 #ifndef CIGI_NO_BND_CHK
00279    if(bndchk && ((HourIn < 0)||(HourIn > 23)))
00280    {
00281 #ifndef CIGI_NO_EXCEPT
00282       throw CigiValueOutOfRangeException("Hour",(Cigi_uint8)HourIn,0,23);
00283 #endif
00284       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00285    }
00286 #endif
00287 
00288    Hour = HourIn;
00289    return(CIGI_SUCCESS);
00290 
00291 }

int CigiEnvCtrlV2::SetHumidity ( const Cigi_uint8  HumidityIn,
bool  bndchk = true 
)

Sets the Humidity with bound checking control

Parameters:
HumidityIn - Percentage humidity.
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 319 of file CigiEnvCtrlV2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::Humidity.

00320 {
00321 
00322 #ifndef CIGI_NO_BND_CHK
00323    if(bndchk && ((HumidityIn < 0)||(HumidityIn > 100)))
00324    {
00325 #ifndef CIGI_NO_EXCEPT
00326       throw CigiValueOutOfRangeException("Humidity",(Cigi_uint8)HumidityIn,0,100);
00327 #endif
00328       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00329    }
00330 #endif
00331 
00332    Humidity = HumidityIn;
00333    return(CIGI_SUCCESS);
00334 
00335 }

int CigiEnvCtrlV2::SetMinute ( const Cigi_uint8  MinuteIn,
bool  bndchk = true 
)

Sets the Minute with bound checking control

Parameters:
MinuteIn - Current minute
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 297 of file CigiEnvCtrlV2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::Minute.

00298 {
00299 
00300 #ifndef CIGI_NO_BND_CHK
00301    if(bndchk && ((MinuteIn < 0)||(MinuteIn > 59)))
00302    {
00303 #ifndef CIGI_NO_EXCEPT
00304       throw CigiValueOutOfRangeException("Minute",(Cigi_uint8)MinuteIn,0,59);
00305 #endif
00306       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00307    }
00308 #endif
00309 
00310    Minute = MinuteIn;
00311    return(CIGI_SUCCESS);
00312 
00313 }

int CigiEnvCtrlV2::SetMonth ( const Cigi_uint8  MonthIn,
bool  bndchk = true 
)

Sets the Month with bound checking control

Parameters:
MonthIn - Current month
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 341 of file CigiEnvCtrlV2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::Month.

00342 {
00343 
00344 #ifndef CIGI_NO_BND_CHK
00345    if(bndchk && ((MonthIn < 1)||(MonthIn > 12)))
00346    {
00347 #ifndef CIGI_NO_EXCEPT
00348       throw CigiValueOutOfRangeException("Month",(Cigi_uint8)MonthIn,1,12);
00349 #endif
00350       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00351    }
00352 #endif
00353 
00354    Month = MonthIn;
00355    return(CIGI_SUCCESS);
00356 
00357 }

int CigiEnvCtrlV2::SetVisibility ( const float  VisibilityIn,
bool  bndchk = true 
)

Sets the Visibility with bound checking control

Parameters:
VisibilityIn - Global visibility
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 407 of file CigiEnvCtrlV2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::Visibility.

00408 {
00409 
00410 #ifndef CIGI_NO_BND_CHK
00411    if(bndchk && (VisibilityIn < 0.0))
00412    {
00413 #ifndef CIGI_NO_EXCEPT
00414       throw CigiValueOutOfRangeException("Visibility",(float)VisibilityIn,">",0.0);
00415 #endif
00416       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00417    }
00418 #endif
00419 
00420    Visibility = VisibilityIn;
00421    return(CIGI_SUCCESS);
00422 
00423 }

int CigiEnvCtrlV2::SetWindDir ( const float  WindDirIn,
bool  bndchk = true 
)

Sets the WindDir with bound checking control

Parameters:
WindDirIn - Wind direction
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 451 of file CigiEnvCtrlV2.cpp.

References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseEnvCtrl::WindDir.

00452 {
00453 
00454 #ifndef CIGI_NO_BND_CHK
00455    if(bndchk && ((WindDirIn < 0.0)||(WindDirIn > 360.0)))
00456    {
00457 #ifndef CIGI_NO_EXCEPT
00458       throw CigiValueOutOfRangeException("WindDir",(float)WindDirIn,0.0,360.0);
00459 #endif
00460       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00461    }
00462 #endif
00463 
00464    WindDir = WindDirIn;
00465    return(CIGI_SUCCESS);
00466 
00467 }

int CigiEnvCtrlV2::SetYear ( const Cigi_uint16  YearIn,
bool  bndchk = true 
) [inline]

Sets the Year with bound checking control

Parameters:
YearIn - Current year
bndchk - Enables (true) or disables (false) bounds checking.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 198 of file CigiEnvCtrlV2.h.

References CIGI_SUCCESS.

00199    {
00200       Year = YearIn;
00201       return(CIGI_SUCCESS);
00202    }

int CigiEnvCtrlV2::Unpack ( Cigi_uint8 Buff,
bool  Swap,
void *  Spec 
) [virtual]

The virtual Unpack function for CIGI 2

Parameters:
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 V2 and V3.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Implements CigiBaseEnvCtrl.

Definition at line 182 of file CigiEnvCtrlV2.cpp.

References CigiBaseEnvCtrl::Aerosol, CigiBaseEnvCtrl::AirTemp, CigiBaseEnvCtrl::AtmosEn, CigiBaseEnvCtrl::BaroPress, PackPointerUnion::c, CIGI_ENV_CTRL_PACKET_SIZE_V2, CIGI_SCOPY4, PackPointerUnion::d, CigiBaseEnvCtrl::DateVld, CigiBaseEnvCtrl::Day, CigiBaseEnvCtrl::EphemerisEn, PackPointerUnion::f, CigiBaseEnvCtrl::HorizWindSp, CigiBaseEnvCtrl::Hour, CigiBaseEnvCtrl::Humidity, PackPointerUnion::l, CigiBaseEnvCtrl::Minute, CigiBaseEnvCtrl::Month, CigiBaseEnvCtrl::MoonEn, CigiBasePacket::PacketSize, PackPointerUnion::s, CigiBaseEnvCtrl::StarEn, CigiBaseEnvCtrl::SunEn, CigiBaseEnvCtrl::Visibility, CigiBaseEnvCtrl::WindDir, and CigiBaseEnvCtrl::Year.

00183 {
00184    double DBuf[6];
00185 
00186    Cigi_uint8 *tBuf = (Cigi_uint8 *)DBuf;
00187 
00188    PackPointer CDta;
00189 
00190    memcpy(tBuf,Buff,CIGI_ENV_CTRL_PACKET_SIZE_V2);
00191 
00192    CDta.d = DBuf;
00193 
00194    CDta.c += 2;  // Step over packet id and size
00195 
00196    Hour = *CDta.c++;
00197    Minute = *CDta.c++;
00198 
00199    Cigi_uint8 HDta = *CDta.c++;
00200    EphemerisEn = ((HDta & 0x80) != 0);
00201    Humidity = HDta & 0x7f;
00202 
00203    SunEn = MoonEn = StarEn = DateVld = EphemerisEn;
00204 
00205    AtmosEn = (*CDta.c++ != 0);
00206 
00207    CDta.s++;
00208 
00209    // Determine date
00210    Cigi_uint32 date;
00211    CIGI_SCOPY4(&date, CDta.l++);
00212 
00213    Month = (Cigi_uint8)(date / 1000000);
00214    date -= ((Cigi_uint32)Month * 1000000);
00215 
00216    Day = (Cigi_uint8)(date / 10000);
00217    date -= ((Cigi_uint32)Day * 10000);
00218 
00219    Year = (Cigi_uint16)date;
00220 
00221 
00222    CIGI_SCOPY4(&AirTemp, CDta.f++);
00223    CIGI_SCOPY4(&Visibility, CDta.f++);
00224    CIGI_SCOPY4(&HorizWindSp, CDta.f++);
00225    CIGI_SCOPY4(&WindDir, CDta.f++);
00226    CIGI_SCOPY4(&BaroPress, CDta.f++);
00227    CIGI_SCOPY4(&Aerosol, CDta.f++);
00228 
00229 
00230    return(PacketSize);
00231 
00232 }


The documentation for this class was generated from the following files:
Generated on Wed Apr 29 09:00:08 2009 for CCL by  doxygen 1.4.7