CigiBaseWeatherCtrl.cpp

Go to the documentation of this file.
00001 
00049 #define _EXPORT_CCL_
00050 
00051 #include "CigiBaseWeatherCtrl.h"
00052 #include "CigiSwapping.h"
00053 #include "CigiExceptions.h"
00054 
00055 
00056 // ====================================================================
00057 // Construction/Destruction
00058 // ====================================================================
00059 
00060 
00061 // ================================================
00062 // CigiBaseWeatherCtrl
00063 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00064 CigiBaseWeatherCtrl::CigiBaseWeatherCtrl()
00065 {
00066 
00067 }
00068 
00069 
00070 
00071 // ================================================
00072 // ~CigiBaseWeatherCtrl
00073 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00074 CigiBaseWeatherCtrl::~CigiBaseWeatherCtrl()
00075 {
00076 
00077 }
00078 
00079 
00080 // ====================================================================
00081 // Conversion Control
00082 // ====================================================================
00083 
00084 
00085 // ================================================
00086 // GetCnvt
00087 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00088 int CigiBaseWeatherCtrl::GetCnvt(CigiVersionID &CnvtVersion,
00089                                  CigiCnvtInfoType::Type &CnvtInfo)
00090 {
00091    CnvtInfo.ProcID = CigiProcessType::ProcStd;
00092 
00093    // V1 & V2 have the same packet id number
00094    if(CnvtVersion.CigiMajorVersion < 3)
00095       CnvtInfo.CnvtPacketID = CIGI_WEATHER_CTRL_PACKET_ID_V2;
00096    else
00097       CnvtInfo.CnvtPacketID = CIGI_WEATHER_CTRL_PACKET_ID_V3;
00098 
00099    return(CIGI_SUCCESS);
00100 }
00101 
00102 
00103 // ====================================================================
00104 // Accessors
00105 // ====================================================================
00106 
00107 
00108 // ================================================
00109 // VisibilityRng
00110 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00111 int CigiBaseWeatherCtrl::SetVisibilityRng(const float VisibilityRngIn, bool bndchk)
00112 {
00113 
00114 #ifndef CIGI_NO_BND_CHK
00115    if(bndchk && (VisibilityRngIn < 0))
00116    {
00117 #ifndef CIGI_NO_EXCEPT
00118       throw CigiValueOutOfRangeException("VisibilityRng",(double)VisibilityRngIn,">=",0.0);
00119 #endif
00120       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00121    }
00122 #endif
00123 
00124    VisibilityRng = VisibilityRngIn;
00125 
00126    if(VisibilityRng > 70000.0f)
00127       Opacity = 100.0f;
00128    else
00129       Opacity = ((VisibilityRng/70000.0f)*100.0f);
00130 
00131    return(CIGI_SUCCESS);
00132 
00133 }
00134 
00135 
00136 // ================================================
00137 // Severity
00138 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00139 int CigiBaseWeatherCtrl::SetSeverity(const Cigi_uint8 SeverityIn, bool bndchk)
00140 {
00141 
00142 #ifndef CIGI_NO_BND_CHK
00143    if(bndchk && ((SeverityIn < 0)||(SeverityIn > 5)))
00144    {
00145 #ifndef CIGI_NO_EXCEPT
00146       throw CigiValueOutOfRangeException("Severity",(Cigi_uint8)SeverityIn,0,5);
00147 #endif
00148       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00149    }
00150 #endif
00151 
00152    Severity = SeverityIn;
00153    return(CIGI_SUCCESS);
00154 
00155 }
00156 
00157 
00158 // ================================================
00159 // ScudFreq
00160 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00161 int CigiBaseWeatherCtrl::SetScudFreq(const float ScudFreqIn, bool bndchk)
00162 {
00163 
00164 #ifndef CIGI_NO_BND_CHK
00165    if(bndchk && ((ScudFreqIn < 0.0)||(ScudFreqIn > 100.0)))
00166    {
00167 #ifndef CIGI_NO_EXCEPT
00168       throw CigiValueOutOfRangeException("ScudFreq",(float)ScudFreqIn,0.0,100.0);
00169 #endif
00170       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00171    }
00172 #endif
00173 
00174    ScudFreq = ScudFreqIn;
00175    return(CIGI_SUCCESS);
00176 
00177 }
00178 
00179 
00180 // ================================================
00181 // Coverage
00182 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00183 int CigiBaseWeatherCtrl::SetCoverage(const float CoverageIn, bool bndchk)
00184 {
00185 
00186 #ifndef CIGI_NO_BND_CHK
00187    if(bndchk && ((CoverageIn < 0.0)||(CoverageIn > 100.0)))
00188    {
00189 #ifndef CIGI_NO_EXCEPT
00190       throw CigiValueOutOfRangeException("Coverage",(float)CoverageIn,0.0,100.0);
00191 #endif
00192       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00193    }
00194 #endif
00195 
00196    Coverage = CoverageIn;
00197    return(CIGI_SUCCESS);
00198 
00199 }
00200 
00201 

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