Work in progress.

merge-requests/1/head
Teuniz 2015-07-07 16:34:15 +02:00
rodzic 5fdf6e7781
commit aaa2ef5738
2 zmienionych plików z 31 dodań i 4 usunięć

Wyświetl plik

@ -31,7 +31,7 @@
#define PROGRAM_NAME "DSRemote"
#define PROGRAM_VERSION "0.20_1507042026"
#define PROGRAM_VERSION "0.20_1507071633"
#define MAX_PATHLEN 4096

Wyświetl plik

@ -294,17 +294,33 @@ OUT_ERROR:
void UI_Mainwindow::scrn_timer_handler()
{
int i, j, n=0, chns=0;
int i, j, n=0, chns=0, line;
char str[128];
static int h_busy=0;
if(device == NULL)
{
return;
}
if(h_busy)
{
return;
}
h_busy = 1;
stat_timer_handler();
if(!devparms.connected)
{
h_busy = 0;
return;
}
for(i=0; i<MAX_CHNS; i++)
{
if(!devparms.chandisplay[i]) // Download data only when channel is switched on
@ -319,6 +335,8 @@ void UI_Mainwindow::scrn_timer_handler()
{
waveForm->clear();
h_busy = 0;
return;
}
@ -389,12 +407,14 @@ void UI_Mainwindow::scrn_timer_handler()
if(n < 0)
{
printf("Can not read from device.\n");
return;
line = __LINE__;
goto OUT_ERROR;
}
if(n > WAVFRM_MAX_BUFSZ)
{
strcpy(str, "Datablock too big for buffer.");
printf("Datablock too big for buffer.\n");
line = __LINE__;
goto OUT_ERROR;
}
@ -418,16 +438,23 @@ void UI_Mainwindow::scrn_timer_handler()
waveForm->update();
}
h_busy = 0;
return;
OUT_ERROR:
scrn_timer->stop();
sprintf(str, "An error occurred while reading screen data from device.\n"
"File %s line %i", __FILE__, line);
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical);
msgBox.setText(str);
msgBox.exec();
h_busy = 0;
}