Kstars

filter.h
1/*
2 SPDX-FileCopyrightText: 2009 Prakash Mohan <prakash.mohan@kdemail.net>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6#pragma once
7
8#include "oal/oal.h"
9#include <QString>
10#include <QDateTime>
11#include "ekos/ekos.h"
12
13#define NULL_FILTER "--"
14#define DATETIME_FORMAT "yyyy-MM-dd hh:mm:ss"
15
16struct filterProperties
17{
18 QString vendor;
19 QString model;
20 QString type;
21 QString color;
22 int offset;
23 double exposure;
24 bool useAutoFocus;
25 QString lockedFilter;
26 int absFocusPos;
27 double focusTemperature;
28 double focusAltitude;
29 QString focusDatetime;
30 double focusTicksPerTemp;
31 double focusTicksPerAlt;
32 double wavelength;
33
34 filterProperties(QString _vendor, QString _model, QString _type, QString _color,
35 int _offset = 0, double _exposure = 1.0, bool _useAutoFocus = false, QString _lockedFilter = NULL_FILTER,
36 int _absFocusPos = 0, double _focusTemperature = Ekos::INVALID_VALUE, double _focusAltitude = Ekos::INVALID_VALUE,
37 QString _focusDatetime = "", double _focusTicksPerTemp = 0.0, double _focusTicksPerAlt = 0.0, double _wavelength = 500.0) :
38 vendor(_vendor), model(_model), type(_type), color(_color),
39 offset(_offset), exposure(_exposure), useAutoFocus(_useAutoFocus), lockedFilter(_lockedFilter),
40 absFocusPos(_absFocusPos), focusTemperature(_focusTemperature), focusAltitude(_focusAltitude), focusDatetime(_focusDatetime),
41 focusTicksPerTemp(_focusTicksPerTemp), focusTicksPerAlt(_focusTicksPerAlt), wavelength(_wavelength) {}
42};
43
44/**
45 * @class OAL::Filter
46 *
47 * Information of user filters
48 */
49
51{
52 public:
53 Filter(const QString &id, const filterProperties *fp);
54
55 QString id() const
56 {
57 return m_Id;
58 }
59 QString name() const
60 {
61 return m_Name;
62 }
63 QString model() const
64 {
65 return m_Model;
66 }
67 QString vendor() const
68 {
69 return m_Vendor;
70 }
71 QString type() const
72 {
73 return m_Type;
74 }
75 QString color() const
76 {
77 return m_Color;
78 }
79
80 // Additional fields used by Ekos
81 int offset() const
82 {
83 return m_Offset;
84 }
85 void setOffset(int _offset)
86 {
87 m_Offset = _offset;
88 }
89
90 double exposure() const
91 {
92 return m_Exposure;
93 }
94 void setExposure(double _exposure)
95 {
96 m_Exposure = _exposure;
97 }
98
99 QString lockedFilter() const
100 {
101 return m_LockedFilter;
102 }
103 void setLockedFilter(const QString &_filter)
104 {
105 m_LockedFilter = _filter;
106 }
107
108 bool useAutoFocus() const
109 {
110 return m_UseAutoFocus;
111 }
112 void setUseAutoFocus(bool enabled)
113 {
114 m_UseAutoFocus = enabled;
115 }
116
117 int absoluteFocusPosition()
118 {
119 return m_AbsoluteFocusPosition;
120 }
121 void setAbsoluteFocusPosition(int newAbsFocusPos)
122 {
123 m_AbsoluteFocusPosition = newAbsFocusPos;
124 }
125
126 double focusTemperature()
127 {
128 return m_FocusTemperature;
129 }
130 void setFocusTemperature(double newFocusTemperature)
131 {
132 m_FocusTemperature = newFocusTemperature;
133 }
134
135 double focusAltitude()
136 {
137 return m_FocusAltitude;
138 }
139 void setFocusAltitude(double newFocusAltitude)
140 {
141 m_FocusAltitude = newFocusAltitude;
142 }
143
144 QDateTime focusDatetime()
145 {
146 return QDateTime::fromString(m_FocusDatetime, DATETIME_FORMAT);
147 }
148 void setFocusDatetime(QDateTime newFocusDatetime)
149 {
150 m_FocusDatetime = newFocusDatetime.toString(DATETIME_FORMAT);
151 }
152
153 double focusTicksPerTemp()
154 {
155 return m_FocusTicksPerTemp;
156 }
157 void setFocusTicksPerTemp(double newFocusTicksPerTemp)
158 {
159 m_FocusTicksPerTemp = newFocusTicksPerTemp;
160 }
161
162 double focusTicksPerAlt()
163 {
164 return m_FocusTicksPerAlt;
165 }
166 void setFocusTicksPerAlt(double newFocusTicksPerAlt)
167 {
168 m_FocusTicksPerAlt = newFocusTicksPerAlt;
169 }
170
171 double wavelength()
172 {
173 return m_Wavelength;
174 }
175 void setWavelength(double newWavelength)
176 {
177 m_Wavelength = newWavelength;
178 }
179
180 private:
181 QString m_Id, m_Model, m_Vendor, m_Type, m_Color, m_Name, m_LockedFilter;
182 int m_Offset { 0 };
183 int m_AbsoluteFocusPosition { 0 };
184 double m_Exposure { 1.0 };
185 bool m_UseAutoFocus { false };
186 double m_FocusTemperature { 0 };
187 double m_FocusAltitude { 0 };
188 QString m_FocusDatetime { "" };
189 double m_FocusTicksPerTemp { 0 };
190 double m_FocusTicksPerAlt { 0 };
191 double m_Wavelength { 0 };
192};
Information of user filters.
Definition filter.h:51
QDateTime fromString(QStringView string, QStringView format, QCalendar cal)
QString toString(QStringView format, QCalendar cal) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:54:28 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.