From 8813c6aaa1de284f2c913f4b861c0afa3c1dd5ba Mon Sep 17 00:00:00 2001 From: Teuniz Date: Sun, 8 Nov 2015 18:36:22 +0100 Subject: [PATCH] context menus: show the actual configuration channel labels: show when the input is inverted --- global.h | 10 +- interface.cpp | 385 ++++++++++++++++++++++++++++++++++++++++++++-- mainwindow.cpp | 78 ++++++++-- save_data.cpp | 2 +- screen_thread.cpp | 2 +- signalcurve.cpp | 22 ++- 6 files changed, 462 insertions(+), 37 deletions(-) diff --git a/global.h b/global.h index affe992..3c054ce 100644 --- a/global.h +++ b/global.h @@ -33,7 +33,7 @@ #define PROGRAM_NAME "DSRemote" -#define PROGRAM_VERSION "0.31_1510241634" +#define PROGRAM_VERSION "0.31_1511081835" #define MAX_PATHLEN 4096 @@ -107,8 +107,6 @@ struct device_settings int screentimerival; - double samplerate; // Samplefrequency - int memdepth; // Number of waveform points that the oscilloscope can store in a single trigger sample int channel_cnt; // Device has 2 or 4 channels int bandwidth; // Bandwidth in MHz @@ -142,7 +140,7 @@ struct device_settings double triggeredgelevel[7]; // Trigger level int triggeredgeslope; // 0=POS, 1=NEG, 2= RFAL int triggeredgesource; // 0=chan1, 1=chan2, 2=chan3, 3=chan4, 4=ext, 5=ext5, 6=acl - double triggerholdoff; // min. is 100nSec + double triggerholdoff; // min. is 16nSec or 100nSec depends on series int triggermode; // 0=edge, 1=pulse, 2=slope, 3=video, 4=pattern, 5=rs232, // 6=i2c, 7=spi, 8=can, 9=usb int triggerstatus; // 0=td, 1=wait, 2=run, 3=auto, 4=fin, 5=stop @@ -150,9 +148,13 @@ struct device_settings int displaygrid; // 0=none, 1=half, 2=full int displaytype; // 0=vectors, 1=dots + int displaygrading; // 0=minimum, 1=0.1, 2=0.2, 5=0.5, 1=10, 2=20, 5=50, 10000=infinite + double samplerate; // Samplefrequency int acquiretype; // 0=normal, 1=average, 2=peak, 3=highres int acquireaverages; // 2, 4, 8, 16, 32, 64, etc. to 8192 + int acquirememdepth; // Number of waveform points that the oscilloscope can + //store in a single trigger sample. 0=AUTO int countersrc; // 0=off, 1=ch1, 2=ch2, 3=ch3, 4=ch4 double counterfreq; // Value of frequency counter diff --git a/interface.cpp b/interface.cpp index bcead3a..5d98dcc 100644 --- a/interface.cpp +++ b/interface.cpp @@ -112,9 +112,19 @@ void UI_Mainwindow::navDialChanged(int npos) devparms.triggerholdoff += (val * mpr); - if(devparms.triggerholdoff < 1e-7) + if(devparms.modelserie == 1) { - devparms.triggerholdoff = 1e-7; + if(devparms.triggerholdoff < 1.7e-8) + { + devparms.triggerholdoff = 1.6e-8; + } + } + else + { + if(devparms.triggerholdoff < 1.01e-7) + { + devparms.triggerholdoff = 1e-7; + } } if(devparms.triggerholdoff > 10) @@ -265,13 +275,27 @@ void UI_Mainwindow::adjDialChanged(int new_pos) } else { - if(devparms.triggerholdoff <= 1e-7) + if(devparms.modelserie == 1) { - devparms.triggerholdoff = 1e-7; + if(devparms.triggerholdoff < 1.7e-8) + { + devparms.triggerholdoff = 1.6e-8; - old_pos = new_pos; + old_pos = new_pos; - return; + return; + } + } + else + { + if(devparms.triggerholdoff <= 1.01e-7) + { + devparms.triggerholdoff = 1e-7; + + old_pos = new_pos; + + return; + } } devparms.triggerholdoff -= get_stepsize_divide_by_1000(devparms.triggerholdoff); @@ -990,6 +1014,8 @@ void UI_Mainwindow::acqButtonClicked() submenuacquisition, submenumemdepth; + QList actionList; + for(chn=0; chnsetCheckable(true); + actionList[0]->setChecked(true); + } + else if(devparms.acquiretype == 1) + { + actionList[1]->setCheckable(true); + actionList[1]->setChecked(true); + } + else if(devparms.acquiretype == 2) + { + actionList[2]->setCheckable(true); + actionList[2]->setChecked(true); + } + else if(devparms.acquiretype == 3) + { + actionList[3]->setCheckable(true); + actionList[3]->setChecked(true); + } menu.addMenu(&submenuacquisition); submenumemdepth.setTitle("Mem Depth"); @@ -1091,6 +1138,74 @@ void UI_Mainwindow::acqButtonClicked() submenumemdepth.addAction("6M", this, SLOT(set_memdepth_6m())); } } + actionList = submenumemdepth.actions(); + if(devparms.acquirememdepth == 0) + { + actionList[0]->setCheckable(true); + actionList[0]->setChecked(true); + } + if(devparms.modelserie != 1) + { + if((devparms.acquirememdepth == 14000) || (devparms.acquirememdepth == 7000)) + { + actionList[1]->setCheckable(true); + actionList[1]->setChecked(true); + } + else if((devparms.acquirememdepth == 140000) || (devparms.acquirememdepth == 70000)) + { + actionList[2]->setCheckable(true); + actionList[2]->setChecked(true); + } + else if((devparms.acquirememdepth == 1400000) || (devparms.acquirememdepth == 700000)) + { + actionList[3]->setCheckable(true); + actionList[3]->setChecked(true); + } + else if((devparms.acquirememdepth == 14000000) || (devparms.acquirememdepth == 7000000)) + { + actionList[4]->setCheckable(true); + actionList[4]->setChecked(true); + } + else if((devparms.acquirememdepth == 140000000) || (devparms.acquirememdepth == 70000000) || + (devparms.acquirememdepth == 56000000) || (devparms.acquirememdepth == 28000000)) + { + actionList[5]->setCheckable(true); + actionList[5]->setChecked(true); + } + } + else + { + if((devparms.acquirememdepth == 12000) || (devparms.acquirememdepth == 6000) || + (devparms.acquirememdepth == 3000)) + { + actionList[1]->setCheckable(true); + actionList[1]->setChecked(true); + } + else if((devparms.acquirememdepth == 120000) || (devparms.acquirememdepth == 60000) || + (devparms.acquirememdepth == 30000)) + { + actionList[2]->setCheckable(true); + actionList[2]->setChecked(true); + } + else if((devparms.acquirememdepth == 1200000) || (devparms.acquirememdepth == 600000) || + (devparms.acquirememdepth == 300000)) + { + actionList[3]->setCheckable(true); + actionList[3]->setChecked(true); + } + else if((devparms.acquirememdepth == 12000000) || (devparms.acquirememdepth == 6000000) || + (devparms.acquirememdepth == 3000000)) + { + actionList[4]->setCheckable(true); + actionList[4]->setChecked(true); + } + else if((devparms.acquirememdepth == 24000000) || (devparms.acquirememdepth == 12000000) || + (devparms.acquirememdepth == 6000000)) + { + actionList[5]->setCheckable(true); + actionList[5]->setChecked(true); + } + } menu.addMenu(&submenumemdepth); menu.exec(acqButton->mapToGlobal(QPoint(0,0))); @@ -1383,29 +1498,99 @@ void UI_Mainwindow::dispButtonClicked() submenugrid, submenugrading; + QList actionList; + submenutype.setTitle("Type"); submenutype.addAction("Vectors", this, SLOT(set_grid_type_vectors())); submenutype.addAction("Dots", this, SLOT(set_grid_type_dots())); + actionList = submenutype.actions(); + if(devparms.displaytype == 0) + { + actionList[0]->setCheckable(true); + actionList[0]->setChecked(true); + } + else + { + actionList[1]->setCheckable(true); + actionList[1]->setChecked(true); + } menu.addMenu(&submenutype); submenugrid.setTitle("Grid"); submenugrid.addAction("Full", this, SLOT(set_grid_full())); submenugrid.addAction("Half", this, SLOT(set_grid_half())); submenugrid.addAction("None", this, SLOT(set_grid_none())); + actionList = submenugrid.actions(); + if(devparms.displaygrid == 2) + { + actionList[0]->setCheckable(true); + actionList[0]->setChecked(true); + } + else if(devparms.displaygrid == 1) + { + actionList[1]->setCheckable(true); + actionList[1]->setChecked(true); + } + else if(devparms.displaygrid == 0) + { + actionList[2]->setCheckable(true); + actionList[2]->setChecked(true); + } menu.addMenu(&submenugrid); submenugrading.setTitle("Persistence"); submenugrading.addAction("Minimum", this, SLOT(set_grading_min())); - submenugrading.addAction("0.05", this, SLOT(set_grading_005())); +// submenugrading.addAction("0.05", this, SLOT(set_grading_005())); submenugrading.addAction("0.1", this, SLOT(set_grading_01())); submenugrading.addAction("0.2", this, SLOT(set_grading_02())); submenugrading.addAction("0.5", this, SLOT(set_grading_05())); submenugrading.addAction("1", this, SLOT(set_grading_1())); submenugrading.addAction("2", this, SLOT(set_grading_2())); submenugrading.addAction("5", this, SLOT(set_grading_5())); - submenugrading.addAction("10", this, SLOT(set_grading_10())); - submenugrading.addAction("20", this, SLOT(set_grading_20())); +// submenugrading.addAction("10", this, SLOT(set_grading_10())); +// submenugrading.addAction("20", this, SLOT(set_grading_20())); submenugrading.addAction("Infinite", this, SLOT(set_grading_inf())); + actionList = submenugrading.actions(); + if(devparms.displaygrading == 0) + { + actionList[0]->setCheckable(true); + actionList[0]->setChecked(true); + } + else if(devparms.displaygrading == 1) + { + actionList[1]->setCheckable(true); + actionList[1]->setChecked(true); + } + else if(devparms.displaygrading == 2) + { + actionList[2]->setCheckable(true); + actionList[2]->setChecked(true); + } + else if(devparms.displaygrading == 5) + { + actionList[3]->setCheckable(true); + actionList[3]->setChecked(true); + } + else if(devparms.displaygrading == 10) + { + actionList[4]->setCheckable(true); + actionList[4]->setChecked(true); + } + else if(devparms.displaygrading == 20) + { + actionList[5]->setCheckable(true); + actionList[5]->setChecked(true); + } + else if(devparms.displaygrading == 50) + { + actionList[6]->setCheckable(true); + actionList[6]->setChecked(true); + } + else if(devparms.displaygrading == 10000) + { + actionList[7]->setCheckable(true); + actionList[7]->setChecked(true); + } menu.addMenu(&submenugrading); menu.exec(dispButton->mapToGlobal(QPoint(0,0))); @@ -1489,6 +1674,13 @@ void UI_Mainwindow::set_grid_none() void UI_Mainwindow::set_grading_min() { + if(devparms.displaygrading == 0) + { + return; + } + + devparms.displaygrading = 0; + statusLabel->setText("Display grading: Minimum"); set_cue_cmd(":DISP:GRAD:TIME MIN"); @@ -1505,6 +1697,13 @@ void UI_Mainwindow::set_grading_005() void UI_Mainwindow::set_grading_01() { + if(devparms.displaygrading == 1) + { + return; + } + + devparms.displaygrading = 1; + statusLabel->setText("Display grading: 0.1 Sec."); set_cue_cmd(":DISP:GRAD:TIME 0.1"); @@ -1513,6 +1712,13 @@ void UI_Mainwindow::set_grading_01() void UI_Mainwindow::set_grading_02() { + if(devparms.displaygrading == 2) + { + return; + } + + devparms.displaygrading = 2; + statusLabel->setText("Display grading: 0.2 Sec."); set_cue_cmd(":DISP:GRAD:TIME 0.2"); @@ -1521,6 +1727,13 @@ void UI_Mainwindow::set_grading_02() void UI_Mainwindow::set_grading_05() { + if(devparms.displaygrading == 5) + { + return; + } + + devparms.displaygrading = 5; + statusLabel->setText("Display grading: 0.5 Sec."); set_cue_cmd(":DISP:GRAD:TIME 0.5"); @@ -1529,6 +1742,13 @@ void UI_Mainwindow::set_grading_05() void UI_Mainwindow::set_grading_1() { + if(devparms.displaygrading == 10) + { + return; + } + + devparms.displaygrading = 10; + statusLabel->setText("Display grading: 1 Sec."); set_cue_cmd(":DISP:GRAD:TIME 1"); @@ -1537,6 +1757,13 @@ void UI_Mainwindow::set_grading_1() void UI_Mainwindow::set_grading_2() { + if(devparms.displaygrading == 20) + { + return; + } + + devparms.displaygrading = 20; + statusLabel->setText("Display grading: 2 Sec."); set_cue_cmd(":DISP:GRAD:TIME 2"); @@ -1545,6 +1772,13 @@ void UI_Mainwindow::set_grading_2() void UI_Mainwindow::set_grading_5() { + if(devparms.displaygrading == 50) + { + return; + } + + devparms.displaygrading = 50; + statusLabel->setText("Display grading: 5 Sec."); set_cue_cmd(":DISP:GRAD:TIME 5"); @@ -1569,6 +1803,13 @@ void UI_Mainwindow::set_grading_20() void UI_Mainwindow::set_grading_inf() { + if(devparms.displaygrading == 10000) + { + return; + } + + devparms.displaygrading = 10000; + statusLabel->setText("Display grading: Infinite"); set_cue_cmd(":DISP:GRAD:TIME INF"); @@ -1851,6 +2092,8 @@ void UI_Mainwindow::chan_menu() submenucoupling, submenuinvert; + QList actionList; + if((devparms.activechannel < 0) || (devparms.activechannel > MAX_CHNS)) { return; @@ -1860,17 +2103,66 @@ void UI_Mainwindow::chan_menu() submenucoupling.addAction("AC", this, SLOT(chan_coupling_ac())); submenucoupling.addAction("DC", this, SLOT(chan_coupling_dc())); submenucoupling.addAction("GND", this, SLOT(chan_coupling_gnd())); + actionList = submenucoupling.actions(); + if(devparms.chancoupling[devparms.activechannel] == 0) + { + actionList[2]->setCheckable(true); + actionList[2]->setChecked(true); + } + else if(devparms.chancoupling[devparms.activechannel] == 1) + { + actionList[1]->setCheckable(true); + actionList[1]->setChecked(true); + } + else if(devparms.chancoupling[devparms.activechannel] == 2) + { + actionList[0]->setCheckable(true); + actionList[0]->setChecked(true); + } menu.addMenu(&submenucoupling); submenubwl.setTitle("BWL"); submenubwl.addAction("Off", this, SLOT(chan_bwl_off())); submenubwl.addAction("20MHz", this, SLOT(chan_bwl_20())); - submenubwl.addAction("250MHz", this, SLOT(chan_bwl_250())); + if(devparms.modelserie == 6) + { + submenubwl.addAction("250MHz", this, SLOT(chan_bwl_250())); + } + actionList = submenubwl.actions(); + if(devparms.chanbwlimit[devparms.activechannel] == 0) + { + actionList[0]->setCheckable(true); + actionList[0]->setChecked(true); + } + else if(devparms.chanbwlimit[devparms.activechannel] == 20) + { + actionList[1]->setCheckable(true); + actionList[1]->setChecked(true); + } + else if(devparms.modelserie == 6) + { + if(devparms.chanbwlimit[devparms.activechannel] == 250) + { + actionList[2]->setCheckable(true); + actionList[2]->setChecked(true); + } + } menu.addMenu(&submenubwl); submenuinvert.setTitle("Invert"); submenuinvert.addAction("On", this, SLOT(chan_invert_on())); submenuinvert.addAction("Off", this, SLOT(chan_invert_off())); + actionList = submenuinvert.actions(); + if(devparms.chaninvert[devparms.activechannel] == 1) + { + actionList[0]->setCheckable(true); + actionList[0]->setChecked(true); + } + else + { + actionList[1]->setCheckable(true); + actionList[1]->setChecked(true); + } menu.addMenu(&submenuinvert); menu.exec(chanMenuButton->mapToGlobal(QPoint(0,0))); @@ -2138,9 +2430,22 @@ void UI_Mainwindow::horMenuButtonClicked() QMenu menu, submenudelayed; + QList actionList; + submenudelayed.setTitle("Delayed"); submenudelayed.addAction("On", this, SLOT(horizontal_delayed_on())); submenudelayed.addAction("Off", this, SLOT(horizontal_delayed_off())); + actionList = submenudelayed.actions(); + if(devparms.timebasedelayenable == 1) + { + actionList[0]->setCheckable(true); + actionList[0]->setChecked(true); + } + else + { + actionList[1]->setCheckable(true); + actionList[1]->setChecked(true); + } menu.addMenu(&submenudelayed); menu.exec(horMenuButton->mapToGlobal(QPoint(0,0))); @@ -2247,9 +2552,13 @@ void UI_Mainwindow::horScaleDialClicked(QPoint) void UI_Mainwindow::measureButtonClicked() { + int i; + QMenu menu, submenucounter; + QList actionList; + submenucounter.setTitle("Counter"); submenucounter.addAction("OFF", this, SLOT(counter_off())); submenucounter.addAction("CH1", this, SLOT(counter_ch1())); @@ -2265,7 +2574,17 @@ void UI_Mainwindow::measureButtonClicked() { submenucounter.addAction("CH4", this, SLOT(counter_ch4())); } + actionList = submenucounter.actions(); + for(i=0; i<5; i++) + { + if(devparms.countersrc == i) + { + actionList[i]->setCheckable(true); + actionList[i]->setChecked(true); + break; + } + } menu.addMenu(&submenucounter); menu.exec(measureButton->mapToGlobal(QPoint(0,0))); @@ -2351,12 +2670,18 @@ void UI_Mainwindow::trigModeButtonClicked() void UI_Mainwindow::trigMenuButtonClicked() { + int i; + + char str[512]; + QMenu menu, submenusource, submenuslope, submenucoupling, submenusetting; + QList actionList; + submenusource.setTitle("Source"); submenusource.addAction("CH1", this, SLOT(trigger_source_ch1())); if(devparms.channel_cnt > 1) @@ -2374,23 +2699,59 @@ void UI_Mainwindow::trigMenuButtonClicked() submenusource.addAction("EXT", this, SLOT(trigger_source_ext())); submenusource.addAction("EXT/ 5", this, SLOT(trigger_source_ext5())); submenusource.addAction("AC Line", this, SLOT(trigger_source_acl())); + actionList = submenusource.actions(); + for(i=0; i<7; i++) + { + if(devparms.triggeredgesource == i) + { + actionList[i]->setCheckable(true); + actionList[i]->setChecked(true); + + break; + } + } menu.addMenu(&submenusource); submenucoupling.setTitle("Coupling"); - submenucoupling.addAction("DC", this, SLOT(trigger_coupling_dc())); submenucoupling.addAction("AC", this, SLOT(trigger_coupling_ac())); + submenucoupling.addAction("DC", this, SLOT(trigger_coupling_dc())); submenucoupling.addAction("LF reject", this, SLOT(trigger_coupling_lfreject())); submenucoupling.addAction("HF reject", this, SLOT(trigger_coupling_hfreject())); + actionList = submenucoupling.actions(); + for(i=0; i<4; i++) + { + if(devparms.triggercoupling == i) + { + actionList[i]->setCheckable(true); + actionList[i]->setChecked(true); + + break; + } + } menu.addMenu(&submenucoupling); submenuslope.setTitle("Slope"); submenuslope.addAction("Positive", this, SLOT(trigger_slope_pos())); submenuslope.addAction("Negative", this, SLOT(trigger_slope_neg())); submenuslope.addAction("Rise/Fal", this, SLOT(trigger_slope_rfal())); + actionList = submenuslope.actions(); + for(i=0; i<3; i++) + { + if(devparms.triggeredgeslope == i) + { + actionList[i]->setCheckable(true); + actionList[i]->setChecked(true); + + break; + } + } menu.addMenu(&submenuslope); submenusetting.setTitle("Setting"); - submenusetting.addAction("Holdoff", this, SLOT(trigger_setting_holdoff())); + sprintf(str, "Holdoff "); + convert_to_metric_suffix(str + strlen(str), devparms.triggerholdoff, 3); + strcat(str, "S"); + submenusetting.addAction(str, this, SLOT(trigger_setting_holdoff())); menu.addMenu(&submenusetting); menu.exec(trigMenuButton->mapToGlobal(QPoint(0,0))); diff --git a/mainwindow.cpp b/mainwindow.cpp index d9c6a70..5fb8f5b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1573,6 +1573,58 @@ int UI_Mainwindow::get_device_settings() devparms.acquireaverages = atoi(device->buf); + usleep(TMC_GDS_DELAY); + + if(tmc_write(":DISP:GRAD:TIME?") != 16) + { + line = __LINE__; + goto OUT_ERROR; + } + + if(tmc_read() < 1) + { + line = __LINE__; + goto OUT_ERROR; + } + + if(!strcmp(device->buf, "MIN")) + { + devparms.displaygrading = 0; + } + else if(!strcmp(device->buf, "0.1")) + { + devparms.displaygrading = 1; + } + else if(!strcmp(device->buf, "0.2")) + { + devparms.displaygrading = 2; + } + else if(!strcmp(device->buf, "0.5")) + { + devparms.displaygrading = 5; + } + else if(!strcmp(device->buf, "1")) + { + devparms.displaygrading = 10; + } + else if(!strcmp(device->buf, "2")) + { + devparms.displaygrading = 20; + } + else if(!strcmp(device->buf, "5")) + { + devparms.displaygrading = 50; + } + else if(!strcmp(device->buf, "INF")) + { + devparms.displaygrading = 10000; + } + else + { + line = __LINE__; + goto OUT_ERROR; + } + QApplication::restoreOverrideCursor(); return 0; @@ -2059,11 +2111,11 @@ void UI_Mainwindow::former_page() { devparms.timebaseoffset -= devparms.timebasescale * devparms.hordivisions; - if(devparms.memdepth > 10) + if(devparms.acquirememdepth > 10) { - if(devparms.timebaseoffset <= -(((double)devparms.memdepth / devparms.samplerate) / 2)) + if(devparms.timebaseoffset <= -(((double)devparms.acquirememdepth / devparms.samplerate) / 2)) { - devparms.timebaseoffset = -(((double)devparms.memdepth / devparms.samplerate) / 2); + devparms.timebaseoffset = -(((double)devparms.acquirememdepth / devparms.samplerate) / 2); } } else @@ -2126,11 +2178,11 @@ void UI_Mainwindow::next_page() { devparms.timebaseoffset += devparms.timebasescale * devparms.hordivisions; - if(devparms.memdepth > 10) + if(devparms.acquirememdepth > 10) { - if(devparms.timebaseoffset >= (((double)devparms.memdepth / devparms.samplerate) / 2)) + if(devparms.timebaseoffset >= (((double)devparms.acquirememdepth / devparms.samplerate) / 2)) { - devparms.timebaseoffset = (((double)devparms.memdepth / devparms.samplerate) / 2); + devparms.timebaseoffset = (((double)devparms.acquirememdepth / devparms.samplerate) / 2); } } else @@ -2193,11 +2245,11 @@ void UI_Mainwindow::shift_page_left() { devparms.timebaseoffset -= devparms.timebasescale; - if(devparms.memdepth > 10) + if(devparms.acquirememdepth > 10) { - if(devparms.timebaseoffset <= -(((double)devparms.memdepth / devparms.samplerate) / 2)) + if(devparms.timebaseoffset <= -(((double)devparms.acquirememdepth / devparms.samplerate) / 2)) { - devparms.timebaseoffset = -(((double)devparms.memdepth / devparms.samplerate) / 2); + devparms.timebaseoffset = -(((double)devparms.acquirememdepth / devparms.samplerate) / 2); } } else @@ -2260,11 +2312,11 @@ void UI_Mainwindow::shift_page_right() { devparms.timebaseoffset += devparms.timebasescale; - if(devparms.memdepth > 10) + if(devparms.acquirememdepth > 10) { - if(devparms.timebaseoffset >= (((double)devparms.memdepth / devparms.samplerate) / 2)) + if(devparms.timebaseoffset >= (((double)devparms.acquirememdepth / devparms.samplerate) / 2)) { - devparms.timebaseoffset = (((double)devparms.memdepth / devparms.samplerate) / 2); + devparms.timebaseoffset = (((double)devparms.acquirememdepth / devparms.samplerate) / 2); } } else @@ -2722,7 +2774,7 @@ void UI_Mainwindow::set_to_factory() devparms.acquiretype = 0; - devparms.memdepth = 0; + devparms.acquirememdepth = 0; devparms.triggermode = 0; diff --git a/save_data.cpp b/save_data.cpp index 17aed79..b59c875 100644 --- a/save_data.cpp +++ b/save_data.cpp @@ -189,7 +189,7 @@ void UI_Mainwindow::save_memory_waveform() wavbuf[2] = NULL; wavbuf[3] = NULL; - mempnts = devparms.memdepth; + mempnts = devparms.acquirememdepth; smps_per_record = mempnts; diff --git a/screen_thread.cpp b/screen_thread.cpp index 44f59ef..dcf688d 100644 --- a/screen_thread.cpp +++ b/screen_thread.cpp @@ -92,7 +92,7 @@ void screenThread::get_params(struct device_settings *dev_parms) dev_parms->triggerstatus = params.triggerstatus; dev_parms->triggersweep = params.triggersweep; dev_parms->samplerate = params.samplerate; - dev_parms->memdepth = params.memdepth; + dev_parms->acquirememdepth = params.memdepth; dev_parms->counterfreq = params.counterfreq; dev_parms->wavebufsz = params.wavebufsz; for(i=0; imemdepth > 1000) && !devparms->timebasedelayenable) + if((devparms->acquirememdepth > 1000) && !devparms->timebasedelayenable) { - tmp = 405 - ((devparms->timebaseoffset / (devparms->memdepth / devparms->samplerate)) * 233); + tmp = 405 - ((devparms->timebaseoffset / (devparms->acquirememdepth / devparms->samplerate)) * 233); } else { @@ -673,9 +673,9 @@ void SignalCurve::drawTopLabels(QPainter *painter) painter->drawText(200, -1, 85, 20, Qt::AlignCenter, str); - if(devparms->memdepth) + if(devparms->acquirememdepth) { - convert_to_metric_suffix(str, devparms->memdepth, 1); + convert_to_metric_suffix(str, devparms->acquirememdepth, 1); strcat(str, "pts"); @@ -716,9 +716,9 @@ void SignalCurve::drawTopLabels(QPainter *painter) painter->fillRect(288 + 233 - x1, 16, x1, 8, QColor(64, 160, 255)); } } - else if(devparms->memdepth > 1000) + else if(devparms->acquirememdepth > 1000) { - dtmp1 = (devparms->hordivisions * devparms->timebasescale) / (devparms->memdepth / devparms->samplerate); + dtmp1 = (devparms->hordivisions * devparms->timebasescale) / (devparms->acquirememdepth / devparms->samplerate); dtmp2 = devparms->timebaseoffset / dtmp1; @@ -907,6 +907,11 @@ void SignalCurve::drawChanLabel(QPainter *painter, int xpos, int ypos, int chn) painter->drawText(xpos + 6, ypos + 15, str1); + if(devparms->chaninvert[chn]) + { + painter->drawLine(xpos + 6, ypos + 3, xpos + 14, ypos + 3); + } + path = QPainterPath(); path.addRoundedRect(xpos + 25, ypos, 85, 20, 3, 3); @@ -963,6 +968,11 @@ void SignalCurve::drawChanLabel(QPainter *painter, int xpos, int ypos, int chn) painter->drawText(xpos + 6, ypos + 15, str1); + if(devparms->chaninvert[chn]) + { + painter->drawLine(xpos + 6, ypos + 3, xpos + 14, ypos + 3); + } + painter->drawText(xpos + 30, ypos + 1, 85, 20, Qt::AlignCenter, str2); if(devparms->chanbwlimit[chn])