asibfm700_servocontroller.cpp: LibSidServo's AXIS_GONNASTOP hardware

state flag processing is added
asibfm700_mount.cpp: in slew-and-track mode waiting for HW_MOVE_GUIDING
flag to switch from slew to track mode is implemented
This commit is contained in:
2026-10-13 14:31:31 +03:00
parent 981a9ef074
commit 092ec63589
2 changed files with 46 additions and 38 deletions

View File

@@ -118,35 +118,35 @@ AsibFM700ServoController::error_t AsibFM700ServoController::hardwareSetState(har
if (state.movementState == hardware_movement_state_t::HW_MOVE_STOPPING) { // stop!
err = static_cast<AsibFM700ServoControllerErrorCode>(Mount.stop());
/*
if (err) {
return err;
}
/*
if (err) {
return err;
}
hardware_state_t hw_state;
hardware_state_t hw_state;
auto start_tp = std::chrono::steady_clock::now();
auto start_tp = std::chrono::steady_clock::now();
// poll hardware till stopped-state detected ...
while (true) {
err = hardwareGetState(&hw_state);
if (err) {
return err;
}
// poll hardware till stopped-state detected ...
while (true) {
err = hardwareGetState(&hw_state);
if (err) {
return err;
}
if (hw_state.movementState == hardware_movement_state_t::HW_MOVE_STOPPED) {
break;
}
if (hw_state.movementState == hardware_movement_state_t::HW_MOVE_STOPPED) {
break;
}
if ((std::chrono::steady_clock::now() - start_tp) > _hardwareConfig.pollingTimeout) {
err = AsibFM700ServoControllerErrorCode::ERROR_POLLING_TIMEOUT;
break;
}
if ((std::chrono::steady_clock::now() - start_tp) > _hardwareConfig.pollingTimeout) {
err = AsibFM700ServoControllerErrorCode::ERROR_POLLING_TIMEOUT;
break;
}
std::this_thread::sleep_for(_hardwareConfig.pollingInterval);
}
std::this_thread::sleep_for(_hardwareConfig.pollingInterval);
}
*/
*/
return err;
}
@@ -204,6 +204,8 @@ AsibFM700ServoController::error_t AsibFM700ServoController::hardwareGetState(har
if (mdata.Xstate == AXIS_ERROR || mdata.Ystate == AXIS_ERROR) {
state->movementState = hardware_movement_state_t::HW_MOVE_ERROR;
} else if (mdata.Xstate == AXIS_GONNASTOP || mdata.Ystate == AXIS_GONNASTOP) {
state->movementState = hardware_movement_state_t::HW_MOVE_STOPPING;
} else {
if (mdata.Xstate == AXIS_STOPPED) {
if (mdata.Ystate == AXIS_STOPPED) {