51 return "SinglePointPositioning - SPP";
61 return "Data Processor";
66 auto nSatColumnContent = [&](
size_t pinIndex) ->
bool {
69 size_t usedSatNum = 0;
73 std::string filler =
", ";
74 for (
const auto& satellite : gnssNavInfo->v->satellites())
76 if (
_algorithm._obsFilter.isSatelliteAllowed(satellite.first))
79 usedSats += (allSats.empty() ?
"" : filler) + fmt::format(
"{}", satellite.first);
81 allSats += (allSats.empty() ?
"" : filler) + fmt::format(
"{}", satellite.first);
83 ImGui::TextUnformatted(fmt::format(
"{} / {}", usedSatNum, gnssNavInfo->v->nSatellites()).c_str());
84 if (ImGui::IsItemHovered())
86 ImGui::SetTooltip(
"Used satellites: %s\n"
87 "Avail satellites: %s",
88 usedSats.c_str(), allSats.c_str());
106 if (_algorithm.ShowGuiWidgets(nameId().c_str(), itemWidth, unitWidth))
127 if (j.contains(
"algorithm")) { j.at(
"algorithm").get_to(
_algorithm); }
136 LOG_ERROR(
"{}: You need to connect a GNSS NavigationInfo provider",
nameId());
165 std::vector<InputPin::IncomingLink::ValueWrapper<GnssNavInfo>> gnssNavInfoWrappers;
166 std::vector<const GnssNavInfo*> gnssNavInfos;
171 gnssNavInfoWrappers.push_back(*gnssNavInfo);
172 gnssNavInfos.push_back(gnssNavInfo->v);
175 if (gnssNavInfos.empty()) {
return; }
177 auto gnssObs = std::static_pointer_cast<const GnssObs>(queue.
extract_front());
180 if (
auto sppSol =
_algorithm.calcSppSolution(gnssObs, gnssNavInfos,
nameId()))
Single Point Positioning Algorithm.
nlohmann::json json
json namespace
Navigation message information.
GNSS Observation messages.
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_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
Position and Velocity Storage Class.
Single Point Positioning (SPP) / Code Phase Positioning.
Vector Utility functions.
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
ImVec2 _guiConfigDefaultWindowSize
Node(std::string name)
Constructor.
std::optional< InputPin::IncomingLink::ValueWrapper< T > > getInputValue(size_t portIndex) const
Get Input Value connected on the pin. Only const data types.
std::vector< InputPin > inputPins
List of input pins.
std::string nameId() const
Node name and id.
std::string name
Name of 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 void pinAddCallback(Node *node)
Function to call to add a new pin.
std::string type() const override
String representation of the Class Type.
void recvGnssObs(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive Function for the Gnss Observations.
static constexpr size_t OUTPUT_PORT_INDEX_SPPSOL
Flow (SppSol)
static std::string typeStatic()
String representation of the Class Type.
static void pinDeleteCallback(Node *node, size_t pinIdx)
Function to call to delete a pin.
static std::string category()
String representation of the Class Category.
SinglePointPositioning()
Default constructor.
void deinitialize() override
Deinitialize the node.
gui::widgets::DynamicInputPins _dynamicInputPins
Dynamic input pins.
~SinglePointPositioning() override
Destructor.
void restore(const json &j) override
Restores the node from a json object.
SPP::Algorithm _algorithm
SPP algorithm.
bool initialize() override
Initialize the node.
json save() const override
Saves the node into a json object.
static constexpr size_t INPUT_PORT_INDEX_GNSS_NAV_INFO
GnssNavInfo.
void guiConfig() override
ImGui config window which is shown on double click.
static std::string type()
Returns the type of the data class.
auto extract_front()
Returns a copy of the first element in the container and removes it from the container.
static float windowFontRatio()
Ratio to multiply for GUI window elements.
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.
bool DeleteInputPin(InputPin &pin)
Deletes the input pin. Invalidates the pin reference given.
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.