 |
helics
3.0.1
|
9 #include "../application_api/Endpoints.hpp"
10 #include "../application_api/Subscriptions.hpp"
11 #include "helicsApp.hpp"
37 explicit Recorder(std::vector<std::string> args);
48 const std::shared_ptr<Core>& core,
60 Recorder(
const std::string& name,
const std::string& jsonString);
68 virtual void runTo(
Time runToTime)
override;
70 void addSubscription(
const std::string& key);
72 void addEndpoint(
const std::string& endpoint);
74 void addSourceEndpointClone(
const std::string& sourceEndpoint);
76 void addDestEndpointClone(
const std::string& destEndpoint);
80 void addCapture(
const std::string& captureDesc);
82 void saveFile(
const std::string& filename);
92 std::tuple<Time, std::string_view, std::string>
getValue(std::size_t index)
const;
97 std::unique_ptr<Message> getMessage(std::size_t index)
const;
103 virtual void loadJsonFile(
const std::string& jsonString)
override;
105 virtual void loadTextFile(
const std::string& textFile)
override;
107 void writeJsonFile(
const std::string& filename);
109 void writeTextFile(
const std::string& filename);
111 virtual void initialize()
override;
112 void generateInterfaces();
113 void captureForCurrentTime(
Time currentTime,
int iteration = 0);
114 void loadCaptureInterfaces();
117 std::shared_ptr<helicsCLI11App> buildArgParserApp();
127 int16_t iteration{0};
132 time(t1), index(id1), value(val)
146 bool allow_iteration{
false};
150 std::unique_ptr<CloningFilter>
cFilt;
157 std::map<helics::InterfaceHandle, int>
subids;
159 std::map<helics::InterfaceHandle, int> eptids;
164 std::string outFileName{
"out.txt"};
constexpr Time timeZero
Definition: helicsTime.hpp:31
void saveFile(const std::string &filename)
Definition: Recorder.cpp:587
std::unique_ptr< Message > getMessage(std::size_t index) const
Definition: Recorder.cpp:578
std::vector< Input > subscriptions
the actual subscription objects
Definition: Recorder.hpp:152
@ HELICS_SEQUENCING_MODE_ORDERED
Definition: helics_enums.h:367
virtual void runTo(Time runToTime) override
Definition: Recorder.cpp:456
auto pointCount() const
Definition: Recorder.hpp:84
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27
std::string outFileName
the final output file
Definition: Recorder.hpp:164
std::tuple< Time, std::string_view, std::string > getValue(std::size_t index) const
Definition: Recorder.cpp:570
void addSourceEndpointClone(const std::string &sourceEndpoint)
Definition: Recorder.cpp:545
@ HELICS_FLAG_OBSERVER
Definition: helics_enums.h:99
std::vector< ValueCapture > points
lists of points that were captured
Definition: Recorder.hpp:151
std::string masterFileName
the name of the master file used to do the construction
Definition: helicsApp.hpp:129
void loadJsonFileConfiguration(const std::string &appName, const std::string &jsonString)
Definition: helicsApp.cpp:159
std::unique_ptr< Endpoint > cloneEndpoint
the endpoint for cloned message delivery
Definition: Recorder.hpp:155
std::string mapfile
file name for the on-line file updater
Definition: Recorder.hpp:163
auto messageCount() const
Definition: Recorder.hpp:86
std::map< helics::InterfaceHandle, int > subids
map of the subscription ids
Definition: Recorder.hpp:157
std::vector< ValueStats > vStat
storage for statistics capture
Definition: Recorder.hpp:161
std::vector< std::string > captureInterfaces
storage for the interfaces to capture
Definition: Recorder.hpp:162
Definition: FederateInfo.hpp:20
Time nextPrintTimeStep
the time advancement period for printing markers
Definition: Recorder.hpp:148
std::vector< std::unique_ptr< Message > > messages
list of messages
Definition: Recorder.hpp:156
@ ITERATE_IF_NEEDED
indicator that the iterations need to continue
Definition: Recorder.hpp:123
std::vector< Endpoint > endpoints
the actual endpoint objects
Definition: Recorder.hpp:154
Recorder(const std::string &name, FederateInfo &fi)
Definition: Recorder.cpp:43
void addEndpoint(const std::string &endpoint)
Definition: Recorder.cpp:533
std::vector< std::string > targets
specified targets for the subscriptions
Definition: Recorder.hpp:153
void addCapture(const std::string &captureDesc)
Definition: Recorder.cpp:565
void addSubscription(const std::string &key)
Definition: Recorder.cpp:520
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
void addDestEndpointClone(const std::string &destEndpoint)
Definition: Recorder.cpp:555
bool verbose
print all captured values to the screen
Definition: Recorder.hpp:147
std::shared_ptr< CombinationFederate > fed
the federate created for the Player
Definition: helicsApp.hpp:127
Definition: Recorder.hpp:138
std::unique_ptr< CloningFilter > cFilt
a pointer to a clone filter
Definition: Recorder.hpp:150
X getValue(ValueFederate &fed, const std::string &key)
Definition: Subscriptions.hpp:30
Definition: helicsApp.hpp:28
std::vector< std::string > vectorizeQueryResult(std::string &&queryres)
Definition: queryFunctions.cpp:19
bool waitForInit(helics::Federate *fed, const std::string &fedName, std::chrono::milliseconds timeout)
Definition: queryFunctions.cpp:136
std::map< std::string, int > subkeys
translate subscription names to an index
Definition: Recorder.hpp:158
void loadFile(const std::string &filename)
Definition: helicsApp.cpp:124
Definition: Recorder.hpp:26
~Recorder()
Definition: Recorder.cpp:94
bool allow_iteration
trigger to allow Iteration
Definition: Recorder.hpp:146
std::map< std::string, int > eptNames
translate endpoint name to index
Definition: Recorder.hpp:160
bool isValidIndex(sizeType testSize, const SizedDataType &vec)
Definition: core-data.hpp:132