43 return "WiFiObsLogger";
85 if (j.contains(
"FileWriter"))
107 _filestream <<
"Time [s],GpsCycle,GpsWeek,GpsToW [s],"
110 <<
"DistanceStd [m]\n";
124 if ([[maybe_unused]]
auto* sourcePin =
inputPins[pinIdx].link.getConnectedPin())
126 constexpr int gpsCyclePrecision = 3;
127 constexpr int gpsTimePrecision = 12;
128 constexpr int valuePrecision = 15;
134 auto obs = std::static_pointer_cast<const WiFiObs>(nodeData);
135 if (!obs->insTime.empty())
140 if (!obs->insTime.empty())
142 _filestream << std::fixed << std::setprecision(gpsCyclePrecision) << obs->insTime.toGPSweekTow().gpsCycle;
145 if (!obs->insTime.empty())
147 _filestream << std::defaultfloat << std::setprecision(gpsTimePrecision) << obs->insTime.toGPSweekTow().gpsWeek;
150 if (!obs->insTime.empty())
152 _filestream << std::defaultfloat << std::setprecision(gpsTimePrecision) << obs->insTime.toGPSweekTow().tow;
154 _filestream <<
"," << std::setprecision(valuePrecision);
157 if (!obs->macAddress.empty())
nlohmann::json json
json namespace
Utility class for logging to console and file.
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
Data Logger for WiFi observations.
Espressif Observation Class.
static bool ShowOriginInput(const char *id)
Shows a GUI to input a origin location.
void initialize() const
Initialize the common log variables.
static double calcTimeIntoRun(const InsTime &insTime)
Calculates the relative time into he run.
FileType _fileType
File Type.
void deinitialize()
Deinitialize the file reader.
bool guiConfig(const char *vFilters, const std::vector< std::string > &extensions, size_t id, const std::string &nameId)
ImGui config.
void restore(const json &j)
Restores the node from a json object.
json save() const
Saves the node into a json object.
bool initialize()
Initialize the file reader.
std::ofstream _filestream
File stream to write the file.
bool doDeinitialize(bool wait=false)
Asks the node worker to deinitialize the node.
ImVec2 _guiConfigDefaultWindowSize
Node(std::string name)
Constructor.
std::vector< InputPin > inputPins
List of input pins.
std::string nameId() const
Node name and id.
std::string name
Name of the Node.
bool _hasConfig
Flag if the config window should be shown.
auto extract_front()
Returns a copy of the first element in the container and removes it from the container.
bool initialize() override
Initialize the node.
void guiConfig() override
ImGui config window which is shown on double click.
static std::string category()
String representation of the Class Category.
void deinitialize() override
Deinitialize the node.
static std::string typeStatic()
String representation of the Class Type.
void restore(const json &j) override
Restores the node from a json object.
std::string type() const override
String representation of the Class Type.
void writeObservation(InputPin::NodeDataQueue &queue, size_t pinIdx)
Write Observation to the file.
~WiFiObsLogger() override
Destructor.
WiFiObsLogger()
Default constructor.
void flush() override
Function called by the flow executer after finishing to flush out remaining data.
json save() const override
Saves the node into a json object.
static std::string type()
Returns the type of the data class.
InputPin * CreateInputPin(Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, InputPin::Callback callback=static_cast< InputPin::FlowFirableCallbackFunc >(nullptr), InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1)
Create an Input Pin object.
void ApplyChanges()
Signals that there have been changes to the flow.