Instrument Neutral Distributed Interface INDI 2.2.5
pmc8driver.h
Go to the documentation of this file.
1/*
2 INDI Explore Scientific PMC8 driver
3
4 Copyright (C) 2017 Michael Fulbright
5 Additional contributors:
6 Thomas Olson, Copyright (C) 2019
7 Karl Rees, Copyright (C) 2019-2023
8 Martin Ruiz, Copyright (C) 2023
9 Daniel Karnaukh, Copyright (C) 2026
10
11 Based on IEQPro driver.
12
13 This library is free software; you can redistribute it and/or
14 modify it under the terms of the GNU Lesser General Public
15 License as published by the Free Software Foundation; either
16 version 2.1 of the License, or (at your option) any later version.
17
18 This library is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with this library; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26*/
27
28#pragma once
29
30#include <string>
31
32#include "inditelescope.h"
33
34// if tracking speed is above this (arcsec / sec) then assume mount is slewing
35// this is just less than 3x sidereal
36// which is what we would normally see if we are tracking
37// and start moving east at the min move rate (4x sidereal)
38#define PMC8_MAX_TRACK_RATE 44
39
40// set max settable slew rate as 833x sidereal
41#define PMC8_MAX_MOVE_RATE (833*15)
42
43// JM 2024.12.03: Since INDI tracking rate is defined as arcsecs per second (SOLAR second), we need to convert from solar to sidereal
44#define SOLAR_SECOND 1.00278551532
45
56
57//#endif
58
60
61//typedef enum { HEMI_SOUTH, HEMI_NORTH } PMC8_HEMISPHERE;
62
63typedef enum { PMC8_AXIS_RA = 0, PMC8_AXIS_DEC = 1 } PMC8_AXIS;
65
67
69
76
77typedef struct FirmwareInfo
78{
79 std::string Model;
80 std::string MainBoardFirmware;
84
85/**************************************************************************
86 Misc.
87**************************************************************************/
88
89void set_pmc8_debug(bool enable);
90void set_pmc8_simulation(bool enable);
91void set_pmc8_device(const char *name);
92void set_pmc8_mountParameters(int index);
93bool get_pmc8_response(int fd, char* buf, int* nbytes_read, const char* expected);
94bool send_pmc8_command(int fd, const char *buf, int nbytes, int *nbytes_written);
95
96/**************************************************************************
97 Simulation
98**************************************************************************/
101void set_pmc8_sim_move_rate(int value);
102//void set_sim_hemisphere(IEQ_HEMISPHERE value);
103void set_pmc8_sim_ra(double ra);
104void set_pmc8_sim_dec(double dec);
105//void set_sim_guide_rate(double rate);
106
107/**************************************************************************
108 Diagnostics
109**************************************************************************/
111bool detect_pmc8(int fd);
114
115/**************************************************************************
116 Get Info
117**************************************************************************/
119bool get_pmc8_status(int fd, PMC8Info *info);
121bool get_pmc8_firmware(int fd, FirmwareInfo *info);
123bool get_pmc8_coords(int fd, double &ra, double &dec, INDI::Telescope::TelescopePierSide &pierSide);
124bool get_pmc8_move_rate_axis(int fd, PMC8_AXIS axis, double &rate);
125bool get_pmc8_track_rate(int fd, double &rate);
126bool get_pmc8_tracking_data(int fd, double &rate, uint8_t &mode);
127uint8_t get_pmc8_tracking_mode_from_rate(double rate);
128
129/**************************************************************************
130 Motion
131**************************************************************************/
132bool set_pmc8_move_rate_axis(int fd, PMC8_DIRECTION dir, int reqrate);
135bool set_pmc8_ra_tracking(int fd, double rate);
136bool set_pmc8_custom_ra_track_rate(int fd, double rate);
137bool set_pmc8_custom_dec_track_rate(int fd, double rate);
138bool set_pmc8_custom_ra_move_rate(int fd, double rate);
139bool set_pmc8_custom_dec_move_rate(int fd, double rate);
140bool set_pmc8_track_mode(int fd, uint8_t mode);
141bool get_pmc8_is_scope_slewing(int fd, bool &isslew);
142bool get_pmc8_direction_axis(int fd, PMC8_AXIS axis, int &dir);
143bool set_pmc8_direction_axis(int fd, PMC8_AXIS axis, int dir, bool fast);
144bool abort_pmc8(int fd);
145bool abort_pmc8_goto(int fd);
146bool slew_pmc8(int fd, double ra, double dec);
147bool sync_pmc8(int fd, double ra, double dec);
148bool set_pmc8_radec(int fd, double ra, double dec);
149void set_pmc8_goto_resume(bool resume);
152
153
154/**************************************************************************
155 Park
156**************************************************************************/
157bool park_pmc8(int fd);
158bool unpark_pmc8(int fd);
159
160/**************************************************************************
161 Guide
162**************************************************************************/
163bool set_pmc8_guide_rate(int fd, PMC8_AXIS axis, double rate);
164bool get_pmc8_guide_rate(int fd, PMC8_AXIS axis, double &rate);
165bool start_pmc8_guide(int fd, PMC8_DIRECTION gdir, int ms, long &timetaken_us, double ratehint);
166bool stop_pmc8_guide(int fd, PMC8_DIRECTION gdir);
167
168/**************************************************************************
169 Time & Location
170**************************************************************************/
171void set_pmc8_location(double latitude, double longitude);
173
174
175
double ra
double dec
int fd
INDI::Telescope::TelescopePierSide currentSideOfPier(int decCounts)
bool get_pmc8_guide_rate(int fd, PMC8_AXIS axis, double &rate)
PMC8_CONNECTION_TYPE
Definition pmc8driver.h:68
@ PMC8_SERIAL_AUTO
Definition pmc8driver.h:68
@ PMC8_ETHERNET
Definition pmc8driver.h:68
@ PMC8_SERIAL_STANDARD
Definition pmc8driver.h:68
@ PMC8_SERIAL_INVERTED
Definition pmc8driver.h:68
void set_pmc8_location(double latitude, double longitude)
bool set_pmc8_custom_ra_track_rate(int fd, double rate)
uint8_t get_pmc8_tracking_mode_from_rate(double rate)
bool start_pmc8_guide(int fd, PMC8_DIRECTION gdir, int ms, long &timetaken_us, double ratehint)
void set_pmc8_sim_system_status(PMC8_SYSTEM_STATUS value)
bool set_pmc8_custom_dec_track_rate(int fd, double rate)
void set_pmc8_device(const char *name)
bool detect_pmc8(int fd)
bool park_pmc8(int fd)
bool stop_pmc8_guide(int fd, PMC8_DIRECTION gdir)
bool get_pmc8_response(int fd, char *buf, int *nbytes_read, const char *expected)
void set_pmc8_debug(bool enable)
bool sync_pmc8(int fd, double ra, double dec)
bool abort_pmc8_goto(int fd)
bool get_pmc8_status(int fd, PMC8Info *info)
bool slew_pmc8(int fd, double ra, double dec)
bool get_pmc8_is_scope_slewing(int fd, bool &isslew)
bool send_pmc8_command(int fd, const char *buf, int nbytes, int *nbytes_written)
PMC8_MOUNT_TYPES
Definition pmc8driver.h:66
@ MOUNT_G11
Definition pmc8driver.h:66
@ MOUNT_iEXOS100
Definition pmc8driver.h:66
@ MOUNT_EXOS2
Definition pmc8driver.h:66
bool check_pmc8_connection(int fd, PMC8_CONNECTION_TYPE isSerial)
PMC8_TRACK_RATE
Definition pmc8driver.h:59
@ PMC8_TRACK_KING
Definition pmc8driver.h:59
@ PMC8_TRACK_CUSTOM
Definition pmc8driver.h:59
@ PMC8_TRACK_SIDEREAL
Definition pmc8driver.h:59
@ PMC8_TRACK_LUNAR
Definition pmc8driver.h:59
@ PMC8_TRACK_SOLAR
Definition pmc8driver.h:59
@ PMC8_TRACK_UNDEFINED
Definition pmc8driver.h:59
bool set_pmc8_track_mode(int fd, uint8_t mode)
bool set_pmc8_radec(int fd, double ra, double dec)
void set_pmc8_mountParameters(int index)
bool set_pmc8_guide_rate(int fd, PMC8_AXIS axis, double rate)
INDI::Telescope::TelescopePierSide destSideOfPier(double ra, double dec)
void set_pmc8_simulation(bool enable)
void set_pmc8_goto_resume(bool resume)
bool get_pmc8_firmware(int fd, FirmwareInfo *info)
bool abort_pmc8(int fd)
bool set_pmc8_custom_ra_move_rate(int fd, double rate)
bool get_pmc8_reconnect_flag()
bool get_pmc8_tracking_data(int fd, double &rate, uint8_t &mode)
bool set_pmc8_custom_dec_move_rate(int fd, double rate)
bool set_pmc8_direction_axis(int fd, PMC8_AXIS axis, int dir, bool fast)
bool unpark_pmc8(int fd)
int get_pmc8_east_dir()
bool get_pmc8_coords(int fd, double &ra, double &dec, INDI::Telescope::TelescopePierSide &pierSide)
void set_pmc8_sim_move_rate(int value)
bool stop_pmc8_tracking_motion(int fd)
void set_pmc8_sim_track_rate(PMC8_TRACK_RATE value)
bool get_pmc8_direction_axis(int fd, PMC8_AXIS axis, int &dir)
void set_pmc8_sim_ra(double ra)
PMC8_SYSTEM_STATUS
Definition pmc8driver.h:47
@ ST_STOPPED
Definition pmc8driver.h:48
@ ST_MERIDIAN_FLIPPING
Definition pmc8driver.h:52
@ ST_PARKED
Definition pmc8driver.h:53
@ ST_SLEWING
Definition pmc8driver.h:50
@ ST_TRACKING
Definition pmc8driver.h:49
@ ST_GUIDING
Definition pmc8driver.h:51
@ ST_HOME
Definition pmc8driver.h:54
PMC8_AXIS
Definition pmc8driver.h:63
@ PMC8_AXIS_DEC
Definition pmc8driver.h:63
@ PMC8_AXIS_RA
Definition pmc8driver.h:63
void set_pmc8_reconnect_flag()
bool set_pmc8_ra_tracking(int fd, double rate)
PMC8_DIRECTION
Definition pmc8driver.h:64
@ PMC8_N
Definition pmc8driver.h:64
@ PMC8_W
Definition pmc8driver.h:64
@ PMC8_S
Definition pmc8driver.h:64
@ PMC8_E
Definition pmc8driver.h:64
void set_pmc8_sim_dec(double dec)
bool stop_pmc8_motion(int fd, PMC8_DIRECTION dir)
bool set_pmc8_move_rate_axis(int fd, PMC8_DIRECTION dir, int reqrate)
bool get_pmc8_track_rate(int fd, double &rate)
bool get_pmc8_move_rate_axis(int fd, PMC8_AXIS axis, double &rate)
std::string Model
PMC8_MOUNT_TYPES MountType
Definition pmc8driver.h:81
std::string MainBoardFirmware
bool IsRev2Compliant
Definition pmc8driver.h:82
PMC8_SYSTEM_STATUS rememberSystemStatus
Definition pmc8driver.h:73
PMC8_SYSTEM_STATUS systemStatus
Definition pmc8driver.h:72