21#include <unordered_set>
69 [[nodiscard]] std::string
type()
const override;
166 std::vector<std::tuple<double, InsTime, std::string, int32_t>>
events;
194 std::pair<ColormapMaskType, int64_t>
colormapMask = { ColormapMaskType::None, -1 };
335 std::array<ImPlotScale, 3>
yAxesScale = { ImPlotScale_Linear, ImPlotScale_Linear, ImPlotScale_Linear };
337 ImPlotLineFlags
lineFlags = ImPlotLineFlags_NoClip | ImPlotLineFlags_SkipNaN;
356 bool initialize()
override;
359 void deinitialize()
override;
362 void updateNumberOfPlots();
366 static void pinAddCallback(
Node* node);
370 static void pinDeleteCallback(
Node* node,
size_t pinIdx);
373 size_t GPST_PLOT_IDX = 1;
376 std::vector<PinData> _pinData;
379 std::vector<PlotInfo> _plots;
384 std::vector<std::string> _dataIdentifier = {
407 int _dragAndDropHeaderIndex = -1;
410 std::pair<std::unordered_set<size_t>, ImPlotRange> _forceXaxisRange{};
413 std::optional<gui::widgets::PositionWithFrame> _originPosition;
416 bool _overridePositionStartValues =
false;
420 gui::widgets::DynamicInputPins _dynamicInputPins{ 0,
this, pinAddCallback, pinDeleteCallback, 1 };
427 void addEvent(
size_t pinIndex, InsTime insTime,
const std::string& text, int32_t dataIndex);
433 void addData(
size_t pinIndex,
size_t dataIndex,
double value);
440 size_t addData(
size_t pinIndex, std::string displayName,
double value);
445 CommonLog::LocalPosition calcLocalPosition(
const Eigen::Vector3d& lla_position);
450 void plotBoolean(
const InsTime& insTime,
size_t pinIdx);
455 void plotInteger(
const InsTime& insTime,
size_t pinIdx);
460 void plotFloat(
const InsTime& insTime,
size_t pinIdx);
465 void plotMatrix(
const InsTime& insTime,
size_t pinIdx);
478 void plotData(
const std::shared_ptr<const T>& obs,
size_t pinIndex,
size_t& plotIndex,
size_t startIndex = 0)
480 for (
size_t i = startIndex; i < T::GetStaticDescriptorCount(); ++i)
482 addData(pinIndex, plotIndex++, obs->getValueAtOrNaN(i));
490 void plotDynamicData(
const std::shared_ptr<const DynamicData>& obs,
size_t pinIndex,
size_t& plotIndex);
496 void plotGnssCombination(
const std::shared_ptr<const GnssCombination>& obs,
size_t pinIndex,
size_t& plotIndex);
502 void plotGnssObs(
const std::shared_ptr<const GnssObs>& obs,
size_t pinIndex,
size_t& plotIndex);
507 void plotSppSolutionDynamicData(
const std::shared_ptr<const SppSolution>& obs,
size_t pinIndex);
Common logging variables like time into run and local positions.
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
GNSS measurement combinations.
GNSS Observation messages.
Data storage class for simulated IMU observations.
Data storage class for one VectorNavImu observation.
Parent Class for all IMU Observations.
Loosely-coupled Kalman Filter INS/GNSS errors.
Tightly-coupled Kalman Filter INS/GNSS errors.
Data storage class for one KVH Imu observation.
Position, Velocity and Attitude Storage Class.
RTKLIB Pos Observation Class.
Binary Outputs from VectorNav Sensors.
Vector Utility functions.
void move(std::vector< T > &v, size_t sourceIdx, size_t targetIdx)
Moves an element within a vector to a new position.
Definition Vector.hpp:26
Common logging variables like time into run and local positions.
Definition CommonLog.hpp:26
static std::string type()
Returns the type of the data class.
Definition DynamicData.hpp:29
static std::string type()
Returns the type of the data class.
Definition GnssCombination.hpp:32
static std::string type()
Returns the type of the data class.
Definition GnssObs.hpp:149
static std::string type()
Returns the type of the data class.
Definition ImuObsSimulated.hpp:31
static std::string type()
Returns the type of the data class.
Definition ImuObsWDelta.hpp:31
static std::string type()
Returns the type of the data class.
Definition ImuObs.hpp:34
static std::string type()
Returns the type of the data class.
Definition InsGnssLCKFSolution.hpp:29
static std::string type()
Returns the type of the data class.
Definition InsGnssTCKFSolution.hpp:26
The class is responsible for all time-related tasks.
Definition InsTime.hpp:667
static std::string type()
Returns the type of the data class.
Definition KvhObs.hpp:39
Abstract parent class for all nodes.
Definition Node.hpp:86
Output pins of nodes.
Definition Pin.hpp:338
Plot node which plots all kind of observations.
Definition Plot.hpp:50
void restore(const json &j) override
Restores the node from a json object.
Plot(const Plot &)=delete
Copy constructor.
std::string type() const override
String representation of the Class Type.
Plot & operator=(Plot &&)=delete
Move assignment operator.
Plot()
Default constructor.
Plot & operator=(const Plot &)=delete
Copy assignment operator.
json save() const override
Saves the node into a json object.
static std::string typeStatic()
String representation of the Class Type.
~Plot() override
Destructor.
void afterCreateLink(OutputPin &startPin, InputPin &endPin) override
Called when a new link was established.
static std::string category()
String representation of the Class Category.
void guiConfig() override
ImGui config window which is shown on double click.
Plot(Plot &&)=delete
Move constructor.
static std::string type()
Returns the type of the data class.
Definition PosVelAtt.hpp:29
static std::string type()
Returns the type of the data class.
Definition PosVel.hpp:27
static std::string type()
Returns the type of the data class.
Definition Pos.hpp:33
static std::string type()
Returns the type of the data class.
Definition RtklibPosObs.hpp:131
static std::string type()
Returns the type of the data class.
Definition SppSolution.hpp:38
static std::string type()
Returns the type of the data class.
Definition VectorNavBinaryOutput.hpp:41
Stores the actual data coming from a pin.
Definition Plot.hpp:95
bool isDynamic
Bool to show if dynamic data.
Definition Plot.hpp:114
PlotData()=default
Default constructor (needed to make serialization with json working)
bool hasData
Flag if data was received, as the buffer contains std::nan("") otherwise.
Definition Plot.hpp:109
bool markedForDelete
When connecting a new link. All data is flagged for delete and only those who are also present in the...
Definition Plot.hpp:112
ScrollingBuffer< double > buffer
Buffer for the data.
Definition Plot.hpp:107
PlotData(std::string displayName, size_t size)
Constructor.
std::string displayName
Display name of the contained data.
Definition Plot.hpp:105
Information needed to plot the data on a certain pin.
Definition Plot.hpp:92
std::mutex mutex
Mutex to lock the buffer so that the GUI thread and the calculation threads don't cause a data race.
Definition Plot.hpp:162
~PinData()=default
Destructor.
PinData & operator=(PinData &&rhs) noexcept
Move assignment operator.
std::vector< std::tuple< double, InsTime, std::string, int32_t > > events
Events with relative time, absolute time, tooltip text and data Index (-1 means all)
Definition Plot.hpp:166
PinData(const PinData &other)
Copy constructor.
PinData()=default
Constructor.
int size
Size of all buffers of the plotData elements.
Definition Plot.hpp:152
int stride
Amount of points to skip for plotting.
Definition Plot.hpp:160
PinType pinType
Pin Type.
Definition Plot.hpp:158
PinData & operator=(const PinData &rhs)
Copy assignment operator.
PinData(PinData &&other) noexcept
Move constructor.
int dynamicDataStartIndex
Dynamic data start index.
Definition Plot.hpp:164
std::vector< PlotData > plotData
List with all the data.
Definition Plot.hpp:156
std::string dataIdentifier
Data Identifier of the connected pin.
Definition Plot.hpp:154
void addPlotDataItem(size_t dataIndex, const std::string &displayName)
Adds a plotData Element to the list.
PinType
Possible Pin types.
Definition Plot.hpp:119
@ Float
Floating Point Number.
Specifying the look of a certain line in the plot.
Definition Plot.hpp:177
ImVec4 color
Line Color.
Definition Plot.hpp:192
float eventMarkerWeight
Weight of the markers (increases thickness of marker lines)
Definition Plot.hpp:229
std::pair< ColormapMaskType, int64_t > markerColormapMask
Colormap mask (pair: type and id)
Definition Plot.hpp:206
size_t markerColormapMaskDataCmpIdx
Index of the plot data to compare for the color.
Definition Plot.hpp:208
std::string legendName
Display name in the legend (if not set falls back to PlotData::displayName)
Definition Plot.hpp:186
ImVec4 eventMarkerOutlineColor
Outline/Border color for markers.
Definition Plot.hpp:233
LineType
Possible line types.
Definition Plot.hpp:180
@ Scatter
Scatter plot (only markers)
float markerSize
Size of the markers (makes the marker smaller/bigger)
Definition Plot.hpp:214
std::optional< ImPlotLineFlags > lineFlags
Line Flags (overrides the plot selection)
Definition Plot.hpp:200
std::pair< ColormapMaskType, int64_t > colormapMask
Colormap mask (pair: type and id)
Definition Plot.hpp:194
ImVec4 markerOutlineColor
Outline/Border color for markers.
Definition Plot.hpp:220
std::string eventTooltipFilterRegex
Tooltip search regex.
Definition Plot.hpp:235
ImVec4 markerFillColor
Fill color for markers.
Definition Plot.hpp:218
int stride
Amount of points to skip for plotting.
Definition Plot.hpp:203
LineType lineType
Line type.
Definition Plot.hpp:190
ImPlotMarker markerStyle
Style of the marker to display.
Definition Plot.hpp:212
ImVec4 eventMarkerFillColor
Fill color for markers.
Definition Plot.hpp:231
std::string legendNameGui
Legend name which gets changed in the gui.
Definition Plot.hpp:188
bool eventsEnabled
Show events on this data.
Definition Plot.hpp:223
float thickness
Line thickness.
Definition Plot.hpp:198
size_t colormapMaskDataCmpIdx
Index of the plot data to compare for the color.
Definition Plot.hpp:196
float markerWeight
Weight of the markers (increases thickness of marker lines)
Definition Plot.hpp:216
ImPlotMarker eventMarkerStyle
Style of the marker to display.
Definition Plot.hpp:225
bool markers
Display markers for the line plot (no effect for scatter type)
Definition Plot.hpp:210
float eventMarkerSize
Size of the markers (makes the marker smaller/bigger)
Definition Plot.hpp:227
Info needed to draw a data set.
Definition Plot.hpp:174
std::string displayName
Display name of the data (not changing and unique)
Definition Plot.hpp:273
ScrollingBuffer< ImU32 > markerColormapMaskColors
Buffer for the colormap mask.
Definition Plot.hpp:281
PlotItem()=default
Default constructor (needed to make serialization with json working)
size_t pinIndex
Index of the pin where the data came in.
Definition Plot.hpp:271
ScrollingBuffer< double > eventMarker
Buffer for event markers.
Definition Plot.hpp:286
PlotItem(size_t pinIndex, size_t dataIndex, std::string displayName, ImAxis axis)
Constructor.
Definition Plot.hpp:257
ScrollingBuffer< ImU32 > colormapMaskColors
Buffer for the colormap mask.
Definition Plot.hpp:277
size_t colormapMaskVersion
Colormap version (to track updates of the colormap)
Definition Plot.hpp:279
size_t dataIndex
Index of the data on the pin.
Definition Plot.hpp:272
constexpr bool operator==(const PlotItem &rhs) const
Equal comparison operator (needed to search the vector with std::find)
Definition Plot.hpp:266
std::vector< std::tuple< double, double, Tooltip > > eventTooltips
List of tooltips (x,y, tooltip)
Definition Plot.hpp:295
size_t markerColormapMaskVersion
Colormap version (to track updates of the colormap)
Definition Plot.hpp:283
Style style
Definition Plot.hpp:275
PlotItem(size_t pinIndex, size_t dataIndex, std::string displayName)
Constructor.
Definition Plot.hpp:245
ImAxis axis
Axis to plot the data on (Y1, Y2, Y3)
Definition Plot.hpp:274
Information specifying the look of each plot.
Definition Plot.hpp:171
ImVec2 size
Size of the plot.
Definition Plot.hpp:308
bool visible
Flag whether the whole plot is visible. If not, then it should be deleted.
Definition Plot.hpp:351
std::string y2AxisLabel
Y2 axis label.
Definition Plot.hpp:321
std::string headerText
Title of the CollapsingHeader.
Definition Plot.hpp:313
std::array< ImPlotScale, 3 > yAxesScale
Scale for the y-Axes.
Definition Plot.hpp:335
ImPlotLineFlags lineFlags
Line Flags for all items (each item can override the selection)
Definition Plot.hpp:337
ImPlotAxisFlags xAxisFlags
Flags for the x-Axis.
Definition Plot.hpp:329
float leftPaneWidth
Width of plot Data content.
Definition Plot.hpp:346
int plotFlags
Flags which are passed to the plot.
Definition Plot.hpp:327
bool overrideXAxisLabel
Flag, whether to override the x axis label.
Definition Plot.hpp:315
std::string xAxisLabel
X axis label.
Definition Plot.hpp:317
size_t selectedPin
Selected pin in the GUI for the Drag & Drop Data.
Definition Plot.hpp:325
ImPlotScale xAxisScale
Scale for the x-Axis.
Definition Plot.hpp:333
PlotInfo(const std::string &title, size_t nInputPins)
Constructor.
Definition Plot.hpp:304
PlotInfo()=default
Default constructor.
float rightPaneWidth
Width of the plot.
Definition Plot.hpp:348
std::vector< PlotItem > plotItems
List containing all elements which should be plotted.
Definition Plot.hpp:343
std::vector< size_t > selectedXdata
Key: PinIndex, Value: plotData to use for x-Axis.
Definition Plot.hpp:340
std::string title
Title of the ImPlot.
Definition Plot.hpp:311
std::string y1AxisLabel
Y1 axis label.
Definition Plot.hpp:319
ImPlotAxisFlags yAxisFlags
Flags for the y-Axes.
Definition Plot.hpp:331
std::string y3AxisLabel
Y3 axis label.
Definition Plot.hpp:323