WSF
WsfCSV_EventOutput.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 2016 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// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFCSV_EVENTOUTPUT_HPP
16#define WSFCSV_EVENTOUTPUT_HPP
17
18#include "wsf_export.h"
19
21
23{
25
26 bool ProcessInput(UtInput& aInput) override;
27
28 static void AddDataTags(const std::string& aEventName, const std::vector<std::string>& aDataTags);
29 static void AppendDataTags(std::vector<std::string>& aLHS, const std::vector<std::string>& aRHS);
30
31 // Header information
32 bool mInsertDataTags{true};
33 std::string mLocationDataStr{"lat<lat>, lon<lon>, alt<double>"};
34
35 static std::mutex sCriticalSection;
36
37 static std::map<std::string, std::vector<std::string>> mDataTags;
38 static const std::vector<std::string> mEM_InteractionTags;
39 static const std::vector<std::string> mMessageDataTags;
40 static const std::vector<std::string> mTrackDataBriefTags;
41 static const std::vector<std::string> mTrackDataTags;
42};
43
44//! A simulation observer to write a comma separated values (csv) event output file.
46{
47public:
48 static WsfCSV_EventOutput* Find(const WsfSimulation& aSimulation);
49
51 : wsf::event::output::SimulationExtension(mCSV_Data)
52 , mCSV_Data(std::move(aData))
53 {
54 }
55
56 const std::string& GetLocationDataStr() const { return mCSV_Data.mLocationDataStr; }
57
58private:
59 void EnableOrDisableEventP(const std::string& aEventName, bool aEnable) override;
60
61 void WriteHeader(const std::string& aEventName);
62
63 void PrintEvent(const wsf::event::Result& aResult) const override;
64
66};
67
68#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
const std::string & GetLocationDataStr() const
Definition WsfCSV_EventOutput.hpp:56
static WsfCSV_EventOutput * Find(const WsfSimulation &aSimulation)
Definition WsfCSV_EventOutput.cpp:263
WsfCSV_EventOutput(WsfCSV_EventOutputData aData)
Definition WsfCSV_EventOutput.hpp:50
friend class WsfSimulation
Definition WsfSimulationExtension.hpp:43
Definition WsfEventResult.hpp:117
A simulation extension that serves as an abstract base class for observers which write an event outpu...
Definition WsfEventOutputBase.hpp:48
SimulationExtension(Data &aData)
Definition WsfEventOutputBase.hpp:50
Template specialization for wsf::comm::Address. Allows usage of Address in std::unordered_map/set.
Definition WsfCommAddress.hpp:185
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Definition WsfCSV_EventOutput.hpp:23
static void AppendDataTags(std::vector< std::string > &aLHS, const std::vector< std::string > &aRHS)
Definition WsfCSV_EventOutput.cpp:39
static const std::vector< std::string > mTrackDataTags
Definition WsfCSV_EventOutput.hpp:74
static const std::vector< std::string > mMessageDataTags
Definition WsfCSV_EventOutput.hpp:44
WsfCSV_EventOutputData()
Definition WsfCSV_EventOutput.cpp:302
static const std::vector< std::string > mEM_InteractionTags
Definition WsfCSV_EventOutput.hpp:134
static std::map< std::string, std::vector< std::string > > mDataTags
Definition WsfCSV_EventOutput.hpp:37
static void AddDataTags(const std::string &aEventName, const std::vector< std::string > &aDataTags)
Definition WsfCSV_EventOutput.cpp:32
static const std::vector< std::string > mTrackDataBriefTags
Definition WsfCSV_EventOutput.hpp:65
bool mInsertDataTags
Definition WsfCSV_EventOutput.hpp:32
static std::mutex sCriticalSection
Definition WsfCSV_EventOutput.hpp:35
std::string mLocationDataStr
Definition WsfCSV_EventOutput.hpp:33
Definition WsfEventOutputBase.hpp:36
virtual bool ProcessInput(UtInput &aInput)
Definition WsfEventOutputBase.cpp:38
Copyrights Multiple, All Rights Reserved