9 #include "indiconcretedevice.h"
10 #include "indicamerachip.h"
13 #include "auxiliary/imageviewer.h"
14 #include "fitsviewer/fitsdata.h"
15 #include "fitsviewer/fitsviewer.h"
16 #include "ekos/capture/placeholderpath.h"
18 #include <QStringList>
20 #include <QtConcurrent>
49 Q_PROPERTY(
bool StreamingEnabled MEMBER m_StreamingEnabled)
53 virtual ~
Camera()
override;
55 typedef enum { UPLOAD_CLIENT, UPLOAD_LOCAL, UPLOAD_BOTH } UploadMode;
64 typedef enum { TELESCOPE_PRIMARY, TELESCOPE_GUIDE, TELESCOPE_UNKNOWN } TelescopeType;
73 void registerProperty(INDI::Property prop)
override;
74 void removeProperty(INDI::Property prop)
override;
76 void processSwitch(INDI::Property prop)
override;
77 void processText(INDI::Property prop)
override;
78 void processNumber(INDI::Property prop)
override;
79 bool processBLOB(INDI::Property prop)
override;
91 bool hasCoolerControl();
92 bool setCoolerControl(
bool enable);
97 return HasVideoStream;
101 bool getTemperature(
double *value);
102 bool setTemperature(
double value);
105 bool getTemperatureRegulation(
double &ramp,
double &threshold);
106 bool setTemperatureRegulation(
double ramp,
double threshold);
108 bool setScopeInfo(
double focalLength,
double aperture);
111 void setISOMode(
bool enable)
115 void setSeqPrefix(
const QString &preFix)
119 void setPlaceholderPath(
const Ekos::PlaceholderPath &php)
121 placeholderPath = php;
123 void setNextSequenceID(
int count)
125 nextSequenceID = count;
131 return gainN !=
nullptr;
133 bool getGain(
double *value);
134 IPerm getGainPermission()
const
138 bool setGain(
double value);
139 bool getGainMinMaxStep(
double *min,
double *max,
double *step);
144 return offsetN !=
nullptr;
146 bool getOffset(
double *value);
147 IPerm getOffsetPermission()
const
151 bool setOffset(
double value);
152 bool getOffsetMinMaxStep(
double *min,
double *max,
double *step);
155 bool configureRapidGuide(CameraChip *targetChip,
bool autoLoop,
bool sendImage =
false,
bool showMarker =
false);
156 bool setRapidGuide(CameraChip *targetChip,
bool enable);
159 void updateUploadSettings(
const QString &remoteDir);
160 UploadMode getUploadMode();
161 bool setUploadMode(UploadMode mode);
164 const QString &getEncodingFormat()
const
166 return m_EncodingFormat;
168 bool setEncodingFormat(
const QString &value);
171 return m_EncodingFormats;
177 return m_CaptureFormats;
179 QString getCaptureFormat()
const;
180 bool setCaptureFormat(
const QString &format);
183 bool isBLOBEnabled();
184 bool setBLOBEnabled(
bool enable,
const QString &prop =
QString());
187 bool setVideoStreamEnabled(
bool enable);
188 bool resetStreamingFrame();
189 bool setStreamingFrame(
int x,
int y,
int w,
int h);
190 bool isStreamingEnabled();
191 bool setStreamExposure(
double duration);
192 bool getStreamExposure(
double *duration);
193 bool setStreamLimits(uint16_t maxBufferSize, uint16_t maxPreviewFPS);
196 bool setSERNameDirectory(
const QString &filename,
const QString &directory);
198 bool startRecording();
199 bool startDurationRecording(
double duration);
200 bool startFramesRecording(uint32_t frames);
201 bool stopRecording();
204 TelescopeType getTelescopeType()
206 return telescopeType;
208 bool setTelescopeType(TelescopeType type);
213 CameraChip *getChip(CameraChip::ChipType cType);
215 bool setFastExposureEnabled(
bool enable);
216 bool isFastExposureEnabled()
const
218 return m_FastExposureEnabled;
220 bool setFastCount(uint32_t count);
224 return m_ExposurePresets;
228 return m_ExposurePresetsMinMax;
233 void StreamWindowHidden();
235 void setBLOBManager(
const char *device, INDI::Property prop);
241 void newTemperatureValue(
double value);
242 void newExposureValue(
ISD::CameraChip *chip,
double value, IPState state);
243 void newGuideStarData(
ISD::CameraChip *chip,
double dx,
double dy,
double fit);
244 void newBLOBManager(INDI::Property prop);
246 void videoStreamToggled(
bool enabled);
247 void videoRecordToggled(
bool enabled);
248 void newFPS(
double instantFPS,
double averageFPS);
250 void coolerToggled(
bool enabled);
255 void processStream(INDI::Property prop);
256 bool generateFilename(
bool batch_mode,
const QString &extension,
QString *filename);
258 bool writeImageFile(
const QString &filename, INDI::Property prop,
bool is_fits);
259 bool WriteImageFileInternal(
const QString &filename,
char *buffer,
const size_t size);
264 bool ISOMode {
true };
265 bool HasGuideHead {
false };
266 bool HasCooler {
false };
267 bool CanCool {
false };
268 bool HasCoolerControl {
false };
269 bool HasVideoStream {
false };
270 bool m_FastExposureEnabled {
false };
272 Ekos::PlaceholderPath placeholderPath;
274 int nextSequenceID { 0 };
275 std::unique_ptr<StreamWG> streamWindow;
278 int normalTabID { -1 };
279 int calibrationTabID { -1 };
280 int focusTabID { -1 };
281 int guideTabID { -1 };
282 int alignTabID { -1 };
284 INDI::Property primaryCCDBLOB;
286 std::unique_ptr<CameraChip> primaryChip;
287 std::unique_ptr<CameraChip> guideChip;
288 std::unique_ptr<WSMedia> m_Media;
289 QString m_EncodingFormat {
"FITS"};
292 bool m_StreamingEnabled {
true};
293 int m_CaptureFormatIndex;
294 TelescopeType telescopeType { TELESCOPE_UNKNOWN };
297 INumber *gainN {
nullptr };
298 IPerm gainPerm { IP_RO };
300 INumber *offsetN {
nullptr };
301 IPerm offsetPerm { IP_RO };
313 char *fileWriteBuffer {
nullptr };
314 int fileWriteBufferSize { 0 };