|
WSF
|
#include <WsfModeList.hpp>


Public Types | |
| using | ModeList = std::vector<WsfMode*> |
Public Member Functions | |
| WsfModeList (WsfMode *aTemplatePtr) | |
| WsfModeList (const WsfModeList &aSrc) | |
| Copy constructor. | |
| WsfModeList & | operator= (const WsfModeList &)=delete |
| virtual | ~WsfModeList () |
| virtual void | AddMode (WsfMode *aModePtr) |
| bool | CanMultiSelect () const |
| size_t | GetCurrentMode () const |
| size_t | GetModeCount () const |
| WsfMode * | GetModeEntry (size_t aModeIndex) const |
| size_t | GetModeByName (WsfStringId aModeNameId) const |
| WsfStringId | GetModeNameId (size_t aModeIndex) const |
| WsfMode * | GetModeTemplate () const |
| Returns the mode that is the 'mode_template' or the implicit mode. | |
| virtual bool | Initialize () |
| virtual bool | ProcessInput (UtInput &aInput) |
| The standard ProcessInput method. | |
| virtual void | Deselect (double aSimTime, WsfStringId aModeNameId) |
| virtual void | Select (double aSimTime, WsfStringId aModeNameId) |
| virtual void | TurnOff (double aSimTime) |
| virtual void | TurnOn (double aSimTime) |
| virtual double | GetModeSelectDelay () |
| virtual bool | IsModeChangeScheduled () const |
| virtual void | SetModeChangeScheduled (bool aModeChangeScheduled) |
| template<class T> | |
| void | GetDerivedModeList (std::vector< T > &aModeList) const |
Static Public Member Functions | |
| static WsfStringId | GetDefaultModeNameId () |
| Return the string id of the 'default' mode name. | |
Protected Member Functions | |
| void | DeselectP (double aSimTime, size_t aModeIndex) |
| void | SelectP (double aSimTime, size_t aModeIndex) |
Protected Attributes | |
| std::vector< WsfMode * > | mModeList |
| This list of modes. | |
| WsfMode * | mTemplatePtr |
| The mode that is the 'mode_template' or the implicit mode. | |
| bool | mExplicitModeUsed |
| 'true' if 'mode' was or 'mode_template' has been used. | |
| bool | mImplicitModeUsed |
| 'true' if a mode was implicitly defined without using 'mode' or 'mode_template'. | |
| bool | mCanMultiSelect |
| WsfStringId | mInitialModeNameId |
| bool | mIsInitialized |
| 'true' if the system has been initialized | |
| bool | mIsTurnedOn |
| 'true' if the system is currently turned on. | |
| size_t | mCurrentModeIndex |
| The vector index of the currently selected mode. | |
| double | mModeSelectDelay |
| bool | mModeChangeScheduled |
| The last successful mode selection time. | |
A mode list is used to represent the various operating modes of platform subsystems (sensors, interferers, etc). A mode (base class WsfMode) is used to represent a single mode.
This class provides the interface to manipulate multi-mode systems.
| using WsfModeList::ModeList = std::vector<WsfMode*> |
| WsfModeList::WsfModeList | ( | WsfMode * | aTemplatePtr | ) |
Constructor.
| aTemplatePtr | A pointer to the 'template' from which new modes will be created by ProcessInput(). The mode list assumes ownership of the 'template' and will delete it when the mode list is destroyed. |
References mCanMultiSelect, mCurrentModeIndex, mExplicitModeUsed, mImplicitModeUsed, mInitialModeNameId, mIsInitialized, mIsTurnedOn, mModeChangeScheduled, mModeList, mModeSelectDelay, and mTemplatePtr.
Referenced by operator=(), WsfModeList(), WsfSensorModeList::WsfSensorModeList(), WsfSensorModeList::WsfSensorModeList(), and WsfSensorModeList::WsfSensorModeList().
| WsfModeList::WsfModeList | ( | const WsfModeList & | aSrc | ) |
Copy constructor.
References WsfMode::Clone(), if(), mCanMultiSelect, mCurrentModeIndex, mExplicitModeUsed, mImplicitModeUsed, mInitialModeNameId, mIsInitialized, mIsTurnedOn, mModeChangeScheduled, mModeList, mModeSelectDelay, mTemplatePtr, and WsfModeList().
|
virtual |
References mExplicitModeUsed, mModeList, and mTemplatePtr.
|
virtual |
Add a mode to the mode list.
| aModePtr | Pointer to the mode object to be added. The mode list will assume ownership of the object and will delete it when the mode list is deleted. |
Reimplemented in WsfSensorModeList.
References mModeList.
Referenced by WsfSensorModeList::AddMode(), Initialize(), operator=(), and ProcessInput().
|
inline |
Can multiple modes can be selected simultaneously?
References mCanMultiSelect.
Referenced by WsfDisEmission::UpdateSensor(), and UT_DEFINE_SCRIPT_METHOD().
|
virtual |
Deselect the mode with the specified mode name.
| aModeNameId | The string ID of the mode name that is to be deselected. |
| aSimTime | The current simulation time. |
References DeselectP(), GetModeByName(), mIsTurnedOn, and mModeList.
|
protected |
Deselect a mode.
| aSimTime | The current simulation time. |
| aModeIndex | The index of the mode to be deselected. |
References WsfMode::Deselect(), WsfMode::IsSelected(), and mModeList.
Referenced by Deselect(), Select(), and TurnOff().
|
inline |
Return the index of the current mode.
References mCurrentModeIndex.
|
static |
Return the string id of the 'default' mode name.
Referenced by WsfSensor::GetCurrentModeName(), WsfWeapon::GetCurrentModeName(), WsfSensor::GetModeName(), WsfWeapon::GetModeName(), and operator=().
|
inline |
A helper template class to get a vector of mode pointers of the proper type. Classes that implement modes typically need pointers to their specific type of mode in order to call methods that aren't defined in the WsfMode base class. This method creates a copy of the mode list but the pointers are of the requested type. This allows the to eliminate a lot of dynamic casting.
References mModeList.
Referenced by WsfDefaultSensorScheduler::Initialize(), WsfDefaultSensorTracker::Initialize(), WsfPhysicalScanSensorScheduler::Initialize(), WsfRotorcraftMover::Initialize(), WsfSectorScanSensorScheduler::Initialize(), WsfSpinSensorScheduler::Initialize(), and WsfDisEmission::UpdateSensor().
| size_t WsfModeList::GetModeByName | ( | WsfStringId | aModeNameId | ) | const |
Return the mode index of the mode with the specified name (ID).
References GetModeCount(), and mModeList.
Referenced by Deselect(), Initialize(), WsfSensorMode::Initialize(), ProcessInput(), Select(), TurnOff(), and TurnOn().
|
inline |
Get the number of modes that are defined.
References mModeList.
Referenced by GetModeByName(), WsfCompositeSensor::Initialize(), WsfSensorMode::Initialize(), ProcessInput(), TurnOff(), TurnOn(), and WsfDisEmission::UpdateSensor().
|
inline |
Return the pointer to mode with the specified index.
| aModeIndex | The index of the desired mode in the range [0, GetModeCount() - 1]. The results are undefined if the index is outside the allowable range. |
References mModeList.
| WsfStringId WsfModeList::GetModeNameId | ( | size_t | aModeIndex | ) | const |
Return the string ID of the name associated with the mode with the specified index.
| aModeIndex | The index of the mode whose name is being requested. This must be in the range [0, GetModeCount() - 1]. |
References mModeList.
Referenced by WsfCompositeSensor::Initialize(), and WsfDisEmission::UpdateSensor().
|
inlinevirtual |
Returns the mode select delay time in seconds.
References mModeSelectDelay.
|
inline |
Returns the mode that is the 'mode_template' or the implicit mode.
References mTemplatePtr.
Referenced by WsfCompositeSensor::Initialize(), and WsfMoonLOS_SensorComponent::ProcessModeInput().
|
virtual |
Initialize the mode list. This method ensures that the mode list is properly formed and prepares it for use.
References AddMode(), GetModeByName(), mCurrentModeIndex, mExplicitModeUsed, mImplicitModeUsed, mInitialModeNameId, mIsInitialized, mModeList, mTemplatePtr, and ok.
|
inlinevirtual |
Check is a mode change is scheduled.
References mModeChangeScheduled.
|
delete |
References AddMode(), GetDefaultModeNameId(), and WsfModeList().
|
virtual |
The standard ProcessInput method.
References AddMode(), GetModeByName(), GetModeCount(), mCanMultiSelect, mExplicitModeUsed, mImplicitModeUsed, mInitialModeNameId, mIsInitialized, mModeList, mModeSelectDelay, mTemplatePtr, WsfMode::ProcessInput(), and WsfNamed::SetName().
|
virtual |
Select the mode with the specified mode name (ID).
| aModeNameId | The string ID of the mode name that is to be selected. |
| aSimTime | The current simulation time. |
References DeselectP(), GetModeByName(), mCanMultiSelect, mCurrentModeIndex, mIsTurnedOn, mModeList, and SelectP().
|
protected |
Select a mode.
| aSimTime | The current simulation time. |
| aModeIndex | The index of the mode to be selected. |
References WsfMode::IsSelected(), mModeList, and WsfMode::Select().
|
inlinevirtual |
Check is a mode change is scheduled.
References mModeChangeScheduled.
|
virtual |
The system is being turned off. This method invokes the 'Deselect' method for every selected mode.
| aSimTime | The current simulation time. |
References DeselectP(), GetModeByName(), GetModeCount(), mCanMultiSelect, mCurrentModeIndex, mInitialModeNameId, mIsTurnedOn, and mModeList.
|
virtual |
The system is being turned on. This method invokes the 'Select' method for every selected mode.
| aSimTime | The current simulation time. |
References GetModeByName(), GetModeCount(), mCanMultiSelect, mCurrentModeIndex, mInitialModeNameId, mIsTurnedOn, mModeList, and SelectP().
|
protected |
'true' if multiple modes can be simultaneously selected. If 'false' then only one mode can be selected at a time and selecting one mode will deselect the currently selected mode.
Referenced by CanMultiSelect(), ProcessInput(), Select(), TurnOff(), TurnOn(), WsfModeList(), WsfModeList(), and WsfSensorModeList::WsfSensorModeList().
|
protected |
The vector index of the currently selected mode.
Referenced by GetCurrentMode(), Initialize(), Select(), TurnOff(), TurnOn(), WsfModeList(), WsfModeList(), and WsfSensorModeList::WsfSensorModeList().
|
protected |
'true' if 'mode' was or 'mode_template' has been used.
Referenced by Initialize(), ProcessInput(), WsfModeList(), WsfModeList(), WsfSensorModeList::WsfSensorModeList(), and ~WsfModeList().
|
protected |
'true' if a mode was implicitly defined without using 'mode' or 'mode_template'.
Referenced by Initialize(), ProcessInput(), WsfModeList(), WsfModeList(), and WsfSensorModeList::WsfSensorModeList().
|
protected |
The string id of the mode to be selected when the system is FIRST turned on. In the current implementation a subsequent turn-on will use the last selected mode.
Referenced by Initialize(), ProcessInput(), TurnOff(), TurnOn(), WsfModeList(), WsfModeList(), and WsfSensorModeList::WsfSensorModeList().
|
protected |
'true' if the system has been initialized
Referenced by Initialize(), ProcessInput(), WsfModeList(), WsfModeList(), and WsfSensorModeList::WsfSensorModeList().
|
protected |
'true' if the system is currently turned on.
Referenced by Deselect(), Select(), TurnOff(), TurnOn(), WsfModeList(), WsfModeList(), and WsfSensorModeList::WsfSensorModeList().
|
protected |
The last successful mode selection time.
Referenced by IsModeChangeScheduled(), SetModeChangeScheduled(), WsfModeList(), WsfModeList(), and WsfSensorModeList::WsfSensorModeList().
|
protected |
This list of modes.
Referenced by AddMode(), Deselect(), DeselectP(), GetDerivedModeList(), GetModeByName(), GetModeCount(), GetModeEntry(), GetModeNameId(), Initialize(), ProcessInput(), Select(), SelectP(), TurnOff(), TurnOn(), WsfModeList(), WsfModeList(), WsfSensorModeList::WsfSensorModeList(), and ~WsfModeList().
|
protected |
The time in which a mode change is delayed before it is actually change upon the request.
Referenced by GetModeSelectDelay(), ProcessInput(), WsfModeList(), WsfModeList(), and WsfSensorModeList::WsfSensorModeList().
|
protected |
The mode that is the 'mode_template' or the implicit mode.
Referenced by GetModeTemplate(), Initialize(), ProcessInput(), WsfModeList(), WsfModeList(), and ~WsfModeList().