|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--vrml.BaseNode
|
+--vrml.node.Script
|
+--mil.navy.nps.dis.RadioCommunicationsPduScriptNode
This Java class provides the communications interface between the radio-communications Script node (in the VRML scene) and the DIS ReceiverPdu, SignalPdu and TransmitterPdu class libraries.
| 14 September 2000 | Don Brutzman, Dave Laflam | New, patterned after EspduTransform |
EspduTransform,
EntityDispatcher,
RadioCommunicationsFamily,
ReceiverPdu,
SignalPdu,
TransmitterPdu| Field Summary | |
protected SFBool |
active
eventOut: recent active signalPdu's heard |
protected SFString |
address
field, multicast address, or "unicast" |
protected SFVec3f |
antennaLocation
VRML scene eventOut for TransmitterPdu.antennaLocation |
protected SFInt32 |
antennaPatternLength
VRML scene eventOut for TransmitterPdu.antennaPatternLength |
protected SFInt32 |
antennaPatternType
VRML scene eventOut for TransmitterPdu.antennaPatternType |
protected SFInt32 |
applicationID
field, entityID triplet: unique application ID at that site |
protected SFInt32 |
cryptoKeyId
VRML scene eventOut for TransmitterPdu.cryptoKeyId |
protected SFInt32 |
cryptoSytem
VRML scene eventOut for TransmitterPdu.cryptoSytem |
protected SFInt32 |
data00
VRML scene eventOut for SignalPdu.data00 |
protected SFInt32 |
data01
VRML scene eventOut for SignalPdu.data01 |
protected SFInt32 |
data02
VRML scene eventOut for SignalPdu.data02 |
protected SFInt32 |
data03
VRML scene eventOut for SignalPdu.data03 |
protected SFInt32 |
data04
VRML scene eventOut for SignalPdu.data04 |
protected SFInt32 |
data05
VRML scene eventOut for SignalPdu.data05 |
protected SFInt32 |
data06
VRML scene eventOut for SignalPdu.data06 |
protected SFInt32 |
data07
VRML scene eventOut for SignalPdu.data07 |
protected SFInt32 |
data08
VRML scene eventOut for SignalPdu.data08 |
protected SFInt32 |
data09
VRML scene eventOut for SignalPdu.data09 |
protected SFInt32 |
data10
VRML scene eventOut for SignalPdu.data10 |
protected SFInt32 |
dataLength
VRML scene eventOut for SignalPdu.dataLength |
protected boolean |
DEBUG
When DEBUG is true, console text messages trace the internals of script operation. |
protected SFInt32 |
encodingScheme
VRML scene eventOut for SignalPdu.encodingScheme |
protected static EntityDispatcher |
entityDispatcher
|
protected static java.lang.Thread |
entityDispatcherThread
|
protected SFInt32 |
entityID
field, entity ID triplet: ID within that app |
protected EntityID |
entityIDObject
|
protected SFInt32 |
frequency
VRML scene eventOut for TransmitterPdu.frequency |
protected SFInt32 |
inputSource
VRML scene eventOut for TransmitterPdu.inputSource |
protected SFInt32 |
lengthOfModulationParameters
VRML scene eventOut for TransmitterPdu.lengthOfModulationParameters |
protected int |
MAX_DATA_PARAMETERS
No more than 11 data elements. |
protected SFInt32 |
modulationTypeDetail
VRML scene eventOut for TransmitterPdu#modulationTypeDetail |
protected SFInt32 |
modulationTypeMajor
VRML scene eventOut for TransmitterPdu#modulationTypeMajor |
protected SFInt32 |
modulationTypeSpreadSpectrum
VRML scene eventOut for TransmitterPdu#modulationTypeSpreadSpectrum |
protected SFInt32 |
modulationTypeSystem
VRML scene eventOut for TransmitterPdu#modulationTypeSystem |
protected SFString |
multicastRelayHost
field, relay host name or IP address (used only if no multicast heard) |
protected SFInt32 |
multicastRelayPort
field, relay host port to connect to (used only if no multicast heard) |
protected ProtocolDataUnit |
nextPdu
ProtocolDataUnit is an abstract class used to inspect each incoming PDU for type information, do not initialize per se. |
protected boolean |
pduFirstHeard
Report via Java console when a PDU is first heard |
protected SFInt32 |
port
field, port to listen on |
protected SFInt32 |
power
VRML scene eventOut for TransmitterPdu.power |
protected SFInt32 |
radioEntityTypeCategory
VRML scene eventOut for TransmitterPdu#radioEntityTypeCategory |
protected SFInt32 |
radioEntityTypeCountry
VRML scene eventOut for TransmitterPdu#radioEntityTypeCountry |
protected SFInt32 |
radioEntityTypeDomain
VRML scene eventOut for TransmitterPdu#radioEntityTypeDomain |
protected SFInt32 |
radioEntityTypeKind
VRML scene eventOut for TransmitterPdu#radioEntityTypeKind |
protected SFInt32 |
radioEntityTypeNomenclature
VRML scene eventOut for TransmitterPdu#radioEntityTypeNomenclature |
protected SFInt32 |
radioEntityTypeNomenclatureVersion
VRML scene eventOut for TransmitterPdu#radioEntityTypeNomenclatureVersion |
protected SFInt32 |
radioID
VRML scene eventOut for RadioCommunicationsFamily.radioID |
protected SFString |
radioPduType
VRML scene field to specify which RadioCommunicationsFamily PDU is being utilized: ReceiverPdu, SignalPdu or TransmitterPdu. |
protected long |
readInterval
field, how often to look for DIS PDUs. |
protected ReceiverPdu |
receiverPdu
Carries receiver information among simulation participants |
protected SFFloat |
receiverPower
VRML scene eventOut for ReceiverPdu.receiverPower |
protected SFInt32 |
receiverState
VRML scene eventOut for ReceiverPdu.receiverState |
protected SFVec3f |
relativeAntennaLocation
VRML scene eventOut for TransmitterPdu.relativeAntennaLocation |
protected SFBool |
rtpHeaderExpected
field, are RTP headers expected? Only set by VRML scene at initialization (because it is a field) but can be reset at runtime if the opposite situation is encountered. |
protected SFBool |
rtpHeaderHeard
eventOut, are RTP headers being heard on the wire? |
protected SFInt32 |
sampleRate
VRML scene eventOut for SignalPdu.sampleRate |
protected SFInt32 |
samples
VRML scene eventOut for SignalPdu.samples |
protected SignalPdu |
signalPdu
Carries signal information among simulation participants |
protected SFInt32 |
siteID
field, entityID triplet: site ID |
protected SecurityStrategy |
strategy
Get platform-specific security strategy |
protected SFInt32 |
tdlType
VRML scene eventOut for SignalPdu.tdlType |
protected SFTime |
timestamp
eventOut: timestamp |
protected SFBool |
traceJava
field: enable Java trace statements to console |
protected SFInt32 |
transmitFrequencyBandwidth
VRML scene eventOut for TransmitterPdu.transmitFrequencyBandwidth |
protected SFInt32 |
transmitState
VRML scene eventOut for TransmitterPdu.transmitState |
protected SFInt32 |
transmitterApplicationID
field, entityID triplet: transmitterApplicationID (as part of transmitterEntityID member object for ReceiverPdu) |
protected SFInt32 |
transmitterEntityID
field, entity ID triplet: transmitterEntityID (as part of transmitterEntityID member object for ReceiverPdu) |
protected TransmitterPdu |
transmitterPdu
Carries transmitterPdu information among simulation participants |
protected SFInt32 |
transmitterRadioID
VRML scene eventOut for ReceiverPdu.transmitterRadioID |
protected SFInt32 |
transmitterSiteID
field, entityID triplet: transmitterSiteID (as part of transmitterEntityID member object for ReceiverPdu) |
protected long |
writeInterval
field, how often to write DIS PDUs. |
| Constructor Summary | |
RadioCommunicationsPduScriptNode()
Constructor that includes setting security permissions since Internet Explorer will throw a com.ms.security.SecurityExceptionEx if initialize () is called from an external source (i.e. |
|
| Method Summary | |
protected void |
debug(java.lang.String pDiagnostic)
Debugging output routine. |
boolean |
getDEBUG()
Access DEBUG trace variable. |
EntityID |
getEntityIDObject()
gets the entity ID, which is the unique triplet that identifies the entity, consisting of (site, application, entity) ID numbers. |
java.lang.String |
getName()
Simple identifying name for the signalPdu is entityID |
void |
initialize()
initialize () gets needed information for setup from the invoking scene entity and VRML browser, and also prints the values if DEBUG is true. |
static void |
main(java.lang.String[] args)
main method was originally intended to be used for debugging, to determine if EntityDispatcher really is sending things to us. |
void |
processEvent(Event event)
This is the main method, called by the VRML scene with periodicity readInterval (or writeInterval). |
void |
receivePDU(ProtocolDataUnit pPDU)
receivePDU () is called by the entity dispatcher when a PDU for the node arrives from the network. |
void |
setDEBUG(boolean pDEBUG)
Modify DEBUG trace variable. |
void |
setEntityIDObject(EntityID pEIO)
resets the entity ID triplet = (site, application, entity) ID numbers. |
void |
shutdown()
shutdown() is called when VRML scene exits. |
void |
startEntityDispatcherThread()
Simple method to launch thread because Microsoft puts security restraints on everything. |
protected void |
trace(java.lang.String pDiagnostic)
Guaranteed trace output routine. |
| Methods inherited from class vrml.node.Script |
eventsProcessed, getEventIn, getEventOut, getField, processEvents, toString |
| Methods inherited from class vrml.BaseNode |
getBrowser, getType |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected SFTime timestamp
protected long readInterval
protected long writeInterval
protected SFString address
protected SFInt32 port
protected SFString multicastRelayHost
protected SFInt32 multicastRelayPort
protected SFBool rtpHeaderExpected
protected SFBool rtpHeaderHeard
protected SFInt32 siteID
protected SFInt32 applicationID
protected SFInt32 entityID
protected SFString radioPduType
protected SFInt32 radioID
RadioCommunicationsFamily.radioIDprotected SFInt32 encodingScheme
SignalPdu.encodingSchemeprotected SFInt32 tdlType
SignalPdu.tdlTypeprotected SFInt32 sampleRate
SignalPdu.sampleRateprotected SFInt32 samples
SignalPdu.samplesprotected SFInt32 dataLength
SignalPdu.dataLengthprotected SFInt32 data00
SignalPdu.data00protected SFInt32 data01
SignalPdu.data01protected SFInt32 data02
SignalPdu.data02protected SFInt32 data03
SignalPdu.data03protected SFInt32 data04
SignalPdu.data04protected SFInt32 data05
SignalPdu.data05protected SFInt32 data06
SignalPdu.data06protected SFInt32 data07
SignalPdu.data07protected SFInt32 data08
SignalPdu.data08protected SFInt32 data09
SignalPdu.data09protected SFInt32 data10
SignalPdu.data10protected SFFloat receiverPower
ReceiverPdu.receiverPowerprotected SFInt32 receiverState
ReceiverPdu.receiverStateprotected SFInt32 transmitterSiteID
transmitterEntityID member object for ReceiverPdu)protected SFInt32 transmitterApplicationID
transmitterEntityID member object for ReceiverPdu)protected SFInt32 transmitterEntityID
transmitterEntityID member object for ReceiverPdu)protected SFInt32 transmitterRadioID
ReceiverPdu.transmitterRadioIDprotected SFVec3f antennaLocation
TransmitterPdu.antennaLocationprotected SFInt32 antennaPatternLength
TransmitterPdu.antennaPatternLengthprotected SFInt32 antennaPatternType
TransmitterPdu.antennaPatternTypeprotected SFInt32 cryptoKeyId
TransmitterPdu.cryptoKeyIdprotected SFInt32 cryptoSytem
TransmitterPdu.cryptoSytemprotected SFInt32 frequency
TransmitterPdu.frequencyprotected SFInt32 inputSource
TransmitterPdu.inputSourceprotected SFInt32 lengthOfModulationParameters
TransmitterPdu.lengthOfModulationParametersprotected SFInt32 modulationTypeDetail
TransmitterPdu#modulationTypeDetailprotected SFInt32 modulationTypeMajor
TransmitterPdu#modulationTypeMajorprotected SFInt32 modulationTypeSpreadSpectrum
TransmitterPdu#modulationTypeSpreadSpectrumprotected SFInt32 modulationTypeSystem
TransmitterPdu#modulationTypeSystemprotected SFInt32 power
TransmitterPdu.powerprotected SFInt32 radioEntityTypeCategory
TransmitterPdu#radioEntityTypeCategoryprotected SFInt32 radioEntityTypeCountry
TransmitterPdu#radioEntityTypeCountryprotected SFInt32 radioEntityTypeDomain
TransmitterPdu#radioEntityTypeDomainprotected SFInt32 radioEntityTypeKind
TransmitterPdu#radioEntityTypeKindprotected SFInt32 radioEntityTypeNomenclature
TransmitterPdu#radioEntityTypeNomenclatureprotected SFInt32 radioEntityTypeNomenclatureVersion
TransmitterPdu#radioEntityTypeNomenclatureVersionprotected SFVec3f relativeAntennaLocation
TransmitterPdu.relativeAntennaLocationprotected SFInt32 transmitFrequencyBandwidth
TransmitterPdu.transmitFrequencyBandwidthprotected SFInt32 transmitState
TransmitterPdu.transmitStateprotected SFBool traceJava
protected SFBool active
protected ProtocolDataUnit nextPdu
protected ReceiverPdu receiverPdu
protected SignalPdu signalPdu
protected TransmitterPdu transmitterPdu
protected boolean pduFirstHeard
protected EntityID entityIDObject
protected static EntityDispatcher entityDispatcher
protected static java.lang.Thread entityDispatcherThread
protected final int MAX_DATA_PARAMETERS
protected SecurityStrategy strategy
protected boolean DEBUG
| Constructor Detail |
public RadioCommunicationsPduScriptNode()
| Method Detail |
public boolean getDEBUG()
public void setDEBUG(boolean pDEBUG)
protected void debug(java.lang.String pDiagnostic)
protected void trace(java.lang.String pDiagnostic)
Can't be static or all entities look the same.
public java.lang.String getName()
public void initialize()
initialize in class Scriptpublic void startEntityDispatcherThread()
EntityDispatcher is static; only one copy is shared between all instances of the RadioCommunicationsPduScriptNode. If it's null the first time through here, create and thread it.
This is synchronized, since we may have N RadioCommunicationsPduScriptNodes attempting to instantiate themselves at once, all accessing this shared class variable. The synchronization prevents multiple access.
This is actually some magic code. Java keeps several mutex locks around, one for every instance of a class and one for the class itself. We can't sychronize on entityDispatcher because that's null the first time through, which will fail silently. We also can't use a java primitive type. So I created a completely arbitrary instance of an object as a class variable, and synchronize on that. It's a standin for the EntityDispatcher in a way.
public void receivePDU(ProtocolDataUnit pPDU)
receivePDU in interface PduSubscriberpublic EntityID getEntityIDObject()
public void setEntityIDObject(EntityID pEIO)
public void processEvent(Event event)
processEvent in class Scriptpublic void shutdown()
shutdown in class Scriptpublic static void main(java.lang.String[] args)
Sigh. We can't actually use main(), since that's declared in Script, and we can't override static methods. So as an alternative we rename this something else and then call it from another class that can have a main method. Reverify that this block of code is correct if you do resurrect it.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||