9#include "ui_filtersettings.h"
11#include "ekos/focus/focusutils.h"
13#include <indi/indifilterwheel.h>
14#include <indi/indifocuser.h>
15#include <oal/filter.h>
19#include <QStandardItemModel>
23class NotEditableDelegate;
24class NotEditableDelegate2dp;
32class FilterManager :
public QDialog,
public Ui::FilterSettings
37 friend class BuildFilterOffsets;
43 CHANGE_POLICY = 1 << 0,
44 OFFSET_POLICY = 1 << 1,
45 AUTOFOCUS_POLICY = 1 << 2,
46 ALL_POLICIES = CHANGE_POLICY | OFFSET_POLICY | AUTOFOCUS_POLICY,
47 NO_AUTOFOCUS_POLICY = CHANGE_POLICY | OFFSET_POLICY
70 void createFilterModel();
71 void refreshFilterModel();
73 QStringList getFilterLabels(
bool forceRefresh =
false);
74 int getFilterPosition(
bool forceRefresh =
false);
78 void refreshFilterLabels();
82 void refreshFilterPosition();
85 int getTargetFilterPosition()
87 return targetFilterPosition;
89 int getTargetFilterOffset()
91 return targetFilterOffset;
102 bool setFilterAbsoluteFocusDetails(
int index,
int focusPos,
double focusTemp,
double focusAlt);
112 bool getFilterAbsoluteFocusDetails(
const QString &name,
int &focusPos,
double &focusTemp,
double &focusAlt)
const;
115 bool syncAbsoluteFocusPosition(
int index);
123 bool setFilterExposure(
int index,
double exposure);
130 int getFilterOffset(
const QString &name)
const;
138 bool setFilterOffset(
QString color,
int offset);
152 double getFilterTicksPerTemp(
const QString &name =
QString())
const;
159 double getFilterTicksPerAlt(
const QString &name =
QString())
const;
170 bool setFilterLock(
int index,
QString name);
176 void setFilterWheel(ISD::FilterWheel *filter);
177 ISD::FilterWheel *filterWheel()
const
179 return m_FilterWheel;
186 void setFocusReady(
bool enabled)
195 void applyFilterFocusPolicies();
201 void buildFilterOffsets();
205 bool setFilterPosition(uint8_t position, Ekos::FilterManager::FilterPolicy policy = ALL_POLICIES);
209 void setFocusOffsetComplete();
213 void reloadFilters();
217 void setFocusStatus(Ekos::FocusState focusState);
219 void setFocusAbsolutePosition(
int value)
221 m_FocusAbsPosition = value;
224 void refreshFilterProperties();
226 void signalRunAutoFocus(AutofocusReason autofocusReason,
const QString &reasonInfo);
228 void signalAbortAutoFocus();
230 void autoFocusComplete(FocusState completionState,
int currentPosition,
double currentTemperature,
double currentAlt);
234 void positionChanged(
int);
238 void exposureChanged(
double);
244 void newStatus(Ekos::FilterState state);
246 void runAutoFocus(AutofocusReason autofocusReason,
const QString &reasonInfo);
248 void abortAutoFocus();
250 void newFocusOffset(
int value,
bool useAbsoluteOffset);
254 void ticksPerTempChanged();
256 void ticksPerAltChanged();
258 void wavelengthChanged();
260 void autoFocusDone(FocusState completionState,
int currentPosition,
double currentTemperature,
double currentAlt);
263 void updateProperty(INDI::Property prop);
264 void processDisconnect();
269 ISD::FilterWheel *m_FilterWheel = {
nullptr };
273 int m_currentFilterPosition = { -1 };
274 double m_currentFilterExposure = { -1 };
280 bool m_useTargetFilter = {
false };
283 uint8_t retries = { 0 };
285 int16_t lastFilterOffset { 0 };
291 ITextVectorProperty *m_FilterNameProperty {
nullptr };
292 INumberVectorProperty *m_FilterPositionProperty {
nullptr };
293 ISwitchVectorProperty *m_FilterConfirmSet {
nullptr };
300 void buildOperationQueue(FilterState operation);
301 bool executeOperationQueue();
302 bool executeOneOperation(FilterState operation);
305 void checkFilterChangeTimeout();
317 FilterState state = { FILTER_IDLE };
319 int targetFilterPosition { -1 };
320 int targetFilterOffset { - 1 };
321 QTimer m_FilterChangeTimeout;
323 bool m_FocusReady {
false };
324 bool m_FocusAbsPositionPending {
false};
325 int m_FocusAbsPosition { -1 };
341 FilterPolicy m_Policy = { ALL_POLICIES };
343 bool m_ConfirmationPending {
false };
Information of user filters.
Ekos is an advanced Astrophotography tool for Linux.
QObject * parent() const const