...
This commit is contained in:
@@ -145,8 +145,8 @@ static auto Asibfm700MountConfigDefaults = std::make_tuple(
|
|||||||
|
|
||||||
// target-mount coordinate difference in arcsecs to start adjusting of slewing
|
// target-mount coordinate difference in arcsecs to start adjusting of slewing
|
||||||
simple_config_record_t{"adjustCoordDiff",
|
simple_config_record_t{"adjustCoordDiff",
|
||||||
50.0,
|
5.5,
|
||||||
{"target-mount coordinate difference in arcsecs to start adjusting of slewing"}},
|
{"target-mount coordinate difference in degress to start adjusting of slewing"}},
|
||||||
|
|
||||||
// minimum time in millisecs between two successive adjustments
|
// minimum time in millisecs between two successive adjustments
|
||||||
simple_config_record_t{"adjustCycleInterval",
|
simple_config_record_t{"adjustCycleInterval",
|
||||||
@@ -612,7 +612,8 @@ public:
|
|||||||
pars.slewRateY = getValue<decltype(pars.slewRateY)>("hwMaxRateDEC").value_or(pars.slewRateY);
|
pars.slewRateY = getValue<decltype(pars.slewRateY)>("hwMaxRateDEC").value_or(pars.slewRateY);
|
||||||
|
|
||||||
pars.adjustCoordDiff =
|
pars.adjustCoordDiff =
|
||||||
getValue<decltype(pars.adjustCoordDiff)>("adjustCoordDiff").value_or(pars.adjustCoordDiff) * arcsecs2rad;
|
getValue<decltype(pars.adjustCoordDiff)>("adjustCoordDiff").value_or(pars.adjustCoordDiff) *
|
||||||
|
mcc::MCC_DEGRESS_TO_RADS;
|
||||||
|
|
||||||
pars.adjustCycleInterval =
|
pars.adjustCycleInterval =
|
||||||
getValue<decltype(pars.adjustCycleInterval)>("adjustCycleInterval").value_or(pars.adjustCycleInterval);
|
getValue<decltype(pars.adjustCycleInterval)>("adjustCycleInterval").value_or(pars.adjustCycleInterval);
|
||||||
|
|||||||
@@ -33,9 +33,12 @@ Asibfm700Mount::Asibfm700Mount(Asibfm700MountConfig const& config, std::shared_p
|
|||||||
|
|
||||||
Asibfm700Mount::~Asibfm700Mount()
|
Asibfm700Mount::~Asibfm700Mount()
|
||||||
{
|
{
|
||||||
stoppingImpl();
|
*_lastMountError = stoppingImpl();
|
||||||
|
if (_lastMountError->load()) {
|
||||||
|
errorLogging("an error occured while stopping mount: ", _lastMountError->load());
|
||||||
|
}
|
||||||
|
|
||||||
Mount.quit();
|
_servolController.hardwareShutdown();
|
||||||
|
|
||||||
logDebug("Delete Asibfm700Mount class instance ({})", this->getThreadId());
|
logDebug("Delete Asibfm700Mount class instance ({})", this->getThreadId());
|
||||||
}
|
}
|
||||||
@@ -490,6 +493,8 @@ Asibfm700Mount::error_t Asibfm700Mount::slewingImpl(bool slew_and_stop)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*_stopMovementRequest = false;
|
||||||
|
|
||||||
_pathFile.clearPath();
|
_pathFile.clearPath();
|
||||||
|
|
||||||
_enteredBackupCoordinates = telemetry_t::getPointingTarget();
|
_enteredBackupCoordinates = telemetry_t::getPointingTarget();
|
||||||
@@ -747,6 +752,8 @@ Asibfm700Mount::error_t Asibfm700Mount::trackingImpl()
|
|||||||
return mcc::impl::MccGenericMovementControlsErrorCode::ERROR_OK;
|
return mcc::impl::MccGenericMovementControlsErrorCode::ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*_stopMovementRequest = false;
|
||||||
|
|
||||||
*_mountStatus = mount_status_t::MOUNT_STATUS_TRACKING;
|
*_mountStatus = mount_status_t::MOUNT_STATUS_TRACKING;
|
||||||
_pathFile.clearPath();
|
_pathFile.clearPath();
|
||||||
|
|
||||||
@@ -877,6 +884,8 @@ Asibfm700Mount::error_t Asibfm700Mount::trackingImpl()
|
|||||||
|
|
||||||
Asibfm700Mount::error_t Asibfm700Mount::stoppingImpl()
|
Asibfm700Mount::error_t Asibfm700Mount::stoppingImpl()
|
||||||
{
|
{
|
||||||
|
logInfo("Stop mount requested");
|
||||||
|
|
||||||
*_stopMovementRequest = true;
|
*_stopMovementRequest = true;
|
||||||
|
|
||||||
typename AsibFM700ServoController::hardware_state_t hw_state;
|
typename AsibFM700ServoController::hardware_state_t hw_state;
|
||||||
@@ -892,6 +901,8 @@ Asibfm700Mount::error_t Asibfm700Mount::stoppingImpl()
|
|||||||
|
|
||||||
*_lastMountError = _servolController.hardwareGetState(&hw_state);
|
*_lastMountError = _servolController.hardwareGetState(&hw_state);
|
||||||
|
|
||||||
|
logDebug(" wait for mount stopping (timeout is {} seconds) ...",
|
||||||
|
_mountConfig.getValue<std::chrono::seconds>("stopTimeout").value().count());
|
||||||
while (hw_state.movementState != AsibFM700ServoController::hardware_movement_state_t::HW_MOVE_STOPPED &&
|
while (hw_state.movementState != AsibFM700ServoController::hardware_movement_state_t::HW_MOVE_STOPPED &&
|
||||||
!_lastMountError->load()) {
|
!_lastMountError->load()) {
|
||||||
if ((std::chrono::steady_clock::now() - start_tp) >
|
if ((std::chrono::steady_clock::now() - start_tp) >
|
||||||
@@ -909,6 +920,7 @@ Asibfm700Mount::error_t Asibfm700Mount::stoppingImpl()
|
|||||||
if (!_lastMountError->load()) {
|
if (!_lastMountError->load()) {
|
||||||
*_mountStatus = mount_status_t::MOUNT_STATUS_IDLE;
|
*_mountStatus = mount_status_t::MOUNT_STATUS_IDLE;
|
||||||
*_lastMountError = mcc::impl::MccGenericMovementControlsErrorCode::ERROR_OK;
|
*_lastMountError = mcc::impl::MccGenericMovementControlsErrorCode::ERROR_OK;
|
||||||
|
logInfo("The mount is stopped!");
|
||||||
} else {
|
} else {
|
||||||
*_mountStatus = mount_status_t::MOUNT_STATUS_ERROR;
|
*_mountStatus = mount_status_t::MOUNT_STATUS_ERROR;
|
||||||
errorLogging("An error occured while stoppping mount: ", _lastMountError->load());
|
errorLogging("An error occured while stoppping mount: ", _lastMountError->load());
|
||||||
|
|||||||
@@ -100,6 +100,15 @@ AsibFM700ServoController::error_t AsibFM700ServoController::hardwareInit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AsibFM700ServoController::error_t AsibFM700ServoController::hardwareShutdown()
|
||||||
|
{
|
||||||
|
Mount.quit();
|
||||||
|
|
||||||
|
return AsibFM700ServoControllerErrorCode::ERROR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AsibFM700ServoController::error_t AsibFM700ServoController::hardwareSetState(hardware_state_t const& state)
|
AsibFM700ServoController::error_t AsibFM700ServoController::hardwareSetState(hardware_state_t const& state)
|
||||||
{
|
{
|
||||||
std::lock_guard lock{*_setStateMutex};
|
std::lock_guard lock{*_setStateMutex};
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ public:
|
|||||||
|
|
||||||
error_t hardwareInit();
|
error_t hardwareInit();
|
||||||
|
|
||||||
|
error_t hardwareShutdown();
|
||||||
|
|
||||||
void hardwareUpdateConfig(conf_t cfg);
|
void hardwareUpdateConfig(conf_t cfg);
|
||||||
|
|
||||||
// save config to EEPROM
|
// save config to EEPROM
|
||||||
|
|||||||
Reference in New Issue
Block a user