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 setSeqPrefix(
const QString &preFix)
115 void setPlaceholderPath(
const Ekos::PlaceholderPath &php)
117 placeholderPath = php;
119 void setNextSequenceID(
int count)
121 nextSequenceID = count;
127 return gainN !=
nullptr;
129 bool getGain(
double *value);
130 IPerm getGainPermission()
const
134 bool setGain(
double value);
135 bool getGainMinMaxStep(
double *min,
double *max,
double *step);
140 return offsetN !=
nullptr;
142 bool getOffset(
double *value);
143 IPerm getOffsetPermission()
const
147 bool setOffset(
double value);
148 bool getOffsetMinMaxStep(
double *min,
double *max,
double *step);
151 bool configureRapidGuide(CameraChip *targetChip,
bool autoLoop,
bool sendImage =
false,
bool showMarker =
false);
152 bool setRapidGuide(CameraChip *targetChip,
bool enable);
155 void updateUploadSettings(
const QString &uploadDirectory,
const QString &uploadFile);
156 UploadMode getUploadMode();
157 bool setUploadMode(UploadMode mode);
160 const QString &getEncodingFormat()
const
162 return m_EncodingFormat;
164 bool setEncodingFormat(
const QString &value);
167 return m_EncodingFormats;
172 Q_SCRIPTABLE
void setStretchValues(
double shadows,
double midtones,
double highlights);
173 Q_SCRIPTABLE
void setAutoStretch();
174 Q_SCRIPTABLE
void toggleHiPSOverlay();
179 return m_CaptureFormats;
181 QString getCaptureFormat()
const;
182 bool setCaptureFormat(
const QString &format);
185 bool isBLOBEnabled();
186 bool setBLOBEnabled(
bool enable,
const QString &prop =
QString());
189 bool setVideoStreamEnabled(
bool enable);
190 bool resetStreamingFrame();
191 bool setStreamingFrame(
int x,
int y,
int w,
int h);
192 bool isStreamingEnabled();
193 bool setStreamExposure(
double duration);
194 bool getStreamExposure(
double *duration);
195 bool setStreamLimits(uint16_t maxBufferSize, uint16_t maxPreviewFPS);
198 bool setSERNameDirectory(
const QString &filename,
const QString &directory);
200 bool startRecording();
201 bool startDurationRecording(
double duration);
202 bool startFramesRecording(uint32_t frames);
203 bool stopRecording();
206 TelescopeType getTelescopeType()
208 return telescopeType;
210 bool setTelescopeType(TelescopeType type);
215 CameraChip *getChip(CameraChip::ChipType cType);
217 bool setFastExposureEnabled(
bool enable);
218 bool isFastExposureEnabled()
const
220 return m_FastExposureEnabled;
222 bool setFastCount(uint32_t count);
226 return m_ExposurePresets;
230 return m_ExposurePresetsMinMax;
234 void StreamWindowHidden();
236 void setBLOBManager(
const char *device, INDI::Property prop);
242 void newTemperatureValue(
double value);
243 void newExposureValue(
ISD::CameraChip *chip,
double value, IPState state);
244 void newGuideStarData(
ISD::CameraChip *chip,
double dx,
double dy,
double fit);
245 void newBLOBManager(INDI::Property prop);
247 void coolerToggled(
bool enabled);
250 void videoStreamToggled(
bool enabled);
251 void videoRecordToggled(
bool enabled);
252 void newFPS(
double instantFPS,
double averageFPS);
260 void processStream(INDI::Property prop);
261 bool generateFilename(
bool batch_mode,
const QString &extension,
QString *filename);
263 bool writeImageFile(
const QString &filename, INDI::Property prop,
bool is_fits);
264 bool WriteImageFileInternal(
const QString &filename,
char *buffer,
const size_t size);
270 bool HasGuideHead {
false };
271 bool HasCooler {
false };
272 bool CanCool {
false };
273 bool HasCoolerControl {
false };
274 bool HasVideoStream {
false };
275 bool m_FastExposureEnabled {
false };
277 Ekos::PlaceholderPath placeholderPath;
279 int nextSequenceID { 0 };
280 std::unique_ptr<StreamWG> streamWindow;
283 int normalTabID { -1 };
284 int calibrationTabID { -1 };
285 int focusTabID { -1 };
286 int guideTabID { -1 };
287 int alignTabID { -1 };
289 INDI::Property primaryCCDBLOB;
291 std::unique_ptr<CameraChip> primaryChip;
292 std::unique_ptr<CameraChip> guideChip;
293 std::unique_ptr<WSMedia> m_Media;
294 QString m_EncodingFormat {
"FITS"};
297 bool m_StreamingEnabled {
true};
298 int m_CaptureFormatIndex {-1};
299 TelescopeType telescopeType { TELESCOPE_UNKNOWN };
302 INumber *gainN {
nullptr };
303 IPerm gainPerm { IP_RO };
305 INumber *offsetN {
nullptr };
306 IPerm offsetPerm { IP_RO };
318 char *fileWriteBuffer {
nullptr };
319 int fileWriteBufferSize { 0 };