61 virtual bool ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n)
override;
62 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
63 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
97 } __attribute__((packed));
107 std::string m_ConfigHost;
108 std::string m_ConfigPort;
111 bool m_ExposureInProgress {
false};
112 std::string m_CurrentReadoutModeName {
"0"};
113 int m_CurrentReadoutModeIndex {0};
114 uint32_t m_MaxADU { 0 };
115 uint8_t m_SensorType { 0 };
116 int m_CameraXSize {1}, m_CameraYSize {1};
117 double m_PixelSizeX {1.0}, m_PixelSizeY {1.0};
118 std::string m_Description, m_DriverInfo, m_DriverVersion, m_CameraName;
119 double m_GainMin {0}, m_GainMax {0};
120 uint8_t m_BayerOffsetX {0}, m_BayerOffsetY {0};
121 double m_ElectronsPerADU {0};
122 double m_FullWellCapacity {0};
125 std::unique_ptr<httplib::Client> httpClient;
126 bool sendAlpacaGET(
const std::string &endpoint,
nlohmann::json &response);
128 std::string getAlpacaURL(
const std::string &endpoint);
129 uint32_t m_ClientTransactionID {1};
141 uint8_t bayer_offset_x;
142 uint8_t bayer_offset_y;
145 ImageMetadata m_CurrentImage;
146 bool alpacaGetImageReady();
147 bool alpacaGetImageArrayImageBytes(uint8_t** buffer,
size_t* buffer_size,
ImageBytesMetadata* metadata);
148 bool alpacaGetImageArrayJSON(ImageMetadata &meta, uint8_t** buffer,
size_t* buffer_size);
149 bool downloadImage();
150 bool processImageBytesData(uint8_t* buffer,
size_t buffer_size,
const ImageBytesMetadata &metadata);
151 bool processMonoImage(uint8_t* buffer);
152 bool processColorImage(uint8_t* buffer);
155 void convertImageBytesToINDI2D(uint8_t* src_buffer, uint16_t* dst_buffer, uint32_t width, uint32_t height,
156 int32_t transmission_type);
157 void convertImageBytesToINDI3D(uint8_t* src_buffer, uint16_t* dst_buffer, uint32_t width, uint32_t height, uint32_t planes,
158 int32_t transmission_type);
161 void translateCoordinates(uint8_t* buffer,
const ImageMetadata &meta);
162 virtual void addFITSKeywords(INDI::CCDChip * targetChip, std::vector<INDI::FITSRecord> &fitsKeywords)
override;
165 INDI::SingleThreadPool mWorker;
166 void workerExposure(
const std::atomic_bool &isAboutToQuit,
float duration);
169 void updateCoolerStatus();
170 void updateCameraState();
171 void updateReadoutModes();
172 void updateCameraCapabilities();
175 std::string getSensorTypeString(uint8_t sensorType);
177 INDI::PropertyText ServerAddressTP {2};
178 INDI::PropertyNumber DeviceNumberNP {1};
179 INDI::PropertyNumber ConnectionSettingsNP {3};
181 INDI::PropertyNumber GainNP {1};
182 INDI::PropertyNumber OffsetNP {1};
183 INDI::PropertyNumber CoolerPowerNP {1};
187 INDI::PropertySwitch GainSP {0};
188 INDI::PropertySwitch OffsetSP {0};
189 bool m_GainIsList {
false};
190 bool m_OffsetIsList {
false};
193 INDI::PropertySwitch FastReadoutSP {2};
194 enum { FAST_READOUT_ENABLE, FAST_READOUT_DISABLE };
195 bool m_HasFastReadout {
false};
197 INDI::PropertyText DeviceInfoTP {4};
199 INDI::PropertySwitch CoolerSP {2};
200 INDI::PropertyText CameraStateTP {1};
201 INDI::PropertySwitch ReadoutModeSP {0};
203 bool m_HasGain {
false};
204 bool m_HasOffset {
false};
205 bool m_CanPulseGuide {
false};
206 bool m_CanAbortExposure {
false};
207 bool m_CanStopExposure {
false};
208 bool m_CanAsymmetricBin {
false};
209 bool m_HasCoolerPower {
false};
210 bool m_HasPercentCompleted {
true};
211 bool m_HasLastExposureDuration {
true};
214 bool m_PulseGuiding {
false};
218 INDI::Timer mTimerTemperature;
219 void temperatureTimerTimeout();
220 double m_CurrentTemperature {0};
221 double m_TargetTemperature {std::numeric_limits<double>::quiet_NaN()};
223 static const constexpr char* CONNECTION_TAB =
"Connection";
224 static constexpr int TEMP_TIMER_MS = 10000;
226 static constexpr double TEMP_THRESHOLD = 0.25;