fix:
相机参数有效性控制3
This commit is contained in:
@ -5,20 +5,25 @@ HyperImagerControl::HyperImagerControl(QWidget* parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
connect(ui.framerate_lineEdit, &QLineEdit::editingFinished, this, &HyperImagerControl::onFramerateLineEditEditingFinished);
|
||||
connect(ui.FramerateSlider, &QSlider::valueChanged, this, &HyperImagerControl::onFramerateSliderChanged);
|
||||
connect(ui.FramerateSlider, &QSlider::sliderReleased, this, &HyperImagerControl::onFramerateSliderReleased);
|
||||
connect(ui.framerate_spinBox, &QDoubleSpinBox::editingFinished, this, &HyperImagerControl::onFramerateSpinBoxEditingFinished);
|
||||
connect(ui.FramerateSlider, &QDoubleSlider::valueChanged, this, &HyperImagerControl::onFramerateSliderChanged);
|
||||
connect(ui.FramerateSlider, &QDoubleSlider::sliderReleased, this, &HyperImagerControl::onFramerateSliderReleased);
|
||||
|
||||
connect(ui.integratioin_time_lineEdit, &QLineEdit::editingFinished, this, &HyperImagerControl::onIntegrationTimeLineEditEditingFinished);
|
||||
connect(ui.IntegratioinTimeSlider, &QSlider::valueChanged, this, &HyperImagerControl::onIntegrationTimeSliderChanged);
|
||||
connect(ui.IntegratioinTimeSlider, &QSlider::sliderReleased, this, &HyperImagerControl::onIntegrationTimeSliderReleased);
|
||||
connect(ui.integratioin_time_spinBox, &QDoubleSpinBox::editingFinished, this, &HyperImagerControl::onIntegrationTimeSpinBoxEditingFinished);
|
||||
connect(ui.IntegratioinTimeSlider, &QDoubleSlider::valueChanged, this, &HyperImagerControl::onIntegrationTimeSliderChanged);
|
||||
connect(ui.IntegratioinTimeSlider, &QDoubleSlider::sliderReleased, this, &HyperImagerControl::onIntegrationTimeSliderReleased);
|
||||
|
||||
connect(ui.gain_lineEdit, &QLineEdit::editingFinished, this, &HyperImagerControl::onGainLineEditEditingFinished);
|
||||
connect(ui.gain_spinBox, &QDoubleSpinBox::editingFinished, this, &HyperImagerControl::onGainSpinBoxEditingFinished);
|
||||
connect(ui.GainSlider, &QSlider::valueChanged, this, &HyperImagerControl::onGainSliderChanged);
|
||||
connect(ui.GainSlider, &QSlider::sliderReleased, this, &HyperImagerControl::onGainSliderReleased);
|
||||
|
||||
ui.framerate_spinBox->setMinimum(1);
|
||||
ui.framerate_spinBox->setMaximum(250);
|
||||
ui.FramerateSlider->setMinimum(1);
|
||||
ui.FramerateSlider->setMaximum(250);
|
||||
|
||||
ui.gain_spinBox->setMinimum(0);
|
||||
ui.gain_spinBox->setMaximum(12);
|
||||
ui.GainSlider->setMinimum(0);
|
||||
ui.GainSlider->setMaximum(12);
|
||||
}
|
||||
@ -29,83 +34,108 @@ HyperImagerControl::~HyperImagerControl()
|
||||
|
||||
void HyperImagerControl::setFrameRate(double frameRate)
|
||||
{
|
||||
ui.framerate_lineEdit->setText(QString::number(frameRate, 10, 2));
|
||||
ui.FramerateSlider->setValue(frameRate, false);
|
||||
ui.framerate_spinBox->setValue(frameRate);
|
||||
ui.FramerateSlider->setValue(frameRate);
|
||||
|
||||
//CalculateIntegratioinTimeRange(frameRate);
|
||||
updateIntegrationTimeRange(frameRate);
|
||||
}
|
||||
|
||||
void HyperImagerControl::setIntegrationTime(double integrationTime)
|
||||
{
|
||||
ui.integratioin_time_lineEdit->setText(QString::number(integrationTime, 10, 2));
|
||||
ui.integratioin_time_spinBox->setValue(integrationTime);
|
||||
ui.IntegratioinTimeSlider->setValue(integrationTime);
|
||||
|
||||
updateFramerateRange(integrationTime);
|
||||
}
|
||||
|
||||
void HyperImagerControl::setGain(double gain)
|
||||
{
|
||||
ui.gain_lineEdit->setText(QString::number(gain, 10, 2));
|
||||
ui.gain_spinBox->setValue(gain);
|
||||
ui.GainSlider->setValue(gain);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onFramerateLineEditEditingFinished()
|
||||
void HyperImagerControl::onFramerateSpinBoxEditingFinished()
|
||||
{
|
||||
double value = ui.framerate_lineEdit->text().toDouble();
|
||||
ui.FramerateSlider->setValue(value);
|
||||
emit framerateChanged(value);
|
||||
double framerate = ui.framerate_spinBox->value();
|
||||
ui.FramerateSlider->setValue(framerate);
|
||||
emit framerateChanged(framerate);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onFramerateSliderChanged(double framerate)
|
||||
{
|
||||
ui.framerate_lineEdit->setText(QString::number(framerate));
|
||||
ui.framerate_spinBox->blockSignals(true);
|
||||
ui.framerate_spinBox->setValue(framerate);
|
||||
ui.framerate_spinBox->blockSignals(false);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onFramerateSliderReleased()
|
||||
{
|
||||
double framerate = ui.framerate_lineEdit->text().toDouble();
|
||||
double framerate = ui.framerate_spinBox->value();//<2F><><EFBFBD>ᴥ<EFBFBD><E1B4A5>QDoubleSpinBox::editingFinished<65>źţ<C5BA><C5A3>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD>onFramerateSpinBoxEditingFinished<65>ۺ<EFBFBD><DBBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>շ<EFBFBD><D5B7><EFBFBD>framerateChanged<65>źš<C5BA>
|
||||
emit framerateChanged(framerate);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onIntegrationTimeLineEditEditingFinished()
|
||||
void HyperImagerControl::onIntegrationTimeSpinBoxEditingFinished()
|
||||
{
|
||||
double value = ui.integratioin_time_lineEdit->text().toDouble();
|
||||
ui.IntegratioinTimeSlider->setValue(value);
|
||||
emit integrationTimeChanged(value);
|
||||
double integrationTime = ui.integratioin_time_spinBox->value();
|
||||
ui.IntegratioinTimeSlider->setValue(integrationTime);
|
||||
emit integrationTimeChanged(integrationTime);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onIntegrationTimeSliderChanged(double integrationTime)
|
||||
{
|
||||
ui.integratioin_time_lineEdit->setText(QString::number(integrationTime));
|
||||
ui.integratioin_time_spinBox->blockSignals(true);
|
||||
ui.integratioin_time_spinBox->setValue(integrationTime);
|
||||
ui.integratioin_time_spinBox->blockSignals(false);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onIntegrationTimeSliderReleased()
|
||||
{
|
||||
double integrationTime = ui.integratioin_time_lineEdit->text().toDouble();
|
||||
double integrationTime = ui.integratioin_time_spinBox->value();
|
||||
emit integrationTimeChanged(integrationTime);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onGainLineEditEditingFinished()
|
||||
void HyperImagerControl::onGainSpinBoxEditingFinished()
|
||||
{
|
||||
double value = ui.gain_lineEdit->text().toDouble();
|
||||
ui.GainSlider->setValue(value);
|
||||
emit gainChanged(value);
|
||||
double gain = ui.gain_spinBox->value();
|
||||
ui.GainSlider->setValue(gain);
|
||||
emit gainChanged(gain);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onGainSliderChanged(double gain)
|
||||
{
|
||||
ui.gain_lineEdit->setText(QString::number(gain));
|
||||
ui.gain_spinBox->blockSignals(true);
|
||||
ui.gain_spinBox->setValue(gain);
|
||||
ui.gain_spinBox->blockSignals(false);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onGainSliderReleased()
|
||||
{
|
||||
double gain = ui.gain_lineEdit->text().toDouble();
|
||||
double gain = ui.gain_spinBox->value();
|
||||
emit gainChanged(gain);
|
||||
}
|
||||
|
||||
void HyperImagerControl::CalculateIntegratioinTimeRange(double frameRate)
|
||||
void HyperImagerControl::updateIntegrationTimeRange(double frameRate)
|
||||
{
|
||||
double range = 1 / frameRate * 1000;//<2F><><EFBFBD><EFBFBD>
|
||||
double maxIntegrationTime = 1.0 / frameRate * 1000.0; // <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ui.IntegratioinTimeSlider->blockSignals(true);//<2F><>ΪsetMaximum<75>ᴥ<EFBFBD><E1B4A5>valueChanged<65>źţ<C5BA><C5A3><EFBFBD><EFBFBD>Ե<EFBFBD><D4B5><EFBFBD>setMaximumǰ<6D><C7B0>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD>
|
||||
ui.IntegratioinTimeSlider->setMaximum(range);
|
||||
ui.IntegratioinTimeSlider->blockSignals(true);
|
||||
ui.IntegratioinTimeSlider->setMaximum(maxIntegrationTime);
|
||||
ui.IntegratioinTimeSlider->blockSignals(false);
|
||||
|
||||
ui.integratioin_time_spinBox->blockSignals(true);
|
||||
ui.integratioin_time_spinBox->setMaximum(maxIntegrationTime);
|
||||
ui.integratioin_time_spinBox->blockSignals(false);
|
||||
}
|
||||
|
||||
void HyperImagerControl::updateFramerateRange(double integrationTime)
|
||||
{
|
||||
double maxFramerate = 1.0 / (integrationTime / 1000.0); // <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>(<28><><EFBFBD><EFBFBD>)ת֡<D7AA><D6A1>
|
||||
|
||||
ui.FramerateSlider->blockSignals(true);
|
||||
ui.FramerateSlider->setMaximum(maxFramerate);
|
||||
ui.FramerateSlider->blockSignals(false);
|
||||
|
||||
ui.framerate_spinBox->blockSignals(true);
|
||||
ui.framerate_spinBox->setMaximum(maxFramerate);
|
||||
ui.framerate_spinBox->blockSignals(false);
|
||||
}
|
||||
|
||||
@ -22,26 +22,25 @@ public:
|
||||
void setIntegrationTime(double integrationTime);
|
||||
void setGain(double gain);
|
||||
|
||||
void CalculateIntegratioinTimeRange(double frameRate);
|
||||
|
||||
signals:
|
||||
void framerateChanged(double framerate);
|
||||
void integrationTimeChanged(double integrationTime);
|
||||
void gainChanged(double gain);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onFramerateLineEditEditingFinished();
|
||||
void onFramerateSpinBoxEditingFinished();
|
||||
void onFramerateSliderChanged(double framerate);
|
||||
void onFramerateSliderReleased();
|
||||
|
||||
void onIntegrationTimeLineEditEditingFinished();
|
||||
void onIntegrationTimeSpinBoxEditingFinished();
|
||||
void onIntegrationTimeSliderChanged(double integrationTime);
|
||||
void onIntegrationTimeSliderReleased();
|
||||
|
||||
void onGainLineEditEditingFinished();
|
||||
void onGainSpinBoxEditingFinished();
|
||||
void onGainSliderChanged(double gain);
|
||||
void onGainSliderReleased();
|
||||
|
||||
private:
|
||||
void updateIntegrationTimeRange(double frameRate);
|
||||
void updateFramerateRange(double integrationTime);
|
||||
|
||||
Ui::HyperImagerControl ui;
|
||||
};
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#include "qDoubleSlider.h"
|
||||
QDoubleSlider::QDoubleSlider(QWidget* pParent /*= NULL*/) :
|
||||
QSlider(pParent),
|
||||
m_Multiplier(1.0)
|
||||
m_Multiplier(100.0)
|
||||
{
|
||||
connect(this, SIGNAL(valueChanged(int)), this, SLOT(notifyValueChanged(int)));
|
||||
|
||||
|
||||
@ -23,8 +23,8 @@ public:
|
||||
private slots:
|
||||
|
||||
signals :
|
||||
void valueChanged(double Value);
|
||||
void rangeChanged(double Min, double Max);
|
||||
void valueChanged(double Value);//QSlider<65><72>valueChanged<65>źŵIJ<C5B5><C4B2><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
||||
void rangeChanged(double Min, double Max);//QSlider<65><72>rangeChanged<65>źŵIJ<C5B5><C4B2><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
||||
|
||||
private:
|
||||
double m_Multiplier;
|
||||
|
||||
@ -186,15 +186,15 @@ QSlider::handle:horizontal:pressed {
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="framerate_lineEdit">
|
||||
<widget class="QDoubleSpinBox" name="framerate_spinBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -241,15 +241,15 @@ QSlider::handle:horizontal:pressed {
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="integratioin_time_lineEdit">
|
||||
<widget class="QDoubleSpinBox" name="integratioin_time_spinBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -302,20 +302,20 @@ QSlider::handle:horizontal:pressed {
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="gain_lineEdit">
|
||||
<widget class="QDoubleSpinBox" name="gain_spinBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSlider" name="GainSlider">
|
||||
<widget class="QSlider" name="GainSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@ -335,16 +335,16 @@ QSlider::handle:horizontal:pressed {
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QDoubleSlider</class>
|
||||
<extends>QSlider</extends>
|
||||
<header>qdoubleslider.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>AspectRatioLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>AspectRatioLabel.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QDoubleSlider</class>
|
||||
<extends>QSlider</extends>
|
||||
<header location="global">qdoubleslider.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
Reference in New Issue
Block a user