kopia lustrzana https://gitlab.com/Teuniz/DSRemote
Work in progress.
rodzic
5a072cc7cf
commit
17aa4c13d3
6
global.h
6
global.h
|
@ -37,6 +37,8 @@
|
||||||
|
|
||||||
#define MAX_CHNS 4
|
#define MAX_CHNS 4
|
||||||
|
|
||||||
|
#define SCREEN_TIMER_IVAL 50
|
||||||
|
|
||||||
#define ADJDIAL_TIMER_IVAL 3000
|
#define ADJDIAL_TIMER_IVAL 3000
|
||||||
|
|
||||||
#define SCRN_SHOT_BMP_SZ 1152054
|
#define SCRN_SHOT_BMP_SZ 1152054
|
||||||
|
@ -128,9 +130,7 @@ struct device_settings
|
||||||
|
|
||||||
char *screenshot_buf;
|
char *screenshot_buf;
|
||||||
short *wavebuf[MAX_CHNS];
|
short *wavebuf[MAX_CHNS];
|
||||||
|
int wavebufsz;
|
||||||
int status_timer_ival; // in milli-Sec.
|
|
||||||
int screen_timer_ival; // in milli-Sec.
|
|
||||||
|
|
||||||
struct waveform_preamble preamble;
|
struct waveform_preamble preamble;
|
||||||
};
|
};
|
||||||
|
|
|
@ -2126,8 +2126,6 @@ void UI_Mainwindow::horizontal_delayed_toggle()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stat_timer->stop();
|
|
||||||
|
|
||||||
scrn_timer->stop();
|
scrn_timer->stop();
|
||||||
|
|
||||||
devparms.timebasedelayenable = 1;
|
devparms.timebasedelayenable = 1;
|
||||||
|
@ -2148,9 +2146,7 @@ void UI_Mainwindow::horizontal_delayed_toggle()
|
||||||
|
|
||||||
devparms.timebasedelayscale = atof(device->buf);
|
devparms.timebasedelayscale = atof(device->buf);
|
||||||
|
|
||||||
stat_timer->start(devparms.status_timer_ival);
|
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||||
|
|
||||||
scrn_timer->start(devparms.screen_timer_ival);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -208,19 +208,6 @@ void UI_Mainwindow::open_connection()
|
||||||
ch2Button->setVisible(false);
|
ch2Button->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(devparms.modelserie == 6)
|
|
||||||
{
|
|
||||||
devparms.status_timer_ival = 100;
|
|
||||||
|
|
||||||
devparms.screen_timer_ival = 50;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
devparms.status_timer_ival = 500;
|
|
||||||
|
|
||||||
devparms.screen_timer_ival = 2000;
|
|
||||||
}
|
|
||||||
|
|
||||||
connect(adjDial, SIGNAL(valueChanged(int)), this, SLOT(adjDialChanged(int)));
|
connect(adjDial, SIGNAL(valueChanged(int)), this, SLOT(adjDialChanged(int)));
|
||||||
connect(trigAdjustDial, SIGNAL(valueChanged(int)), this, SLOT(trigAdjustDialChanged(int)));
|
connect(trigAdjustDial, SIGNAL(valueChanged(int)), this, SLOT(trigAdjustDialChanged(int)));
|
||||||
connect(horScaleDial, SIGNAL(valueChanged(int)), this, SLOT(horScaleDialChanged(int)));
|
connect(horScaleDial, SIGNAL(valueChanged(int)), this, SLOT(horScaleDialChanged(int)));
|
||||||
|
@ -270,13 +257,11 @@ void UI_Mainwindow::open_connection()
|
||||||
|
|
||||||
devparms.connected = 1;
|
devparms.connected = 1;
|
||||||
|
|
||||||
stat_timer->start(devparms.status_timer_ival);
|
|
||||||
|
|
||||||
// test_timer->start(2000);
|
// test_timer->start(2000);
|
||||||
|
|
||||||
DPRwidget->setEnabled(true);
|
DPRwidget->setEnabled(true);
|
||||||
|
|
||||||
scrn_timer->start(devparms.screen_timer_ival);
|
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -303,8 +288,6 @@ void UI_Mainwindow::close_connection()
|
||||||
|
|
||||||
scrn_timer->stop();
|
scrn_timer->stop();
|
||||||
|
|
||||||
stat_timer->stop();
|
|
||||||
|
|
||||||
adjdial_timer->stop();
|
adjdial_timer->stop();
|
||||||
|
|
||||||
setWindowTitle(PROGRAM_NAME " " PROGRAM_VERSION);
|
setWindowTitle(PROGRAM_NAME " " PROGRAM_VERSION);
|
||||||
|
@ -367,8 +350,6 @@ void UI_Mainwindow::closeEvent(QCloseEvent *cl_event)
|
||||||
|
|
||||||
scrn_timer->stop();
|
scrn_timer->stop();
|
||||||
|
|
||||||
stat_timer->stop();
|
|
||||||
|
|
||||||
adjdial_timer->stop();
|
adjdial_timer->stop();
|
||||||
|
|
||||||
tmcdev_close(device);
|
tmcdev_close(device);
|
||||||
|
|
|
@ -110,6 +110,8 @@ public:
|
||||||
int adjDialFunc,
|
int adjDialFunc,
|
||||||
navDialFunc;
|
navDialFunc;
|
||||||
|
|
||||||
|
QTimer *scrn_timer;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QMenuBar *menubar;
|
QMenuBar *menubar;
|
||||||
|
@ -117,9 +119,7 @@ private:
|
||||||
QMenu *devicemenu,
|
QMenu *devicemenu,
|
||||||
*helpmenu;
|
*helpmenu;
|
||||||
|
|
||||||
QTimer *scrn_timer,
|
QTimer *adjdial_timer,
|
||||||
*stat_timer,
|
|
||||||
*adjdial_timer,
|
|
||||||
*navDial_timer,
|
*navDial_timer,
|
||||||
*test_timer;
|
*test_timer;
|
||||||
|
|
||||||
|
|
|
@ -73,10 +73,6 @@ UI_Mainwindow::UI_Mainwindow()
|
||||||
|
|
||||||
devparms.hordivisions = 14;
|
devparms.hordivisions = 14;
|
||||||
|
|
||||||
devparms.status_timer_ival = 500;
|
|
||||||
|
|
||||||
devparms.screen_timer_ival = 2000;
|
|
||||||
|
|
||||||
menubar = menuBar();
|
menubar = menuBar();
|
||||||
|
|
||||||
devicemenu = new QMenu;
|
devicemenu = new QMenu;
|
||||||
|
@ -349,14 +345,12 @@ UI_Mainwindow::UI_Mainwindow()
|
||||||
navDialFunc = NAV_DIAL_FUNC_NONE;
|
navDialFunc = NAV_DIAL_FUNC_NONE;
|
||||||
|
|
||||||
scrn_timer = new QTimer(this);
|
scrn_timer = new QTimer(this);
|
||||||
stat_timer = new QTimer(this);
|
|
||||||
adjdial_timer = new QTimer(this);
|
adjdial_timer = new QTimer(this);
|
||||||
navDial_timer = new QTimer(this);
|
navDial_timer = new QTimer(this);
|
||||||
navDial_timer->setSingleShot(true);
|
navDial_timer->setSingleShot(true);
|
||||||
test_timer = new QTimer(this);
|
test_timer = new QTimer(this);
|
||||||
|
|
||||||
connect(scrn_timer, SIGNAL(timeout()), this, SLOT(scrn_timer_handler()));
|
connect(scrn_timer, SIGNAL(timeout()), this, SLOT(scrn_timer_handler()));
|
||||||
connect(stat_timer, SIGNAL(timeout()), this, SLOT(stat_timer_handler()));
|
|
||||||
connect(adjdial_timer, SIGNAL(timeout()), this, SLOT(adjdial_timer_handler()));
|
connect(adjdial_timer, SIGNAL(timeout()), this, SLOT(adjdial_timer_handler()));
|
||||||
connect(navDial, SIGNAL(sliderReleased()), this, SLOT(navDialReleased()));
|
connect(navDial, SIGNAL(sliderReleased()), this, SLOT(navDialReleased()));
|
||||||
connect(navDial_timer, SIGNAL(timeout()), this, SLOT(navDial_timer_handler()));
|
connect(navDial_timer, SIGNAL(timeout()), this, SLOT(navDial_timer_handler()));
|
||||||
|
|
|
@ -46,8 +46,6 @@ void UI_Mainwindow::save_screenshot()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
stat_timer->stop();
|
|
||||||
|
|
||||||
scrn_timer->stop();
|
scrn_timer->stop();
|
||||||
|
|
||||||
tmcdev_write(device, ":DISP:DATA?");
|
tmcdev_write(device, ":DISP:DATA?");
|
||||||
|
@ -123,9 +121,7 @@ void UI_Mainwindow::save_screenshot()
|
||||||
|
|
||||||
if(!strcmp(opath, ""))
|
if(!strcmp(opath, ""))
|
||||||
{
|
{
|
||||||
stat_timer->start(devparms.status_timer_ival);
|
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||||
|
|
||||||
scrn_timer->start(devparms.screen_timer_ival);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -138,17 +134,13 @@ void UI_Mainwindow::save_screenshot()
|
||||||
goto OUT_ERROR;
|
goto OUT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
stat_timer->start(devparms.status_timer_ival);
|
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||||
|
|
||||||
scrn_timer->start(devparms.screen_timer_ival);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OUT_ERROR:
|
OUT_ERROR:
|
||||||
|
|
||||||
stat_timer->start(devparms.status_timer_ival);
|
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||||
|
|
||||||
scrn_timer->start(devparms.screen_timer_ival);
|
|
||||||
|
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
msgBox.setIcon(QMessageBox::Critical);
|
msgBox.setIcon(QMessageBox::Critical);
|
||||||
|
@ -254,8 +246,6 @@ void UI_Mainwindow::save_memory_waveform()
|
||||||
|
|
||||||
scrn_timer->stop();
|
scrn_timer->stop();
|
||||||
|
|
||||||
stat_timer->stop();
|
|
||||||
|
|
||||||
tmcdev_write(device, ":STOP");
|
tmcdev_write(device, ":STOP");
|
||||||
|
|
||||||
for(chn=0; chn<MAX_CHNS; chn++)
|
for(chn=0; chn<MAX_CHNS; chn++)
|
||||||
|
@ -461,9 +451,7 @@ void UI_Mainwindow::save_memory_waveform()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stat_timer->start(devparms.status_timer_ival);
|
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||||
|
|
||||||
scrn_timer->start(devparms.screen_timer_ival);
|
|
||||||
|
|
||||||
if(bytes_rcvd < mempnts)
|
if(bytes_rcvd < mempnts)
|
||||||
{
|
{
|
||||||
|
@ -626,9 +614,7 @@ OUT_ERROR:
|
||||||
free(wavbuf[chn]);
|
free(wavbuf[chn]);
|
||||||
}
|
}
|
||||||
|
|
||||||
stat_timer->start(devparms.status_timer_ival);
|
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||||
|
|
||||||
scrn_timer->start(devparms.screen_timer_ival);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -692,8 +678,6 @@ void UI_Mainwindow::save_screen_waveform()
|
||||||
wavbuf[2] = NULL;
|
wavbuf[2] = NULL;
|
||||||
wavbuf[3] = NULL;
|
wavbuf[3] = NULL;
|
||||||
|
|
||||||
stat_timer->stop();
|
|
||||||
|
|
||||||
scrn_timer->stop();
|
scrn_timer->stop();
|
||||||
|
|
||||||
if(devparms.modelserie == 1)
|
if(devparms.modelserie == 1)
|
||||||
|
@ -889,9 +873,7 @@ OUT_NORMAL:
|
||||||
free(wavbuf[i]);
|
free(wavbuf[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
stat_timer->start(devparms.status_timer_ival);
|
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||||
|
|
||||||
scrn_timer->start(devparms.screen_timer_ival);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -912,9 +894,7 @@ OUT_ERROR:
|
||||||
free(wavbuf[i]);
|
free(wavbuf[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
stat_timer->start(devparms.status_timer_ival);
|
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||||
|
|
||||||
scrn_timer->start(devparms.screen_timer_ival);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1246,6 +1246,11 @@ void SignalCurve::mousePressEvent(QMouseEvent *press_event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(use_move_events)
|
||||||
|
{
|
||||||
|
mainwindow->scrn_timer->stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1268,6 +1273,8 @@ void SignalCurve::mouseReleaseEvent(QMouseEvent *release_event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mainwindow->scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||||
|
|
||||||
if(trig_pos_arrow_moving)
|
if(trig_pos_arrow_moving)
|
||||||
{
|
{
|
||||||
trig_pos_arrow_pos = mouse_x;
|
trig_pos_arrow_pos = mouse_x;
|
||||||
|
@ -1449,6 +1456,8 @@ void SignalCurve::mouseReleaseEvent(QMouseEvent *release_event)
|
||||||
trig_pos_arrow_moving = 0;
|
trig_pos_arrow_moving = 0;
|
||||||
use_move_events = 0;
|
use_move_events = 0;
|
||||||
setMouseTracking(false);
|
setMouseTracking(false);
|
||||||
|
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -243,6 +243,8 @@ void UI_Mainwindow::scrn_timer_handler()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stat_timer_handler();
|
||||||
|
|
||||||
for(i=0; i<MAX_CHNS; i++)
|
for(i=0; i<MAX_CHNS; i++)
|
||||||
{
|
{
|
||||||
if(!devparms.chandisplay[i]) // Download data only when channel is switched on
|
if(!devparms.chandisplay[i]) // Download data only when channel is switched on
|
||||||
|
|
Ładowanie…
Reference in New Issue