56 return "Data Provider";
61 if (ImGui::InputTextWithHint(
"SensorPort",
"/dev/ttyUSB0", &
_sensorPort))
69 "- \"COM1\" (Windows format for physical and virtual (USB) serial port)\n"
70 "- \"/dev/ttyS1\" (Linux format for physical serial port)\n"
71 "- \"/dev/ttyUSB0\" (Linux format for virtual (USB) serial port)\n"
72 "- \"/dev/tty.usbserial-FTXXXXXX\" (Mac OS X format for virtual (USB) serial port)\n"
73 "- \"/dev/ttyS0\" (CYGWIN format. Usually the Windows COM port number minus 1. This would connect to COM1)");
94 if (j.contains(
"UartSensor"))
98 if (j.contains(
"Imu"))
144 _sensor->unregisterAsyncPacketReceivedHandler();
154 auto* kvhSensor =
static_cast<KvhSensor*
>(userData);
156 if (p.type() == uart::protocol::Packet::Type::TYPE_BINARY)
158 auto obs = std::make_shared<KvhObs>(kvhSensor->_imuPos, p);
163 kvhSensor->name, obs->sequenceNumber, obs->temperature.value(), fmt::streamed(obs->status));
166 if (kvhSensor->_prevSequenceNumber == UINT8_MAX)
168 kvhSensor->_prevSequenceNumber = obs->sequenceNumber;
170 if (obs->sequenceNumber != 0 && (obs->sequenceNumber < kvhSensor->_prevSequenceNumber || obs->sequenceNumber > kvhSensor->_prevSequenceNumber + 2))
172 LOG_WARN(
"{}: Sequence Number changed from {} to {}", kvhSensor->name, kvhSensor->_prevSequenceNumber, obs->sequenceNumber);
174 kvhSensor->_prevSequenceNumber = obs->sequenceNumber;
177 if (
InsTime currentTime = util::time::GetCurrentInsTime();
178 !currentTime.
empty())
180 obs->insTime = currentTime;
184 else if (p.type() == uart::protocol::Packet::Type::TYPE_ASCII)
186 LOG_WARN(
"{}: Received an ASCII Async message: {}", kvhSensor->name, p.datastr());
nlohmann::json json
json namespace
Text Help Marker (?) with Tooltip.
Data storage class for one KVH Imu observation.
Helper Functions to work with Kvh Sensors.
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_DATA
All output which occurs repeatedly every time observations are received.
#define LOG_ERROR
Error occurred, which stops part of the program to work, but not everything.
#define LOG_WARN
Error occurred, but a fallback option exists and program continues to work normally.
#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.
json save() const override
Saves the node into a json object.
void restore(const json &j) override
Restores the node from a json object.
void guiConfig() override
ImGui config window which is shown on double click.
Imu(const Imu &)=delete
Copy constructor.
The class is responsible for all time-related tasks.
constexpr bool empty() const
Checks if the Time object has a value.
static std::string type()
Returns the type of the data class.
bool initialize() override
Initialize the node.
void deinitialize() override
Deinitialize 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 restore(const json &j) override
Restores the node from a json object.
KvhSensor()
Default constructor.
json save() const override
Saves the node into a json object.
std::string type() const override
String representation of the Class Type.
vendor::kvh::KvhUartSensor _sensor
Sensor Object.
static std::string typeStatic()
String representation of the Class Type.
static constexpr size_t OUTPUT_PORT_INDEX_KVH_OBS
Flow (KvhObs)
bool resetNode() override
Resets the node. It is guaranteed that the node is initialized when this is called.
static void asciiOrBinaryAsyncMessageReceived(void *userData, uart::protocol::Packet &p, size_t index)
Callback handler for notifications of new asynchronous data packets received.
~KvhSensor() override
Destructor.
bool isInitialized() const
Checks if the node is initialized.
bool doDeinitialize(bool wait=false)
Asks the node worker to deinitialize the node.
ImVec2 _guiConfigDefaultWindowSize
std::string nameId() const
Node name and id.
std::string name
Name of the Node.
bool _onlyRealTime
Whether the node can run in post-processing or only real-time.
bool _hasConfig
Flag if the config window should be shown.
static int baudrate2Selection(Baudrate baud)
Returns the guiSelection for the given baudrate.
int _selectedBaudrate
Baudrate for the sensor.
@ BAUDRATE_921600
Baudrate with 921600 symbols per second [Baud].
void restore(const json &j)
Restores the node from a json object.
Baudrate sensorBaudrate() const
Returns the Baudrate for the element Selected by the GUI.
json save() const
Saves the node into a json object.
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 decryptKvhObs(const std::shared_ptr< NAV::KvhObs > &obs)
Decrypts the provided Kvh observation.