WSF
MapPlotVariables Class Reference

#include <MapPlotVariables.hpp>

Inheritance diagram for MapPlotVariables:
Collaboration diagram for MapPlotVariables:

Public Types

using MapPlotVariableMap = std::map<std::string, std::shared_ptr<MapPlotVariable>>

Public Member Functions

 MapPlotVariables ()
 MapPlotVariables (const MapPlotVariables &)=default
MapPlotVariablesoperator= (const MapPlotVariables &)=default
 ~MapPlotVariables ()=default
bool ProcessInput (UtInput &aInput)
bool ProcessScriptVariableInput (const std::string &aVarName, double aVarInitValue)
size_t Count () const
void Evaluate (double aSimTime, WsfSensor *aSensorPtr, WsfSensorResult &aResult, std::vector< double > &aVarValues)
bool Initialize (WsfSimulation &aSimulation)
void InitializeValues (WsfSimulation &aSimulation, std::vector< double > &aVarValues, const std::vector< double > &aUserInitValues)
void AddVariable (const std::string &aVarLabel)
const std::string & GetLabel (size_t aIndex) const
size_t GetLabelPosition (const std::string &aLabel) const
void RegisterMapPlotVariable (const std::string &aVarName, std::shared_ptr< MapPlotVariable > aVariablePtr)
Public Member Functions inherited from MapPlotVariable::SharedData
void SetCrossRange (double aCrossRange)
 Set accessor for private member data mCrossRange.
void SetDownRange (double aDownRange)
 Set accessor for private member data mDownRange.
void SetRangeScale (double aRangeScale)
 Set accessor for private member data mRangeScale.
double GetCrossRange () const
 Get accessor for private member data mCrossRange.
double GetDownRange () const
 Get accessor for private member data mDownRange.
double GetRangeScale () const
 Get accessor for private member data mRangeScale.

Static Public Member Functions

static bool CheckSucceeded (WsfSensorResult &aResult)

Detailed Description

A class that defines plot variables that are common between horizontal and vertical maps.

The horizontal_map and vertical_map functions have many plot variables in common. Rather than replicated the code, this provides the processing that can be shared.

Member Typedef Documentation

◆ MapPlotVariableMap

using MapPlotVariables::MapPlotVariableMap = std::map<std::string, std::shared_ptr<MapPlotVariable>>

Constructor & Destructor Documentation

◆ MapPlotVariables() [1/2]

MapPlotVariables::MapPlotVariables ( )

References RegisterMapPlotVariable().

Referenced by MapPlotVariables(), and operator=().

◆ MapPlotVariables() [2/2]

MapPlotVariables::MapPlotVariables ( const MapPlotVariables & )
default

References MapPlotVariables().

◆ ~MapPlotVariables()

MapPlotVariables::~MapPlotVariables ( )
default

Member Function Documentation

◆ AddVariable()

void MapPlotVariables::AddVariable ( const std::string & aVarLabel)

Adds a new map plot variable ID to mVarLabels. ID must already be present in mVariableMap.

Parameters
aVarLabelthe ID of the new map plot variable, added to the end of mVarLabels.

Referenced by Initialize(), and ProcessScriptVariableInput().

◆ CheckSucceeded()

bool MapPlotVariables::CheckSucceeded ( WsfSensorResult & aResult)
static

Status checker function.

Parameters
aResultSubject result to be evaluated
Returns
True if aResult reports that its status has been checked & reports a valid status, False otherwise.

References WsfEM_Interaction::mCheckedStatus, and WsfEM_Interaction::mFailedStatus.

◆ Count()

size_t MapPlotVariables::Count ( ) const
inline

Return the number of variables defined.

Returns
The length of the vector of strings mVarLabels

◆ Evaluate()

void MapPlotVariables::Evaluate ( double aSimTime,
WsfSensor * aSensorPtr,
WsfSensorResult & aResult,
std::vector< double > & aVarValues )

Calls the MapPlotVariable::Evaluate in each instance of MapPlotVariable derived classes.

Parameters
aSimTimeCurrent simulation time, internal.
aSensorPtrA pointer to the sensor object undergoing evaluation.
aResultResultant value of previous sensor process.
aVarValuesInitial value for a given evaluation.

◆ GetLabel()

const std::string & MapPlotVariables::GetLabel ( size_t aIndex) const
inline

Get the MapPlotVariable ID (label) at a given index.

Parameters
aIndexIndex of the desired ID.
Returns
The MapPlotVariable ID (label) at the given index.

◆ GetLabelPosition()

size_t MapPlotVariables::GetLabelPosition ( const std::string & aLabel) const

Get the MapPlotVariable Index at a given ID (label)

Parameters
aLabelLabel of the desired index.
Returns
Index of the input label.

◆ Initialize()

bool MapPlotVariables::Initialize ( WsfSimulation & aSimulation)

Initializes member variables in MapPlotVariable derived classes.

Parameters
aSimulationThe currently active simulation.
Returns
True by default, False if failed initialization in a derived class.

References AddVariable(), and ok.

◆ InitializeValues()

void MapPlotVariables::InitializeValues ( WsfSimulation & aSimulation,
std::vector< double > & aVarValues,
const std::vector< double > & aUserInitValues )

Initializes dynamic member values in MapPlotVariable derived classes.

Parameters
aSimulationThe currently active simulation.
aVarValuesA vector containing variable values for each derived class.
aUserInitValuesInitialization values.

◆ operator=()

MapPlotVariables & MapPlotVariables::operator= ( const MapPlotVariables & )
default

References MapPlotVariables().

◆ ProcessInput()

bool MapPlotVariables::ProcessInput ( UtInput & aInput)

Check if UtInput contains a script block type defined by this extension and if so processes the data.

Parameters
aInputCheck and process this block of script.
Returns
True if the script block was processed by this extension, False if the extension ignored the script block.

◆ ProcessScriptVariableInput()

bool MapPlotVariables::ProcessScriptVariableInput ( const std::string & aVarName,
double aVarInitValue )

Add a user defined script variable to the master list (MapPlotVariableMap) and add its name to mVarLabels

Parameters
aVarNameThe name of the script variable.
aVarInitValueThe initial value for the script variable.
Returns
True if the script is added to the list, False otherwise.

References AddVariable(), and RegisterMapPlotVariable().

Referenced by ~MapPlotVariables().

◆ RegisterMapPlotVariable()

void MapPlotVariables::RegisterMapPlotVariable ( const std::string & aVarName,
std::shared_ptr< MapPlotVariable > aVariablePtr )

Registration of new Map Plot Variables.

Parameters
aVarNameThe name of the variable Label
aVariablePtrPointer to MapPlotVariable derived class instance mapped by variable label

Referenced by MapPlotVariables(), and ProcessScriptVariableInput().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved