open-dis-cpp
DirectedEnergyFirePdu.h
1 #pragma once
2 
3 #include <dis7/EntityType.h>
4 #include <dis7/ClockTime.h>
5 #include <dis7/Vector3Float.h>
6 #include <dis7/StandardVariableSpecification.h>
7 #include <vector>
8 #include <dis7/WarfareFamilyPdu.h>
9 #include <dis7/utils/DataStream.h>
10 #include <dis7/opendis7_export.h>
11 
12 
13 namespace DIS
14 {
15 // Firing of a directed energy weapon shall be communicated by issuing a Directed Energy Fire PDU Section 7.3.4 COMPLETE
16 
17 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
18 //
19 // @author DMcG, jkg
20 
21 class OPENDIS7_EXPORT DirectedEnergyFirePdu : public WarfareFamilyPdu
22 {
23 protected:
26 
29 
32 
35 
38 
40  float _wavelength;
41 
44 
47 
50 
52  int _flags;
53 
55  char _pulseShape;
56 
58  unsigned char _padding1;
59 
61  unsigned int _padding2;
62 
64  unsigned short _padding3;
65 
67  unsigned short _numberOfDERecords;
68 
70  std::vector<StandardVariableSpecification> _dERecords;
71 
72 
73  public:
75  virtual ~DirectedEnergyFirePdu();
76 
77  virtual void marshal(DataStream& dataStream) const;
78  virtual void unmarshal(DataStream& dataStream);
79 
80  EntityType& getMunitionType();
81  const EntityType& getMunitionType() const;
82  void setMunitionType(const EntityType &pX);
83 
84  ClockTime& getShotStartTime();
85  const ClockTime& getShotStartTime() const;
86  void setShotStartTime(const ClockTime &pX);
87 
88  float getCommulativeShotTime() const;
89  void setCommulativeShotTime(float pX);
90 
91  Vector3Float& getApertureEmitterLocation();
92  const Vector3Float& getApertureEmitterLocation() const;
93  void setApertureEmitterLocation(const Vector3Float &pX);
94 
95  float getApertureDiameter() const;
96  void setApertureDiameter(float pX);
97 
98  float getWavelength() const;
99  void setWavelength(float pX);
100 
101  float getPeakIrradiance() const;
102  void setPeakIrradiance(float pX);
103 
104  float getPulseRepetitionFrequency() const;
105  void setPulseRepetitionFrequency(float pX);
106 
107  int getPulseWidth() const;
108  void setPulseWidth(int pX);
109 
110  int getFlags() const;
111  void setFlags(int pX);
112 
113  char getPulseShape() const;
114  void setPulseShape(char pX);
115 
116  unsigned char getPadding1() const;
117  void setPadding1(unsigned char pX);
118 
119  unsigned int getPadding2() const;
120  void setPadding2(unsigned int pX);
121 
122  unsigned short getPadding3() const;
123  void setPadding3(unsigned short pX);
124 
125  unsigned short getNumberOfDERecords() const;
126 
127  std::vector<StandardVariableSpecification>& getDERecords();
128  const std::vector<StandardVariableSpecification>& getDERecords() const;
129  void setDERecords(const std::vector<StandardVariableSpecification>& pX);
130 
131 
132 virtual int getMarshalledSize() const;
133 
134  bool operator ==(const DirectedEnergyFirePdu& rhs) const;
135 };
136 }
137 
138 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
139 // Redistribution and use in source and binary forms, with or without
140 // modification, are permitted provided that the following conditions
141 // are met:
142 //
143 // * Redistributions of source code must retain the above copyright
144 // notice, this list of conditions and the following disclaimer.
145 // * Redistributions in binary form must reproduce the above copyright
146 // notice, this list of conditions and the following disclaimer
147 // in the documentation and/or other materials provided with the
148 // distribution.
149 // * Neither the names of the Naval Postgraduate School (NPS)
150 // Modeling Virtual Environments and Simulation (MOVES) Institute
151 // (http://www.nps.edu and http://www.MovesInstitute.org)
152 // nor the names of its contributors may be used to endorse or
153 // promote products derived from this software without specific
154 // prior written permission.
155 //
156 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
157 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
158 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
159 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
160 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
161 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
162 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
163 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
164 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
165 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
166 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
167 // POSSIBILITY OF SUCH DAMAGE.
Definition: ClockTime.h:15
unsigned int _padding2
padding, Section 7.3.4
Definition: DirectedEnergyFirePdu.h:61
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
float _commulativeShotTime
Field shall indicate the current cumulative duration of the shot, Section 7.3.4.
Definition: DirectedEnergyFirePdu.h:31
a class to support managing a network buffer.
Definition: DataStream.h:28
float _apertureDiameter
Field shall identify the beam diameter at the aperture/emitter, Section 7.3.4.
Definition: DirectedEnergyFirePdu.h:37
std::vector< StandardVariableSpecification > _dERecords
Fields shall contain one or more DE records, records shall conform to the variable record format (Sec...
Definition: DirectedEnergyFirePdu.h:70
int _flags
16bit Boolean field shall contain various flags to indicate status information needed to process a DE...
Definition: DirectedEnergyFirePdu.h:52
EntityType _munitionType
Field shall identify the munition type enumeration for the DE weapon beam, Section 7...
Definition: DirectedEnergyFirePdu.h:25
unsigned short _numberOfDERecords
Field shall specify the number of DE records, Section 7.3.4.
Definition: DirectedEnergyFirePdu.h:67
unsigned char _padding1
padding, Section 7.3.4
Definition: DirectedEnergyFirePdu.h:58
Definition: DirectedEnergyFirePdu.h:21
Definition: WarfareFamilyPdu.h:18
Definition: Vector3Float.h:15
unsigned short _padding3
padding, Section 7.3.4
Definition: DirectedEnergyFirePdu.h:64
float _peakIrradiance
Field shall identify the current peak irradiance of emissions in units of Watts per square meter...
Definition: DirectedEnergyFirePdu.h:43
Definition: EntityType.h:15
char _pulseShape
Field shall identify the pulse shape and shall be represented as an 8-bit enumeration, Section 7.3.4.
Definition: DirectedEnergyFirePdu.h:55
float _pulseRepetitionFrequency
field shall identify the current pulse repetition frequency in units of cycles per second (Hertz)...
Definition: DirectedEnergyFirePdu.h:46
Vector3Float _ApertureEmitterLocation
Field shall identify the location of the DE weapon aperture/emitter, Section 7.3.4.
Definition: DirectedEnergyFirePdu.h:34
float _wavelength
Field shall identify the emissions wavelength in units of meters, Section 7.3.4.
Definition: DirectedEnergyFirePdu.h:40
int _pulseWidth
field shall identify the pulse width emissions in units of seconds, Section 7.3.4 ...
Definition: DirectedEnergyFirePdu.h:49
ClockTime _shotStartTime
Field shall indicate the simulation time at start of the shot, Section 7.3.4.
Definition: DirectedEnergyFirePdu.h:28