41 return "WiFiObsLogger";
83 if (j.contains(
"FileWriter"))
105 _filestream <<
"Time [s],GpsCycle,GpsWeek,GpsToW [s],"
108 <<
"DistanceStd [m]\n";
122 if ([[maybe_unused]]
auto* sourcePin =
inputPins[pinIdx].link.getConnectedPin())
124 constexpr int gpsCyclePrecision = 3;
125 constexpr int gpsTimePrecision = 12;
126 constexpr int valuePrecision = 15;
132 auto obs = std::static_pointer_cast<const WiFiObs>(nodeData);
133 if (!obs->insTime.empty())
138 if (!obs->insTime.empty())
140 _filestream << std::fixed << std::setprecision(gpsCyclePrecision) << obs->insTime.toGPSweekTow().gpsCycle;
143 if (!obs->insTime.empty())
145 _filestream << std::defaultfloat << std::setprecision(gpsTimePrecision) << obs->insTime.toGPSweekTow().gpsWeek;
148 if (!obs->insTime.empty())
150 _filestream << std::defaultfloat << std::setprecision(gpsTimePrecision) << obs->insTime.toGPSweekTow().tow;
152 _filestream <<
"," << std::setprecision(valuePrecision);
155 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.
InputPin * CreateInputPin(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.
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.
void ApplyChanges()
Signals that there have been changes to the flow.