#include <CigiLosVectReqV3_2.h>
Inheritance diagram for CigiLosVectReqV3_2:
Public Member Functions | |
CigiLosVectReqV3_2 () | |
virtual | ~CigiLosVectReqV3_2 () |
virtual int | Pack (CigiBasePacket *Base, Cigi_uint8 *Buff, void *Spec) const |
virtual int | Unpack (Cigi_uint8 *Buff, bool Swap, void *Spec) |
int | SetReqType (const ReqTypeGrp ReqTypeIn, bool bndchk=true) |
ReqTypeGrp | GetReqType (void) const |
int | SetSrcCoordSys (const CoordSysGrp SrcCoordSysIn, bool bndchk=true) |
CoordSysGrp | GetSrcCoordSys (void) const |
int | SetResponseCoordSys (const CoordSysGrp ResponseCoordSysIn, bool bndchk=true) |
CoordSysGrp | GetResponseCoordSys (void) const |
int | SetAlphaThresh (const Cigi_uint8 AlphaThreshIn, bool bndchk=true) |
Cigi_uint8 | GetAlphaThresh (void) const |
int | SetEntityID (const Cigi_uint16 EntityIDIn, bool bndchk=true) |
Cigi_uint16 | GetEntityID (void) const |
int | SetVectAz (const float VectAzIn, bool bndchk=true) |
float | GetVectAz (void) |
int | SetMinRange (const float MinRangeIn, bool bndchk=true) |
float | GetMinRange (void) const |
int | SetSrcXoff (const double SrcXoffIn, bool bndchk=true) |
double | GetSrcXoff (void) const |
int | SetSrcYoff (const double SrcYoffIn, bool bndchk=true) |
double | GetSrcYoff (void) const |
int | SetSrcZoff (const double SrcZoffIn, bool bndchk=true) |
double | GetSrcZoff (void) const |
int | SetMask (const Cigi_uint32 MaskIn, bool bndchk=true) |
Cigi_uint32 | GetMask (void) const |
int | SetUpdatePeriod (const Cigi_uint8 UpdatePeriodIn, bool bndchk=true) |
Cigi_uint8 | GetUpdatePeriod (void) const |
Definition at line 55 of file CigiLosVectReqV3_2.h.
CigiLosVectReqV3_2::CigiLosVectReqV3_2 | ( | ) |
General Constructor
Definition at line 62 of file CigiLosVectReqV3_2.cpp.
References CigiBaseLosVectReq::AlphaThresh, CigiBaseLosVectReq::Basic, CIGI_LOS_VECT_REQ_PACKET_ID_V3_2, CIGI_LOS_VECT_REQ_PACKET_SIZE_V3_2, CigiBaseLosVectReq::EntityID, CigiBaseLosVectReq::Geodetic, CigiBaseLosVectReq::LosID, CigiBaseLosVectReq::Mask, CigiBaseLosVectReq::MaxRange, CigiBasePacket::MinorVersion, CigiBaseLosVectReq::MinRange, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseLosVectReq::ReqType, CigiBaseLosVectReq::ResponseCoordSys, CigiBaseLosVectReq::SrcCoordSys, CigiBaseLosVectReq::SrcXLat, CigiBaseLosVectReq::SrcYLon, CigiBaseLosVectReq::SrcZAlt, CigiBaseLosVectReq::UpdatePeriod, CigiBaseLosVectReq::ValidV1or2, CigiBaseLosVectReq::VectAz, CigiBaseLosVectReq::VectEl, and CigiBasePacket::Version.
00063 { 00064 00065 PacketID = CIGI_LOS_VECT_REQ_PACKET_ID_V3_2; 00066 PacketSize = CIGI_LOS_VECT_REQ_PACKET_SIZE_V3_2; 00067 Version = 3; 00068 MinorVersion = 2; 00069 00070 LosID = 0; 00071 ReqType = Basic; 00072 SrcCoordSys = Geodetic; 00073 ResponseCoordSys = Geodetic; 00074 AlphaThresh = 0; 00075 EntityID = 0; 00076 VectAz = 0.0; 00077 VectEl = 0.0; 00078 MinRange = 0.0; 00079 MaxRange = 0.0; 00080 SrcXLat = 0.0; 00081 SrcYLon = 0.0; 00082 SrcZAlt = 0.0; 00083 Mask = 0; 00084 UpdatePeriod = 0; 00085 ValidV1or2 = true; 00086 00087 }
CigiLosVectReqV3_2::~CigiLosVectReqV3_2 | ( | ) | [virtual] |
Cigi_uint8 CigiLosVectReqV3_2::GetAlphaThresh | ( | void | ) | const [inline] |
Gets the AlphaThresh value.
Definition at line 183 of file CigiLosVectReqV3_2.h.
00183 { return(AlphaThresh); }
Cigi_uint16 CigiLosVectReqV3_2::GetEntityID | ( | void | ) | const [inline] |
Gets the EntityID value.
Definition at line 204 of file CigiLosVectReqV3_2.h.
00204 { return(EntityID); }
Cigi_uint32 CigiLosVectReqV3_2::GetMask | ( | void | ) | const [inline] |
Gets the Mask value.
Definition at line 336 of file CigiLosVectReqV3_2.h.
00336 { return(Mask); }
float CigiLosVectReqV3_2::GetMinRange | ( | void | ) | const [inline] |
Gets the MinRange value.
Definition at line 249 of file CigiLosVectReqV3_2.h.
00249 { return(MinRange); }
ReqTypeGrp CigiLosVectReqV3_2::GetReqType | ( | void | ) | const [inline] |
Gets the ReqType value.
Definition at line 121 of file CigiLosVectReqV3_2.h.
00121 { return(ReqType); }
CoordSysGrp CigiLosVectReqV3_2::GetResponseCoordSys | ( | void | ) | const [inline] |
Gets the ResponseCoordSys value.
Definition at line 161 of file CigiLosVectReqV3_2.h.
00161 { return(ResponseCoordSys); }
CoordSysGrp CigiLosVectReqV3_2::GetSrcCoordSys | ( | void | ) | const [inline] |
Gets the SrcCoordSys value.
Definition at line 141 of file CigiLosVectReqV3_2.h.
00141 { return(SrcCoordSys); }
double CigiLosVectReqV3_2::GetSrcXoff | ( | void | ) | const [inline] |
Gets the SrcXoff value.
Definition at line 271 of file CigiLosVectReqV3_2.h.
00271 { return(SrcXLat); }
double CigiLosVectReqV3_2::GetSrcYoff | ( | void | ) | const [inline] |
Gets the SrcYoff value.
Definition at line 293 of file CigiLosVectReqV3_2.h.
00293 { return(SrcYLon); }
double CigiLosVectReqV3_2::GetSrcZoff | ( | void | ) | const [inline] |
Gets the SrcZoff value.
Definition at line 315 of file CigiLosVectReqV3_2.h.
00315 { return(SrcZAlt); }
Cigi_uint8 CigiLosVectReqV3_2::GetUpdatePeriod | ( | void | ) | const [inline] |
Gets the Update Period value.
Definition at line 361 of file CigiLosVectReqV3_2.h.
00361 { return(UpdatePeriod); }
float CigiLosVectReqV3_2::GetVectAz | ( | void | ) | [inline] |
Gets the VectAz value.
Definition at line 221 of file CigiLosVectReqV3_2.h.
int CigiLosVectReqV3_2::Pack | ( | CigiBasePacket * | Base, | |
Cigi_uint8 * | Buff, | |||
void * | Spec | |||
) | const [virtual] |
The virtual Pack function for CIGI 3
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 not used in this class. |
Implements CigiBaseLosVectReq.
Definition at line 104 of file CigiLosVectReqV3_2.cpp.
References CigiBaseLosVectReq::AlphaThresh, PackPointerUnion::c, PackPointerUnion::d, CigiBaseLosVectReq::EntityID, PackPointerUnion::f, PackPointerUnion::l, CigiBaseLosVectReq::LosID, CigiBaseLosVectReq::Mask, CigiBaseLosVectReq::MaxRange, CigiBaseLosVectReq::MinRange, CigiBasePacket::PacketID, CigiBasePacket::PacketSize, CigiBaseLosVectReq::ReqType, CigiBaseLosVectReq::ResponseCoordSys, PackPointerUnion::s, CigiBaseLosVectReq::SrcCoordSys, CigiBaseLosVectReq::SrcXLat, CigiBaseLosVectReq::SrcYLon, CigiBaseLosVectReq::SrcZAlt, CigiBaseLosVectReq::UpdatePeriod, CigiBaseLosVectReq::VectAz, and CigiBaseLosVectReq::VectEl.
00105 { 00106 PackPointer CDta; 00107 00108 CigiBaseLosVectReq * Data = ( CigiBaseLosVectReq *)Base; 00109 00110 CDta.c = Buff; 00111 00112 *CDta.c++ = PacketID; 00113 *CDta.c++ = PacketSize; 00114 00115 *CDta.s++ = Data->LosID; 00116 00117 Cigi_uint8 HDta = (Cigi_uint8)(Data->ReqType & 0x01); 00118 HDta |= (Cigi_uint8)((Data->SrcCoordSys << 1) & 0x02); 00119 HDta |= (Cigi_uint8)((Data->ResponseCoordSys << 2) & 0x04); 00120 *CDta.c++ = HDta; 00121 00122 *CDta.c++ = Data->AlphaThresh; 00123 *CDta.s++ = Data->EntityID; 00124 00125 if(Data->VectAz > 180.0f) 00126 Data->VectAz -= 360.0f; 00127 *CDta.f++ = Data->VectAz; 00128 00129 *CDta.f++ = Data->VectEl; 00130 *CDta.f++ = Data->MinRange; 00131 *CDta.f++ = Data->MaxRange; 00132 *CDta.d++ = Data->SrcXLat; 00133 *CDta.d++ = Data->SrcYLon; 00134 *CDta.d++ = Data->SrcZAlt; 00135 *CDta.l++ = Data->Mask; 00136 *CDta.c++ = Data->UpdatePeriod; 00137 *CDta.c++ = 0; 00138 *CDta.s++ = 0; 00139 00140 return(PacketSize); 00141 00142 }
int CigiLosVectReqV3_2::SetAlphaThresh | ( | const Cigi_uint8 | AlphaThreshIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the AlphaThresh with bound checking control
AlphaThreshIn | - The lowest alpha value that will cause a report to be generated when intersected. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 174 of file CigiLosVectReqV3_2.h.
References CIGI_SUCCESS.
00175 { 00176 AlphaThresh = AlphaThreshIn; 00177 return(CIGI_SUCCESS); 00178 }
int CigiLosVectReqV3_2::SetEntityID | ( | const Cigi_uint16 | EntityIDIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the EntityID with bound checking control
EntityIDIn | - The ID of the origin entity. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 195 of file CigiLosVectReqV3_2.h.
References CIGI_SUCCESS.
00196 { 00197 EntityID = EntityIDIn; 00198 return(CIGI_SUCCESS); 00199 }
int CigiLosVectReqV3_2::SetMask | ( | const Cigi_uint32 | MaskIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the Mask with bound checking control
MaskIn | - | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 327 of file CigiLosVectReqV3_2.h.
References CIGI_SUCCESS.
00328 { 00329 Mask = MaskIn; 00330 return(CIGI_SUCCESS); 00331 }
int CigiLosVectReqV3_2::SetMinRange | ( | const float | MinRangeIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the MinRange with bound checking control
MinRangeIn | - The minimum range from the starting or source point that will result in a report when intersected. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 240 of file CigiLosVectReqV3_2.h.
References CIGI_SUCCESS.
00241 { 00242 MinRange = MinRangeIn; 00243 return(CIGI_SUCCESS); 00244 }
int CigiLosVectReqV3_2::SetReqType | ( | const ReqTypeGrp | ReqTypeIn, | |
bool | bndchk = true | |||
) |
Sets the ReqType with bound checking control
ReqTypeIn | - Specifies which type of response is desired. Basic=0 Extended=1 | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 215 of file CigiLosVectReqV3_2.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseLosVectReq::ReqType.
00216 { 00217 00218 #ifndef CIGI_NO_BND_CHK 00219 if(bndchk && ((ReqTypeIn < 0)||(ReqTypeIn > 1))) 00220 { 00221 #ifndef CIGI_NO_EXCEPT 00222 throw CigiValueOutOfRangeException("ReqType",(ReqTypeGrp)ReqTypeIn,0,1); 00223 #endif 00224 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00225 } 00226 #endif 00227 00228 ReqType = ReqTypeIn; 00229 return(CIGI_SUCCESS); 00230 00231 }
int CigiLosVectReqV3_2::SetResponseCoordSys | ( | const CoordSysGrp | ResponseCoordSysIn, | |
bool | bndchk = true | |||
) |
Sets the ResponseCoordSys with bound checking control
ResponseCoordSysIn | - Specifies which coordinate system is desired to define the intersection point. Geodetic=0 Entity=1 | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 259 of file CigiLosVectReqV3_2.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseLosVectReq::ResponseCoordSys.
00260 { 00261 00262 #ifndef CIGI_NO_BND_CHK 00263 if(bndchk && ((ResponseCoordSysIn < 0)||(ResponseCoordSysIn > 1))) 00264 { 00265 #ifndef CIGI_NO_EXCEPT 00266 throw CigiValueOutOfRangeException("ResponseCoordSys",(CoordSysGrp)ResponseCoordSysIn,0,1); 00267 #endif 00268 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00269 } 00270 #endif 00271 00272 ResponseCoordSys = ResponseCoordSysIn; 00273 return(CIGI_SUCCESS); 00274 00275 }
int CigiLosVectReqV3_2::SetSrcCoordSys | ( | const CoordSysGrp | SrcCoordSysIn, | |
bool | bndchk = true | |||
) |
Sets the SrcCoordSys with bound checking control
SrcCoordSysIn | - Specifies which coordinate system is used to define the source or starting point. Geodetic=0 Entity=1 | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 237 of file CigiLosVectReqV3_2.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseLosVectReq::SrcCoordSys.
00238 { 00239 00240 #ifndef CIGI_NO_BND_CHK 00241 if(bndchk && ((SrcCoordSysIn < 0)||(SrcCoordSysIn > 1))) 00242 { 00243 #ifndef CIGI_NO_EXCEPT 00244 throw CigiValueOutOfRangeException("SrcCoordSys",(CoordSysGrp)SrcCoordSysIn,0,1); 00245 #endif 00246 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00247 } 00248 #endif 00249 00250 SrcCoordSys = SrcCoordSysIn; 00251 return(CIGI_SUCCESS); 00252 00253 }
int CigiLosVectReqV3_2::SetSrcXoff | ( | const double | SrcXoffIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the SrcXoff with bound checking control
SrcXoffIn | - The offset of the starting or source point along the X axis from the origin of the origin entity. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 262 of file CigiLosVectReqV3_2.h.
References CIGI_SUCCESS.
00263 { 00264 SrcXLat = SrcXoffIn; 00265 return(CIGI_SUCCESS); 00266 }
int CigiLosVectReqV3_2::SetSrcYoff | ( | const double | SrcYoffIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the SrcYoff with bound checking control
SrcYoffIn | - The offset of the starting or source point along the Y axis from the origin of the origin entity. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 284 of file CigiLosVectReqV3_2.h.
References CIGI_SUCCESS.
00285 { 00286 SrcYLon = SrcYoffIn; 00287 return(CIGI_SUCCESS); 00288 }
int CigiLosVectReqV3_2::SetSrcZoff | ( | const double | SrcZoffIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the SrcZoff with bound checking control
SrcZoffIn | - The offset of the starting or source point along the Z axis from the origin of the origin entity. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 306 of file CigiLosVectReqV3_2.h.
References CIGI_SUCCESS.
00307 { 00308 SrcZAlt = SrcZoffIn; 00309 return(CIGI_SUCCESS); 00310 }
int CigiLosVectReqV3_2::SetUpdatePeriod | ( | const Cigi_uint8 | UpdatePeriodIn, | |
bool | bndchk = true | |||
) | [inline] |
Sets the UpdatePeriod with bound checking control
UpdatePeriodIn | - The number of frames between each LOS response from the IG. If zero - the IG should only respond with one hat/hot response. | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 350 of file CigiLosVectReqV3_2.h.
References CIGI_SUCCESS.
00351 { 00352 UpdatePeriod = UpdatePeriodIn; 00353 return(CIGI_SUCCESS); 00354 }
int CigiLosVectReqV3_2::SetVectAz | ( | const float | VectAzIn, | |
bool | bndchk = true | |||
) |
Sets the VectAz with bound checking control
VectAzIn | - The azimuth of the LOS vector | |
bndchk | - Enables (true) or disables (false) bounds checking. |
Definition at line 281 of file CigiLosVectReqV3_2.cpp.
References CIGI_ERROR_VALUE_OUT_OF_RANGE, CIGI_SUCCESS, and CigiBaseLosVectReq::VectAz.
00282 { 00283 00284 #ifndef CIGI_NO_BND_CHK 00285 if(bndchk && ((VectAzIn < -180.0f)||(VectAzIn > 180.0f))) 00286 { 00287 #ifndef CIGI_NO_EXCEPT 00288 throw CigiValueOutOfRangeException("VectAz",(float)VectAzIn,-180.0,180.0); 00289 #endif 00290 return(CIGI_ERROR_VALUE_OUT_OF_RANGE); 00291 } 00292 #endif 00293 00294 VectAz = VectAzIn; 00295 return(CIGI_SUCCESS); 00296 00297 }
int CigiLosVectReqV3_2::Unpack | ( | Cigi_uint8 * | Buff, | |
bool | Swap, | |||
void * | Spec | |||
) | [virtual] |
The virtual Unpack function for CIGI 3
Buff | - A pointer to the current pack point. | |
Swap | - N/A for V1 & V2 | |
Spec | - A pointer to special data - This is not used in this class. |
Implements CigiBaseLosVectReq.
Definition at line 147 of file CigiLosVectReqV3_2.cpp.
References CigiBaseLosVectReq::AlphaThresh, PackPointerUnion::c, CigiSwap2(), CigiSwap4(), CigiSwap8(), PackPointerUnion::d, CigiBaseLosVectReq::EntityID, PackPointerUnion::f, CigiBaseLosVectReq::Geodetic, PackPointerUnion::l, CigiBaseLosVectReq::LosID, CigiBaseLosVectReq::Mask, CigiBaseLosVectReq::MaxRange, CigiBaseLosVectReq::MinRange, CigiBasePacket::PacketSize, CigiBaseLosVectReq::ReqType, CigiBaseLosVectReq::ResponseCoordSys, PackPointerUnion::s, CigiBaseLosVectReq::SrcCoordSys, CigiBaseLosVectReq::SrcXLat, CigiBaseLosVectReq::SrcYLon, CigiBaseLosVectReq::SrcZAlt, CigiBaseLosVectReq::UpdatePeriod, CigiBaseLosVectReq::ValidV1or2, CigiBaseLosVectReq::VectAz, and CigiBaseLosVectReq::VectEl.
00148 { 00149 PackPointer CDta; 00150 00151 CDta.c = Buff; 00152 00153 CDta.c += 2; // Step over packet id and size 00154 00155 if(!Swap) 00156 { 00157 LosID = *CDta.s++; 00158 00159 Cigi_uint16 HDta = *CDta.c++; 00160 ReqType = (ReqTypeGrp)(HDta & 0x01); 00161 SrcCoordSys = (CoordSysGrp)((HDta >> 1) & 0x01); 00162 ResponseCoordSys = (CoordSysGrp)((HDta >> 2) & 0x01); 00163 00164 AlphaThresh = *CDta.c++; 00165 EntityID = *CDta.s++; 00166 VectAz = *CDta.f++; 00167 VectEl = *CDta.f++; 00168 MinRange = *CDta.f++; 00169 MaxRange = *CDta.f++; 00170 SrcXLat = *CDta.d++; 00171 SrcYLon = *CDta.d++; 00172 SrcZAlt = *CDta.d++; 00173 Mask = *CDta.l++; 00174 UpdatePeriod = *CDta.c++; 00175 00176 } 00177 else 00178 { 00179 CigiSwap2(&LosID, CDta.s++); 00180 00181 Cigi_uint16 HDta = *CDta.c++; 00182 ReqType = (ReqTypeGrp)(HDta & 0x01); 00183 SrcCoordSys = (CoordSysGrp)((HDta >> 1) & 0x01); 00184 ResponseCoordSys = (CoordSysGrp)((HDta >> 2) & 0x01); 00185 00186 AlphaThresh = *CDta.c++; 00187 CigiSwap2(&EntityID, CDta.s++); 00188 CigiSwap4(&VectAz, CDta.f++); 00189 CigiSwap4(&VectEl, CDta.f++); 00190 CigiSwap4(&MinRange, CDta.f++); 00191 CigiSwap4(&MaxRange, CDta.f++); 00192 CigiSwap8(&SrcXLat, CDta.d++); 00193 CigiSwap8(&SrcYLon, CDta.d++); 00194 CigiSwap8(&SrcZAlt, CDta.d++); 00195 CigiSwap4(&Mask, CDta.l++); 00196 UpdatePeriod = *CDta.c++; 00197 } 00198 00199 ValidV1or2 = (SrcCoordSys == Geodetic); 00200 00201 return(PacketSize); 00202 00203 }