00001
00049 #define _EXPORT_CCL_
00050
00051 #include "CigiBaseEnvCondReq.h"
00052 #include "CigiSwapping.h"
00053 #include "CigiExceptions.h"
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 CigiBaseEnvCondReq::CigiBaseEnvCondReq()
00065 {
00066
00067 }
00068
00069
00070
00071
00072
00073
00074 CigiBaseEnvCondReq::~CigiBaseEnvCondReq()
00075 {
00076
00077 }
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088 int CigiBaseEnvCondReq::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_ENV_COND_REQ_PACKET_ID_V3;
00100 }
00101
00102 return(CIGI_SUCCESS);
00103 }
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114 int CigiBaseEnvCondReq::SetReqType(const Cigi_uint8 ReqTypeIn, bool bndchk)
00115 {
00116
00117 #ifndef CIGI_NO_BND_CHK
00118 if(bndchk && ((ReqTypeIn < 0)||(ReqTypeIn > 15)))
00119 {
00120 #ifndef CIGI_NO_EXCEPT
00121 throw CigiValueOutOfRangeException("ReqType",(int)ReqTypeIn,0,15);
00122 #endif
00123 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00124 }
00125 #endif
00126
00127 ReqType = ReqTypeIn;
00128 return(CIGI_SUCCESS);
00129
00130 }
00131
00132
00133
00134
00135
00136 int CigiBaseEnvCondReq::SetLat(const double LatIn, bool bndchk)
00137 {
00138
00139 #ifndef CIGI_NO_BND_CHK
00140 if(bndchk && ((LatIn < -90.0)||(LatIn > 90.0)))
00141 {
00142 #ifndef CIGI_NO_EXCEPT
00143 throw CigiValueOutOfRangeException("Lat",(double)LatIn,-90.0,90.0);
00144 #endif
00145 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00146 }
00147 #endif
00148
00149 Lat = LatIn;
00150 return(CIGI_SUCCESS);
00151
00152 }
00153
00154
00155
00156
00157
00158 int CigiBaseEnvCondReq::SetLon(const double LonIn, bool bndchk)
00159 {
00160
00161 #ifndef CIGI_NO_BND_CHK
00162 if(bndchk && ((LonIn < -180.0)||(LonIn > 180.0)))
00163 {
00164 #ifndef CIGI_NO_EXCEPT
00165 throw CigiValueOutOfRangeException("Lon",(double)LonIn,-180.0,180.0);
00166 #endif
00167 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00168 }
00169 #endif
00170
00171 Lon = LonIn;
00172 return(CIGI_SUCCESS);
00173
00174 }
00175
00176