|
@@ -1,5 +1,6 @@
|
|
#include "LightJoystickSwitchPage.h"
|
|
#include "LightJoystickSwitchPage.h"
|
|
#include "ui_LightJoystickSwitchPage.h"
|
|
#include "ui_LightJoystickSwitchPage.h"
|
|
|
|
+#include "../common/JMessageTip.h"
|
|
|
|
|
|
LightJoystickSwitchPage::LightJoystickSwitchPage(QWidget *parent)
|
|
LightJoystickSwitchPage::LightJoystickSwitchPage(QWidget *parent)
|
|
: QWidget(parent)
|
|
: QWidget(parent)
|
|
@@ -21,6 +22,9 @@ void LightJoystickSwitchPage::InitForm()
|
|
|
|
|
|
InitLineEdits();
|
|
InitLineEdits();
|
|
SliderBind();
|
|
SliderBind();
|
|
|
|
+
|
|
|
|
+ QDoubleValidator* validator = new QDoubleValidator(-1e12, 1e12, 6, this);
|
|
|
|
+ ui->valLineEdit->setValidator(validator);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -128,21 +132,13 @@ void LightJoystickSwitchPage::setLightWidget(int value, QWidget *lightWidget, QL
|
|
|
|
|
|
void LightJoystickSwitchPage::on_move_Button_clicked()
|
|
void LightJoystickSwitchPage::on_move_Button_clicked()
|
|
{
|
|
{
|
|
- double doNum = ui->valLineEdit->text().toDouble();
|
|
|
|
- if (doNum > 0)
|
|
|
|
- {
|
|
|
|
- m_pCameraBind->SetModuleMove(m_moveAxisInfo.ModuleType, m_moveAxisInfo.AxisType, doNum, false);
|
|
|
|
- }
|
|
|
|
|
|
+ RunMoveOrMoveTo(false);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
void LightJoystickSwitchPage::on_moveTo_Button_clicked()
|
|
void LightJoystickSwitchPage::on_moveTo_Button_clicked()
|
|
{
|
|
{
|
|
- double doNum = ui->valLineEdit->text().toDouble();
|
|
|
|
- if (doNum > 0)
|
|
|
|
- {
|
|
|
|
- m_pCameraBind->SetModuleMove(m_moveAxisInfo.ModuleType, m_moveAxisInfo.AxisType, doNum, true);
|
|
|
|
- }
|
|
|
|
|
|
+ RunMoveOrMoveTo(true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -295,6 +291,41 @@ void LightJoystickSwitchPage::MoveJoystick()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void LightJoystickSwitchPage::RunMoveOrMoveTo(bool isMoveTo)
|
|
|
|
+{
|
|
|
|
+ QString strErrInfo = {};
|
|
|
|
+ QString strNum = ui->valLineEdit->text().trimmed();
|
|
|
|
+ if (strNum.isEmpty())
|
|
|
|
+ {
|
|
|
|
+ strErrInfo = tr("","请输入值");
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ double doNum = strNum.toDouble();
|
|
|
|
+
|
|
|
|
+ if (m_moveAxisInfo.ModuleType != "")
|
|
|
|
+ {
|
|
|
|
+ if (m_moveAxisInfo.AxisType != "")
|
|
|
|
+ {
|
|
|
|
+ m_pCameraBind->SetModuleMove(m_moveAxisInfo.ModuleType, m_moveAxisInfo.AxisType, doNum, isMoveTo);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ strErrInfo = tr("AxisType is Empty", "AxisType 为空");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ strErrInfo = tr("ModuleType is Empty", "ModuleType 为空");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!strErrInfo.isEmpty())
|
|
|
|
+ {
|
|
|
|
+ JMessageTip::Message_question(strErrInfo);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
void LightJoystickSwitchPage::UpdataLightVal()
|
|
void LightJoystickSwitchPage::UpdataLightVal()
|
|
{
|
|
{
|
|
if (m_pCameraBind->m_pCViewInterface == nullptr)
|
|
if (m_pCameraBind->m_pCViewInterface == nullptr)
|