 |
helics
2.8.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, std::string>
getValue(
int index)
const;
97 std::unique_ptr<Message> getMessage(
int 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;
156 std::map<helics::interface_handle, int>
subids;
158 std::map<helics::interface_handle, int> eptids;
163 std::string outFileName{
"out.txt"};
constexpr Time timeZero
Definition: helics-time.hpp:31
void saveFile(const std::string &filename)
Definition: Recorder.cpp:587
std::vector< Input > subscriptions
the actual subscription objects
Definition: Recorder.hpp:152
virtual void runTo(Time runToTime) override
Definition: Recorder.cpp:455
auto pointCount() const
Definition: Recorder.hpp:84
TimeRepresentation< count_time< 9 > > Time
Definition: helics-time.hpp:27
std::string outFileName
the final output file
Definition: Recorder.hpp:163
@ helics_sequencing_mode_ordered
Definition: helics_enums.h:337
void addSourceEndpointClone(const std::string &sourceEndpoint)
Definition: Recorder.cpp:543
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
std::map< helics::interface_handle, int > subids
map of the subscription ids
Definition: Recorder.hpp:156
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:154
std::string mapfile
file name for the on-line file updater
Definition: Recorder.hpp:162
auto messageCount() const
Definition: Recorder.hpp:86
@ iterate_if_needed
indicator that the iterations need to continue
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: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:155
Json::Value loadJson(const std::string &jsonString)
Definition: JsonProcessingFunctions.cpp:24
@ startup
when created the federate is in startup state
Definition: Recorder.hpp:123
std::vector< Endpoint > endpoints
the actual endpoint objects
Definition: Recorder.hpp:153
Recorder(const std::string &name, FederateInfo &fi)
Definition: Recorder.cpp:44
void addEndpoint(const std::string &endpoint)
Definition: Recorder.cpp:531
void addCapture(const std::string &captureDesc)
Definition: Recorder.cpp:563
void addSubscription(const std::string &key)
Definition: Recorder.cpp:519
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
std::unique_ptr< Message > getMessage(int index) const
Definition: Recorder.cpp:578
void addDestEndpointClone(const std::string &destEndpoint)
Definition: Recorder.cpp:553
bool verbose
print all captured values to the screen
Definition: Recorder.hpp:147
std::tuple< Time, std::string, std::string > getValue(int index) const
Definition: Recorder.cpp:568
@ helics_flag_observer
Definition: helics_enums.h:86
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:67
Definition: helicsApp.hpp:28
std::vector< std::string > vectorizeQueryResult(std::string &&queryres)
Definition: queryFunctions.cpp:17
bool waitForInit(helics::Federate *fed, const std::string &fedName, std::chrono::milliseconds timeout)
Definition: queryFunctions.cpp:90
std::map< std::string, int > subkeys
translate subscription names to an index
Definition: Recorder.hpp:157
void loadFile(const std::string &filename)
Definition: helicsApp.cpp:124
Definition: Recorder.hpp:26
~Recorder()
Definition: Recorder.cpp:92
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:159
bool isValidIndex(sizeType testSize, const SizedDataType &vec)
Definition: core-data.hpp:249