WSF
WsfAccessReport.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 2017 Infoscitex, a DCS 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 WSFACCESSREPORT_HPP
13#define WSFACCESSREPORT_HPP
14
15#include "wsf_space_export.h"
16
17#include <list>
18#include <map>
19#include <string>
20
21#include "UtCalendar.hpp"
22#include "UtCallbackHolder.hpp"
23class WsfPlatform;
26#include "WsfStringId.hpp"
27
28class UtInput;
29class WsfDateTime;
30class WsfSensor;
31class WsfSensorResult;
32class WsfSimuluation;
33
37{
38public:
40
42 {
44 double mStart;
45 double mEnd;
46 double mDuration;
47 };
48
49 using DetectionIntervalList = std::list<DetectionInterval>;
50
52 {
53 DetectorDetecteeKey(const std::string& aDetector, const std::string& aDetectee, const std::string& aSensorName);
54
58
59 bool operator<(const DetectorDetecteeKey& aRhs) const;
60 };
61
62 using DetectorDetecteeMap = std::map<DetectorDetecteeKey, DetectionIntervalList>;
63 using KeyInputs = std::list<DetectorDetecteeKey>;
64
67 std::string mDefaultSensor;
68 std::string mFileName;
69 std::string mFormat;
70};
71
76class WSF_SPACE_EXPORT WsfAccessReport : public WsfSimulationExtension, protected WsfAccessReportData
77{
78public:
79 explicit WsfAccessReport(const WsfAccessReportData& aData);
80
81 bool Initialize() override;
82
83protected:
84 void SensorDetectionChangedHandler(double aSimTime, WsfSensor* aSensorPtr, size_t aTargetIndex, WsfSensorResult& aResult);
85 void SimulationCompleteHandler(double aSimTime);
86
87private:
88 std::string FormatDateTime(const double& aSimTime);
89
90 UtCallbackHolder mCallbacks;
91 UtCalendar mSimulationCalendar;
92};
93
96{
97public:
98 bool Complete() override;
99 bool ProcessInput(UtInput& aInput) override;
100 void SimulationCreated(WsfSimulation& aSimulation) override;
101
102private:
103 void AddDefaultSensor(WsfPlatform& aPlatform);
104};
105#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
std::string mFileName
Definition WsfAccessReport.hpp:68
std::string mFormat
Definition WsfAccessReport.hpp:69
std::list< DetectionInterval > DetectionIntervalList
Definition WsfAccessReport.hpp:49
WsfAccessReportData()
Definition WsfAccessReport.cpp:37
std::map< DetectorDetecteeKey, DetectionIntervalList > DetectorDetecteeMap
Definition WsfAccessReport.hpp:62
KeyInputs mKeyInputs
Definition WsfAccessReport.hpp:65
std::list< DetectorDetecteeKey > KeyInputs
Definition WsfAccessReport.hpp:63
DetectorDetecteeMap mDetectorDetecteeMap
Definition WsfAccessReport.hpp:66
std::string mDefaultSensor
Definition WsfAccessReport.hpp:67
WsfAccessReport(const WsfAccessReportData &aData)
Definition WsfAccessReport.cpp:42
void SimulationCompleteHandler(double aSimTime)
Use the SimulationCompleted callaback to write detection inteval output to the specified file.
Definition WsfAccessReport.cpp:308
void SensorDetectionChangedHandler(double aSimTime, WsfSensor *aSensorPtr, size_t aTargetIndex, WsfSensorResult &aResult)
Use the SensorDetectionChanged callback to store detection interval results.
Definition WsfAccessReport.cpp:272
The scenario extension used to configure the access reports object.
Definition WsfAccessReport.hpp:96
bool ProcessInput(UtInput &aInput) override
Definition WsfAccessReport.cpp:48
bool Complete() override
Definition WsfAccessReport.cpp:138
void SimulationCreated(WsfSimulation &aSimulation) override
Definition WsfAccessReport.cpp:441
A singleton object used to maintain the start date and time of the simulation.
Definition WsfDateTime.hpp:34
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
WsfScenarioExtension()
Definition WsfScenarioExtension.cpp:21
Definition WsfSensorResult.hpp:27
Definition WsfSensor.hpp:92
WsfSimulationExtension()
Definition WsfSimulationExtension.cpp:23
virtual bool Initialize()
Definition WsfSimulationExtension.cpp:49
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfAccessReport.hpp:42
double mStart
Definition WsfAccessReport.hpp:44
bool mComplete
Definition WsfAccessReport.hpp:43
double mDuration
Definition WsfAccessReport.hpp:46
double mEnd
Definition WsfAccessReport.hpp:45
bool operator<(const DetectorDetecteeKey &aRhs) const
Definition WsfAccessReport.cpp:425
WsfStringId mDetector
Definition WsfAccessReport.hpp:55
DetectorDetecteeKey(const std::string &aDetector, const std::string &aDetectee, const std::string &aSensorName)
Definition WsfAccessReport.cpp:416
WsfStringId mSensorName
Definition WsfAccessReport.hpp:57
WsfStringId mDetectee
Definition WsfAccessReport.hpp:56
Copyrights Multiple, All Rights Reserved