kopia lustrzana https://gitlab.com/Teuniz/DSRemote
Work in progress.
rodzic
17aa4c13d3
commit
19291e9317
5
global.h
5
global.h
|
@ -39,7 +39,8 @@
|
|||
|
||||
#define SCREEN_TIMER_IVAL 50
|
||||
|
||||
#define ADJDIAL_TIMER_IVAL 3000
|
||||
#define ADJDIAL_TIMER_IVAL_1 3000
|
||||
#define ADJDIAL_TIMER_IVAL_2 1000
|
||||
|
||||
#define SCRN_SHOT_BMP_SZ 1152054
|
||||
|
||||
|
@ -132,6 +133,8 @@ struct device_settings
|
|||
short *wavebuf[MAX_CHNS];
|
||||
int wavebufsz;
|
||||
|
||||
int screenupdates_on;
|
||||
|
||||
struct waveform_preamble preamble;
|
||||
};
|
||||
|
||||
|
|
|
@ -32,10 +32,10 @@ void UI_Mainwindow::navDialChanged(int npos)
|
|||
{
|
||||
int mpr = 1;
|
||||
|
||||
char str[512];
|
||||
|
||||
double val, lefttime, righttime, delayrange;
|
||||
|
||||
scrn_timer->stop();
|
||||
|
||||
if(navDial->isSliderDown() == true)
|
||||
{
|
||||
navDial_timer->start(100);
|
||||
|
@ -108,7 +108,7 @@ void UI_Mainwindow::navDialChanged(int npos)
|
|||
|
||||
if(navDialFunc == NAV_DIAL_FUNC_HOLDOFF)
|
||||
{
|
||||
adjdial_timer->start(ADJDIAL_TIMER_IVAL);
|
||||
adjdial_timer->start(ADJDIAL_TIMER_IVAL_2);
|
||||
|
||||
val = get_stepsize_divide_by_1000(devparms.triggerholdoff);
|
||||
|
||||
|
@ -123,18 +123,6 @@ void UI_Mainwindow::navDialChanged(int npos)
|
|||
{
|
||||
devparms.triggerholdoff = 10;
|
||||
}
|
||||
|
||||
strcpy(str, "Trigger holdoff: ");
|
||||
|
||||
convert_to_metric_suffix(str + strlen(str), devparms.triggerholdoff, 2);
|
||||
|
||||
strcat(str, "s");
|
||||
|
||||
statusLabel->setText(str);
|
||||
|
||||
// sprintf(str, ":TRIG:HOLD %e", devparms.triggerholdoff);
|
||||
//
|
||||
// tmcdev_write(device, str);
|
||||
}
|
||||
else if(devparms.timebasedelayenable)
|
||||
{
|
||||
|
@ -169,19 +157,9 @@ void UI_Mainwindow::navDialChanged(int npos)
|
|||
{
|
||||
devparms.timebasedelayoffset = (righttime - delayrange);
|
||||
}
|
||||
|
||||
strcpy(str, "Delayed timebase position: ");
|
||||
|
||||
convert_to_metric_suffix(str + strlen(str), devparms.timebasedelayoffset, 2);
|
||||
|
||||
strcat(str, "s");
|
||||
|
||||
statusLabel->setText(str);
|
||||
|
||||
// sprintf(str, ":TIM:DEL:OFFS %e", devparms.timebasedelayoffset);
|
||||
//
|
||||
// tmcdev_write(device, str);
|
||||
}
|
||||
|
||||
waveForm->update();
|
||||
}
|
||||
|
||||
|
||||
|
@ -193,18 +171,39 @@ void UI_Mainwindow::navDialReleased()
|
|||
|
||||
if(navDialFunc == NAV_DIAL_FUNC_HOLDOFF)
|
||||
{
|
||||
strcpy(str, "Trigger holdoff: ");
|
||||
|
||||
convert_to_metric_suffix(str + strlen(str), devparms.triggerholdoff, 2);
|
||||
|
||||
strcat(str, "s");
|
||||
|
||||
statusLabel->setText(str);
|
||||
|
||||
sprintf(str, ":TRIG:HOLD %e", devparms.triggerholdoff);
|
||||
|
||||
tmcdev_write(device, str);
|
||||
}
|
||||
else if(devparms.timebasedelayenable)
|
||||
{
|
||||
strcpy(str, "Delayed timebase position: ");
|
||||
|
||||
convert_to_metric_suffix(str + strlen(str), devparms.timebasedelayoffset, 2);
|
||||
|
||||
strcat(str, "s");
|
||||
|
||||
statusLabel->setText(str);
|
||||
|
||||
sprintf(str, ":TIM:DEL:OFFS %e", devparms.timebasedelayoffset);
|
||||
|
||||
tmcdev_write(device, str);
|
||||
}
|
||||
|
||||
adjDialFunc = NAV_DIAL_FUNC_NONE;
|
||||
adjDialFunc = ADJ_DIAL_FUNC_NONE;
|
||||
|
||||
if(devparms.screenupdates_on == 1)
|
||||
{
|
||||
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -554,7 +553,7 @@ void UI_Mainwindow::set_acq_average()
|
|||
|
||||
adjDialLabel->setStyleSheet("background: #66FF99; font: 7pt;");
|
||||
|
||||
adjdial_timer->start(ADJDIAL_TIMER_IVAL);
|
||||
adjdial_timer->start(ADJDIAL_TIMER_IVAL_1);
|
||||
|
||||
if(devparms.acquiretype == 1)
|
||||
{
|
||||
|
@ -825,13 +824,15 @@ void UI_Mainwindow::adjDialChanged(int new_pos)
|
|||
|
||||
int diff, dir;
|
||||
|
||||
char str[512];
|
||||
|
||||
if(adjDialFunc == ADJ_DIAL_FUNC_NONE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
scrn_timer->stop();
|
||||
|
||||
adjdial_timer->start(ADJDIAL_TIMER_IVAL_2);
|
||||
|
||||
diff = new_pos - old_pos;
|
||||
|
||||
if(diff < 0)
|
||||
|
@ -869,8 +870,6 @@ void UI_Mainwindow::adjDialChanged(int new_pos)
|
|||
|
||||
if(adjDialFunc == ADJ_DIAL_FUNC_HOLDOFF)
|
||||
{
|
||||
adjdial_timer->start(ADJDIAL_TIMER_IVAL);
|
||||
|
||||
if(!dir)
|
||||
{
|
||||
if(devparms.triggerholdoff >= 10)
|
||||
|
@ -897,23 +896,9 @@ void UI_Mainwindow::adjDialChanged(int new_pos)
|
|||
|
||||
devparms.triggerholdoff -= get_stepsize_divide_by_1000(devparms.triggerholdoff);
|
||||
}
|
||||
|
||||
strcpy(str, "Trigger holdoff: ");
|
||||
|
||||
convert_to_metric_suffix(str + strlen(str), devparms.triggerholdoff, 2);
|
||||
|
||||
strcat(str, "s");
|
||||
|
||||
statusLabel->setText(str);
|
||||
|
||||
sprintf(str, ":TRIG:HOLD %e", devparms.triggerholdoff);
|
||||
|
||||
tmcdev_write(device, str);
|
||||
}
|
||||
else if(adjDialFunc == ADJ_DIAL_FUNC_ACQ_AVG)
|
||||
{
|
||||
adjdial_timer->start(ADJDIAL_TIMER_IVAL);
|
||||
|
||||
if(!dir)
|
||||
{
|
||||
if(devparms.acquireaverages >= 8192)
|
||||
|
@ -940,17 +925,11 @@ void UI_Mainwindow::adjDialChanged(int new_pos)
|
|||
|
||||
devparms.acquireaverages /= 2;
|
||||
}
|
||||
|
||||
sprintf(str, "Acquire averages: %i", devparms.acquireaverages);
|
||||
|
||||
statusLabel->setText(str);
|
||||
|
||||
sprintf(str, ":ACQ:AVER %i", devparms.acquireaverages);
|
||||
|
||||
tmcdev_write(device, str);
|
||||
}
|
||||
|
||||
old_pos = new_pos;
|
||||
|
||||
waveForm->update();
|
||||
}
|
||||
|
||||
|
||||
|
@ -2498,7 +2477,7 @@ void UI_Mainwindow::trigger_setting_holdoff()
|
|||
|
||||
adjDialLabel->setStyleSheet("background: #66FF99; font: 7pt;");
|
||||
|
||||
adjdial_timer->start(ADJDIAL_TIMER_IVAL);
|
||||
adjdial_timer->start(ADJDIAL_TIMER_IVAL_1);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -261,6 +261,8 @@ void UI_Mainwindow::open_connection()
|
|||
|
||||
DPRwidget->setEnabled(true);
|
||||
|
||||
devparms.screenupdates_on = 1;
|
||||
|
||||
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||
|
||||
return;
|
||||
|
@ -290,6 +292,8 @@ void UI_Mainwindow::close_connection()
|
|||
|
||||
adjdial_timer->stop();
|
||||
|
||||
devparms.screenupdates_on = 0;
|
||||
|
||||
setWindowTitle(PROGRAM_NAME " " PROGRAM_VERSION);
|
||||
|
||||
disconnect(adjDial, SIGNAL(valueChanged(int)), this, SLOT(adjDialChanged(int)));
|
||||
|
@ -350,6 +354,8 @@ void UI_Mainwindow::closeEvent(QCloseEvent *cl_event)
|
|||
|
||||
scrn_timer->stop();
|
||||
|
||||
devparms.screenupdates_on = 0;
|
||||
|
||||
adjdial_timer->stop();
|
||||
|
||||
tmcdev_close(device);
|
||||
|
|
|
@ -468,7 +468,7 @@ void SignalCurve::drawWidget(QPainter *painter, int curve_w, int curve_h)
|
|||
|
||||
char str[128];
|
||||
|
||||
if((mainwindow->adjDialFunc == NAV_DIAL_FUNC_HOLDOFF) || (mainwindow->navDialFunc == NAV_DIAL_FUNC_HOLDOFF))
|
||||
if((mainwindow->adjDialFunc == ADJ_DIAL_FUNC_HOLDOFF) || (mainwindow->navDialFunc == NAV_DIAL_FUNC_HOLDOFF))
|
||||
{
|
||||
convert_to_metric_suffix(str, devparms->triggerholdoff, 2);
|
||||
|
||||
|
@ -1273,7 +1273,10 @@ void SignalCurve::mouseReleaseEvent(QMouseEvent *release_event)
|
|||
return;
|
||||
}
|
||||
|
||||
mainwindow->scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||
if(devparms->screenupdates_on == 1)
|
||||
{
|
||||
mainwindow->scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||
}
|
||||
|
||||
if(trig_pos_arrow_moving)
|
||||
{
|
||||
|
|
|
@ -47,12 +47,24 @@ void UI_Mainwindow::navDial_timer_handler()
|
|||
navDial->setSliderPosition(50);
|
||||
|
||||
navDialFunc = NAV_DIAL_FUNC_NONE;
|
||||
|
||||
if(adjdial_timer->isActive() == false)
|
||||
{
|
||||
adjDialFunc = ADJ_DIAL_FUNC_NONE;
|
||||
}
|
||||
|
||||
if(devparms.screenupdates_on == 1)
|
||||
{
|
||||
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UI_Mainwindow::adjdial_timer_handler()
|
||||
{
|
||||
char str[512];
|
||||
|
||||
adjdial_timer->stop();
|
||||
|
||||
adjDialLabel->setStyleSheet(def_stylesh);
|
||||
|
@ -61,7 +73,42 @@ void UI_Mainwindow::adjdial_timer_handler()
|
|||
|
||||
adjDialLabel->setText("");
|
||||
|
||||
adjDialFunc = NAV_DIAL_FUNC_NONE;
|
||||
if(adjDialFunc == ADJ_DIAL_FUNC_HOLDOFF)
|
||||
{
|
||||
strcpy(str, "Trigger holdoff: ");
|
||||
|
||||
convert_to_metric_suffix(str + strlen(str), devparms.triggerholdoff, 2);
|
||||
|
||||
strcat(str, "s");
|
||||
|
||||
statusLabel->setText(str);
|
||||
|
||||
sprintf(str, ":TRIG:HOLD %e", devparms.triggerholdoff);
|
||||
|
||||
tmcdev_write(device, str);
|
||||
}
|
||||
else if(adjDialFunc == ADJ_DIAL_FUNC_ACQ_AVG)
|
||||
{
|
||||
sprintf(str, "Acquire averages: %i", devparms.acquireaverages);
|
||||
|
||||
statusLabel->setText(str);
|
||||
|
||||
sprintf(str, ":ACQ:AVER %i", devparms.acquireaverages);
|
||||
|
||||
tmcdev_write(device, str);
|
||||
}
|
||||
|
||||
adjDialFunc = ADJ_DIAL_FUNC_NONE;
|
||||
|
||||
if(navDial_timer->isActive() == false)
|
||||
{
|
||||
navDialFunc = NAV_DIAL_FUNC_NONE;
|
||||
}
|
||||
|
||||
if(devparms.screenupdates_on == 1)
|
||||
{
|
||||
scrn_timer->start(SCREEN_TIMER_IVAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -347,6 +394,8 @@ void UI_Mainwindow::scrn_timer_handler()
|
|||
}
|
||||
}
|
||||
|
||||
devparms.wavebufsz = n;
|
||||
|
||||
waveForm->drawCurve(&devparms, device, n);
|
||||
|
||||
return;
|
||||
|
|
Ładowanie…
Reference in New Issue