DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyExerciseInterface Class Reference

#include <diguyExerciseInterface.h>

Public Member Functions

Exercise Control Functions
void send_pdu_xc_set_tin_tod (unsigned short site, unsigned short host, float ttod)
 This function sends an xc_set_tin_tod PDU. More...
 
void send_pdu_xc_load_scenario (unsigned short site, unsigned short host, const char *filename, const char *refname)
 This function sends an xc_load_scenario PDU. More...
 
void send_pdu_xc_save_scenario (unsigned short site, unsigned short host, const char *filename, const int use_user_name)
 This function sends an xc_save_scenario PDU. More...
 
void send_pdu_xc_reset_scenario (unsigned short site, unsigned short host)
 This function sends an xc_reset_scenario PDU. More...
 
void send_pdu_xc_merge_scenario (unsigned short site, unsigned short host, float ttod, float refx, float refy, float refz, float tx, float ty, float tz, float rz, float rx, float ry, const char *filename, const char *suffix)
 This function sends an xc_merge_scenario PDU. More...
 
void send_pdu_xc_trigger_script (unsigned short site, unsigned short host, const char *script_name)
 This function sends an xc_trigger_script PDU. More...
 
void send_pdu_xc_control (unsigned short site, unsigned short host, const char *command)
 This function sends an xc_control PDU. More...
 
void send_pdu_xc_time_now (float tod, float smooth_period)
 This function sends an xc_time_now PDU. More...
 
void send_pdu_xc_eval_script (unsigned short site, unsigned short host, const char *text)
 This function sends an xc_eval_script PDU. More...
 
void send_pdu_xc_enter_slave_mode (unsigned short site, unsigned short host)
 This function sends an xc_enter_slave PDU. More...
 
void send_pdu_xc_exit_slave_mode (unsigned short site, unsigned short host)
 This function sends an xc_exit_slave PDU. More...
 
AI Messaging Functions
int send_message_to_character (diguyCharacter *character, const char *sender_name, const char *message_type, const char *message, const char *message_params=NULL)
 This function sends a custom AI message PDU. More...
 
int send_message_to_group (const char *group_name, const char *sender_name, const char *message_type, const char *message, const char *message_params=NULL)
 This function sends a custom AI message PDU. More...
 
int broadcast_message (diguyCharacter *sender, float radius, const char *message_type, const char *message, const char *message_params=NULL)
 This function sends a custom AI message PDU. More...
 
int broadcast_message_to_group (diguyCharacter *sender, const char *group_name, float radius, const char *message_type, const char *message, const char *message_params=NULL)
 This function sends a custom AI message PDU. More...
 
const char * get_net_id (diguyCharacter *character)
 Returns: "sitenum_hostnum_idnum" as a string. More...
 
Experimental Conversion Functions
int convert_mgrs_to_local (const char *MGRS_str, float *x, float *y, float *z)
 
const char * convert_local_to_mgrs (float x, float y, float z)
 
float convert_local_to_lat (float x, float y, float z)
 
float convert_local_to_long (float x, float y, float z)
 
const char * convert_local_to_lat_long_string (float x, float y, float z)
 
int convert_lat_long_to_local (float lat, float lon, float *x, float *y, float *z)
 

Private Functions

The functions and variables past this point are for internal use only.

No external access to them is expected or necessary.

class bdiExerciseInterface
 
bdiExerciseInterfacem_bdiExerciseInterface
 A pointer to internal data. More...
 
bdiExerciseInterfaceget_scripted_object ()
 
 diguyExerciseInterface (bdiExerciseInterface *ei)
 A private constructor. More...
 

Constructor & Destructor Documentation

diguyExerciseInterface::diguyExerciseInterface ( bdiExerciseInterface ei)
private

A private constructor.

Member Function Documentation

void diguyExerciseInterface::send_pdu_xc_set_tin_tod ( unsigned short  site,
unsigned short  host,
float  ttod 
)

This function sends an xc_set_tin_tod PDU.

This PDU tells a remote DI-Guy application the simulated time of day at which its scenario is supposed to begin. Doing this provides a conceptual link between scenario time, which nominally starts at zero, and wall-clock time. This makes it possible for a scenario to be run under different simulated lighting conditions.

The remote DI-Guy application essentially does a diguyScenario::set_tin_time_of_day() call.

Parameters
sitedestination host id (65535 for all sites)
hostdestination host id (65535 for all hosts)
ttodtin time of day (seconds after midnight)

Callable From:

  • C++
  • Script
void diguyExerciseInterface::send_pdu_xc_load_scenario ( unsigned short  site,
unsigned short  host,
const char *  filename,
const char *  refname 
)

This function sends an xc_load_scenario PDU.

This PDU tells a remote DI-Guy application to load a particular scenario file.

The remote DI-Guy application essentially does a diguyScenario::load() call.

Parameters
sitedestination host id (65535 for all sites)
hostdestination host id (65535 for all hosts)
filenamescenario to load
refnamescenario reference name

Callable From:

  • C++
  • Script
void diguyExerciseInterface::send_pdu_xc_save_scenario ( unsigned short  site,
unsigned short  host,
const char *  filename,
const int  use_user_name 
)

This function sends an xc_save_scenario PDU.

This PDU tells a remote DI-Guy application to save a particular scenario file.

The remote DI-Guy application essentially does a diguyScenario::save_as() call.

Parameters
sitedestination host id (65535 for all sites)
hostdestination host id (65535 for all hosts)
filenamescenario to load
use_user_nameuser name to uniquely identify the file

Callable From:

  • C++
  • Script
void diguyExerciseInterface::send_pdu_xc_reset_scenario ( unsigned short  site,
unsigned short  host 
)

This function sends an xc_reset_scenario PDU.

This PDU tells a remote DI-Guy application to reset the current scenario file.

The remote DI-Guy application essentially does a diguyScenario::reset() call.

Parameters
sitedestination host id (65535 for all sites)
hostdestination host id (65535 for all hosts)

Callable From:

  • C++
  • Script
void diguyExerciseInterface::send_pdu_xc_merge_scenario ( unsigned short  site,
unsigned short  host,
float  ttod,
float  refx,
float  refy,
float  refz,
float  tx,
float  ty,
float  tz,
float  rz,
float  rx,
float  ry,
const char *  filename,
const char *  suffix 
)

This function sends an xc_merge_scenario PDU.

This PDU tells a remote DI-Guy application to merge a particular scenario file.

The remote DI-Guy application essentially does a diguyScenario::merge() call.

Parameters
sitedestination host id (65535 for all sites)
hostdestination host id (65535 for all hosts)
ttodtin time of day for the merged scenario (seconds after midnight)
refx,refy,refztransformation reference point in merged scenario (point around which translation and rotation will occur)
tx,ty,tztranslation of reference point in merged scenario
rz,rx,ryrotation of reference point in merged scenario
filenamefilename of scenario to merge
collision_suffixsuffix to be used in event of name conflicts

Callable From:

  • C++
  • Script
void diguyExerciseInterface::send_pdu_xc_trigger_script ( unsigned short  site,
unsigned short  host,
const char *  script_name 
)

This function sends an xc_trigger_script PDU.

This PDU tells a remote DI-Guy application to trigger the named script.

The remote DI-Guy application essentially does a diguyScenario::trigger_script() call.

Parameters
sitedestination host id (65535 for all sites)
hostdestination host id (65535 for all hosts)
script_namename of the script to be triggered

Callable From:

  • C++
  • Script
void diguyExerciseInterface::send_pdu_xc_control ( unsigned short  site,
unsigned short  host,
const char *  command 
)

This function sends an xc_control PDU.

This PDU tells a remote DI-Guy application to PLAY, STOP, RESET, etc.

Parameters
sitedestination host id (65535 for all sites)
hostdestination host id (65535 for all hosts)
commandcommand string. Valid values are "RESET", "RUN", "STOP", "FF", "REWIND"

Callable From:

  • C++
  • Script
void diguyExerciseInterface::send_pdu_xc_time_now ( float  tod,
float  smooth_period 
)

This function sends an xc_time_now PDU.

This PDU tells all remote DI-Guy applications what the simulated time of day is right now. There is no way to target this message at particular DI-Guy hosts. It is received and processed by all DI-Guy applications in the DIS exercise.

Parameters
todtime of day: number of seconds since midnight, where 0.0 <= tod < 86400.0
smooth_periodhow many real seconds should be taken to get into sync

Scenarios can proceed from one day to the next, up to a length of 24 hours. When midnight comes, tod should be specified AS ZERO, and should increase from there. Values less than zero or greater than or equal to 86400.0 will NOT be sent over the network. In the case nothing will be sent.

Callable From:

  • C++
  • Script
void diguyExerciseInterface::send_pdu_xc_eval_script ( unsigned short  site,
unsigned short  host,
const char *  text 
)

This function sends an xc_eval_script PDU.

This PDU tells a remote DI-Guy application to evaluate a literal piece of script text.

Parameters
sitedestination host id (65535 for all sites)
hostdestination host id (65535 for all hosts)
texttext of the script to be executed

Callable From:

  • C++
  • Script
void diguyExerciseInterface::send_pdu_xc_enter_slave_mode ( unsigned short  site,
unsigned short  host 
)

This function sends an xc_enter_slave PDU.

This PDU tells a remote DI-Guy application to start slaving it's camera to incoming camera/time packets.

Parameters
sitedestination host id (65535 for all sites)
hostdestination host id (65535 for all hosts)

Callable From:

  • C++
  • Script
void diguyExerciseInterface::send_pdu_xc_exit_slave_mode ( unsigned short  site,
unsigned short  host 
)

This function sends an xc_exit_slave PDU.

This PDU tells a remote DI-Guy application to stop slaving it's camera to incoming camera/time packets.

Parameters
sitedestination host id (65535 for all sites)
hostdestination host id (65535 for all hosts)

Callable From:

  • C++
  • Script
int diguyExerciseInterface::send_message_to_character ( diguyCharacter character,
const char *  sender_name,
const char *  message_type,
const char *  message,
const char *  message_params = NULL 
)

This function sends a custom AI message PDU.

This PDU is mapped into a diguyCharacter::agent_accept_message() function call on the receiving side.

Parameters
characterpointer to the remote diguyCharacter
sender_namewho is sending the message
message_typetype of message is being sent
messagemessage string
message_paramsoptional parameter string

Use diguyExerciseInterface::get_net_id() to get the name of the character that the remote machine will see the sender as.

Callable From:

  • C++
  • Script
int diguyExerciseInterface::send_message_to_group ( const char *  group_name,
const char *  sender_name,
const char *  message_type,
const char *  message,
const char *  message_params = NULL 
)

This function sends a custom AI message PDU.

This PDU is mapped into a diguyCharacterGroup::send_message_to_all_members() on all clients.

Parameters
group_namename of the diguyCharacterGroup to target
sender_namewho is sending the message
message_typewhat type of message is being sent
messagethe message string
message_paramsoptional parameter string

Use diguyExerciseInterface::get_net_id() to get the name of the character that the remote machine will see the sender as.

Callable From:

  • C++
  • Script
int diguyExerciseInterface::broadcast_message ( diguyCharacter sender,
float  radius,
const char *  message_type,
const char *  message,
const char *  message_params = NULL 
)

This function sends a custom AI message PDU.

This PDU is mapped into a diguyCharacter::agent_broadcast_message() on all clients.

Parameters
senderpointer to the diguyCharacter that is broadcasting the message
radiushow far to broadcast the message
message_typewhat type of message is being sent
messagethe message string
message_paramsoptional parameter string

Callable From:

  • C++
  • Script
int diguyExerciseInterface::broadcast_message_to_group ( diguyCharacter sender,
const char *  group_name,
float  radius,
const char *  message_type,
const char *  message,
const char *  message_params = NULL 
)

This function sends a custom AI message PDU.

This PDU is mapped into a diguyCharacter::agent_broadcast_message_to_group() on all clients.

Parameters
senderpointer to the diguyCharacter that is broadcasting the message
group_namethe group that receive the message
radiushow far to broadcast the message
message_typewhat type of message is being sent
messagethe message string
message_paramsoptional parameter string

Callable From:

  • C++
  • Script
const char* diguyExerciseInterface::get_net_id ( diguyCharacter character)

Returns: "sitenum_hostnum_idnum" as a string.

Useful for knowing the name that this entity will have on remote machines. This string should be copied.

int diguyExerciseInterface::convert_mgrs_to_local ( const char *  MGRS_str,
float *  x,
float *  y,
float *  z 
)
const char* diguyExerciseInterface::convert_local_to_mgrs ( float  x,
float  y,
float  z 
)
float diguyExerciseInterface::convert_local_to_lat ( float  x,
float  y,
float  z 
)
float diguyExerciseInterface::convert_local_to_long ( float  x,
float  y,
float  z 
)
const char* diguyExerciseInterface::convert_local_to_lat_long_string ( float  x,
float  y,
float  z 
)
int diguyExerciseInterface::convert_lat_long_to_local ( float  lat,
float  lon,
float *  x,
float *  y,
float *  z 
)
bdiExerciseInterface* diguyExerciseInterface::get_scripted_object ( )
inline

Friends And Related Function Documentation

friend class bdiExerciseInterface
friend

Member Data Documentation

bdiExerciseInterface* diguyExerciseInterface::m_bdiExerciseInterface
private

A pointer to internal data.


The documentation for this class was generated from the following file: