WsfPlatformPart¶
- WsfPlatformPart inherits WsfObject
General Methods¶
- WsfPlatform Platform()¶
Returns the owning platform of the part.
- bool IsNonOperational()¶
Returns true if the part is marked as non-operational. Any request to turn a non-operational part on will be rejected.
- bool IsOperational()¶
Returns true if the part is marked as operational. An operational part can be turned on and off as desired.
- bool SetOperational(bool aOperational)¶
Sets the operational state of the object. If the argument is true, the object will be defined to be ‘operational,’ which means it can be turned on and off as desired. If the argument is false, the object will be defined to be ‘non-operational,’ which means any attempt to turn the object on will be rejected.
The return value is true if the change was successful, or false if not.
- bool IsTurnedOff()¶
Returns true if the part is turned off.
- bool IsTurnedOn()¶
Returns true if the part is turned on.
- bool InitiallyTurnedOn()¶
Returns true if the part is turned on when initially added to the simulation.
- double TimeSinceLastStatusChange()¶
Returns the number of seconds since the part was last turned off or on.
- void SendMessage(WsfMessage aMessage)¶
Sends the message to all linked objects.
- void SendMessage(WsfMessage aMessage, string aPartName)¶
Sends the message to the platform part with the specified name on the current platform.
Note
This probably only makes sense for sending messages from one processor to another. In the future it may be possible to send messages to sensors, etc.
- bool DebugEnabled()¶
Returns the value of the ‘debug’ attribute for the part.
- void SetDebugEnabled(bool aValue)¶
Sets the “debug’ attribute of the part to the indicated value. Many parts use this attribute to control the display of debugging output.
- double DamageFactor()¶
Returns the current value of the ‘damage factor’ attribute for the part. See details below on ‘damage factor’ attribute.
- void SetDamageFactor(double aValue)¶
Sets the “damage factor’ attribute of the part to the indicated value. Each platform part may now be damaged separately from the platform as a whole. Zero is no damage, One is totally destroyed, and values supplied outside this range are constrained to the closed interval.
Group Methods¶
- bool GroupMemberOf(WsfGroup aGroupPtr)¶
Returns true if the platform part is a member of the specified group.
- Array<WsfGroup> Groups()¶
Returns a list of all groups this platform part is a member of.
- Array<string> GroupsByName()¶
Returns a list of names of all groups this platform part is a member of.
Auxiliary Data Methods¶
Auxiliary Data is a collection of optional named user data attributes that can be stored with the object. The framework will maintain the attributes but in no other way attempts to use the data contained within. The definition and use of any attribute is defined purely by the user.
- Object AuxDataObject(string aName)¶
Retrieve the value of the auxiliary data attribute with the indicated name. If the attribute does not exist then a default value will be returned (false for bool, 0 for int and 0.0 for double).
- bool CheckAuxData(string aName)¶
Returns true if an auxiliary data member exists with the specified name.
- bool HasAuxData()¶
Returns true if the object has auxiliary data.
- bool DeleteAuxData(string aName)¶
Delete the auxiliary data attribute with the indicated name. Returns true if the attribute exists and was deleted, or false if the attribute did not exist.
- void SetAuxData(string aName, bool aValue)¶
- void SetAuxData(string aName, int aValue)¶
- void SetAuxData(string aName, double aValue)¶
- void SetAuxData(string aName, string aValue)¶
- void SetAuxData(string aName, Object aValue)¶
Set the value of the auxiliary data attribute with the indicated name. The last form of SetAuxData() can store any script object type.
- Map<string, string> GetAllAuxDataTypes()¶
Return the names and types of all auxiliary data attributes in the form of a Map<string,string>. Map keys are valid names of auxiliary data attributes. Map values are type names corresponding to valid auxiliary data attribute names.