QXRD  0.11.16
Public Member Functions | Private Attributes | List of all members
QxrdZingerDialog Class Reference

#include <qxrdzingerdialog.h>

Inheritance diagram for QxrdZingerDialog:
Inheritance graph
[legend]
Collaboration diagram for QxrdZingerDialog:
Collaboration graph
[legend]

Public Member Functions

 QxrdZingerDialog (QxrdDataProcessorWPtr procw, QWidget *parent=0)
 
 ~QxrdZingerDialog ()
 
void accept ()
 

Private Attributes

QxrdDataProcessorWPtr m_Processor
 

Detailed Description

Definition at line 9 of file qxrdzingerdialog.h.

Constructor & Destructor Documentation

QxrdZingerDialog::QxrdZingerDialog ( QxrdDataProcessorWPtr  procw,
QWidget *  parent = 0 
)
explicit

Definition at line 7 of file qxrdzingerdialog.cpp.

References m_Processor, QxrdDataProcessorBase::ZingerDataMask, QxrdDataProcessorBase::ZingerNoMask, and QxrdDataProcessorBase::ZingerTopStack.

7  :
8  QDialog(parent),
9  m_Processor(procw)
10 {
11  setupUi(this);
12 
14 
15  if (proc) {
16  QxrdMaskStackPtr masks(proc->maskStack());
17 
18  if (masks) {
19  m_ZingerAlgorithm -> addItem("Default", 0);
20 
21  int nmasks = masks->size();
22 
23  m_ZingerMask -> addItem("No Mask", QxrdDataProcessor::ZingerNoMask);
24  m_ZingerMask -> addItem("Mask from data", QxrdDataProcessor::ZingerDataMask);
25 
26  for (int i=0; i<nmasks; i++) {
27  QcepMaskDataPtr p = masks->at(i);
28 
29  if (p) {
30  QString lvl = masks->stackLevelName(i);
31 
32  m_ZingerMask -> addItem(lvl, i);
33  m_ZingerDestination -> addItem(lvl, i);
34  }
35  }
36 
37  m_ZingerDestination -> addItem("Top of stack", QxrdDataProcessor::ZingerTopStack);
38 
39  int algIndex = m_ZingerAlgorithm -> findData(proc->get_ZingerAlgorithm());
40  int mskIndex = m_ZingerMask -> findData(proc->get_ZingerMask());
41  int dstIndex = m_ZingerDestination -> findData(proc->get_ZingerDestination());
42 
43  m_ZingerAlgorithm -> setCurrentIndex(algIndex);
44  m_ZingerMask -> setCurrentIndex(mskIndex);
45  m_ZingerDestination -> setCurrentIndex(dstIndex);
46 
47  m_ZingerSize1 -> setValue(proc->get_ZingerSize1());
48  m_ZingerSize2 -> setValue(proc->get_ZingerSize2());
49  m_ZingerThreshold -> setValue(proc->get_ZingerThreshold());
50  }
51  }
52 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QSharedPointer< QcepMaskData > QcepMaskDataPtr
QxrdDataProcessorWPtr m_Processor
QxrdZingerDialog::~QxrdZingerDialog ( )

Definition at line 54 of file qxrdzingerdialog.cpp.

55 {
56 }

Member Function Documentation

void QxrdZingerDialog::accept ( )

Definition at line 58 of file qxrdzingerdialog.cpp.

References m_Processor.

59 {
61 
62  if (proc) {
63  proc->set_ZingerAlgorithm (m_ZingerAlgorithm -> currentData().toInt());
64  proc->set_ZingerMask (m_ZingerMask -> currentData().toInt());
65  proc->set_ZingerDestination (m_ZingerDestination -> currentData().toInt());
66  proc->set_ZingerSize1 (m_ZingerSize1 -> value());
67  proc->set_ZingerSize2 (m_ZingerSize2 -> value());
68  proc->set_ZingerThreshold (m_ZingerThreshold -> value());
69 
70  proc->findZingers();
71  }
72 
73  QDialog::accept();
74 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QxrdDataProcessorWPtr m_Processor

Member Data Documentation

QxrdDataProcessorWPtr QxrdZingerDialog::m_Processor
private

Definition at line 20 of file qxrdzingerdialog.h.

Referenced by accept(), and QxrdZingerDialog().


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