qmca  0.0.20
Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
BM12ControlPanel Class Reference

#include <bm12controlpanel.h>

Inheritance diagram for BM12ControlPanel:
Inheritance graph

Public Slots

void previousChannel ()
 
void nextChannel ()
 
void countTotal ()
 
void clearTotal ()
 
void countSCA1 ()
 
void countSCA2 ()
 
void countSCA3 ()
 
void save1 ()
 
void save2 ()
 
void save3 ()
 
void clear1 ()
 
void clear2 ()
 
void clear3 ()
 
void saveData ()
 
void saveEnergyWindows ()
 
void loadEnergyWindows ()
 

Public Member Functions

 BM12ControlPanel (MCAController *ctrl, QwtPlot *graph, QWidget *parent)
 
virtual ~BM12ControlPanel ()
 

Private Member Functions

int channel ()
 
void setChannel (int chan)
 
void selectSCA (int ch, int win)
 
void countMCA (int ch, int win)
 

Private Attributes

QGridLayout * m_GridLayout
 
BM12Controller m_Controller
 
QStackedWidget * m_Channels
 
QwtPlot * m_Graph
 

Detailed Description

Definition at line 14 of file bm12controlpanel.h.

Constructor & Destructor Documentation

BM12ControlPanel::BM12ControlPanel ( MCAController ctrl,
QwtPlot *  graph,
QWidget *  parent 
)

Definition at line 12 of file bm12controlpanel.cpp.

References channel(), clear1(), clear2(), clear3(), clearTotal(), countSCA1(), countSCA2(), countSCA3(), countTotal(), EpicsMCA::elapsedLiveTime(), EpicsMCA::elapsedRealTime(), EpicsPowerSupply::enabled(), EpicsPulseAnalyser::lowerLevel(), m_Channels, m_Controller, m_GridLayout, BM12Controller::mca(), nextChannel(), BM12Controller::powerSupply(), EpicsMCA::presetLiveTime(), EpicsMCA::presetRealTime(), previousChannel(), BM12Controller::pulseAnalyser(), save1(), save2(), save3(), and EpicsPulseAnalyser::upperLevel().

13  : QFrame(parent),
14  m_GridLayout(NULL),
15  m_Controller(ctrl,graph,NULL),
16  m_Channels(NULL),
17  m_Graph(graph)
18 {
19  QFont f;
20  f.setPointSize(8);
21  setFont(f);
22  setContentsMargins(2,2,2,2);
23 
24  m_GridLayout = new QGridLayout(this);
25  m_GridLayout -> setHorizontalSpacing(2);
26  m_GridLayout -> setVerticalSpacing(2);
27  m_GridLayout -> setColumnStretch(0,1);
28  m_GridLayout -> setColumnStretch(1,1);
29 
30  m_GridLayout -> addWidget(new QLabel("Real:"), 0,0,1,1);
31  m_GridLayout -> addWidget(new QLabel("Live:"), 1,0,1,1);
32 
33  EpicsMCA* mca = m_Controller.mca();
34 
35  m_GridLayout -> addWidget(new EpicsDoubleLineEdit(mca->presetRealTime()), 0,1,1,1);
36  m_GridLayout -> addWidget(new EpicsDoubleLineEdit(mca->presetLiveTime()), 1,1,1,1);
37 
38 
39  m_GridLayout -> addWidget(new EpicsDoubleDisplay(mca->elapsedRealTime()), 2,0,1,1);
40  m_GridLayout -> addWidget(new EpicsDoubleDisplay(mca->elapsedLiveTime()), 2,1,1,1);
41 
42  QPushButton *clear = new QPushButton("Clear");
43  connect(clear, SIGNAL(clicked()), this, SLOT(clearTotal()));
44 
45  QPushButton *count = new QPushButton("Count");
46  connect(count, SIGNAL(clicked()), this, SLOT(countTotal()));
47 
48  QPushButton *clra = new QPushButton("Clear A");
49  connect(clra, SIGNAL(clicked()), this, SLOT(clear1()));
50 
51  QPushButton *savea = new QPushButton("Save A");
52  connect(savea, SIGNAL(clicked()), this, SLOT(save1()));
53 
54  QPushButton *clrb = new QPushButton("Clear B");
55  connect(clrb, SIGNAL(clicked()), this, SLOT(clear2()));
56 
57  QPushButton *saveb = new QPushButton("Save B");
58  connect(saveb, SIGNAL(clicked()), this, SLOT(save2()));
59 
60  QPushButton *clrc = new QPushButton("Clear C");
61  connect(clrc, SIGNAL(clicked()), this, SLOT(clear3()));
62 
63  QPushButton *savec = new QPushButton("Save C");
64  connect(savec, SIGNAL(clicked()), this, SLOT(save3()));
65 
67 
69 
70  m_GridLayout -> addWidget(clear, 3, 0, 1,1);
71  m_GridLayout -> addWidget(count, 3, 1, 1,1);
72  m_GridLayout -> addWidget(clra, 4, 0, 1,1);
73  m_GridLayout -> addWidget(savea, 4, 1, 1,1);
74  m_GridLayout -> addWidget(clrb, 5, 0, 1,1);
75  m_GridLayout -> addWidget(saveb, 5, 1, 1,1);
76  m_GridLayout -> addWidget(clrc, 6, 0, 1,1);
77  m_GridLayout -> addWidget(savec, 6, 1, 1,1);
78 
79  m_GridLayout -> addWidget(new QLabel("HV"), 7,0,1,1);
80  m_GridLayout -> addWidget(chbx, 7,1,1,1);
81 
82  m_Channels = new QStackedWidget();
83 
84  for (int i = 0; i<13; i++) {
86 
87  QGroupBox *channel = new QGroupBox(QString("Channel %1").arg(i+1));
88 
89  QGridLayout *layout = new QGridLayout(channel);
90  layout -> setColumnStretch(0,1);
91  layout -> setColumnStretch(1,1);
92 
93  QPushButton *prev = new QPushButton("<");
94  connect(prev, SIGNAL(clicked()), this, SLOT(previousChannel()));
95  layout -> addWidget(prev, 0,0, 1,1);
96 
97  QPushButton *next = new QPushButton(">");
98  connect(next, SIGNAL(clicked()), this, SLOT(nextChannel()));
99  layout -> addWidget(next, 0,1, 1,1);
100 
101  QPalette palette1;
102  palette1.setColor(QPalette::Active, QPalette::Button, QColor(255,0,0,20));
103  palette1.setColor(QPalette::Disabled, QPalette::Button, QColor(255,0,0,20));
104  palette1.setColor(QPalette::Inactive, QPalette::Button, QColor(255,0,0,20));
105 
106  QLabel *lsca1 = new QLabel("SCA1");
107 // lsca1 -> setPalette(palette1);
108  layout -> addWidget(lsca1, 1,0,1,1);
109 
110  QPushButton *sca1 = new QPushButton("Count");
111  sca1->setPalette(palette1);
112 
113  layout -> addWidget(sca1, 1,1,1,1);
114  connect(sca1, SIGNAL(clicked()), this, SLOT(countSCA1()));
115 
116  layout -> addWidget(new QLabel("Low"), 2,0,1,1);
117  layout -> addWidget(new EpicsDoubleLineEdit(tca->lowerLevel(0)), 2,1,1,1);
118 
119  layout -> addWidget(new QLabel("High"), 3,0,1,1);
120  layout -> addWidget(new EpicsDoubleLineEdit(tca->upperLevel(0)), 3,1,1,1);
121 
122  QPalette palette2;
123  palette2.setColor(QPalette::Active, QPalette::Button, QColor(0,255,0,20));
124  palette2.setColor(QPalette::Disabled, QPalette::Button, QColor(0,255,0,20));
125  palette2.setColor(QPalette::Inactive, QPalette::Button, QColor(0,255,0,20));
126 
127  layout -> addWidget(new QLabel("SCA2"), 4,0,1,1);
128 
129  QPushButton *sca2 = new QPushButton("Count");
130  sca2->setPalette(palette2);
131  layout -> addWidget(sca2, 4,1,1,1);
132  connect(sca2, SIGNAL(clicked()), this, SLOT(countSCA2()));
133 
134  layout -> addWidget(new QLabel("Low"), 5,0,1,1);
135  layout -> addWidget(new EpicsDoubleLineEdit(tca->lowerLevel(1)), 5,1,1,1);
136 
137  layout -> addWidget(new QLabel("High"), 6,0,1,1);
138  layout -> addWidget(new EpicsDoubleLineEdit(tca->upperLevel(1)), 6,1,1,1);
139 
140  QPalette palette3;
141  palette3.setColor(QPalette::Active, QPalette::Button, QColor(0,0,255,20));
142  palette3.setColor(QPalette::Disabled, QPalette::Button, QColor(0,0,255,20));
143  palette3.setColor(QPalette::Inactive, QPalette::Button, QColor(0,0,255,20));
144 
145  layout -> addWidget(new QLabel("SCA3"), 7,0,1,1);
146 
147  QPushButton *sca3 = new QPushButton("Count");
148  sca3->setPalette(palette3);
149  layout -> addWidget(sca3, 7,1,1,1);
150  connect(sca3, SIGNAL(clicked()), this, SLOT(countSCA3()));
151 
152 
153  layout -> addWidget(new QLabel("Low"), 8,0,1,1);
154  layout -> addWidget(new EpicsDoubleLineEdit(tca->lowerLevel(2)), 8,1,1,1);
155 
156  layout -> addWidget(new QLabel("High"), 9,0,1,1);
157  layout -> addWidget(new EpicsDoubleLineEdit(tca->upperLevel(2)), 9,1,1,1);
158 
159  m_Channels -> addWidget(channel);
160  }
161 
162  QSpacerItem *spacer = new QSpacerItem(20,40, QSizePolicy::Minimum, QSizePolicy::Expanding);
163 
164  m_GridLayout -> addWidget(m_Channels, 8,0,1,2);
165  m_GridLayout -> addItem(spacer, 9,0,1,1);
166 }
EpicsDouble * presetLiveTime()
Definition: epicsmca.cpp:40
EpicsDouble * elapsedRealTime()
Definition: epicsmca.cpp:45
EpicsDouble * upperLevel(int chan)
EpicsMCA * mca()
EpicsDouble * lowerLevel(int chan)
EpicsPowerSupply * powerSupply()
EpicsDouble * presetRealTime()
Definition: epicsmca.cpp:35
QGridLayout * m_GridLayout
EpicsInteger * enabled()
EpicsPulseAnalyser * pulseAnalyser(int chan)
EpicsDouble * elapsedLiveTime()
Definition: epicsmca.cpp:50
QStackedWidget * m_Channels
BM12Controller m_Controller
BM12ControlPanel::~BM12ControlPanel ( )
virtual

Definition at line 168 of file bm12controlpanel.cpp.

169 {
170 }

Member Function Documentation

int BM12ControlPanel::channel ( )
private
void BM12ControlPanel::clear1 ( )
slot

Definition at line 247 of file bm12controlpanel.cpp.

References channel(), BM12Controller::clear(), and m_Controller.

Referenced by BM12ControlPanel().

248 {
250 }
void clear(int ch, int mem)
BM12Controller m_Controller
void BM12ControlPanel::clear2 ( )
slot

Definition at line 252 of file bm12controlpanel.cpp.

References channel(), BM12Controller::clear(), and m_Controller.

Referenced by BM12ControlPanel().

253 {
255 }
void clear(int ch, int mem)
BM12Controller m_Controller
void BM12ControlPanel::clear3 ( )
slot

Definition at line 257 of file bm12controlpanel.cpp.

References channel(), BM12Controller::clear(), and m_Controller.

Referenced by BM12ControlPanel().

258 {
260 }
void clear(int ch, int mem)
BM12Controller m_Controller
void BM12ControlPanel::clearTotal ( )
slot

Definition at line 209 of file bm12controlpanel.cpp.

References channel(), BM12Controller::clear(), and m_Controller.

Referenced by BM12ControlPanel().

210 {
212 }
void clear(int ch, int mem)
BM12Controller m_Controller
void BM12ControlPanel::countMCA ( int  ch,
int  win 
)
private

Definition at line 198 of file bm12controlpanel.cpp.

References BM12Controller::count(), and m_Controller.

Referenced by countSCA1(), countSCA2(), countSCA3(), and countTotal().

199 {
200  m_Controller.count(ch,win);
201 }
void count(int ch, int win)
BM12Controller m_Controller
void BM12ControlPanel::countSCA1 ( )
slot

Definition at line 214 of file bm12controlpanel.cpp.

References channel(), countMCA(), and selectSCA().

Referenced by BM12ControlPanel().

215 {
216  selectSCA(channel(),1);
217  countMCA(channel(),1);
218 }
void countMCA(int ch, int win)
void selectSCA(int ch, int win)
void BM12ControlPanel::countSCA2 ( )
slot

Definition at line 220 of file bm12controlpanel.cpp.

References channel(), countMCA(), and selectSCA().

Referenced by BM12ControlPanel().

221 {
222  selectSCA(channel(),2);
223  countMCA(channel(),2);
224 }
void countMCA(int ch, int win)
void selectSCA(int ch, int win)
void BM12ControlPanel::countSCA3 ( )
slot

Definition at line 226 of file bm12controlpanel.cpp.

References channel(), countMCA(), and selectSCA().

Referenced by BM12ControlPanel().

227 {
228  selectSCA(channel(),3);
229  countMCA(channel(),3);
230 }
void countMCA(int ch, int win)
void selectSCA(int ch, int win)
void BM12ControlPanel::countTotal ( )
slot

Definition at line 203 of file bm12controlpanel.cpp.

References channel(), countMCA(), and selectSCA().

Referenced by BM12ControlPanel().

204 {
205  selectSCA(channel(),0);
206  countMCA(channel(),0);
207 }
void countMCA(int ch, int win)
void selectSCA(int ch, int win)
void BM12ControlPanel::loadEnergyWindows ( )
slot

Definition at line 272 of file bm12controlpanel.cpp.

References channel(), BM12Controller::loadEnergyWindows(), and m_Controller.

273 {
275 }
BM12Controller m_Controller
void loadEnergyWindows(int ch)
void BM12ControlPanel::nextChannel ( )
slot

Definition at line 188 of file bm12controlpanel.cpp.

References channel(), and setChannel().

Referenced by BM12ControlPanel().

189 {
190  setChannel((channel()+13+1)%13);
191 }
void setChannel(int chan)
void BM12ControlPanel::previousChannel ( )
slot

Definition at line 183 of file bm12controlpanel.cpp.

References channel(), and setChannel().

Referenced by BM12ControlPanel().

184 {
185  setChannel((channel()+13-1)%13);
186 }
void setChannel(int chan)
void BM12ControlPanel::save1 ( )
slot

Definition at line 232 of file bm12controlpanel.cpp.

References channel(), m_Controller, and BM12Controller::save().

Referenced by BM12ControlPanel().

233 {
235 }
BM12Controller m_Controller
void save(int ch, int mem)
void BM12ControlPanel::save2 ( )
slot

Definition at line 237 of file bm12controlpanel.cpp.

References channel(), m_Controller, and BM12Controller::save().

Referenced by BM12ControlPanel().

238 {
240 }
BM12Controller m_Controller
void save(int ch, int mem)
void BM12ControlPanel::save3 ( )
slot

Definition at line 242 of file bm12controlpanel.cpp.

References channel(), m_Controller, and BM12Controller::save().

Referenced by BM12ControlPanel().

243 {
245 }
BM12Controller m_Controller
void save(int ch, int mem)
void BM12ControlPanel::saveData ( )
slot

Definition at line 262 of file bm12controlpanel.cpp.

References channel(), m_Controller, and BM12Controller::saveData().

263 {
265 }
void saveData(int ch)
BM12Controller m_Controller
void BM12ControlPanel::saveEnergyWindows ( )
slot

Definition at line 267 of file bm12controlpanel.cpp.

References channel(), m_Controller, and BM12Controller::saveEnergyWindows().

268 {
270 }
void saveEnergyWindows(int ch)
BM12Controller m_Controller
void BM12ControlPanel::selectSCA ( int  ch,
int  win 
)
private

Definition at line 193 of file bm12controlpanel.cpp.

References m_Controller, and BM12Controller::selectSCA().

Referenced by countSCA1(), countSCA2(), countSCA3(), and countTotal().

194 {
195  m_Controller.selectSCA(ch,win);
196 }
void selectSCA(int ch, int win)
BM12Controller m_Controller
void BM12ControlPanel::setChannel ( int  chan)
private

Definition at line 172 of file bm12controlpanel.cpp.

References m_Channels, m_Controller, and BM12Controller::selectSCA().

Referenced by nextChannel(), and previousChannel().

173 {
174  m_Channels->setCurrentIndex(chan);
175  m_Controller.selectSCA(chan,0);
176 }
QStackedWidget * m_Channels
void selectSCA(int ch, int win)
BM12Controller m_Controller

Member Data Documentation

QStackedWidget* BM12ControlPanel::m_Channels
private

Definition at line 49 of file bm12controlpanel.h.

Referenced by BM12ControlPanel(), channel(), and setChannel().

BM12Controller BM12ControlPanel::m_Controller
private
QwtPlot* BM12ControlPanel::m_Graph
private

Definition at line 50 of file bm12controlpanel.h.

QGridLayout* BM12ControlPanel::m_GridLayout
private

Definition at line 47 of file bm12controlpanel.h.

Referenced by BM12ControlPanel().


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