35 #include <QPushButton>
38 #include <QVBoxLayout>
50 BaseWidget(parent,
"RecordSessionWidget",
"Record Session"),
51 mAcquisitionService(base),
52 mInfoLabel(new QLabel(
"")),
53 mStartStopButton(new QPushButton(QIcon(
":/icons/open_icon_library/media-record-3.png"),
"Start")),
54 mCancelButton(new QPushButton(QIcon(
":/icons/open_icon_library/process-stop-7.png"),
"Cancel")),
55 mDescriptionLine(new QLineEdit(defaultDescription)),
56 mRequireUsReady(requireUsReady)
58 QVBoxLayout* layout =
new QVBoxLayout(
this);
60 mDescriptionLabel =
new QLabel(
"Description:");
61 layout->addWidget(mInfoLabel);
62 layout->addWidget(mDescriptionLabel);
63 layout->addWidget(mDescriptionLine);
65 QHBoxLayout* buttonLayout =
new QHBoxLayout();
67 int buttonheight = mStartStopButton->sizeHint().height()*2.5;
68 mStartStopButton->setMinimumHeight(buttonheight);
69 mCancelButton->setMinimumHeight(buttonheight);
71 buttonLayout->addWidget(mStartStopButton);
72 buttonLayout->addWidget(mCancelButton);
73 layout->addLayout(buttonLayout);
77 mStartStopButton->setCheckable(
true);
78 connect(mStartStopButton, &QPushButton::clicked,
this, &RecordSessionWidget::startStopSlot);
79 connect(mCancelButton, &QPushButton::clicked,
this, &RecordSessionWidget::cancelSlot);
81 this->recordStateChangedSlot();
86 this->usReadinessChangedSlot();
92 this->setEnabled(val);
93 mInfoLabel->setText(text);
98 mDescriptionLine->setVisible(value);
99 mDescriptionLabel->setVisible(value);
107 mDescriptionLine->setText(text);
110 void RecordSessionWidget::usReadinessChangedSlot()
112 this->setEnabled(mAcquisitionService->isReady());
113 mInfoLabel->setText(mAcquisitionService->getInfoText());
116 void RecordSessionWidget::recordStateChangedSlot()
120 mStartStopButton->blockSignals(
true);
125 mStartStopButton->setChecked(
true);
126 mStartStopButton->setText(
"Stop");
127 mStartStopButton->setIcon(QIcon(
":/icons/open_icon_library/media-playback-stop.png"));
128 mStartStopButton->setEnabled(
true);
129 mCancelButton->setEnabled(
true);
132 mStartStopButton->setChecked(
false);
133 mStartStopButton->setText(
"Start");
134 mStartStopButton->setIcon(QIcon(
":/icons/open_icon_library/media-record-3.png"));
135 mStartStopButton->setEnabled(
true);
136 mCancelButton->setEnabled(
false);
139 mStartStopButton->setChecked(
false);
140 mStartStopButton->setText(
"Processing...");
141 mStartStopButton->setIcon(QIcon(
":/icons/open_icon_library/media-record-3.png"));
142 mStartStopButton->setEnabled(
false);
143 mCancelButton->setEnabled(
false);
147 mStartStopButton->blockSignals(
false);
150 void RecordSessionWidget::startStopSlot(
bool checked)
152 mAcquisitionService->toggleRecord();
155 void RecordSessionWidget::cancelSlot()
157 mAcquisitionService->cancelRecord();
boost::shared_ptr< class AcquisitionService > AcquisitionServicePtr
void usReadinessChanged()