cctw  0.2.1
Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CctwqtTransformTester Class Reference

#include <cctwqttransformtester.h>

Inheritance diagram for CctwqtTransformTester:
Inheritance graph
Collaboration diagram for CctwqtTransformTester:
Collaboration graph

Public Slots

void parametersChanged ()
 
void testGetDetPix ()
 
void testPixel2QLab ()
 
void testQLab2HKL ()
 
void testHKL2Grid ()
 
void testGrid2HKL ()
 
void testHKL2QLab ()
 
void testQLab2Pixel ()
 
void testGetDetPos ()
 
- Public Slots inherited from CctwObject
virtual void printLine (QString line)
 
virtual void printMessage (QString msg, QDateTime dt=QDateTime::currentDateTime())
 
virtual QString settingsScript ()
 
QString scriptValueLiteral (QVariant v)
 

Public Member Functions

 CctwqtTransformTester (CctwqtMainWindow *w, CctwCrystalCoordinateParameters *p, QObject *parent)
 
- Public Member Functions inherited from CctwObject
 CctwObject (QString name, QObject *parent=0)
 
virtual void writeSettings (QSettings *set, QString section)
 
virtual void readSettings (QSettings *set, QString section)
 

Private Member Functions

double getRotation ()
 
CctwDoubleVector3D getDet ()
 
void setDet (CctwDoubleVector3D det)
 
CctwDoubleVector3D getPixels ()
 
void setPixels (CctwDoubleVector3D val)
 
CctwDoubleVector3D getQLab ()
 
void setQLab (CctwDoubleVector3D val)
 
CctwDoubleVector3D getHKL ()
 
void setHKL (CctwDoubleVector3D val)
 
CctwDoubleVector3D getGrid ()
 
void setGrid (CctwDoubleVector3D val)
 
void setColor (QDoubleSpinBox *box, QColor col)
 
void unhighlight ()
 
void highlightInput (QDoubleSpinBox *inp)
 
void highlightOutput (QDoubleSpinBox *inp)
 

Private Attributes

CctwqtMainWindowm_MainWindow
 
CctwCrystalCoordinateParametersm_Parameters
 

Additional Inherited Members

- Properties inherited from CctwObject
QString name
 

Detailed Description

Definition at line 10 of file cctwqttransformtester.h.

Constructor & Destructor Documentation

CctwqtTransformTester::CctwqtTransformTester ( CctwqtMainWindow w,
CctwCrystalCoordinateParameters p,
QObject *  parent 
)
explicit

Definition at line 7 of file cctwqttransformtester.cpp.

References m_MainWindow, m_Parameters, parametersChanged(), CctwObject::printMessage(), testGetDetPix(), testGetDetPos(), testGrid2HKL(), testHKL2Grid(), testHKL2QLab(), testPixel2QLab(), testQLab2HKL(), testQLab2Pixel(), and CctwqtMainWindow::ui.

7  :
8  CctwObject("transformtester", parent),
9  m_MainWindow(w),
10  m_Parameters(p)
11 {
12  printMessage(tr("Transform tester constructed, parameters = %1").arg((long) m_Parameters));
13 
14  connect(m_Parameters, SIGNAL(parametersChanged()), this, SLOT(parametersChanged()));
15 
16  connect(m_MainWindow->ui->m_GetDetPixButton, SIGNAL(clicked()), this, SLOT(testGetDetPix()));
17  connect(m_MainWindow->ui->m_Pixel2QLabButton, SIGNAL(clicked()), this, SLOT(testPixel2QLab()));
18  connect(m_MainWindow->ui->m_QLab2HKLButton, SIGNAL(clicked()), this, SLOT(testQLab2HKL()));
19  connect(m_MainWindow->ui->m_HKL2GridButton, SIGNAL(clicked()), this, SLOT(testHKL2Grid()));
20  connect(m_MainWindow->ui->m_Grid2HKLButton, SIGNAL(clicked()), this, SLOT(testGrid2HKL()));
21  connect(m_MainWindow->ui->m_HKL2QLabButton, SIGNAL(clicked()), this, SLOT(testHKL2QLab()));
22  connect(m_MainWindow->ui->m_QLab2PixelButton, SIGNAL(clicked()), this, SLOT(testQLab2Pixel()));
23  connect(m_MainWindow->ui->m_GetDetPosButton, SIGNAL(clicked()), this, SLOT(testGetDetPos()));
24 }
CctwCrystalCoordinateParameters * m_Parameters
CctwqtMainWindow * m_MainWindow
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
Definition: cctwobject.cpp:25
Ui::CctwqtMainWindow * ui
CctwObject(QString name, QObject *parent=0)
Definition: cctwobject.cpp:7

Member Function Documentation

CctwDoubleVector3D CctwqtTransformTester::getDet ( )
private

Definition at line 87 of file cctwqttransformtester.cpp.

References highlightInput(), m_MainWindow, and CctwqtMainWindow::ui.

Referenced by testGetDetPos().

88 {
89  CctwDoubleVector3D val(m_MainWindow->ui->m_TestDetectorX->value(),
90  m_MainWindow->ui->m_TestDetectorY->value(),
91  m_MainWindow->ui->m_TestDetectorZ->value());
92 
93  highlightInput(m_MainWindow->ui->m_TestDetectorX);
94  highlightInput(m_MainWindow->ui->m_TestDetectorY);
95  highlightInput(m_MainWindow->ui->m_TestDetectorZ);
96 
97  return val;
98 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
void highlightInput(QDoubleSpinBox *inp)
CctwDoubleVector3D CctwqtTransformTester::getGrid ( )
private

Definition at line 183 of file cctwqttransformtester.cpp.

References highlightInput(), m_MainWindow, and CctwqtMainWindow::ui.

Referenced by testGrid2HKL().

184 {
185  CctwDoubleVector3D val(m_MainWindow->ui->m_TestGridX->value(),
186  m_MainWindow->ui->m_TestGridY->value(),
187  m_MainWindow->ui->m_TestGridZ->value());
188 
189  highlightInput(m_MainWindow->ui->m_TestGridX);
190  highlightInput(m_MainWindow->ui->m_TestGridY);
191  highlightInput(m_MainWindow->ui->m_TestGridZ);
192 
193  return val;
194 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
void highlightInput(QDoubleSpinBox *inp)
CctwDoubleVector3D CctwqtTransformTester::getHKL ( )
private

Definition at line 159 of file cctwqttransformtester.cpp.

References highlightInput(), m_MainWindow, and CctwqtMainWindow::ui.

Referenced by testHKL2Grid(), and testHKL2QLab().

160 {
161  CctwDoubleVector3D val(m_MainWindow->ui->m_TestHKLX->value(),
162  m_MainWindow->ui->m_TestHKLY->value(),
163  m_MainWindow->ui->m_TestHKLZ->value());
164 
165  highlightInput(m_MainWindow->ui->m_TestHKLX);
166  highlightInput(m_MainWindow->ui->m_TestHKLY);
167  highlightInput(m_MainWindow->ui->m_TestHKLZ);
168 
169  return val;
170 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
void highlightInput(QDoubleSpinBox *inp)
CctwDoubleVector3D CctwqtTransformTester::getPixels ( )
private

Definition at line 111 of file cctwqttransformtester.cpp.

References highlightInput(), m_MainWindow, and CctwqtMainWindow::ui.

Referenced by testGetDetPix(), and testPixel2QLab().

112 {
113  CctwDoubleVector3D val(m_MainWindow->ui->m_TestPixelX->value(),
114  m_MainWindow->ui->m_TestPixelY->value(),
115  m_MainWindow->ui->m_TestPixelZ->value());
116 
117  highlightInput(m_MainWindow->ui->m_TestPixelX);
118  highlightInput(m_MainWindow->ui->m_TestPixelY);
119  highlightInput(m_MainWindow->ui->m_TestPixelZ);
120 
121  return val;
122 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
void highlightInput(QDoubleSpinBox *inp)
CctwDoubleVector3D CctwqtTransformTester::getQLab ( )
private

Definition at line 135 of file cctwqttransformtester.cpp.

References highlightInput(), m_MainWindow, and CctwqtMainWindow::ui.

Referenced by testQLab2HKL(), and testQLab2Pixel().

136 {
137  CctwDoubleVector3D val(m_MainWindow->ui->m_TestQLabX->value(),
138  m_MainWindow->ui->m_TestQLabY->value(),
139  m_MainWindow->ui->m_TestQLabZ->value());
140 
141  highlightInput(m_MainWindow->ui->m_TestQLabX);
142  highlightInput(m_MainWindow->ui->m_TestQLabY);
143  highlightInput(m_MainWindow->ui->m_TestQLabZ);
144 
145  return val;
146 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
void highlightInput(QDoubleSpinBox *inp)
double CctwqtTransformTester::getRotation ( )
private

Definition at line 78 of file cctwqttransformtester.cpp.

References highlightInput(), m_MainWindow, and CctwqtMainWindow::ui.

Referenced by testGetDetPix(), testGetDetPos(), testGrid2HKL(), testHKL2Grid(), testHKL2QLab(), testPixel2QLab(), testQLab2HKL(), and testQLab2Pixel().

79 {
80  double rot = m_MainWindow->ui->m_FrameAngle->value();
81 
82  highlightInput(m_MainWindow->ui->m_FrameAngle);
83 
84  return rot;
85 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
void highlightInput(QDoubleSpinBox *inp)
void CctwqtTransformTester::highlightInput ( QDoubleSpinBox *  inp)
private

Definition at line 68 of file cctwqttransformtester.cpp.

References setColor().

Referenced by getDet(), getGrid(), getHKL(), getPixels(), getQLab(), and getRotation().

69 {
70  setColor(box, QColor(0,160,0));
71 }
void setColor(QDoubleSpinBox *box, QColor col)
void CctwqtTransformTester::highlightOutput ( QDoubleSpinBox *  inp)
private

Definition at line 73 of file cctwqttransformtester.cpp.

References setColor().

Referenced by setDet(), setGrid(), setHKL(), setPixels(), and setQLab().

74 {
75  setColor(box, QColor(220,0,0));
76 }
void setColor(QDoubleSpinBox *box, QColor col)
void CctwqtTransformTester::parametersChanged ( )
slot

Definition at line 26 of file cctwqttransformtester.cpp.

References CctwObject::printMessage().

Referenced by CctwqtTransformTester().

27 {
28  printMessage("CctwqtTransformTester::parametersChanged");
29 }
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
Definition: cctwobject.cpp:25
void CctwqtTransformTester::setColor ( QDoubleSpinBox *  box,
QColor  col 
)
private

Definition at line 31 of file cctwqttransformtester.cpp.

Referenced by highlightInput(), highlightOutput(), and unhighlight().

32 {
33 // printMessage(tr("setColor %1 to %2").arg(box->objectName()).arg(col.hue()));
34 
35  QPalette pall = box->palette();
36 
37  pall.setColor(QPalette::Text, col);
38 
39  box->setPalette(pall);
40  box->update();
41 }
void CctwqtTransformTester::setDet ( CctwDoubleVector3D  det)
private

Definition at line 100 of file cctwqttransformtester.cpp.

References highlightOutput(), m_MainWindow, CctwqtMainWindow::ui, CctwVector3D< T >::x(), CctwVector3D< T >::y(), and CctwVector3D< T >::z().

Referenced by testGetDetPix().

101 {
102  m_MainWindow->ui->m_TestDetectorX->setValue(det.x());
103  m_MainWindow->ui->m_TestDetectorY->setValue(det.y());
104  m_MainWindow->ui->m_TestDetectorZ->setValue(det.z());
105 
106  highlightOutput(m_MainWindow->ui->m_TestDetectorX);
107  highlightOutput(m_MainWindow->ui->m_TestDetectorY);
108  highlightOutput(m_MainWindow->ui->m_TestDetectorZ);
109 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
T x() const
Definition: cctwvector3d.h:17
T z() const
Definition: cctwvector3d.h:19
void highlightOutput(QDoubleSpinBox *inp)
T y() const
Definition: cctwvector3d.h:18
void CctwqtTransformTester::setGrid ( CctwDoubleVector3D  val)
private

Definition at line 196 of file cctwqttransformtester.cpp.

References highlightOutput(), m_MainWindow, CctwqtMainWindow::ui, CctwVector3D< T >::x(), CctwVector3D< T >::y(), and CctwVector3D< T >::z().

Referenced by testHKL2Grid().

197 {
198  m_MainWindow->ui->m_TestGridX->setValue(val.x());
199  m_MainWindow->ui->m_TestGridY->setValue(val.y());
200  m_MainWindow->ui->m_TestGridZ->setValue(val.z());
201 
202  highlightOutput(m_MainWindow->ui->m_TestGridX);
203  highlightOutput(m_MainWindow->ui->m_TestGridY);
204  highlightOutput(m_MainWindow->ui->m_TestGridZ);
205 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
T x() const
Definition: cctwvector3d.h:17
T z() const
Definition: cctwvector3d.h:19
void highlightOutput(QDoubleSpinBox *inp)
T y() const
Definition: cctwvector3d.h:18
void CctwqtTransformTester::setHKL ( CctwDoubleVector3D  val)
private

Definition at line 172 of file cctwqttransformtester.cpp.

References highlightOutput(), m_MainWindow, CctwqtMainWindow::ui, CctwVector3D< T >::x(), CctwVector3D< T >::y(), and CctwVector3D< T >::z().

Referenced by testGrid2HKL(), and testQLab2HKL().

173 {
174  m_MainWindow->ui->m_TestHKLX->setValue(val.x());
175  m_MainWindow->ui->m_TestHKLY->setValue(val.y());
176  m_MainWindow->ui->m_TestHKLZ->setValue(val.z());
177 
178  highlightOutput(m_MainWindow->ui->m_TestHKLX);
179  highlightOutput(m_MainWindow->ui->m_TestHKLY);
180  highlightOutput(m_MainWindow->ui->m_TestHKLZ);
181 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
T x() const
Definition: cctwvector3d.h:17
T z() const
Definition: cctwvector3d.h:19
void highlightOutput(QDoubleSpinBox *inp)
T y() const
Definition: cctwvector3d.h:18
void CctwqtTransformTester::setPixels ( CctwDoubleVector3D  val)
private

Definition at line 124 of file cctwqttransformtester.cpp.

References highlightOutput(), m_MainWindow, CctwqtMainWindow::ui, CctwVector3D< T >::x(), CctwVector3D< T >::y(), and CctwVector3D< T >::z().

Referenced by testGetDetPos(), and testQLab2Pixel().

125 {
126  m_MainWindow->ui->m_TestPixelX->setValue(val.x());
127  m_MainWindow->ui->m_TestPixelY->setValue(val.y());
128  m_MainWindow->ui->m_TestPixelZ->setValue(val.z());
129 
130  highlightOutput(m_MainWindow->ui->m_TestPixelX);
131  highlightOutput(m_MainWindow->ui->m_TestPixelY);
132  highlightOutput(m_MainWindow->ui->m_TestPixelZ);
133 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
T x() const
Definition: cctwvector3d.h:17
T z() const
Definition: cctwvector3d.h:19
void highlightOutput(QDoubleSpinBox *inp)
T y() const
Definition: cctwvector3d.h:18
void CctwqtTransformTester::setQLab ( CctwDoubleVector3D  val)
private

Definition at line 148 of file cctwqttransformtester.cpp.

References highlightOutput(), m_MainWindow, CctwqtMainWindow::ui, CctwVector3D< T >::x(), CctwVector3D< T >::y(), and CctwVector3D< T >::z().

Referenced by testHKL2QLab(), and testPixel2QLab().

149 {
150  m_MainWindow->ui->m_TestQLabX->setValue(val.x());
151  m_MainWindow->ui->m_TestQLabY->setValue(val.y());
152  m_MainWindow->ui->m_TestQLabZ->setValue(val.z());
153 
154  highlightOutput(m_MainWindow->ui->m_TestQLabX);
155  highlightOutput(m_MainWindow->ui->m_TestQLabY);
156  highlightOutput(m_MainWindow->ui->m_TestQLabZ);
157 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
T x() const
Definition: cctwvector3d.h:17
T z() const
Definition: cctwvector3d.h:19
void highlightOutput(QDoubleSpinBox *inp)
T y() const
Definition: cctwvector3d.h:18
void CctwqtTransformTester::testGetDetPix ( )
slot
void CctwqtTransformTester::testGetDetPos ( )
slot
void CctwqtTransformTester::testGrid2HKL ( )
slot
void CctwqtTransformTester::testHKL2Grid ( )
slot
void CctwqtTransformTester::testHKL2QLab ( )
slot
void CctwqtTransformTester::testPixel2QLab ( )
slot
void CctwqtTransformTester::testQLab2HKL ( )
slot
void CctwqtTransformTester::testQLab2Pixel ( )
slot
void CctwqtTransformTester::unhighlight ( )
private

Definition at line 43 of file cctwqttransformtester.cpp.

References m_MainWindow, setColor(), and CctwqtMainWindow::ui.

Referenced by testGetDetPix(), testGetDetPos(), testGrid2HKL(), testHKL2Grid(), testHKL2QLab(), testPixel2QLab(), testQLab2HKL(), and testQLab2Pixel().

44 {
45  setColor(m_MainWindow->ui->m_FrameAngle, Qt::black);
46 
47  setColor(m_MainWindow->ui->m_TestDetectorX, Qt::black);
48  setColor(m_MainWindow->ui->m_TestDetectorY, Qt::black);
49  setColor(m_MainWindow->ui->m_TestDetectorZ, Qt::black);
50 
51  setColor(m_MainWindow->ui->m_TestPixelX, Qt::black);
52  setColor(m_MainWindow->ui->m_TestPixelY, Qt::black);
53  setColor(m_MainWindow->ui->m_TestPixelZ, Qt::black);
54 
55  setColor(m_MainWindow->ui->m_TestQLabX, Qt::black);
56  setColor(m_MainWindow->ui->m_TestQLabY, Qt::black);
57  setColor(m_MainWindow->ui->m_TestQLabZ, Qt::black);
58 
59  setColor(m_MainWindow->ui->m_TestHKLX, Qt::black);
60  setColor(m_MainWindow->ui->m_TestHKLY, Qt::black);
61  setColor(m_MainWindow->ui->m_TestHKLZ, Qt::black);
62 
63  setColor(m_MainWindow->ui->m_TestGridX, Qt::black);
64  setColor(m_MainWindow->ui->m_TestGridY, Qt::black);
65  setColor(m_MainWindow->ui->m_TestGridZ, Qt::black);
66 }
CctwqtMainWindow * m_MainWindow
Ui::CctwqtMainWindow * ui
void setColor(QDoubleSpinBox *box, QColor col)

Member Data Documentation

CctwqtMainWindow* CctwqtTransformTester::m_MainWindow
private
CctwCrystalCoordinateParameters* CctwqtTransformTester::m_Parameters
private

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