50 return "Data Provider";
85 if (j.contains(
"FileReader"))
115 std::unique_ptr<uart::protocol::Packet> packet =
nullptr;
116 while (!
eof() &&
read(
reinterpret_cast<char*
>(&i), 1))
118 packet =
_sensor.findPacket(i);
120 if (packet !=
nullptr)
132 if (packet->getRawDataLength() == 0)
137 auto obs = std::make_shared<EmlidObs>();
140 if (obs->insTime.empty())
142 if (
auto currentTime = util::time::GetCurrentInsTime();
143 !currentTime.empty())
145 obs->insTime = currentTime;
159 constexpr uint16_t BUFFER_SIZE = 10;
161 std::array<char, BUFFER_SIZE> buffer{};
162 if (filestream.good())
164 filestream.read(buffer.data(), BUFFER_SIZE);
File Reader for Emlid log files.
Helper Functions to work with Emlid Sensors.
nlohmann::json json
json namespace
Utility class for logging to console and file.
#define LOG_DEBUG
Debug information. Should not be called on functions which receive observations (spamming)
#define LOG_ERROR
Error occurred, which stops part of the program to work, but not everything.
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
Keeps track of the current real/simulation time.
EmlidFile()
Default constructor.
bool resetNode() override
Resets the node. Moves the read cursor to the start.
void deinitialize() override
Deinitialize the node.
bool initialize() override
Initialize the node.
static std::string typeStatic()
String representation of the Class Type.
~EmlidFile() override
Destructor.
static constexpr size_t OUTPUT_PORT_INDEX_EMLID_OBS
Flow (EmlidObs)
void guiConfig() override
ImGui config window which is shown on double click.
FileType determineFileType() override
Determines the type of the file.
std::shared_ptr< const NodeData > pollData()
Polls data from the file.
vendor::emlid::EmlidUartSensor _sensor
Sensor Object.
void restore(const json &j) override
Restores the node from a json object.
json save() const override
Saves the node into a json object.
std::string type() const override
String representation of the Class Type.
static std::string category()
String representation of the Class Category.
static std::string type()
Returns the type of the data class.
bool initialize()
Initialize the file reader.
void restore(const json &j)
Restores the node from a json object.
std::string _path
Path to the file.
FileType
File Type Enumeration.
auto eof() const
Check whether the end of file is reached.
auto & read(char *__s, std::streamsize __n)
Extraction without delimiters.
std::filesystem::path getFilepath()
Returns the path of the file.
@ PATH_CHANGED
The path changed and exists.
GuiResult guiConfig(const char *vFilters, const std::vector< std::string > &extensions, size_t id, const std::string &nameId)
ImGui config.
void resetReader()
Moves the read cursor to the start.
json save() const
Saves the node into a json object.
void deinitialize()
Deinitialize the file reader.
bool doDeinitialize(bool wait=false)
Asks the node worker to deinitialize the node.
ImVec2 _guiConfigDefaultWindowSize
Node(std::string name)
Constructor.
std::string nameId() const
Node name and id.
std::string name
Name of the Node.
bool doReinitialize(bool wait=false)
Asks the node worker to reinitialize the node.
void invokeCallbacks(size_t portIndex, const std::shared_ptr< const NodeData > &data)
Calls all registered callbacks on the specified output port.
bool _hasConfig
Flag if the config window should be shown.
static constexpr uint8_t BINARY_SYNC_CHAR_2
E - Second sync character which begins a new binary message.
static constexpr uint8_t ASCII_START_CHAR
Ascii character which begins a new ascii message.
static constexpr uint8_t BINARY_SYNC_CHAR_1
R - First sync character which begins a new binary message.
OutputPin * CreateOutputPin(Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, OutputPin::PinData data=static_cast< void * >(nullptr), int idx=-1)
Create an Output Pin object.
void ApplyChanges()
Signals that there have been changes to the flow.
void decryptEmlidObs(const std::shared_ptr< NAV::EmlidObs > &obs, uart::protocol::Packet &packet)
Decrypts the provided Emlid observation.