VR-Link JAVA API Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
List of all members | Public Member Functions
com.mak.vrlj.vl.ExerciseConnection Interface Reference

Instances of ExerciseConnection provide an application's interface or connection to the network. More...

+ Inheritance diagram for com.mak.vrlj.vl.ExerciseConnection:
+ Collaboration diagram for com.mak.vrlj.vl.ExerciseConnection:

Public Member Functions

abstract void close () throws Exception
abstract void drainInput ()
 Processes input from the exercise.
abstract void drainInput (double maxTime)
 Processes input from the exercise.
abstract Clock getClock ()
 Get the Exercise Connection's clock.
abstract int getNextEventId ()
abstract PublisherFactory getPublisherFactory ()
abstract
ReflectedObjectCollection
< ObjectIdentifier, BaseObject
<?extends ObjectIdentifier > > 
getReflectedCollection ()
abstract void send (Interaction inter)
 Send an interaction to the network.
InteractionDispatcher<?extends
Interaction
getInteractionDispatcher (String interactionName)
 Get a subscription source for a particular interaction simulation class.
void setDefaultHeartbeatRate (float theRate)
 Set the default Heartbeat Rate This is a DIS only settings This only applies to newly created publishers.
void setDefaultReflectedSmoothingPeriod (float thePeriod)
 Set the default Reflected Smoothing Period.
void setDefaultThresholds (float theRotationalThreshold, float theTranslationThreshold)
 Set the default Thresholds.
void setInteractionDispatcher (String interactionName, InteractionDispatcher<?extends Interaction > iDisp)
 Set a subscription source for a particular interaction simulation class.
void setNotifyLevel (NotifyLevel theNotifyLevel)
 Set the notify level for VR-Link's internal logging.
void setReflectedHeartbeatThreshold (float theRate)
 Set the Reflected Heartbeat Threshold.
void setSingleReflectedSmoothingPeriod (GlobalObjectDesignator id, float thePeriod)
 Set the Reflected Smoothing Period.
void vlPrint (String text, NotifyLevel notifyLevel)
 Print using VR-Link's internal logging.

Detailed Description

Instances of ExerciseConnection provide an application's interface or connection to the network.

In HLA, ExerciseConnection maintains an application's interface to the RTI via the RTI Ambassador. ExerciseConnection also maintains the RTI's connection to the federate via the federate ambassador. An application must continually call drainInput() on the ExerciseConnection so that the LRC (Local RTI Component) may process RTI messages, receive callbacks and perform other housekeeping activities.

In DIS, ExerciseConnection maintains an application's interface to the DIS exercise, and handles all outgoing and incoming PDUs. An application must continually call drainInput() on the ExerciseConnection so that the application may process PDUs, make callbacks and perform other housekeeping activities.

Interactions may be sent using send(), and received by adding a listener to getInteractionDispatcher().

All reflected objects received from the network are stored in a single ReflectedObjectCollection in getReflectedCollection() and may be accessed and iterated without the need to create any ReflectedMap objects if desired.

Objects may be published to the network by creating publishers using the PublisherFactory from getPublisherFactory().

Member Function Documentation

abstract void com.mak.vrlj.vl.ExerciseConnection.close ( ) throws Exception
pure virtual
abstract void com.mak.vrlj.vl.ExerciseConnection.drainInput ( )
pure virtual

Processes input from the exercise.

It is from within drainInput that user callbacks are executed. This will use a default timeout typically specified in the constructor

abstract void com.mak.vrlj.vl.ExerciseConnection.drainInput ( double  maxTime)
pure virtual

Processes input from the exercise.

It is from within drainInput that user callbacks are executed. If maxTime is negative, then we read all available input without bound on time spent before returning.

Parameters
maxTimeis the approximate maximum time to spend
abstract Clock com.mak.vrlj.vl.ExerciseConnection.getClock ( )
pure virtual

Get the Exercise Connection's clock.

This clock must be set every frame to allow dead reckoning and stamped send calls

Returns
Clock used for simtime by the Exercise Connection

Referenced by com.mak.vrlj.example.f18.VehicleSim.fireMunition(), com.mak.vrlj.example.f18.VehicleSim.moveArtParts(), com.mak.vrlj.example.f18.VehicleSim.munitionTick(), and com.mak.vrlj.example.f18.VehicleSim.reactToDamage().

InteractionDispatcher<? extends Interaction> com.mak.vrlj.vl.ExerciseConnection.getInteractionDispatcher ( String  interactionName)
abstract int com.mak.vrlj.vl.ExerciseConnection.getNextEventId ( )
pure virtual
Returns
the sequential event ID.

Referenced by com.mak.vrlj.example.f18.VehicleSim.fireMunition().

abstract PublisherFactory com.mak.vrlj.vl.ExerciseConnection.getPublisherFactory ( )
pure virtual
Returns
a PublisherFactory which produces publishers for this connection.

Referenced by com.mak.vrlj.example.f18.VehicleSim.VehicleSim().

abstract ReflectedObjectCollection<ObjectIdentifier, BaseObject<? extends ObjectIdentifier> > com.mak.vrlj.vl.ExerciseConnection.getReflectedCollection ( )
pure virtual
Returns
a ReflectedObjectCollection containing all the objects received on this connection.
abstract void com.mak.vrlj.vl.ExerciseConnection.send ( Interaction  inter)
pure virtual

Send an interaction to the network.

Parameters
inter

Referenced by com.mak.vrlj.example.f18.VehicleSim.detonateMunition(), and com.mak.vrlj.example.f18.VehicleSim.fireMunition().

void com.mak.vrlj.vl.ExerciseConnection.setDefaultHeartbeatRate ( float  theRate)

Set the default Heartbeat Rate This is a DIS only settings This only applies to newly created publishers.

Parameters
theRate
void com.mak.vrlj.vl.ExerciseConnection.setDefaultReflectedSmoothingPeriod ( float  thePeriod)

Set the default Reflected Smoothing Period.

Parameters
thePeriod
void com.mak.vrlj.vl.ExerciseConnection.setDefaultThresholds ( float  theRotationalThreshold,
float  theTranslationThreshold 
)

Set the default Thresholds.

This only applies to newly created publishers.

Parameters
theRotationalThreshold
theTranslationThreshold
void com.mak.vrlj.vl.ExerciseConnection.setInteractionDispatcher ( String  interactionName,
InteractionDispatcher<?extends Interaction iDisp 
)

Set a subscription source for a particular interaction simulation class.

Parameters
interactionNamesimulation class name for the desired interaction.
iDispa dispatcher for subscription to the desired simulation interaction class.
void com.mak.vrlj.vl.ExerciseConnection.setNotifyLevel ( NotifyLevel  theNotifyLevel)

Set the notify level for VR-Link's internal logging.

Parameters
theNotifyLevel
void com.mak.vrlj.vl.ExerciseConnection.setReflectedHeartbeatThreshold ( float  theRate)

Set the Reflected Heartbeat Threshold.

Parameters
theRate
void com.mak.vrlj.vl.ExerciseConnection.setSingleReflectedSmoothingPeriod ( GlobalObjectDesignator  id,
float  thePeriod 
)

Set the Reflected Smoothing Period.

Parameters
id
thePeriod
void com.mak.vrlj.vl.ExerciseConnection.vlPrint ( String  text,
NotifyLevel  notifyLevel 
)

Print using VR-Link's internal logging.

Parameters
text
notifyLevel

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

Document ID: Generated on Fri Dec 2 02:42:08 EST 2016 from SVN revision 171416
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)