add,计划采集20,上海农科院3D植物表型:

1、新增任务类型AutoFocus:执行自动调焦过程;
This commit is contained in:
tangchao0503
2026-08-12 17:06:17 +08:00
parent 33e34aa125
commit 0866b9cd56
11 changed files with 300 additions and 128 deletions

View File

@ -232,6 +232,25 @@ void TwoMotorControl::run4_ObtainTargetDepthInfo(DepthCameraWindow* window, int
m_ObtainTargetDepthInfoCoordinator->moveToTarget(depthInfoX, depthInfoY, xmotor_move_speed, ymotor_move_speed);
}
void TwoMotorControl::run5_AutoFocus(double autoFocusX, double autoFocusY)
{
m_focusWindow = new focusWindow(this, m_Imager);
m_focusWindow->onConnectMotor();
m_focusWindow->show();
//自动调焦的协调器添加功能:先归零
m_autoFocusCoordinator = new TwoMotor1PosCoordinator(m_multiAxisController);
connect(m_autoFocusCoordinator, &TwoMotor1PosCoordinator::ArrivalSignal, m_focusWindow, &focusWindow::onAutoFocus);
connect(m_focusWindow, &focusWindow::AutoFocusFinishedSignal, m_autoFocusCoordinator, &TwoMotor1PosCoordinator::back2origin);
connect(m_focusWindow, &focusWindow::AutoFocusFinishedSignal, this, &TwoMotorControl::sequenceComplete, Qt::UniqueConnection);
connect(m_autoFocusCoordinator, &TwoMotor1PosCoordinator::back2OriginSignal, this, &TwoMotorControl::onBack2Origin4);
double xmotor_move_speed = ui.xmotor_move_speed_lineEdit->text().toDouble();
double ymotor_move_speed = ui.ymotor_move_speed_lineEdit->text().toDouble();
m_autoFocusCoordinator->moveToTarget(autoFocusX, autoFocusY, xmotor_move_speed, ymotor_move_speed);
}
void TwoMotorControl::saveDepthValue(double depthValue)
{
if (m_depthType == 0)//0表示植被深度,1表示白板/调焦版深度
@ -251,6 +270,16 @@ void TwoMotorControl::onBack2Origin3()
emit back2OriginSignal_TimedDataCollection();
}
void TwoMotorControl::onBack2Origin4()
{
m_focusWindow->deleteLater();
m_focusWindow = nullptr;
m_autoFocusCoordinator->deleteLater();
m_autoFocusCoordinator = nullptr;
emit back2OriginSignal_TimedDataCollection();
}
void TwoMotorControl::run()
{
if (getState())