reset Graphstart variable when <data clear>

This commit is contained in:
iceman1001 2021-08-01 20:32:14 +02:00
commit 9b90250434
5 changed files with 5 additions and 4 deletions

View file

@ -43,8 +43,9 @@ size_t ClearGraph(bool redraw) {
size_t gtl = GraphTraceLen;
memset(GraphBuffer, 0x00, GraphTraceLen);
GraphTraceLen = 0;
GraphStart = 0;
GraphStop = 0;
// showDemod = false;
DemodBufferLen = 0;
if (redraw)
RepaintGraphWindow();

View file

@ -35,7 +35,7 @@ void ExitGraphics(void);
extern double CursorScaleFactor;
extern char CursorScaleFactorUnit[11];
extern double PlotGridX, PlotGridY, PlotGridXdefault, PlotGridYdefault, GridOffset;
extern uint32_t CursorCPos, CursorDPos, GraphStop;
extern uint32_t CursorCPos, CursorDPos, GraphStart, GraphStop;
extern int CommandFinished;
extern int offline;
extern bool GridLocked;

View file

@ -766,7 +766,7 @@ void Plot::paintEvent(QPaintEvent *event) {
painter.drawText(20, infoRect.bottom() - 3, str);
}
Plot::Plot(QWidget *parent) : QWidget(parent), GraphStart(0), GraphPixelsPerPoint(1) {
Plot::Plot(QWidget *parent) : QWidget(parent), GraphPixelsPerPoint(1) {
//Need to set this, otherwise we don't receive keypress events
setFocusPolicy(Qt::StrongFocus);
resize(400, 200);

View file

@ -32,7 +32,6 @@ class ProxWidget;
class Plot: public QWidget {
private:
QWidget *master;
uint32_t GraphStart; // Starting point/offset for the left side of the graph
double GraphPixelsPerPoint; // How many visual pixels are between each sample point (x axis)
uint32_t CursorAPos;
uint32_t CursorBPos;

View file

@ -45,6 +45,7 @@ double CursorScaleFactor = 1;
char CursorScaleFactorUnit[11] = {0};
double PlotGridX = 0, PlotGridY = 0, PlotGridXdefault = 64, PlotGridYdefault = 64;
uint32_t CursorCPos = 0, CursorDPos = 0, GraphStop = 0;
uint32_t GraphStart = 0; // Starting point/offset for the left side of the graph
double GraphPixelsPerPoint = 1.f; // How many visual pixels are between each sample point (x axis)
static bool flushAfterWrite = 0;
double GridOffset = 0;