VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
underwaterAcousticPdu.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2013 MAK Technologies, Inc
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #if DtDIS
13 
14 #include <vlutil/vlMachineTypes.h>
15 
16 #include <vl/packets/undwaAcP.h>
19 #include <vl/exerciseConn.h>
22 #include <vl/hostStructs.h>
23 #include <vl/stateMsgDIS.h>
24 
25 #include <matrix/vlMath.h>
26 
27 #define DtINCONSISTENT_UA_PDU_LENGTH 1
28 #define DtINCONSISTENT_UA_SYS_LENGTHS 2
29 #define DtINCONSISTENT_UA_SYS_BEAM_LENGTHS 3
30 
32 
34 typedef void (*DtUnderwaterAcousticPduCb)( DtUnderwaterAcousticPdu* pdu, void* usr );
35 
40 {
41 public:
42 
46  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0 );
48 
50  virtual ~DtUnderwaterAcousticPdu();
51 
54 
56  virtual void setEmittingEntityID( const DtEntityIdentifier& entity );
57  virtual const DtEntityIdentifier& emittingEntityID() const;
58 
60  virtual void setEventID( const DtEventID& event );
61  virtual const DtEventID& eventID() const;
62 
64  virtual void setStateChangeUpdate( DtUnderwaterAcousticUpdate upd );
65  virtual DtUnderwaterAcousticUpdate stateChangeUpdate() const;
66 
68  virtual void setPassiveParameterIndex(
71  passiveParameterIndex() const;
72 
74  virtual void setPropulsionPlantConfig(
77  propulsionPlantConfig() const;
78 
81  virtual bool setNumShafts( DtU8 num );
82  virtual DtU8 numShafts() const;
83 
86  virtual bool setNumAdditionalPassiveAct( DtU8 num );
87  virtual DtU8 numAdditionalPassiveAct() const;
88 
91  virtual bool setNumEmitterSystems( DtU8 num );
92  virtual DtU8 numEmitterSystems() const;
93 
97  virtual bool setNumBeams( int emitterSystemIndex, DtU8 num );
98  virtual DtU8 numBeams( int emitterSystemIndex ) const;
99 
102  virtual bool setShaftSpeed( int index,
103  const DtUnderwaterAcousticShaftSpeed& record );
104  virtual bool getShaftSpeed( int index,
105  DtUnderwaterAcousticShaftSpeed& record ) const;
106 
109  virtual bool setAddtnlPassiveAct( int index,
110  const DtUnderwaterAcousticAddtnlPassiveAct& record );
111  virtual bool getAddtnlPassiveAct( int index,
112  DtUnderwaterAcousticAddtnlPassiveAct& record ) const;
113 
117  virtual bool setEmitterSystem( int index,
118  const DtUnderwaterAcousticEmitterSystem& record );
119  virtual bool getEmitterSystem( int index,
120  DtUnderwaterAcousticEmitterSystem& record ) const;
121 
125  virtual bool setBeam( int emitterSystemIndex, int beamIndex,
126  const DtUnderwaterAcousticBeam& record );
127  virtual bool getBeam( int emitterSystemIndex, int beamIndex,
128  DtUnderwaterAcousticBeam& record ) const;
129 
131  virtual void printData() const;
132  virtual void printDataToStream( std::ostream& stream ) const;
133 
134 public:
135 
138  static DtPdu* create( const DtNetPacket* initial,
139  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0 );
140 
143  static void addCallback( DtExerciseConn* conn,
144  DtUnderwaterAcousticPduCb cb, void* usr );
145  static void removeCallback( DtExerciseConn* conn,
146  DtUnderwaterAcousticPduCb cb, void* usr );
147 
148 protected:
149 
152  DtUnderwaterAcousticPdu* self() const;
153 
156 
158  virtual DtNetUnderwaterAcousticPdu* netPduStruct() const;
159 
161  virtual char* var() const;
162 
164  virtual int shaftSpeedRecordOffset( int recordIndex ) const;
165 
167  virtual int passiveActRecordOffset( int recordIndex ) const;
168 
170  virtual int emitterSystemRecordOffset( int recordIndex ) const;
171 
174  virtual int beamDataRecordOffset( int emitterSystemIndex, int beamIndex ) const;
175 
176  int computeStatus() const;
177 
178 protected:
179 
180  static const int theNetUaPduSize;
181  static const int theNetShaftSize;
182  static const int theNetApaSize;
183  static const int theNetSystemSize;
184  static const int theNetBeamSize;
185 
186 protected:
187 
191 
192 };
193 
194 #endif // DtDIS
DtUnderwaterAcousticUpdate
Underwater acoustic PDU enums.
Definition: disEnums.h:2405
DtUnderwaterAcousticEmitterSystem is a class which contains information describing the acoustic emitt...
Definition: underwaterAcousticEmitterSystem.h:22
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnDIS.h:62
Contains the DIS DtUnderwaterAcousticShaftSpeed class declaration.
Definition: disEnums.h:272
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
Instances of DtUnderwaterAcousticPdu are used to send information about simulated underwater acoustic...
Definition: underwaterAcousticPdu.h:39
static const int theNetSystemSize
Definition: underwaterAcousticPdu.h:183
Definition: pduHeader.h:14
DtEventID myEventID
Definition: underwaterAcousticPdu.h:190
DtUnderwaterAcousticPassiveParmIndex
Definition: disEnums.h:2449
static const int theNetUaPduSize
Definition: underwaterAcousticPdu.h:180
class DtPduFactory:
Definition: pduFactory.h:38
DtEntityIdentifier myEntityID
Temporary objects for reference returns.
Definition: underwaterAcousticPdu.h:189
DtUnderwaterAcousticPropulsionPlantConfig
Definition: disEnums.h:2454
virtual void printDataToStream(std::ostream &stream) const
This file defines math constants and methods which may be useful in simulations.
void(* DtUnderwaterAcousticPduCb)(DtUnderwaterAcousticPdu *pdu, void *usr)
DtUnderwaterAcousticPdu callback function signature.
Definition: underwaterAcousticPdu.h:34
DtStateMsg & operator=(const DtStateMsg &orig)
assignment operator
DtPdu is the base class for all PDU&#39;s in VR-Link.
Definition: pdu.h:69
unsigned char DtU8
An eight bit unsigned integer value.
Definition: vlMachineTypes.h:137
Represents Events in DIS.
Definition: eventId.h:154
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
This file provides protocol to independence DtExerciseConn.
Contains the DtUnderwaterAcousticAddtnlPassiveAct class declaration.
DtUnderwaterAcousticShaftSpeed is a class which contains the shaft speed information for the underwat...
Definition: underwaterAcousticShaftSpeed.h:20
static const int theNetBeamSize
Definition: underwaterAcousticPdu.h:184
virtual void printData() const
Print the PDU&#39;s data (not including header).
static const int theNetShaftSize
Definition: underwaterAcousticPdu.h:181
This file is deprecated - Please see simulationAddress.h, entityIdentifier.h, entityType.h, burstDescriptor.h, and NetStructs.h.
DtUnderwaterAcousticBeam is a class which contains the beam fundamental data parameters for the under...
Definition: underwaterAcousticBeam.h:21
struct DtBufferPlaceHolder * DtBufferPtr
Definition: vlBaseMsg.h:17
#define DtUSE_INTERNAL_BUFFER
Definition: vlBaseMsg.h:22
virtual DtPduKind internalGetPduKind() const
Returns the internal PDU kind.
Definition: underwaterAcousticPdu.h:155
DtUnderwaterAcousticAddtnlPassiveAct is a class which contains the additional passive activity inform...
Definition: underwaterAcousticAddtnlPassiveAct.h:21
DtPduKind
([UID 4]) - PDU Type
Definition: disEnums.h:238
Definition: undwaAcP.h:66
Instances of DtStateMsg are used to represent state data communicated via the network in a DIS (as op...
Definition: stateMsgDIS.h:21
This file contains typedefs for machine dependant types.
static const int theNetApaSize
Definition: underwaterAcousticPdu.h:182

Document ID: Generated on Wed Mar 27 02:04:30 EDT 2024 from SVN revision 264570
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)