diff --git a/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.cpp b/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.cpp index de86ddea54..e4a7e569b4 100644 --- a/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.cpp +++ b/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.cpp @@ -1,124 +1,129 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkUSControlsBModeWidget.h" #include "ui_QmitkUSControlsBModeWidget.h" QmitkUSControlsBModeWidget::QmitkUSControlsBModeWidget(mitk::USControlInterfaceBMode::Pointer controlInterface, QWidget *parent) : QWidget(parent), ui(new Ui::QmitkUSControlsBModeWidget), m_ControlInterface(controlInterface) { ui->setupUi(this); if ( ! m_ControlInterface ) { this->setDisabled(true); /*ui->scanningDepthComboBox->setEnabled(false); ui->scanningGainSlider->setEnabled(false); ui->scanningRejectionSlider->setEnabled(false);*/ return; } if ( ! m_ControlInterface->GetIsActive() ) { m_ControlInterface->SetIsActive(true); } // get possible scanning depth values and set combo box values according to them std::vector scanningDepths = m_ControlInterface->GetScanningDepthValues(); double curDepthValue = m_ControlInterface->GetScanningDepth(); for (auto it = scanningDepths.begin(); it != scanningDepths.end(); it++) { ui->scanningDepthComboBox->addItem(QString::number(*it, 'f', 2)); // set current index to last inserted element if this element is equal // to the current depth value got from the interface if (curDepthValue == *it) ui->scanningDepthComboBox->setCurrentIndex(ui->scanningDepthComboBox->count()-1); } // get possible scanning frequency values and set combo box values according to them std::vector scanningFrequencies = m_ControlInterface->GetScanningFrequencyValues(); double curFrequencyValue = m_ControlInterface->GetScanningFrequency(); for (auto it = scanningFrequencies.begin(); it != scanningFrequencies.end(); it++) { ui->scanningFrequencyComboBox->addItem(QString::number(*it, 'f', 2) + QString(" MHz")); // set current index to last inserted element if this element is equal // to the current depth value got from the interface if (curFrequencyValue == *it) ui->scanningFrequencyComboBox->setCurrentIndex(ui->scanningFrequencyComboBox->count()-1); } - + ui->scanningPowerSlider->setMinimum(m_ControlInterface->GetScanningPowerMin()); ui->scanningPowerSlider->setMaximum(m_ControlInterface->GetScanningPowerMax()); ui->scanningPowerSlider->setTickInterval(m_ControlInterface->GetScanningPowerTick()); ui->scanningPowerSlider->setValue(m_ControlInterface->GetScanningPower()); ui->scanningGainSlider->setMinimum(m_ControlInterface->GetScanningGainMin()); ui->scanningGainSlider->setMaximum(m_ControlInterface->GetScanningGainMax()); ui->scanningGainSlider->setTickInterval(m_ControlInterface->GetScanningGainTick()); ui->scanningGainSlider->setValue(m_ControlInterface->GetScanningGain()); ui->scanningRejectionSlider->setMinimum(m_ControlInterface->GetScanningRejectionMin()); ui->scanningRejectionSlider->setMaximum(m_ControlInterface->GetScanningRejectionMax()); ui->scanningRejectionSlider->setTickInterval(m_ControlInterface->GetScanningRejectionTick()); ui->scanningRejectionSlider->setValue(m_ControlInterface->GetScanningRejection()); ui->scanningDynamicRangeSlider->setMinimum(m_ControlInterface->GetScanningDynamicRangeMin()); ui->scanningDynamicRangeSlider->setMaximum(m_ControlInterface->GetScanningDynamicRangeMax()); ui->scanningDynamicRangeSlider->setTickInterval(m_ControlInterface->GetScanningDynamicRangeTick()); ui->scanningDynamicRangeSlider->setValue(m_ControlInterface->GetScanningDynamicRange()); connect( ui->scanningFrequencyComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(OnFrequencyControlIndexChanged(int)) ); connect( ui->scanningDepthComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(OnDepthControlActivated(int)) ); connect( ui->scanningPowerSlider, SIGNAL(valueChanged(int)), this, SLOT(OnPowerControlValueChanged(int)) ); connect( ui->scanningGainSlider, SIGNAL(valueChanged(int)), this, SLOT(OnGainControlValueChanged(int)) ); connect( ui->scanningRejectionSlider, SIGNAL(valueChanged(int)), this, SLOT(OnRejectionControlValueChanged(int)) ); connect( ui->scanningDynamicRangeSlider, SIGNAL(valueChanged(int)), this, SLOT(OnDynamicRangeControlValueChanged(int)) ); } QmitkUSControlsBModeWidget::~QmitkUSControlsBModeWidget() { delete ui; } // slots void QmitkUSControlsBModeWidget::OnFrequencyControlIndexChanged(int) { QString currentText = ui->scanningFrequencyComboBox->currentText(); m_ControlInterface->SetScanningFrequency((currentText.left(currentText.size()-5)).toDouble()); } void QmitkUSControlsBModeWidget::OnDepthControlActivated(int) { m_ControlInterface->SetScanningDepth(ui->scanningDepthComboBox->currentText().toDouble()); } void QmitkUSControlsBModeWidget::OnPowerControlValueChanged(int value) { m_ControlInterface->SetScanningPower(static_cast(value)); + ui->scanningPowerLabel_value->setText(QString::number(value) +"%"); + } void QmitkUSControlsBModeWidget::OnGainControlValueChanged(int value) { m_ControlInterface->SetScanningGain(static_cast(value)); + ui->scanningGainLabel_value->setText(QString::number(value) + "%"); } void QmitkUSControlsBModeWidget::OnRejectionControlValueChanged(int value) { m_ControlInterface->SetScanningRejection(static_cast(value)); + ui->scanningRejectionLabel_value->setText(QString::number(value)); } void QmitkUSControlsBModeWidget::OnDynamicRangeControlValueChanged(int value) { m_ControlInterface->SetScanningDynamicRange(static_cast(value)); + ui->scanningDynamicRangeLabel_value->setText(QString::number(value) + "dB"); } \ No newline at end of file diff --git a/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.ui b/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.ui index 5de348c171..fdeae33882 100644 --- a/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.ui +++ b/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.ui @@ -1,593 +1,689 @@ QmitkUSControlsBModeWidget 0 0 372 394 Form - - + + Depth Control - + - :/USUI/zoom-out.png:/USUI/zoom-out.png 0 0 + :/USUI/zoom-in.png:/USUI/zoom-in.png - + Frequency Control - + - :/USUI/zoom-out.png:/USUI/zoom-out.png + :/USUI/zoom-in.png:/USUI/zoom-in.png - - - - Power Control - - + + + + + + Power Control : + + + + + + + 100 % + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - + 0 15 true Qt::Horizontal false false QSlider::NoTicks - + 16777215 10 6 0% 16777215 10 Qt::Horizontal 40 20 16777215 10 6 100% - - - - Gain Control - - + + + + + + Gain Control : + + + + + + + 100 % + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - + 0 15 Qt::Horizontal QSlider::NoTicks - + 16777215 10 6 0% 16777215 10 Qt::Horizontal 40 20 16777215 10 6 100% - - - - Dynamic Range Control - - + + + + + + Dynamic Range Control : + + + + + + + 80 dB + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - + 0 15 Qt::Horizontal QSlider::NoTicks - + 16777215 10 6 20 dB 16777215 10 Qt::Horizontal 40 20 16777215 10 6 80 dB - - - - Rejection Control - - + + + + + + Rejection Control : + + + + + + + 0 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + - + 0 15 Qt::Horizontal QSlider::NoTicks - + 16777215 10 6 0 16777215 10 Qt::Horizontal 40 20 16777215 10 6 32 - + Qt::Vertical 20 40 QmitkComboBoxStepThrough QComboBox
QmitkComboBoxStepThrough.h
SignalReachedBegin(bool) SignalReachedEnd(bool) OnSetPreviousIndex() OnSetNextIndex()
scanningDepthNext clicked() scanningDepthComboBox OnSetNextIndex() 197 36 107 35 scanningDepthPrev clicked() scanningDepthComboBox OnSetPreviousIndex() 17 36 107 35 scanningDepthComboBox SignalReachedBegin(bool) scanningDepthPrev setDisabled(bool) 107 35 17 36 scanningDepthComboBox SignalReachedEnd(bool) scanningDepthNext setDisabled(bool) 107 35 197 36 scanningFrequencyNext clicked() scanningFrequencyComboBox OnSetNextIndex() 50 39 136 39 scanningFrequencyPrev clicked() scanningFrequencyComboBox OnSetPreviousIndex() 21 39 136 39 scanningFrequencyComboBox SignalReachedBegin(bool) scanningFrequencyPrev setDisabled(bool) 136 39 21 39 scanningFrequencyComboBox SignalReachedEnd(bool) scanningFrequencyNext setDisabled(bool) 136 39 50 39