37 #include <QVBoxLayout>
38 #include "boost/bind.hpp"
66 mUsReconstructionService(usReconstructionService)
68 this->setObjectName(
"USAcqusitionWidget");
69 this->setWindowTitle(
"US Acquisition");
86 QHBoxLayout* timerLayout =
new QHBoxLayout;
87 mLayout->addLayout(timerLayout);
90 timerLayout->addStretch();
91 timerLayout->addWidget(mDisplayTimerWidget);
92 timerLayout->addStretch();
94 QGridLayout* editsLayout =
new QGridLayout;
95 editsLayout->setColumnStretch(0,0);
96 editsLayout->setColumnStretch(1,1);
102 QIcon(
":/icons/open_icon_library/system-run-5.png"),
103 "Details",
"Show Details",
104 SLOT(toggleDetailsSlot()),
107 QToolButton* optionsButton =
new QToolButton();
108 optionsButton->setDefaultAction(optionsAction);
109 editsLayout->addWidget(optionsButton, 0, 2);
111 mOptionsWidget = this->createOptionsWidget();
112 mOptionsWidget->setVisible(
settings()->value(
"acquisition/UsAcqShowDetails").toBool());
115 mLayout->addWidget(mOptionsWidget);
118 mLayout->addWidget(mTimedAlgorithmProgressBar);
128 "<h3>US Acquisition.</h3>"
129 "<p><i>Record and reconstruct US data.</i></br>"
134 void USAcqusitionWidget::toggleDetailsSlot()
136 mOptionsWidget->setVisible(!mOptionsWidget->isVisible());
137 settings()->
setValue(
"acquisition/UsAcqShowDetails", mOptionsWidget->isVisible());
140 QWidget* USAcqusitionWidget::createOptionsWidget()
142 QWidget* retval =
new QWidget(
this);
143 QGridLayout* layout =
new QGridLayout(retval);
144 layout->setMargin(0);
146 SoundSpeedConverterWidget* soundSpeedWidget =
new SoundSpeedConverterWidget(mServices->getToolManager(),
this);
148 ProbeConfigWidget* probeWidget =
new ProbeConfigWidget(mServices,
this);
149 probeWidget->getActiveProbeConfigWidget()->setVisible(
false);
155 layout->addWidget(this->wrapGroupBox(probeWidget,
"Probe",
"Probe Definition"), line++, 0);
156 layout->addWidget(this->wrapGroupBox(soundSpeedWidget,
"Sound Speed",
"Sound Speed"), line++, 0);
157 layout->addWidget(temporalCalibrationWidget, line++, 0);
162 QWidget* USAcqusitionWidget::wrapGroupBox(QWidget* input, QString name, QString tip)
164 QGroupBox* retval =
new QGroupBox(name);
165 retval->setToolTip(tip);
166 QVBoxLayout* layout =
new QVBoxLayout(retval);
167 layout->addWidget(input);
168 layout->addStretch();
169 layout->setMargin(layout->margin()/2);
173 QWidget* USAcqusitionWidget::wrapVerticalStretch(QWidget* input)
175 QWidget* retval =
new QWidget(
this);
176 QVBoxLayout* layout =
new QVBoxLayout(retval);
177 layout->addWidget(input);
178 layout->addStretch();
179 layout->setMargin(0);
180 layout->setSpacing(0);
184 void USAcqusitionWidget::acquisitionDataReadySlot()
186 if (
settings()->value(
"Automation/autoReconstruct").toBool())
188 mUsReconstructionService->startReconstruction();
192 void USAcqusitionWidget::acquisitionStateChangedSlot()
207 void USAcqusitionWidget::recordStarted()
209 mDisplayTimerWidget->
start();
211 void USAcqusitionWidget::recordStopped()
213 mDisplayTimerWidget->
stop();
215 void USAcqusitionWidget::recordCancelled()
217 mDisplayTimerWidget->
stop();
220 void USAcqusitionWidget::reconstructAboutToStartSlot()
222 std::set<cx::TimedAlgorithmPtr> threads = mUsReconstructionService->getThreadedReconstruction();
223 mTimedAlgorithmProgressBar->
attach(threads);
226 void USAcqusitionWidget::reconstructStartedSlot()
231 void USAcqusitionWidget::reconstructFinishedSlot()
233 std::set<cx::TimedAlgorithmPtr> threads = mUsReconstructionService->getThreadedReconstruction();
234 mTimedAlgorithmProgressBar->
detach(threads);
boost::shared_ptr< class UsReconstructionService > UsReconstructionServicePtr
void acquisitionStopped()
boost::shared_ptr< class AcquisitionService > AcquisitionServicePtr
boost::shared_ptr< class VisServices > VisServicesPtr
void reconstructFinished()
void saveDataCompleted(QString mhdFilename)
emitted when data has been saved to file
static DoublePropertyBasePtr New(TrackingServicePtr trackingService)
static StringPropertyActiveProbeConfigurationPtr New(TrackingServicePtr trackingService)
Show progress for a TimedBaseAlgorithm.
void detach(TimedAlgorithmPtr algorithm)
void setValue(const QString &key, const QVariant &value)
void reconstructStarted()
Settings * settings()
Shortcut for accessing the settings instance.
void attach(TimedAlgorithmPtr algorithm)
cxLogicManager_EXPORT AcquisitionServicePtr acquisitionService()
void reconstructAboutToStart()
virtual void newDataOnDisk(QString mhdFilename)=0
void acquisitionDataReady()
emitted when data is acquired and sent to the reconstruction module