Move also the trace when dragging the vertical position arrow up or down with the mouse.

merge-requests/1/head
Teuniz 2016-09-17 15:00:01 +02:00
rodzic f03bf14c8d
commit 7d40e97b26
4 zmienionych plików z 32 dodań i 7 usunięć

Wyświetl plik

@ -35,7 +35,7 @@
#define PROGRAM_NAME "DSRemote" #define PROGRAM_NAME "DSRemote"
#define PROGRAM_VERSION "0.32_1609152016" #define PROGRAM_VERSION "0.32_1609171455"
#define MAX_PATHLEN 4096 #define MAX_PATHLEN 4096

Wyświetl plik

@ -37,11 +37,11 @@ Reading a screenshot in BMP format is slow, approx. 3 seconds.
You need to add an udev rule. See readme_usbtmc_driver.txt for how to do that. You need to add an udev rule. See readme_usbtmc_driver.txt for how to do that.
DS1054Z: (softversion 00.04.03.SP1, boardversion 0.1.1) DS1054Z: (softversion 00.04.04.SP1, boardversion 0.1.1)
======= =======
USB connection: high speed (480 Mbit) USB connection: high speed (480 Mbit)
Reading screen data is slow, maximum 7 waveforms per second with one channel. Reading screen data is slow, maximum 4 waveforms per second with one channel.
With all four channels active, downloading the screen waveform data is really slow. With all four channels active, downloading the screen waveform data is really slow.
Reading a screenshot in BMP format is faster, less than one second. Reading a screenshot in BMP format is faster, less than one second.
It's plug and play, no need to add an udev rule. It's plug and play, no need to add an udev rule.

Wyświetl plik

@ -80,6 +80,10 @@ SignalCurve::SignalCurve(QWidget *w_parent) : QWidget(w_parent)
chan_arrow_moving[i] = 0; chan_arrow_moving[i] = 0;
chan_arrow_pos[i] = 127; chan_arrow_pos[i] = 127;
chan_tmp_y_pixel_offset[i] = 0;
chan_tmp_old_y_pixel_offset[i] = 0;
} }
trig_level_arrow_moving = 0; trig_level_arrow_moving = 0;
@ -410,10 +414,16 @@ void SignalCurve::drawWidget(QPainter *painter, int curve_w, int curve_h)
{ {
if(bufsize < (curve_w / 2)) if(bufsize < (curve_w / 2))
{ {
painter->drawLine(i * h_step, (devparms->wavebuf[chn][i] * v_sense) + (curve_h / 2), (i + 1) * h_step, (devparms->wavebuf[chn][i] * v_sense) + (curve_h / 2)); painter->drawLine(i * h_step,
(devparms->wavebuf[chn][i] * v_sense) + (curve_h / 2) - chan_tmp_y_pixel_offset[chn],
(i + 1) * h_step,
(devparms->wavebuf[chn][i] * v_sense) + (curve_h / 2) - chan_tmp_y_pixel_offset[chn]);
if(i) if(i)
{ {
painter->drawLine(i * h_step, (devparms->wavebuf[chn][i - 1] * v_sense) + (curve_h / 2), i * h_step, (devparms->wavebuf[chn][i] * v_sense) + (curve_h / 2)); painter->drawLine(i * h_step,
(devparms->wavebuf[chn][i - 1] * v_sense) + (curve_h / 2) - chan_tmp_y_pixel_offset[chn],
i * h_step,
(devparms->wavebuf[chn][i] * v_sense) + (curve_h / 2) - chan_tmp_y_pixel_offset[chn]);
} }
} }
else else
@ -422,11 +432,15 @@ void SignalCurve::drawWidget(QPainter *painter, int curve_w, int curve_h)
{ {
if(devparms->displaytype) if(devparms->displaytype)
{ {
painter->drawPoint(i * h_step, (devparms->wavebuf[chn][i] * v_sense) + (curve_h / 2)); painter->drawPoint(i * h_step,
(devparms->wavebuf[chn][i] * v_sense) + (curve_h / 2) - chan_tmp_y_pixel_offset[chn]);
} }
else else
{ {
painter->drawLine(i * h_step, (devparms->wavebuf[chn][i] * v_sense) + (curve_h / 2), (i + 1) * h_step, (devparms->wavebuf[chn][i + 1] * v_sense) + (curve_h / 2)); painter->drawLine(i * h_step,
(devparms->wavebuf[chn][i] * v_sense) + (curve_h / 2) - chan_tmp_y_pixel_offset[chn],
(i + 1) * h_step,
(devparms->wavebuf[chn][i + 1] * v_sense) + (curve_h / 2) - chan_tmp_y_pixel_offset[chn]);
} }
} }
} }
@ -1700,6 +1714,7 @@ void SignalCurve::mousePressEvent(QMouseEvent *press_event)
setMouseTracking(true); setMouseTracking(true);
mouse_old_x = m_x; mouse_old_x = m_x;
mouse_old_y = m_y; mouse_old_y = m_y;
chan_tmp_old_y_pixel_offset[chn] = m_y;
break; break;
} }
@ -1951,6 +1966,10 @@ void SignalCurve::mouseReleaseEvent(QMouseEvent *release_event)
devparms->activechannel = chn; devparms->activechannel = chn;
chan_tmp_y_pixel_offset[chn] = 0;
chan_tmp_old_y_pixel_offset[chn] = 0;
break; break;
} }
} }
@ -2094,6 +2113,10 @@ void SignalCurve::mouseMoveEvent(QMouseEvent *move_event)
devparms->chanoffset[chn] = ((h / 2) - chan_arrow_pos[chn]) * ((devparms->chanscale[chn] * 8) / h); devparms->chanoffset[chn] = ((h / 2) - chan_arrow_pos[chn]) * ((devparms->chanscale[chn] * 8) / h);
// chan_tmp_y_pixel_offset[chn] = (h / 2) - chan_arrow_pos[chn];
chan_tmp_y_pixel_offset[chn] = chan_tmp_old_y_pixel_offset[chn] - chan_arrow_pos[chn];
dtmp = devparms->chanoffset[chn] / (devparms->chanscale[chn] / 50); dtmp = devparms->chanoffset[chn] / (devparms->chanscale[chn] / 50);
devparms->chanoffset[chn] = (devparms->chanscale[chn] / 50) * dtmp; devparms->chanoffset[chn] = (devparms->chanscale[chn] / 50) * dtmp;

Wyświetl plik

@ -128,6 +128,8 @@ private:
trig_pos_arrow_moving, trig_pos_arrow_moving,
use_move_events, use_move_events,
chan_arrow_pos[MAX_CHNS], chan_arrow_pos[MAX_CHNS],
chan_tmp_y_pixel_offset[MAX_CHNS],
chan_tmp_old_y_pixel_offset[MAX_CHNS],
trig_level_arrow_pos, trig_level_arrow_pos,
trig_pos_arrow_pos, trig_pos_arrow_pos,
trig_stat_flash, trig_stat_flash,