18 #include "ui_QmitkUSControlsBModeWidget.h"
22 m_ControlInterface(controlInterface)
26 if ( ! m_ControlInterface )
28 this->setDisabled(
true);
35 if ( ! m_ControlInterface->GetIsActive() ) { m_ControlInterface->SetIsActive(
true); }
38 std::vector<double> scanningDepths = m_ControlInterface->GetScanningDepthValues();
39 double curDepthValue = m_ControlInterface->GetScanningDepth();
40 for (
auto it = scanningDepths.begin(); it != scanningDepths.end(); it++)
42 ui->scanningDepthComboBox->addItem(QString::number(*it,
'f', 2));
46 if (curDepthValue == *it) ui->scanningDepthComboBox->setCurrentIndex(ui->scanningDepthComboBox->count()-1);
50 std::vector<double> scanningFrequencies = m_ControlInterface->GetScanningFrequencyValues();
51 double curFrequencyValue = m_ControlInterface->GetScanningFrequency();
52 for (
auto it = scanningFrequencies.begin(); it != scanningFrequencies.end(); it++)
54 ui->scanningFrequencyComboBox->addItem(QString::number(*it,
'f', 2) + QString(
" MHz"));
58 if (curFrequencyValue == *it) ui->scanningFrequencyComboBox->setCurrentIndex(ui->scanningFrequencyComboBox->count()-1);
61 ui->scanningPowerSlider->setMinimum(m_ControlInterface->GetScanningPowerMin());
62 ui->scanningPowerSlider->setMaximum(m_ControlInterface->GetScanningPowerMax());
63 ui->scanningPowerSlider->setTickInterval(m_ControlInterface->GetScanningPowerTick());
64 ui->scanningPowerSlider->setValue(m_ControlInterface->GetScanningPower());
66 ui->scanningGainSlider->setMinimum(m_ControlInterface->GetScanningGainMin());
67 ui->scanningGainSlider->setMaximum(m_ControlInterface->GetScanningGainMax());
68 ui->scanningGainSlider->setTickInterval(m_ControlInterface->GetScanningGainTick());
69 ui->scanningGainSlider->setValue(m_ControlInterface->GetScanningGain());
71 ui->scanningRejectionSlider->setMinimum(m_ControlInterface->GetScanningRejectionMin());
72 ui->scanningRejectionSlider->setMaximum(m_ControlInterface->GetScanningRejectionMax());
73 ui->scanningRejectionSlider->setTickInterval(m_ControlInterface->GetScanningRejectionTick());
74 ui->scanningRejectionSlider->setValue(m_ControlInterface->GetScanningRejection());
76 ui->scanningDynamicRangeSlider->setMinimum(m_ControlInterface->GetScanningDynamicRangeMin());
77 ui->scanningDynamicRangeSlider->setMaximum(m_ControlInterface->GetScanningDynamicRangeMax());
78 ui->scanningDynamicRangeSlider->setTickInterval(m_ControlInterface->GetScanningDynamicRangeTick());
79 ui->scanningDynamicRangeSlider->setValue(m_ControlInterface->GetScanningDynamicRange());
81 connect( ui->scanningFrequencyComboBox, SIGNAL(currentIndexChanged(
int)),
this, SLOT(OnFrequencyControlIndexChanged(
int)) );
82 connect( ui->scanningDepthComboBox, SIGNAL(currentIndexChanged(
int)),
this, SLOT(OnDepthControlActivated(
int)) );
83 connect( ui->scanningPowerSlider, SIGNAL(valueChanged(
int)),
this, SLOT(OnPowerControlValueChanged(
int)) );
84 connect( ui->scanningGainSlider, SIGNAL(valueChanged(
int)),
this, SLOT(OnGainControlValueChanged(
int)) );
85 connect( ui->scanningRejectionSlider, SIGNAL(valueChanged(
int)),
this, SLOT(OnRejectionControlValueChanged(
int)) );
86 connect( ui->scanningDynamicRangeSlider, SIGNAL(valueChanged(
int)),
this, SLOT(OnDynamicRangeControlValueChanged(
int)) );
95 void QmitkUSControlsBModeWidget::OnFrequencyControlIndexChanged(
int)
97 QString currentText = ui->scanningFrequencyComboBox->currentText();
98 m_ControlInterface->SetScanningFrequency((currentText.left(currentText.size()-5)).toDouble());
101 void QmitkUSControlsBModeWidget::OnDepthControlActivated(
int)
103 m_ControlInterface->SetScanningDepth(ui->scanningDepthComboBox->currentText().toDouble());
106 void QmitkUSControlsBModeWidget::OnPowerControlValueChanged(
int value)
108 m_ControlInterface->SetScanningPower(static_cast<double>(value));
111 void QmitkUSControlsBModeWidget::OnGainControlValueChanged(
int value)
113 m_ControlInterface->SetScanningGain(static_cast<double>(value));
116 void QmitkUSControlsBModeWidget::OnRejectionControlValueChanged(
int value)
118 m_ControlInterface->SetScanningRejection(static_cast<double>(value));
121 void QmitkUSControlsBModeWidget::OnDynamicRangeControlValueChanged(
int value)
123 m_ControlInterface->SetScanningDynamicRange(static_cast<double>(value));
itk::SmartPointer< Self > Pointer