@@ -70,6 +70,11 @@ EyeDiagramPlot::~EyeDiagramPlot()
70
70
71
71
void EyeDiagramPlot::enableTrace (Trace *t, bool enabled)
72
72
{
73
+ bool already_enabled = trace == t;
74
+ if (already_enabled == enabled) {
75
+ // ignore, the requested condition is already fulfilled
76
+ return ;
77
+ }
73
78
if (enabled) {
74
79
// only one trace at a time is allowed, disable all others
75
80
for (auto t : traces) {
@@ -373,11 +378,13 @@ void EyeDiagramPlot::axisSetupDialog()
373
378
yAxis.set (yAxis.getType (), false , ui->Yauto ->isChecked (), ui->Ymin ->value (), ui->Ymax ->value (), ui->Ydivs ->value (), ui->YautoDivs ->isChecked ());
374
379
};
375
380
376
- connect (ui->buttonBox ->button (QDialogButtonBox::Ok), &QPushButton::clicked, [=](){
377
- updateValues ();
381
+ connect (ui->buttonBox ->button (QDialogButtonBox::Ok), &QPushButton::clicked, this , [=](){
382
+ triggerUpdate ();
383
+ updateValues ();
378
384
});
379
- connect (ui->buttonBox ->button (QDialogButtonBox::Apply), &QPushButton::clicked, [=](){
380
- updateValues ();
385
+ connect (ui->buttonBox ->button (QDialogButtonBox::Apply), &QPushButton::clicked, this , [=](){
386
+ triggerUpdate ();
387
+ updateValues ();
381
388
});
382
389
383
390
if (AppWindow::showGUI ()) {
@@ -395,7 +402,7 @@ void EyeDiagramPlot::updateContextMenu()
395
402
contextmenu->addSeparator ();
396
403
auto image = new QAction (" Save image..." , contextmenu);
397
404
contextmenu->addAction (image);
398
- connect (image, &QAction::triggered, [=]() {
405
+ connect (image, &QAction::triggered, this , [=]() {
399
406
auto filename = QFileDialog::getSaveFileName (nullptr , " Save plot image" , " " , " PNG image files (*.png)" , nullptr , Preferences::QFileDialogOptions ());
400
407
if (filename.isEmpty ()) {
401
408
// aborted selection
@@ -419,7 +426,7 @@ void EyeDiagramPlot::updateContextMenu()
419
426
if (traces[t]) {
420
427
action->setChecked (true );
421
428
}
422
- connect (action, &QAction::toggled, [=](bool active) {
429
+ connect (action, &QAction::toggled, this , [=](bool active) {
423
430
enableTrace (t, active);
424
431
});
425
432
contextmenu->addAction (action);
@@ -693,7 +700,7 @@ void EyeDiagramPlot::draw(QPainter &p)
693
700
694
701
bool EyeDiagramPlot::supported (Trace *t)
695
702
{
696
- if (t->getDataType () != Trace::DataType::Frequency) {
703
+ if (t->outputType () != Trace::DataType::Frequency) {
697
704
// wrong domain
698
705
return false ;
699
706
}
@@ -932,13 +939,13 @@ void EyeThread::run()
932
939
if (eye.linearEdge ) {
933
940
if (next > last) {
934
941
// rising edge
935
- double max_rise = timestep / (eye.risetime * 1.25 );
942
+ double max_rise = abs (eye. highlevel - eye. lowlevel ) * timestep / (eye.risetime * 1.25 );
936
943
if (next - last > max_rise) {
937
944
next = last + max_rise;
938
945
}
939
946
} else {
940
947
// falling edge
941
- double max_fall = timestep / (eye.falltime * 1.25 );
948
+ double max_fall = abs (eye. highlevel - eye. lowlevel ) * timestep / (eye.falltime * 1.25 );
942
949
if (next - last < -max_fall) {
943
950
next = last - max_fall;
944
951
}
0 commit comments