2020-08-31 04:03:41 +08:00
|
|
|
#ifndef TRACESMITHCHART_H
|
|
|
|
#define TRACESMITHCHART_H
|
|
|
|
|
|
|
|
#include "traceplot.h"
|
|
|
|
#include <QPen>
|
2020-11-20 00:10:47 +08:00
|
|
|
#include <QPainterPath>
|
2020-11-22 07:41:42 +08:00
|
|
|
#include <QTransform>
|
2020-08-31 04:03:41 +08:00
|
|
|
|
|
|
|
class TraceSmithChart : public TracePlot
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
TraceSmithChart(TraceModel &model, QWidget *parent = 0);
|
2020-11-06 20:05:09 +08:00
|
|
|
public slots:
|
|
|
|
void axisSetupDialog();
|
2020-08-31 04:03:41 +08:00
|
|
|
protected:
|
|
|
|
static constexpr double ReferenceImpedance = 50.0;
|
|
|
|
static constexpr double screenUsage = 0.9;
|
2020-11-22 07:41:42 +08:00
|
|
|
static constexpr double smithCoordMax = 4096;
|
2020-08-31 04:03:41 +08:00
|
|
|
|
2020-11-23 04:25:41 +08:00
|
|
|
QPoint dataToPixel(Trace::Data d);
|
|
|
|
QPoint markerToPixel(TraceMarker *m) override;
|
|
|
|
double nearestTracePoint(Trace *t, QPoint pixel) override;
|
2020-08-31 04:03:41 +08:00
|
|
|
|
2020-11-22 07:41:42 +08:00
|
|
|
//void paintEvent(QPaintEvent *event) override;
|
2020-11-06 20:05:09 +08:00
|
|
|
virtual void updateContextMenu() override;
|
2020-08-31 04:03:41 +08:00
|
|
|
bool supported(Trace *t) override;
|
2020-11-22 07:41:42 +08:00
|
|
|
virtual void draw(QPainter& painter) override;
|
2020-11-22 21:38:52 +08:00
|
|
|
virtual void traceDropped(Trace *t, QPoint position) override;
|
2020-08-31 04:03:41 +08:00
|
|
|
QPen textPen;
|
|
|
|
QPen chartLinesPen;
|
|
|
|
QPen thinPen;
|
|
|
|
QPen pointDataPen;
|
|
|
|
QPen lineDataPen;
|
2020-11-06 20:05:09 +08:00
|
|
|
bool limitToSpan;
|
2020-08-31 04:03:41 +08:00
|
|
|
|
|
|
|
/// Path for the thin arcs
|
|
|
|
QPainterPath thinArcsPath;
|
|
|
|
/// Path for the thick arcs
|
|
|
|
QPainterPath thickArcsPath;
|
|
|
|
|
2020-11-22 07:41:42 +08:00
|
|
|
QTransform transform;
|
2020-08-31 04:03:41 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TRACESMITHCHART_H
|