This class is used for easy access to the emitter systems in a DISPDU_emissions_type object.
class dis_em_systems_type : public dbl_llist {
public:
int id;
This field contains the id of the system.
DIS_emissions_beams_type *es_radar;
This field contains a pointer to a radar system.
virtual ~dis_em_systems_type();
};
This class is a DIS implementation of a platform_data object.
class dis_data : public platform_data {
protected:
This field contains a pointer to the DISPDU_entity_state_type object for this class.
This field contains a pointer to the DISPDU_emissions_type object for this class.
dbl_llist_manager sensorman;
This field contains a list of sensors for this object.
unsigned int flags;
This field is a bitfield representing the current state of this object, and may be set as a combination of the following:
double next_update_time;
Time of the next update in seconds.
double update_time;
Duration between updates in seconds.
buffer_type send_buffer;
Bytestream of a PDU to be sent out.
public:
void label(dbl_llist_manager *label_manager);
A replacement for the virtual function defined in "platform_data".
void update(double *machine_time);
A replacement for the virtual function defined in "platform_data".
int perform(iface *isim, int task, void *data);
A replacement for the virtual function defined in "platform_data".
void render(iface *isim);
A replacement for the virtual function defined in "platform_data".
int init(iface *isim, correlate *basis, symbol_correlation_type *str);
A replacement for the virtual function defined in "platform_data".
dis_data(basic_platform *x);
virtual ~dis_data();
};
This class is a DIS implementation of the basic_platform object.
class dis_platform : public basic_platform {
protected:
void update_data(double *machine_time);
A replacement for the virtual function defined in "basic_platform".
public:
DIS_id_type dis_id;
The DIS triple for this object.
virtual ~dis_platform();
int init(dis_iface *isim, DISPDU_entity_state_type *es, symbol_correlation_type *str);
This function initializes the object. "isim" is a pointer to the simulation manager, "es" is a pointer to the initial entity state received for this object, and "str" contains associated data to this object.
void update(dis_iface *isim, DISPDU_entity_state_type *es, double *machine_time);
This function updates the object. "isim" is a pointer to the simulation manager, "es" is a pointer to the updated entity state received for this object.
};
This class is a user controlled implementation of the dis_platform object.
class dis_mcp_platform : public dis_platform {
protected:
This contains the information needed to build an outgoing Entity State PDU.
buffer_type send_buffer;
This contains the outgoing bitstream for an Entity State PDU.
double update_time;
This contains the duration between updates in seconds.
double next_update_time;
This contains the time of the next update in seconds.
public:
void update_platform(plat_stat_type *pc);
A replacement for the virtual function defined in "basic_platform".
dis_mcp_platform();
virtual ~dis_mcp_platform();
int init(dis_iface *isim, symbol_correlation_type *str);
This function updates the object. "isim" is a pointer to the simulation manager, and "str" contains associated data to this object.
};
This class is a DIS implementation of the iface object.
class dis_iface : public iface {
asockudp clientudp;
protected:
This is the socket handler for the PDU's.
int exercise_id;
This is the exercise ID for this interface.
int site_id;
This is the site ID for this interface.
int app_id;
This is the application ID for this interface.
lla_type center;
This is the latitude/longitude for this exercise.
dis_mcp_platform control_platform;
This is the user controlled entity.
int cockpit_code;
This code maps the user controlled object to an entry in the setup .ini file.
dis_platform *AddPlatform(DISPDU_entity_state_type *es, double *machine_time);
This method adds a new entity to the simulation manager.
public:
void init();
A replacement for the virtual function defined in "iface".
void cleanup();
A replacement for the virtual function defined in "iface".
void parse_input(int argc, char **argv);
A replacement for the virtual function defined in "iface".
void update(double *machine_time);
A replacement for the virtual function defined in "iface".
void mcp(plat_stat_type *pc);
A replacement for the virtual function defined in "iface".
int id_counter;
An id counter for new entities.
dis_iface();
virtual ~dis_iface();
};
This class is a DIS implementation of the post_office_type object.
class dispost_office_type : public post_office_type {
protected:
buffer_type tbuffer;
Internal buffer for processing PDUs.
void update_mailboxes();
Process PDU's off the net.
public:
int send_message(buffer_type *buffer);
Broadcast a PDU.
int dis_event_counter;
Counter for generating event ids.
dispost_office_type();
virtual ~dispost_office_type();
};
This class represents the header for all DIS PDUs.
class DIS_header_type {
public:
char version;
DIS version.
char exercise_id;
DIS exercise id.
char type;
PDU type.
char family;
PDU family.
unsigned int time;
Timestamp of PDU.
unsigned short size;
Byte size of pdu.
unsigned short padd;
DIS_header_type();
virtual ~DIS_header_type();
void build(sfile *sbuffer);
Insert header data in a PDU bytestream.
void extract(sfile *sbuffer);
Extract header data from a PDU bytestream.
};
This class represents the Kind field for all DIS PDUs.
class DIS_entity_type_type {
public:
char kind;
Entity kind.
char domain;
Entity domain.
unsigned short country;
Entity country.
char category;
Entity category.
char subcategory;
Entity subcategory.
char specific;
Entity specific.
char extra;
Entity extra.
virtual ~DIS_entity_type_type();
void build(sfile *sbuffer);
Insert kind data in a PDU bytestream.
void extract(sfile *sbuffer);
Extract kind data from a PDU bytestream.
};
This class represents the burst descriptor of a Fire/Detonate PDU.
class DIS_burst_descriptor_type {
public:
DIS_entity_type_type burst_id;
DIS id for the warhead.
unsigned short burst_warhead;
Warhead code.
unsigned short burst_fuze;
Fuze code.
unsigned short burst_quantity;
# of warheads.
unsigned short burst_rate;
Rate of fire.
virtual ~DIS_burst_descriptor_type();
void build(sfile *sbuffer);
Insert burst descriptor data in a PDU bytestream.
void extract(sfile *sbuffer);
Extract burst descriptor data from a PDU bytestream.
};
This class represents the Entity State PDU.
class DISPDU_entity_state_type {
public:
DIS_header_type header;
Header data for the Entity State Pdu.
unsigned short site_id;
Site ID for the entity.
unsigned short application_id;
Application ID for the entity.
unsigned short entity_id;
Id for the entity.
char force_id;
Force ID for the entity.
char articulation_parameter_count;
# of articulated parts.
DIS_entity_type_type entity_type;
Kind description of the entity.
DIS_entity_type_type alt_entity_type;
Alternate kind description of the entity.
vector3f velocity;
Velocity of entity (meters per sec).
vector3d location;
Location of entity in DIS world coordinates (meters).
vector3f ypr;
Orientation of entity (radians) in DIS world coordinates.
unsigned int appearance_flag;
DIS appearance bits for the entity.
char dr_algorithm;
Enumeration for the dead recogning algorithm used.
char dr_other[15];
Entries for user specified parameters to dead recogning.
vector3f dr_accel;
Acceleration of entity (meters per second per second).
vector3f dr_ypr_velocity;
orientation velocity of entity (radians per sec).
char character_set;
See DIS spec.
unsigned char marking[11];
See DIS spec.
unsigned int capability_flag;
See DIS spec.
DISPDU_entity_state_type();
void setup(int id, int fid, DIS_entity_type_type *type, int dr_algo);
Initialize the entity state with the entity "id", the force id ("fid"), its kind descriptor ("type") and its dead recogning enumeration ("dr_algo").
void build(buffer_type *buffer);
Insert entity state data in a PDU bytestream.
void extract(buffer_type *buffer);
Extract entity state data from a PDU bytestream.
};
This class represents the Fire PDU.
class DISPDU_fire_type {
public:
DIS_header_type header;
Header data for the Fire Pdu.
unsigned short fire_site_id;
Attacker Site ID.
unsigned short fire_application_id;
Attacker Application ID.
unsigned short fire_entity_id;
Attacker Entity ID.
unsigned short target_site_id;
Target Site ID.
unsigned short target_application_id;
Target Application ID.
unsigned short target_entity_id;
Target Entity ID.
unsigned short ammo_site_id;
Munition Site ID.
unsigned short ammo_application_id;
Munition Application ID.
unsigned short ammo_entity_id;
Munition Entity ID.
unsigned short event_site_id;
Fire Event Site ID.
unsigned short event_application_id;
Fire Event Application ID.
unsigned short event_entity_id;
Fire Event Entity ID.
unsigned int fire_mission_index;
Fire mission index.
vector3d location;
Location of munition in DIS world coordinate system (meters).
DIS_burst_descriptor_type burst_data;
Warhead burst descriptor.
vector3f velocity;
Velocity of munition (meters per sec).
float range;
Range of munition (meters).
DISPDU_fire_type();
virtual ~DISPDU_fire_type();
void setup(int fire_id, DIS_id_type *target, int ammo_id,
int event_id, DIS_burst_descriptor_type *burst,
double *pos, double *vel, double *range,
unsigned int timer);
Setup the PDU w/ the entity id of the attacker ("fire_id"), the DIS id of the target ("target"), the entity id of the munition ("ammo_id"), the event id ("event_id"), the burst descriptor ("burst"), the initial position of the munition ("pos"), the velocity of the munition ("vel"), the "range" of the munition, and the DIS timestamp ("timer").
void build(buffer_type *buffer);
Insert fire data in a PDU bytestream.
void extract(buffer_type *buffer);
Extract fire data from a PDU bytestream.
};
This class represents the Detonate PDU.
class DISPDU_detonate_type {
public:
DIS_header_type header;
Header data for the Detonate Pdu.
unsigned short fire_site_id;
Attacker Site ID.
unsigned short fire_application_id;
Attacker Application ID.
unsigned short fire_entity_id;
Attacker Entity ID.
unsigned short target_site_id;
Target Site ID.
unsigned short target_application_id;
Target Application ID.
unsigned short target_entity_id;
Target Entity ID.
unsigned short ammo_site_id;
Munition Site ID.
unsigned short ammo_application_id;
Munition Application ID.
unsigned short ammo_entity_id;
Munition Entity ID.
unsigned short event_site_id;
Detonation Event Site ID.
unsigned short event_application_id;
Detonation Event Application ID.
unsigned short event_entity_id;
Detonation Event Entity ID.
vector3f velocity;
Velocity of munition (meters per sec).
vector3d location;
Location of detonation in DIS world coordinates (meters).
DIS_burst_descriptor_type burst_data;
Warhead burst description.
vector3f location_target_coords;
Location of detonation in target local body coordinates (meters).
unsigned char detonation_result;
Detonation result enumeration.
unsigned char articulation_count;
Number of Articulated parts.
unsigned char padd[2];
DISPDU_detonate_type();
virtual ~DISPDU_detonate_type();
void setup(DISPDU_fire_type *fire,
int fire_id, DIS_id_type *target, int ammo_id, int event_id,
DIS_burst_descriptor_type *burst,
double *pos, double *vel, double *target_local_pos, int det_result,
unsigned int timer);
Sets up the PDU w/ the initial Fire PDU ("fire"), the attacker entity id ("fire_id"), the target DIS id ("target"), the munition entity id ("ammo_id"), the event entity id ("event_id"), the burst descriptor ("burst"), the location of the detonation in world space ("pos"), the velocity of the munition ("vel"), the location of the detonation in the target's local space ("target_local_pos"), the detonation enumerated result ("det_result"), and the DIS timestamp ("timer").
void build(buffer_type *buffer);
Insert detonation data in a PDU bytestream.
void extract(buffer_type *buffer);
Extract detonation data from a PDU bytestream.
};
This class represents the Action Request PDU.
class DISPDU_action_request_type {
public:
DIS_header_type header;
Header data for the Action Request Pdu.
unsigned short source_site_id;
From Site ID.
unsigned short source_application_id;
From Application ID.
unsigned short source_entity_id;
From Entity ID.
unsigned short target_site_id;
To Site ID.
unsigned short target_application_id;
To Application ID.
unsigned short target_entity_id;
To Entity ID.
unsigned int request_id;
Counter used to identify specific requests.
unsigned int action_id;
Enumerated value for the request.
unsigned int fixed_record_count;
Count of appended fixed records.
unsigned int variable_record_count;
Count of appended variable records.
DISPDU_action_request_type();
virtual ~DISPDU_action_request_type();
void setup(DIS_id_type *source,
DIS_id_type *target,
int request_id, int action_id, unsigned int timer);
Sets up the PDU w/ the DIS id of the "source", the DIS id of the "target", the id of the request ("request id"), the type of request ("action_id"), and the DIS timestamp ("timer").
void build(buffer_type *buffer);
Insert action request data in a PDU bytestream.
void extract(buffer_type *buffer);
Extract action request data from a PDU bytestream.
};
This class represents the Action Response PDU.
class DISPDU_action_response_type {
public:
DIS_header_type header;
Header data for the Action Response Pdu.
unsigned short source_site_id;
From Site ID.
unsigned short source_application_id;
From Application ID.
unsigned short source_entity_id;
From Entity ID.
unsigned short target_site_id;
To Site ID.
unsigned short target_application_id;
To Application ID.
unsigned short target_entity_id;
To Entity ID.
unsigned int request_id;
Counter used to identify the associated Action Request.
unsigned int request_status;
Enumerated value for the response.
unsigned int fixed_record_count;
Count of appended fixed records.
unsigned int variable_record_count;
Count of appended variable records.
DISPDU_action_response_type();
virtual ~DISPDU_action_response_type();
void setup(DIS_id_type *source,
DIS_id_type *target,
int request_id, int request_status, unsigned int timer);
Sets up the PDU w/ the DIS id of the "source", the DIS id of the "target", the id of the response ("request id"), the type of response ("request_status"), and the DIS timestamp ("timer").
void build(buffer_type *buffer);
Insert action response data in a PDU bytestream.
void extract(buffer_type *buffer);
Extract action response data from a PDU bytestream.
};
This class represents the Track/Jam section of the Emissions PDU.
class DIS_emissions_trackjam_type : public dbl_llist {
public:
unsigned short site_id;
Tracked/jammed target site id.
unsigned short application_id;
Tracked/jammed target application id.
unsigned short entity_id;
Tracked/jammed target entity id.
unsigned char emitter_id;
Emitter id to be jammed.
unsigned char beam_id;
Beam id to be jammed.
virtual ~DIS_emissions_trackjam_type();
int build(int *count, int *systemsize, int *beamsize, sfile *sbuffer);
Build the track/jam record, and increments the byte "count" for the main emissions PDU, the 32 bit word count for the system ("systemsize"), and the 32 bit word count for the beam ("beamsize").
void extract(sfile *sbuffer);
Extract track/jam data from a PDU bytestream.
};
This class represents the beam section of the Emissions PDU.
class DIS_emissions_beams_type : public dbl_llist {
unsigned char beam_id;
public:
unsigned char padd;
Beam id.
unsigned short beam_parameter_index;
Used to identify the beam type in a database.
float frequency;
Main beam frequency (hz).
float freq_range;
Frequency range (hz).
float power;
Current power level (db).
float prf;
Pulse repetition frequency (hz).
float pulse_width;
Pulse width (meters).
float beam_azimuth;
Main beam azimuth (radians).
float beam_az_sweep;
Azimuth range (radians).
float beam_elevation;
Main beam elevation (radians).
float beam_ele_sweep;
Elevation range (radians).
float beam_sweep_sync;
A percentage used to sync the receiver to the scan pattern.
unsigned char beam_function;
As per section 8 of the enumerations document.
unsigned char high_density;
As per section 8 of the enumerations document.
unsigned char padd2[2];
unsigned int jamming_mode;
Signifies jamming techniques.
dbl_llist_manager trackjamman;
List of DIS_emissions_trackjam_type.
virtual ~DIS_emissions_beams_type();
int build(int *count, int *systemsize, sfile *sbuffer);
Build the beam record, and increments the byte "count" for the main emissions PDU and the 32 bit word count for the system ("systemsize").
void extract(sfile *sbuffer);
Extract beam data from a PDU bytestream.
};
This class represents the systems section of the Emissions PDU.
class DIS_emissions_systems_type : public dbl_llist {
public:
unsigned short emitter_name;
As per section 8 of the enumerations document.
unsigned char emitter_function;
As per section 8 of the enumerations document.
unsigned char emitter_id;
A numeric id assigned to the system.
vector3f location;
Location of the system (meters) with respect to the entity' local coordinate system.
dbl_llist_manager beamman;
A list of DIS_emissions_beams_type.
DIS_emissions_systems_type();
virtual ~DIS_emissions_systems_type();
int build(int *count, sfile *sbuffer);
Build the system record, and increments the byte "count" for the main emissions PDU.
void extract(sfile *sbuffer);
Extract system data from a PDU bytestream.
};
This class represents the main section of the Emissions PDU.
class DISPDU_emissions_type {
public:
DIS_header_type header;
Header data for the Action Response Pdu.
unsigned short emitting_site_id;
Emitter Site ID.
unsigned short emitting_application_id;
Emitter Application ID.
unsigned short emitting_entity_id;
Emitter Entity ID.
unsigned short event_site_id;
Event Site ID.
unsigned short event_application_id;
Event Application ID.
unsigned short event_entity_id;
Event Entity ID.
unsigned char state_update_indicator;
Update/State change flag.
unsigned char padd[3];
dbl_llist_manager systemman;
A list of DIS_emissions_systems_type.
DISPDU_emissions_type();
virtual ~DISPDU_emissions_type();
void build(buffer_type *buffer);
Build the emissions PDU bytestream.
void extract(buffer_type *buffer);
Extract emissions data from a PDU bytestream.
void setup(int id);
Extract emissions data from a PDU bytestream.
};
This structure represents a DIS ID triple.
typedef struct {
int entity;
Entity ID
int site;
Site ID
int application;
Application ID
} DIS_id_type;
This structure represents a latitude/longitude/altitude point.
typedef struct {
double latitude;
Latitude (radians).
double longitude;
Longitude (radians).
double altitude;
Altitude (meters).
} lla_type;
This variable is an instantiation of the PDU mailbox object.
This variable contains the command line arguement identifier for the DIS application id.
This variable contains the command line arguement identifier for the DIS site id.
This variable contains the command line arguement identifier for the DIS exercise id.
This variable contains the command line arguement identifier for the user controlled DIS site id.
This variable contains the command line arguement identifier for the user controlled DIS application id.
This variable contains the command line arguement identifier for the user controlled DIS entity id.
Sets the DIS exercise, site, and application ID's for the library
Retrieves the DIS exercise, site, and application ID's from the library
Initializes the flat earth coordinate conversion routines for the JIMM/SWEG coordinate system. "Center" is the center of scenario.
Initializes the flat earth coordinate conversion routines for the VISPixcon coordinate system. "Center" is the center of scenario.
Converts a point ("type" == DIS_POSITION) or a vector ("type" == DIS_POSITION) from the DIS world coordinate system to flat earth. "dis" is the DIS world coordinate, and "local" is the converted result.
Converts a point ("type" == DIS_POSITION) or a vector ("type" == DIS_POSITION) from a flat earth system to DIS world coordinate system. "dis" is the DIS world coordinate, and "local" is the converted result.
Converts a (yaw, pitch, roll) triple from a flat earth system ("localypr") to DIS world coordinate system ("disypr").
Converts a (yaw, pitch, roll) triple from the DIS world coordinate system ("disypr") to a flat earth system ("localypr").
Converts and returns "seconds" from time from start of the scenario to a DIS timestamp.