Work in progress.

merge-requests/1/head
Teuniz 2015-06-14 17:38:43 +02:00
rodzic ac2fa5d52d
commit cfae40a015
4 zmienionych plików z 125 dodań i 79 usunięć

Wyświetl plik

@ -31,7 +31,7 @@
#define PROGRAM_NAME "DSRemote"
#define PROGRAM_VERSION "0.11_1506141043"
#define PROGRAM_VERSION "0.11_1506141737"
#define MAX_PATHLEN 4096

Wyświetl plik

@ -1110,211 +1110,196 @@ void UI_Mainwindow::acqButtonClicked()
}
void UI_Mainwindow::set_memdepth(int mdepth)
{
char str[256];
if(mdepth <= 0)
{
statusLabel->setText("Memory depth: auto");
tmcdev_write(device, ":ACQ:MDEP AUTO");
devparms.timebaseoffset = 0;
usleep(20000);
tmcdev_write(device, ":TIM:OFFS 0");
return;
}
strcpy(str, "Memory depth: ");
convert_to_metric_suffix(str + strlen(str), mdepth, 0);
statusLabel->setText(str);
sprintf(str, ":ACQ:MDEP %i", mdepth);
tmcdev_write(device, str);
devparms.timebaseoffset = 0;
usleep(20000);
tmcdev_write(device, ":TIM:OFFS 0");
}
void UI_Mainwindow::set_memdepth_auto()
{
statusLabel->setText("Memory depth: auto");
tmcdev_write(device, ":ACQ:MDEP AUTO");
set_memdepth(0);
}
void UI_Mainwindow::set_memdepth_12k()
{
statusLabel->setText("Memory depth: 12k");
tmcdev_write(device, ":ACQ:MDEP 12000");
set_memdepth(12000);
}
void UI_Mainwindow::set_memdepth_120k()
{
statusLabel->setText("Memory depth: 120k");
tmcdev_write(device, ":ACQ:MDEP 120000");
set_memdepth(120000);
}
void UI_Mainwindow::set_memdepth_1200k()
{
statusLabel->setText("Memory depth: 1.2M");
tmcdev_write(device, ":ACQ:MDEP 1200000");
set_memdepth(1200000);
}
void UI_Mainwindow::set_memdepth_12m()
{
statusLabel->setText("Memory depth: 12M");
tmcdev_write(device, ":ACQ:MDEP 12000000");
set_memdepth(12000000);
}
void UI_Mainwindow::set_memdepth_24m()
{
statusLabel->setText("Memory depth: 24M");
tmcdev_write(device, ":ACQ:MDEP 24000000");
set_memdepth(24000000);
}
void UI_Mainwindow::set_memdepth_3k()
{
statusLabel->setText("Memory depth: 3K");
tmcdev_write(device, ":ACQ:MDEP 3000");
set_memdepth(3000);
}
void UI_Mainwindow::set_memdepth_30k()
{
statusLabel->setText("Memory depth: 30K");
tmcdev_write(device, ":ACQ:MDEP 30000");
set_memdepth(30000);
}
void UI_Mainwindow::set_memdepth_300k()
{
statusLabel->setText("Memory depth: 300K");
tmcdev_write(device, ":ACQ:MDEP 300000");
set_memdepth(300000);
}
void UI_Mainwindow::set_memdepth_3m()
{
statusLabel->setText("Memory depth: 3M");
tmcdev_write(device, ":ACQ:MDEP 3000000");
set_memdepth(3000000);
}
void UI_Mainwindow::set_memdepth_6m()
{
statusLabel->setText("Memory depth: 6M");
tmcdev_write(device, ":ACQ:MDEP 6000000");
set_memdepth(6000000);
}
void UI_Mainwindow::set_memdepth_6k()
{
statusLabel->setText("Memory depth: 6K");
tmcdev_write(device, ":ACQ:MDEP 6000");
set_memdepth(6000);
}
void UI_Mainwindow::set_memdepth_60k()
{
statusLabel->setText("Memory depth: 60K");
tmcdev_write(device, ":ACQ:MDEP 60000");
set_memdepth(60000);
}
void UI_Mainwindow::set_memdepth_600k()
{
statusLabel->setText("Memory depth: 600K");
tmcdev_write(device, ":ACQ:MDEP 600000");
set_memdepth(600000);
}
void UI_Mainwindow::set_memdepth_7k()
{
statusLabel->setText("Memory depth: 7k");
tmcdev_write(device, ":ACQ:MDEP 7000");
set_memdepth(7000);
}
void UI_Mainwindow::set_memdepth_70k()
{
statusLabel->setText("Memory depth: 70k");
tmcdev_write(device, ":ACQ:MDEP 70000");
set_memdepth(70000);
}
void UI_Mainwindow::set_memdepth_700k()
{
statusLabel->setText("Memory depth: 700K");
tmcdev_write(device, ":ACQ:MDEP 700000");
set_memdepth(700000);
}
void UI_Mainwindow::set_memdepth_7m()
{
statusLabel->setText("Memory depth: 7M");
tmcdev_write(device, ":ACQ:MDEP 7000000");
set_memdepth(7000000);
}
void UI_Mainwindow::set_memdepth_70m()
{
statusLabel->setText("Memory depth: 70M");
tmcdev_write(device, ":ACQ:MDEP 70000000");
set_memdepth(70000000);
}
void UI_Mainwindow::set_memdepth_14k()
{
statusLabel->setText("Memory depth: 14k");
tmcdev_write(device, ":ACQ:MDEP 14000");
set_memdepth(14000);
}
void UI_Mainwindow::set_memdepth_140k()
{
statusLabel->setText("Memory depth: 140k");
tmcdev_write(device, ":ACQ:MDEP 140000");
set_memdepth(140000);
}
void UI_Mainwindow::set_memdepth_1400k()
{
statusLabel->setText("Memory depth: 1.4M");
tmcdev_write(device, ":ACQ:MDEP 1400000");
set_memdepth(1400000);
}
void UI_Mainwindow::set_memdepth_14m()
{
statusLabel->setText("Memory depth: 14M");
tmcdev_write(device, ":ACQ:MDEP 14000000");
set_memdepth(14000000);
}
void UI_Mainwindow::set_memdepth_140m()
{
statusLabel->setText("Memory depth: 140M");
tmcdev_write(device, ":ACQ:MDEP 140000000");
set_memdepth(140000000);
}
void UI_Mainwindow::set_memdepth_28m()
{
statusLabel->setText("Memory depth: 28M");
tmcdev_write(device, ":ACQ:MDEP 28000000");
set_memdepth(28000000);
}
void UI_Mainwindow::set_memdepth_56m()
{
statusLabel->setText("Memory depth: 56M");
tmcdev_write(device, ":ACQ:MDEP 56000000");
set_memdepth(56000000);
}

Wyświetl plik

@ -1887,6 +1887,21 @@ void UI_Mainwindow::former_page()
{
devparms.timebaseoffset -= devparms.timebasescale * devparms.hordivisions;
if(devparms.memdepth > 10)
{
if(devparms.timebaseoffset <= -(((double)devparms.memdepth / devparms.samplerate) / 2))
{
devparms.timebaseoffset = -(((double)devparms.memdepth / devparms.samplerate) / 2);
}
}
else
{
if(devparms.timebaseoffset <= -((devparms.hordivisions / 2) * devparms.timebasescale))
{
devparms.timebaseoffset = -((devparms.hordivisions / 2) * devparms.timebasescale);
}
}
strcpy(str, "Horizontal position: ");
convert_to_metric_suffix(str + strlen(str), devparms.timebaseoffset, 2);
@ -1943,6 +1958,21 @@ void UI_Mainwindow::next_page()
{
devparms.timebaseoffset += devparms.timebasescale * devparms.hordivisions;
if(devparms.memdepth > 10)
{
if(devparms.timebaseoffset >= (((double)devparms.memdepth / devparms.samplerate) / 2))
{
devparms.timebaseoffset = (((double)devparms.memdepth / devparms.samplerate) / 2);
}
}
else
{
if(devparms.timebaseoffset >= (devparms.hordivisions / 2) * devparms.timebasescale)
{
devparms.timebaseoffset = (devparms.hordivisions / 2) * devparms.timebasescale;
}
}
strcpy(str, "Horizontal position: ");
convert_to_metric_suffix(str + strlen(str), devparms.timebaseoffset, 2);
@ -1999,6 +2029,21 @@ void UI_Mainwindow::shift_page_left()
{
devparms.timebaseoffset -= devparms.timebasescale;
if(devparms.memdepth > 10)
{
if(devparms.timebaseoffset <= -(((double)devparms.memdepth / devparms.samplerate) / 2))
{
devparms.timebaseoffset = -(((double)devparms.memdepth / devparms.samplerate) / 2);
}
}
else
{
if(devparms.timebaseoffset <= -((devparms.hordivisions / 2) * devparms.timebasescale))
{
devparms.timebaseoffset = -((devparms.hordivisions / 2) * devparms.timebasescale);
}
}
strcpy(str, "Horizontal position: ");
convert_to_metric_suffix(str + strlen(str), devparms.timebaseoffset, 2);
@ -2055,6 +2100,21 @@ void UI_Mainwindow::shift_page_right()
{
devparms.timebaseoffset += devparms.timebasescale;
if(devparms.memdepth > 10)
{
if(devparms.timebaseoffset >= (((double)devparms.memdepth / devparms.samplerate) / 2))
{
devparms.timebaseoffset = (((double)devparms.memdepth / devparms.samplerate) / 2);
}
}
else
{
if(devparms.timebaseoffset >= (devparms.hordivisions / 2) * devparms.timebasescale)
{
devparms.timebaseoffset = (devparms.hordivisions / 2) * devparms.timebasescale;
}
}
strcpy(str, "Horizontal position: ");
convert_to_metric_suffix(str + strlen(str), devparms.timebaseoffset, 2);

Wyświetl plik

@ -325,6 +325,7 @@ private slots:
void set_acq_peak();
void set_acq_hres();
void set_memdepth(int);
void set_memdepth_auto();
void set_memdepth_12k();
void set_memdepth_120k();