19 #include <QColorDialog> 20 #include <QFileDialog> 21 #include <QMessageBox> 25 #include "ui_glscopegui.h" 51 qDebug(
"GLScopeGUI::GLScopeGUI");
55 ui->traceColor->setStyleSheet(
"QLabel { background-color : rgb(255,255,64); }");
57 ui->trigColor->setStyleSheet(
"QLabel { background-color : rgb(0,255,0); }");
59 ui->traceText->setText(
"X");
70 qDebug(
"GLScopeGUI::setBuddies");
77 ui->onlyX->setChecked(
true);
78 ui->onlyY->setChecked(
false);
79 ui->horizontalXY->setChecked(
false);
80 ui->verticalXY->setChecked(
false);
81 ui->polar->setChecked(
false);
82 ui->onlyY->setEnabled(
false);
83 ui->horizontalXY->setEnabled(
false);
84 ui->verticalXY->setEnabled(
false);
85 ui->polar->setEnabled(
false);
89 ui->trigPos->setChecked(
true);
90 ui->trigNeg->setChecked(
false);
91 ui->trigBoth->setChecked(
false);
92 ui->trigOneShot->setChecked(
false);
93 ui->trigOneShot->setEnabled(
false);
94 ui->freerun->setChecked(
true);
111 ui->traceMode->clear();
114 ui->trigMode->clear();
121 ui->freerun->isChecked());
127 ui->freerun->isChecked());
146 ui->sampleRateText->setText(tr(
"%1\nkS/s").
arg(
m_sampleRate / 1000.0f, 0,
'f', 2));
157 qDebug(
"GLScopeGUI::on_scope_traceSizeChanged: %u", traceNbSamples);
165 qDebug(
"GLScopeGUI::on_scope_preTriggerChanged: %u", preTriggerNbSamples);
189 std::vector<ScopeVis::TraceData>::const_iterator traceDataIt = tracesData.begin();
193 for (; traceDataIt != tracesData.end(); ++traceDataIt, i++)
195 s.
writeS32(20 + 16*i, (
int) traceDataIt->m_projectionType);
196 s.
writeU32(21 + 16*i, traceDataIt->m_ampIndex);
197 s.
writeS32(22 + 16*i, traceDataIt->m_ofsCoarse);
198 s.
writeS32(23 + 16*i, traceDataIt->m_ofsFine);
199 s.
writeS32(24 + 16*i, traceDataIt->m_traceDelayCoarse);
200 s.
writeS32(25 + 16*i, traceDataIt->m_traceDelayFine);
201 s.
writeFloat(26 + 16*i, traceDataIt->m_traceColorR);
202 s.
writeFloat(27 + 16*i, traceDataIt->m_traceColorG);
203 s.
writeFloat(28 + 16*i, traceDataIt->m_traceColorB);
232 qDebug(
"GLScopeGUI::deserialize");
248 ui->onlyX->setEnabled(
false);
249 ui->onlyY->setEnabled(
false);
250 ui->horizontalXY->setEnabled(
false);
251 ui->verticalXY->setEnabled(
false);
252 ui->polar->setEnabled(
false);
254 ui->traceMode->setCurrentIndex(0);
258 ui->onlyX->setChecked(
false);
259 ui->onlyY->setChecked(
false);
260 ui->horizontalXY->setChecked(
false);
261 ui->verticalXY->setChecked(
false);
262 ui->polar->setChecked(
false);
267 ui->onlyY->setChecked(
true);
270 ui->horizontalXY->setChecked(
true);
273 ui->verticalXY->setChecked(
true);
276 ui->polar->setChecked(
true);
280 ui->onlyX->setChecked(
true);
285 ui->traceIntensity->setValue(intValue);
287 ui->gridIntensity->setValue(intValue);
289 ui->time->setValue(intValue);
291 ui->timeOfs->setValue(intValue);
293 ui->traceLen->setValue(intValue);
298 d.
readU32(10, &nbTracesSaved, 1);
300 uint32_t iTrace = tracesData.size();
302 qDebug(
"GLScopeGUI::deserialize: nbTracesSaved: %u tracesData.size(): %lu", nbTracesSaved, tracesData.size());
304 while (iTrace > nbTracesSaved)
310 for (iTrace = 0; iTrace < nbTracesSaved; iTrace++)
315 d.
readS32(20 + 16*iTrace, &intValue, 0);
316 ui->traceMode->setCurrentIndex(intValue);
317 d.
readU32(21 + 16*iTrace, &uintValue, 0);
318 ui->amp->setValue(uintValue);
319 d.
readS32(22 + 16*iTrace, &intValue, 0);
320 ui->ofsCoarse->setValue(intValue);
321 d.
readS32(23 + 16*iTrace, &intValue, 0);
322 ui->ofsFine->setValue(intValue);
323 d.
readS32(24 + 16*iTrace, &intValue, 0);
324 ui->traceDelayCoarse->setValue(intValue);
325 d.
readS32(25 + 16*iTrace, &intValue, 0);
326 ui->traceDelayFine->setValue(intValue);
334 if (iTrace < tracesData.size())
345 ui->trace->setMaximum(nbTracesSaved-1);
346 ui->trace->setValue(nbTracesSaved-1);
351 ui->traceColor->setStyleSheet(tr(
"QLabel { background-color : rgb(%1,%2,%3); }").
arg(r).
arg(g).
arg(b));
358 ui->onlyX->setEnabled(
true);
359 ui->onlyY->setEnabled(nbTracesSaved > 1);
360 ui->horizontalXY->setEnabled(nbTracesSaved > 1);
361 ui->verticalXY->setEnabled(nbTracesSaved > 1);
362 ui->polar->setEnabled(nbTracesSaved > 1);
367 d.
readU32(200, &nbTriggersSaved, 1);
372 ui->trigPre->setValue(intValue);
374 qDebug(
"GLScopeGUI::deserialize: nbTriggersSaved: %u nbTriggers: %u", nbTriggersSaved, nbTriggers);
376 while (iTrigger > nbTriggersSaved)
382 for (iTrigger = 0; iTrigger < nbTriggersSaved; iTrigger++)
387 d.
readS32(210 + 16*iTrigger, &intValue, 0);
388 ui->trigMode->setCurrentIndex(intValue);
389 d.
readS32(211 + 16*iTrigger, &intValue, 1);
390 ui->trigCount->setValue(intValue);
391 d.
readBool(212 + 16*iTrigger, &boolValue,
true);
392 ui->trigPos->setChecked(boolValue);
393 d.
readBool(213 + 16*iTrigger, &boolValue,
false);
394 ui->trigBoth->setChecked(boolValue);
395 d.
readS32(214 + 16*iTrigger, &intValue, 1);
396 ui->trigLevelCoarse->setValue(intValue);
397 d.
readS32(215 + 16*iTrigger, &intValue, 1);
398 ui->trigLevelFine->setValue(intValue);
399 d.
readS32(216 + 16*iTrigger, &intValue, 1);
400 ui->trigDelayCoarse->setValue(intValue);
401 d.
readS32(217 + 16*iTrigger, &intValue, 1);
402 ui->trigDelayFine->setValue(intValue);
403 d.
readFloat(218 + 16*iTrigger, &r, 1.0f);
404 d.
readFloat(219 + 16*iTrigger, &g, 1.0f);
405 d.
readFloat(220 + 16*iTrigger, &b, 1.0f);
407 d.
readU32(221 + 16*iTrigger, &uintValue, 1);
408 ui->trigHoldoff->setValue(uintValue);
409 ui->trigHoldoffText->setText(tr(
"%1").
arg(uintValue));
413 if (iTrigger < nbTriggers)
422 if (iTrigger == nbTriggersSaved-1)
428 ui->trig->setMaximum(nbTriggersSaved-1);
429 ui->trig->setValue(nbTriggersSaved-1);
432 ui->trigColor->setStyleSheet(tr(
"QLabel { background-color : rgb(%1,%2,%3); }").
arg(r).
arg(g).
arg(b));
453 ui->onlyY->setChecked(
false);
454 ui->horizontalXY->setChecked(
false);
455 ui->verticalXY->setChecked(
false);
456 ui->polar->setChecked(
false);
461 if (!
ui->onlyY->isChecked() && !
ui->horizontalXY->isChecked() && !
ui->verticalXY->isChecked() && !
ui->polar->isChecked()) {
462 ui->polar->setChecked(
true);
471 ui->onlyX->setChecked(
false);
472 ui->horizontalXY->setChecked(
false);
473 ui->verticalXY->setChecked(
false);
474 ui->polar->setChecked(
false);
479 if (!
ui->onlyX->isChecked() && !
ui->horizontalXY->isChecked() && !
ui->verticalXY->isChecked() && !
ui->polar->isChecked()) {
480 ui->polar->setChecked(
true);
489 ui->onlyX->setChecked(
false);
490 ui->onlyY->setChecked(
false);
491 ui->verticalXY->setChecked(
false);
492 ui->polar->setChecked(
false);
497 if (!
ui->onlyX->isChecked() && !
ui->onlyY->isChecked() && !
ui->verticalXY->isChecked() && !
ui->polar->isChecked()) {
498 ui->polar->setChecked(
true);
507 ui->onlyX->setChecked(
false);
508 ui->onlyY->setChecked(
false);
509 ui->horizontalXY->setChecked(
false);
510 ui->polar->setChecked(
false);
515 if (!
ui->onlyX->isChecked() && !
ui->onlyY->isChecked() && !
ui->horizontalXY->isChecked() && !
ui->polar->isChecked()) {
516 ui->polar->setChecked(
true);
525 ui->onlyX->setChecked(
false);
526 ui->onlyY->setChecked(
false);
527 ui->horizontalXY->setChecked(
false);
528 ui->verticalXY->setChecked(
false);
533 if (!
ui->onlyX->isChecked() && !
ui->onlyY->isChecked() && !
ui->horizontalXY->isChecked() && !
ui->verticalXY->isChecked()) {
534 ui->polar->setChecked(
true);
546 ui->traceIntensity->setToolTip(QString(
"Trace intensity: %1").
arg(value));
552 ui->gridIntensity->setToolTip(QString(
"Grid intensity: %1").
arg(value));
565 ui->freerun->isChecked());
570 if ((value < 0) || (value > 100)) {
580 ui->freerun->isChecked());
585 if ((value < 1) || (value > 100)) {
594 ui->freerun->isChecked());
604 ui->traceText->setText(value == 0 ?
"X" : QString(
"Y%1").
arg(
ui->trace->value()));
609 qDebug() <<
"GLScopeGUI::on_trace_valueChanged:" 611 <<
" m_amp" << traceData.
m_amp 612 <<
" m_ofs" << traceData.
m_ofs 631 if (
ui->trace->value() > 0)
633 ui->trace->setMaximum(
ui->trace->maximum() - 1);
635 if (
ui->trace->value() == 0)
637 ui->onlyX->setChecked(
true);
638 ui->onlyY->setEnabled(
false);
639 ui->horizontalXY->setEnabled(
false);
640 ui->verticalXY->setEnabled(
false);
641 ui->polar->setEnabled(
false);
653 if (
ui->trace->maximum() > 0)
655 int newTraceIndex = (
ui->trace->value() + 1) % (
ui->trace->maximum()+1);
657 ui->trace->setValue(newTraceIndex);
668 if (
ui->trace->value() > 0)
670 int newTraceIndex = (
ui->trace->value() - 1) % (
ui->trace->maximum()+1);
672 ui->trace->setValue(newTraceIndex);
682 ui->trigText->setText(tr(
"%1").
arg(value));
687 qDebug() <<
"GLScopeGUI::on_trig_valueChanged:" 710 if (
ui->trig->value() > 0)
713 ui->trig->setMaximum(
ui->trig->maximum() - 1);
720 if (
ui->trig->maximum() > 0)
722 int newTriggerIndex = (
ui->trig->value() + 1) % (
ui->trig->maximum()+1);
724 ui->trig->setValue(newTriggerIndex);
735 if (
ui->trig->value() > 0)
737 int newTriggerIndex = (
ui->trig->value() - 1) % (
ui->trig->maximum()+1);
739 ui->trig->setValue(newTriggerIndex);
798 QColor newColor = QColorDialog::getColor(
m_focusedTraceColor,
this, tr(
"Select Color for trace"), QColorDialog::DontUseNativeDialog);
800 if (newColor.isValid())
805 ui->traceColor->setStyleSheet(tr(
"QLabel { background-color : rgb(%1,%2,%3); }").
arg(r).
arg(g).
arg(b));
813 QString fileName = QFileDialog::getSaveFileName(
this,
814 tr(
"Open trace memory file"),
".", tr(
"Trace memory files (*.trcm)"), 0, QFileDialog::DontUseNativeDialog);
818 QFileInfo fileInfo(fileName);
820 if (fileInfo.suffix() !=
"trcm") {
824 QFile exportFile(fileName);
826 if (exportFile.open(QIODevice::WriteOnly | QIODevice::Text))
829 QTextStream outstream(&exportFile);
830 outstream << base64Str;
832 qDebug(
"GLScopeGUI::on_memorySave_clicked: saved to %s", qPrintable(fileName));
836 QMessageBox::information(
this, tr(
"Message"), tr(
"Cannot open %1 file for writing").
arg(fileName));
844 qDebug(
"GLScopeGUI::on_memoryLoad_clicked");
846 QString fileName = QFileDialog::getOpenFileName(
this,
847 tr(
"Open trace memory file"),
".", tr(
"Trace memory files (*.trcm)"), 0, QFileDialog::DontUseNativeDialog);
851 QFile exportFile(fileName);
853 if (exportFile.open(QIODevice::ReadOnly | QIODevice::Text))
855 QByteArray base64Str;
856 QTextStream instream(&exportFile);
857 instream >> base64Str;
860 qDebug(
"GLScopeGUI::on_memoryLoad_clicked: loaded from %s", qPrintable(fileName));
864 QMessageBox::information(
this, tr(
"Message"), tr(
"Cannot open file %1 for reading").
arg(fileName));
872 text.sprintf(
"%02d", value);
873 ui->memText->setText(text);
896 ui->trigNeg->setChecked(
false);
897 ui->trigBoth->setChecked(
false);
906 ui->trigPos->setChecked(
false);
907 ui->trigBoth->setChecked(
false);
916 ui->trigNeg->setChecked(
false);
917 ui->trigPos->setChecked(
false);
924 ui->trigHoldoffText->setText(tr(
"%1").
arg(value));
964 ui->freerun->isChecked());
969 QColor newColor = QColorDialog::getColor(
m_focusedTriggerColor,
this, tr(
"Select Color for trigger line"), QColorDialog::DontUseNativeDialog);
971 if (newColor.isValid())
976 ui->trigColor->setStyleSheet(tr(
"QLabel { background-color : rgb(%1,%2,%3); }").
arg(r).
arg(g).
arg(b));
990 ui->trigOneShot->setChecked(
false);
991 ui->trigOneShot->setEnabled(
false);
995 ui->trigOneShot->setEnabled(
true);
1002 ui->freerun->isChecked());
1007 ui->traceText->setText(
ui->trace->value() == 0 ?
"X" : QString(
"Y%1").arg(
ui->trace->value()));
1013 text.sprintf(
"%02d",
ui->trigCount->value());
1014 ui->trigCountText->setText(text);
1023 if (n_samples < 1000) {
1024 ui->timeText->setToolTip(tr(
"%1 S").
arg(n_samples));
1025 }
else if (n_samples < 1000000) {
1026 ui->timeText->setToolTip(tr(
"%1 kS").
arg(n_samples/1000.0));
1028 ui->timeText->setToolTip(tr(
"%1 MS").
arg(n_samples/1000000.0));
1033 t = round(t * 100000000000.0) / 100.0;
1034 ui->timeText->setText(tr(
"%1\nns").
arg(t));
1038 t = round(t * 100000000.0) / 100.0;
1039 ui->timeText->setText(tr(
"%1\nµs").
arg(t));
1043 t = round(t * 100000.0) / 100.0;
1044 ui->timeText->setText(tr(
"%1\nms").
arg(t));
1048 t = round(t * 100.0) / 100.0;
1049 ui->timeText->setText(tr(
"%1\ns").
arg(t));
1057 if (n_samples < 1000) {
1058 ui->traceLenText->setToolTip(tr(
"%1 S").
arg(n_samples));
1059 }
else if (n_samples < 1000000) {
1060 ui->traceLenText->setToolTip(tr(
"%1 kS").
arg(n_samples/1000.0));
1062 ui->traceLenText->setToolTip(tr(
"%1 MS").
arg(n_samples/1000000.0));
1069 ui->traceLenText->setText(tr(
"%1\nns").
arg(t * 1000000000.0, 0,
'f', 2));
1071 ui->traceLenText->setText(tr(
"%1\nµs").
arg(t * 1000000.0, 0,
'f', 2));
1073 ui->traceLenText->setText(tr(
"%1\nms").
arg(t * 1000.0, 0,
'f', 2));
1075 ui->traceLenText->setText(tr(
"%1\ns").
arg(t * 1.0, 0,
'f', 2));
1083 if (n_samples < 1000) {
1084 ui->timeOfsText->setToolTip(tr(
"%1 S").
arg(n_samples));
1085 }
else if (n_samples < 1000000) {
1086 ui->timeOfsText->setToolTip(tr(
"%1 kS").
arg(n_samples/1000.0));
1088 ui->timeOfsText->setToolTip(tr(
"%1 MS").
arg(n_samples/1000000.0));
1092 ui->timeOfsText->setText(tr(
"%1\nns").
arg(dt * 1000000000.0, 0,
'f', 2));
1094 ui->timeOfsText->setText(tr(
"%1\nµs").
arg(dt * 1000000.0, 0,
'f', 2));
1096 ui->timeOfsText->setText(tr(
"%1\nms").
arg(dt * 1000.0, 0,
'f', 2));
1098 ui->timeOfsText->setText(tr(
"%1\ns").
arg(dt * 1.0, 0,
'f', 2));
1104 double ampValue =
amps[
ui->amp->value()];
1108 double displayValue = ampValue*500.0f;
1110 if (displayValue < 10.0f) {
1111 ui->ampText->setText(tr(
"%1\ndB").
arg(displayValue, 0,
'f', 2));
1114 ui->ampText->setText(tr(
"%1\ndB").
arg(displayValue, 0,
'f', 1));
1119 double a = ampValue*10.0f;
1122 ui->ampText->setText(tr(
"%1\nn").
arg(a * 1000000000.0));
1124 ui->ampText->setText(tr(
"%1\nµ").
arg(a * 1000000.0));
1126 ui->ampText->setText(tr(
"%1\nm").
arg(a * 1000.0));
1128 ui->ampText->setText(tr(
"%1").
arg(a * 1.0));
1135 double o = (
ui->ofsCoarse->value() * 10.0f) + (
ui->ofsFine->value() / 20.0f);
1139 ui->ofsText->setText(tr(
"%1\ndB").
arg(o/10.0f - 100.0f, 0,
'f', 1));
1155 ui->ofsText->setText(tr(
"%1\np").
arg(a * 1e12));
1156 else if(fabs(a) < 1e-6)
1157 ui->ofsText->setText(tr(
"%1\nn").
arg(a * 1e9));
1158 else if(fabs(a) < 1e-3)
1159 ui->ofsText->setText(tr(
"%1\nµ").
arg(a * 1e6));
1160 else if(fabs(a) < 1.0f)
1161 ui->ofsText->setText(tr(
"%1\nm").
arg(a * 1e3));
1163 ui->ofsText->setText(tr(
"%1").
arg(a * 1.0));
1171 int n_samples =
ui->traceDelayCoarse->value()*100 +
ui->traceDelayFine->value();
1174 if (n_samples < 1000) {
1175 ui->traceDelayText->setToolTip(tr(
"%1 S").
arg(n_samples));
1176 }
else if (n_samples < 1000000) {
1177 ui->traceDelayText->setToolTip(tr(
"%1 kS").
arg(n_samples/1000.0));
1179 ui->traceDelayText->setToolTip(tr(
"%1 MS").
arg(n_samples/1000000.0));
1183 ui->traceDelayText->setText(tr(
"%1\nns").
arg(t * 1000000000.0, 0,
'f', 2));
1185 ui->traceDelayText->setText(tr(
"%1\nµs").
arg(t * 1000000.0, 0,
'f', 2));
1187 ui->traceDelayText->setText(tr(
"%1\nms").
arg(t * 1000.0, 0,
'f', 2));
1189 ui->traceDelayText->setText(tr(
"%1\ns").
arg(t * 1.0, 0,
'f', 2));
1195 ui->trigText->setText(tr(
"%1").
arg(
ui->trig->value()));
1200 double t = (
ui->trigLevelCoarse->value() / 100.0f) + (
ui->trigLevelFine->value() / 50000.0f);
1203 ui->trigLevelCoarse->setToolTip(QString(
"Trigger level coarse: %1 %").
arg(
ui->trigLevelCoarse->value() / 100.0f));
1204 ui->trigLevelFine->setToolTip(QString(
"Trigger level fine: %1 ppm").
arg(
ui->trigLevelFine->value() * 20));
1207 ui->trigLevelText->setText(tr(
"%1\ndB").
arg(100.0 * (t - 1.0), 0,
'f', 1));
1219 if(fabs(a) < 0.000001)
1220 ui->trigLevelText->setText(tr(
"%1\nn").
arg(a * 1000000000.0f, 0,
'f', 2));
1221 else if(fabs(a) < 0.001)
1222 ui->trigLevelText->setText(tr(
"%1\nµ").
arg(a * 1000000.0f, 0,
'f', 2));
1223 else if(fabs(a) < 1.0)
1224 ui->trigLevelText->setText(tr(
"%1\nm").
arg(a * 1000.0f, 0,
'f', 2));
1226 ui->trigLevelText->setText(tr(
"%1").
arg(a * 1.0f, 0,
'f', 2));
1237 if (n_samples_delay < 1000) {
1238 ui->trigDelayText->setToolTip(tr(
"%1 S").
arg(n_samples_delay));
1239 }
else if (n_samples_delay < 1000000) {
1240 ui->trigDelayText->setToolTip(tr(
"%1 kS").
arg(n_samples_delay/1000.0));
1241 }
else if (n_samples_delay < 1000000000) {
1242 ui->trigDelayText->setToolTip(tr(
"%1 MS").
arg(n_samples_delay/1000000.0));
1244 ui->trigDelayText->setToolTip(tr(
"%1 GS").
arg(n_samples_delay/1000000000.0));
1251 ui->trigDelayText->setText(tr(
"%1\nns").
arg(t * 1000000000.0, 0,
'f', 2));
1253 ui->trigDelayText->setText(tr(
"%1\nµs").
arg(t * 1000000.0, 0,
'f', 2));
1255 ui->trigDelayText->setText(tr(
"%1\nms").
arg(t * 1000.0, 0,
'f', 2));
1257 ui->trigDelayText->setText(tr(
"%1\ns").
arg(t * 1.0, 0,
'f', 2));
1268 if (n_samples_delay < 1000) {
1269 ui->trigPreText->setToolTip(tr(
"%1 S").
arg(n_samples_delay));
1270 }
else if (n_samples_delay < 1000000) {
1271 ui->trigPreText->setToolTip(tr(
"%1 kS").
arg(n_samples_delay/1000.0));
1272 }
else if (n_samples_delay < 1000000000) {
1273 ui->trigPreText->setToolTip(tr(
"%1 MS").
arg(n_samples_delay/1000000.0));
1275 ui->trigPreText->setToolTip(tr(
"%1 GS").
arg(n_samples_delay/1000000000.0));
1279 ui->trigPreText->setText(tr(
"%1\nns").
arg(dt * 1000000000.0f, 0,
'f', 2));
1281 ui->trigPreText->setText(tr(
"%1\nµs").
arg(dt * 1000000.0f, 0,
'f', 2));
1283 ui->trigPreText->setText(tr(
"%1\nms").
arg(dt * 1000.0f, 0,
'f', 2));
1285 ui->trigPreText->setText(tr(
"%1\ns").
arg(dt * 1.0f, 0,
'f', 2));
1293 uint32_t currentTraceIndex =
ui->trace->value();
1301 uint32_t currentTriggerIndex =
ui->trig->value();
1322 ui->traceLen->setEnabled(!disable);
1323 ui->trig->setEnabled(!disable);
1324 ui->trigAdd->setEnabled(!disable);
1325 ui->trigDel->setEnabled(!disable);
1326 ui->trigMode->setEnabled(!disable);
1327 ui->trigCount->setEnabled(!disable);
1328 ui->trigPos->setEnabled(!disable);
1329 ui->trigNeg->setEnabled(!disable);
1330 ui->trigBoth->setEnabled(!disable);
1331 ui->trigLevelCoarse->setEnabled(!disable);
1332 ui->trigLevelFine->setEnabled(!disable);
1333 ui->trigDelayCoarse->setEnabled(!disable);
1334 ui->trigDelayFine->setEnabled(!disable);
1335 ui->trigPre->setEnabled(!disable);
1336 ui->trigOneShot->setEnabled(!disable);
1337 ui->freerun->setEnabled(!disable);
1338 ui->memorySave->setEnabled(disable);
1339 ui->memoryLoad->setEnabled(disable);
1355 traceData.
m_ofs = ((10.0 *
ui->ofsCoarse->value()) + (
ui->ofsFine->value() / 20.0)) / 2000.0f;
1357 traceData.
m_ofs = ((10.0 *
ui->ofsCoarse->value()) + (
ui->ofsFine->value() / 20.0)) / 1000.0f;
1371 triggerData.
m_triggerLevel = (
ui->trigLevelCoarse->value() / 100.0) + (
ui->trigLevelFine->value() / 50000.0);
1404 ui->traceColor->setStyleSheet(tr(
"QLabel { background-color : rgb(%1,%2,%3); }").
arg(r).
arg(g).
arg(b));
1417 ui->trigPos->setChecked(
false);
1418 ui->trigNeg->setChecked(
false);
1419 ui->trigPos->doToggle(
false);
1420 ui->trigNeg->doToggle(
false);
1424 ui->trigBoth->setChecked(
true);
1425 ui->trigBoth->doToggle(
true);
1429 ui->trigBoth->setChecked(
false);
1430 ui->trigBoth->doToggle(
false);
1434 ui->trigPos->setChecked(
true);
1435 ui->trigPos->doToggle(
true);
1439 ui->trigNeg->setChecked(
true);
1440 ui->trigNeg->doToggle(
true);
1457 ui->trigColor->setStyleSheet(tr(
"QLabel { background-color : rgb(%1,%2,%3); }").
arg(r).
arg(g).
arg(b));
1568 if (
ui->trace->maximum() == 0)
1570 ui->onlyX->setChecked(
true);
1574 switch (displayMode)
1577 ui->onlyX->setChecked(
true);
1580 ui->onlyY->setChecked(
true);
1583 ui->horizontalXY->setChecked(
true);
1586 ui->verticalXY->setChecked(
true);
1589 ui->polar->setChecked(
true);
1592 ui->onlyX->setChecked(
true);
1600 if ((value < ui->traceIntensity->minimum()) || (value >
ui->traceIntensity->maximum())) {
1604 ui->traceIntensity->setValue(value);
1609 if ((value < ui->gridIntensity->minimum()) || (value >
ui->gridIntensity->maximum())) {
1613 ui->gridIntensity->setValue(value);
1618 if ((step < ui->time->minimum()) || (step >
ui->time->maximum())) {
1622 ui->time->setValue(step);
1627 if ((step < ui->timeOfs->minimum()) || (step >
ui->timeOfs->maximum())) {
1631 ui->timeOfs->setValue(step);
1636 if ((step < ui->traceLen->minimum()) || (step >
ui->traceLen->maximum())) {
1640 ui->traceLen->setValue(step);
1645 if ((step < ui->trigPre->minimum()) || (step >
ui->trigPre->maximum())) {
1649 ui->trigPre->setValue(step);
1659 if (
ui->trace->maximum() < 3)
1661 if (
ui->trace->value() == 0)
1663 ui->onlyY->setEnabled(
true);
1664 ui->horizontalXY->setEnabled(
true);
1665 ui->verticalXY->setEnabled(
true);
1666 ui->polar->setEnabled(
true);
1670 ui->trace->setMaximum(
ui->trace->maximum() + 1);
1686 if (
ui->trig->maximum() < 9)
1689 ui->trig->setMaximum(
ui->trig->maximum() + 1);
void addTrigger(const TriggerData &triggerData)
uint32_t m_triggerRepeat
Number of trigger conditions before the final decisive trigger.
void on_onlyX_toggled(bool checked)
void changeCurrentTrace()
void on_gridIntensity_valueChanged(int value)
void on_traceIntensity_valueChanged(int value)
void on_trigUp_clicked(bool checked)
void on_traceLen_valueChanged(int value)
bool m_viewTrace
Trace visibility.
void getTraceData(TraceData &traceData, uint32_t traceIndex)
bool m_triggerPositiveEdge
Trigger on the positive edge (else negative)
void changeTrigger(const TriggerData &triggerData, uint32_t triggerIndex)
void setTrigDelayDisplay()
void on_trigOneShot_toggled(bool checked)
void changeTrace(const TraceData &traceData, uint32_t traceIndex)
void on_trigMode_currentIndexChanged(int index)
void changeTrigger(int triggerIndex, const ScopeVis::TriggerData &triggerData)
void on_traceDelayFine_valueChanged(int value)
static const double amps[27]
void on_trigPre_valueChanged(int value)
void setTrigLevelDisplay()
void addTrigger(const ScopeVis::TriggerData &triggerData)
bool readFloat(quint32 id, float *result, float def=0) const
bool m_oldStateVerticalXY
void moveTrigger(uint32_t triggerIndex, bool upElseDown)
void focusOnTrace(uint32_t traceIndex)
bool m_oldStateTrigLevelCoarse
void on_time_valueChanged(int value)
Calculate logarithmic (dB) of squared magnitude.
void on_traceView_toggled(bool checked)
void removeTrace(uint32_t traceIndex)
void setTraceLenDisplay()
bool m_oldStateHorizontalXY
void on_traceDelayCoarse_valueChanged(int value)
MessageQueue * m_messageQueue
void writeFloat(quint32 id, float value)
QByteArray serializeMemory() const
void on_trigBoth_toggled(bool checked)
void setSampleRate(int sampleRate)
void setTraceLength(int step)
void setTimeBase(int step)
void on_traceColor_clicked()
void getTriggerData(TriggerData &triggerData, uint32_t triggerIndex)
void setTrigCountDisplay()
Phase comparator 8-PSK evaluation.
void setTimeScaleDisplay()
QColor m_traceColor
Trace display color.
void setTraceIntensity(int value)
bool m_oldStateTrigDelayCoarse
void setColor(QColor color)
bool readU32(quint32 id, quint32 *result, quint32 def=0) const
void focusOnTrace(int traceIndex)
void on_scope_traceSizeChanged(uint32_t value)
QString m_textOverlay
Text overlay to display.
void focusOnTrigger(int triggerIndex)
void changeTrace(int traceIndex, const ScopeVis::TraceData &traceData)
Phase comparator 16-PSK evaluation.
void on_trace_valueChanged(int value)
void on_timeOfs_valueChanged(int value)
void setDisplayXYPoints(bool value)
void on_ofsCoarse_valueChanged(int value)
bool readBool(quint32 id, bool *result, bool def=false) const
void on_amp_valueChanged(int value)
virtual QByteArray serialize() const
void setFocusedTriggerData(ScopeVis::TriggerData &triggerData)
int m_traceDelay
Trace delay in number of samples.
void on_trigLevelCoarse_valueChanged(int value)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
void on_polar_toggled(bool checked)
void setTimeOffset(int step)
void on_scope_preTriggerChanged(uint32_t value)
bool m_oldStateTraceColor
void setTraceDelayDisplay()
virtual bool deserialize(const QByteArray &data)
void setMemoryIndex(uint32_t memoryIndex)
int m_traceDelayCoarse
Coarse delay slider value.
DisplayMode getDisplayMode() const
int m_traceDelayFine
Fine delay slider value.
void on_traceDown_clicked(bool checked)
float m_triggerColorR
Trigger line display color - red shortcut.
void on_mem_valueChanged(int value)
void on_traceDel_clicked(bool checked)
bool readS32(quint32 id, qint32 *result, qint32 def=0) const
bool m_oldStateTrigDelayFine
bool m_triggerBothEdges
Trigger on both edges (else only one)
uint32_t m_triggerHoldoff
Trigger holdoff in number of samples.
Phase comparator BPSK evaluation.
MainUIBlocker(Ui::GLScopeGUI *ui)
void configure(uint32_t traceSize, uint32_t timeBase, uint32_t timeOfsProMill, uint32_t triggerPre, bool freeRun)
void focusOnTrigger(uint32_t triggerIndex)
void on_trigDown_clicked(bool checked)
QColor m_triggerColor
Trigger line display color.
void fillProjectionCombo(QComboBox *comboBox)
void moveTrace(uint32_t traceIndex, bool upElseDown)
bool deserializeMemory(const QByteArray &data)
void changeCurrentTrigger()
int m_ofsFine
Fine offset slider value.
void setBuddies(MessageQueue *messageQueue, ScopeVis *scopeVis, GLScope *glScope)
void setFocusedTraceIndex(uint32_t traceIndex)
Real m_triggerLevel
Level in real units.
Calculate linear magnitude or modulus.
bool m_hasTextOverlay
True if a text overlay has to be displayed.
void writeS32(quint32 id, qint32 value)
void on_trigAdd_clicked(bool checked)
void on_trigHoldoff_valueChanged(int value)
void fillTriggerData(ScopeVis::TriggerData &triggerData)
void on_scope_sampleRateChanged(int value)
quint32 getVersion() const
void setAmpScaleDisplay()
Calculate linear squared magnitude or power.
void setTraceUI(const ScopeVis::TraceData &traceData)
void setDisplayMode(DisplayMode displayMode)
void setOneShot(bool oneShot)
void on_freerun_toggled(bool checked)
Projector::ProjectionType m_projectionType
Complex to real projection type.
float m_amp
Amplification factor.
static const uint32_t m_traceChunkSize
void setTriggerUI(const ScopeVis::TriggerData &triggerData)
void on_traceUp_clicked(bool checked)
void on_verticalXY_toggled(bool checked)
void on_polarPoints_toggled(bool checked)
QColor m_focusedTraceColor
int getSampleRate() const
void on_trigLevelFine_valueChanged(int value)
Calculate phase derivative i.e. instantaneous frequency scaled to sample rate.
void fillTraceData(ScopeVis::TraceData &traceData)
void writeU32(quint32 id, quint32 value)
void setGridIntensity(int value)
TrigUIBlocker(Ui::GLScopeGUI *ui)
void addTrace(const ScopeVis::TraceData &traceData)
static const uint32_t m_nbTraceMemories
void setDisplayGridIntensity(int intensity)
void setPreTrigger(int step)
void on_ofsFine_valueChanged(int value)
void on_traceMode_currentIndexChanged(int index)
void on_onlyY_toggled(bool checked)
uint32_t m_inputIndex
Input or feed index this trace is associated with.
void writeBool(quint32 id, bool value)
bool m_oldStateTraceDelayCoarse
void on_horizontalXY_toggled(bool checked)
void addTrace(const TraceData &traceData)
void on_trigDelayFine_valueChanged(int value)
void setDisplayTraceIntensity(int intensity)
uint32_t getNbTriggers() const
Projector::ProjectionType m_projectionType
Complex to real projection type.
uint32_t m_triggerDelay
Delay before the trigger is kicked off in number of samples (trigger delay)
QColor m_focusedTriggerColor
void disableLiveMode(bool disable)
void on_trig_valueChanged(int value)
void on_trigNeg_toggled(bool checked)
void setTraceIndexDisplay()
const std::vector< TraceData > & getTracesData() const
bool handleMessage(Message *message)
void on_trigDel_clicked(bool checked)
void setDisplayMode(DisplayMode displayMode)
bool m_oldStateTraceDelayFine
void on_trigCount_valueChanged(int value)
void on_memoryLoad_clicked(bool checked)
uint32_t m_ampIndex
Index in list of amplification factors.
void on_trigColor_clicked()
void on_trigPos_toggled(bool checked)
uint32_t m_inputIndex
Input or feed index this trigger is associated with.
GLScopeGUI(QWidget *parent=0)
void removeTrigger(uint32_t triggerIndex)
float m_triggerColorB
Trigger line display color - blue shortcut.
const QByteArray & final()
float m_triggerColorG
Trigger line display color - green shortcut.
void setColor(QColor color)
bool m_oldStateTrigLevelFine
float m_ofs
Offset factor.
void on_memorySave_clicked(bool checked)
Phase comparator QPSK evaluation.
TraceUIBlocker(Ui::GLScopeGUI *ui)
void setTrigIndexDisplay()
int m_ofsCoarse
Coarse offset slider value.
void on_traceAdd_clicked(bool checked)
void on_trigDelayCoarse_valueChanged(int value)
double m_triggerDelayMult
Trigger delay as a multiplier of trace length.