WSF
MapPlotVariables.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef MAPVARIABLES_HPP
13#define MAPVARIABLES_HPP
14
15#include "sensor_plot_lib_export.h"
16
17#include <map>
18#include <memory>
19#include <string>
20#include <vector>
21
22class UtInput;
23
24#include "MapPlotVariable.hpp"
25class WsfSensor;
26class WsfSensorResult;
27class WsfSimulation;
28
33class SENSOR_PLOT_LIB_EXPORT MapPlotVariables : public MapPlotVariable::SharedData
34{
35public:
36 using MapPlotVariableMap = std::map<std::string, std::shared_ptr<MapPlotVariable>>;
37
41 ~MapPlotVariables() = default;
42
48 bool ProcessInput(UtInput& aInput);
49
55 bool ProcessScriptVariableInput(const std::string& aVarName, double aVarInitValue);
56
60 size_t Count() const { return mVarLabels.size(); }
61
68 void Evaluate(double aSimTime, WsfSensor* aSensorPtr, WsfSensorResult& aResult, std::vector<double>& aVarValues);
69
74 bool Initialize(WsfSimulation& aSimulation);
75
81 void InitializeValues(WsfSimulation& aSimulation,
82 std::vector<double>& aVarValues,
83 const std::vector<double>& aUserInitValues);
84
88 void AddVariable(const std::string& aVarLabel);
89
94 const std::string& GetLabel(size_t aIndex) const { return mVarLabels.at(aIndex); }
95
100 size_t GetLabelPosition(const std::string& aLabel) const;
101
106 static bool CheckSucceeded(WsfSensorResult& aResult);
107
112 void RegisterMapPlotVariable(const std::string& aVarName, std::shared_ptr<MapPlotVariable> aVariablePtr);
113
114private:
115 WsfSimulation* mSimulationPtr{nullptr};
116 std::vector<std::string> mVarLabels;
117 MapPlotVariableMap mVariableMap;
118};
119
120#endif
Definition MapPlotVariable.hpp:36
virtual bool ProcessInput(UtInput &aInput)
Definition MapPlotVariable.hpp:72
virtual bool Initialize(WsfSimulation &aSimulation, const SharedData &aSharedData)
Definition MapPlotVariable.hpp:79
virtual double Evaluate(double aSimTime, WsfSimulation *aSimulationPtr, double aValue, WsfSensor *aSensorPtr, WsfSensorResult &aResult) const =0
~MapPlotVariables()=default
std::map< std::string, std::shared_ptr< MapPlotVariable > > MapPlotVariableMap
Definition MapPlotVariables.hpp:36
MapPlotVariables()
Definition MapPlotVariables.cpp:2249
MapPlotVariables & operator=(const MapPlotVariables &)=default
size_t Count() const
Definition MapPlotVariables.hpp:60
bool ProcessScriptVariableInput(const std::string &aVarName, double aVarInitValue)
Definition MapPlotVariables.cpp:2348
MapPlotVariables(const MapPlotVariables &)=default
const std::string & GetLabel(size_t aIndex) const
Definition MapPlotVariables.hpp:94
Definition WsfSensorResult.hpp:27
Definition WsfSensor.hpp:92
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Copyrights Multiple, All Rights Reserved