 |
helics
3.3.0
|
9 #include "../application_api/Endpoints.hpp"
10 #include "../application_api/Subscriptions.hpp"
11 #include "helicsApp.hpp"
38 explicit Recorder(std::vector<std::string> args);
59 Recorder(std::string_view name,
const std::string& jsonString);
67 virtual void runTo(
Time runToTime)
override;
69 void addSubscription(std::string_view key);
71 void addEndpoint(std::string_view endpoint);
73 void addSourceEndpointClone(std::string_view sourceEndpoint);
75 void addDestEndpointClone(std::string_view destEndpoint);
79 void addCapture(std::string_view captureDesc);
81 void saveFile(
const std::string& filename);
91 std::tuple<Time, std::string_view, std::string>
getValue(std::size_t index)
const;
96 std::unique_ptr<Message> getMessage(std::size_t index)
const;
102 virtual void loadJsonFile(
const std::string& jsonString)
override;
104 virtual void loadTextFile(
const std::string& textFile)
override;
106 void writeJsonFile(
const std::string& filename);
108 void writeTextFile(
const std::string& filename);
110 virtual void initialize()
override;
111 void generateInterfaces();
112 void captureForCurrentTime(
Time currentTime,
int iteration = 0);
113 void loadCaptureInterfaces();
116 std::shared_ptr<helicsCLI11App> buildArgParserApp();
126 int16_t iteration{0};
131 time(t1), index(id1), value(val)
145 bool allow_iteration{
false};
149 std::unique_ptr<CloningFilter>
cFilt;
156 std::map<helics::InterfaceHandle, int>
subids;
158 std::map<helics::InterfaceHandle, int> eptids;
163 std::string outFileName{
"out.txt"};
constexpr Time timeZero
Definition: helicsTime.hpp:31
void addSourceEndpointClone(std::string_view sourceEndpoint)
Definition: Recorder.cpp:545
void saveFile(const std::string &filename)
Definition: Recorder.cpp:587
std::unique_ptr< Message > getMessage(std::size_t index) const
Definition: Recorder.cpp:578
@ HELICS_SEQUENCING_MODE_ORDERED
Definition: helics_enums.h:399
std::map< std::string_view, int > eptNames
translate endpoint name to index
Definition: Recorder.hpp:159
virtual void runTo(Time runToTime) override
Definition: Recorder.cpp:456
void addEndpoint(std::string_view endpoint)
Definition: Recorder.cpp:533
auto pointCount() const
Definition: Recorder.hpp:83
X getValue(ValueFederate &fed, std::string_view key)
Definition: Subscriptions.hpp:31
std::map< std::string_view, int > subkeys
translate subscription names to an index
Definition: Recorder.hpp:157
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27
std::string outFileName
the final output file
Definition: Recorder.hpp:163
std::tuple< Time, std::string_view, std::string > getValue(std::size_t index) const
Definition: Recorder.cpp:570
std::vector< std::string > vectorizeQueryResult(std::string_view queryres)
Definition: queryFunctions.cpp:19
@ HELICS_FLAG_OBSERVER
Definition: helics_enums.h:101
std::vector< ValueCapture > points
lists of points that were captured
Definition: Recorder.hpp:150
std::string masterFileName
the name of the master file used to do the construction
Definition: helicsApp.hpp:132
void loadJsonFileConfiguration(const std::string &appName, const std::string &jsonString)
Definition: helicsApp.cpp:158
void addSubscription(std::string_view key)
Definition: Recorder.cpp:520
std::unique_ptr< Endpoint > cloneEndpoint
the endpoint for cloned message delivery
Definition: Recorder.hpp:154
std::string mapfile
file name for the on-line file updater
Definition: Recorder.hpp:162
auto messageCount() const
Definition: Recorder.hpp:85
std::map< helics::InterfaceHandle, int > subids
map of the subscription ids
Definition: Recorder.hpp:156
std::vector< ValueStats > vStat
storage for statistics capture
Definition: Recorder.hpp:160
std::vector< std::string > captureInterfaces
storage for the interfaces to capture
Definition: Recorder.hpp:161
Definition: FederateInfo.hpp:24
Time nextPrintTimeStep
the time advancement period for printing markers
Definition: Recorder.hpp:147
std::deque< Endpoint > endpoints
the actual endpoint objects
Definition: Recorder.hpp:153
std::vector< std::unique_ptr< Message > > messages
list of messages
Definition: Recorder.hpp:155
void addDestEndpointClone(std::string_view destEndpoint)
Definition: Recorder.cpp:555
@ ITERATE_IF_NEEDED
indicator that the iterations need to continue
Definition: Recorder.hpp:122
bool waitForInit(helics::Federate *fed, std::string_view fedName, std::chrono::milliseconds timeout)
Definition: queryFunctions.cpp:101
std::vector< std::string > targets
specified targets for the subscriptions
Definition: Recorder.hpp:152
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
Recorder(std::string_view name, FederateInfo &fi)
Definition: Recorder.cpp:43
bool verbose
print all captured values to the screen
Definition: Recorder.hpp:146
std::shared_ptr< CombinationFederate > fed
the federate created for the Player
Definition: helicsApp.hpp:130
Definition: Recorder.hpp:137
std::unique_ptr< CloningFilter > cFilt
a pointer to a clone filter
Definition: Recorder.hpp:149
void addCapture(std::string_view captureDesc)
Definition: Recorder.cpp:565
Definition: helicsApp.hpp:29
void loadFile(const std::string &filename)
Definition: helicsApp.cpp:123
Definition: Recorder.hpp:27
std::deque< Input > subscriptions
the actual subscription objects
Definition: Recorder.hpp:151
~Recorder()
Definition: Recorder.cpp:94
bool allow_iteration
trigger to allow Iteration
Definition: Recorder.hpp:145
bool isValidIndex(sizeType testSize, const SizedDataType &vec)
Definition: core-data.hpp:171