Instrument Neutral Distributed Interface INDI
2.0.2
|
#include "pmc8driver.h"
#include "indicom.h"
#include "indilogger.h"
#include "inditelescope.h"
#include <libnova/julian_day.h>
#include <libnova/sidereal_time.h>
#include <math.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/time.h>
Go to the source code of this file.
Classes | |
struct | PulseGuideState |
Macros | |
#define | PMC8_TIMEOUT 5 /* FD timeout in seconds */ |
#define | PMC8_SIMUL_VERSION_RESP "ESGvES06B9T9" |
#define | PMC8_G11_AXIS0_SCALE 4608000.0 |
#define | PMC8_G11_AXIS1_SCALE 4608000.0 |
#define | PMC8_EXOS2_AXIS0_SCALE 4147200.0 |
#define | PMC8_EXOS2_AXIS1_SCALE 4147200.0 |
#define | PMC8_iEXOS100_AXIS0_SCALE 4147200.0 |
#define | PMC8_iEXOS100_AXIS1_SCALE 4147200.0 |
#define | ARCSEC_IN_CIRCLE 1296000.0 |
#define | PMC8_MAX_PRECISE_MOTOR_RATE 62500 |
#define | PMC8_PULSE_GUIDE_MIN_MS 20 |
#define | PMC8_PULSE_GUIDE_MAX_NOTIMER 250 |
#define | PMC8_MAX_RETRIES 3 /*number of times to retry reading a response */ |
#define | PMC8_RETRY_DELAY 30000 /* how long to wait before retrying i/o */ |
#define | PMC8_MAX_IO_ERROR_THRESHOLD 2 /* how many consecutive read timeouts before trying to reset the connection */ |
#define | PMC8_RATE_SIDEREAL 15.000 |
#define | PMC8_RATE_LUNAR 14.451 |
#define | PMC8_RATE_SOLAR 14.959 |
#define | PMC8_RATE_KING 14.996 |
Typedefs | |
typedef struct PulseGuideState | PulseGuideState |
Functions | |
void | convert_motor_counts_to_hex (int val, char *hex) |
bool | convert_precise_rate_to_motor (double rate, int *mrate) |
bool | convert_precise_motor_to_rate (int mrate, double *rate) |
bool | convert_move_rate_to_motor (float rate, int *mrate) |
bool | convert_motor_rate_to_move_rate (int mrate, double *rate) |
void | set_pmc8_mountParameters (int index) |
void | set_pmc8_debug (bool enable) |
void | set_pmc8_simulation (bool enable) |
void | set_pmc8_device (const char *name) |
void | set_pmc8_location (double latitude, double longitude) |
void | set_pmc8_sim_system_status (PMC8_SYSTEM_STATUS value) |
void | set_pmc8_sim_track_rate (PMC8_TRACK_RATE value) |
void | set_pmc8_sim_move_rate (int value) |
void | set_pmc8_sim_ra (double ra) |
void | set_pmc8_sim_dec (double dec) |
bool | check_pmc8_connection (int fd, PMC8_CONNECTION_TYPE connection) |
bool | detect_pmc8 (int fd) |
bool | get_pmc8_model (int fd, FirmwareInfo *info) |
bool | get_pmc8_main_firmware (int fd, FirmwareInfo *info) |
bool | get_pmc8_firmware (int fd, FirmwareInfo *info) |
bool | get_pmc8_move_rate_axis (int fd, PMC8_AXIS axis, double &rate) |
bool | get_pmc8_direction_axis (int fd, PMC8_AXIS axis, int &dir) |
bool | set_pmc8_direction_axis (int fd, PMC8_AXIS axis, int dir, bool fast) |
bool | get_pmc8_is_scope_slewing (int fd, bool &isslew) |
bool | set_pmc8_move_rate_axis (int fd, PMC8_DIRECTION dir, int reqrate) |
bool | stop_pmc8_tracking_motion (int fd) |
bool | get_pmc8_track_rate (int fd, double &rate) |
bool | get_pmc8_tracking_data (int fd, double &rate, uint8_t &mode) |
uint8_t | get_pmc8_tracking_mode_from_rate (double rate) |
bool | set_pmc8_axis_motor_rate (int fd, PMC8_AXIS axis, int mrate, bool fast) |
bool | set_pmc8_axis_move_rate (int fd, PMC8_AXIS axis, float rate) |
bool | set_pmc8_track_mode (int fd, uint8_t mode) |
bool | set_pmc8_ra_tracking (int fd, double rate) |
bool | set_pmc8_custom_ra_track_rate (int fd, double rate) |
bool | set_pmc8_custom_dec_track_rate (int fd, double rate) |
bool | set_pmc8_custom_ra_move_rate (int fd, double rate) |
bool | set_pmc8_custom_dec_move_rate (int fd, double rate) |
bool | set_pmc8_guide_rate (int fd, PMC8_AXIS axis, double rate) |
bool | get_pmc8_guide_rate (int fd, PMC8_AXIS axis, double &rate) |
bool | get_pmc8_guide_state (PMC8_DIRECTION gdir, PulseGuideState **pstate) |
bool | start_pmc8_guide (int fd, PMC8_DIRECTION gdir, int ms, long &timetaken_us, double ratehint) |
bool | stop_pmc8_guide (int fd, PMC8_DIRECTION gdir) |
int | convert_axispos_to_motor (int axispos) |
bool | convert_ra_to_motor (double ra, INDI::Telescope::TelescopePierSide sop, int *mcounts) |
bool | convert_motor_to_radec (int racounts, int deccounts, double &ra_value, double &dec_value) |
bool | convert_dec_to_motor (double dec, INDI::Telescope::TelescopePierSide sop, int *mcounts) |
bool | set_pmc8_target_position_axis (int fd, PMC8_AXIS axis, int point) |
bool | set_pmc8_target_position (int fd, int rapoint, int decpoint) |
bool | set_pmc8_position_axis (int fd, PMC8_AXIS axis, int point) |
bool | set_pmc8_position (int fd, int rapoint, int decpoint) |
bool | get_pmc8_position_axis (int fd, PMC8_AXIS axis, int &point) |
bool | get_pmc8_position (int fd, int &rapoint, int &decpoint) |
bool | park_pmc8 (int fd) |
bool | unpark_pmc8 (int fd) |
bool | abort_pmc8 (int fd) |
bool | abort_pmc8_goto (int fd) |
bool | slew_pmc8 (int fd, double ra, double dec) |
INDI::Telescope::TelescopePierSide | destSideOfPier (double ra, double dec) |
bool | sync_pmc8 (int fd, double ra, double dec) |
bool | set_pmc8_radec (int fd, double ra, double dec) |
bool | get_pmc8_coords (int fd, double &ra, double &dec) |
bool | get_pmc8_response (int fd, char *buf, int *nbytes_read, const char *expected=NULL) |
bool | send_pmc8_command (int fd, const char *buf, int nbytes, int *nbytes_written) |
void | set_pmc8_reconnect_flag () |
bool | get_pmc8_reconnect_flag () |
void | set_pmc8_goto_resume (bool resume) |
Variables | |
double | PMC8_AXIS0_SCALE = PMC8_EXOS2_AXIS0_SCALE |
double | PMC8_AXIS1_SCALE = PMC8_EXOS2_AXIS1_SCALE |
PMC8_CONNECTION_TYPE | pmc8_connection = PMC8_SERIAL_AUTO |
bool | pmc8_debug = false |
bool | pmc8_simulation = false |
bool | pmc8_isRev2Compliant = false |
bool | pmc8_reconnect_flag = false |
bool | pmc8_goto_resume = true |
int | pmc8_io_error_ctr = 0 |
char | pmc8_device [MAXINDIDEVICE] = "PMC8" |
double | pmc8_latitude = 0 |
double | pmc8_longitude = 0 |
double | pmc8_sidereal_rate_fraction_ra = 0.4 |
double | pmc8_sidereal_rate_fraction_de = 0.4 |
int | pmc8_east_dir = 1 |
PMC8Info | simPMC8Info |
PulseGuideState | NS_PulseGuideState |
PulseGuideState | EW_PulseGuideState |
struct { | |
double ra | |
double dec | |
int raDirection | |
int decDirection | |
double trackRate | |
double moveRate | |
double guide_rate | |
} | simPMC8Data |
#define ARCSEC_IN_CIRCLE 1296000.0 |
Definition at line 64 of file pmc8driver.cpp.
#define PMC8_EXOS2_AXIS0_SCALE 4147200.0 |
Definition at line 54 of file pmc8driver.cpp.
#define PMC8_EXOS2_AXIS1_SCALE 4147200.0 |
Definition at line 55 of file pmc8driver.cpp.
#define PMC8_G11_AXIS0_SCALE 4608000.0 |
Definition at line 51 of file pmc8driver.cpp.
#define PMC8_G11_AXIS1_SCALE 4608000.0 |
Definition at line 52 of file pmc8driver.cpp.
#define PMC8_iEXOS100_AXIS0_SCALE 4147200.0 |
Definition at line 57 of file pmc8driver.cpp.
#define PMC8_iEXOS100_AXIS1_SCALE 4147200.0 |
Definition at line 58 of file pmc8driver.cpp.
#define PMC8_MAX_IO_ERROR_THRESHOLD 2 /* how many consecutive read timeouts before trying to reset the connection */ |
Definition at line 78 of file pmc8driver.cpp.
#define PMC8_MAX_PRECISE_MOTOR_RATE 62500 |
Definition at line 68 of file pmc8driver.cpp.
#define PMC8_MAX_RETRIES 3 /*number of times to retry reading a response */ |
Definition at line 76 of file pmc8driver.cpp.
#define PMC8_PULSE_GUIDE_MAX_NOTIMER 250 |
Definition at line 74 of file pmc8driver.cpp.
#define PMC8_PULSE_GUIDE_MIN_MS 20 |
Definition at line 71 of file pmc8driver.cpp.
#define PMC8_RATE_KING 14.996 |
Definition at line 83 of file pmc8driver.cpp.
#define PMC8_RATE_LUNAR 14.451 |
Definition at line 81 of file pmc8driver.cpp.
#define PMC8_RATE_SIDEREAL 15.000 |
Definition at line 80 of file pmc8driver.cpp.
#define PMC8_RATE_SOLAR 14.959 |
Definition at line 82 of file pmc8driver.cpp.
#define PMC8_RETRY_DELAY 30000 /* how long to wait before retrying i/o */ |
Definition at line 77 of file pmc8driver.cpp.
#define PMC8_SIMUL_VERSION_RESP "ESGvES06B9T9" |
Definition at line 48 of file pmc8driver.cpp.
#define PMC8_TIMEOUT 5 /* FD timeout in seconds */ |
Definition at line 46 of file pmc8driver.cpp.
typedef struct PulseGuideState PulseGuideState |
bool abort_pmc8 | ( | int | fd | ) |
Definition at line 1922 of file pmc8driver.cpp.
bool abort_pmc8_goto | ( | int | fd | ) |
Definition at line 1951 of file pmc8driver.cpp.
bool check_pmc8_connection | ( | int | fd, |
PMC8_CONNECTION_TYPE | connection | ||
) |
Definition at line 297 of file pmc8driver.cpp.
int convert_axispos_to_motor | ( | int | axispos | ) |
Definition at line 1539 of file pmc8driver.cpp.
bool convert_dec_to_motor | ( | double | dec, |
INDI::Telescope::TelescopePierSide | sop, | ||
int * | mcounts | ||
) |
Definition at line 1668 of file pmc8driver.cpp.
void convert_motor_counts_to_hex | ( | int | val, |
char * | hex | ||
) |
Definition at line 128 of file pmc8driver.cpp.
bool convert_motor_rate_to_move_rate | ( | int | mrate, |
double * | rate | ||
) |
Definition at line 197 of file pmc8driver.cpp.
bool convert_motor_to_radec | ( | int | racounts, |
int | deccounts, | ||
double & | ra_value, | ||
double & | dec_value | ||
) |
Definition at line 1601 of file pmc8driver.cpp.
bool convert_move_rate_to_motor | ( | float | rate, |
int * | mrate | ||
) |
Definition at line 182 of file pmc8driver.cpp.
bool convert_precise_motor_to_rate | ( | int | mrate, |
double * | rate | ||
) |
Definition at line 174 of file pmc8driver.cpp.
bool convert_precise_rate_to_motor | ( | double | rate, |
int * | mrate | ||
) |
Definition at line 152 of file pmc8driver.cpp.
bool convert_ra_to_motor | ( | double | ra, |
INDI::Telescope::TelescopePierSide | sop, | ||
int * | mcounts | ||
) |
Definition at line 1551 of file pmc8driver.cpp.
INDI::Telescope::TelescopePierSide destSideOfPier | ( | double | ra, |
double | dec | ||
) |
Definition at line 2027 of file pmc8driver.cpp.
bool detect_pmc8 | ( | int | fd | ) |
Definition at line 355 of file pmc8driver.cpp.
bool get_pmc8_coords | ( | int | fd, |
double & | ra, | ||
double & | dec | ||
) |
Get RA/DEC
Definition at line 2154 of file pmc8driver.cpp.
bool get_pmc8_direction_axis | ( | int | fd, |
PMC8_AXIS | axis, | ||
int & | dir | ||
) |
Definition at line 609 of file pmc8driver.cpp.
bool get_pmc8_firmware | ( | int | fd, |
FirmwareInfo * | info | ||
) |
Get All firmware informatin in addition to mount model
Definition at line 538 of file pmc8driver.cpp.
bool get_pmc8_guide_rate | ( | int | fd, |
PMC8_AXIS | axis, | ||
double & | rate | ||
) |
Definition at line 1211 of file pmc8driver.cpp.
bool get_pmc8_guide_state | ( | PMC8_DIRECTION | gdir, |
PulseGuideState ** | pstate | ||
) |
Definition at line 1273 of file pmc8driver.cpp.
bool get_pmc8_is_scope_slewing | ( | int | fd, |
bool & | isslew | ||
) |
Definition at line 712 of file pmc8driver.cpp.
bool get_pmc8_main_firmware | ( | int | fd, |
FirmwareInfo * | info | ||
) |
Definition at line 485 of file pmc8driver.cpp.
bool get_pmc8_model | ( | int | fd, |
FirmwareInfo * | info | ||
) |
Definition at line 390 of file pmc8driver.cpp.
bool get_pmc8_move_rate_axis | ( | int | fd, |
PMC8_AXIS | axis, | ||
double & | rate | ||
) |
Definition at line 553 of file pmc8driver.cpp.
bool get_pmc8_position | ( | int | fd, |
int & | rapoint, | ||
int & | decpoint | ||
) |
Definition at line 1864 of file pmc8driver.cpp.
bool get_pmc8_position_axis | ( | int | fd, |
PMC8_AXIS | axis, | ||
int & | point | ||
) |
Definition at line 1814 of file pmc8driver.cpp.
bool get_pmc8_reconnect_flag | ( | ) |
Definition at line 2312 of file pmc8driver.cpp.
bool get_pmc8_response | ( | int | fd, |
char * | buf, | ||
int * | nbytes_read, | ||
const char * | expected = NULL |
||
) |
Definition at line 2198 of file pmc8driver.cpp.
bool get_pmc8_track_rate | ( | int | fd, |
double & | rate | ||
) |
Definition at line 787 of file pmc8driver.cpp.
bool get_pmc8_tracking_data | ( | int | fd, |
double & | rate, | ||
uint8_t & | mode | ||
) |
Definition at line 834 of file pmc8driver.cpp.
uint8_t get_pmc8_tracking_mode_from_rate | ( | double | rate | ) |
Definition at line 842 of file pmc8driver.cpp.
bool park_pmc8 | ( | int | fd | ) |
Definition at line 1890 of file pmc8driver.cpp.
bool send_pmc8_command | ( | int | fd, |
const char * | buf, | ||
int | nbytes, | ||
int * | nbytes_written | ||
) |
Definition at line 2284 of file pmc8driver.cpp.
bool set_pmc8_axis_motor_rate | ( | int | fd, |
PMC8_AXIS | axis, | ||
int | mrate, | ||
bool | fast | ||
) |
Definition at line 884 of file pmc8driver.cpp.
bool set_pmc8_axis_move_rate | ( | int | fd, |
PMC8_AXIS | axis, | ||
float | rate | ||
) |
Definition at line 932 of file pmc8driver.cpp.
bool set_pmc8_custom_dec_move_rate | ( | int | fd, |
double | rate | ||
) |
Definition at line 1140 of file pmc8driver.cpp.
bool set_pmc8_custom_dec_track_rate | ( | int | fd, |
double | rate | ||
) |
Definition at line 1111 of file pmc8driver.cpp.
bool set_pmc8_custom_ra_move_rate | ( | int | fd, |
double | rate | ||
) |
Definition at line 1121 of file pmc8driver.cpp.
bool set_pmc8_custom_ra_track_rate | ( | int | fd, |
double | rate | ||
) |
Definition at line 1036 of file pmc8driver.cpp.
void set_pmc8_debug | ( | bool | enable | ) |
Definition at line 226 of file pmc8driver.cpp.
void set_pmc8_device | ( | const char * | name | ) |
Definition at line 238 of file pmc8driver.cpp.
bool set_pmc8_direction_axis | ( | int | fd, |
PMC8_AXIS | axis, | ||
int | dir, | ||
bool | fast | ||
) |
Definition at line 665 of file pmc8driver.cpp.
void set_pmc8_goto_resume | ( | bool | resume | ) |
Definition at line 2322 of file pmc8driver.cpp.
bool set_pmc8_guide_rate | ( | int | fd, |
PMC8_AXIS | axis, | ||
double | rate | ||
) |
Definition at line 1159 of file pmc8driver.cpp.
void set_pmc8_location | ( | double | latitude, |
double | longitude | ||
) |
Definition at line 243 of file pmc8driver.cpp.
void set_pmc8_mountParameters | ( | int | index | ) |
Definition at line 204 of file pmc8driver.cpp.
bool set_pmc8_move_rate_axis | ( | int | fd, |
PMC8_DIRECTION | dir, | ||
int | reqrate | ||
) |
Definition at line 745 of file pmc8driver.cpp.
bool set_pmc8_position | ( | int | fd, |
int | rapoint, | ||
int | decpoint | ||
) |
Definition at line 1799 of file pmc8driver.cpp.
bool set_pmc8_position_axis | ( | int | fd, |
PMC8_AXIS | axis, | ||
int | point | ||
) |
Definition at line 1758 of file pmc8driver.cpp.
bool set_pmc8_ra_tracking | ( | int | fd, |
double | rate | ||
) |
Definition at line 1024 of file pmc8driver.cpp.
bool set_pmc8_radec | ( | int | fd, |
double | ra, | ||
double | dec | ||
) |
Definition at line 2108 of file pmc8driver.cpp.
void set_pmc8_reconnect_flag | ( | ) |
Definition at line 2306 of file pmc8driver.cpp.
void set_pmc8_sim_dec | ( | double | dec | ) |
Definition at line 292 of file pmc8driver.cpp.
void set_pmc8_sim_move_rate | ( | int | value | ) |
Definition at line 282 of file pmc8driver.cpp.
void set_pmc8_sim_ra | ( | double | ra | ) |
Definition at line 287 of file pmc8driver.cpp.
void set_pmc8_sim_system_status | ( | PMC8_SYSTEM_STATUS | value | ) |
Definition at line 253 of file pmc8driver.cpp.
void set_pmc8_sim_track_rate | ( | PMC8_TRACK_RATE | value | ) |
Definition at line 277 of file pmc8driver.cpp.
void set_pmc8_simulation | ( | bool | enable | ) |
Definition at line 231 of file pmc8driver.cpp.
bool set_pmc8_target_position | ( | int | fd, |
int | rapoint, | ||
int | decpoint | ||
) |
Definition at line 1743 of file pmc8driver.cpp.
bool set_pmc8_target_position_axis | ( | int | fd, |
PMC8_AXIS | axis, | ||
int | point | ||
) |
Definition at line 1701 of file pmc8driver.cpp.
bool set_pmc8_track_mode | ( | int | fd, |
uint8_t | mode | ||
) |
Definition at line 996 of file pmc8driver.cpp.
bool slew_pmc8 | ( | int | fd, |
double | ra, | ||
double | dec | ||
) |
Definition at line 1987 of file pmc8driver.cpp.
bool start_pmc8_guide | ( | int | fd, |
PMC8_DIRECTION | gdir, | ||
int | ms, | ||
long & | timetaken_us, | ||
double | ratehint | ||
) |
Definition at line 1296 of file pmc8driver.cpp.
bool stop_pmc8_guide | ( | int | fd, |
PMC8_DIRECTION | gdir | ||
) |
Definition at line 1458 of file pmc8driver.cpp.
bool stop_pmc8_tracking_motion | ( | int | fd | ) |
Definition at line 771 of file pmc8driver.cpp.
bool sync_pmc8 | ( | int | fd, |
double | ra, | ||
double | dec | ||
) |
Definition at line 2062 of file pmc8driver.cpp.
bool unpark_pmc8 | ( | int | fd | ) |
Definition at line 1903 of file pmc8driver.cpp.
double dec |
Definition at line 119 of file pmc8driver.cpp.
int decDirection |
Definition at line 121 of file pmc8driver.cpp.
PulseGuideState EW_PulseGuideState |
Definition at line 114 of file pmc8driver.cpp.
double guide_rate |
Definition at line 124 of file pmc8driver.cpp.
double moveRate |
Definition at line 123 of file pmc8driver.cpp.
PulseGuideState NS_PulseGuideState |
Definition at line 114 of file pmc8driver.cpp.
double PMC8_AXIS0_SCALE = PMC8_EXOS2_AXIS0_SCALE |
Definition at line 61 of file pmc8driver.cpp.
double PMC8_AXIS1_SCALE = PMC8_EXOS2_AXIS1_SCALE |
Definition at line 62 of file pmc8driver.cpp.
PMC8_CONNECTION_TYPE pmc8_connection = PMC8_SERIAL_AUTO |
Definition at line 85 of file pmc8driver.cpp.
bool pmc8_debug = false |
Definition at line 86 of file pmc8driver.cpp.
char pmc8_device[MAXINDIDEVICE] = "PMC8" |
Definition at line 92 of file pmc8driver.cpp.
int pmc8_east_dir = 1 |
Definition at line 97 of file pmc8driver.cpp.
bool pmc8_goto_resume = true |
Definition at line 90 of file pmc8driver.cpp.
int pmc8_io_error_ctr = 0 |
Definition at line 91 of file pmc8driver.cpp.
bool pmc8_isRev2Compliant = false |
Definition at line 88 of file pmc8driver.cpp.
double pmc8_latitude = 0 |
Definition at line 93 of file pmc8driver.cpp.
double pmc8_longitude = 0 |
Definition at line 94 of file pmc8driver.cpp.
bool pmc8_reconnect_flag = false |
Definition at line 89 of file pmc8driver.cpp.
double pmc8_sidereal_rate_fraction_de = 0.4 |
Definition at line 96 of file pmc8driver.cpp.
double pmc8_sidereal_rate_fraction_ra = 0.4 |
Definition at line 95 of file pmc8driver.cpp.
bool pmc8_simulation = false |
Definition at line 87 of file pmc8driver.cpp.
double ra |
Definition at line 118 of file pmc8driver.cpp.
int raDirection |
Definition at line 120 of file pmc8driver.cpp.
struct { ... } simPMC8Data |
PMC8Info simPMC8Info |
Definition at line 98 of file pmc8driver.cpp.
double trackRate |
Definition at line 122 of file pmc8driver.cpp.