49 return "SinglePointPositioning - SPP";
59 return "Data Processor";
64 auto nSatColumnContent = [&](
size_t pinIndex) ->
bool {
67 size_t usedSatNum = 0;
71 std::string filler =
", ";
72 for (
const auto& satellite : gnssNavInfo->v->satellites())
74 if (
_algorithm._obsFilter.isSatelliteAllowed(satellite.first))
77 usedSats += (allSats.empty() ?
"" : filler) + fmt::format(
"{}", satellite.first);
79 allSats += (allSats.empty() ?
"" : filler) + fmt::format(
"{}", satellite.first);
81 ImGui::TextUnformatted(fmt::format(
"{} / {}", usedSatNum, gnssNavInfo->v->nSatellites()).c_str());
82 if (ImGui::IsItemHovered())
84 ImGui::SetTooltip(
"Used satellites: %s\n"
85 "Avail satellites: %s",
86 usedSats.c_str(), allSats.c_str());
104 if (_algorithm.ShowGuiWidgets(nameId().c_str(), itemWidth, unitWidth))
125 if (j.contains(
"algorithm")) { j.at(
"algorithm").get_to(
_algorithm); }
134 LOG_ERROR(
"{}: You need to connect a GNSS NavigationInfo provider",
nameId());
163 std::vector<InputPin::IncomingLink::ValueWrapper<GnssNavInfo>> gnssNavInfoWrappers;
164 std::vector<const GnssNavInfo*> gnssNavInfos;
169 gnssNavInfoWrappers.push_back(*gnssNavInfo);
170 gnssNavInfos.push_back(gnssNavInfo->v);
173 if (gnssNavInfos.empty()) {
return; }
175 auto gnssObs = std::static_pointer_cast<const GnssObs>(queue.
extract_front());
178 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.
OutputPin * CreateOutputPin(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.
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.
void invokeCallbacks(size_t portIndex, const std::shared_ptr< const NodeData > &data)
Calls all registered callbacks on the specified output port.
bool DeleteInputPin(size_t pinIndex)
Deletes the input pin. Invalidates the pin reference given.
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.
void ApplyChanges()
Signals that there have been changes to the flow.