58 void attach(
int descriptor);
62 bool line(std::string &out,
int wait_ms);
94 bool ISNewNumber(
const char *dev,
const char *name,
double values[],
95 char *names[],
int n)
override;
97 char *names[],
int n)
override;
98 bool ISNewText(
const char *dev,
const char *name,
char *texts[],
99 char *names[],
int n)
override;
112 using Fields = std::map<std::string, std::string>;
117 bool command(
const std::string &text, Fields *fields =
nullptr,
118 std::string *error_for_user =
nullptr);
119 void collect_unsolicited();
120 void handle_unsolicited_line(
const std::string &line);
121 static Fields split_fields(
const std::string &line);
122 static double number(
const Fields &fields,
const char *key,
double if_missing = 0.0);
125 bool read_status(Fields &fields);
126 bool read_calibration();
127 void update_panels(
const Fields &status);
136 void finish_sweep(
bool succeeded);
139 std::string log_path()
const;
140 std::string sweep_path()
const;
144 static std::string expand_home(
const std::string &path);
145 static std::string default_folder();
148 static void ensure_folder(
const std::string &file_path);
151 void record_move(
const Fields &status,
const char *outcome);
164 bool change_slots(
int count);
175 std::vector<INDI::PropertyNumber> AngleNP;
176 int m_angles_defined {0};
185 int m_marked_slot {0};
199 int m_unsaved_slot {0};
200 double m_live_angle {0.0};
201 bool m_angles_stale {
false};
203 void mark_current_slot();
204 void forget_unsaved();
208 void refresh_angles();
209 void redefine_calibration();
210 void define_angles();
211 void delete_angles();
212 void set_angle(
int slot,
double value);
214 void note_angle_change(
int slot,
double before,
double after,
const char *what);
221 bool save_to_wheel();
231 static const int JOG_PER_ROW = 4;
234 bool m_jogging {
false};
237 ISState *states,
char *names[],
int n);
239 void finish_jog(
const Fields &status,
const std::string &outcome);
258 void read_direction(
bool warn);
261 void take_ceiling(
const Fields &reply,
bool warn);
264 double move_ceiling_s()
const;
267 void read_led_mode();
278 enum FileRow { FILE_LOG, FILE_SWEEP, FILE_COUNT };
298 static bool link_is_gone(
int error_number);
299 void link_lost(
const std::string &why);
300 bool try_reconnect();
301 void link_found(
const std::string &path);
302 void remember_alias();
303 bool m_link_lost {
false};
304 bool m_reconnecting {
false};
305 double m_next_attempt {0.0};
306 double m_retry_pause_s {0.0};
314 std::string m_port_in_use;
318 bool m_moving {
false};
319 double m_move_start {0.0};
320 double m_wheel_ceiling_s {0.0};
321 bool m_magnet_lost {
false};
325 bool m_show_comments {
false};
326 std::FILE *m_log {
nullptr};
328 bool m_sweeping {
false};
329 int m_sweep_remaining {0};
330 std::vector<wheelly::Sample> m_samples;
334 std::string m_expected_serial;
335 bool m_only_mine {
false};
336 bool m_serial_to_save {
false};
340 std::string suggest_name(
const char *text,
int slot);
bool channel_down() const
bool line(std::string &out, int wait_ms)
void attach(int descriptor)
bool SelectFilter(int slot) override
Select a new filter position.
int QueryFilter() override
Return current filter position.
bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
void TimerHit() override
Callback function to be called once SetTimer duration elapses.
bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
bool GetFilterNames() override
Obtains a list of filter names from the hardware and initializes the FilterNameTP property....
virtual ~Wheelly() override=default
bool Handshake() override
perform handshake with device to check communication
const char * getDefaultName() override
bool SetFilterNames() override
Set filter names as defined by the client for each filter position. The desired filter names are stor...
bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
bool Disconnect() override
Disconnect from device.