34 #include <shared_mutex> 38 #include <qwt_curve_fitter.h> 39 #include <qwt_interval.h> 40 #include <qwt_painter.h> 42 #include <qwt_plot_canvas.h> 43 #include <qwt_plot_curve.h> 44 #include <qwt_plot_directpainter.h> 45 #include <qwt_plot_grid.h> 46 #include <qwt_plot_layout.h> 47 #include <qwt_plot_legenditem.h> 48 #include <qwt_plot_marker.h> 49 #include <qwt_scale_engine.h> 50 #include <qwt_system_clock.h> 79 constexpr
size_t HZ60 = 17;
121 const std::array<QColor, 7>
penColors = {QColor(255, 0, 16, 255),
122 QColor(255, 164, 5, 255),
123 QColor(43, 206, 72, 255),
124 QColor(0, 117, 220, 255),
125 QColor(178, 102, 255, 255),
126 QColor(0, 153, 143, 255),
127 QColor(83, 81, 84, 255)};
130 "Red",
"Orange",
"Green",
"Blue",
"Purple",
"Teal",
"Black"};
139 "Solid",
"Dash",
"Dot",
"Dash Dot",
"Dash Dot Dot"};
162 explicit Canvas(QwtPlot* plot);
177 explicit Scope(QWidget* parent);
218 return this->m_trigger_info.
endpoint;
230 std::atomic<bool> isPaused =
false;
234 int64_t horizontal_scale_ns = 1000000;
235 bool triggering =
false;
236 std::vector<sample> sample_buffer;
239 QwtPlotDirectPainter* d_directPainter =
nullptr;
243 QwtPlotMarker* origin;
246 QwtScaleMap* scaleMapY;
247 QwtScaleMap* scaleMapX;
254 std::vector<scope_channel> channels;
257 std::shared_mutex m_channel_mutex;
void setDataSize(size_t size)
double getChannelScale(IO::endpoint endpoint)
void removeChannel(IO::endpoint probeInfo)
void setTriggerThreshold(double threshold)
void setChannelLabel(IO::endpoint endpoint, const QString &label)
void setChannelPen(IO::endpoint endpoint, const QPen &pen)
int getChannelWidth(IO::endpoint endpoint)
Scope & operator=(const Scope &)=delete
double getChannelOffset(IO::endpoint endpoint)
QColor getChannelColor(IO::endpoint endpoint)
void setChannelOffset(IO::endpoint endpoint, double offset)
double getTriggerThreshold() const
size_t getDataSize() const
Scope(const Scope &)=delete
void setRefresh(size_t r)
void createChannel(IO::endpoint probeInfo, RT::OS::Fifo *fifo)
IO::endpoint getTriggerEndpoint() const
Qt::PenStyle getChannelStyle(IO::endpoint endpoint)
size_t getRefresh() const
void setTriggerDirection(Trigger::trig_t direction)
Trigger::trig_t getTriggerDirection()
void resizeEvent(QResizeEvent *event) override
void setDivT(int64_t value)
void removeBlockChannels(IO::Block *block)
void setPause(bool value)
bool channelRegistered(IO::endpoint probeInfo)
Scope & operator=(Scope &&)=delete
void setChannelScale(IO::endpoint endpoint, double scale)
struct IO::endpoint endpoint
struct Oscilloscope::Trigger::Info Info
constexpr std::array< std::string_view, 7 > color2string
struct Oscilloscope::sample sample
constexpr std::array< Qt::PenStyle, 5 > penStyles
constexpr std::array< std::string_view, 5 > penstyles2string
const std::array< QColor, 7 > penColors
constexpr size_t DEFAULT_BUFFER_SIZE
struct Oscilloscope::scope_channel scope_channel
Trigger::trig_t trigger_direction
std::vector< double > ytransformed
std::vector< double > ybuffer
std::vector< int64_t > timebuffer
std::vector< double > xtransformed
std::vector< double > xbuffer