merge-requests/1/head
Teuniz 2017-01-11 12:29:24 +01:00
rodzic f8a55eabba
commit 3a3d3befb3
3 zmienionych plików z 12 dodań i 18 usunięć

Wyświetl plik

@ -35,7 +35,7 @@
#define PROGRAM_NAME "DSRemote"
#define PROGRAM_VERSION "0.34_1701071917"
#define PROGRAM_VERSION "0.34_1701111215"
#define MAX_PATHLEN 4096
@ -239,6 +239,7 @@ struct device_settings
short *wavebuf[MAX_CHNS];
int wavebufsz;
double yinc[MAX_CHNS];
int yor[MAX_CHNS];
int screenshot_inv; // 0=normal, 1=inverted colors

Wyświetl plik

@ -188,7 +188,6 @@ void UI_Mainwindow::get_deep_memory_waveform(void)
bytes_rcvd=0,
mempnts,
yref[MAX_CHNS],
yor[MAX_CHNS],
empty_buf;
char str[256];
@ -326,9 +325,9 @@ void UI_Mainwindow::get_deep_memory_waveform(void)
tmc_read();
yor[chn] = atoi(device->buf);
devparms.yor[chn] = atoi(device->buf);
if((yor[chn] < -255) || (yor[chn] > 255))
if((devparms.yor[chn] < -255) || (devparms.yor[chn] > 255))
{
sprintf(str, "Error, parameter \"YOR\" out of range. line %i file %s", __LINE__, __FILE__);
goto OUT_ERROR;
@ -413,7 +412,7 @@ void UI_Mainwindow::get_deep_memory_waveform(void)
break;
}
wavbuf[chn][bytes_rcvd + k] = ((int)(((unsigned char *)device->buf)[k]) - yref[chn]) << 5;
wavbuf[chn][bytes_rcvd + k] = ((int)(((unsigned char *)device->buf)[k]) - yref[chn] - devparms.yor[chn]) << 5;
}
bytes_rcvd += n;
@ -778,8 +777,7 @@ void UI_Mainwindow::save_screen_waveform()
chn,
chns=0,
hdl=-1,
yref[MAX_CHNS],
yor[MAX_CHNS];
yref[MAX_CHNS];
char str[128],
opath[MAX_PATHLEN];
@ -908,9 +906,9 @@ void UI_Mainwindow::save_screen_waveform()
tmc_read();
yor[chn] = atoi(device->buf);
devparms.yor[chn] = atoi(device->buf);
if((yor[chn] < -255) || (yor[chn] > 255))
if((devparms.yor[chn] < -255) || (devparms.yor[chn] > 255))
{
sprintf(str, "Error, parameter \"YOR\" out of range. line %i file %s", __LINE__, __FILE__);
goto OUT_ERROR;
@ -954,7 +952,7 @@ void UI_Mainwindow::save_screen_waveform()
for(i=0; i<n; i++)
{
wavbuf[chn][i] = ((int)(((unsigned char *)device->buf)[i]) - yref[chn] - yor[chn]) << 5;
wavbuf[chn][i] = ((int)(((unsigned char *)device->buf)[i]) - yref[chn] - devparms.yor[chn]) << 5;
}
}

Wyświetl plik

@ -243,14 +243,7 @@ void WaveCurve::paintEvent(QPaintEvent *)
continue;
}
if(devparms->modelserie == 6)
{
v_sense = -((double)curve_h / 256.0);
}
else
{
v_sense = ((double)curve_h / ((devparms->chanscale[chn] * devparms->vertdivisions) / devparms->yinc[chn])) / -32.0;
}
chan_arrow_pos[chn] = (curve_h / 2) - (devparms->chanoffset[chn] / ((devparms->chanscale[chn] * devparms->vertdivisions) / curve_h));
@ -311,6 +304,8 @@ void WaveCurve::paintEvent(QPaintEvent *)
h_trace_offset = curve_h / 2;
h_trace_offset += (devparms->yor[chn] * v_sense * 32.0);
painter->setPen(QPen(QBrush(SignalColor[chn], Qt::SolidPattern), tracewidth, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
for(i=0; i<sample_range; i++)