WsfTask

WsfTask

Clone: WsfTask newObj = WsfTask(other);

WsfTask is used by WsfTaskManager to represent a task. It is included in various task messages and has script methods. WsfTask is further specialized to provide access to weapon, jamming, and uplinking parameters.

Methods

int TaskId()

Returns the serial number of the task.

WsfTrackId TrackId()

Returns the track ID as known by the assigner.

WsfTrackId LocalTrackId()

Returns the track ID as known by the assignee.

string TaskType()

Returns the ‘task type’ from the WsfTaskManager::AssignTask method.

void SetTaskType(string aTaskType)

Sets the ‘task type’. To be used prior to WsfTaskManager::AssignTask

WsfPlatform Assigner()

Returns the platform that made the assignment.

Note

This returned value may be a null reference if the platform has been deleted. Use IsValid() to ensure it is valid.

string AssignerName()

Returns the name of the platform that made the assignment.

WsfPlatform Assignee()

Returns the platform to which the task was assigned.

Note

This returned value may be a null reference if the platform has been deleted. Use IsValid() to ensure it is valid.

string AssigneeName()

Returns the name of the platform to which the task was assigned.

void SetAssignee(WsfPlatform aAssignee)

Sets the assignee of the task. To be used prior to WsfTaskManager::AssignTask.

void SetAssignee(string aAssignee)

Sets the platform name of the task assignee. To be used prior to WsfTaskManager::AssignTask.

string Status()

Returns the task’s status. Possible values are: “ACCEPTED”, “REJECTED”, “COMPLETED”, “IN_PROGRESS”, “ACKNOWLEDGE_CANCEL”, “ACKNOWLEDGE_COMPLETE”, “WEAPON_RELEASED”, “SUCCESSFUL”, or “UNSUCCESSFUL”.

string SubStatus()

Returns the task’s sub-status. This is a user-defined status string set by methods like WsfTaskManager.TaskComplete.

double TimeAssigned()

Returns the simulation time when the task was assigned.

double TimeUpdated()

Returns the simulation time when the task was last updated.

double TimeSinceAssigned()

Returns the number of seconds that have elapsed since the task was assigned.

double TimeSinceUpdated()

Returns the number of seconds that have elapsed since the task was last updated.

void SetCommDevice(string aCommDevice)

Sets the name of the comm device to be used when transmitting the task assignment. To be used prior to WsfTaskManager::AssignTask

Resource Methods

The following methods apply only if the task is a resource (i.e., sensor, weapon, or processor) control task.

string ResourceName()

Returns the name of the sensor, weapon or processor resource. This will be an empty string if the task is not a resource control task.

bool ResourceIsSensor()
bool ResourceIsWeapon()
bool ResourceIsJammer()
bool ResourceIsProcessor()

Returns true if the indicated resource is a sensor, weapon, jammer, processor, or uplink, respectively.

string ResourceMode()

Returns the ‘mode’ for a sensor or jammer task.

int ResourceCount()

Returns the number of resources (rounds) to be used.

double ResourceFrequency()

Returns the center frequency in Hertz for a jamming task.

double ResourceBandwidth()

Returns the jamming bandwidth in Hertz for a jamming task.

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.

bool AuxDataBool(string aName)
int AuxDataInt(string aName)
double AuxDataDouble(string aName)
string AuxDataString(string aName)
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 AuxDataExists(string aName)
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.