Merge lp:~stolowski/stellarium/oculars-barlow-lens into lp:stellarium
- oculars-barlow-lens
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Alexander Wolf |
Approved revision: | 5764 |
Merged at revision: | 5788 |
Proposed branch: | lp:~stolowski/stellarium/oculars-barlow-lens |
Merge into: | lp:stellarium |
Diff against target: |
1356 lines (+698/-26) 14 files modified
data/gui/nightStyle.css (+2/-2) data/gui/normalStyle.css (+2/-2) plugins/Oculars/src/Barlow.cpp (+92/-0) plugins/Oculars/src/Barlow.hpp (+53/-0) plugins/Oculars/src/CMakeLists.txt (+2/-1) plugins/Oculars/src/Ocular.cpp (+8/-5) plugins/Oculars/src/Ocular.hpp (+3/-2) plugins/Oculars/src/Oculars.cpp (+138/-5) plugins/Oculars/src/Oculars.hpp (+17/-2) plugins/Oculars/src/gui/OcularDialog.cpp (+64/-1) plugins/Oculars/src/gui/OcularDialog.hpp (+10/-1) plugins/Oculars/src/gui/OcularsGuiPanel.cpp (+139/-4) plugins/Oculars/src/gui/OcularsGuiPanel.hpp (+8/-1) plugins/Oculars/src/gui/ocularDialog.ui (+160/-0) |
To merge this branch: | bzr merge lp:~stolowski/stellarium/oculars-barlow-lens |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexander Wolf | Approve | ||
Review via email: mp+145210@code.launchpad.net |
Commit message
Implementation of barlow lens for Oculars plugin.
Description of the change
Implementation of barlow lens for Oculars plugin. Barlow lenses can be managed via ocular config dialog (see http://
This change introduces new "barlow" section in the settings file, but this section is optional. No barlow is defined by default (that was intended, but I can add one in the default .ini if desired, though this would affect only new installations).
Other than that, this patch introduces new strings for translators.
- 5764. By Paweł Stołowski
-
Reverted some unintended changes to the .ui file.
Alexander Wolf (alexwolf) : | # |
Preview Diff
1 | === modified file 'data/gui/nightStyle.css' | |||
2 | --- data/gui/nightStyle.css 2012-10-05 13:00:30 +0000 | |||
3 | +++ data/gui/nightStyle.css 2013-01-28 17:20:27 +0000 | |||
4 | @@ -235,11 +235,11 @@ | |||
5 | 235 | image: url(:/graphicGui/nv_searchButtonImage.png); | 235 | image: url(:/graphicGui/nv_searchButtonImage.png); |
6 | 236 | } | 236 | } |
7 | 237 | 237 | ||
9 | 238 | QPushButton#pushButtonMoveSensorUp, QPushButton#pushButtonMoveOcularUp, QPushButton#pushButtonMoveTelescopeUp { | 238 | QPushButton#pushButtonMoveSensorUp, QPushButton#pushButtonMoveOcularUp, QPushButton#pushButtonMoveTelescopeUp, QPushButton#pushButtonMoveBarlowUp { |
10 | 239 | image: url(:/graphicGui/nv_spinup.png); | 239 | image: url(:/graphicGui/nv_spinup.png); |
11 | 240 | } | 240 | } |
12 | 241 | 241 | ||
14 | 242 | QPushButton#pushButtonMoveSensorDown, QPushButton#pushButtonMoveOcularDown, QPushButton#pushButtonMoveTelescopeDown { | 242 | QPushButton#pushButtonMoveSensorDown, QPushButton#pushButtonMoveOcularDown, QPushButton#pushButtonMoveTelescopeDown, QPushButton#pushButtonMoveBarlowDown { |
15 | 243 | image: url(:/graphicGui/nv_spindown.png); | 243 | image: url(:/graphicGui/nv_spindown.png); |
16 | 244 | } | 244 | } |
17 | 245 | 245 | ||
18 | 246 | 246 | ||
19 | === modified file 'data/gui/normalStyle.css' | |||
20 | --- data/gui/normalStyle.css 2012-10-05 13:00:30 +0000 | |||
21 | +++ data/gui/normalStyle.css 2013-01-28 17:20:27 +0000 | |||
22 | @@ -243,11 +243,11 @@ | |||
23 | 243 | background-image: url(:/graphicGui/closeButton-hover.png); | 243 | background-image: url(:/graphicGui/closeButton-hover.png); |
24 | 244 | } | 244 | } |
25 | 245 | 245 | ||
27 | 246 | QPushButton#pushButtonMoveSensorUp, QPushButton#pushButtonMoveOcularUp, QPushButton#pushButtonMoveTelescopeUp { | 246 | QPushButton#pushButtonMoveSensorUp, QPushButton#pushButtonMoveOcularUp, QPushButton#pushButtonMoveTelescopeUp, QPushButton#pushButtonMoveBarlowUp { |
28 | 247 | image: url(:/graphicGui/spinup.png); | 247 | image: url(:/graphicGui/spinup.png); |
29 | 248 | } | 248 | } |
30 | 249 | 249 | ||
32 | 250 | QPushButton#pushButtonMoveSensorDown, QPushButton#pushButtonMoveOcularDown, QPushButton#pushButtonMoveTelescopeDown { | 250 | QPushButton#pushButtonMoveSensorDown, QPushButton#pushButtonMoveOcularDown, QPushButton#pushButtonMoveTelescopeDown, QPushButton#pushButtonMoveBarlowDown { |
33 | 251 | image: url(:/graphicGui/spindown.png); | 251 | image: url(:/graphicGui/spindown.png); |
34 | 252 | } | 252 | } |
35 | 253 | 253 | ||
36 | 254 | 254 | ||
37 | === added file 'plugins/Oculars/src/Barlow.cpp' | |||
38 | --- plugins/Oculars/src/Barlow.cpp 1970-01-01 00:00:00 +0000 | |||
39 | +++ plugins/Oculars/src/Barlow.cpp 2013-01-28 17:20:27 +0000 | |||
40 | @@ -0,0 +1,92 @@ | |||
41 | 1 | /* | ||
42 | 2 | * Copyright (C) 2009 Timothy Reaves | ||
43 | 3 | * Copytight (C) 2013 Pawel Stolowski | ||
44 | 4 | * | ||
45 | 5 | * This program is free software; you can redistribute it and/or | ||
46 | 6 | * modify it under the terms of the GNU General Public License | ||
47 | 7 | * as published by the Free Software Foundation; either version 2 | ||
48 | 8 | * of the License, or (at your option) any later version. | ||
49 | 9 | * | ||
50 | 10 | * This program is distributed in the hope that it will be useful, | ||
51 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
52 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
53 | 13 | * GNU General Public License for more details. | ||
54 | 14 | * | ||
55 | 15 | * You should have received a copy of the GNU General Public License | ||
56 | 16 | * along with this program; if not, write to the Free Software | ||
57 | 17 | * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. | ||
58 | 18 | */ | ||
59 | 19 | |||
60 | 20 | #include "Barlow.hpp" | ||
61 | 21 | #include <QSettings> | ||
62 | 22 | |||
63 | 23 | Barlow::Barlow() | ||
64 | 24 | { | ||
65 | 25 | } | ||
66 | 26 | |||
67 | 27 | Barlow::Barlow(const QObject& other) | ||
68 | 28 | { | ||
69 | 29 | this->m_multipler = other.property("multipler").toDouble(); | ||
70 | 30 | this->m_name = other.property("name").toString(); | ||
71 | 31 | } | ||
72 | 32 | |||
73 | 33 | Barlow::~Barlow() | ||
74 | 34 | { | ||
75 | 35 | } | ||
76 | 36 | |||
77 | 37 | static QMap<int, QString> mapping; | ||
78 | 38 | QMap<int, QString> Barlow::propertyMap() | ||
79 | 39 | { | ||
80 | 40 | if(mapping.isEmpty()) { | ||
81 | 41 | mapping = QMap<int, QString>(); | ||
82 | 42 | mapping[0] = "name"; | ||
83 | 43 | mapping[1] = "multipler"; | ||
84 | 44 | } | ||
85 | 45 | return mapping; | ||
86 | 46 | } | ||
87 | 47 | |||
88 | 48 | const QString Barlow::name() const | ||
89 | 49 | { | ||
90 | 50 | return m_name; | ||
91 | 51 | } | ||
92 | 52 | |||
93 | 53 | void Barlow::setName(const QString& theValue) | ||
94 | 54 | { | ||
95 | 55 | m_name = theValue; | ||
96 | 56 | } | ||
97 | 57 | |||
98 | 58 | double Barlow::multipler() const | ||
99 | 59 | { | ||
100 | 60 | return m_multipler; | ||
101 | 61 | } | ||
102 | 62 | |||
103 | 63 | void Barlow::setMultipler(double theValue) | ||
104 | 64 | { | ||
105 | 65 | m_multipler = theValue; | ||
106 | 66 | } | ||
107 | 67 | |||
108 | 68 | /* ********************************************************************* */ | ||
109 | 69 | #if 0 | ||
110 | 70 | #pragma mark - | ||
111 | 71 | #pragma mark Static Methods | ||
112 | 72 | #endif | ||
113 | 73 | /* ********************************************************************* */ | ||
114 | 74 | |||
115 | 75 | Barlow* Barlow:: barlowFromSettings(QSettings* theSettings, int barlowIndex) | ||
116 | 76 | { | ||
117 | 77 | Barlow* barlow = new Barlow(); | ||
118 | 78 | QString prefix = "barlow/" + QVariant(barlowIndex).toString() + "/"; | ||
119 | 79 | |||
120 | 80 | barlow->setName(theSettings->value(prefix + "name", "").toString()); | ||
121 | 81 | barlow->setMultipler(theSettings->value(prefix + "multipler", "1").toDouble()); | ||
122 | 82 | |||
123 | 83 | return barlow; | ||
124 | 84 | } | ||
125 | 85 | |||
126 | 86 | Barlow* Barlow::barlowModel() | ||
127 | 87 | { | ||
128 | 88 | Barlow* model = new Barlow(); | ||
129 | 89 | model->setName("My Barlow"); | ||
130 | 90 | model->setMultipler(2.0f); | ||
131 | 91 | return model; | ||
132 | 92 | } | ||
133 | 0 | 93 | ||
134 | === added file 'plugins/Oculars/src/Barlow.hpp' | |||
135 | --- plugins/Oculars/src/Barlow.hpp 1970-01-01 00:00:00 +0000 | |||
136 | +++ plugins/Oculars/src/Barlow.hpp 2013-01-28 17:20:27 +0000 | |||
137 | @@ -0,0 +1,53 @@ | |||
138 | 1 | /* | ||
139 | 2 | * Copyright (C) 2009 Timothy Reaves | ||
140 | 3 | * Copytight (C) 2013 Pawel Stolowski | ||
141 | 4 | * | ||
142 | 5 | * This program is free software; you can redistribute it and/or | ||
143 | 6 | * modify it under the terms of the GNU General Public License | ||
144 | 7 | * as published by the Free Software Foundation; either version 2 | ||
145 | 8 | * of the License, or (at your option) any later version. | ||
146 | 9 | * | ||
147 | 10 | * This program is distributed in the hope that it will be useful, | ||
148 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
149 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
150 | 13 | * GNU General Public License for more details. | ||
151 | 14 | * | ||
152 | 15 | * You should have received a copy of the GNU General Public License | ||
153 | 16 | * along with this program; if not, write to the Free Software | ||
154 | 17 | * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. | ||
155 | 18 | */ | ||
156 | 19 | |||
157 | 20 | #ifndef BARLOW_HPP_ | ||
158 | 21 | #define BARLOW_HPP_ | ||
159 | 22 | |||
160 | 23 | #include <QObject> | ||
161 | 24 | #include <QString> | ||
162 | 25 | #include <QMap> | ||
163 | 26 | |||
164 | 27 | class QSettings; | ||
165 | 28 | |||
166 | 29 | class Barlow : public QObject | ||
167 | 30 | { | ||
168 | 31 | Q_OBJECT | ||
169 | 32 | Q_PROPERTY(QString name READ name WRITE setName) | ||
170 | 33 | Q_PROPERTY(double multipler READ multipler WRITE setMultipler) | ||
171 | 34 | |||
172 | 35 | public: | ||
173 | 36 | Barlow(); | ||
174 | 37 | Q_INVOKABLE Barlow(const QObject& other); | ||
175 | 38 | virtual ~Barlow(); | ||
176 | 39 | static Barlow* barlowFromSettings(QSettings* theSettings, int barlowIndex); | ||
177 | 40 | static Barlow* barlowModel(); | ||
178 | 41 | |||
179 | 42 | double multipler() const; | ||
180 | 43 | void setMultipler(double theValue); | ||
181 | 44 | const QString name() const; | ||
182 | 45 | void setName(const QString& theValue); | ||
183 | 46 | QMap<int, QString> propertyMap(); | ||
184 | 47 | |||
185 | 48 | private: | ||
186 | 49 | QString m_name; | ||
187 | 50 | double m_multipler; | ||
188 | 51 | }; | ||
189 | 52 | |||
190 | 53 | #endif | ||
191 | 0 | 54 | ||
192 | === modified file 'plugins/Oculars/src/CMakeLists.txt' | |||
193 | --- plugins/Oculars/src/CMakeLists.txt 2012-12-06 15:00:12 +0000 | |||
194 | +++ plugins/Oculars/src/CMakeLists.txt 2013-01-28 17:20:27 +0000 | |||
195 | @@ -9,6 +9,8 @@ | |||
196 | 9 | SET(Oculars_SRCS | 9 | SET(Oculars_SRCS |
197 | 10 | CCD.hpp | 10 | CCD.hpp |
198 | 11 | CCD.cpp | 11 | CCD.cpp |
199 | 12 | Barlow.hpp | ||
200 | 13 | Barlow.cpp | ||
201 | 12 | Ocular.hpp | 14 | Ocular.hpp |
202 | 13 | Ocular.cpp | 15 | Ocular.cpp |
203 | 14 | Oculars.hpp | 16 | Oculars.hpp |
204 | @@ -73,4 +75,3 @@ | |||
205 | 73 | SET_TARGET_PROPERTIES(Oculars-static PROPERTIES COMPILE_FLAGS "-DQT_STATICPLUGIN") | 75 | SET_TARGET_PROPERTIES(Oculars-static PROPERTIES COMPILE_FLAGS "-DQT_STATICPLUGIN") |
206 | 74 | ADD_DEPENDENCIES(AllStaticPlugins Oculars-static) | 76 | ADD_DEPENDENCIES(AllStaticPlugins Oculars-static) |
207 | 75 | ENDIF() | 77 | ENDIF() |
208 | 76 | |||
209 | 77 | 78 | ||
210 | === modified file 'plugins/Oculars/src/Ocular.cpp' | |||
211 | --- plugins/Oculars/src/Ocular.cpp 2012-01-11 10:50:37 +0000 | |||
212 | +++ plugins/Oculars/src/Ocular.cpp 2013-01-28 17:20:27 +0000 | |||
213 | @@ -18,6 +18,7 @@ | |||
214 | 18 | 18 | ||
215 | 19 | #include "Ocular.hpp" | 19 | #include "Ocular.hpp" |
216 | 20 | #include "Telescope.hpp" | 20 | #include "Telescope.hpp" |
217 | 21 | #include "Barlow.hpp" | ||
218 | 21 | 22 | ||
219 | 22 | Ocular::Ocular() | 23 | Ocular::Ocular() |
220 | 23 | { | 24 | { |
221 | @@ -57,27 +58,29 @@ | |||
222 | 57 | #pragma mark Instance Methods | 58 | #pragma mark Instance Methods |
223 | 58 | #endif | 59 | #endif |
224 | 59 | /* ********************************************************************* */ | 60 | /* ********************************************************************* */ |
226 | 60 | double Ocular::actualFOV(Telescope *telescope) const | 61 | double Ocular::actualFOV(Telescope *telescope, Barlow *barlow) const |
227 | 61 | { | 62 | { |
228 | 63 | const double barlow_multipler = (barlow != NULL ? barlow->multipler() : 1.0f); | ||
229 | 62 | double actualFOV = 0.0; | 64 | double actualFOV = 0.0; |
230 | 63 | if (m_binoculars) { | 65 | if (m_binoculars) { |
231 | 64 | actualFOV = appearentFOV(); | 66 | actualFOV = appearentFOV(); |
232 | 65 | } else if (fieldStop() > 0.0) { | 67 | } else if (fieldStop() > 0.0) { |
234 | 66 | actualFOV = fieldStop() / telescope->focalLength() * 57.3; | 68 | actualFOV = fieldStop() / (telescope->focalLength() * barlow_multipler) * 57.3; |
235 | 67 | } else { | 69 | } else { |
236 | 68 | //actualFOV = apparent / mag | 70 | //actualFOV = apparent / mag |
238 | 69 | actualFOV = appearentFOV() / (telescope->focalLength() / effectiveFocalLength()); | 71 | actualFOV = appearentFOV() / (telescope->focalLength() * barlow_multipler / effectiveFocalLength()); |
239 | 70 | } | 72 | } |
240 | 71 | return actualFOV; | 73 | return actualFOV; |
241 | 72 | } | 74 | } |
242 | 73 | 75 | ||
244 | 74 | double Ocular::magnification(Telescope *telescope) const | 76 | double Ocular::magnification(Telescope *telescope, Barlow *barlow) const |
245 | 75 | { | 77 | { |
246 | 76 | double magnifiction = 0.0; | 78 | double magnifiction = 0.0; |
247 | 77 | if (m_binoculars) { | 79 | if (m_binoculars) { |
248 | 78 | magnifiction = effectiveFocalLength(); | 80 | magnifiction = effectiveFocalLength(); |
249 | 79 | } else { | 81 | } else { |
251 | 80 | magnifiction = telescope->focalLength() / effectiveFocalLength(); | 82 | const double barlow_multipler = (barlow != NULL ? barlow->multipler() : 1.0f); |
252 | 83 | magnifiction = telescope->focalLength() * barlow_multipler / effectiveFocalLength(); | ||
253 | 81 | } | 84 | } |
254 | 82 | return magnifiction; | 85 | return magnifiction; |
255 | 83 | } | 86 | } |
256 | 84 | 87 | ||
257 | === modified file 'plugins/Oculars/src/Ocular.hpp' | |||
258 | --- plugins/Oculars/src/Ocular.hpp 2012-01-11 10:50:37 +0000 | |||
259 | +++ plugins/Oculars/src/Ocular.hpp 2013-01-28 17:20:27 +0000 | |||
260 | @@ -25,6 +25,7 @@ | |||
261 | 25 | #include <QSettings> | 25 | #include <QSettings> |
262 | 26 | 26 | ||
263 | 27 | class Telescope; | 27 | class Telescope; |
264 | 28 | class Barlow; | ||
265 | 28 | 29 | ||
266 | 29 | class Ocular : public QObject | 30 | class Ocular : public QObject |
267 | 30 | { | 31 | { |
268 | @@ -52,8 +53,8 @@ | |||
269 | 52 | bool isBinoculars() const; | 53 | bool isBinoculars() const; |
270 | 53 | void setBinoculars(bool flag); | 54 | void setBinoculars(bool flag); |
271 | 54 | 55 | ||
274 | 55 | double actualFOV(Telescope *telescope) const; | 56 | double actualFOV(Telescope *telescope, Barlow *barlow) const; |
275 | 56 | double magnification(Telescope *telescope) const; | 57 | double magnification(Telescope *telescope, Barlow *barlow) const; |
276 | 57 | QMap<int, QString> propertyMap(); | 58 | QMap<int, QString> propertyMap(); |
277 | 58 | 59 | ||
278 | 59 | private: | 60 | private: |
279 | 60 | 61 | ||
280 | === modified file 'plugins/Oculars/src/Oculars.cpp' | |||
281 | --- plugins/Oculars/src/Oculars.cpp 2013-01-07 13:54:44 +0000 | |||
282 | +++ plugins/Oculars/src/Oculars.cpp 2013-01-28 17:20:27 +0000 | |||
283 | @@ -119,14 +119,18 @@ | |||
284 | 119 | ccds = QList<CCD *>(); | 119 | ccds = QList<CCD *>(); |
285 | 120 | oculars = QList<Ocular *>(); | 120 | oculars = QList<Ocular *>(); |
286 | 121 | telescopes = QList<Telescope *>(); | 121 | telescopes = QList<Telescope *>(); |
287 | 122 | barlows = QList<Barlow *> (); | ||
288 | 123 | |||
289 | 122 | ccdRotationSignalMapper = new QSignalMapper(this); | 124 | ccdRotationSignalMapper = new QSignalMapper(this); |
290 | 123 | ccdsSignalMapper = new QSignalMapper(this); | 125 | ccdsSignalMapper = new QSignalMapper(this); |
291 | 124 | ocularsSignalMapper = new QSignalMapper(this); | 126 | ocularsSignalMapper = new QSignalMapper(this); |
292 | 125 | telescopesSignalMapper = new QSignalMapper(this); | 127 | telescopesSignalMapper = new QSignalMapper(this); |
293 | 128 | barlowSignalMapper = new QSignalMapper(this); | ||
294 | 126 | 129 | ||
295 | 127 | selectedCCDIndex = -1; | 130 | selectedCCDIndex = -1; |
296 | 128 | selectedOcularIndex = -1; | 131 | selectedOcularIndex = -1; |
297 | 129 | selectedTelescopeIndex = -1; | 132 | selectedTelescopeIndex = -1; |
298 | 133 | selectedBarlowIndex = -1; | ||
299 | 130 | 134 | ||
300 | 131 | usageMessageLabelID = -1; | 135 | usageMessageLabelID = -1; |
301 | 132 | 136 | ||
302 | @@ -157,6 +161,8 @@ | |||
303 | 157 | telescopes.clear(); | 161 | telescopes.clear(); |
304 | 158 | qDeleteAll(oculars); | 162 | qDeleteAll(oculars); |
305 | 159 | oculars.clear(); | 163 | oculars.clear(); |
306 | 164 | qDeleteAll(barlows); | ||
307 | 165 | barlows.clear(); | ||
308 | 160 | } | 166 | } |
309 | 161 | 167 | ||
310 | 162 | QSettings* Oculars::appSettings() | 168 | QSettings* Oculars::appSettings() |
311 | @@ -186,6 +192,7 @@ | |||
312 | 186 | settings->remove("ccd"); | 192 | settings->remove("ccd"); |
313 | 187 | settings->remove("ocular"); | 193 | settings->remove("ocular"); |
314 | 188 | settings->remove("telescope"); | 194 | settings->remove("telescope"); |
315 | 195 | settings->remove("barlow"); | ||
316 | 189 | int index = 0; | 196 | int index = 0; |
317 | 190 | foreach(CCD* ccd, ccds) { | 197 | foreach(CCD* ccd, ccds) { |
318 | 191 | QString prefix = "ccd/" + QVariant(index).toString() + "/"; | 198 | QString prefix = "ccd/" + QVariant(index).toString() + "/"; |
319 | @@ -218,9 +225,18 @@ | |||
320 | 218 | settings->setValue(prefix + "vFlip", telescope->isVFlipped()); | 225 | settings->setValue(prefix + "vFlip", telescope->isVFlipped()); |
321 | 219 | index++; | 226 | index++; |
322 | 220 | } | 227 | } |
323 | 228 | index = 0; | ||
324 | 229 | foreach(Barlow* barlow, barlows) { | ||
325 | 230 | QString prefix = "barlow/" + QVariant(index).toString() + "/"; | ||
326 | 231 | settings->setValue(prefix + "name", barlow->name()); | ||
327 | 232 | settings->setValue(prefix + "multipler", barlow->multipler()); | ||
328 | 233 | index++; | ||
329 | 234 | } | ||
330 | 235 | |||
331 | 221 | settings->setValue("ocular_count", oculars.count()); | 236 | settings->setValue("ocular_count", oculars.count()); |
332 | 222 | settings->setValue("telescope_count", telescopes.count()); | 237 | settings->setValue("telescope_count", telescopes.count()); |
333 | 223 | settings->setValue("ccd_count", ccds.count()); | 238 | settings->setValue("ccd_count", ccds.count()); |
334 | 239 | settings->setValue("barlow_count", barlows.count()); | ||
335 | 224 | settings->sync(); | 240 | settings->sync(); |
336 | 225 | } | 241 | } |
337 | 226 | 242 | ||
338 | @@ -495,7 +511,23 @@ | |||
339 | 495 | selectedTelescopeIndex = 0; | 511 | selectedTelescopeIndex = 0; |
340 | 496 | } | 512 | } |
341 | 497 | 513 | ||
343 | 498 | ocularDialog = new OcularDialog(this, &ccds, &oculars, &telescopes); | 514 | int barlowCount = settings->value("barlow_count", 0).toInt(); |
344 | 515 | int actualBarlowCount = barlowCount; | ||
345 | 516 | for (int index = 0; index<barlowCount; index++) { | ||
346 | 517 | Barlow *newBarlow = Barlow::barlowFromSettings(settings, index); | ||
347 | 518 | if (newBarlow != NULL) { | ||
348 | 519 | barlows.append(newBarlow); | ||
349 | 520 | } | ||
350 | 521 | else { | ||
351 | 522 | actualBarlowCount--; | ||
352 | 523 | } | ||
353 | 524 | } | ||
354 | 525 | if (barlowCount > 0 && actualBarlowCount < barlowCount) | ||
355 | 526 | { | ||
356 | 527 | qWarning() << "The Oculars ini file appears to be corrupt; delete it."; | ||
357 | 528 | } | ||
358 | 529 | |||
359 | 530 | ocularDialog = new OcularDialog(this, &ccds, &oculars, &telescopes, &barlows); | ||
360 | 499 | initializeActivationActions(); | 531 | initializeActivationActions(); |
361 | 500 | determineMaxEyepieceAngle(); | 532 | determineMaxEyepieceAngle(); |
362 | 501 | 533 | ||
363 | @@ -822,6 +854,15 @@ | |||
364 | 822 | emit(selectedTelescopeChanged()); | 854 | emit(selectedTelescopeChanged()); |
365 | 823 | } | 855 | } |
366 | 824 | 856 | ||
367 | 857 | void Oculars::decrementBarlowIndex() | ||
368 | 858 | { | ||
369 | 859 | selectedBarlowIndex++; | ||
370 | 860 | if (selectedBarlowIndex == barlows.count()) { | ||
371 | 861 | selectedBarlowIndex = -1; | ||
372 | 862 | } | ||
373 | 863 | emit(selectedBarlowChanged()); | ||
374 | 864 | } | ||
375 | 865 | |||
376 | 825 | void Oculars::displayPopupMenu() | 866 | void Oculars::displayPopupMenu() |
377 | 826 | { | 867 | { |
378 | 827 | QMenu* popup = new QMenu(&StelMainWindow::getInstance()); | 868 | QMenu* popup = new QMenu(&StelMainWindow::getInstance()); |
379 | @@ -877,6 +918,8 @@ | |||
380 | 877 | { | 918 | { |
381 | 878 | QMenu* submenu = addTelescopeSubmenu(popup); | 919 | QMenu* submenu = addTelescopeSubmenu(popup); |
382 | 879 | popup->addMenu(submenu); | 920 | popup->addMenu(submenu); |
383 | 921 | submenu = addBarlowSubmenu(popup); | ||
384 | 922 | popup->addMenu(submenu); | ||
385 | 880 | popup->addSeparator(); | 923 | popup->addSeparator(); |
386 | 881 | } | 924 | } |
387 | 882 | 925 | ||
388 | @@ -1029,6 +1072,21 @@ | |||
389 | 1029 | emit(selectedTelescopeChanged()); | 1072 | emit(selectedTelescopeChanged()); |
390 | 1030 | } | 1073 | } |
391 | 1031 | 1074 | ||
392 | 1075 | void Oculars::incrementBarlowIndex() | ||
393 | 1076 | { | ||
394 | 1077 | selectedBarlowIndex++; | ||
395 | 1078 | if (selectedBarlowIndex == barlows.count()) { | ||
396 | 1079 | selectedBarlowIndex = -1; | ||
397 | 1080 | } | ||
398 | 1081 | emit(selectedBarlowChanged()); | ||
399 | 1082 | } | ||
400 | 1083 | |||
401 | 1084 | void Oculars::disableBarlow() | ||
402 | 1085 | { | ||
403 | 1086 | selectedBarlowIndex = -1; | ||
404 | 1087 | emit(selectedBarlowChanged()); | ||
405 | 1088 | } | ||
406 | 1089 | |||
407 | 1032 | void Oculars::rotateCCD(QString amount) | 1090 | void Oculars::rotateCCD(QString amount) |
408 | 1033 | { | 1091 | { |
409 | 1034 | ccdRotationAngle += amount.toInt(); | 1092 | ccdRotationAngle += amount.toInt(); |
410 | @@ -1077,6 +1135,15 @@ | |||
411 | 1077 | } | 1135 | } |
412 | 1078 | } | 1136 | } |
413 | 1079 | 1137 | ||
414 | 1138 | void Oculars::selectBarlowAtIndex(QString indexString) | ||
415 | 1139 | { | ||
416 | 1140 | int index = indexString.toInt(); | ||
417 | 1141 | if (index > -2 && index < barlows.count()) { | ||
418 | 1142 | selectedBarlowIndex = index; | ||
419 | 1143 | emit(selectedBarlowChanged()); | ||
420 | 1144 | } | ||
421 | 1145 | } | ||
422 | 1146 | |||
423 | 1080 | void Oculars::toggleCCD(bool show) | 1147 | void Oculars::toggleCCD(bool show) |
424 | 1081 | { | 1148 | { |
425 | 1082 | //If there are no sensors... | 1149 | //If there are no sensors... |
426 | @@ -1239,6 +1306,7 @@ | |||
427 | 1239 | connect(this, SIGNAL(selectedOcularChanged()), this, SLOT(instrumentChanged())); | 1306 | connect(this, SIGNAL(selectedOcularChanged()), this, SLOT(instrumentChanged())); |
428 | 1240 | connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(instrumentChanged())); | 1307 | connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(instrumentChanged())); |
429 | 1241 | connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(setScreenFOVForCCD())); | 1308 | connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(setScreenFOVForCCD())); |
430 | 1309 | connect(this, SIGNAL(selectedBarlowChanged()), this, SLOT(instrumentChanged())); | ||
431 | 1242 | connect(ocularDialog, SIGNAL(requireSelectionChanged(bool)), this, SLOT(setRequireSelection(bool))); | 1310 | connect(ocularDialog, SIGNAL(requireSelectionChanged(bool)), this, SLOT(setRequireSelection(bool))); |
432 | 1243 | connect(ocularDialog, SIGNAL(scaleImageCircleChanged(bool)), this, SLOT(setScaleImageCircle(bool))); | 1311 | connect(ocularDialog, SIGNAL(scaleImageCircleChanged(bool)), this, SLOT(setScaleImageCircle(bool))); |
433 | 1244 | 1312 | ||
434 | @@ -1248,6 +1316,7 @@ | |||
435 | 1248 | connect(ocularsSignalMapper, SIGNAL(mapped(QString)), this, SLOT(selectOcularAtIndex(QString))); | 1316 | connect(ocularsSignalMapper, SIGNAL(mapped(QString)), this, SLOT(selectOcularAtIndex(QString))); |
436 | 1249 | connect(telescopesSignalMapper, SIGNAL(mapped(QString)), this, SLOT(selectTelescopeAtIndex(QString))); | 1317 | connect(telescopesSignalMapper, SIGNAL(mapped(QString)), this, SLOT(selectTelescopeAtIndex(QString))); |
437 | 1250 | connect(telescopesSignalMapper, SIGNAL(mapped(QString)), this, SLOT(setScreenFOVForCCD())); | 1318 | connect(telescopesSignalMapper, SIGNAL(mapped(QString)), this, SLOT(setScreenFOVForCCD())); |
438 | 1319 | connect(barlowSignalMapper, SIGNAL(mapped(QString)), this, SLOT(selectBarlowAtIndex(QString))); | ||
439 | 1251 | } | 1320 | } |
440 | 1252 | 1321 | ||
441 | 1253 | bool Oculars::isBinocularDefined() | 1322 | bool Oculars::isBinocularDefined() |
442 | @@ -1422,6 +1491,7 @@ | |||
443 | 1422 | } | 1491 | } |
444 | 1423 | Ocular *ocular = oculars[selectedOcularIndex]; | 1492 | Ocular *ocular = oculars[selectedOcularIndex]; |
445 | 1424 | Telescope *telescope = telescopes[selectedTelescopeIndex]; | 1493 | Telescope *telescope = telescopes[selectedTelescopeIndex]; |
446 | 1494 | Barlow *barlow = selectedBarlowIndex >=0 ? barlows[selectedBarlowIndex] : NULL; | ||
447 | 1425 | 1495 | ||
448 | 1426 | // set up drawing | 1496 | // set up drawing |
449 | 1427 | if (StelApp::getInstance().getVisionModeNight()) | 1497 | if (StelApp::getInstance().getVisionModeNight()) |
450 | @@ -1478,7 +1548,28 @@ | |||
451 | 1478 | .arg(ocularFov); | 1548 | .arg(ocularFov); |
452 | 1479 | renderer->drawText(TextParams(xPosition, yPosition, ocularFOVLabel)); | 1549 | renderer->drawText(TextParams(xPosition, yPosition, ocularFOVLabel)); |
453 | 1480 | yPosition-=lineHeight; | 1550 | yPosition-=lineHeight; |
455 | 1481 | 1551 | ||
456 | 1552 | QString barlowNumberLabel; | ||
457 | 1553 | // Barlow lens | ||
458 | 1554 | if (barlow != NULL) // it's null if barlow is not selected (barlow index = -1) | ||
459 | 1555 | { | ||
460 | 1556 | QString barlowName = barlow->name(); | ||
461 | 1557 | if (barlowName.isEmpty()) | ||
462 | 1558 | { | ||
463 | 1559 | barlowNumberLabel = QString(q_("Barlow #%1")).arg(selectedBarlowIndex); | ||
464 | 1560 | } | ||
465 | 1561 | else | ||
466 | 1562 | { | ||
467 | 1563 | barlowNumberLabel = QString (q_("Barlow #%1: %2")).arg(selectedBarlowIndex).arg(barlowName); | ||
468 | 1564 | } | ||
469 | 1565 | } | ||
470 | 1566 | else | ||
471 | 1567 | { | ||
472 | 1568 | barlowNumberLabel = QString (q_("Barlow: none")); //FIXME | ||
473 | 1569 | } | ||
474 | 1570 | renderer->drawText(TextParams(xPosition, yPosition, barlowNumberLabel)); | ||
475 | 1571 | yPosition-=lineHeight; | ||
476 | 1572 | |||
477 | 1482 | // The telescope | 1573 | // The telescope |
478 | 1483 | QString telescopeNumberLabel; | 1574 | QString telescopeNumberLabel; |
479 | 1484 | QString telescopeName = telescope->name(); | 1575 | QString telescopeName = telescope->name(); |
480 | @@ -1497,7 +1588,7 @@ | |||
481 | 1497 | yPosition-=lineHeight; | 1588 | yPosition-=lineHeight; |
482 | 1498 | 1589 | ||
483 | 1499 | // General info | 1590 | // General info |
485 | 1500 | double magnification = ((int)(ocular->magnification(telescope) * 10.0)) / 10.0; | 1591 | double magnification = ((int)(ocular->magnification(telescope, barlow) * 10.0)) / 10.0; |
486 | 1501 | QString magString = QString::number(magnification); | 1592 | QString magString = QString::number(magnification); |
487 | 1502 | magString.append(QChar(0x00D7));//Multiplication sign | 1593 | magString.append(QChar(0x00D7));//Multiplication sign |
488 | 1503 | QString magnificationLabel = QString(q_("Magnification: %1")) | 1594 | QString magnificationLabel = QString(q_("Magnification: %1")) |
489 | @@ -1505,7 +1596,7 @@ | |||
490 | 1505 | renderer->drawText(TextParams(xPosition, yPosition, magnificationLabel)); | 1596 | renderer->drawText(TextParams(xPosition, yPosition, magnificationLabel)); |
491 | 1506 | yPosition-=lineHeight; | 1597 | yPosition-=lineHeight; |
492 | 1507 | 1598 | ||
494 | 1508 | double fov = ((int)(ocular->actualFOV(telescope) * 10000.00)) / 10000.0; | 1599 | double fov = ((int)(ocular->actualFOV(telescope, barlow) * 10000.00)) / 10000.0; |
495 | 1509 | QString fovString = QString::number(fov); | 1600 | QString fovString = QString::number(fov); |
496 | 1510 | fovString.append(QChar(0x00B0));//Degree sign | 1601 | fovString.append(QChar(0x00B0));//Degree sign |
497 | 1511 | QString fovLabel = QString(q_("FOV: %1")).arg(fovString); | 1602 | QString fovLabel = QString(q_("FOV: %1")).arg(fovString); |
498 | @@ -1700,6 +1791,7 @@ | |||
499 | 1700 | // core->setMaskType(StelProjector::MaskDisk); | 1791 | // core->setMaskType(StelProjector::MaskDisk); |
500 | 1701 | Ocular *ocular = oculars[selectedOcularIndex]; | 1792 | Ocular *ocular = oculars[selectedOcularIndex]; |
501 | 1702 | Telescope *telescope = NULL; | 1793 | Telescope *telescope = NULL; |
502 | 1794 | Barlow *barlow = NULL; | ||
503 | 1703 | // Only consider flip is we're not binoculars | 1795 | // Only consider flip is we're not binoculars |
504 | 1704 | if (ocular->isBinoculars()) | 1796 | if (ocular->isBinoculars()) |
505 | 1705 | { | 1797 | { |
506 | @@ -1708,12 +1800,14 @@ | |||
507 | 1708 | } | 1800 | } |
508 | 1709 | else | 1801 | else |
509 | 1710 | { | 1802 | { |
510 | 1803 | if (selectedBarlowIndex >= 0) | ||
511 | 1804 | barlow = barlows[selectedBarlowIndex]; | ||
512 | 1711 | telescope = telescopes[selectedTelescopeIndex]; | 1805 | telescope = telescopes[selectedTelescopeIndex]; |
513 | 1712 | core->setFlipHorz(telescope->isHFlipped()); | 1806 | core->setFlipHorz(telescope->isHFlipped()); |
514 | 1713 | core->setFlipVert(telescope->isVFlipped()); | 1807 | core->setFlipVert(telescope->isVFlipped()); |
515 | 1714 | } | 1808 | } |
516 | 1715 | 1809 | ||
518 | 1716 | double actualFOV = ocular->actualFOV(telescope); | 1810 | double actualFOV = ocular->actualFOV(telescope, barlow); |
519 | 1717 | // See if the mask was scaled; if so, correct the actualFOV. | 1811 | // See if the mask was scaled; if so, correct the actualFOV. |
520 | 1718 | if (useMaxEyepieceAngle && ocular->appearentFOV() > 0.0 && !ocular->isBinoculars()) { | 1812 | if (useMaxEyepieceAngle && ocular->appearentFOV() > 0.0 && !ocular->isBinoculars()) { |
521 | 1719 | actualFOV = maxEyepieceAngle * actualFOV / ocular->appearentFOV(); | 1813 | actualFOV = maxEyepieceAngle * actualFOV / ocular->appearentFOV(); |
522 | @@ -1732,6 +1826,45 @@ | |||
523 | 1732 | } | 1826 | } |
524 | 1733 | } | 1827 | } |
525 | 1734 | 1828 | ||
526 | 1829 | Barlow* Oculars::selectedBarlow() | ||
527 | 1830 | { | ||
528 | 1831 | if (selectedBarlowIndex >= 0 && selectedBarlowIndex < barlows.count()) | ||
529 | 1832 | return barlows[selectedBarlowIndex]; | ||
530 | 1833 | return NULL; | ||
531 | 1834 | } | ||
532 | 1835 | |||
533 | 1836 | QMenu* Oculars::addBarlowSubmenu(QMenu* parent) | ||
534 | 1837 | { | ||
535 | 1838 | Q_ASSERT(parent); | ||
536 | 1839 | |||
537 | 1840 | QMenu *submenu = new QMenu(q_("&Barlow"), parent); | ||
538 | 1841 | submenu->addAction(q_("&Previous barlow"), this, SLOT(decrementBarlowIndex())); | ||
539 | 1842 | submenu->addAction(q_("&Next barlow"), this, SLOT(incrementBarlowIndex())); | ||
540 | 1843 | submenu->addSeparator(); | ||
541 | 1844 | submenu->addAction(q_("None"), this, SLOT(disableBarlow())); | ||
542 | 1845 | |||
543 | 1846 | for (int index = 0; index < barlows.count(); ++index) | ||
544 | 1847 | { | ||
545 | 1848 | QString label; | ||
546 | 1849 | if (index < 10) | ||
547 | 1850 | { | ||
548 | 1851 | label = QString("&%1: %2").arg(index).arg(barlows[index]->name()); | ||
549 | 1852 | } | ||
550 | 1853 | else | ||
551 | 1854 | { | ||
552 | 1855 | label = barlows[index]->name(); | ||
553 | 1856 | } | ||
554 | 1857 | QAction* action = submenu->addAction(label, barlowSignalMapper, SLOT(map())); | ||
555 | 1858 | if (index == selectedBarlowIndex) | ||
556 | 1859 | { | ||
557 | 1860 | action->setCheckable(true); | ||
558 | 1861 | action->setChecked(true); | ||
559 | 1862 | } | ||
560 | 1863 | barlowSignalMapper->setMapping(action, QString("%1").arg(index)); | ||
561 | 1864 | } | ||
562 | 1865 | return submenu; | ||
563 | 1866 | } | ||
564 | 1867 | |||
565 | 1735 | QMenu* Oculars::addTelescopeSubmenu(QMenu *parent) | 1868 | QMenu* Oculars::addTelescopeSubmenu(QMenu *parent) |
566 | 1736 | { | 1869 | { |
567 | 1737 | Q_ASSERT(parent); | 1870 | Q_ASSERT(parent); |
568 | 1738 | 1871 | ||
569 | === modified file 'plugins/Oculars/src/Oculars.hpp' | |||
570 | --- plugins/Oculars/src/Oculars.hpp 2012-08-12 12:26:44 +0000 | |||
571 | +++ plugins/Oculars/src/Oculars.hpp 2013-01-28 17:20:27 +0000 | |||
572 | @@ -26,6 +26,7 @@ | |||
573 | 26 | #include "CCD.hpp" | 26 | #include "CCD.hpp" |
574 | 27 | #include "Ocular.hpp" | 27 | #include "Ocular.hpp" |
575 | 28 | #include "Telescope.hpp" | 28 | #include "Telescope.hpp" |
576 | 29 | #include "Barlow.hpp" | ||
577 | 29 | 30 | ||
578 | 30 | #include <QFont> | 31 | #include <QFont> |
579 | 31 | #include <QSettings> | 32 | #include <QSettings> |
580 | @@ -86,6 +87,7 @@ | |||
581 | 86 | void decrementCCDIndex(); | 87 | void decrementCCDIndex(); |
582 | 87 | void decrementOcularIndex(); | 88 | void decrementOcularIndex(); |
583 | 88 | void decrementTelescopeIndex(); | 89 | void decrementTelescopeIndex(); |
584 | 90 | void decrementBarlowIndex(); | ||
585 | 89 | void displayPopupMenu(); | 91 | void displayPopupMenu(); |
586 | 90 | //! This method is called with we detect that our hot key is pressed. It handles | 92 | //! This method is called with we detect that our hot key is pressed. It handles |
587 | 91 | //! determining if we should do anything - based on a selected object. | 93 | //! determining if we should do anything - based on a selected object. |
588 | @@ -93,10 +95,13 @@ | |||
589 | 93 | void incrementCCDIndex(); | 95 | void incrementCCDIndex(); |
590 | 94 | void incrementOcularIndex(); | 96 | void incrementOcularIndex(); |
591 | 95 | void incrementTelescopeIndex(); | 97 | void incrementTelescopeIndex(); |
592 | 98 | void incrementBarlowIndex(); | ||
593 | 99 | void disableBarlow(); | ||
594 | 96 | void rotateCCD(QString amount); //!< amount must be a number. | 100 | void rotateCCD(QString amount); //!< amount must be a number. |
595 | 97 | void selectCCDAtIndex(QString indexString); //!< indexString must be an integer, in the range of -1:ccds.count() | 101 | void selectCCDAtIndex(QString indexString); //!< indexString must be an integer, in the range of -1:ccds.count() |
596 | 98 | void selectOcularAtIndex(QString indexString); //!< indexString must be an integer, in the range of -1:oculars.count() | 102 | void selectOcularAtIndex(QString indexString); //!< indexString must be an integer, in the range of -1:oculars.count() |
597 | 99 | void selectTelescopeAtIndex(QString indexString); //!< indexString must be an integer, in the range of -1:telescopes.count() | 103 | void selectTelescopeAtIndex(QString indexString); //!< indexString must be an integer, in the range of -1:telescopes.count() |
598 | 104 | void selectBarlowAtIndex(QString indexString); //!< indexString must be an integer, in the range -1:barlows.count<() | ||
599 | 100 | //! Toggles the sensor frame overlay. | 105 | //! Toggles the sensor frame overlay. |
600 | 101 | void toggleCCD(bool show); | 106 | void toggleCCD(bool show); |
601 | 102 | //! Toggles the sensor frame overlay (overloaded for blind switching). | 107 | //! Toggles the sensor frame overlay (overloaded for blind switching). |
602 | @@ -115,6 +120,7 @@ | |||
603 | 115 | void selectedCCDChanged(); | 120 | void selectedCCDChanged(); |
604 | 116 | void selectedOcularChanged(); | 121 | void selectedOcularChanged(); |
605 | 117 | void selectedTelescopeChanged(); | 122 | void selectedTelescopeChanged(); |
606 | 123 | void selectedBarlowChanged(); | ||
607 | 118 | 124 | ||
608 | 119 | private slots: | 125 | private slots: |
609 | 120 | //! Signifies a change in ocular or telescope. Sets new zoom level. | 126 | //! Signifies a change in ocular or telescope. Sets new zoom level. |
610 | @@ -129,7 +135,7 @@ | |||
611 | 129 | private: | 135 | private: |
612 | 130 | //! Set up the Qt actions needed to activate the plugin. | 136 | //! Set up the Qt actions needed to activate the plugin. |
613 | 131 | void initializeActivationActions(); | 137 | void initializeActivationActions(); |
615 | 132 | 138 | ||
616 | 133 | //! Returns TRUE if at least one bincular is defined. | 139 | //! Returns TRUE if at least one bincular is defined. |
617 | 134 | bool isBinocularDefined(); | 140 | bool isBinocularDefined(); |
618 | 135 | 141 | ||
619 | @@ -168,16 +174,25 @@ | |||
620 | 168 | 174 | ||
621 | 169 | void hideUsageMessageIfDisplayed(); | 175 | void hideUsageMessageIfDisplayed(); |
622 | 170 | 176 | ||
623 | 177 | //! Creates the sub-menu listing barlow lenses in the pop-up menu | ||
624 | 178 | QMenu* addBarlowSubmenu(QMenu* parent); | ||
625 | 179 | |||
626 | 171 | //! Creates the sub-menu listing telescopes in the pop-up menu. | 180 | //! Creates the sub-menu listing telescopes in the pop-up menu. |
627 | 172 | QMenu* addTelescopeSubmenu(QMenu* parent); | 181 | QMenu* addTelescopeSubmenu(QMenu* parent); |
628 | 173 | 182 | ||
629 | 183 | //! Returns selected barlow,or NULL if no barlow is selected | ||
630 | 184 | Barlow* selectedBarlow(); | ||
631 | 185 | |||
632 | 174 | //! A list of all the oculars defined in the ini file. Must have at least one, or module will not run. | 186 | //! A list of all the oculars defined in the ini file. Must have at least one, or module will not run. |
633 | 175 | QList<CCD *> ccds; | 187 | QList<CCD *> ccds; |
634 | 176 | QList<Ocular *> oculars; | 188 | QList<Ocular *> oculars; |
635 | 177 | QList<Telescope *> telescopes; | 189 | QList<Telescope *> telescopes; |
636 | 190 | QList<Barlow *> barlows; | ||
637 | 191 | |||
638 | 178 | int selectedCCDIndex; //!< index of the current CCD, in the range of -1:ccds.count(). -1 means no CCD is selected. | 192 | int selectedCCDIndex; //!< index of the current CCD, in the range of -1:ccds.count(). -1 means no CCD is selected. |
639 | 179 | int selectedOcularIndex; //!< index of the current ocular, in the range of -1:oculars.count(). -1 means no ocular is selected. | 193 | int selectedOcularIndex; //!< index of the current ocular, in the range of -1:oculars.count(). -1 means no ocular is selected. |
640 | 180 | int selectedTelescopeIndex; //!< index of the current telescope, in the range of -1:telescopes.count(). -1 means none is selected. | 194 | int selectedTelescopeIndex; //!< index of the current telescope, in the range of -1:telescopes.count(). -1 means none is selected. |
641 | 195 | int selectedBarlowIndex; //!< index of the current barlow lends, in the range of -1:barlows.count(). -1 means no barlow is selected | ||
642 | 181 | 196 | ||
643 | 182 | QFont font; //!< The font used for drawing labels. | 197 | QFont font; //!< The font used for drawing labels. |
644 | 183 | bool flagShowCCD; //!< flag used to track f we are in CCD mode. | 198 | bool flagShowCCD; //!< flag used to track f we are in CCD mode. |
645 | @@ -209,6 +224,7 @@ | |||
646 | 209 | QSignalMapper* ccdsSignalMapper; //!< Used to determine which CCD was selected from the popup navigator. */ | 224 | QSignalMapper* ccdsSignalMapper; //!< Used to determine which CCD was selected from the popup navigator. */ |
647 | 210 | QSignalMapper* ocularsSignalMapper; //!< Used to determine which ocular was selected from the popup navigator. */ | 225 | QSignalMapper* ocularsSignalMapper; //!< Used to determine which ocular was selected from the popup navigator. */ |
648 | 211 | QSignalMapper* telescopesSignalMapper; //!< Used to determine which telescope was selected from the popup navigator. */ | 226 | QSignalMapper* telescopesSignalMapper; //!< Used to determine which telescope was selected from the popup navigator. */ |
649 | 227 | QSignalMapper* barlowSignalMapper; //!< Used to determine which barlow was selected from the popup navigator */ | ||
650 | 212 | 228 | ||
651 | 213 | // for toolbar button | 229 | // for toolbar button |
652 | 214 | QPixmap* pxmapGlow; | 230 | QPixmap* pxmapGlow; |
653 | @@ -249,4 +265,3 @@ | |||
654 | 249 | }; | 265 | }; |
655 | 250 | 266 | ||
656 | 251 | #endif /*_OCULARS_HPP_*/ | 267 | #endif /*_OCULARS_HPP_*/ |
657 | 252 | |||
658 | 253 | 268 | ||
659 | === modified file 'plugins/Oculars/src/gui/OcularDialog.cpp' | |||
660 | --- plugins/Oculars/src/gui/OcularDialog.cpp 2012-08-14 05:48:00 +0000 | |||
661 | +++ plugins/Oculars/src/gui/OcularDialog.cpp 2013-01-28 17:20:27 +0000 | |||
662 | @@ -38,7 +38,7 @@ | |||
663 | 38 | #include <QStandardItemModel> | 38 | #include <QStandardItemModel> |
664 | 39 | #include <limits> | 39 | #include <limits> |
665 | 40 | 40 | ||
667 | 41 | OcularDialog::OcularDialog(Oculars* pluginPtr, QList<CCD *>* ccds, QList<Ocular *>* oculars, QList<Telescope *>* telescopes) : | 41 | OcularDialog::OcularDialog(Oculars* pluginPtr, QList<CCD *>* ccds, QList<Ocular *>* oculars, QList<Telescope *>* telescopes, QList<Barlow *>* barlows) : |
668 | 42 | plugin(pluginPtr) | 42 | plugin(pluginPtr) |
669 | 43 | { | 43 | { |
670 | 44 | ui = new Ui_ocularDialogForm; | 44 | ui = new Ui_ocularDialogForm; |
671 | @@ -60,12 +60,18 @@ | |||
672 | 60 | telescopeModel, | 60 | telescopeModel, |
673 | 61 | telescopeModel->propertyMap()); | 61 | telescopeModel->propertyMap()); |
674 | 62 | 62 | ||
675 | 63 | this->barlows = barlows; | ||
676 | 64 | barlowTableModel = new PropertyBasedTableModel(this); | ||
677 | 65 | Barlow* barlowModel = Barlow::barlowModel(); | ||
678 | 66 | barlowTableModel->init(reinterpret_cast<QList<QObject *>* >(barlows), barlowModel, barlowModel->propertyMap()); | ||
679 | 67 | |||
680 | 63 | validatorPositiveInt = new QIntValidator(0, std::numeric_limits<int>::max(), this); | 68 | validatorPositiveInt = new QIntValidator(0, std::numeric_limits<int>::max(), this); |
681 | 64 | validatorPositiveDouble = new QDoubleValidator(.0, std::numeric_limits<double>::max(), 24, this); | 69 | validatorPositiveDouble = new QDoubleValidator(.0, std::numeric_limits<double>::max(), 24, this); |
682 | 65 | validatorOcularAFOV = new QDoubleValidator(1.0, 120.0, 1, this); | 70 | validatorOcularAFOV = new QDoubleValidator(1.0, 120.0, 1, this); |
683 | 66 | validatorOcularEFL = new QDoubleValidator(1.0, 60.0, 1, this); | 71 | validatorOcularEFL = new QDoubleValidator(1.0, 60.0, 1, this); |
684 | 67 | validatorTelescopeDiameter = new QDoubleValidator(1.0, 1000.0, 1, this); | 72 | validatorTelescopeDiameter = new QDoubleValidator(1.0, 1000.0, 1, this); |
685 | 68 | validatorTelescopeFL = new QDoubleValidator(1.0, 10000.0, 1, this); | 73 | validatorTelescopeFL = new QDoubleValidator(1.0, 10000.0, 1, this); |
686 | 74 | validatorBarlowMultipler = new QDoubleValidator(1.0, 6.0, 1, this); | ||
687 | 69 | QRegExp nameExp("^\\S.*"); | 75 | QRegExp nameExp("^\\S.*"); |
688 | 70 | validatorName = new QRegExpValidator(nameExp, this); | 76 | validatorName = new QRegExpValidator(nameExp, this); |
689 | 71 | } | 77 | } |
690 | @@ -146,6 +152,17 @@ | |||
691 | 146 | } | 152 | } |
692 | 147 | } | 153 | } |
693 | 148 | 154 | ||
694 | 155 | void OcularDialog::deleteSelectedBarlow() | ||
695 | 156 | { | ||
696 | 157 | if (barlowTableModel->rowCount() > 0) { | ||
697 | 158 | barlowTableModel->removeRows(ui->barlowListView->currentIndex().row(), 1); | ||
698 | 159 | if (barlowTableModel->rowCount() > 0) { | ||
699 | 160 | ui->barlowListView->setCurrentIndex(barlowTableModel->index(0, 1)); | ||
700 | 161 | } | ||
701 | 162 | plugin->updateLists(); | ||
702 | 163 | } | ||
703 | 164 | } | ||
704 | 165 | |||
705 | 149 | void OcularDialog::insertNewCCD() | 166 | void OcularDialog::insertNewCCD() |
706 | 150 | { | 167 | { |
707 | 151 | ccdTableModel->insertRows(ccdTableModel->rowCount(), 1); | 168 | ccdTableModel->insertRows(ccdTableModel->rowCount(), 1); |
708 | @@ -164,6 +181,12 @@ | |||
709 | 164 | ui->telescopeListView->setCurrentIndex(telescopeTableModel->index(telescopeTableModel->rowCount() - 1, 1)); | 181 | ui->telescopeListView->setCurrentIndex(telescopeTableModel->index(telescopeTableModel->rowCount() - 1, 1)); |
710 | 165 | } | 182 | } |
711 | 166 | 183 | ||
712 | 184 | void OcularDialog::insertNewBarlow() | ||
713 | 185 | { | ||
714 | 186 | barlowTableModel->insertRows(barlowTableModel->rowCount(), 1); | ||
715 | 187 | ui->barlowListView->setCurrentIndex(barlowTableModel->index(barlowTableModel->rowCount() - 1, 1)); | ||
716 | 188 | } | ||
717 | 189 | |||
718 | 167 | void OcularDialog::moveUpSelectedSensor() | 190 | void OcularDialog::moveUpSelectedSensor() |
719 | 168 | { | 191 | { |
720 | 169 | int index = ui->ccdListView->currentIndex().row(); | 192 | int index = ui->ccdListView->currentIndex().row(); |
721 | @@ -194,6 +217,16 @@ | |||
722 | 194 | } | 217 | } |
723 | 195 | } | 218 | } |
724 | 196 | 219 | ||
725 | 220 | void OcularDialog::moveUpSelectedBarlow() | ||
726 | 221 | { | ||
727 | 222 | int index = ui->barlowListView->currentIndex().row(); | ||
728 | 223 | if (index > 0) | ||
729 | 224 | { | ||
730 | 225 | barlowTableModel->moveRowUp(index); | ||
731 | 226 | plugin->updateLists(); | ||
732 | 227 | } | ||
733 | 228 | } | ||
734 | 229 | |||
735 | 197 | void OcularDialog::moveDownSelectedSensor() | 230 | void OcularDialog::moveDownSelectedSensor() |
736 | 198 | { | 231 | { |
737 | 199 | int index = ui->ccdListView->currentIndex().row(); | 232 | int index = ui->ccdListView->currentIndex().row(); |
738 | @@ -224,6 +257,16 @@ | |||
739 | 224 | } | 257 | } |
740 | 225 | } | 258 | } |
741 | 226 | 259 | ||
742 | 260 | void OcularDialog::moveDownSelectedBarlow() | ||
743 | 261 | { | ||
744 | 262 | int index = ui->barlowListView->currentIndex().row(); | ||
745 | 263 | if (index >= 0 && index < barlowTableModel->rowCount() - 1) | ||
746 | 264 | { | ||
747 | 265 | barlowTableModel->moveRowDown(index); | ||
748 | 266 | plugin->updateLists(); | ||
749 | 267 | } | ||
750 | 268 | } | ||
751 | 269 | |||
752 | 227 | /* ********************************************************************* */ | 270 | /* ********************************************************************* */ |
753 | 228 | #if 0 | 271 | #if 0 |
754 | 229 | #pragma mark - | 272 | #pragma mark - |
755 | @@ -288,6 +331,7 @@ | |||
756 | 288 | ui->ccdListView->setModel(ccdTableModel); | 331 | ui->ccdListView->setModel(ccdTableModel); |
757 | 289 | ui->ocularListView->setModel(ocularTableModel); | 332 | ui->ocularListView->setModel(ocularTableModel); |
758 | 290 | ui->telescopeListView->setModel(telescopeTableModel); | 333 | ui->telescopeListView->setModel(telescopeTableModel); |
759 | 334 | ui->barlowListView->setModel(barlowTableModel); | ||
760 | 291 | 335 | ||
761 | 292 | //Now the rest of the actions. | 336 | //Now the rest of the actions. |
762 | 293 | connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); | 337 | connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())); |
763 | @@ -301,6 +345,8 @@ | |||
764 | 301 | connect(ui->deleteCCD, SIGNAL(clicked()), this, SLOT(deleteSelectedCCD())); | 345 | connect(ui->deleteCCD, SIGNAL(clicked()), this, SLOT(deleteSelectedCCD())); |
765 | 302 | connect(ui->addOcular, SIGNAL(clicked()), this, SLOT(insertNewOcular())); | 346 | connect(ui->addOcular, SIGNAL(clicked()), this, SLOT(insertNewOcular())); |
766 | 303 | connect(ui->deleteOcular, SIGNAL(clicked()), this, SLOT(deleteSelectedOcular())); | 347 | connect(ui->deleteOcular, SIGNAL(clicked()), this, SLOT(deleteSelectedOcular())); |
767 | 348 | connect(ui->addBarlow, SIGNAL(clicked()), this, SLOT(insertNewBarlow())); | ||
768 | 349 | connect(ui->deleteBarlow, SIGNAL(clicked()), this, SLOT(deleteSelectedBarlow())); | ||
769 | 304 | connect(ui->addTelescope, SIGNAL(clicked()), this, SLOT(insertNewTelescope())); | 350 | connect(ui->addTelescope, SIGNAL(clicked()), this, SLOT(insertNewTelescope())); |
770 | 305 | connect(ui->deleteTelescope, SIGNAL(clicked()), this, SLOT(deleteSelectedTelescope())); | 351 | connect(ui->deleteTelescope, SIGNAL(clicked()), this, SLOT(deleteSelectedTelescope())); |
771 | 306 | 352 | ||
772 | @@ -319,6 +365,8 @@ | |||
773 | 319 | ui->telescopeDiameter->setValidator(validatorTelescopeDiameter); | 365 | ui->telescopeDiameter->setValidator(validatorTelescopeDiameter); |
774 | 320 | ui->ocularName->setValidator(validatorName); | 366 | ui->ocularName->setValidator(validatorName); |
775 | 321 | ui->telescopeName->setValidator(validatorName); | 367 | ui->telescopeName->setValidator(validatorName); |
776 | 368 | ui->barlowName->setValidator(validatorName); | ||
777 | 369 | ui->barlowMultipler->setValidator(validatorBarlowMultipler); | ||
778 | 322 | 370 | ||
779 | 323 | // The key bindings | 371 | // The key bindings |
780 | 324 | QString bindingString = Oculars::appSettings()->value("bindings/toggle_oculars", "Ctrl+O").toString(); | 372 | QString bindingString = Oculars::appSettings()->value("bindings/toggle_oculars", "Ctrl+O").toString(); |
781 | @@ -348,6 +396,10 @@ | |||
782 | 348 | this, SLOT(moveUpSelectedTelescope())); | 396 | this, SLOT(moveUpSelectedTelescope())); |
783 | 349 | connect(ui->pushButtonMoveTelescopeDown, SIGNAL(pressed()), | 397 | connect(ui->pushButtonMoveTelescopeDown, SIGNAL(pressed()), |
784 | 350 | this, SLOT(moveDownSelectedTelescope())); | 398 | this, SLOT(moveDownSelectedTelescope())); |
785 | 399 | connect(ui->pushButtonMoveBarlowUp, SIGNAL(pressed()), | ||
786 | 400 | this, SLOT(moveUpSelectedBarlow())); | ||
787 | 401 | connect(ui->pushButtonMoveBarlowDown, SIGNAL(pressed()), | ||
788 | 402 | this, SLOT(moveDownSelectedBarlow())); | ||
789 | 351 | 403 | ||
790 | 352 | // The CCD mapper | 404 | // The CCD mapper |
791 | 353 | ccdMapper = new QDataWidgetMapper(); | 405 | ccdMapper = new QDataWidgetMapper(); |
792 | @@ -379,6 +431,17 @@ | |||
793 | 379 | ocularMapper, SLOT(setCurrentModelIndex(QModelIndex))); | 431 | ocularMapper, SLOT(setCurrentModelIndex(QModelIndex))); |
794 | 380 | ui->ocularListView->setCurrentIndex(ocularTableModel->index(0, 1)); | 432 | ui->ocularListView->setCurrentIndex(ocularTableModel->index(0, 1)); |
795 | 381 | 433 | ||
796 | 434 | // The barlow lens mapper | ||
797 | 435 | barlowMapper = new QDataWidgetMapper(); | ||
798 | 436 | barlowMapper->setModel(barlowTableModel); | ||
799 | 437 | barlowMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit); | ||
800 | 438 | barlowMapper->addMapping(ui->barlowName, 0); | ||
801 | 439 | barlowMapper->addMapping(ui->barlowMultipler, 1); | ||
802 | 440 | barlowMapper->toFirst(); | ||
803 | 441 | connect(ui->barlowListView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), | ||
804 | 442 | barlowMapper, SLOT(setCurrentModelIndex(QModelIndex))); | ||
805 | 443 | ui->barlowListView->setCurrentIndex(barlowTableModel->index(0, 1)); | ||
806 | 444 | |||
807 | 382 | // The telescope mapper | 445 | // The telescope mapper |
808 | 383 | telescopeMapper = new QDataWidgetMapper(); | 446 | telescopeMapper = new QDataWidgetMapper(); |
809 | 384 | telescopeMapper->setModel(telescopeTableModel); | 447 | telescopeMapper->setModel(telescopeTableModel); |
810 | 385 | 448 | ||
811 | === modified file 'plugins/Oculars/src/gui/OcularDialog.hpp' | |||
812 | --- plugins/Oculars/src/gui/OcularDialog.hpp 2012-04-01 21:12:29 +0000 | |||
813 | +++ plugins/Oculars/src/gui/OcularDialog.hpp 2013-01-28 17:20:27 +0000 | |||
814 | @@ -27,6 +27,7 @@ | |||
815 | 27 | #include "StelDialog.hpp" | 27 | #include "StelDialog.hpp" |
816 | 28 | #include "StelStyle.hpp" | 28 | #include "StelStyle.hpp" |
817 | 29 | #include "Telescope.hpp" | 29 | #include "Telescope.hpp" |
818 | 30 | #include "Barlow.hpp" | ||
819 | 30 | 31 | ||
820 | 31 | class Ui_ocularDialogForm; | 32 | class Ui_ocularDialogForm; |
821 | 32 | 33 | ||
822 | @@ -46,7 +47,7 @@ | |||
823 | 46 | Q_OBJECT | 47 | Q_OBJECT |
824 | 47 | 48 | ||
825 | 48 | public: | 49 | public: |
827 | 49 | OcularDialog(Oculars* plugin, QList<CCD *>* ccds, QList<Ocular *>* oculars, QList<Telescope *>* telescopes); | 50 | OcularDialog(Oculars* plugin, QList<CCD *>* ccds, QList<Ocular *>* oculars, QList<Telescope *>* telescopes, QList<Barlow *>* barlows); |
828 | 50 | virtual ~OcularDialog(); | 51 | virtual ~OcularDialog(); |
829 | 51 | //! Notify that the application style changed | 52 | //! Notify that the application style changed |
830 | 52 | void styleChanged(); | 53 | void styleChanged(); |
831 | @@ -57,15 +58,19 @@ | |||
832 | 57 | void deleteSelectedCCD(); | 58 | void deleteSelectedCCD(); |
833 | 58 | void deleteSelectedOcular(); | 59 | void deleteSelectedOcular(); |
834 | 59 | void deleteSelectedTelescope(); | 60 | void deleteSelectedTelescope(); |
835 | 61 | void deleteSelectedBarlow(); | ||
836 | 60 | void insertNewCCD(); | 62 | void insertNewCCD(); |
837 | 61 | void insertNewOcular(); | 63 | void insertNewOcular(); |
838 | 62 | void insertNewTelescope(); | 64 | void insertNewTelescope(); |
839 | 65 | void insertNewBarlow(); | ||
840 | 63 | void moveUpSelectedSensor(); | 66 | void moveUpSelectedSensor(); |
841 | 64 | void moveUpSelectedOcular(); | 67 | void moveUpSelectedOcular(); |
842 | 65 | void moveUpSelectedTelescope(); | 68 | void moveUpSelectedTelescope(); |
843 | 69 | void moveUpSelectedBarlow(); | ||
844 | 66 | void moveDownSelectedSensor(); | 70 | void moveDownSelectedSensor(); |
845 | 67 | void moveDownSelectedOcular(); | 71 | void moveDownSelectedOcular(); |
846 | 68 | void moveDownSelectedTelescope(); | 72 | void moveDownSelectedTelescope(); |
847 | 73 | void moveDownSelectedBarlow(); | ||
848 | 69 | void retranslate(); | 74 | void retranslate(); |
849 | 70 | 75 | ||
850 | 71 | signals: | 76 | signals: |
851 | @@ -96,10 +101,14 @@ | |||
852 | 96 | QDataWidgetMapper* telescopeMapper; | 101 | QDataWidgetMapper* telescopeMapper; |
853 | 97 | QList<Telescope *>* telescopes; | 102 | QList<Telescope *>* telescopes; |
854 | 98 | PropertyBasedTableModel* telescopeTableModel; | 103 | PropertyBasedTableModel* telescopeTableModel; |
855 | 104 | QDataWidgetMapper* barlowMapper; | ||
856 | 105 | QList<Barlow *>* barlows; | ||
857 | 106 | PropertyBasedTableModel* barlowTableModel; | ||
858 | 99 | QDoubleValidator* validatorOcularAFOV; | 107 | QDoubleValidator* validatorOcularAFOV; |
859 | 100 | QDoubleValidator* validatorOcularEFL; | 108 | QDoubleValidator* validatorOcularEFL; |
860 | 101 | QDoubleValidator* validatorTelescopeDiameter; | 109 | QDoubleValidator* validatorTelescopeDiameter; |
861 | 102 | QDoubleValidator* validatorTelescopeFL; | 110 | QDoubleValidator* validatorTelescopeFL; |
862 | 111 | QDoubleValidator* validatorBarlowMultipler; | ||
863 | 103 | QRegExpValidator* validatorName; | 112 | QRegExpValidator* validatorName; |
864 | 104 | QIntValidator* validatorPositiveInt; | 113 | QIntValidator* validatorPositiveInt; |
865 | 105 | QDoubleValidator* validatorPositiveDouble; | 114 | QDoubleValidator* validatorPositiveDouble; |
866 | 106 | 115 | ||
867 | === modified file 'plugins/Oculars/src/gui/OcularsGuiPanel.cpp' | |||
868 | --- plugins/Oculars/src/gui/OcularsGuiPanel.cpp 2012-07-06 17:00:39 +0000 | |||
869 | +++ plugins/Oculars/src/gui/OcularsGuiPanel.cpp 2013-01-28 17:20:27 +0000 | |||
870 | @@ -130,6 +130,9 @@ | |||
871 | 130 | ocularControls = new QGraphicsWidget(this); | 130 | ocularControls = new QGraphicsWidget(this); |
872 | 131 | ocularControls->setParentItem(this); | 131 | ocularControls->setParentItem(this); |
873 | 132 | ocularControls->setVisible(false); | 132 | ocularControls->setVisible(false); |
874 | 133 | barlowControls = new QGraphicsWidget(this); | ||
875 | 134 | barlowControls->setParentItem(this); | ||
876 | 135 | barlowControls->setVisible(false); | ||
877 | 133 | ccdControls = new QGraphicsWidget(this); | 136 | ccdControls = new QGraphicsWidget(this); |
878 | 134 | ccdControls->setParentItem(this); | 137 | ccdControls->setParentItem(this); |
879 | 135 | ccdControls->setVisible(false); | 138 | ccdControls->setVisible(false); |
880 | @@ -147,6 +150,9 @@ | |||
881 | 147 | fieldMagnification = new QGraphicsTextItem(telescopeControls); | 150 | fieldMagnification = new QGraphicsTextItem(telescopeControls); |
882 | 148 | fieldFov = new QGraphicsTextItem(telescopeControls); | 151 | fieldFov = new QGraphicsTextItem(telescopeControls); |
883 | 149 | 152 | ||
884 | 153 | fieldBarlowName = new QGraphicsTextItem(barlowControls); | ||
885 | 154 | fieldBarlowMultipler = new QGraphicsTextItem(barlowControls); | ||
886 | 155 | |||
887 | 150 | QFont newFont = font(); | 156 | QFont newFont = font(); |
888 | 151 | newFont.setPixelSize(12); | 157 | newFont.setPixelSize(12); |
889 | 152 | setControlsFont(newFont); | 158 | setControlsFont(newFont); |
890 | @@ -167,6 +173,9 @@ | |||
891 | 167 | fieldMagnification->setTextWidth(maxWidth); | 173 | fieldMagnification->setTextWidth(maxWidth); |
892 | 168 | fieldFov->setTextWidth(maxWidth); | 174 | fieldFov->setTextWidth(maxWidth); |
893 | 169 | 175 | ||
894 | 176 | fieldBarlowName->setTextWidth(maxWidth); | ||
895 | 177 | fieldBarlowMultipler->setTextWidth(maxWidth); | ||
896 | 178 | |||
897 | 170 | QPixmap pa(":/graphicGui/btTimeRewind-on.png"); | 179 | QPixmap pa(":/graphicGui/btTimeRewind-on.png"); |
898 | 171 | QPixmap prevArrow = pa.scaledToHeight(lineHeight, Qt::SmoothTransformation); | 180 | QPixmap prevArrow = pa.scaledToHeight(lineHeight, Qt::SmoothTransformation); |
899 | 172 | QPixmap paOff(":/graphicGui/btTimeRewind-off.png"); | 181 | QPixmap paOff(":/graphicGui/btTimeRewind-off.png"); |
900 | @@ -190,6 +199,18 @@ | |||
901 | 190 | QPixmap(), | 199 | QPixmap(), |
902 | 191 | defaultAction); | 200 | defaultAction); |
903 | 192 | nextOcularButton->setToolTip(q_("Next ocular")); | 201 | nextOcularButton->setToolTip(q_("Next ocular")); |
904 | 202 | prevBarlowButton = new StelButton(barlowControls, | ||
905 | 203 | prevArrow, | ||
906 | 204 | prevArrowOff, | ||
907 | 205 | QPixmap(), | ||
908 | 206 | defaultAction); | ||
909 | 207 | prevBarlowButton->setToolTip(q_("Previous Barlow lens")); | ||
910 | 208 | nextBarlowButton = new StelButton(barlowControls, | ||
911 | 209 | nextArrow, | ||
912 | 210 | nextArrowOff, | ||
913 | 211 | QPixmap(), | ||
914 | 212 | defaultAction); | ||
915 | 213 | nextBarlowButton->setToolTip(q_("Next Barlow lens")); | ||
916 | 193 | prevCcdButton = new StelButton(ccdControls, | 214 | prevCcdButton = new StelButton(ccdControls, |
917 | 194 | prevArrow, | 215 | prevArrow, |
918 | 195 | prevArrowOff, | 216 | prevArrowOff, |
919 | @@ -227,6 +248,10 @@ | |||
920 | 227 | ocularsPlugin, SLOT(decrementCCDIndex())); | 248 | ocularsPlugin, SLOT(decrementCCDIndex())); |
921 | 228 | connect(prevTelescopeButton, SIGNAL(triggered()), | 249 | connect(prevTelescopeButton, SIGNAL(triggered()), |
922 | 229 | ocularsPlugin, SLOT(decrementTelescopeIndex())); | 250 | ocularsPlugin, SLOT(decrementTelescopeIndex())); |
923 | 251 | connect(nextBarlowButton, SIGNAL(triggered()), | ||
924 | 252 | ocularsPlugin, SLOT(incrementBarlowIndex())); | ||
925 | 253 | connect(prevBarlowButton, SIGNAL(triggered()), | ||
926 | 254 | ocularsPlugin, SLOT(decrementBarlowIndex())); | ||
927 | 230 | 255 | ||
928 | 231 | QColor cOn(255, 255, 255); | 256 | QColor cOn(255, 255, 255); |
929 | 232 | QColor cOff(102, 102, 102); | 257 | QColor cOff(102, 102, 102); |
930 | @@ -368,6 +393,7 @@ | |||
931 | 368 | ocularControls->setMaximumWidth(width); | 393 | ocularControls->setMaximumWidth(width); |
932 | 369 | ccdControls->setMaximumWidth(width); | 394 | ccdControls->setMaximumWidth(width); |
933 | 370 | telescopeControls->setMaximumWidth(width); | 395 | telescopeControls->setMaximumWidth(width); |
934 | 396 | barlowControls->setMaximumWidth(width); | ||
935 | 371 | resize(width + left + right, 10); | 397 | resize(width + left + right, 10); |
936 | 372 | buttonBar->resize(width, size().height()); | 398 | buttonBar->resize(width, size().height()); |
937 | 373 | updateMainButtonsPositions(); | 399 | updateMainButtonsPositions(); |
938 | @@ -394,6 +420,8 @@ | |||
939 | 394 | this, SLOT(updateCcdControls())); | 420 | this, SLOT(updateCcdControls())); |
940 | 395 | connect(ocularsPlugin, SIGNAL(selectedTelescopeChanged()), | 421 | connect(ocularsPlugin, SIGNAL(selectedTelescopeChanged()), |
941 | 396 | this, SLOT(updateTelescopeControls())); | 422 | this, SLOT(updateTelescopeControls())); |
942 | 423 | connect(ocularsPlugin, SIGNAL(selectedBarlowChanged()), | ||
943 | 424 | this, SLOT(updateTelescopeControls())); | ||
944 | 397 | 425 | ||
945 | 398 | //Night mode | 426 | //Night mode |
946 | 399 | connect(&stelApp, SIGNAL(colorSchemeChanged(const QString&)), | 427 | connect(&stelApp, SIGNAL(colorSchemeChanged(const QString&)), |
947 | @@ -418,6 +446,7 @@ | |||
948 | 418 | { | 446 | { |
949 | 419 | setOcularControlsVisible(false); | 447 | setOcularControlsVisible(false); |
950 | 420 | setTelescopeControlsVisible(false); | 448 | setTelescopeControlsVisible(false); |
951 | 449 | setBarlowControlsVisible(false); | ||
952 | 421 | updatePosition(); | 450 | updatePosition(); |
953 | 422 | } | 451 | } |
954 | 423 | } | 452 | } |
955 | @@ -433,6 +462,7 @@ | |||
956 | 433 | setOcularControlsVisible(false); | 462 | setOcularControlsVisible(false); |
957 | 434 | setCcdControlsVisible(false); | 463 | setCcdControlsVisible(false); |
958 | 435 | setTelescopeControlsVisible(false); | 464 | setTelescopeControlsVisible(false); |
959 | 465 | setBarlowControlsVisible(false); | ||
960 | 436 | updatePosition(); | 466 | updatePosition(); |
961 | 437 | } | 467 | } |
962 | 438 | 468 | ||
963 | @@ -545,6 +575,76 @@ | |||
964 | 545 | updateTelescopeControls();//Contains a call to updatePosition() | 575 | updateTelescopeControls();//Contains a call to updatePosition() |
965 | 546 | } | 576 | } |
966 | 547 | 577 | ||
967 | 578 | void OcularsGuiPanel::updateBarlowControls() | ||
968 | 579 | { | ||
969 | 580 | if (ocularsPlugin->flagShowCCD) | ||
970 | 581 | { | ||
971 | 582 | setBarlowControlsVisible(false); | ||
972 | 583 | return; | ||
973 | 584 | } | ||
974 | 585 | int index = ocularsPlugin->selectedOcularIndex; | ||
975 | 586 | Ocular* ocular = ocularsPlugin->oculars[index]; | ||
976 | 587 | |||
977 | 588 | Barlow* barlow = ocularsPlugin->selectedBarlow(); | ||
978 | 589 | index = ocularsPlugin->selectedBarlowIndex; | ||
979 | 590 | |||
980 | 591 | QString fullName; | ||
981 | 592 | QString multiplerString; | ||
982 | 593 | if (barlow != NULL) | ||
983 | 594 | { | ||
984 | 595 | QString name = barlow->name(); | ||
985 | 596 | if (name.isEmpty()) | ||
986 | 597 | { | ||
987 | 598 | fullName = QString(q_("Barlow #%1")).arg(index); | ||
988 | 599 | } | ||
989 | 600 | else | ||
990 | 601 | { | ||
991 | 602 | fullName = QString(q_("Barlow #%1: %2")).arg(index).arg(name); | ||
992 | 603 | } | ||
993 | 604 | multiplerString = QString(q_("Multiplicity: %1")).arg(barlow->multipler()); | ||
994 | 605 | multiplerString.append(QChar(0x00D7)); | ||
995 | 606 | } | ||
996 | 607 | else | ||
997 | 608 | { | ||
998 | 609 | fullName = QString(q_("Barlow: None")); | ||
999 | 610 | multiplerString = QString(q_("Multiplicity: N/A")); | ||
1000 | 611 | } | ||
1001 | 612 | fieldBarlowName->setPlainText(fullName); | ||
1002 | 613 | fieldBarlowMultipler->setPlainText(multiplerString); | ||
1003 | 614 | fieldOcularFl->setToolTip(q_("Multiplicity of barlow lens")); | ||
1004 | 615 | |||
1005 | 616 | qreal posX = 0.; | ||
1006 | 617 | qreal posY = 0.; | ||
1007 | 618 | qreal widgetWidth = 0.; | ||
1008 | 619 | qreal widgetHeight = 0.; | ||
1009 | 620 | |||
1010 | 621 | //Prev button | ||
1011 | 622 | qreal heightAdjustment = (fieldBarlowName->boundingRect().height() - prevBarlowButton->boundingRect().height()) / 2.; | ||
1012 | 623 | prevBarlowButton->setPos(posX, round(posY + heightAdjustment)); | ||
1013 | 624 | posX += prevBarlowButton->boundingRect().width(); | ||
1014 | 625 | widgetWidth += prevBarlowButton->boundingRect().width(); | ||
1015 | 626 | |||
1016 | 627 | //Name field | ||
1017 | 628 | fieldBarlowName->setPos(posX, posY); | ||
1018 | 629 | posX += fieldBarlowName->boundingRect().width(); | ||
1019 | 630 | widgetWidth += fieldBarlowName->boundingRect().width(); | ||
1020 | 631 | widgetHeight += fieldBarlowName->boundingRect().height(); | ||
1021 | 632 | |||
1022 | 633 | //Next button | ||
1023 | 634 | nextBarlowButton->setPos(posX, posY + heightAdjustment); | ||
1024 | 635 | widgetWidth += nextBarlowButton->boundingRect().width(); | ||
1025 | 636 | |||
1026 | 637 | posX = prevBarlowButton->boundingRect().width(); | ||
1027 | 638 | posY += fieldBarlowName->boundingRect().height(); | ||
1028 | 639 | fieldBarlowMultipler->setPos(posX, posY); | ||
1029 | 640 | widgetHeight += fieldBarlowMultipler->boundingRect().height(); | ||
1030 | 641 | |||
1031 | 642 | barlowControls->setMinimumSize(widgetWidth, widgetHeight); | ||
1032 | 643 | barlowControls->resize(widgetWidth, widgetHeight); | ||
1033 | 644 | |||
1034 | 645 | setBarlowControlsVisible(true); | ||
1035 | 646 | } | ||
1036 | 647 | |||
1037 | 548 | void OcularsGuiPanel::updateCcdControls() | 648 | void OcularsGuiPanel::updateCcdControls() |
1038 | 549 | { | 649 | { |
1039 | 550 | setOcularControlsVisible(false); | 650 | setOcularControlsVisible(false); |
1040 | @@ -702,6 +802,8 @@ | |||
1041 | 702 | int index = ocularsPlugin->selectedOcularIndex; | 802 | int index = ocularsPlugin->selectedOcularIndex; |
1042 | 703 | Ocular* ocular = ocularsPlugin->oculars[index]; | 803 | Ocular* ocular = ocularsPlugin->oculars[index]; |
1043 | 704 | Q_ASSERT(ocular); | 804 | Q_ASSERT(ocular); |
1044 | 805 | |||
1045 | 806 | Barlow *barlow = ocularsPlugin->selectedBarlow(); | ||
1046 | 705 | 807 | ||
1047 | 706 | if (ocular->isBinoculars()) | 808 | if (ocular->isBinoculars()) |
1048 | 707 | { | 809 | { |
1049 | @@ -720,12 +822,12 @@ | |||
1050 | 720 | nextTelescopeButton->setVisible(true); | 822 | nextTelescopeButton->setVisible(true); |
1051 | 721 | fieldTelescopeName->setVisible(true); | 823 | fieldTelescopeName->setVisible(true); |
1052 | 722 | 824 | ||
1055 | 723 | fieldMagnification->setToolTip(q_("Magnification provided by this ocular/telescope combination")); | 825 | fieldMagnification->setToolTip(q_("Magnification provided by this ocular/barlow/telescope combination")); |
1056 | 724 | fieldFov->setToolTip(q_("Actual field of view provided by this ocular/telescope combination")); | 826 | fieldFov->setToolTip(q_("Actual field of view provided by this ocular/barlow/telescope combination")); |
1057 | 725 | } | 827 | } |
1058 | 726 | 828 | ||
1059 | 727 | //WTF? Rounding? | 829 | //WTF? Rounding? |
1061 | 728 | double magnification = ((int)(ocular->magnification(telescope) * 10.0)) / 10.0; | 830 | double magnification = ((int)(ocular->magnification(telescope, barlow) * 10.0)) / 10.0; |
1062 | 729 | QString magnificationString = QString::number(magnification); | 831 | QString magnificationString = QString::number(magnification); |
1063 | 730 | magnificationString.append(QChar(0x00D7)); | 832 | magnificationString.append(QChar(0x00D7)); |
1064 | 731 | QString magnificationLabel = QString(q_("Magnification: %1")) | 833 | QString magnificationLabel = QString(q_("Magnification: %1")) |
1065 | @@ -735,7 +837,7 @@ | |||
1066 | 735 | posY += fieldMagnification->boundingRect().height(); | 837 | posY += fieldMagnification->boundingRect().height(); |
1067 | 736 | widgetHeight += fieldMagnification->boundingRect().height(); | 838 | widgetHeight += fieldMagnification->boundingRect().height(); |
1068 | 737 | 839 | ||
1070 | 738 | double fov = ((int)(ocular->actualFOV(telescope) * 10000.00)) / 10000.0; | 840 | double fov = ((int)(ocular->actualFOV(telescope, barlow) * 10000.00)) / 10000.0; |
1071 | 739 | QString fovString = QString::number(fov) + QChar(0x00B0); | 841 | QString fovString = QString::number(fov) + QChar(0x00B0); |
1072 | 740 | QString fovLabel = QString(q_("FOV: %1")).arg(fovString); | 842 | QString fovLabel = QString(q_("FOV: %1")).arg(fovString); |
1073 | 741 | fieldFov->setPlainText(fovLabel); | 843 | fieldFov->setPlainText(fovLabel); |
1074 | @@ -759,9 +861,34 @@ | |||
1075 | 759 | telescopeControls->resize(widgetWidth, widgetHeight); | 861 | telescopeControls->resize(widgetWidth, widgetHeight); |
1076 | 760 | setTelescopeControlsVisible(true); | 862 | setTelescopeControlsVisible(true); |
1077 | 761 | 863 | ||
1078 | 864 | updateBarlowControls(); | ||
1079 | 762 | updatePosition(); | 865 | updatePosition(); |
1080 | 763 | } | 866 | } |
1081 | 764 | 867 | ||
1082 | 868 | void OcularsGuiPanel::setBarlowControlsVisible(bool show) | ||
1083 | 869 | { | ||
1084 | 870 | if (show) | ||
1085 | 871 | { | ||
1086 | 872 | if (!barlowControls->isVisible()) | ||
1087 | 873 | { | ||
1088 | 874 | barlowControls->setVisible(true); | ||
1089 | 875 | mainLayout->insertItem(2, barlowControls); | ||
1090 | 876 | } | ||
1091 | 877 | } | ||
1092 | 878 | else | ||
1093 | 879 | { | ||
1094 | 880 | if (barlowControls->isVisible()) | ||
1095 | 881 | { | ||
1096 | 882 | mainLayout->removeItem(barlowControls); | ||
1097 | 883 | barlowControls->setVisible(false); | ||
1098 | 884 | } | ||
1099 | 885 | } | ||
1100 | 886 | mainLayout->invalidate(); | ||
1101 | 887 | mainLayout->activate(); | ||
1102 | 888 | resize(mainLayout->geometry().width(), | ||
1103 | 889 | mainLayout->geometry().height()); | ||
1104 | 890 | } | ||
1105 | 891 | |||
1106 | 765 | void OcularsGuiPanel::setOcularControlsVisible(bool show) | 892 | void OcularsGuiPanel::setOcularControlsVisible(bool show) |
1107 | 766 | { | 893 | { |
1108 | 767 | if (show) | 894 | if (show) |
1109 | @@ -881,6 +1008,8 @@ | |||
1110 | 881 | Q_ASSERT(fieldTelescopeName); | 1008 | Q_ASSERT(fieldTelescopeName); |
1111 | 882 | Q_ASSERT(fieldMagnification); | 1009 | Q_ASSERT(fieldMagnification); |
1112 | 883 | Q_ASSERT(fieldFov); | 1010 | Q_ASSERT(fieldFov); |
1113 | 1011 | Q_ASSERT(fieldBarlowName); | ||
1114 | 1012 | Q_ASSERT(fieldBarlowMultipler); | ||
1115 | 884 | 1013 | ||
1116 | 885 | fieldOcularName->setDefaultTextColor(color); | 1014 | fieldOcularName->setDefaultTextColor(color); |
1117 | 886 | fieldOcularFl->setDefaultTextColor(color); | 1015 | fieldOcularFl->setDefaultTextColor(color); |
1118 | @@ -891,6 +1020,8 @@ | |||
1119 | 891 | fieldTelescopeName->setDefaultTextColor(color); | 1020 | fieldTelescopeName->setDefaultTextColor(color); |
1120 | 892 | fieldMagnification->setDefaultTextColor(color); | 1021 | fieldMagnification->setDefaultTextColor(color); |
1121 | 893 | fieldFov->setDefaultTextColor(color); | 1022 | fieldFov->setDefaultTextColor(color); |
1122 | 1023 | fieldBarlowName->setDefaultTextColor(color); | ||
1123 | 1024 | fieldBarlowMultipler->setDefaultTextColor(color); | ||
1124 | 894 | } | 1025 | } |
1125 | 895 | 1026 | ||
1126 | 896 | void OcularsGuiPanel::setControlsFont(const QFont& font) | 1027 | void OcularsGuiPanel::setControlsFont(const QFont& font) |
1127 | @@ -904,6 +1035,8 @@ | |||
1128 | 904 | Q_ASSERT(fieldTelescopeName); | 1035 | Q_ASSERT(fieldTelescopeName); |
1129 | 905 | Q_ASSERT(fieldMagnification); | 1036 | Q_ASSERT(fieldMagnification); |
1130 | 906 | Q_ASSERT(fieldFov); | 1037 | Q_ASSERT(fieldFov); |
1131 | 1038 | Q_ASSERT(fieldBarlowName); | ||
1132 | 1039 | Q_ASSERT(fieldBarlowMultipler); | ||
1133 | 907 | 1040 | ||
1134 | 908 | fieldOcularName->setFont(font); | 1041 | fieldOcularName->setFont(font); |
1135 | 909 | fieldOcularFl->setFont(font); | 1042 | fieldOcularFl->setFont(font); |
1136 | @@ -914,6 +1047,8 @@ | |||
1137 | 914 | fieldTelescopeName->setFont(font); | 1047 | fieldTelescopeName->setFont(font); |
1138 | 915 | fieldMagnification->setFont(font); | 1048 | fieldMagnification->setFont(font); |
1139 | 916 | fieldFov->setFont(font); | 1049 | fieldFov->setFont(font); |
1140 | 1050 | fieldBarlowName->setFont(font); | ||
1141 | 1051 | fieldBarlowMultipler->setFont(font); | ||
1142 | 917 | } | 1052 | } |
1143 | 918 | 1053 | ||
1144 | 919 | void OcularsGuiPanel::setButtonsNightMode(bool nightMode) | 1054 | void OcularsGuiPanel::setButtonsNightMode(bool nightMode) |
1145 | 920 | 1055 | ||
1146 | === modified file 'plugins/Oculars/src/gui/OcularsGuiPanel.hpp' | |||
1147 | --- plugins/Oculars/src/gui/OcularsGuiPanel.hpp 2012-01-11 10:50:37 +0000 | |||
1148 | +++ plugins/Oculars/src/gui/OcularsGuiPanel.hpp 2013-01-28 17:20:27 +0000 | |||
1149 | @@ -61,7 +61,8 @@ | |||
1150 | 61 | //! Updates the information that depends on the current telescope. | 61 | //! Updates the information that depends on the current telescope. |
1151 | 62 | //! Called in both updateOcularControls() and updateCcdControls(). | 62 | //! Called in both updateOcularControls() and updateCcdControls(). |
1152 | 63 | void updateTelescopeControls(); | 63 | void updateTelescopeControls(); |
1154 | 64 | 64 | //! Updates the information that depends on the current barlow | |
1155 | 65 | void updateBarlowControls(); | ||
1156 | 65 | //! Sets the color scheme (day/night mode) | 66 | //! Sets the color scheme (day/night mode) |
1157 | 66 | void setColorScheme(const QString& schemeName); | 67 | void setColorScheme(const QString& schemeName); |
1158 | 67 | 68 | ||
1159 | @@ -78,6 +79,7 @@ | |||
1160 | 78 | //! Mini-toolbar holding StelButtons | 79 | //! Mini-toolbar holding StelButtons |
1161 | 79 | QGraphicsWidget* buttonBar; | 80 | QGraphicsWidget* buttonBar; |
1162 | 80 | QGraphicsWidget* ocularControls; | 81 | QGraphicsWidget* ocularControls; |
1163 | 82 | QGraphicsWidget* barlowControls; | ||
1164 | 81 | QGraphicsWidget* ccdControls; | 83 | QGraphicsWidget* ccdControls; |
1165 | 82 | QGraphicsWidget* telescopeControls; | 84 | QGraphicsWidget* telescopeControls; |
1166 | 83 | 85 | ||
1167 | @@ -95,6 +97,10 @@ | |||
1168 | 95 | StelButton* nextTelescopeButton; | 97 | StelButton* nextTelescopeButton; |
1169 | 96 | StelButton* prevCcdButton; | 98 | StelButton* prevCcdButton; |
1170 | 97 | StelButton* nextCcdButton; | 99 | StelButton* nextCcdButton; |
1171 | 100 | StelButton* prevBarlowButton; | ||
1172 | 101 | StelButton* nextBarlowButton; | ||
1173 | 102 | QGraphicsTextItem* fieldBarlowName; | ||
1174 | 103 | QGraphicsTextItem* fieldBarlowMultipler; | ||
1175 | 98 | QGraphicsTextItem* fieldOcularName; | 104 | QGraphicsTextItem* fieldOcularName; |
1176 | 99 | QGraphicsTextItem* fieldOcularFl; | 105 | QGraphicsTextItem* fieldOcularFl; |
1177 | 100 | QGraphicsTextItem* fieldOcularAfov; | 106 | QGraphicsTextItem* fieldOcularAfov; |
1178 | @@ -118,6 +124,7 @@ | |||
1179 | 118 | void setOcularControlsVisible(bool show); | 124 | void setOcularControlsVisible(bool show); |
1180 | 119 | void setCcdControlsVisible(bool show); | 125 | void setCcdControlsVisible(bool show); |
1181 | 120 | void setTelescopeControlsVisible(bool show); | 126 | void setTelescopeControlsVisible(bool show); |
1182 | 127 | void setBarlowControlsVisible(bool show); | ||
1183 | 121 | //! Updates the positions of the buttons inside the button bar. | 128 | //! Updates the positions of the buttons inside the button bar. |
1184 | 122 | void updateMainButtonsPositions(); | 129 | void updateMainButtonsPositions(); |
1185 | 123 | 130 | ||
1186 | 124 | 131 | ||
1187 | === modified file 'plugins/Oculars/src/gui/ocularDialog.ui' | |||
1188 | --- plugins/Oculars/src/gui/ocularDialog.ui 2012-08-10 14:45:17 +0000 | |||
1189 | +++ plugins/Oculars/src/gui/ocularDialog.ui 2013-01-28 17:20:27 +0000 | |||
1190 | @@ -596,6 +596,166 @@ | |||
1191 | 596 | </item> | 596 | </item> |
1192 | 597 | </layout> | 597 | </layout> |
1193 | 598 | </widget> | 598 | </widget> |
1194 | 599 | <widget class="QWidget" name="tab"> | ||
1195 | 600 | <attribute name="title"> | ||
1196 | 601 | <string>Barlow lenses</string> | ||
1197 | 602 | </attribute> | ||
1198 | 603 | <layout class="QHBoxLayout" name="horizontalLayout_4"> | ||
1199 | 604 | <item> | ||
1200 | 605 | <layout class="QVBoxLayout" name="verticalLayout_10"> | ||
1201 | 606 | <item> | ||
1202 | 607 | <widget class="QLabel" name="label_6"> | ||
1203 | 608 | <property name="text"> | ||
1204 | 609 | <string>Barlows</string> | ||
1205 | 610 | </property> | ||
1206 | 611 | </widget> | ||
1207 | 612 | </item> | ||
1208 | 613 | <item> | ||
1209 | 614 | <widget class="QListView" name="barlowListView"/> | ||
1210 | 615 | </item> | ||
1211 | 616 | <item> | ||
1212 | 617 | <widget class="QFrame" name="frame_5"> | ||
1213 | 618 | <property name="frameShape"> | ||
1214 | 619 | <enum>QFrame::StyledPanel</enum> | ||
1215 | 620 | </property> | ||
1216 | 621 | <property name="frameShadow"> | ||
1217 | 622 | <enum>QFrame::Raised</enum> | ||
1218 | 623 | </property> | ||
1219 | 624 | <layout class="QHBoxLayout" name="horizontalLayout_3"> | ||
1220 | 625 | <property name="leftMargin"> | ||
1221 | 626 | <number>0</number> | ||
1222 | 627 | </property> | ||
1223 | 628 | <property name="topMargin"> | ||
1224 | 629 | <number>5</number> | ||
1225 | 630 | </property> | ||
1226 | 631 | <property name="rightMargin"> | ||
1227 | 632 | <number>0</number> | ||
1228 | 633 | </property> | ||
1229 | 634 | <property name="bottomMargin"> | ||
1230 | 635 | <number>0</number> | ||
1231 | 636 | </property> | ||
1232 | 637 | <item> | ||
1233 | 638 | <widget class="QPushButton" name="addBarlow"> | ||
1234 | 639 | <property name="minimumSize"> | ||
1235 | 640 | <size> | ||
1236 | 641 | <width>0</width> | ||
1237 | 642 | <height>24</height> | ||
1238 | 643 | </size> | ||
1239 | 644 | </property> | ||
1240 | 645 | <property name="text"> | ||
1241 | 646 | <string>Add</string> | ||
1242 | 647 | </property> | ||
1243 | 648 | </widget> | ||
1244 | 649 | </item> | ||
1245 | 650 | <item> | ||
1246 | 651 | <widget class="QPushButton" name="pushButtonMoveBarlowUp"> | ||
1247 | 652 | <property name="sizePolicy"> | ||
1248 | 653 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
1249 | 654 | <horstretch>0</horstretch> | ||
1250 | 655 | <verstretch>0</verstretch> | ||
1251 | 656 | </sizepolicy> | ||
1252 | 657 | </property> | ||
1253 | 658 | <property name="minimumSize"> | ||
1254 | 659 | <size> | ||
1255 | 660 | <width>24</width> | ||
1256 | 661 | <height>24</height> | ||
1257 | 662 | </size> | ||
1258 | 663 | </property> | ||
1259 | 664 | </widget> | ||
1260 | 665 | </item> | ||
1261 | 666 | <item> | ||
1262 | 667 | <widget class="QPushButton" name="pushButtonMoveBarlowDown"> | ||
1263 | 668 | <property name="sizePolicy"> | ||
1264 | 669 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> | ||
1265 | 670 | <horstretch>0</horstretch> | ||
1266 | 671 | <verstretch>0</verstretch> | ||
1267 | 672 | </sizepolicy> | ||
1268 | 673 | </property> | ||
1269 | 674 | <property name="minimumSize"> | ||
1270 | 675 | <size> | ||
1271 | 676 | <width>24</width> | ||
1272 | 677 | <height>24</height> | ||
1273 | 678 | </size> | ||
1274 | 679 | </property> | ||
1275 | 680 | </widget> | ||
1276 | 681 | </item> | ||
1277 | 682 | <item> | ||
1278 | 683 | <widget class="QPushButton" name="deleteBarlow"> | ||
1279 | 684 | <property name="minimumSize"> | ||
1280 | 685 | <size> | ||
1281 | 686 | <width>0</width> | ||
1282 | 687 | <height>24</height> | ||
1283 | 688 | </size> | ||
1284 | 689 | </property> | ||
1285 | 690 | <property name="text"> | ||
1286 | 691 | <string>Delete</string> | ||
1287 | 692 | </property> | ||
1288 | 693 | </widget> | ||
1289 | 694 | </item> | ||
1290 | 695 | </layout> | ||
1291 | 696 | </widget> | ||
1292 | 697 | </item> | ||
1293 | 698 | </layout> | ||
1294 | 699 | </item> | ||
1295 | 700 | <item> | ||
1296 | 701 | <layout class="QVBoxLayout" name="verticalLayout_9"> | ||
1297 | 702 | <item> | ||
1298 | 703 | <widget class="QFrame" name="frame_2"> | ||
1299 | 704 | <property name="frameShape"> | ||
1300 | 705 | <enum>QFrame::StyledPanel</enum> | ||
1301 | 706 | </property> | ||
1302 | 707 | <property name="frameShadow"> | ||
1303 | 708 | <enum>QFrame::Raised</enum> | ||
1304 | 709 | </property> | ||
1305 | 710 | <layout class="QFormLayout" name="formLayout_4"> | ||
1306 | 711 | <item row="0" column="0"> | ||
1307 | 712 | <widget class="QLabel" name="label_7"> | ||
1308 | 713 | <property name="text"> | ||
1309 | 714 | <string>Name</string> | ||
1310 | 715 | </property> | ||
1311 | 716 | </widget> | ||
1312 | 717 | </item> | ||
1313 | 718 | <item row="0" column="1"> | ||
1314 | 719 | <widget class="QLineEdit" name="barlowName"> | ||
1315 | 720 | <property name="maxLength"> | ||
1316 | 721 | <number>50</number> | ||
1317 | 722 | </property> | ||
1318 | 723 | </widget> | ||
1319 | 724 | </item> | ||
1320 | 725 | <item row="1" column="0"> | ||
1321 | 726 | <widget class="QLabel" name="label_13"> | ||
1322 | 727 | <property name="text"> | ||
1323 | 728 | <string>Multiplicity</string> | ||
1324 | 729 | </property> | ||
1325 | 730 | </widget> | ||
1326 | 731 | </item> | ||
1327 | 732 | <item row="1" column="1"> | ||
1328 | 733 | <widget class="QLineEdit" name="barlowMultipler"> | ||
1329 | 734 | <property name="maxLength"> | ||
1330 | 735 | <number>5</number> | ||
1331 | 736 | </property> | ||
1332 | 737 | </widget> | ||
1333 | 738 | </item> | ||
1334 | 739 | </layout> | ||
1335 | 740 | </widget> | ||
1336 | 741 | </item> | ||
1337 | 742 | <item> | ||
1338 | 743 | <spacer name="verticalSpacer_4"> | ||
1339 | 744 | <property name="orientation"> | ||
1340 | 745 | <enum>Qt::Vertical</enum> | ||
1341 | 746 | </property> | ||
1342 | 747 | <property name="sizeHint" stdset="0"> | ||
1343 | 748 | <size> | ||
1344 | 749 | <width>20</width> | ||
1345 | 750 | <height>40</height> | ||
1346 | 751 | </size> | ||
1347 | 752 | </property> | ||
1348 | 753 | </spacer> | ||
1349 | 754 | </item> | ||
1350 | 755 | </layout> | ||
1351 | 756 | </item> | ||
1352 | 757 | </layout> | ||
1353 | 758 | </widget> | ||
1354 | 599 | <widget class="QWidget" name="CCD"> | 759 | <widget class="QWidget" name="CCD"> |
1355 | 600 | <attribute name="title"> | 760 | <attribute name="title"> |
1356 | 601 | <string>Sensors</string> | 761 | <string>Sensors</string> |