diff --git a/global.h b/global.h index 7f0d974..cf4068d 100644 --- a/global.h +++ b/global.h @@ -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; }; diff --git a/interface.cpp b/interface.cpp index b894055..86e9021 100644 --- a/interface.cpp +++ b/interface.cpp @@ -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); } } diff --git a/mainwindow.cpp b/mainwindow.cpp index 6b5428f..8056d16 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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); diff --git a/mainwindow.h b/mainwindow.h index 6c83918..b7ec791 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -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; diff --git a/mainwindow_constr.cpp b/mainwindow_constr.cpp index 1b0e417..398d48e 100644 --- a/mainwindow_constr.cpp +++ b/mainwindow_constr.cpp @@ -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())); diff --git a/save_data.cpp b/save_data.cpp index 0ab9a12..692ae31 100644 --- a/save_data.cpp +++ b/save_data.cpp @@ -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; chnstart(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); } diff --git a/signalcurve.cpp b/signalcurve.cpp index b7294d9..3e47706 100644 --- a/signalcurve.cpp +++ b/signalcurve.cpp @@ -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(); } diff --git a/timer_handlers.cpp b/timer_handlers.cpp index 0dc4993..1d59500 100644 --- a/timer_handlers.cpp +++ b/timer_handlers.cpp @@ -243,6 +243,8 @@ void UI_Mainwindow::scrn_timer_handler() return; } + stat_timer_handler(); + for(i=0; i