qmca  0.0.20
qmcacontrolpanel.cpp
Go to the documentation of this file.
1 #include "qmcacontrolpanel.h"
2 
3 #include "mcacontroller.h"
4 #include "mcacontrolpanel.h"
9 #include "bm12controlpanel.h"
10 
11 #include <QGridLayout>
12 
13 QMCAControlPanel::QMCAControlPanel(QWidget *parent, Qt::WindowFlags f)
14  : QToolBox(parent,f)
15 {
16 }
17 
18 void QMCAControlPanel::newSection(QString title, QWidget *panel)
19 {
20  QWidget *page = new QWidget();
21  QGridLayout *layout = new QGridLayout(page);
22  QSpacerItem *spacer = new QSpacerItem(20,40, QSizePolicy::Minimum, QSizePolicy::Expanding);
23 
24  layout -> addItem(spacer, 1,0,1,1);
25 
26  panel -> setParent(page);
27  layout -> addWidget(panel, 0,0,1,1);
28 
29  addItem(page, title);
30 }
31 
33 {
34  MCAControlPanel *p = new MCAControlPanel(ctrl, NULL);
35 
36  newSection("MCA", p);
37 
38  return p;
39 }
40 
42 {
44 
45  newSection("A-D Converter", p);
46 
47  return p;
48 }
49 
51 {
53 
54  newSection("Amplifier", p);
55 
56  return p;
57 }
58 
60 {
62 
63  newSection("TCA", p);
64 
65  return p;
66 }
67 
69 {
71 
72  newSection("Power Supply", p);
73 
74  return p;
75 }
76 
78 {
79  BM12ControlPanel *p = new BM12ControlPanel(ctrl, ctrl->graph(), NULL);
80 
81  newSection("BM12", p);
82 
83  return p;
84 }
85 
PowerSupplyControlPanel * newPowerSupplyControlPanel(MCAController *ctrl)
void newSection(QString title, QWidget *panel)
QMCAControlPanel(QWidget *parent=0, Qt::WindowFlags f=0)
AmplifierControlPanel * newAmplifierControlPanel(MCAController *ctrl)
BM12ControlPanel * newBM12ControlPanel(MCAController *ctrl)
MCAControlPanel * newMCAControlPanel(MCAController *ctrl)
PulseAnalyserControlPanel * newPulseAnalyserControlPanel(MCAController *ctrl)
QwtPlot * graph()
A2DConverterControlPanel * newA2DConverterControlPanel(MCAController *ctrl)