From 6e8e11f8cd784d36b9852ae28aa29c0d065ee4ab Mon Sep 17 00:00:00 2001 From: Teuniz Date: Sat, 27 Jun 2015 23:30:38 +0200 Subject: [PATCH] Work in progress. --- global.h | 2 +- mainwindow.cpp | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/global.h b/global.h index 2cb42e5..aac0e69 100644 --- a/global.h +++ b/global.h @@ -31,7 +31,7 @@ #define PROGRAM_NAME "DSRemote" -#define PROGRAM_VERSION "0.20_1506272231" +#define PROGRAM_VERSION "0.20_1506272330" #define MAX_PATHLEN 4096 diff --git a/mainwindow.cpp b/mainwindow.cpp index 1e69146..7cceeb3 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2485,8 +2485,12 @@ void UI_Mainwindow::set_to_factory() scrn_timer->stop(); + qApp->processEvents(); + tmc_write("*RST"); + qApp->processEvents(); + devparms.timebasescale = 1e-6; devparms.timebaseoffset = 0; @@ -2555,7 +2559,21 @@ void UI_Mainwindow::set_to_factory() qApp->processEvents(); - sleep(10); + for(i=0; i<50; i++) + { + qApp->processEvents(); + + usleep(500000); + + tmc_write("*OPC?"); + + tmc_read(); + + if(device->buf[0] == '1') + { + break; + } + } if(devparms.modelserie == 6) {