XY-Plot setup handling improved

- Use readable names for axis type/mode in json (old integer encoding still valid when loading old setups)
- Bugfix: time domain traces not included in context menu when plot is constructed after the trace
This commit is contained in:
Jan Käberich 2020-12-17 20:37:30 +01:00
parent 0b00186a5a
commit 0f345ba253
4 changed files with 92 additions and 19 deletions

View file

@ -29,11 +29,13 @@ public:
Frequency,
Time,
Distance,
Last,
};
enum class XAxisMode {
UseSpan,
FitTraces,
Manual,
Last,
};
void setYAxis(int axis, YAxisType type, bool log, bool autorange, double min, double max, double div);
@ -61,6 +63,11 @@ private slots:
private:
static constexpr int AxisLabelSize = 10;
QString AxisTypeToName(YAxisType type);
QString AxisTypeToName(XAxisType type);
QString AxisModeToName(XAxisMode mode);
XAxisType XAxisTypeFromName(QString name);
YAxisType YAxisTypeFromName(QString name);
XAxisMode AxisModeFromName(QString name);
void enableTraceAxis(Trace *t, int axis, bool enabled);
bool supported(Trace *t, YAxisType type);
void removeUnsupportedTraces();