CigiBaseSensorCtrl.cpp

Go to the documentation of this file.
00001 
00045 #define _EXPORT_CCL_
00046 
00047 #include "CigiBaseSensorCtrl.h"
00048 #include "CigiSwapping.h"
00049 #include "CigiExceptions.h"
00050 
00051 
00052 // ====================================================================
00053 // Construction/Destruction
00054 // ====================================================================
00055 
00056 
00057 // ================================================
00058 // CigiBaseSensorCtrl
00059 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00060 CigiBaseSensorCtrl::CigiBaseSensorCtrl()
00061 {
00062 
00063 }
00064 
00065 
00066 
00067 // ================================================
00068 // ~CigiBaseSensorCtrl
00069 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00070 CigiBaseSensorCtrl::~CigiBaseSensorCtrl()
00071 {
00072 
00073 }
00074 
00075 
00076 // ====================================================================
00077 // Conversion Control
00078 // ====================================================================
00079 
00080 
00081 // ================================================
00082 // GetCnvt
00083 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00084 int CigiBaseSensorCtrl::GetCnvt(CigiVersionID &CnvtVersion,
00085                                 CigiCnvtInfoType::Type &CnvtInfo)
00086 {
00087    CnvtInfo.ProcID = CigiProcessType::ProcStd;
00088 
00089    if(CnvtVersion.CigiMajorVersion < 3)
00090       CnvtInfo.CnvtPacketID = CIGI_SENSOR_CTRL_PACKET_ID_V2;
00091    else
00092       CnvtInfo.CnvtPacketID = CIGI_SENSOR_CTRL_PACKET_ID_V3;
00093 
00094    return(CIGI_SUCCESS);
00095 }
00096 
00097 
00098 // ====================================================================
00099 // Accessors
00100 // ====================================================================
00101 
00102 
00103 // ================================================
00104 // Polarity
00105 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00106 int CigiBaseSensorCtrl::SetPolarity(const PolarityGrp PolarityIn, bool bndchk)
00107 {
00108 
00109 #ifndef CIGI_NO_BND_CHK
00110    if(bndchk && ((PolarityIn < 0)||(PolarityIn > 1)))
00111    {
00112 #ifndef CIGI_NO_EXCEPT
00113       throw CigiValueOutOfRangeException("Polarity",(PolarityGrp)PolarityIn,0,1);
00114 #endif
00115       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00116    }
00117 #endif
00118 
00119    Polarity = PolarityIn;
00120    return(CIGI_SUCCESS);
00121 
00122 }
00123 
00124 
00125 // ================================================
00126 // TrackMode
00127 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00128 int CigiBaseSensorCtrl::SetTrackMode(const TrackModeGrp TrackModeIn, bool bndchk)
00129 {
00130 
00131 #ifndef CIGI_NO_BND_CHK
00132    if(bndchk && ((TrackModeIn < 0)||(TrackModeIn > 7)))
00133    {
00134 #ifndef CIGI_NO_EXCEPT
00135       throw CigiValueOutOfRangeException("TrackMode",(TrackModeGrp)TrackModeIn,0,7);
00136 #endif
00137       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00138    }
00139 #endif
00140 
00141    TrackMode = TrackModeIn;
00142    return(CIGI_SUCCESS);
00143 
00144 }
00145 
00146 
00147 // ================================================
00148 // TrackPolarity
00149 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00150 int CigiBaseSensorCtrl::SetTrackPolarity(const TrackPolarityGrp TrackPolarityIn, bool bndchk)
00151 {
00152 
00153 #ifndef CIGI_NO_BND_CHK
00154    if(bndchk && ((TrackPolarityIn < 0)||(TrackPolarityIn > 1)))
00155    {
00156 #ifndef CIGI_NO_EXCEPT
00157       throw CigiValueOutOfRangeException("TrackPolarity",(TrackPolarityGrp)TrackPolarityIn,0,1);
00158 #endif
00159       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00160    }
00161 #endif
00162 
00163    TrackPolarity = TrackPolarityIn;
00164    return(CIGI_SUCCESS);
00165 
00166 }
00167 
00168 
00169 // ================================================
00170 // Level
00171 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00172 int CigiBaseSensorCtrl::SetLevel(const float LevelIn, bool bndchk)
00173 {
00174 
00175 #ifndef CIGI_NO_BND_CHK
00176    if(bndchk && ((LevelIn < 0.0)||(LevelIn > 1.0)))
00177    {
00178 #ifndef CIGI_NO_EXCEPT
00179       throw CigiValueOutOfRangeException("Level",(float)LevelIn,0.0,1.0);
00180 #endif
00181       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00182    }
00183 #endif
00184 
00185    Level = LevelIn;
00186    return(CIGI_SUCCESS);
00187 
00188 }
00189 
00190 
00191 // ================================================
00192 // ACCoupling
00193 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00194 int CigiBaseSensorCtrl::SetACCoupling(const float ACCouplingIn, bool bndchk)
00195 {
00196 
00197 #ifndef CIGI_NO_BND_CHK
00198    if(bndchk && (ACCouplingIn < 0.0))
00199    {
00200 #ifndef CIGI_NO_EXCEPT
00201       throw CigiValueOutOfRangeException("ACCoupling",(float)ACCouplingIn,">=",0.0);
00202 #endif
00203       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00204    }
00205 #endif
00206 
00207    ACCoupling = ACCouplingIn;
00208    return(CIGI_SUCCESS);
00209 
00210 }
00211 
00212 
00213 // ================================================
00214 // Noise
00215 // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00216 int CigiBaseSensorCtrl::SetNoise(const float NoiseIn, bool bndchk)
00217 {
00218 
00219 #ifndef CIGI_NO_BND_CHK
00220    if(bndchk && ((NoiseIn < 0.0)||(NoiseIn > 1.0)))
00221    {
00222 #ifndef CIGI_NO_EXCEPT
00223       throw CigiValueOutOfRangeException("Noise",(float)NoiseIn,0.0,1.0);
00224 #endif
00225       return(CIGI_ERROR_VALUE_OUT_OF_RANGE);
00226    }
00227 #endif
00228 
00229    Noise = NoiseIn;
00230    return(CIGI_SUCCESS);
00231 
00232 }
00233 
00234 

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