Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@knro
Copy link
Contributor

@knro knro commented Jul 28, 2024

Since several mounts support Homing controls. This PR moves the responsibility of defining available homing operations to the INDI::Telescope class. Three operations are currently supported and any combination of the three can be set by the concrete class:

  • Find: Command mount to search for home axis indexes.
  • Set: Accept current position as the new home position.
  • Go: Slew to home position.

Both Find and Go are transient operations so the driver must set the status of HomeSP to OK and must also reset all members of the switch property.

@pawel-soja
Copy link
Contributor

I added HOME_SET. Where did the buttons go?
image

image

@pawel-soja
Copy link
Contributor

There is one more call in the code and it overwrites homeCapability to 0

if (mountType == Equatorial)
SetTelescopeCapability(GetTelescopeCapability() | TELESCOPE_HAS_PIER_SIDE, SLEW_MODES);

@pawel-soja
Copy link
Contributor

To check compatibility, the argument should not have the default value of 0.

void SetTelescopeCapability(uint32_t cap, uint8_t slewRateCount, uint8_t homeCapability = 0);

Why don't you want to add these options to a 32-bit variable? There's still some space :)

enum
{
    TELESCOPE_CAN_GOTO                    = 1 << 0,  /** Can the telescope go to to specific coordinates? */
    TELESCOPE_CAN_SYNC                    = 1 << 1,  /** Can the telescope sync to specific coordinates? */
    TELESCOPE_CAN_PARK                    = 1 << 2,  /** Can the telescope park? */
    TELESCOPE_CAN_ABORT                   = 1 << 3,  /** Can the telescope abort motion? */
    TELESCOPE_HAS_TIME                    = 1 << 4,  /** Does the telescope have configurable date and time settings? */
    TELESCOPE_HAS_LOCATION                = 1 << 5,  /** Does the telescope have configuration location settings? */
    TELESCOPE_HAS_PIER_SIDE               = 1 << 6,  /** Does the telescope have pier side property? */
    TELESCOPE_HAS_PEC                     = 1 << 7,  /** Does the telescope have PEC playback? */
    TELESCOPE_HAS_TRACK_MODE              = 1 << 8,  /** Does the telescope have track modes (sidereal, lunar, solar..etc)? */
    TELESCOPE_CAN_CONTROL_TRACK           = 1 << 9,  /** Can the telescope engage and disengage tracking? */
    TELESCOPE_HAS_TRACK_RATE              = 1 << 10, /** Does the telescope have custom track rates? */
    TELESCOPE_HAS_PIER_SIDE_SIMULATION    = 1 << 11, /** Does the telescope simulate the pier side property? */
    TELESCOPE_CAN_TRACK_SATELLITE         = 1 << 12, /** Can the telescope track satellites? */
    TELESCOPE_CAN_FLIP                    = 1 << 13, /** Does the telescope have a command for flipping? */

    TELESCOPE_HOME_FIND                   = 1 << 14,     /*!< Mount can search for home position  */
    TELESCOPE_HOME_SET                    = 1 << 15,     /*!< Mount can use current-position as home position */
    TELESCOPE_HOME_GO                     = 1 << 16,     /*!< Mount can slew to home position */
} TelescopeCapability;

@knro
Copy link
Contributor Author

knro commented Jul 28, 2024

Thank you for the suggestion, I'll make the necessary changes tomorrow.

@knro knro marked this pull request as ready for review July 29, 2024 09:20
@knro knro merged commit 65b9270 into indilib:master Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants