Work in progress.

merge-requests/1/head
Teuniz 2015-06-09 08:37:17 +02:00
rodzic 5a072cc7cf
commit 17aa4c13d3
8 zmienionych plików z 27 dodań i 65 usunięć

Wyświetl plik

@ -37,6 +37,8 @@
#define MAX_CHNS 4
#define SCREEN_TIMER_IVAL 50
#define ADJDIAL_TIMER_IVAL 3000
#define SCRN_SHOT_BMP_SZ 1152054
@ -128,9 +130,7 @@ struct device_settings
char *screenshot_buf;
short *wavebuf[MAX_CHNS];
int status_timer_ival; // in milli-Sec.
int screen_timer_ival; // in milli-Sec.
int wavebufsz;
struct waveform_preamble preamble;
};

Wyświetl plik

@ -2126,8 +2126,6 @@ void UI_Mainwindow::horizontal_delayed_toggle()
}
else
{
stat_timer->stop();
scrn_timer->stop();
devparms.timebasedelayenable = 1;
@ -2148,9 +2146,7 @@ void UI_Mainwindow::horizontal_delayed_toggle()
devparms.timebasedelayscale = atof(device->buf);
stat_timer->start(devparms.status_timer_ival);
scrn_timer->start(devparms.screen_timer_ival);
scrn_timer->start(SCREEN_TIMER_IVAL);
}
}

Wyświetl plik

@ -208,19 +208,6 @@ void UI_Mainwindow::open_connection()
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(trigAdjustDial, SIGNAL(valueChanged(int)), this, SLOT(trigAdjustDialChanged(int)));
connect(horScaleDial, SIGNAL(valueChanged(int)), this, SLOT(horScaleDialChanged(int)));
@ -270,13 +257,11 @@ void UI_Mainwindow::open_connection()
devparms.connected = 1;
stat_timer->start(devparms.status_timer_ival);
// test_timer->start(2000);
DPRwidget->setEnabled(true);
scrn_timer->start(devparms.screen_timer_ival);
scrn_timer->start(SCREEN_TIMER_IVAL);
return;
@ -303,8 +288,6 @@ void UI_Mainwindow::close_connection()
scrn_timer->stop();
stat_timer->stop();
adjdial_timer->stop();
setWindowTitle(PROGRAM_NAME " " PROGRAM_VERSION);
@ -315,7 +298,7 @@ void UI_Mainwindow::close_connection()
disconnect(horPosDial, SIGNAL(valueChanged(int)), this, SLOT(horPosDialChanged(int)));
disconnect(vertOffsetDial, SIGNAL(valueChanged(int)), this, SLOT(vertOffsetDialChanged(int)));
disconnect(vertScaleDial, SIGNAL(valueChanged(int)), this, SLOT(vertScaleDialChanged(int)));
disconnect(navDial, SIGNAL(valueChanged(int)), this, SLOT(navDialChanged(int)));
disconnect(navDial, SIGNAL(valueChanged(int)), this, SLOT(navDialChanged(int)));
disconnect(ch1Button, SIGNAL(clicked()), this, SLOT(ch1ButtonClicked()));
disconnect(ch2Button, SIGNAL(clicked()), this, SLOT(ch2ButtonClicked()));
@ -367,8 +350,6 @@ void UI_Mainwindow::closeEvent(QCloseEvent *cl_event)
scrn_timer->stop();
stat_timer->stop();
adjdial_timer->stop();
tmcdev_close(device);

Wyświetl plik

@ -110,6 +110,8 @@ public:
int adjDialFunc,
navDialFunc;
QTimer *scrn_timer;
private:
QMenuBar *menubar;
@ -117,9 +119,7 @@ private:
QMenu *devicemenu,
*helpmenu;
QTimer *scrn_timer,
*stat_timer,
*adjdial_timer,
QTimer *adjdial_timer,
*navDial_timer,
*test_timer;

Wyświetl plik

@ -73,10 +73,6 @@ UI_Mainwindow::UI_Mainwindow()
devparms.hordivisions = 14;
devparms.status_timer_ival = 500;
devparms.screen_timer_ival = 2000;
menubar = menuBar();
devicemenu = new QMenu;
@ -349,14 +345,12 @@ UI_Mainwindow::UI_Mainwindow()
navDialFunc = NAV_DIAL_FUNC_NONE;
scrn_timer = new QTimer(this);
stat_timer = new QTimer(this);
adjdial_timer = new QTimer(this);
navDial_timer = new QTimer(this);
navDial_timer->setSingleShot(true);
test_timer = new QTimer(this);
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(navDial, SIGNAL(sliderReleased()), this, SLOT(navDialReleased()));
connect(navDial_timer, SIGNAL(timeout()), this, SLOT(navDial_timer_handler()));

Wyświetl plik

@ -46,8 +46,6 @@ void UI_Mainwindow::save_screenshot()
return;
}
stat_timer->stop();
scrn_timer->stop();
tmcdev_write(device, ":DISP:DATA?");
@ -123,9 +121,7 @@ void UI_Mainwindow::save_screenshot()
if(!strcmp(opath, ""))
{
stat_timer->start(devparms.status_timer_ival);
scrn_timer->start(devparms.screen_timer_ival);
scrn_timer->start(SCREEN_TIMER_IVAL);
return;
}
@ -138,17 +134,13 @@ void UI_Mainwindow::save_screenshot()
goto OUT_ERROR;
}
stat_timer->start(devparms.status_timer_ival);
scrn_timer->start(devparms.screen_timer_ival);
scrn_timer->start(SCREEN_TIMER_IVAL);
return;
OUT_ERROR:
stat_timer->start(devparms.status_timer_ival);
scrn_timer->start(devparms.screen_timer_ival);
scrn_timer->start(SCREEN_TIMER_IVAL);
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical);
@ -254,8 +246,6 @@ void UI_Mainwindow::save_memory_waveform()
scrn_timer->stop();
stat_timer->stop();
tmcdev_write(device, ":STOP");
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(devparms.screen_timer_ival);
scrn_timer->start(SCREEN_TIMER_IVAL);
if(bytes_rcvd < mempnts)
{
@ -626,9 +614,7 @@ OUT_ERROR:
free(wavbuf[chn]);
}
stat_timer->start(devparms.status_timer_ival);
scrn_timer->start(devparms.screen_timer_ival);
scrn_timer->start(SCREEN_TIMER_IVAL);
}
@ -692,8 +678,6 @@ void UI_Mainwindow::save_screen_waveform()
wavbuf[2] = NULL;
wavbuf[3] = NULL;
stat_timer->stop();
scrn_timer->stop();
if(devparms.modelserie == 1)
@ -889,9 +873,7 @@ OUT_NORMAL:
free(wavbuf[i]);
}
stat_timer->start(devparms.status_timer_ival);
scrn_timer->start(devparms.screen_timer_ival);
scrn_timer->start(SCREEN_TIMER_IVAL);
return;
@ -912,9 +894,7 @@ OUT_ERROR:
free(wavbuf[i]);
}
stat_timer->start(devparms.status_timer_ival);
scrn_timer->start(devparms.screen_timer_ival);
scrn_timer->start(SCREEN_TIMER_IVAL);
}

Wyświetl plik

@ -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;
}
mainwindow->scrn_timer->start(SCREEN_TIMER_IVAL);
if(trig_pos_arrow_moving)
{
trig_pos_arrow_pos = mouse_x;
@ -1449,6 +1456,8 @@ void SignalCurve::mouseReleaseEvent(QMouseEvent *release_event)
trig_pos_arrow_moving = 0;
use_move_events = 0;
setMouseTracking(false);
update();
}

Wyświetl plik

@ -243,6 +243,8 @@ void UI_Mainwindow::scrn_timer_handler()
return;
}
stat_timer_handler();
for(i=0; i<MAX_CHNS; i++)
{
if(!devparms.chandisplay[i]) // Download data only when channel is switched on