From 722f04b100df99c7f7729a4dcb9a3ae85671e2c0 Mon Sep 17 00:00:00 2001 From: Teuniz Date: Mon, 15 Jun 2015 17:45:06 +0200 Subject: [PATCH] Work in progress. --- global.h | 2 +- mainwindow.cpp | 14 ++++++++++++++ save_data.cpp | 10 ++++++++++ signalcurve.cpp | 26 +++++++++++++++++++++----- 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/global.h b/global.h index 6c735da..e0c1a6a 100644 --- a/global.h +++ b/global.h @@ -31,7 +31,7 @@ #define PROGRAM_NAME "DSRemote" -#define PROGRAM_VERSION "0.11_1506141913" +#define PROGRAM_VERSION "0.11_1506151743" #define MAX_PATHLEN 4096 diff --git a/mainwindow.cpp b/mainwindow.cpp index 1eabe9b..b5697e6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2432,6 +2432,8 @@ void UI_Mainwindow::set_to_factory() { int i; + char str[256]; + scrn_timer->stop(); tmcdev_write(device, "*RST"); @@ -2506,6 +2508,18 @@ void UI_Mainwindow::set_to_factory() sleep(10); + if(devparms.modelserie == 6) + { + for(i=0; istart(SCREEN_TIMER_IVAL); diff --git a/save_data.cpp b/save_data.cpp index 9a9a7d2..c08f948 100644 --- a/save_data.cpp +++ b/save_data.cpp @@ -397,6 +397,16 @@ void UI_Mainwindow::save_memory_waveform() usleep(20000); tmcdev_write(device, ":WAV:BEG"); + + usleep(20000); + + tmcdev_write(device, ":WAV:STAT?"); + + usleep(20000); + + tmcdev_read(device); + + printf(":WAV:STAT? %s\n", device->buf); } usleep(20000); diff --git a/signalcurve.cpp b/signalcurve.cpp index 39cf588..922a232 100644 --- a/signalcurve.cpp +++ b/signalcurve.cpp @@ -562,7 +562,7 @@ void SignalCurve::setDeviceParameters(struct device_settings *devp) void SignalCurve::drawTopLabels(QPainter *painter) { - int i, x1; + int i, x1, tmp; char str[128]; @@ -702,11 +702,19 @@ void SignalCurve::drawTopLabels(QPainter *painter) dtmp2 = (devparms->timebaseoffset - devparms->timebasedelayoffset) / ((devparms->hordivisions / 2) * devparms->timebasescale); - painter->fillRect(288, 16, (116 - (dtmp1 * 116)) - (dtmp2 * 116), 8, QColor(64, 160, 255)); + tmp = (116 - (dtmp1 * 116)) - (dtmp2 * 116); + + if(tmp > 0) + { + painter->fillRect(288, 16, tmp, 8, QColor(64, 160, 255)); + } x1 = (116 - (dtmp1 * 116)) + (dtmp2 * 116); - painter->fillRect(288 + 233 - x1, 16, x1, 8, QColor(64, 160, 255)); + if(x1 > 0) + { + painter->fillRect(288 + 233 - x1, 16, x1, 8, QColor(64, 160, 255)); + } } else if(devparms->memdepth > 1000) { @@ -714,11 +722,19 @@ void SignalCurve::drawTopLabels(QPainter *painter) dtmp2 = devparms->timebaseoffset / dtmp1; - painter->fillRect(288, 16, (116 - (dtmp1 * 116)) - (dtmp2 * 116), 8, QColor(64, 160, 255)); + tmp = (116 - (dtmp1 * 116)) - (dtmp2 * 116); + + if(tmp > 0) + { + painter->fillRect(288, 16, tmp, 8, QColor(64, 160, 255)); + } x1 = (116 - (dtmp1 * 116)) + (dtmp2 * 116); - painter->fillRect(288 + 233 - x1, 16, x1, 8, QColor(64, 160, 255)); + if(x1 > 0) + { + painter->fillRect(288 + 233 - x1, 16, x1, 8, QColor(64, 160, 255)); + } } painter->drawRect(288, 16, 233, 8);