SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Classes | Public Types | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
GLScopeGUI Class Reference

#include <glscopegui.h>

+ Inheritance diagram for GLScopeGUI:
+ Collaboration diagram for GLScopeGUI:

Classes

class  MainUIBlocker
 
class  TraceUIBlocker
 
class  TrigUIBlocker
 

Public Types

enum  DisplayMode {
  DisplayXYH, DisplayXYV, DisplayX, DisplayY,
  DisplayPol
}
 

Public Member Functions

 GLScopeGUI (QWidget *parent=0)
 
 ~GLScopeGUI ()
 
void setBuddies (MessageQueue *messageQueue, ScopeVis *scopeVis, GLScope *glScope)
 
void setSampleRate (int sampleRate)
 
void resetToDefaults ()
 
virtual QByteArray serialize () const
 
virtual bool deserialize (const QByteArray &data)
 
bool handleMessage (Message *message)
 
void setDisplayMode (DisplayMode displayMode)
 
void setTraceIntensity (int value)
 
void setGridIntensity (int value)
 
void setTimeBase (int step)
 
void setTimeOffset (int step)
 
void setTraceLength (int step)
 
void setPreTrigger (int step)
 
void changeTrace (int traceIndex, const ScopeVis::TraceData &traceData)
 
void addTrace (const ScopeVis::TraceData &traceData)
 
void focusOnTrace (int traceIndex)
 
void changeTrigger (int triggerIndex, const ScopeVis::TriggerData &triggerData)
 
void addTrigger (const ScopeVis::TriggerData &triggerData)
 
void focusOnTrigger (int triggerIndex)
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Private Slots

void on_scope_sampleRateChanged (int value)
 
void on_scope_traceSizeChanged (uint32_t value)
 
void on_scope_preTriggerChanged (uint32_t value)
 
void on_onlyX_toggled (bool checked)
 
void on_onlyY_toggled (bool checked)
 
void on_horizontalXY_toggled (bool checked)
 
void on_verticalXY_toggled (bool checked)
 
void on_polar_toggled (bool checked)
 
void on_polarPoints_toggled (bool checked)
 
void on_traceIntensity_valueChanged (int value)
 
void on_gridIntensity_valueChanged (int value)
 
void on_time_valueChanged (int value)
 
void on_timeOfs_valueChanged (int value)
 
void on_traceLen_valueChanged (int value)
 
void on_trace_valueChanged (int value)
 
void on_traceAdd_clicked (bool checked)
 
void on_traceDel_clicked (bool checked)
 
void on_traceUp_clicked (bool checked)
 
void on_traceDown_clicked (bool checked)
 
void on_traceMode_currentIndexChanged (int index)
 
void on_amp_valueChanged (int value)
 
void on_ofsCoarse_valueChanged (int value)
 
void on_ofsFine_valueChanged (int value)
 
void on_traceDelayCoarse_valueChanged (int value)
 
void on_traceDelayFine_valueChanged (int value)
 
void on_traceView_toggled (bool checked)
 
void on_traceColor_clicked ()
 
void on_memorySave_clicked (bool checked)
 
void on_memoryLoad_clicked (bool checked)
 
void on_mem_valueChanged (int value)
 
void on_trig_valueChanged (int value)
 
void on_trigAdd_clicked (bool checked)
 
void on_trigDel_clicked (bool checked)
 
void on_trigUp_clicked (bool checked)
 
void on_trigDown_clicked (bool checked)
 
void on_trigMode_currentIndexChanged (int index)
 
void on_trigCount_valueChanged (int value)
 
void on_trigPos_toggled (bool checked)
 
void on_trigNeg_toggled (bool checked)
 
void on_trigBoth_toggled (bool checked)
 
void on_trigHoldoff_valueChanged (int value)
 
void on_trigLevelCoarse_valueChanged (int value)
 
void on_trigLevelFine_valueChanged (int value)
 
void on_trigDelayCoarse_valueChanged (int value)
 
void on_trigDelayFine_valueChanged (int value)
 
void on_trigPre_valueChanged (int value)
 
void on_trigColor_clicked ()
 
void on_trigOneShot_toggled (bool checked)
 
void on_freerun_toggled (bool checked)
 

Private Member Functions

void applySettings ()
 
void setTraceIndexDisplay ()
 
void setTimeScaleDisplay ()
 
void setTraceLenDisplay ()
 
void setTimeOfsDisplay ()
 
void setAmpScaleDisplay ()
 
void setAmpOfsDisplay ()
 
void setTraceDelayDisplay ()
 
void setTrigIndexDisplay ()
 
void setTrigCountDisplay ()
 
void setTrigLevelDisplay ()
 
void setTrigDelayDisplay ()
 
void setTrigPreDisplay ()
 
void changeCurrentTrace ()
 
void changeCurrentTrigger ()
 
void fillTraceData (ScopeVis::TraceData &traceData)
 
void fillTriggerData (ScopeVis::TriggerData &triggerData)
 
void setTriggerUI (const ScopeVis::TriggerData &triggerData)
 
void setTraceUI (const ScopeVis::TraceData &traceData)
 
void fillProjectionCombo (QComboBox *comboBox)
 
void disableLiveMode (bool disable)
 

Private Attributes

Ui::GLScopeGUI * ui
 
MessageQueuem_messageQueue
 
ScopeVism_scopeVis
 
GLScopem_glScope
 
int m_sampleRate
 
int m_timeBase
 
int m_timeOffset
 
int m_traceLenMult
 
QColor m_focusedTraceColor
 
QColor m_focusedTriggerColor
 

Static Private Attributes

static const double amps [27]
 

Detailed Description

Definition at line 38 of file glscopegui.h.

Member Enumeration Documentation

◆ DisplayMode

Enumerator
DisplayXYH 
DisplayXYV 
DisplayX 
DisplayY 
DisplayPol 

Definition at line 42 of file glscopegui.h.

Constructor & Destructor Documentation

◆ GLScopeGUI()

GLScopeGUI::GLScopeGUI ( QWidget *  parent = 0)
explicit

Definition at line 40 of file glscopegui.cpp.

References m_focusedTraceColor, m_focusedTriggerColor, ScopeVis::m_nbTraceMemories, ScopeVis::m_traceChunkSize, and ui.

40  :
41  QWidget(parent),
42  ui(new Ui::GLScopeGUI),
43  m_messageQueue(0),
44  m_scopeVis(0),
45  m_glScope(0),
46  m_sampleRate(0),
47  m_timeBase(1),
48  m_timeOffset(0),
50 {
51  qDebug("GLScopeGUI::GLScopeGUI");
52  setEnabled(false);
53  ui->setupUi(this);
54  ui->trigDelayFine->setMaximum(ScopeVis::m_traceChunkSize / 10.0);
55  ui->traceColor->setStyleSheet("QLabel { background-color : rgb(255,255,64); }");
56  m_focusedTraceColor.setRgb(255,255,64);
57  ui->trigColor->setStyleSheet("QLabel { background-color : rgb(0,255,0); }");
58  m_focusedTriggerColor.setRgb(0,255,0);
59  ui->traceText->setText("X");
60  ui->mem->setMaximum(ScopeVis::m_nbTraceMemories - 1);
61 }
int m_timeOffset
Definition: glscopegui.h:152
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
MessageQueue * m_messageQueue
Definition: glscopegui.h:146
int m_timeBase
Definition: glscopegui.h:151
int m_traceLenMult
Definition: glscopegui.h:153
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
int m_sampleRate
Definition: glscopegui.h:150
static const uint32_t m_traceChunkSize
Definition: scopevis.h:150
QColor m_focusedTraceColor
Definition: glscopegui.h:154
static const uint32_t m_nbTraceMemories
Definition: scopevis.h:153
GLScope * m_glScope
Definition: glscopegui.h:148
QColor m_focusedTriggerColor
Definition: glscopegui.h:155

◆ ~GLScopeGUI()

GLScopeGUI::~GLScopeGUI ( )

Definition at line 63 of file glscopegui.cpp.

References ui.

64 {
65  delete ui;
66 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144

Member Function Documentation

◆ addTrace()

void GLScopeGUI::addTrace ( const ScopeVis::TraceData traceData)

Definition at line 1657 of file glscopegui.cpp.

References ScopeVis::addTrace(), m_scopeVis, and ui.

Referenced by on_traceAdd_clicked().

1658 {
1659  if (ui->trace->maximum() < 3)
1660  {
1661  if (ui->trace->value() == 0)
1662  {
1663  ui->onlyY->setEnabled(true);
1664  ui->horizontalXY->setEnabled(true);
1665  ui->verticalXY->setEnabled(true);
1666  ui->polar->setEnabled(true);
1667  }
1668 
1669  m_scopeVis->addTrace(traceData);
1670  ui->trace->setMaximum(ui->trace->maximum() + 1);
1671  }
1672 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void addTrace(const TraceData &traceData)
Definition: scopevis.cpp:135
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTrigger()

void GLScopeGUI::addTrigger ( const ScopeVis::TriggerData triggerData)

Definition at line 1684 of file glscopegui.cpp.

References ScopeVis::addTrigger(), m_scopeVis, and ui.

Referenced by on_trigAdd_clicked().

1685 {
1686  if (ui->trig->maximum() < 9)
1687  {
1688  m_scopeVis->addTrigger(triggerData);
1689  ui->trig->setMaximum(ui->trig->maximum() + 1);
1690  }
1691 }
void addTrigger(const TriggerData &triggerData)
Definition: scopevis.cpp:179
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettings()

void GLScopeGUI::applySettings ( )
private

Definition at line 1460 of file glscopegui.cpp.

1461 {
1462 }

◆ changeCurrentTrace()

void GLScopeGUI::changeCurrentTrace ( )
private

Definition at line 1289 of file glscopegui.cpp.

References ScopeVis::changeTrace(), fillTraceData(), m_scopeVis, and ui.

Referenced by on_amp_valueChanged(), on_ofsCoarse_valueChanged(), on_ofsFine_valueChanged(), on_traceColor_clicked(), on_traceDel_clicked(), on_traceDelayCoarse_valueChanged(), on_traceDelayFine_valueChanged(), on_traceMode_currentIndexChanged(), and on_traceView_toggled().

1290 {
1291  ScopeVis::TraceData traceData;
1292  fillTraceData(traceData);
1293  uint32_t currentTraceIndex = ui->trace->value();
1294  m_scopeVis->changeTrace(traceData, currentTraceIndex);
1295 }
void changeTrace(const TraceData &traceData, uint32_t traceIndex)
Definition: scopevis.cpp:145
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
unsigned int uint32_t
Definition: rtptypes_win.h:46
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void fillTraceData(ScopeVis::TraceData &traceData)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeCurrentTrigger()

void GLScopeGUI::changeCurrentTrigger ( )
private

Definition at line 1297 of file glscopegui.cpp.

References ScopeVis::changeTrigger(), fillTriggerData(), m_scopeVis, and ui.

Referenced by on_trigBoth_toggled(), on_trigColor_clicked(), on_trigCount_valueChanged(), on_trigDelayCoarse_valueChanged(), on_trigDelayFine_valueChanged(), on_trigHoldoff_valueChanged(), on_trigLevelCoarse_valueChanged(), on_trigLevelFine_valueChanged(), on_trigMode_currentIndexChanged(), on_trigNeg_toggled(), and on_trigPos_toggled().

1298 {
1299  ScopeVis::TriggerData triggerData;
1300  fillTriggerData(triggerData);
1301  uint32_t currentTriggerIndex = ui->trig->value();
1302  m_scopeVis->changeTrigger(triggerData, currentTriggerIndex);
1303 }
void changeTrigger(const TriggerData &triggerData, uint32_t triggerIndex)
Definition: scopevis.cpp:185
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
unsigned int uint32_t
Definition: rtptypes_win.h:46
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void fillTriggerData(ScopeVis::TriggerData &triggerData)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeTrace()

void GLScopeGUI::changeTrace ( int  traceIndex,
const ScopeVis::TraceData traceData 
)

Definition at line 1652 of file glscopegui.cpp.

References ScopeVis::changeTrace(), and m_scopeVis.

1653 {
1654  m_scopeVis->changeTrace(traceData, traceIndex);
1655 }
void changeTrace(const TraceData &traceData, uint32_t traceIndex)
Definition: scopevis.cpp:145
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
+ Here is the call graph for this function:

◆ changeTrigger()

void GLScopeGUI::changeTrigger ( int  triggerIndex,
const ScopeVis::TriggerData triggerData 
)

Definition at line 1679 of file glscopegui.cpp.

References ScopeVis::changeTrigger(), and m_scopeVis.

1680 {
1681  m_scopeVis->changeTrigger(triggerData, triggerIndex);
1682 }
void changeTrigger(const TriggerData &triggerData, uint32_t triggerIndex)
Definition: scopevis.cpp:185
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
+ Here is the call graph for this function:

◆ deserialize()

bool GLScopeGUI::deserialize ( const QByteArray &  data)
virtual

Implements Serializable.

Definition at line 230 of file glscopegui.cpp.

References ScopeVis::addTrace(), ScopeVis::addTrigger(), arg(), ScopeVis::changeTrace(), ScopeVis::changeTrigger(), GLScope::DisplayPol, GLScope::DisplayX, GLScope::DisplayXYH, GLScope::DisplayXYV, GLScope::DisplayY, fillTraceData(), fillTriggerData(), GLScope::getDisplayMode(), ScopeVis::getNbTriggers(), ScopeVis::getTracesData(), SimpleDeserializer::getVersion(), SimpleDeserializer::isValid(), m_focusedTraceColor, m_focusedTriggerColor, m_glScope, m_scopeVis, SimpleDeserializer::readBool(), SimpleDeserializer::readFloat(), SimpleDeserializer::readS32(), SimpleDeserializer::readU32(), ScopeVis::removeTrace(), ScopeVis::removeTrigger(), resetToDefaults(), setAmpOfsDisplay(), setAmpScaleDisplay(), GLScope::setDisplayMode(), GLScope::setFocusedTraceIndex(), GLScope::setFocusedTriggerData(), setTraceDelayDisplay(), setTraceIndexDisplay(), setTrigCountDisplay(), setTrigDelayDisplay(), setTrigIndexDisplay(), setTrigLevelDisplay(), setTrigPreDisplay(), and ui.

231 {
232  qDebug("GLScopeGUI::deserialize");
233  SimpleDeserializer d(data);
234 
235  if(!d.isValid()) {
236  resetToDefaults();
237  return false;
238  }
239 
240  if(d.getVersion() == 1)
241  {
242  TraceUIBlocker traceUIBlocker(ui);
243  TrigUIBlocker trigUIBlocker(ui);
244  int intValue;
245  uint32_t uintValue;
246  bool boolValue;
247 
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);
253 
254  ui->traceMode->setCurrentIndex(0);
255  d.readS32(1, &intValue, (int) GLScope::DisplayX);
257 
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);
263 
264  switch (m_glScope->getDisplayMode())
265  {
266  case GLScope::DisplayY:
267  ui->onlyY->setChecked(true);
268  break;
269  case GLScope::DisplayXYH:
270  ui->horizontalXY->setChecked(true);
271  break;
272  case GLScope::DisplayXYV:
273  ui->verticalXY->setChecked(true);
274  break;
275  case GLScope::DisplayPol:
276  ui->polar->setChecked(true);
277  break;
278  case GLScope::DisplayX:
279  default:
280  ui->onlyX->setChecked(true);
281  break;
282  }
283 
284  d.readS32(2, &intValue, 50);
285  ui->traceIntensity->setValue(intValue);
286  d.readS32(3, &intValue, 10);
287  ui->gridIntensity->setValue(intValue);
288  d.readS32(4, &intValue, 1);
289  ui->time->setValue(intValue);
290  d.readS32(5, &intValue, 0);
291  ui->timeOfs->setValue(intValue);
292  d.readS32(6, &intValue, 1);
293  ui->traceLen->setValue(intValue);
294 
295  // trace stuff
296 
297  uint32_t nbTracesSaved;
298  d.readU32(10, &nbTracesSaved, 1);
299  const std::vector<ScopeVis::TraceData>& tracesData = m_scopeVis->getTracesData();
300  uint32_t iTrace = tracesData.size();
301 
302  qDebug("GLScopeGUI::deserialize: nbTracesSaved: %u tracesData.size(): %lu", nbTracesSaved, tracesData.size());
303 
304  while (iTrace > nbTracesSaved) // remove possible traces in excess
305  {
306  m_scopeVis->removeTrace(iTrace - 1);
307  iTrace--;
308  }
309 
310  for (iTrace = 0; iTrace < nbTracesSaved; iTrace++)
311  {
312  ScopeVis::TraceData traceData;
313  float r, g, b;
314 
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);
327  d.readFloat(26 + 16*iTrace, &r, 1.0f);
328  d.readFloat(27 + 16*iTrace, &g, 1.0f);
329  d.readFloat(28 + 16*iTrace, &b, 1.0f);
330  m_focusedTraceColor.setRgbF(r, g, b);
331 
332  fillTraceData(traceData);
333 
334  if (iTrace < tracesData.size()) // change existing traces
335  {
336  m_scopeVis->changeTrace(traceData, iTrace);
337  }
338  else // add new traces
339  {
340  m_scopeVis->addTrace(traceData);
341  }
342  }
343 
344 
345  ui->trace->setMaximum(nbTracesSaved-1);
346  ui->trace->setValue(nbTracesSaved-1);
347  m_glScope->setFocusedTraceIndex(nbTracesSaved-1);
348 
349  int r,g,b,a;
350  m_focusedTraceColor.getRgb(&r, &g, &b, &a);
351  ui->traceColor->setStyleSheet(tr("QLabel { background-color : rgb(%1,%2,%3); }").arg(r).arg(g).arg(b));
352 
357 
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);
363 
364  // trigger stuff
365 
366  uint32_t nbTriggersSaved;
367  d.readU32(200, &nbTriggersSaved, 1);
368  uint32_t nbTriggers = m_scopeVis->getNbTriggers();
369  uint32_t iTrigger = nbTriggers;
370 
371  d.readS32(201, &intValue, 0);
372  ui->trigPre->setValue(intValue);
373 
374  qDebug("GLScopeGUI::deserialize: nbTriggersSaved: %u nbTriggers: %u", nbTriggersSaved, nbTriggers);
375 
376  while (iTrigger > nbTriggersSaved) // remove possible triggers in excess
377  {
378  m_scopeVis->removeTrigger(iTrigger - 1);
379  iTrigger--;
380  }
381 
382  for (iTrigger = 0; iTrigger < nbTriggersSaved; iTrigger++)
383  {
384  ScopeVis::TriggerData triggerData;
385  float r, g, b;
386 
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);
406  m_focusedTriggerColor.setRgbF(r, g, b);
407  d.readU32(221 + 16*iTrigger, &uintValue, 1);
408  ui->trigHoldoff->setValue(uintValue);
409  ui->trigHoldoffText->setText(tr("%1").arg(uintValue));
410 
411  fillTriggerData(triggerData);
412 
413  if (iTrigger < nbTriggers) // change existing triggers
414  {
415  m_scopeVis->changeTrigger(triggerData, iTrigger);
416  }
417  else // add new trigers
418  {
419  m_scopeVis->addTrigger(triggerData);
420  }
421 
422  if (iTrigger == nbTriggersSaved-1)
423  {
424  m_glScope->setFocusedTriggerData(triggerData);
425  }
426  }
427 
428  ui->trig->setMaximum(nbTriggersSaved-1);
429  ui->trig->setValue(nbTriggersSaved-1);
430 
431  m_focusedTriggerColor.getRgb(&r, &g, &b, &a);
432  ui->trigColor->setStyleSheet(tr("QLabel { background-color : rgb(%1,%2,%3); }").arg(r).arg(g).arg(b));
433 
439 
440  return true;
441  }
442  else
443  {
444  resetToDefaults();
445  return false;
446  }
447 }
void addTrigger(const TriggerData &triggerData)
Definition: scopevis.cpp:179
void changeTrigger(const TriggerData &triggerData, uint32_t triggerIndex)
Definition: scopevis.cpp:185
void setTrigDelayDisplay()
void changeTrace(const TraceData &traceData, uint32_t traceIndex)
Definition: scopevis.cpp:145
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void setTrigLevelDisplay()
void resetToDefaults()
Definition: glscopegui.cpp:170
void removeTrace(uint32_t traceIndex)
Definition: scopevis.cpp:156
void setTrigCountDisplay()
void setFocusedTriggerData(ScopeVis::TriggerData &triggerData)
Definition: glscope.h:75
unsigned int uint32_t
Definition: rtptypes_win.h:46
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setTraceDelayDisplay()
DisplayMode getDisplayMode() const
Definition: glscope.h:80
void setFocusedTraceIndex(uint32_t traceIndex)
Definition: glscope.cpp:983
void setAmpOfsDisplay()
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void fillTriggerData(ScopeVis::TriggerData &triggerData)
void setAmpScaleDisplay()
void setTrigPreDisplay()
QColor m_focusedTraceColor
Definition: glscopegui.h:154
void fillTraceData(ScopeVis::TraceData &traceData)
void addTrace(const TraceData &traceData)
Definition: scopevis.cpp:135
uint32_t getNbTriggers() const
Definition: scopevis.h:241
GLScope * m_glScope
Definition: glscopegui.h:148
QColor m_focusedTriggerColor
Definition: glscopegui.h:155
void setTraceIndexDisplay()
const std::vector< TraceData > & getTracesData() const
Definition: scopevis.h:240
void setDisplayMode(DisplayMode displayMode)
Definition: glscope.cpp:990
void removeTrigger(uint32_t triggerIndex)
Definition: scopevis.cpp:191
DisplayMode
Definition: glscope.h:45
void setTrigIndexDisplay()
+ Here is the call graph for this function:

◆ disableLiveMode()

void GLScopeGUI::disableLiveMode ( bool  disable)
private

Definition at line 1320 of file glscopegui.cpp.

References ui.

Referenced by on_mem_valueChanged().

1321 {
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);
1340 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
+ Here is the caller graph for this function:

◆ fillProjectionCombo()

void GLScopeGUI::fillProjectionCombo ( QComboBox *  comboBox)
private

Definition at line 1305 of file glscopegui.cpp.

References Projector::Projection16PSK, Projector::Projection8PSK, Projector::ProjectionBPSK, Projector::ProjectionDPhase, Projector::ProjectionImag, Projector::ProjectionMagDB, Projector::ProjectionMagLin, Projector::ProjectionMagSq, Projector::ProjectionPhase, Projector::ProjectionQPSK, and Projector::ProjectionReal.

Referenced by setBuddies().

1306 {
1307  comboBox->addItem("Real", Projector::ProjectionReal);
1308  comboBox->addItem("Imag", Projector::ProjectionImag);
1309  comboBox->addItem("Mag", Projector::ProjectionMagLin);
1310  comboBox->addItem("MagSq", Projector::ProjectionMagSq);
1311  comboBox->addItem("MagdB", Projector::ProjectionMagDB);
1312  comboBox->addItem("Phi", Projector::ProjectionPhase);
1313  comboBox->addItem("dPhi", Projector::ProjectionDPhase);
1314  comboBox->addItem("BPSK", Projector::ProjectionBPSK);
1315  comboBox->addItem("QPSK", Projector::ProjectionQPSK);
1316  comboBox->addItem("8PSK", Projector::Projection8PSK);
1317  comboBox->addItem("16PSK", Projector::Projection16PSK);
1318 }
Calculate logarithmic (dB) of squared magnitude.
Definition: projector.h:31
Phase comparator 8-PSK evaluation.
Definition: projector.h:36
Phase comparator 16-PSK evaluation.
Definition: projector.h:37
Phase comparator BPSK evaluation.
Definition: projector.h:34
Calculate phase.
Definition: projector.h:32
Calculate linear magnitude or modulus.
Definition: projector.h:29
Calculate linear squared magnitude or power.
Definition: projector.h:30
Calculate phase derivative i.e. instantaneous frequency scaled to sample rate.
Definition: projector.h:33
Extract imaginary part.
Definition: projector.h:28
Phase comparator QPSK evaluation.
Definition: projector.h:35
Extract real part.
Definition: projector.h:27
+ Here is the caller graph for this function:

◆ fillTraceData()

void GLScopeGUI::fillTraceData ( ScopeVis::TraceData traceData)
private

Definition at line 1342 of file glscopegui.cpp.

References amps, ScopeVis::TraceData::m_amp, ScopeVis::TraceData::m_ampIndex, m_focusedTraceColor, ScopeVis::TraceData::m_hasTextOverlay, ScopeVis::TraceData::m_inputIndex, ScopeVis::TraceData::m_ofs, ScopeVis::TraceData::m_ofsCoarse, ScopeVis::TraceData::m_ofsFine, ScopeVis::TraceData::m_projectionType, ScopeVis::TraceData::m_textOverlay, ScopeVis::TraceData::m_traceDelay, ScopeVis::TraceData::m_traceDelayCoarse, ScopeVis::TraceData::m_traceDelayFine, ScopeVis::TraceData::m_viewTrace, Projector::ProjectionMagDB, Projector::ProjectionMagLin, Projector::ProjectionMagSq, ScopeVis::TraceData::setColor(), and ui.

Referenced by changeCurrentTrace(), deserialize(), on_traceAdd_clicked(), and setBuddies().

1343 {
1344  traceData.m_projectionType = (Projector::ProjectionType) ui->traceMode->currentIndex();
1346  traceData.m_textOverlay.clear();
1347  traceData.m_inputIndex = 0;
1348  traceData.m_amp = 0.2 / amps[ui->amp->value()];
1349  traceData.m_ampIndex = ui->amp->value();
1350 
1351  traceData.m_ofsCoarse = ui->ofsCoarse->value();
1352  traceData.m_ofsFine = ui->ofsFine->value();
1353 
1355  traceData.m_ofs = ((10.0 * ui->ofsCoarse->value()) + (ui->ofsFine->value() / 20.0)) / 2000.0f;
1356  } else {
1357  traceData.m_ofs = ((10.0 * ui->ofsCoarse->value()) + (ui->ofsFine->value() / 20.0)) / 1000.0f;
1358  }
1359 
1360  traceData.m_traceDelayCoarse = ui->traceDelayCoarse->value();
1361  traceData.m_traceDelayFine = ui->traceDelayFine->value();
1362  traceData.m_traceDelay = traceData.m_traceDelayCoarse * 100 + traceData.m_traceDelayFine;
1363  traceData.setColor(m_focusedTraceColor);
1364  traceData.m_viewTrace = ui->traceView->isChecked();
1365 }
bool m_viewTrace
Trace visibility.
Definition: scopevis.h:67
static const double amps[27]
Definition: glscopegui.h:157
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Calculate logarithmic (dB) of squared magnitude.
Definition: projector.h:31
ProjectionType
Definition: projector.h:25
void setColor(QColor color)
Definition: scopevis.h:88
QString m_textOverlay
Text overlay to display.
Definition: scopevis.h:66
int m_traceDelay
Trace delay in number of samples.
Definition: scopevis.h:57
int m_traceDelayCoarse
Coarse delay slider value.
Definition: scopevis.h:58
int m_traceDelayFine
Fine delay slider value.
Definition: scopevis.h:59
int m_ofsFine
Fine offset slider value.
Definition: scopevis.h:56
Calculate linear magnitude or modulus.
Definition: projector.h:29
bool m_hasTextOverlay
True if a text overlay has to be displayed.
Definition: scopevis.h:65
Calculate linear squared magnitude or power.
Definition: projector.h:30
float m_amp
Amplification factor.
Definition: scopevis.h:52
QColor m_focusedTraceColor
Definition: glscopegui.h:154
uint32_t m_inputIndex
Input or feed index this trace is associated with.
Definition: scopevis.h:51
Projector::ProjectionType m_projectionType
Complex to real projection type.
Definition: scopevis.h:50
uint32_t m_ampIndex
Index in list of amplification factors.
Definition: scopevis.h:53
float m_ofs
Offset factor.
Definition: scopevis.h:54
int m_ofsCoarse
Coarse offset slider value.
Definition: scopevis.h:55
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillTriggerData()

void GLScopeGUI::fillTriggerData ( ScopeVis::TriggerData triggerData)
private

Definition at line 1367 of file glscopegui.cpp.

References m_focusedTriggerColor, ScopeVis::TriggerData::m_inputIndex, ScopeVis::TriggerData::m_projectionType, ScopeVis::m_traceChunkSize, m_traceLenMult, ScopeVis::TriggerData::m_triggerBothEdges, ScopeVis::TriggerData::m_triggerDelay, ScopeVis::TriggerData::m_triggerDelayCoarse, ScopeVis::TriggerData::m_triggerDelayFine, ScopeVis::TriggerData::m_triggerDelayMult, ScopeVis::TriggerData::m_triggerHoldoff, ScopeVis::TriggerData::m_triggerLevel, ScopeVis::TriggerData::m_triggerLevelCoarse, ScopeVis::TriggerData::m_triggerLevelFine, ScopeVis::TriggerData::m_triggerPositiveEdge, ScopeVis::TriggerData::m_triggerRepeat, ScopeVis::TriggerData::setColor(), and ui.

Referenced by changeCurrentTrigger(), deserialize(), on_trigAdd_clicked(), and setBuddies().

1368 {
1369  triggerData.m_projectionType = (Projector::ProjectionType) ui->trigMode->currentIndex();
1370  triggerData.m_inputIndex = 0;
1371  triggerData.m_triggerLevel = (ui->trigLevelCoarse->value() / 100.0) + (ui->trigLevelFine->value() / 50000.0);
1372  triggerData.m_triggerLevelCoarse = ui->trigLevelCoarse->value();
1373  triggerData.m_triggerLevelFine = ui->trigLevelFine->value();
1374  triggerData.m_triggerPositiveEdge = ui->trigPos->isChecked();
1375  triggerData.m_triggerBothEdges = ui->trigBoth->isChecked();
1376  triggerData.m_triggerHoldoff = ui->trigHoldoff->value();
1377  triggerData.m_triggerRepeat = ui->trigCount->value();
1378  triggerData.m_triggerDelayMult = ui->trigDelayCoarse->value() + ui->trigDelayFine->value() / (ScopeVis::m_traceChunkSize / 10.0);
1379  triggerData.m_triggerDelay = (int) (m_traceLenMult * ScopeVis::m_traceChunkSize * triggerData.m_triggerDelayMult);
1380  triggerData.m_triggerDelayCoarse = ui->trigDelayCoarse->value();
1381  triggerData.m_triggerDelayFine = ui->trigDelayFine->value();
1382  triggerData.setColor(m_focusedTriggerColor);
1383 }
uint32_t m_triggerRepeat
Number of trigger conditions before the final decisive trigger.
Definition: scopevis.h:114
bool m_triggerPositiveEdge
Trigger on the positive edge (else negative)
Definition: scopevis.h:107
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
ProjectionType
Definition: projector.h:25
bool m_triggerBothEdges
Trigger on both edges (else only one)
Definition: scopevis.h:108
uint32_t m_triggerHoldoff
Trigger holdoff in number of samples.
Definition: scopevis.h:109
int m_traceLenMult
Definition: glscopegui.h:153
Real m_triggerLevel
Level in real units.
Definition: scopevis.h:104
Projector::ProjectionType m_projectionType
Complex to real projection type.
Definition: scopevis.h:102
static const uint32_t m_traceChunkSize
Definition: scopevis.h:150
uint32_t m_triggerDelay
Delay before the trigger is kicked off in number of samples (trigger delay)
Definition: scopevis.h:110
QColor m_focusedTriggerColor
Definition: glscopegui.h:155
uint32_t m_inputIndex
Input or feed index this trigger is associated with.
Definition: scopevis.h:103
void setColor(QColor color)
Definition: scopevis.h:139
double m_triggerDelayMult
Trigger delay as a multiplier of trace length.
Definition: scopevis.h:111
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ focusOnTrace()

void GLScopeGUI::focusOnTrace ( int  traceIndex)

Definition at line 1674 of file glscopegui.cpp.

References on_trace_valueChanged().

1675 {
1676  on_trace_valueChanged(traceIndex);
1677 }
void on_trace_valueChanged(int value)
Definition: glscopegui.cpp:602
+ Here is the call graph for this function:

◆ focusOnTrigger()

void GLScopeGUI::focusOnTrigger ( int  triggerIndex)

Definition at line 1693 of file glscopegui.cpp.

References on_trig_valueChanged().

1694 {
1695  on_trig_valueChanged(triggerIndex);
1696 }
void on_trig_valueChanged(int value)
Definition: glscopegui.cpp:680
+ Here is the call graph for this function:

◆ handleMessage()

bool GLScopeGUI::handleMessage ( Message message)

Definition at line 1464 of file glscopegui.cpp.

1465 {
1466  (void) message;
1467  return false;
1468 }

◆ on_amp_valueChanged

void GLScopeGUI::on_amp_valueChanged ( int  value)
privateslot

Definition at line 755 of file glscopegui.cpp.

References changeCurrentTrace(), and setAmpScaleDisplay().

756 {
757  (void) value;
760 }
void changeCurrentTrace()
void setAmpScaleDisplay()
+ Here is the call graph for this function:

◆ on_freerun_toggled

void GLScopeGUI::on_freerun_toggled ( bool  checked)
privateslot

Definition at line 986 of file glscopegui.cpp.

References ScopeVis::configure(), GLScope::getTraceSize(), m_glScope, m_scopeVis, m_timeBase, m_timeOffset, ScopeVis::m_traceChunkSize, m_traceLenMult, and ui.

987 {
988  if (checked)
989  {
990  ui->trigOneShot->setChecked(false);
991  ui->trigOneShot->setEnabled(false);
992  }
993  else
994  {
995  ui->trigOneShot->setEnabled(true);
996  }
997 
999  m_timeBase,
1000  m_timeOffset*10,
1001  (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
1002  ui->freerun->isChecked());
1003 }
int m_timeOffset
Definition: glscopegui.h:152
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
int m_timeBase
Definition: glscopegui.h:151
unsigned int uint32_t
Definition: rtptypes_win.h:46
void configure(uint32_t traceSize, uint32_t timeBase, uint32_t timeOfsProMill, uint32_t triggerPre, bool freeRun)
Definition: scopevis.cpp:129
int getTraceSize() const
Definition: glscope.h:63
int m_traceLenMult
Definition: glscopegui.h:153
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
static const uint32_t m_traceChunkSize
Definition: scopevis.h:150
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:

◆ on_gridIntensity_valueChanged

void GLScopeGUI::on_gridIntensity_valueChanged ( int  value)
privateslot

Definition at line 550 of file glscopegui.cpp.

References arg(), m_glScope, GLScope::setDisplayGridIntensity(), and ui.

551 {
552  ui->gridIntensity->setToolTip(QString("Grid intensity: %1").arg(value));
554 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setDisplayGridIntensity(int intensity)
Definition: glscope.cpp:75
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:

◆ on_horizontalXY_toggled

void GLScopeGUI::on_horizontalXY_toggled ( bool  checked)
privateslot

Definition at line 485 of file glscopegui.cpp.

References GLScope::DisplayXYH, m_glScope, GLScope::setDisplayMode(), and ui.

486 {
487  if (checked)
488  {
489  ui->onlyX->setChecked(false);
490  ui->onlyY->setChecked(false);
491  ui->verticalXY->setChecked(false);
492  ui->polar->setChecked(false);
494  }
495  else
496  {
497  if (!ui->onlyX->isChecked() && !ui->onlyY->isChecked() && !ui->verticalXY->isChecked() && !ui->polar->isChecked()) {
498  ui->polar->setChecked(true);
499  }
500  }
501 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
GLScope * m_glScope
Definition: glscopegui.h:148
void setDisplayMode(DisplayMode displayMode)
Definition: glscope.cpp:990
+ Here is the call graph for this function:

◆ on_mem_valueChanged

void GLScopeGUI::on_mem_valueChanged ( int  value)
privateslot

Definition at line 869 of file glscopegui.cpp.

References disableLiveMode(), m_scopeVis, ScopeVis::setMemoryIndex(), and ui.

870 {
871  QString text;
872  text.sprintf("%02d", value);
873  ui->memText->setText(text);
874  disableLiveMode(value > 0); // live / memory mode toggle
875  m_scopeVis->setMemoryIndex(value);
876 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void setMemoryIndex(uint32_t memoryIndex)
Definition: scopevis.cpp:215
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void disableLiveMode(bool disable)
+ Here is the call graph for this function:

◆ on_memoryLoad_clicked

void GLScopeGUI::on_memoryLoad_clicked ( bool  checked)
privateslot

Definition at line 841 of file glscopegui.cpp.

References arg(), ScopeVis::deserializeMemory(), and m_scopeVis.

842 {
843  (void) checked;
844  qDebug("GLScopeGUI::on_memoryLoad_clicked");
845 
846  QString fileName = QFileDialog::getOpenFileName(this,
847  tr("Open trace memory file"), ".", tr("Trace memory files (*.trcm)"), 0, QFileDialog::DontUseNativeDialog);
848 
849  if (fileName != "")
850  {
851  QFile exportFile(fileName);
852 
853  if (exportFile.open(QIODevice::ReadOnly | QIODevice::Text))
854  {
855  QByteArray base64Str;
856  QTextStream instream(&exportFile);
857  instream >> base64Str;
858  exportFile.close();
859  m_scopeVis->deserializeMemory(QByteArray::fromBase64(base64Str));
860  qDebug("GLScopeGUI::on_memoryLoad_clicked: loaded from %s", qPrintable(fileName));
861  }
862  else
863  {
864  QMessageBox::information(this, tr("Message"), tr("Cannot open file %1 for reading").arg(fileName));
865  }
866  }
867 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
bool deserializeMemory(const QByteArray &data)
Definition: scopevis.h:187
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
+ Here is the call graph for this function:

◆ on_memorySave_clicked

void GLScopeGUI::on_memorySave_clicked ( bool  checked)
privateslot

Definition at line 810 of file glscopegui.cpp.

References arg(), m_scopeVis, and ScopeVis::serializeMemory().

811 {
812  (void) checked;
813  QString fileName = QFileDialog::getSaveFileName(this,
814  tr("Open trace memory file"), ".", tr("Trace memory files (*.trcm)"), 0, QFileDialog::DontUseNativeDialog);
815 
816  if (fileName != "")
817  {
818  QFileInfo fileInfo(fileName);
819 
820  if (fileInfo.suffix() != "trcm") {
821  fileName += ".trcm";
822  }
823 
824  QFile exportFile(fileName);
825 
826  if (exportFile.open(QIODevice::WriteOnly | QIODevice::Text))
827  {
828  QString base64Str = m_scopeVis->serializeMemory().toBase64();
829  QTextStream outstream(&exportFile);
830  outstream << base64Str;
831  exportFile.close();
832  qDebug("GLScopeGUI::on_memorySave_clicked: saved to %s", qPrintable(fileName));
833  }
834  else
835  {
836  QMessageBox::information(this, tr("Message"), tr("Cannot open %1 file for writing").arg(fileName));
837  }
838  }
839 }
QByteArray serializeMemory() const
Definition: scopevis.h:174
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
+ Here is the call graph for this function:

◆ on_ofsCoarse_valueChanged

void GLScopeGUI::on_ofsCoarse_valueChanged ( int  value)
privateslot

Definition at line 762 of file glscopegui.cpp.

References changeCurrentTrace(), and setAmpOfsDisplay().

763 {
764  (void) value;
767 }
void changeCurrentTrace()
void setAmpOfsDisplay()
+ Here is the call graph for this function:

◆ on_ofsFine_valueChanged

void GLScopeGUI::on_ofsFine_valueChanged ( int  value)
privateslot

Definition at line 769 of file glscopegui.cpp.

References changeCurrentTrace(), and setAmpOfsDisplay().

770 {
771  (void) value;
774 }
void changeCurrentTrace()
void setAmpOfsDisplay()
+ Here is the call graph for this function:

◆ on_onlyX_toggled

void GLScopeGUI::on_onlyX_toggled ( bool  checked)
privateslot

Definition at line 449 of file glscopegui.cpp.

References GLScope::DisplayX, m_glScope, GLScope::setDisplayMode(), and ui.

450 {
451  if (checked)
452  {
453  ui->onlyY->setChecked(false);
454  ui->horizontalXY->setChecked(false);
455  ui->verticalXY->setChecked(false);
456  ui->polar->setChecked(false);
458  }
459  else
460  {
461  if (!ui->onlyY->isChecked() && !ui->horizontalXY->isChecked() && !ui->verticalXY->isChecked() && !ui->polar->isChecked()) {
462  ui->polar->setChecked(true);
463  }
464  }
465 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
GLScope * m_glScope
Definition: glscopegui.h:148
void setDisplayMode(DisplayMode displayMode)
Definition: glscope.cpp:990
+ Here is the call graph for this function:

◆ on_onlyY_toggled

void GLScopeGUI::on_onlyY_toggled ( bool  checked)
privateslot

Definition at line 467 of file glscopegui.cpp.

References GLScope::DisplayY, m_glScope, GLScope::setDisplayMode(), and ui.

468 {
469  if (checked)
470  {
471  ui->onlyX->setChecked(false);
472  ui->horizontalXY->setChecked(false);
473  ui->verticalXY->setChecked(false);
474  ui->polar->setChecked(false);
476  }
477  else
478  {
479  if (!ui->onlyX->isChecked() && !ui->horizontalXY->isChecked() && !ui->verticalXY->isChecked() && !ui->polar->isChecked()) {
480  ui->polar->setChecked(true);
481  }
482  }
483 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
GLScope * m_glScope
Definition: glscopegui.h:148
void setDisplayMode(DisplayMode displayMode)
Definition: glscope.cpp:990
+ Here is the call graph for this function:

◆ on_polar_toggled

void GLScopeGUI::on_polar_toggled ( bool  checked)
privateslot

Definition at line 521 of file glscopegui.cpp.

References GLScope::DisplayPol, m_glScope, GLScope::setDisplayMode(), and ui.

522 {
523  if (checked)
524  {
525  ui->onlyX->setChecked(false);
526  ui->onlyY->setChecked(false);
527  ui->horizontalXY->setChecked(false);
528  ui->verticalXY->setChecked(false);
530  }
531  else
532  {
533  if (!ui->onlyX->isChecked() && !ui->onlyY->isChecked() && !ui->horizontalXY->isChecked() && !ui->verticalXY->isChecked()) {
534  ui->polar->setChecked(true);
535  }
536  }
537 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
GLScope * m_glScope
Definition: glscopegui.h:148
void setDisplayMode(DisplayMode displayMode)
Definition: glscope.cpp:990
+ Here is the call graph for this function:

◆ on_polarPoints_toggled

void GLScopeGUI::on_polarPoints_toggled ( bool  checked)
privateslot

Definition at line 539 of file glscopegui.cpp.

References m_glScope, and GLScope::setDisplayXYPoints().

540 {
541  m_glScope->setDisplayXYPoints(checked);
542 }
void setDisplayXYPoints(bool value)
Definition: glscope.h:81
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:

◆ on_scope_preTriggerChanged

void GLScopeGUI::on_scope_preTriggerChanged ( uint32_t  value)
privateslot

Definition at line 163 of file glscopegui.cpp.

References GLScope::getTraceSize(), m_glScope, setTrigPreDisplay(), and ui.

Referenced by setBuddies().

164 {
165  qDebug("GLScopeGUI::on_scope_preTriggerChanged: %u", preTriggerNbSamples);
166  ui->trigPre->setValue(preTriggerNbSamples*100 / m_glScope->getTraceSize()); // slider position is a percentage value of the trace size
168 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
int getTraceSize() const
Definition: glscope.h:63
void setTrigPreDisplay()
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_scope_sampleRateChanged

void GLScopeGUI::on_scope_sampleRateChanged ( int  value)
privateslot

Definition at line 142 of file glscopegui.cpp.

References arg(), m_sampleRate, setTimeOfsDisplay(), setTimeScaleDisplay(), setTraceDelayDisplay(), setTraceLenDisplay(), setTrigDelayDisplay(), setTrigPreDisplay(), and ui.

Referenced by setBuddies().

143 {
144  //m_sampleRate = m_glScope->getSampleRate();
145  m_sampleRate = sampleRate;
146  ui->sampleRateText->setText(tr("%1\nkS/s").arg(m_sampleRate / 1000.0f, 0, 'f', 2));
153 }
void setTimeOfsDisplay()
void setTrigDelayDisplay()
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void setTraceLenDisplay()
void setTimeScaleDisplay()
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setTraceDelayDisplay()
int m_sampleRate
Definition: glscopegui.h:150
void setTrigPreDisplay()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_scope_traceSizeChanged

void GLScopeGUI::on_scope_traceSizeChanged ( uint32_t  value)
privateslot

Definition at line 155 of file glscopegui.cpp.

References ScopeVis::m_traceChunkSize, m_traceLenMult, setTraceLenDisplay(), and ui.

Referenced by setBuddies().

156 {
157  qDebug("GLScopeGUI::on_scope_traceSizeChanged: %u", traceNbSamples);
158  m_traceLenMult = traceNbSamples / ScopeVis::m_traceChunkSize;
159  ui->traceLen->setValue(m_traceLenMult);
161 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void setTraceLenDisplay()
int m_traceLenMult
Definition: glscopegui.h:153
static const uint32_t m_traceChunkSize
Definition: scopevis.h:150
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_time_valueChanged

void GLScopeGUI::on_time_valueChanged ( int  value)
privateslot

Definition at line 556 of file glscopegui.cpp.

References ScopeVis::configure(), GLScope::getTraceSize(), m_glScope, m_scopeVis, m_timeBase, m_timeOffset, ScopeVis::m_traceChunkSize, m_traceLenMult, setTimeScaleDisplay(), setTraceDelayDisplay(), and ui.

557 {
558  m_timeBase = value;
562  m_timeBase,
563  m_timeOffset*10,
564  (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
565  ui->freerun->isChecked());
566 }
int m_timeOffset
Definition: glscopegui.h:152
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void setTimeScaleDisplay()
int m_timeBase
Definition: glscopegui.h:151
unsigned int uint32_t
Definition: rtptypes_win.h:46
void setTraceDelayDisplay()
void configure(uint32_t traceSize, uint32_t timeBase, uint32_t timeOfsProMill, uint32_t triggerPre, bool freeRun)
Definition: scopevis.cpp:129
int getTraceSize() const
Definition: glscope.h:63
int m_traceLenMult
Definition: glscopegui.h:153
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
static const uint32_t m_traceChunkSize
Definition: scopevis.h:150
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:

◆ on_timeOfs_valueChanged

void GLScopeGUI::on_timeOfs_valueChanged ( int  value)
privateslot

Definition at line 568 of file glscopegui.cpp.

References ScopeVis::configure(), GLScope::getTraceSize(), m_glScope, m_scopeVis, m_timeBase, m_timeOffset, ScopeVis::m_traceChunkSize, m_traceLenMult, setTimeOfsDisplay(), and ui.

569 {
570  if ((value < 0) || (value > 100)) {
571  return;
572  }
573 
574  m_timeOffset = value;
577  m_timeBase,
578  m_timeOffset*10,
579  (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
580  ui->freerun->isChecked());
581 }
int m_timeOffset
Definition: glscopegui.h:152
void setTimeOfsDisplay()
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
int m_timeBase
Definition: glscopegui.h:151
unsigned int uint32_t
Definition: rtptypes_win.h:46
void configure(uint32_t traceSize, uint32_t timeBase, uint32_t timeOfsProMill, uint32_t triggerPre, bool freeRun)
Definition: scopevis.cpp:129
int getTraceSize() const
Definition: glscope.h:63
int m_traceLenMult
Definition: glscopegui.h:153
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
static const uint32_t m_traceChunkSize
Definition: scopevis.h:150
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:

◆ on_trace_valueChanged

void GLScopeGUI::on_trace_valueChanged ( int  value)
privateslot

Definition at line 602 of file glscopegui.cpp.

References arg(), ScopeVis::focusOnTrace(), ScopeVis::getTraceData(), ScopeVis::TraceData::m_amp, ScopeVis::TraceData::m_ofs, ScopeVis::TraceData::m_projectionType, m_scopeVis, ScopeVis::TraceData::m_traceDelay, setTraceUI(), and ui.

Referenced by focusOnTrace().

603 {
604  ui->traceText->setText(value == 0 ? "X" : QString("Y%1").arg(ui->trace->value()));
605 
606  ScopeVis::TraceData traceData;
607  m_scopeVis->getTraceData(traceData, value);
608 
609  qDebug() << "GLScopeGUI::on_trace_valueChanged:"
610  << " m_projectionType: " << (int) traceData.m_projectionType
611  << " m_amp" << traceData.m_amp
612  << " m_ofs" << traceData.m_ofs
613  << " m_traceDelay" << traceData.m_traceDelay;
614 
615  setTraceUI(traceData);
616 
617  m_scopeVis->focusOnTrace(value);
618 }
void getTraceData(TraceData &traceData, uint32_t traceIndex)
Definition: scopevis.h:231
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void focusOnTrace(uint32_t traceIndex)
Definition: scopevis.cpp:173
int m_traceDelay
Trace delay in number of samples.
Definition: scopevis.h:57
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void setTraceUI(const ScopeVis::TraceData &traceData)
float m_amp
Amplification factor.
Definition: scopevis.h:52
Projector::ProjectionType m_projectionType
Complex to real projection type.
Definition: scopevis.h:50
float m_ofs
Offset factor.
Definition: scopevis.h:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_traceAdd_clicked

void GLScopeGUI::on_traceAdd_clicked ( bool  checked)
privateslot

Definition at line 620 of file glscopegui.cpp.

References addTrace(), and fillTraceData().

621 {
622  (void) checked;
623  ScopeVis::TraceData traceData;
624  fillTraceData(traceData);
625  addTrace(traceData);
626 }
void fillTraceData(ScopeVis::TraceData &traceData)
void addTrace(const ScopeVis::TraceData &traceData)
+ Here is the call graph for this function:

◆ on_traceColor_clicked

void GLScopeGUI::on_traceColor_clicked ( )
privateslot

Definition at line 796 of file glscopegui.cpp.

References arg(), changeCurrentTrace(), m_focusedTraceColor, and ui.

797 {
798  QColor newColor = QColorDialog::getColor(m_focusedTraceColor, this, tr("Select Color for trace"), QColorDialog::DontUseNativeDialog);
799 
800  if (newColor.isValid()) // user clicked OK and selected a color
801  {
802  m_focusedTraceColor = newColor;
803  int r,g,b,a;
804  m_focusedTraceColor.getRgb(&r, &g, &b, &a);
805  ui->traceColor->setStyleSheet(tr("QLabel { background-color : rgb(%1,%2,%3); }").arg(r).arg(g).arg(b));
807  }
808 }
void changeCurrentTrace()
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
QColor m_focusedTraceColor
Definition: glscopegui.h:154
+ Here is the call graph for this function:

◆ on_traceDel_clicked

void GLScopeGUI::on_traceDel_clicked ( bool  checked)
privateslot

Definition at line 628 of file glscopegui.cpp.

References changeCurrentTrace(), GLScope::DisplayX, m_glScope, m_scopeVis, ScopeVis::removeTrace(), GLScope::setDisplayMode(), and ui.

629 {
630  (void) checked;
631  if (ui->trace->value() > 0) // not the X trace
632  {
633  ui->trace->setMaximum(ui->trace->maximum() - 1);
634 
635  if (ui->trace->value() == 0)
636  {
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);
643  }
644 
645  m_scopeVis->removeTrace(ui->trace->value());
647  }
648 }
void changeCurrentTrace()
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void removeTrace(uint32_t traceIndex)
Definition: scopevis.cpp:156
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
GLScope * m_glScope
Definition: glscopegui.h:148
void setDisplayMode(DisplayMode displayMode)
Definition: glscope.cpp:990
+ Here is the call graph for this function:

◆ on_traceDelayCoarse_valueChanged

void GLScopeGUI::on_traceDelayCoarse_valueChanged ( int  value)
privateslot

Definition at line 776 of file glscopegui.cpp.

References changeCurrentTrace(), and setTraceDelayDisplay().

777 {
778  (void) value;
781 }
void changeCurrentTrace()
void setTraceDelayDisplay()
+ Here is the call graph for this function:

◆ on_traceDelayFine_valueChanged

void GLScopeGUI::on_traceDelayFine_valueChanged ( int  value)
privateslot

Definition at line 783 of file glscopegui.cpp.

References changeCurrentTrace(), and setTraceDelayDisplay().

784 {
785  (void) value;
788 }
void changeCurrentTrace()
void setTraceDelayDisplay()
+ Here is the call graph for this function:

◆ on_traceDown_clicked

void GLScopeGUI::on_traceDown_clicked ( bool  checked)
privateslot

Definition at line 665 of file glscopegui.cpp.

References ScopeVis::focusOnTrace(), ScopeVis::getTraceData(), m_scopeVis, ScopeVis::moveTrace(), setTraceUI(), and ui.

666 {
667  (void) checked;
668  if (ui->trace->value() > 0) // not the X (lowest) trace
669  {
670  int newTraceIndex = (ui->trace->value() - 1) % (ui->trace->maximum()+1);
671  m_scopeVis->moveTrace(ui->trace->value(), false);
672  ui->trace->setValue(newTraceIndex); // follow trace
673  ScopeVis::TraceData traceData;
674  m_scopeVis->getTraceData(traceData, ui->trace->value());
675  setTraceUI(traceData);
676  m_scopeVis->focusOnTrace(ui->trace->value());
677  }
678 }
void getTraceData(TraceData &traceData, uint32_t traceIndex)
Definition: scopevis.h:231
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void focusOnTrace(uint32_t traceIndex)
Definition: scopevis.cpp:173
void moveTrace(uint32_t traceIndex, bool upElseDown)
Definition: scopevis.cpp:164
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void setTraceUI(const ScopeVis::TraceData &traceData)
+ Here is the call graph for this function:

◆ on_traceIntensity_valueChanged

void GLScopeGUI::on_traceIntensity_valueChanged ( int  value)
privateslot

Definition at line 544 of file glscopegui.cpp.

References arg(), m_glScope, GLScope::setDisplayTraceIntensity(), and ui.

545 {
546  ui->traceIntensity->setToolTip(QString("Trace intensity: %1").arg(value));
548 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setDisplayTraceIntensity(int intensity)
Definition: glscope.cpp:86
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:

◆ on_traceLen_valueChanged

void GLScopeGUI::on_traceLen_valueChanged ( int  value)
privateslot

Definition at line 583 of file glscopegui.cpp.

References ScopeVis::configure(), GLScope::getTraceSize(), m_glScope, m_scopeVis, m_timeBase, m_timeOffset, ScopeVis::m_traceChunkSize, m_traceLenMult, setTimeOfsDisplay(), setTimeScaleDisplay(), setTraceLenDisplay(), setTrigDelayDisplay(), setTrigPreDisplay(), and ui.

584 {
585  if ((value < 1) || (value > 100)) {
586  return;
587  }
588 
589  m_traceLenMult = value;
591  m_timeBase,
592  m_timeOffset*10,
593  (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
594  ui->freerun->isChecked());
600 }
int m_timeOffset
Definition: glscopegui.h:152
void setTimeOfsDisplay()
void setTrigDelayDisplay()
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void setTraceLenDisplay()
void setTimeScaleDisplay()
int m_timeBase
Definition: glscopegui.h:151
unsigned int uint32_t
Definition: rtptypes_win.h:46
void configure(uint32_t traceSize, uint32_t timeBase, uint32_t timeOfsProMill, uint32_t triggerPre, bool freeRun)
Definition: scopevis.cpp:129
int getTraceSize() const
Definition: glscope.h:63
int m_traceLenMult
Definition: glscopegui.h:153
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void setTrigPreDisplay()
static const uint32_t m_traceChunkSize
Definition: scopevis.h:150
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:

◆ on_traceMode_currentIndexChanged

void GLScopeGUI::on_traceMode_currentIndexChanged ( int  index)
privateslot

Definition at line 747 of file glscopegui.cpp.

References changeCurrentTrace(), setAmpOfsDisplay(), and setAmpScaleDisplay().

748 {
749  (void) index;
753 }
void changeCurrentTrace()
void setAmpOfsDisplay()
void setAmpScaleDisplay()
+ Here is the call graph for this function:

◆ on_traceUp_clicked

void GLScopeGUI::on_traceUp_clicked ( bool  checked)
privateslot

Definition at line 650 of file glscopegui.cpp.

References ScopeVis::focusOnTrace(), ScopeVis::getTraceData(), m_scopeVis, ScopeVis::moveTrace(), setTraceUI(), and ui.

651 {
652  (void) checked;
653  if (ui->trace->maximum() > 0) // more than one trace
654  {
655  int newTraceIndex = (ui->trace->value() + 1) % (ui->trace->maximum()+1);
656  m_scopeVis->moveTrace(ui->trace->value(), true);
657  ui->trace->setValue(newTraceIndex); // follow trace
658  ScopeVis::TraceData traceData;
659  m_scopeVis->getTraceData(traceData, ui->trace->value());
660  setTraceUI(traceData);
661  m_scopeVis->focusOnTrace(ui->trace->value());
662  }
663 }
void getTraceData(TraceData &traceData, uint32_t traceIndex)
Definition: scopevis.h:231
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void focusOnTrace(uint32_t traceIndex)
Definition: scopevis.cpp:173
void moveTrace(uint32_t traceIndex, bool upElseDown)
Definition: scopevis.cpp:164
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void setTraceUI(const ScopeVis::TraceData &traceData)
+ Here is the call graph for this function:

◆ on_traceView_toggled

void GLScopeGUI::on_traceView_toggled ( bool  checked)
privateslot

Definition at line 790 of file glscopegui.cpp.

References changeCurrentTrace().

791 {
792  (void) checked;
794 }
void changeCurrentTrace()
+ Here is the call graph for this function:

◆ on_trig_valueChanged

void GLScopeGUI::on_trig_valueChanged ( int  value)
privateslot

Definition at line 680 of file glscopegui.cpp.

References arg(), ScopeVis::focusOnTrigger(), ScopeVis::getTriggerData(), ScopeVis::TriggerData::m_projectionType, m_scopeVis, ScopeVis::TriggerData::m_triggerBothEdges, ScopeVis::TriggerData::m_triggerLevel, ScopeVis::TriggerData::m_triggerPositiveEdge, ScopeVis::TriggerData::m_triggerRepeat, setTriggerUI(), and ui.

Referenced by focusOnTrigger().

681 {
682  ui->trigText->setText(tr("%1").arg(value));
683 
684  ScopeVis::TriggerData triggerData;
685  m_scopeVis->getTriggerData(triggerData, value);
686 
687  qDebug() << "GLScopeGUI::on_trig_valueChanged:"
688  << " m_projectionType: " << (int) triggerData.m_projectionType
689  << " m_triggerRepeat" << triggerData.m_triggerRepeat
690  << " m_triggerPositiveEdge" << triggerData.m_triggerPositiveEdge
691  << " m_triggerBothEdges" << triggerData.m_triggerBothEdges
692  << " m_triggerLevel" << triggerData.m_triggerLevel;
693 
694  setTriggerUI(triggerData);
695 
696  m_scopeVis->focusOnTrigger(value);
697 }
uint32_t m_triggerRepeat
Number of trigger conditions before the final decisive trigger.
Definition: scopevis.h:114
bool m_triggerPositiveEdge
Trigger on the positive edge (else negative)
Definition: scopevis.h:107
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void getTriggerData(TriggerData &triggerData, uint32_t triggerIndex)
Definition: scopevis.h:223
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
bool m_triggerBothEdges
Trigger on both edges (else only one)
Definition: scopevis.h:108
void focusOnTrigger(uint32_t triggerIndex)
Definition: scopevis.cpp:203
Real m_triggerLevel
Level in real units.
Definition: scopevis.h:104
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
Projector::ProjectionType m_projectionType
Complex to real projection type.
Definition: scopevis.h:102
void setTriggerUI(const ScopeVis::TriggerData &triggerData)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_trigAdd_clicked

void GLScopeGUI::on_trigAdd_clicked ( bool  checked)
privateslot

Definition at line 699 of file glscopegui.cpp.

References addTrigger(), and fillTriggerData().

700 {
701  (void) checked;
702  ScopeVis::TriggerData triggerData;
703  fillTriggerData(triggerData);
704  addTrigger(triggerData);
705 }
void addTrigger(const ScopeVis::TriggerData &triggerData)
void fillTriggerData(ScopeVis::TriggerData &triggerData)
+ Here is the call graph for this function:

◆ on_trigBoth_toggled

void GLScopeGUI::on_trigBoth_toggled ( bool  checked)
privateslot

Definition at line 912 of file glscopegui.cpp.

References changeCurrentTrigger(), and ui.

913 {
914  if (checked)
915  {
916  ui->trigNeg->setChecked(false);
917  ui->trigPos->setChecked(false);
918  }
920 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void changeCurrentTrigger()
+ Here is the call graph for this function:

◆ on_trigColor_clicked

void GLScopeGUI::on_trigColor_clicked ( )
privateslot

Definition at line 967 of file glscopegui.cpp.

References arg(), changeCurrentTrigger(), m_focusedTriggerColor, and ui.

968 {
969  QColor newColor = QColorDialog::getColor(m_focusedTriggerColor, this, tr("Select Color for trigger line"), QColorDialog::DontUseNativeDialog);
970 
971  if (newColor.isValid()) // user clicked "OK"
972  {
973  m_focusedTriggerColor = newColor;
974  int r,g,b,a;
975  m_focusedTriggerColor.getRgb(&r, &g, &b, &a);
976  ui->trigColor->setStyleSheet(tr("QLabel { background-color : rgb(%1,%2,%3); }").arg(r).arg(g).arg(b));
978  }
979 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void changeCurrentTrigger()
QColor m_focusedTriggerColor
Definition: glscopegui.h:155
+ Here is the call graph for this function:

◆ on_trigCount_valueChanged

void GLScopeGUI::on_trigCount_valueChanged ( int  value)
privateslot

Definition at line 885 of file glscopegui.cpp.

References changeCurrentTrigger(), and setTrigCountDisplay().

886 {
887  (void) value;
890 }
void setTrigCountDisplay()
void changeCurrentTrigger()
+ Here is the call graph for this function:

◆ on_trigDel_clicked

void GLScopeGUI::on_trigDel_clicked ( bool  checked)
privateslot

Definition at line 707 of file glscopegui.cpp.

References m_scopeVis, ScopeVis::removeTrigger(), and ui.

708 {
709  (void) checked;
710  if (ui->trig->value() > 0)
711  {
712  m_scopeVis->removeTrigger(ui->trig->value());
713  ui->trig->setMaximum(ui->trig->maximum() - 1);
714  }
715 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void removeTrigger(uint32_t triggerIndex)
Definition: scopevis.cpp:191
+ Here is the call graph for this function:

◆ on_trigDelayCoarse_valueChanged

void GLScopeGUI::on_trigDelayCoarse_valueChanged ( int  value)
privateslot

Definition at line 942 of file glscopegui.cpp.

References changeCurrentTrigger(), and setTrigDelayDisplay().

943 {
944  (void) value;
947 }
void setTrigDelayDisplay()
void changeCurrentTrigger()
+ Here is the call graph for this function:

◆ on_trigDelayFine_valueChanged

void GLScopeGUI::on_trigDelayFine_valueChanged ( int  value)
privateslot

Definition at line 949 of file glscopegui.cpp.

References changeCurrentTrigger(), and setTrigDelayDisplay().

950 {
951  (void) value;
954 }
void setTrigDelayDisplay()
void changeCurrentTrigger()
+ Here is the call graph for this function:

◆ on_trigDown_clicked

void GLScopeGUI::on_trigDown_clicked ( bool  checked)
privateslot

Definition at line 732 of file glscopegui.cpp.

References ScopeVis::focusOnTrigger(), ScopeVis::getTriggerData(), m_scopeVis, ScopeVis::moveTrigger(), setTriggerUI(), and ui.

733 {
734  (void) checked;
735  if (ui->trig->value() > 0) // not the 0 (lowest) trigger
736  {
737  int newTriggerIndex = (ui->trig->value() - 1) % (ui->trig->maximum()+1);
738  m_scopeVis->moveTrigger(ui->trace->value(), false);
739  ui->trig->setValue(newTriggerIndex); // follow trigger
740  ScopeVis::TriggerData triggerData;
741  m_scopeVis->getTriggerData(triggerData, ui->trig->value());
742  setTriggerUI(triggerData);
743  m_scopeVis->focusOnTrigger(ui->trig->value());
744  }
745 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void moveTrigger(uint32_t triggerIndex, bool upElseDown)
Definition: scopevis.cpp:197
void getTriggerData(TriggerData &triggerData, uint32_t triggerIndex)
Definition: scopevis.h:223
void focusOnTrigger(uint32_t triggerIndex)
Definition: scopevis.cpp:203
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void setTriggerUI(const ScopeVis::TriggerData &triggerData)
+ Here is the call graph for this function:

◆ on_trigHoldoff_valueChanged

void GLScopeGUI::on_trigHoldoff_valueChanged ( int  value)
privateslot

Definition at line 922 of file glscopegui.cpp.

References arg(), changeCurrentTrigger(), and ui.

923 {
924  ui->trigHoldoffText->setText(tr("%1").arg(value));
926 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void changeCurrentTrigger()
+ Here is the call graph for this function:

◆ on_trigLevelCoarse_valueChanged

void GLScopeGUI::on_trigLevelCoarse_valueChanged ( int  value)
privateslot

Definition at line 928 of file glscopegui.cpp.

References changeCurrentTrigger(), and setTrigLevelDisplay().

929 {
930  (void) value;
933 }
void setTrigLevelDisplay()
void changeCurrentTrigger()
+ Here is the call graph for this function:

◆ on_trigLevelFine_valueChanged

void GLScopeGUI::on_trigLevelFine_valueChanged ( int  value)
privateslot

Definition at line 935 of file glscopegui.cpp.

References changeCurrentTrigger(), and setTrigLevelDisplay().

936 {
937  (void) value;
940 }
void setTrigLevelDisplay()
void changeCurrentTrigger()
+ Here is the call graph for this function:

◆ on_trigMode_currentIndexChanged

void GLScopeGUI::on_trigMode_currentIndexChanged ( int  index)
privateslot

Definition at line 878 of file glscopegui.cpp.

References changeCurrentTrigger(), and setTrigLevelDisplay().

879 {
880  (void) index;
883 }
void setTrigLevelDisplay()
void changeCurrentTrigger()
+ Here is the call graph for this function:

◆ on_trigNeg_toggled

void GLScopeGUI::on_trigNeg_toggled ( bool  checked)
privateslot

Definition at line 902 of file glscopegui.cpp.

References changeCurrentTrigger(), and ui.

903 {
904  if (checked)
905  {
906  ui->trigPos->setChecked(false);
907  ui->trigBoth->setChecked(false);
908  }
910 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void changeCurrentTrigger()
+ Here is the call graph for this function:

◆ on_trigOneShot_toggled

void GLScopeGUI::on_trigOneShot_toggled ( bool  checked)
privateslot

Definition at line 981 of file glscopegui.cpp.

References m_scopeVis, and ScopeVis::setOneShot().

982 {
983  m_scopeVis->setOneShot(checked);
984 }
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void setOneShot(bool oneShot)
Definition: scopevis.cpp:209
+ Here is the call graph for this function:

◆ on_trigPos_toggled

void GLScopeGUI::on_trigPos_toggled ( bool  checked)
privateslot

Definition at line 892 of file glscopegui.cpp.

References changeCurrentTrigger(), and ui.

893 {
894  if (checked)
895  {
896  ui->trigNeg->setChecked(false);
897  ui->trigBoth->setChecked(false);
898  }
900 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void changeCurrentTrigger()
+ Here is the call graph for this function:

◆ on_trigPre_valueChanged

void GLScopeGUI::on_trigPre_valueChanged ( int  value)
privateslot

Definition at line 956 of file glscopegui.cpp.

References ScopeVis::configure(), GLScope::getTraceSize(), m_glScope, m_scopeVis, m_timeBase, m_timeOffset, ScopeVis::m_traceChunkSize, m_traceLenMult, setTrigPreDisplay(), and ui.

957 {
958  (void) value;
961  m_timeBase,
962  m_timeOffset*10,
963  (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
964  ui->freerun->isChecked());
965 }
int m_timeOffset
Definition: glscopegui.h:152
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
int m_timeBase
Definition: glscopegui.h:151
unsigned int uint32_t
Definition: rtptypes_win.h:46
void configure(uint32_t traceSize, uint32_t timeBase, uint32_t timeOfsProMill, uint32_t triggerPre, bool freeRun)
Definition: scopevis.cpp:129
int getTraceSize() const
Definition: glscope.h:63
int m_traceLenMult
Definition: glscopegui.h:153
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void setTrigPreDisplay()
static const uint32_t m_traceChunkSize
Definition: scopevis.h:150
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:

◆ on_trigUp_clicked

void GLScopeGUI::on_trigUp_clicked ( bool  checked)
privateslot

Definition at line 717 of file glscopegui.cpp.

References ScopeVis::focusOnTrigger(), ScopeVis::getTriggerData(), m_scopeVis, ScopeVis::moveTrigger(), setTriggerUI(), and ui.

718 {
719  (void) checked;
720  if (ui->trig->maximum() > 0) // more than one trigger
721  {
722  int newTriggerIndex = (ui->trig->value() + 1) % (ui->trig->maximum()+1);
723  m_scopeVis->moveTrigger(ui->trace->value(), true);
724  ui->trig->setValue(newTriggerIndex); // follow trigger
725  ScopeVis::TriggerData triggerData;
726  m_scopeVis->getTriggerData(triggerData, ui->trig->value());
727  setTriggerUI(triggerData);
728  m_scopeVis->focusOnTrigger(ui->trig->value());
729  }
730 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void moveTrigger(uint32_t triggerIndex, bool upElseDown)
Definition: scopevis.cpp:197
void getTriggerData(TriggerData &triggerData, uint32_t triggerIndex)
Definition: scopevis.h:223
void focusOnTrigger(uint32_t triggerIndex)
Definition: scopevis.cpp:203
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void setTriggerUI(const ScopeVis::TriggerData &triggerData)
+ Here is the call graph for this function:

◆ on_verticalXY_toggled

void GLScopeGUI::on_verticalXY_toggled ( bool  checked)
privateslot

Definition at line 503 of file glscopegui.cpp.

References GLScope::DisplayXYV, m_glScope, GLScope::setDisplayMode(), and ui.

504 {
505  if (checked)
506  {
507  ui->onlyX->setChecked(false);
508  ui->onlyY->setChecked(false);
509  ui->horizontalXY->setChecked(false);
510  ui->polar->setChecked(false);
512  }
513  else
514  {
515  if (!ui->onlyX->isChecked() && !ui->onlyY->isChecked() && !ui->horizontalXY->isChecked() && !ui->polar->isChecked()) {
516  ui->polar->setChecked(true);
517  }
518  }
519 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
GLScope * m_glScope
Definition: glscopegui.h:148
void setDisplayMode(DisplayMode displayMode)
Definition: glscope.cpp:990
+ Here is the call graph for this function:

◆ resetToDefaults()

void GLScopeGUI::resetToDefaults ( )

Definition at line 170 of file glscopegui.cpp.

Referenced by deserialize().

171 {
172 }
+ Here is the caller graph for this function:

◆ serialize()

QByteArray GLScopeGUI::serialize ( ) const
virtual

Implements Serializable.

Definition at line 175 of file glscopegui.cpp.

References SimpleSerializer::final(), GLScope::getDisplayMode(), ScopeVis::getNbTriggers(), ScopeVis::getTracesData(), ScopeVis::getTriggerData(), i, m_glScope, ScopeVis::TriggerData::m_projectionType, m_scopeVis, ScopeVis::TriggerData::m_triggerBothEdges, ScopeVis::TriggerData::m_triggerColorB, ScopeVis::TriggerData::m_triggerColorG, ScopeVis::TriggerData::m_triggerColorR, ScopeVis::TriggerData::m_triggerDelayCoarse, ScopeVis::TriggerData::m_triggerDelayFine, ScopeVis::TriggerData::m_triggerHoldoff, ScopeVis::TriggerData::m_triggerLevelCoarse, ScopeVis::TriggerData::m_triggerLevelFine, ScopeVis::TriggerData::m_triggerPositiveEdge, ScopeVis::TriggerData::m_triggerRepeat, ui, SimpleSerializer::writeBool(), SimpleSerializer::writeFloat(), SimpleSerializer::writeS32(), and SimpleSerializer::writeU32().

176 {
177  SimpleSerializer s(1);
178 
179  // first row
180  s.writeS32(1, (int) m_glScope->getDisplayMode());
181  s.writeS32(2, ui->traceIntensity->value());
182  s.writeS32(3, ui->gridIntensity->value());
183  s.writeS32(4, ui->time->value());
184  s.writeS32(5, ui->timeOfs->value());
185  s.writeS32(6, ui->traceLen->value());
186 
187  // second row - by trace
188  const std::vector<ScopeVis::TraceData>& tracesData = m_scopeVis->getTracesData();
189  std::vector<ScopeVis::TraceData>::const_iterator traceDataIt = tracesData.begin();
190  s.writeU32(10, (uint32_t) tracesData.size());
191  int i = 0;
192 
193  for (; traceDataIt != tracesData.end(); ++traceDataIt, i++)
194  {
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);
204  }
205 
206  // third row - by trigger
207  s.writeU32(200, (uint32_t) m_scopeVis->getNbTriggers());
208  s.writeS32(201, ui->trigPre->value());
209 
210  for (unsigned int i = 0; i < m_scopeVis->getNbTriggers(); i++)
211  {
212  const ScopeVis::TriggerData& triggerData = m_scopeVis->getTriggerData(i);
213  s.writeS32(210 + 16*i, (int) triggerData.m_projectionType);
214  s.writeS32(211 + 16*i, triggerData.m_triggerRepeat);
215  s.writeBool(212 + 16*i, triggerData.m_triggerPositiveEdge);
216  s.writeBool(213 + 16*i, triggerData.m_triggerBothEdges);
217  s.writeS32(214 + 16*i, triggerData.m_triggerLevelCoarse);
218  s.writeS32(215 + 16*i, triggerData.m_triggerLevelFine);
219  s.writeS32(216 + 16*i, triggerData.m_triggerDelayCoarse);
220  s.writeS32(217 + 16*i, triggerData.m_triggerDelayFine);
221  s.writeFloat(218 + 16*i, triggerData.m_triggerColorR);
222  s.writeFloat(219 + 16*i, triggerData.m_triggerColorG);
223  s.writeFloat(220 + 16*i, triggerData.m_triggerColorB);
224  s.writeU32(221 + 16*i, triggerData.m_triggerHoldoff);
225  }
226 
227  return s.final();
228 }
uint32_t m_triggerRepeat
Number of trigger conditions before the final decisive trigger.
Definition: scopevis.h:114
bool m_triggerPositiveEdge
Trigger on the positive edge (else negative)
Definition: scopevis.h:107
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void getTriggerData(TriggerData &triggerData, uint32_t triggerIndex)
Definition: scopevis.h:223
unsigned int uint32_t
Definition: rtptypes_win.h:46
DisplayMode getDisplayMode() const
Definition: glscope.h:80
float m_triggerColorR
Trigger line display color - red shortcut.
Definition: scopevis.h:116
bool m_triggerBothEdges
Trigger on both edges (else only one)
Definition: scopevis.h:108
uint32_t m_triggerHoldoff
Trigger holdoff in number of samples.
Definition: scopevis.h:109
int32_t i
Definition: decimators.h:244
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
Projector::ProjectionType m_projectionType
Complex to real projection type.
Definition: scopevis.h:102
uint32_t getNbTriggers() const
Definition: scopevis.h:241
GLScope * m_glScope
Definition: glscopegui.h:148
const std::vector< TraceData > & getTracesData() const
Definition: scopevis.h:240
float m_triggerColorB
Trigger line display color - blue shortcut.
Definition: scopevis.h:118
float m_triggerColorG
Trigger line display color - green shortcut.
Definition: scopevis.h:117
+ Here is the call graph for this function:

◆ setAmpOfsDisplay()

void GLScopeGUI::setAmpOfsDisplay ( )
private

Definition at line 1132 of file glscopegui.cpp.

References arg(), Projector::ProjectionMagDB, Projector::ProjectionMagLin, Projector::ProjectionMagSq, and ui.

Referenced by deserialize(), on_ofsCoarse_valueChanged(), on_ofsFine_valueChanged(), on_traceMode_currentIndexChanged(), setBuddies(), and setTraceUI().

1133 {
1134  Projector::ProjectionType projectionType = (Projector::ProjectionType) ui->traceMode->currentIndex();
1135  double o = (ui->ofsCoarse->value() * 10.0f) + (ui->ofsFine->value() / 20.0f);
1136 
1137  if (projectionType == Projector::ProjectionMagDB)
1138  {
1139  ui->ofsText->setText(tr("%1\ndB").arg(o/10.0f - 100.0f, 0, 'f', 1));
1140  }
1141  else
1142  {
1143  double a;
1144 
1145  if ((projectionType == Projector::ProjectionMagLin) || (projectionType == Projector::ProjectionMagSq))
1146  {
1147  a = o/2000.0f;
1148  }
1149  else
1150  {
1151  a = o/1000.0f;
1152  }
1153 
1154  if(fabs(a) < 1e-9)
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));
1162  else
1163  ui->ofsText->setText(tr("%1").arg(a * 1.0));
1164  }
1165 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Calculate logarithmic (dB) of squared magnitude.
Definition: projector.h:31
ProjectionType
Definition: projector.h:25
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Calculate linear magnitude or modulus.
Definition: projector.h:29
Calculate linear squared magnitude or power.
Definition: projector.h:30
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAmpScaleDisplay()

void GLScopeGUI::setAmpScaleDisplay ( )
private

Definition at line 1101 of file glscopegui.cpp.

References amps, arg(), Projector::ProjectionMagDB, and ui.

Referenced by deserialize(), on_amp_valueChanged(), on_traceMode_currentIndexChanged(), setBuddies(), and setTraceUI().

1102 {
1103  Projector::ProjectionType projectionType = (Projector::ProjectionType) ui->traceMode->currentIndex();
1104  double ampValue = amps[ui->amp->value()];
1105 
1106  if (projectionType == Projector::ProjectionMagDB)
1107  {
1108  double displayValue = ampValue*500.0f;
1109 
1110  if (displayValue < 10.0f) {
1111  ui->ampText->setText(tr("%1\ndB").arg(displayValue, 0, 'f', 2));
1112  }
1113  else {
1114  ui->ampText->setText(tr("%1\ndB").arg(displayValue, 0, 'f', 1));
1115  }
1116  }
1117  else
1118  {
1119  double a = ampValue*10.0f;
1120 
1121  if(a < 0.000001)
1122  ui->ampText->setText(tr("%1\nn").arg(a * 1000000000.0));
1123  else if(a < 0.001)
1124  ui->ampText->setText(tr("%1\nµ").arg(a * 1000000.0));
1125  else if(a < 1.0)
1126  ui->ampText->setText(tr("%1\nm").arg(a * 1000.0));
1127  else
1128  ui->ampText->setText(tr("%1").arg(a * 1.0));
1129  }
1130 }
static const double amps[27]
Definition: glscopegui.h:157
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Calculate logarithmic (dB) of squared magnitude.
Definition: projector.h:31
ProjectionType
Definition: projector.h:25
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setBuddies()

void GLScopeGUI::setBuddies ( MessageQueue messageQueue,
ScopeVis scopeVis,
GLScope glScope 
)

Definition at line 68 of file glscopegui.cpp.

References ScopeVis::addTrace(), ScopeVis::addTrigger(), ScopeVis::configure(), GLScope::DisplayX, fillProjectionCombo(), fillTraceData(), fillTriggerData(), GLScope::getTraceSize(), m_glScope, m_messageQueue, m_scopeVis, m_timeBase, m_timeOffset, ScopeVis::m_traceChunkSize, m_traceLenMult, on_scope_preTriggerChanged(), on_scope_sampleRateChanged(), on_scope_traceSizeChanged(), setAmpOfsDisplay(), setAmpScaleDisplay(), GLScope::setDisplayMode(), setTimeOfsDisplay(), setTimeScaleDisplay(), setTraceDelayDisplay(), setTraceLenDisplay(), and ui.

69 {
70  qDebug("GLScopeGUI::setBuddies");
71 
72  m_messageQueue = messageQueue;
73  m_scopeVis = scopeVis;
74  m_glScope = glScope;
75 
76  // initialize display combo
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);
87 
88  // initialize trigger combo
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);
95 
96  // Add a trigger
97  ScopeVis::TriggerData triggerData;
98  fillTriggerData(triggerData);
99  m_scopeVis->addTrigger(triggerData);
100 
101  // Add a trace
102  ScopeVis::TraceData traceData;
103  fillTraceData(traceData);
104  m_scopeVis->addTrace(traceData);
105 
106  setEnabled(true);
107  connect(m_glScope, SIGNAL(sampleRateChanged(int)), this, SLOT(on_scope_sampleRateChanged(int)));
108  connect(m_glScope, SIGNAL(traceSizeChanged(uint32_t)), this, SLOT(on_scope_traceSizeChanged(uint32_t)));
109  connect(m_glScope, SIGNAL(preTriggerChanged(uint32_t)), this, SLOT(on_scope_preTriggerChanged(uint32_t)));
110 
111  ui->traceMode->clear();
112  fillProjectionCombo(ui->traceMode);
113 
114  ui->trigMode->clear();
115  fillProjectionCombo(ui->trigMode);
116 
118  m_timeBase,
119  m_timeOffset*10,
120  (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
121  ui->freerun->isChecked());
122 
123  m_scopeVis->configure(m_traceLenMult*ScopeVis::m_traceChunkSize,
124  m_timeBase,
125  m_timeOffset*10,
126  (uint32_t) (m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f)),
127  ui->freerun->isChecked());
128 
135 }
void addTrigger(const TriggerData &triggerData)
Definition: scopevis.cpp:179
int m_timeOffset
Definition: glscopegui.h:152
void setTimeOfsDisplay()
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void setTraceLenDisplay()
MessageQueue * m_messageQueue
Definition: glscopegui.h:146
void setTimeScaleDisplay()
void on_scope_traceSizeChanged(uint32_t value)
Definition: glscopegui.cpp:155
int m_timeBase
Definition: glscopegui.h:151
unsigned int uint32_t
Definition: rtptypes_win.h:46
void on_scope_preTriggerChanged(uint32_t value)
Definition: glscopegui.cpp:163
void setTraceDelayDisplay()
void configure(uint32_t traceSize, uint32_t timeBase, uint32_t timeOfsProMill, uint32_t triggerPre, bool freeRun)
Definition: scopevis.cpp:129
void fillProjectionCombo(QComboBox *comboBox)
int getTraceSize() const
Definition: glscope.h:63
int m_traceLenMult
Definition: glscopegui.h:153
void setAmpOfsDisplay()
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
void fillTriggerData(ScopeVis::TriggerData &triggerData)
void on_scope_sampleRateChanged(int value)
Definition: glscopegui.cpp:142
void setAmpScaleDisplay()
static const uint32_t m_traceChunkSize
Definition: scopevis.h:150
void fillTraceData(ScopeVis::TraceData &traceData)
void addTrace(const TraceData &traceData)
Definition: scopevis.cpp:135
GLScope * m_glScope
Definition: glscopegui.h:148
void setDisplayMode(DisplayMode displayMode)
Definition: glscope.cpp:990
+ Here is the call graph for this function:

◆ setDisplayMode()

void GLScopeGUI::setDisplayMode ( DisplayMode  displayMode)

Definition at line 1566 of file glscopegui.cpp.

References DisplayPol, DisplayX, DisplayXYH, DisplayXYV, DisplayY, and ui.

1567 {
1568  if (ui->trace->maximum() == 0)
1569  {
1570  ui->onlyX->setChecked(true);
1571  }
1572  else
1573  {
1574  switch (displayMode)
1575  {
1576  case DisplayX:
1577  ui->onlyX->setChecked(true);
1578  break;
1579  case DisplayY:
1580  ui->onlyY->setChecked(true);
1581  break;
1582  case DisplayXYH:
1583  ui->horizontalXY->setChecked(true);
1584  break;
1585  case DisplayXYV:
1586  ui->verticalXY->setChecked(true);
1587  break;
1588  case DisplayPol:
1589  ui->polar->setChecked(true);
1590  break;
1591  default:
1592  ui->onlyX->setChecked(true);
1593  break;
1594  }
1595  }
1596 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144

◆ setGridIntensity()

void GLScopeGUI::setGridIntensity ( int  value)

Definition at line 1607 of file glscopegui.cpp.

References ui.

1608 {
1609  if ((value < ui->gridIntensity->minimum()) || (value > ui->gridIntensity->maximum())) {
1610  return;
1611  }
1612 
1613  ui->gridIntensity->setValue(value);
1614 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144

◆ setPreTrigger()

void GLScopeGUI::setPreTrigger ( int  step)

Definition at line 1643 of file glscopegui.cpp.

References ui.

1644 {
1645  if ((step < ui->trigPre->minimum()) || (step > ui->trigPre->maximum())) {
1646  return;
1647  }
1648 
1649  ui->trigPre->setValue(step);
1650 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144

◆ setSampleRate()

void GLScopeGUI::setSampleRate ( int  sampleRate)

Definition at line 137 of file glscopegui.cpp.

References m_sampleRate.

138 {
139  m_sampleRate = sampleRate;
140 }
int m_sampleRate
Definition: glscopegui.h:150

◆ setTimeBase()

void GLScopeGUI::setTimeBase ( int  step)

Definition at line 1616 of file glscopegui.cpp.

References ui.

1617 {
1618  if ((step < ui->time->minimum()) || (step > ui->time->maximum())) {
1619  return;
1620  }
1621 
1622  ui->time->setValue(step);
1623 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144

◆ setTimeOffset()

void GLScopeGUI::setTimeOffset ( int  step)

Definition at line 1625 of file glscopegui.cpp.

References ui.

1626 {
1627  if ((step < ui->timeOfs->minimum()) || (step > ui->timeOfs->maximum())) {
1628  return;
1629  }
1630 
1631  ui->timeOfs->setValue(step);
1632 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144

◆ setTimeOfsDisplay()

void GLScopeGUI::setTimeOfsDisplay ( )
private

Definition at line 1078 of file glscopegui.cpp.

References arg(), GLScope::getTraceSize(), m_glScope, m_sampleRate, m_timeOffset, and ui.

Referenced by on_scope_sampleRateChanged(), on_timeOfs_valueChanged(), on_traceLen_valueChanged(), and setBuddies().

1079 {
1080  unsigned int n_samples = m_glScope->getTraceSize() * (m_timeOffset/100.0);
1081  double dt = m_glScope->getTraceSize() * (m_timeOffset/100.0) / m_sampleRate;
1082 
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));
1087  } else {
1088  ui->timeOfsText->setToolTip(tr("%1 MS").arg(n_samples/1000000.0));
1089  }
1090 
1091  if(dt < 0.000001)
1092  ui->timeOfsText->setText(tr("%1\nns").arg(dt * 1000000000.0, 0, 'f', 2));
1093  else if(dt < 0.001)
1094  ui->timeOfsText->setText(tr("%1\nµs").arg(dt * 1000000.0, 0, 'f', 2));
1095  else if(dt < 1.0)
1096  ui->timeOfsText->setText(tr("%1\nms").arg(dt * 1000.0, 0, 'f', 2));
1097  else
1098  ui->timeOfsText->setText(tr("%1\ns").arg(dt * 1.0, 0, 'f', 2));
1099 }
int m_timeOffset
Definition: glscopegui.h:152
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int getTraceSize() const
Definition: glscope.h:63
int m_sampleRate
Definition: glscopegui.h:150
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTimeScaleDisplay()

void GLScopeGUI::setTimeScaleDisplay ( )
private

Definition at line 1017 of file glscopegui.cpp.

References arg(), GLScope::getSampleRate(), GLScope::getTraceSize(), m_glScope, m_sampleRate, m_timeBase, and ui.

Referenced by on_scope_sampleRateChanged(), on_time_valueChanged(), on_traceLen_valueChanged(), and setBuddies().

1018 {
1020  unsigned int n_samples = (m_glScope->getTraceSize() * 1.0) / (double) m_timeBase;
1021  double t = (m_glScope->getTraceSize() * 1.0 / m_sampleRate) / (double) m_timeBase;
1022 
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));
1027  } else {
1028  ui->timeText->setToolTip(tr("%1 MS").arg(n_samples/1000000.0));
1029  }
1030 
1031  if(t < 0.000001)
1032  {
1033  t = round(t * 100000000000.0) / 100.0;
1034  ui->timeText->setText(tr("%1\nns").arg(t));
1035  }
1036  else if(t < 0.001)
1037  {
1038  t = round(t * 100000000.0) / 100.0;
1039  ui->timeText->setText(tr("%1\nµs").arg(t));
1040  }
1041  else if(t < 1.0)
1042  {
1043  t = round(t * 100000.0) / 100.0;
1044  ui->timeText->setText(tr("%1\nms").arg(t));
1045  }
1046  else
1047  {
1048  t = round(t * 100.0) / 100.0;
1049  ui->timeText->setText(tr("%1\ns").arg(t));
1050  }
1051 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
int m_timeBase
Definition: glscopegui.h:151
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int getTraceSize() const
Definition: glscope.h:63
int m_sampleRate
Definition: glscopegui.h:150
int getSampleRate() const
Definition: glscope.h:62
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTraceDelayDisplay()

void GLScopeGUI::setTraceDelayDisplay ( )
private

Definition at line 1167 of file glscopegui.cpp.

References arg(), m_sampleRate, and ui.

Referenced by deserialize(), on_scope_sampleRateChanged(), on_time_valueChanged(), on_traceDelayCoarse_valueChanged(), on_traceDelayFine_valueChanged(), setBuddies(), and setTraceUI().

1168 {
1169  if (m_sampleRate > 0)
1170  {
1171  int n_samples = ui->traceDelayCoarse->value()*100 + ui->traceDelayFine->value();
1172  double t = ((double) n_samples) / m_sampleRate;
1173 
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));
1178  } else {
1179  ui->traceDelayText->setToolTip(tr("%1 MS").arg(n_samples/1000000.0));
1180  }
1181 
1182  if(t < 0.000001)
1183  ui->traceDelayText->setText(tr("%1\nns").arg(t * 1000000000.0, 0, 'f', 2));
1184  else if(t < 0.001)
1185  ui->traceDelayText->setText(tr("%1\nµs").arg(t * 1000000.0, 0, 'f', 2));
1186  else if(t < 1.0)
1187  ui->traceDelayText->setText(tr("%1\nms").arg(t * 1000.0, 0, 'f', 2));
1188  else
1189  ui->traceDelayText->setText(tr("%1\ns").arg(t * 1.0, 0, 'f', 2));
1190  }
1191 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int m_sampleRate
Definition: glscopegui.h:150
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTraceIndexDisplay()

void GLScopeGUI::setTraceIndexDisplay ( )
private

Definition at line 1005 of file glscopegui.cpp.

References ui.

Referenced by deserialize().

1006 {
1007  ui->traceText->setText(ui->trace->value() == 0 ? "X" : QString("Y%1").arg(ui->trace->value()));
1008 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
+ Here is the caller graph for this function:

◆ setTraceIntensity()

void GLScopeGUI::setTraceIntensity ( int  value)

Definition at line 1598 of file glscopegui.cpp.

References ui.

1599 {
1600  if ((value < ui->traceIntensity->minimum()) || (value > ui->traceIntensity->maximum())) {
1601  return;
1602  }
1603 
1604  ui->traceIntensity->setValue(value);
1605 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144

◆ setTraceLenDisplay()

void GLScopeGUI::setTraceLenDisplay ( )
private

Definition at line 1053 of file glscopegui.cpp.

References arg(), GLScope::getSampleRate(), GLScope::getTraceSize(), m_glScope, m_sampleRate, ScopeVis::m_traceChunkSize, m_traceLenMult, and ui.

Referenced by on_scope_sampleRateChanged(), on_scope_traceSizeChanged(), on_traceLen_valueChanged(), and setBuddies().

1054 {
1055  unsigned int n_samples = m_traceLenMult * ScopeVis::m_traceChunkSize;
1056 
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));
1061  } else {
1062  ui->traceLenText->setToolTip(tr("%1 MS").arg(n_samples/1000000.0));
1063  }
1064 
1066  double t = (m_glScope->getTraceSize() * 1.0 / m_sampleRate);
1067 
1068  if(t < 0.000001)
1069  ui->traceLenText->setText(tr("%1\nns").arg(t * 1000000000.0, 0, 'f', 2));
1070  else if(t < 0.001)
1071  ui->traceLenText->setText(tr("%1\nµs").arg(t * 1000000.0, 0, 'f', 2));
1072  else if(t < 1.0)
1073  ui->traceLenText->setText(tr("%1\nms").arg(t * 1000.0, 0, 'f', 2));
1074  else
1075  ui->traceLenText->setText(tr("%1\ns").arg(t * 1.0, 0, 'f', 2));
1076 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int getTraceSize() const
Definition: glscope.h:63
int m_traceLenMult
Definition: glscopegui.h:153
int m_sampleRate
Definition: glscopegui.h:150
static const uint32_t m_traceChunkSize
Definition: scopevis.h:150
int getSampleRate() const
Definition: glscope.h:62
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTraceLength()

void GLScopeGUI::setTraceLength ( int  step)

Definition at line 1634 of file glscopegui.cpp.

References ui.

1635 {
1636  if ((step < ui->traceLen->minimum()) || (step > ui->traceLen->maximum())) {
1637  return;
1638  }
1639 
1640  ui->traceLen->setValue(step);
1641 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144

◆ setTraceUI()

void GLScopeGUI::setTraceUI ( const ScopeVis::TraceData traceData)
private

Definition at line 1385 of file glscopegui.cpp.

References arg(), ScopeVis::TraceData::m_ampIndex, m_focusedTraceColor, ScopeVis::TraceData::m_ofsCoarse, ScopeVis::TraceData::m_ofsFine, ScopeVis::TraceData::m_projectionType, ScopeVis::TraceData::m_traceColor, ScopeVis::TraceData::m_traceDelayCoarse, ScopeVis::TraceData::m_traceDelayFine, ScopeVis::TraceData::m_viewTrace, setAmpOfsDisplay(), setAmpScaleDisplay(), setTraceDelayDisplay(), and ui.

Referenced by on_trace_valueChanged(), on_traceDown_clicked(), and on_traceUp_clicked().

1386 {
1387  TraceUIBlocker traceUIBlocker(ui);
1388 
1389  ui->traceMode->setCurrentIndex((int) traceData.m_projectionType);
1390  ui->amp->setValue(traceData.m_ampIndex);
1392 
1393  ui->ofsCoarse->setValue(traceData.m_ofsCoarse);
1394  ui->ofsFine->setValue(traceData.m_ofsFine);
1395  setAmpOfsDisplay();
1396 
1397  ui->traceDelayCoarse->setValue(traceData.m_traceDelayCoarse);
1398  ui->traceDelayFine->setValue(traceData.m_traceDelayFine);
1400 
1401  m_focusedTraceColor = traceData.m_traceColor;
1402  int r, g, b, a;
1403  m_focusedTraceColor.getRgb(&r, &g, &b, &a);
1404  ui->traceColor->setStyleSheet(tr("QLabel { background-color : rgb(%1,%2,%3); }").arg(r).arg(g).arg(b));
1405 
1406  ui->traceView->setChecked(traceData.m_viewTrace);
1407 }
bool m_viewTrace
Trace visibility.
Definition: scopevis.h:67
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
QColor m_traceColor
Trace display color.
Definition: scopevis.h:61
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setTraceDelayDisplay()
int m_traceDelayCoarse
Coarse delay slider value.
Definition: scopevis.h:58
int m_traceDelayFine
Fine delay slider value.
Definition: scopevis.h:59
int m_ofsFine
Fine offset slider value.
Definition: scopevis.h:56
void setAmpOfsDisplay()
void setAmpScaleDisplay()
QColor m_focusedTraceColor
Definition: glscopegui.h:154
Projector::ProjectionType m_projectionType
Complex to real projection type.
Definition: scopevis.h:50
uint32_t m_ampIndex
Index in list of amplification factors.
Definition: scopevis.h:53
int m_ofsCoarse
Coarse offset slider value.
Definition: scopevis.h:55
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTrigCountDisplay()

void GLScopeGUI::setTrigCountDisplay ( )
private

Definition at line 1010 of file glscopegui.cpp.

References ui.

Referenced by deserialize(), on_trigCount_valueChanged(), and setTriggerUI().

1011 {
1012  QString text;
1013  text.sprintf("%02d", ui->trigCount->value());
1014  ui->trigCountText->setText(text);
1015 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
+ Here is the caller graph for this function:

◆ setTrigDelayDisplay()

void GLScopeGUI::setTrigDelayDisplay ( )
private

Definition at line 1230 of file glscopegui.cpp.

References arg(), GLScope::getSampleRate(), m_glScope, m_sampleRate, ScopeVis::m_traceChunkSize, m_traceLenMult, and ui.

Referenced by deserialize(), on_scope_sampleRateChanged(), on_traceLen_valueChanged(), on_trigDelayCoarse_valueChanged(), on_trigDelayFine_valueChanged(), and setTriggerUI().

1231 {
1232  if (m_sampleRate > 0)
1233  {
1234  double delayMult = ui->trigDelayCoarse->value() + ui->trigDelayFine->value() / (ScopeVis::m_traceChunkSize / 10.0);
1235  unsigned int n_samples_delay = m_traceLenMult * ScopeVis::m_traceChunkSize * delayMult;
1236 
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));
1243  } else {
1244  ui->trigDelayText->setToolTip(tr("%1 GS").arg(n_samples_delay/1000000000.0));
1245  }
1246 
1248  double t = (n_samples_delay * 1.0f / m_sampleRate);
1249 
1250  if(t < 0.000001)
1251  ui->trigDelayText->setText(tr("%1\nns").arg(t * 1000000000.0, 0, 'f', 2));
1252  else if(t < 0.001)
1253  ui->trigDelayText->setText(tr("%1\nµs").arg(t * 1000000.0, 0, 'f', 2));
1254  else if(t < 1.0)
1255  ui->trigDelayText->setText(tr("%1\nms").arg(t * 1000.0, 0, 'f', 2));
1256  else
1257  ui->trigDelayText->setText(tr("%1\ns").arg(t * 1.0, 0, 'f', 2));
1258  }
1259 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int m_traceLenMult
Definition: glscopegui.h:153
int m_sampleRate
Definition: glscopegui.h:150
static const uint32_t m_traceChunkSize
Definition: scopevis.h:150
int getSampleRate() const
Definition: glscope.h:62
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTriggerUI()

void GLScopeGUI::setTriggerUI ( const ScopeVis::TriggerData triggerData)
private

Definition at line 1409 of file glscopegui.cpp.

References arg(), m_focusedTriggerColor, ScopeVis::TriggerData::m_projectionType, ScopeVis::TriggerData::m_triggerBothEdges, ScopeVis::TriggerData::m_triggerColor, ScopeVis::TriggerData::m_triggerDelayCoarse, ScopeVis::TriggerData::m_triggerDelayFine, ScopeVis::TriggerData::m_triggerHoldoff, ScopeVis::TriggerData::m_triggerLevelCoarse, ScopeVis::TriggerData::m_triggerLevelFine, ScopeVis::TriggerData::m_triggerPositiveEdge, ScopeVis::TriggerData::m_triggerRepeat, setTrigCountDisplay(), setTrigDelayDisplay(), setTrigLevelDisplay(), and ui.

Referenced by on_trig_valueChanged(), on_trigDown_clicked(), and on_trigUp_clicked().

1410 {
1411  TrigUIBlocker trigUIBlocker(ui);
1412 
1413  ui->trigMode->setCurrentIndex((int) triggerData.m_projectionType);
1414  ui->trigCount->setValue(triggerData.m_triggerRepeat);
1416 
1417  ui->trigPos->setChecked(false);
1418  ui->trigNeg->setChecked(false);
1419  ui->trigPos->doToggle(false);
1420  ui->trigNeg->doToggle(false);
1421 
1422  if (triggerData.m_triggerBothEdges)
1423  {
1424  ui->trigBoth->setChecked(true);
1425  ui->trigBoth->doToggle(true);
1426  }
1427  else
1428  {
1429  ui->trigBoth->setChecked(false);
1430  ui->trigBoth->doToggle(false);
1431 
1432  if (triggerData.m_triggerPositiveEdge)
1433  {
1434  ui->trigPos->setChecked(true);
1435  ui->trigPos->doToggle(true);
1436  }
1437  else
1438  {
1439  ui->trigNeg->setChecked(true);
1440  ui->trigNeg->doToggle(true);
1441  }
1442  }
1443 
1444  ui->trigHoldoffText->setText(tr("%1").arg(triggerData.m_triggerHoldoff));
1445 
1446  ui->trigLevelCoarse->setValue(triggerData.m_triggerLevelCoarse);
1447  ui->trigLevelFine->setValue(triggerData.m_triggerLevelFine);
1449 
1450  ui->trigDelayCoarse->setValue(triggerData.m_triggerDelayCoarse);
1451  ui->trigDelayFine->setValue(triggerData.m_triggerDelayFine);
1453 
1454  m_focusedTriggerColor = triggerData.m_triggerColor;
1455  int r, g, b, a;
1456  m_focusedTriggerColor.getRgb(&r, &g, &b, &a);
1457  ui->trigColor->setStyleSheet(tr("QLabel { background-color : rgb(%1,%2,%3); }").arg(r).arg(g).arg(b));
1458 }
uint32_t m_triggerRepeat
Number of trigger conditions before the final decisive trigger.
Definition: scopevis.h:114
bool m_triggerPositiveEdge
Trigger on the positive edge (else negative)
Definition: scopevis.h:107
void setTrigDelayDisplay()
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
void setTrigLevelDisplay()
void setTrigCountDisplay()
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
bool m_triggerBothEdges
Trigger on both edges (else only one)
Definition: scopevis.h:108
uint32_t m_triggerHoldoff
Trigger holdoff in number of samples.
Definition: scopevis.h:109
QColor m_triggerColor
Trigger line display color.
Definition: scopevis.h:115
Projector::ProjectionType m_projectionType
Complex to real projection type.
Definition: scopevis.h:102
QColor m_focusedTriggerColor
Definition: glscopegui.h:155
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTrigIndexDisplay()

void GLScopeGUI::setTrigIndexDisplay ( )
private

Definition at line 1193 of file glscopegui.cpp.

References arg(), and ui.

Referenced by deserialize().

1194 {
1195  ui->trigText->setText(tr("%1").arg(ui->trig->value()));
1196 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTrigLevelDisplay()

void GLScopeGUI::setTrigLevelDisplay ( )
private

Definition at line 1198 of file glscopegui.cpp.

References arg(), Projector::ProjectionMagDB, Projector::ProjectionMagLin, Projector::ProjectionMagSq, and ui.

Referenced by deserialize(), on_trigLevelCoarse_valueChanged(), on_trigLevelFine_valueChanged(), on_trigMode_currentIndexChanged(), and setTriggerUI().

1199 {
1200  double t = (ui->trigLevelCoarse->value() / 100.0f) + (ui->trigLevelFine->value() / 50000.0f);
1201  Projector::ProjectionType projectionType = (Projector::ProjectionType) ui->trigMode->currentIndex();
1202 
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));
1205 
1206  if (projectionType == Projector::ProjectionMagDB) {
1207  ui->trigLevelText->setText(tr("%1\ndB").arg(100.0 * (t - 1.0), 0, 'f', 1));
1208  }
1209  else
1210  {
1211  double a;
1212 
1213  if ((projectionType == Projector::ProjectionMagLin) || (projectionType == Projector::ProjectionMagSq)) {
1214  a = 1.0 + t;
1215  } else {
1216  a = t;
1217  }
1218 
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));
1225  else
1226  ui->trigLevelText->setText(tr("%1").arg(a * 1.0f, 0, 'f', 2));
1227  }
1228 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Calculate logarithmic (dB) of squared magnitude.
Definition: projector.h:31
ProjectionType
Definition: projector.h:25
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Calculate linear magnitude or modulus.
Definition: projector.h:29
Calculate linear squared magnitude or power.
Definition: projector.h:30
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTrigPreDisplay()

void GLScopeGUI::setTrigPreDisplay ( )
private

Definition at line 1261 of file glscopegui.cpp.

References arg(), GLScope::getTraceSize(), m_glScope, m_sampleRate, and ui.

Referenced by deserialize(), on_scope_preTriggerChanged(), on_scope_sampleRateChanged(), on_traceLen_valueChanged(), and on_trigPre_valueChanged().

1262 {
1263  if (m_sampleRate > 0)
1264  {
1265  unsigned int n_samples_delay = m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f);
1266  double dt = m_glScope->getTraceSize() * (ui->trigPre->value()/100.0f) / m_sampleRate;
1267 
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));
1274  } else {
1275  ui->trigPreText->setToolTip(tr("%1 GS").arg(n_samples_delay/1000000000.0));
1276  }
1277 
1278  if(dt < 0.000001)
1279  ui->trigPreText->setText(tr("%1\nns").arg(dt * 1000000000.0f, 0, 'f', 2));
1280  else if(dt < 0.001)
1281  ui->trigPreText->setText(tr("%1\nµs").arg(dt * 1000000.0f, 0, 'f', 2));
1282  else if(dt < 1.0)
1283  ui->trigPreText->setText(tr("%1\nms").arg(dt * 1000.0f, 0, 'f', 2));
1284  else
1285  ui->trigPreText->setText(tr("%1\ns").arg(dt * 1.0f, 0, 'f', 2));
1286  }
1287 }
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int getTraceSize() const
Definition: glscope.h:63
int m_sampleRate
Definition: glscopegui.h:150
GLScope * m_glScope
Definition: glscopegui.h:148
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ amps

const double GLScopeGUI::amps
staticprivate
Initial value:
= {
2e-1, 1e-1, 5e-2,
2e-2, 1e-2, 5e-3,
2e-3, 1e-3, 5e-4,
2e-4, 1e-4, 5e-5,
2e-5, 1e-5, 5e-6,
2e-6, 1e-6, 5e-7,
2e-7, 1e-7, 5e-8,
2e-8, 1e-8, 5e-9,
2e-9, 1e-9, 5e-10,
}

Definition at line 157 of file glscopegui.h.

Referenced by fillTraceData(), and setAmpScaleDisplay().

◆ m_focusedTraceColor

QColor GLScopeGUI::m_focusedTraceColor
private

◆ m_focusedTriggerColor

QColor GLScopeGUI::m_focusedTriggerColor
private

◆ m_glScope

GLScope* GLScopeGUI::m_glScope
private

◆ m_messageQueue

MessageQueue* GLScopeGUI::m_messageQueue
private

Definition at line 146 of file glscopegui.h.

Referenced by setBuddies().

◆ m_sampleRate

int GLScopeGUI::m_sampleRate
private

◆ m_scopeVis

ScopeVis* GLScopeGUI::m_scopeVis
private

◆ m_timeBase

int GLScopeGUI::m_timeBase
private

◆ m_timeOffset

int GLScopeGUI::m_timeOffset
private

◆ m_traceLenMult

int GLScopeGUI::m_traceLenMult
private

◆ ui

Ui::GLScopeGUI* GLScopeGUI::ui
private

The documentation for this class was generated from the following files: