00001
00045 #define _EXPORT_CCL_
00046
00047 #include "CigiBaseWaveCtrl.h"
00048 #include "CigiSwapping.h"
00049 #include "CigiExceptions.h"
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 CigiBaseWaveCtrl::CigiBaseWaveCtrl()
00061 {
00062
00063 }
00064
00065
00066
00067
00068
00069
00070 CigiBaseWaveCtrl::~CigiBaseWaveCtrl()
00071 {
00072
00073 }
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 int CigiBaseWaveCtrl::GetCnvt(CigiVersionID &CnvtVersion,
00085 CigiCnvtInfoType::Type &CnvtInfo)
00086 {
00087 if(CnvtVersion.CigiMajorVersion < 3)
00088 {
00089 CnvtInfo.ProcID = CigiProcessType::ProcNone;
00090 CnvtInfo.CnvtPacketID = 0;
00091 }
00092 else
00093 {
00094 CnvtInfo.ProcID = CigiProcessType::ProcStd;
00095 CnvtInfo.CnvtPacketID = CIGI_WAVE_CTRL_PACKET_ID_V3;
00096 }
00097
00098 return(CIGI_SUCCESS);
00099 }
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 int CigiBaseWaveCtrl::SetScope(const ScopeGrp ScopeIn, bool bndchk)
00110 {
00111
00112 #ifndef CIGI_NO_BND_CHK
00113 if(bndchk && ((ScopeIn < 0)||(ScopeIn > 2)))
00114 {
00115 #ifndef CIGI_NO_EXCEPT
00116 throw CigiValueOutOfRangeException("Scope",(ScopeGrp)ScopeIn,0,2);
00117 #endif
00118 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00119 }
00120 #endif
00121
00122 Scope = ScopeIn;
00123 return(CIGI_SUCCESS);
00124
00125 }
00126
00127
00128
00129
00130
00131 int CigiBaseWaveCtrl::SetBreaker(const BreakerGrp BreakerIn, bool bndchk)
00132 {
00133
00134 #ifndef CIGI_NO_BND_CHK
00135 if(bndchk && ((BreakerIn < 0)||(BreakerIn > 2)))
00136 {
00137 #ifndef CIGI_NO_EXCEPT
00138 throw CigiValueOutOfRangeException("Breaker",(BreakerGrp)BreakerIn,0,2);
00139 #endif
00140 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00141 }
00142 #endif
00143
00144 Breaker = BreakerIn;
00145 return(CIGI_SUCCESS);
00146
00147 }
00148
00149
00150
00151
00152
00153 int CigiBaseWaveCtrl::SetWaveHt(const float WaveHtIn, bool bndchk)
00154 {
00155
00156 #ifndef CIGI_NO_BND_CHK
00157 if(bndchk && (WaveHtIn < 0.0))
00158 {
00159 #ifndef CIGI_NO_EXCEPT
00160 throw CigiValueOutOfRangeException("WaveHt",(float)WaveHtIn,">",0.0);
00161 #endif
00162 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00163 }
00164 #endif
00165
00166 WaveHt = WaveHtIn;
00167 return(CIGI_SUCCESS);
00168
00169 }
00170
00171
00172
00173
00174
00175 int CigiBaseWaveCtrl::SetWaveLen(const float WaveLenIn, bool bndchk)
00176 {
00177
00178 #ifndef CIGI_NO_BND_CHK
00179 if(bndchk && (WaveLenIn < 0.0))
00180 {
00181 #ifndef CIGI_NO_EXCEPT
00182 throw CigiValueOutOfRangeException("WaveLen",(float)WaveLenIn,">",0.0);
00183 #endif
00184 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00185 }
00186 #endif
00187
00188 WaveLen = WaveLenIn;
00189 return(CIGI_SUCCESS);
00190
00191 }
00192
00193
00194
00195
00196
00197 int CigiBaseWaveCtrl::SetPeriod(const float PeriodIn, bool bndchk)
00198 {
00199
00200 #ifndef CIGI_NO_BND_CHK
00201 if(bndchk && (PeriodIn < 0.0))
00202 {
00203 #ifndef CIGI_NO_EXCEPT
00204 throw CigiValueOutOfRangeException("Period",(float)PeriodIn,">",0.0);
00205 #endif
00206 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00207 }
00208 #endif
00209
00210 Period = PeriodIn;
00211 return(CIGI_SUCCESS);
00212
00213 }
00214
00215
00216
00217
00218
00219 int CigiBaseWaveCtrl::SetDirection(const float DirectionIn, bool bndchk)
00220 {
00221
00222 #ifndef CIGI_NO_BND_CHK
00223 if(bndchk && ((DirectionIn < 0.0)||(DirectionIn > 360.0)))
00224 {
00225 #ifndef CIGI_NO_EXCEPT
00226 throw CigiValueOutOfRangeException("Direction",(float)DirectionIn,0.0,360.0);
00227 #endif
00228 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00229 }
00230 #endif
00231
00232 Direction = DirectionIn;
00233 return(CIGI_SUCCESS);
00234
00235 }
00236
00237
00238
00239
00240
00241 int CigiBaseWaveCtrl::SetPhaseOff(const float PhaseOffIn, bool bndchk)
00242 {
00243
00244 #ifndef CIGI_NO_BND_CHK
00245 if(bndchk && ((PhaseOffIn < -360.0)||(PhaseOffIn > 360.0)))
00246 {
00247 #ifndef CIGI_NO_EXCEPT
00248 throw CigiValueOutOfRangeException("PhaseOff",(float)PhaseOffIn,-360.0,360.0);
00249 #endif
00250 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00251 }
00252 #endif
00253
00254 PhaseOff = PhaseOffIn;
00255 return(CIGI_SUCCESS);
00256
00257 }
00258
00259
00260
00261
00262
00263 int CigiBaseWaveCtrl::SetLeading(const float LeadingIn, bool bndchk)
00264 {
00265
00266 #ifndef CIGI_NO_BND_CHK
00267 if(bndchk && ((LeadingIn < -180.0)||(LeadingIn > 180.0)))
00268 {
00269 #ifndef CIGI_NO_EXCEPT
00270 throw CigiValueOutOfRangeException("Leading",(float)LeadingIn,-180.0,180.0);
00271 #endif
00272 return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00273 }
00274 #endif
00275
00276 Leading = LeadingIn;
00277 return(CIGI_SUCCESS);
00278
00279 }
00280
00281