Merge lp:~stolowski/stellarium/oculars-barlow-lens into lp:stellarium

Proposed by Paweł Stołowski on 2013-01-28
Status: Merged
Approved by: Alexander Wolf on 2013-01-31
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
Reviewer Review Type Date Requested Status
Alexander Wolf 2013-01-28 Approve on 2013-01-31
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://imgur.com/BwnO3GK,wY788Oj#0) and can be switched via ocular panel (see http://imgur.com/BwnO3GK,wY788Oj#1) or via popup menu. Barlow's multiplicity affects selected telescope's focal length (and thus increases magnification / decreases fov). It's perfectly fine to have no barlow active, which is indicated by "Barlow: None" and "Multiplicity: N/A" in the GUI.
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.

To post a comment you must log in.
5764. By Paweł Stołowski on 2013-01-28

Reverted some unintended changes to the .ui file.

Alexander Wolf (alexwolf) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/gui/nightStyle.css'
--- data/gui/nightStyle.css 2012-10-05 13:00:30 +0000
+++ data/gui/nightStyle.css 2013-01-28 17:20:27 +0000
@@ -235,11 +235,11 @@
235 image: url(:/graphicGui/nv_searchButtonImage.png);235 image: url(:/graphicGui/nv_searchButtonImage.png);
236}236}
237237
238QPushButton#pushButtonMoveSensorUp, QPushButton#pushButtonMoveOcularUp, QPushButton#pushButtonMoveTelescopeUp {238QPushButton#pushButtonMoveSensorUp, QPushButton#pushButtonMoveOcularUp, QPushButton#pushButtonMoveTelescopeUp, QPushButton#pushButtonMoveBarlowUp {
239 image: url(:/graphicGui/nv_spinup.png);239 image: url(:/graphicGui/nv_spinup.png);
240}240}
241241
242QPushButton#pushButtonMoveSensorDown, QPushButton#pushButtonMoveOcularDown, QPushButton#pushButtonMoveTelescopeDown {242QPushButton#pushButtonMoveSensorDown, QPushButton#pushButtonMoveOcularDown, QPushButton#pushButtonMoveTelescopeDown, QPushButton#pushButtonMoveBarlowDown {
243 image: url(:/graphicGui/nv_spindown.png);243 image: url(:/graphicGui/nv_spindown.png);
244}244}
245245
246246
=== modified file 'data/gui/normalStyle.css'
--- data/gui/normalStyle.css 2012-10-05 13:00:30 +0000
+++ data/gui/normalStyle.css 2013-01-28 17:20:27 +0000
@@ -243,11 +243,11 @@
243 background-image: url(:/graphicGui/closeButton-hover.png);243 background-image: url(:/graphicGui/closeButton-hover.png);
244}244}
245245
246QPushButton#pushButtonMoveSensorUp, QPushButton#pushButtonMoveOcularUp, QPushButton#pushButtonMoveTelescopeUp {246QPushButton#pushButtonMoveSensorUp, QPushButton#pushButtonMoveOcularUp, QPushButton#pushButtonMoveTelescopeUp, QPushButton#pushButtonMoveBarlowUp {
247 image: url(:/graphicGui/spinup.png);247 image: url(:/graphicGui/spinup.png);
248}248}
249249
250QPushButton#pushButtonMoveSensorDown, QPushButton#pushButtonMoveOcularDown, QPushButton#pushButtonMoveTelescopeDown {250QPushButton#pushButtonMoveSensorDown, QPushButton#pushButtonMoveOcularDown, QPushButton#pushButtonMoveTelescopeDown, QPushButton#pushButtonMoveBarlowDown {
251 image: url(:/graphicGui/spindown.png);251 image: url(:/graphicGui/spindown.png);
252}252}
253253
254254
=== added file 'plugins/Oculars/src/Barlow.cpp'
--- plugins/Oculars/src/Barlow.cpp 1970-01-01 00:00:00 +0000
+++ plugins/Oculars/src/Barlow.cpp 2013-01-28 17:20:27 +0000
@@ -0,0 +1,92 @@
1/*
2 * Copyright (C) 2009 Timothy Reaves
3 * Copytight (C) 2013 Pawel Stolowski
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18 */
19
20#include "Barlow.hpp"
21#include <QSettings>
22
23Barlow::Barlow()
24{
25}
26
27Barlow::Barlow(const QObject& other)
28{
29 this->m_multipler = other.property("multipler").toDouble();
30 this->m_name = other.property("name").toString();
31}
32
33Barlow::~Barlow()
34{
35}
36
37static QMap<int, QString> mapping;
38QMap<int, QString> Barlow::propertyMap()
39{
40 if(mapping.isEmpty()) {
41 mapping = QMap<int, QString>();
42 mapping[0] = "name";
43 mapping[1] = "multipler";
44 }
45 return mapping;
46}
47
48const QString Barlow::name() const
49{
50 return m_name;
51}
52
53void Barlow::setName(const QString& theValue)
54{
55 m_name = theValue;
56}
57
58double Barlow::multipler() const
59{
60 return m_multipler;
61}
62
63void Barlow::setMultipler(double theValue)
64{
65 m_multipler = theValue;
66}
67
68/* ********************************************************************* */
69#if 0
70#pragma mark -
71#pragma mark Static Methods
72#endif
73/* ********************************************************************* */
74
75Barlow* Barlow:: barlowFromSettings(QSettings* theSettings, int barlowIndex)
76{
77 Barlow* barlow = new Barlow();
78 QString prefix = "barlow/" + QVariant(barlowIndex).toString() + "/";
79
80 barlow->setName(theSettings->value(prefix + "name", "").toString());
81 barlow->setMultipler(theSettings->value(prefix + "multipler", "1").toDouble());
82
83 return barlow;
84}
85
86Barlow* Barlow::barlowModel()
87{
88 Barlow* model = new Barlow();
89 model->setName("My Barlow");
90 model->setMultipler(2.0f);
91 return model;
92}
093
=== added file 'plugins/Oculars/src/Barlow.hpp'
--- plugins/Oculars/src/Barlow.hpp 1970-01-01 00:00:00 +0000
+++ plugins/Oculars/src/Barlow.hpp 2013-01-28 17:20:27 +0000
@@ -0,0 +1,53 @@
1/*
2 * Copyright (C) 2009 Timothy Reaves
3 * Copytight (C) 2013 Pawel Stolowski
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18 */
19
20#ifndef BARLOW_HPP_
21#define BARLOW_HPP_
22
23#include <QObject>
24#include <QString>
25#include <QMap>
26
27class QSettings;
28
29class Barlow : public QObject
30{
31 Q_OBJECT
32 Q_PROPERTY(QString name READ name WRITE setName)
33 Q_PROPERTY(double multipler READ multipler WRITE setMultipler)
34
35public:
36 Barlow();
37 Q_INVOKABLE Barlow(const QObject& other);
38 virtual ~Barlow();
39 static Barlow* barlowFromSettings(QSettings* theSettings, int barlowIndex);
40 static Barlow* barlowModel();
41
42 double multipler() const;
43 void setMultipler(double theValue);
44 const QString name() const;
45 void setName(const QString& theValue);
46 QMap<int, QString> propertyMap();
47
48private:
49 QString m_name;
50 double m_multipler;
51};
52
53#endif
054
=== modified file 'plugins/Oculars/src/CMakeLists.txt'
--- plugins/Oculars/src/CMakeLists.txt 2012-12-06 15:00:12 +0000
+++ plugins/Oculars/src/CMakeLists.txt 2013-01-28 17:20:27 +0000
@@ -9,6 +9,8 @@
9SET(Oculars_SRCS9SET(Oculars_SRCS
10 CCD.hpp10 CCD.hpp
11 CCD.cpp11 CCD.cpp
12 Barlow.hpp
13 Barlow.cpp
12 Ocular.hpp14 Ocular.hpp
13 Ocular.cpp15 Ocular.cpp
14 Oculars.hpp16 Oculars.hpp
@@ -73,4 +75,3 @@
73 SET_TARGET_PROPERTIES(Oculars-static PROPERTIES COMPILE_FLAGS "-DQT_STATICPLUGIN")75 SET_TARGET_PROPERTIES(Oculars-static PROPERTIES COMPILE_FLAGS "-DQT_STATICPLUGIN")
74 ADD_DEPENDENCIES(AllStaticPlugins Oculars-static)76 ADD_DEPENDENCIES(AllStaticPlugins Oculars-static)
75ENDIF()77ENDIF()
76
7778
=== modified file 'plugins/Oculars/src/Ocular.cpp'
--- plugins/Oculars/src/Ocular.cpp 2012-01-11 10:50:37 +0000
+++ plugins/Oculars/src/Ocular.cpp 2013-01-28 17:20:27 +0000
@@ -18,6 +18,7 @@
1818
19#include "Ocular.hpp"19#include "Ocular.hpp"
20#include "Telescope.hpp"20#include "Telescope.hpp"
21#include "Barlow.hpp"
2122
22Ocular::Ocular()23Ocular::Ocular()
23{24{
@@ -57,27 +58,29 @@
57#pragma mark Instance Methods58#pragma mark Instance Methods
58#endif59#endif
59/* ********************************************************************* */60/* ********************************************************************* */
60double Ocular::actualFOV(Telescope *telescope) const61double Ocular::actualFOV(Telescope *telescope, Barlow *barlow) const
61{62{
63 const double barlow_multipler = (barlow != NULL ? barlow->multipler() : 1.0f);
62 double actualFOV = 0.0;64 double actualFOV = 0.0;
63 if (m_binoculars) {65 if (m_binoculars) {
64 actualFOV = appearentFOV();66 actualFOV = appearentFOV();
65 } else if (fieldStop() > 0.0) {67 } else if (fieldStop() > 0.0) {
66 actualFOV = fieldStop() / telescope->focalLength() * 57.3;68 actualFOV = fieldStop() / (telescope->focalLength() * barlow_multipler) * 57.3;
67 } else {69 } else {
68 //actualFOV = apparent / mag70 //actualFOV = apparent / mag
69 actualFOV = appearentFOV() / (telescope->focalLength() / effectiveFocalLength());71 actualFOV = appearentFOV() / (telescope->focalLength() * barlow_multipler / effectiveFocalLength());
70 }72 }
71 return actualFOV;73 return actualFOV;
72}74}
7375
74double Ocular::magnification(Telescope *telescope) const76double Ocular::magnification(Telescope *telescope, Barlow *barlow) const
75{77{
76 double magnifiction = 0.0;78 double magnifiction = 0.0;
77 if (m_binoculars) {79 if (m_binoculars) {
78 magnifiction = effectiveFocalLength();80 magnifiction = effectiveFocalLength();
79 } else {81 } else {
80 magnifiction = telescope->focalLength() / effectiveFocalLength();82 const double barlow_multipler = (barlow != NULL ? barlow->multipler() : 1.0f);
83 magnifiction = telescope->focalLength() * barlow_multipler / effectiveFocalLength();
81 }84 }
82 return magnifiction;85 return magnifiction;
83}86}
8487
=== modified file 'plugins/Oculars/src/Ocular.hpp'
--- plugins/Oculars/src/Ocular.hpp 2012-01-11 10:50:37 +0000
+++ plugins/Oculars/src/Ocular.hpp 2013-01-28 17:20:27 +0000
@@ -25,6 +25,7 @@
25#include <QSettings>25#include <QSettings>
2626
27class Telescope;27class Telescope;
28class Barlow;
2829
29class Ocular : public QObject30class Ocular : public QObject
30{31{
@@ -52,8 +53,8 @@
52 bool isBinoculars() const;53 bool isBinoculars() const;
53 void setBinoculars(bool flag);54 void setBinoculars(bool flag);
5455
55 double actualFOV(Telescope *telescope) const;56 double actualFOV(Telescope *telescope, Barlow *barlow) const;
56 double magnification(Telescope *telescope) const;57 double magnification(Telescope *telescope, Barlow *barlow) const;
57 QMap<int, QString> propertyMap();58 QMap<int, QString> propertyMap();
5859
59private:60private:
6061
=== modified file 'plugins/Oculars/src/Oculars.cpp'
--- plugins/Oculars/src/Oculars.cpp 2013-01-07 13:54:44 +0000
+++ plugins/Oculars/src/Oculars.cpp 2013-01-28 17:20:27 +0000
@@ -119,14 +119,18 @@
119 ccds = QList<CCD *>();119 ccds = QList<CCD *>();
120 oculars = QList<Ocular *>();120 oculars = QList<Ocular *>();
121 telescopes = QList<Telescope *>();121 telescopes = QList<Telescope *>();
122 barlows = QList<Barlow *> ();
123
122 ccdRotationSignalMapper = new QSignalMapper(this);124 ccdRotationSignalMapper = new QSignalMapper(this);
123 ccdsSignalMapper = new QSignalMapper(this);125 ccdsSignalMapper = new QSignalMapper(this);
124 ocularsSignalMapper = new QSignalMapper(this);126 ocularsSignalMapper = new QSignalMapper(this);
125 telescopesSignalMapper = new QSignalMapper(this);127 telescopesSignalMapper = new QSignalMapper(this);
128 barlowSignalMapper = new QSignalMapper(this);
126 129
127 selectedCCDIndex = -1;130 selectedCCDIndex = -1;
128 selectedOcularIndex = -1;131 selectedOcularIndex = -1;
129 selectedTelescopeIndex = -1;132 selectedTelescopeIndex = -1;
133 selectedBarlowIndex = -1;
130 134
131 usageMessageLabelID = -1;135 usageMessageLabelID = -1;
132136
@@ -157,6 +161,8 @@
157 telescopes.clear();161 telescopes.clear();
158 qDeleteAll(oculars);162 qDeleteAll(oculars);
159 oculars.clear();163 oculars.clear();
164 qDeleteAll(barlows);
165 barlows.clear();
160}166}
161167
162QSettings* Oculars::appSettings()168QSettings* Oculars::appSettings()
@@ -186,6 +192,7 @@
186 settings->remove("ccd");192 settings->remove("ccd");
187 settings->remove("ocular");193 settings->remove("ocular");
188 settings->remove("telescope");194 settings->remove("telescope");
195 settings->remove("barlow");
189 int index = 0;196 int index = 0;
190 foreach(CCD* ccd, ccds) {197 foreach(CCD* ccd, ccds) {
191 QString prefix = "ccd/" + QVariant(index).toString() + "/";198 QString prefix = "ccd/" + QVariant(index).toString() + "/";
@@ -218,9 +225,18 @@
218 settings->setValue(prefix + "vFlip", telescope->isVFlipped());225 settings->setValue(prefix + "vFlip", telescope->isVFlipped());
219 index++;226 index++;
220 }227 }
228 index = 0;
229 foreach(Barlow* barlow, barlows) {
230 QString prefix = "barlow/" + QVariant(index).toString() + "/";
231 settings->setValue(prefix + "name", barlow->name());
232 settings->setValue(prefix + "multipler", barlow->multipler());
233 index++;
234 }
235
221 settings->setValue("ocular_count", oculars.count());236 settings->setValue("ocular_count", oculars.count());
222 settings->setValue("telescope_count", telescopes.count());237 settings->setValue("telescope_count", telescopes.count());
223 settings->setValue("ccd_count", ccds.count());238 settings->setValue("ccd_count", ccds.count());
239 settings->setValue("barlow_count", barlows.count());
224 settings->sync();240 settings->sync();
225}241}
226242
@@ -495,7 +511,23 @@
495 selectedTelescopeIndex = 0;511 selectedTelescopeIndex = 0;
496 }512 }
497513
498 ocularDialog = new OcularDialog(this, &ccds, &oculars, &telescopes);514 int barlowCount = settings->value("barlow_count", 0).toInt();
515 int actualBarlowCount = barlowCount;
516 for (int index = 0; index<barlowCount; index++) {
517 Barlow *newBarlow = Barlow::barlowFromSettings(settings, index);
518 if (newBarlow != NULL) {
519 barlows.append(newBarlow);
520 }
521 else {
522 actualBarlowCount--;
523 }
524 }
525 if (barlowCount > 0 && actualBarlowCount < barlowCount)
526 {
527 qWarning() << "The Oculars ini file appears to be corrupt; delete it.";
528 }
529
530 ocularDialog = new OcularDialog(this, &ccds, &oculars, &telescopes, &barlows);
499 initializeActivationActions();531 initializeActivationActions();
500 determineMaxEyepieceAngle();532 determineMaxEyepieceAngle();
501 533
@@ -822,6 +854,15 @@
822 emit(selectedTelescopeChanged());854 emit(selectedTelescopeChanged());
823}855}
824856
857void Oculars::decrementBarlowIndex()
858{
859 selectedBarlowIndex++;
860 if (selectedBarlowIndex == barlows.count()) {
861 selectedBarlowIndex = -1;
862 }
863 emit(selectedBarlowChanged());
864}
865
825void Oculars::displayPopupMenu()866void Oculars::displayPopupMenu()
826{867{
827 QMenu* popup = new QMenu(&StelMainWindow::getInstance());868 QMenu* popup = new QMenu(&StelMainWindow::getInstance());
@@ -877,6 +918,8 @@
877 {918 {
878 QMenu* submenu = addTelescopeSubmenu(popup);919 QMenu* submenu = addTelescopeSubmenu(popup);
879 popup->addMenu(submenu);920 popup->addMenu(submenu);
921 submenu = addBarlowSubmenu(popup);
922 popup->addMenu(submenu);
880 popup->addSeparator();923 popup->addSeparator();
881 }924 }
882925
@@ -1029,6 +1072,21 @@
1029 emit(selectedTelescopeChanged());1072 emit(selectedTelescopeChanged());
1030}1073}
10311074
1075void Oculars::incrementBarlowIndex()
1076{
1077 selectedBarlowIndex++;
1078 if (selectedBarlowIndex == barlows.count()) {
1079 selectedBarlowIndex = -1;
1080 }
1081 emit(selectedBarlowChanged());
1082}
1083
1084void Oculars::disableBarlow()
1085{
1086 selectedBarlowIndex = -1;
1087 emit(selectedBarlowChanged());
1088}
1089
1032void Oculars::rotateCCD(QString amount)1090void Oculars::rotateCCD(QString amount)
1033{1091{
1034 ccdRotationAngle += amount.toInt();1092 ccdRotationAngle += amount.toInt();
@@ -1077,6 +1135,15 @@
1077 }1135 }
1078}1136}
10791137
1138void Oculars::selectBarlowAtIndex(QString indexString)
1139{
1140 int index = indexString.toInt();
1141 if (index > -2 && index < barlows.count()) {
1142 selectedBarlowIndex = index;
1143 emit(selectedBarlowChanged());
1144 }
1145}
1146
1080void Oculars::toggleCCD(bool show)1147void Oculars::toggleCCD(bool show)
1081{1148{
1082 //If there are no sensors...1149 //If there are no sensors...
@@ -1239,6 +1306,7 @@
1239 connect(this, SIGNAL(selectedOcularChanged()), this, SLOT(instrumentChanged()));1306 connect(this, SIGNAL(selectedOcularChanged()), this, SLOT(instrumentChanged()));
1240 connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(instrumentChanged()));1307 connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(instrumentChanged()));
1241 connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(setScreenFOVForCCD()));1308 connect(this, SIGNAL(selectedTelescopeChanged()), this, SLOT(setScreenFOVForCCD()));
1309 connect(this, SIGNAL(selectedBarlowChanged()), this, SLOT(instrumentChanged()));
1242 connect(ocularDialog, SIGNAL(requireSelectionChanged(bool)), this, SLOT(setRequireSelection(bool)));1310 connect(ocularDialog, SIGNAL(requireSelectionChanged(bool)), this, SLOT(setRequireSelection(bool)));
1243 connect(ocularDialog, SIGNAL(scaleImageCircleChanged(bool)), this, SLOT(setScaleImageCircle(bool)));1311 connect(ocularDialog, SIGNAL(scaleImageCircleChanged(bool)), this, SLOT(setScaleImageCircle(bool)));
12441312
@@ -1248,6 +1316,7 @@
1248 connect(ocularsSignalMapper, SIGNAL(mapped(QString)), this, SLOT(selectOcularAtIndex(QString)));1316 connect(ocularsSignalMapper, SIGNAL(mapped(QString)), this, SLOT(selectOcularAtIndex(QString)));
1249 connect(telescopesSignalMapper, SIGNAL(mapped(QString)), this, SLOT(selectTelescopeAtIndex(QString)));1317 connect(telescopesSignalMapper, SIGNAL(mapped(QString)), this, SLOT(selectTelescopeAtIndex(QString)));
1250 connect(telescopesSignalMapper, SIGNAL(mapped(QString)), this, SLOT(setScreenFOVForCCD()));1318 connect(telescopesSignalMapper, SIGNAL(mapped(QString)), this, SLOT(setScreenFOVForCCD()));
1319 connect(barlowSignalMapper, SIGNAL(mapped(QString)), this, SLOT(selectBarlowAtIndex(QString)));
1251}1320}
12521321
1253bool Oculars::isBinocularDefined()1322bool Oculars::isBinocularDefined()
@@ -1422,6 +1491,7 @@
1422 }1491 }
1423 Ocular *ocular = oculars[selectedOcularIndex];1492 Ocular *ocular = oculars[selectedOcularIndex];
1424 Telescope *telescope = telescopes[selectedTelescopeIndex];1493 Telescope *telescope = telescopes[selectedTelescopeIndex];
1494 Barlow *barlow = selectedBarlowIndex >=0 ? barlows[selectedBarlowIndex] : NULL;
14251495
1426 // set up drawing1496 // set up drawing
1427 if (StelApp::getInstance().getVisionModeNight())1497 if (StelApp::getInstance().getVisionModeNight())
@@ -1478,7 +1548,28 @@
1478 .arg(ocularFov);1548 .arg(ocularFov);
1479 renderer->drawText(TextParams(xPosition, yPosition, ocularFOVLabel));1549 renderer->drawText(TextParams(xPosition, yPosition, ocularFOVLabel));
1480 yPosition-=lineHeight;1550 yPosition-=lineHeight;
1481 1551
1552 QString barlowNumberLabel;
1553 // Barlow lens
1554 if (barlow != NULL) // it's null if barlow is not selected (barlow index = -1)
1555 {
1556 QString barlowName = barlow->name();
1557 if (barlowName.isEmpty())
1558 {
1559 barlowNumberLabel = QString(q_("Barlow #%1")).arg(selectedBarlowIndex);
1560 }
1561 else
1562 {
1563 barlowNumberLabel = QString (q_("Barlow #%1: %2")).arg(selectedBarlowIndex).arg(barlowName);
1564 }
1565 }
1566 else
1567 {
1568 barlowNumberLabel = QString (q_("Barlow: none")); //FIXME
1569 }
1570 renderer->drawText(TextParams(xPosition, yPosition, barlowNumberLabel));
1571 yPosition-=lineHeight;
1572
1482 // The telescope1573 // The telescope
1483 QString telescopeNumberLabel;1574 QString telescopeNumberLabel;
1484 QString telescopeName = telescope->name();1575 QString telescopeName = telescope->name();
@@ -1497,7 +1588,7 @@
1497 yPosition-=lineHeight;1588 yPosition-=lineHeight;
1498 1589
1499 // General info1590 // General info
1500 double magnification = ((int)(ocular->magnification(telescope) * 10.0)) / 10.0;1591 double magnification = ((int)(ocular->magnification(telescope, barlow) * 10.0)) / 10.0;
1501 QString magString = QString::number(magnification);1592 QString magString = QString::number(magnification);
1502 magString.append(QChar(0x00D7));//Multiplication sign1593 magString.append(QChar(0x00D7));//Multiplication sign
1503 QString magnificationLabel = QString(q_("Magnification: %1"))1594 QString magnificationLabel = QString(q_("Magnification: %1"))
@@ -1505,7 +1596,7 @@
1505 renderer->drawText(TextParams(xPosition, yPosition, magnificationLabel));1596 renderer->drawText(TextParams(xPosition, yPosition, magnificationLabel));
1506 yPosition-=lineHeight;1597 yPosition-=lineHeight;
1507 1598
1508 double fov = ((int)(ocular->actualFOV(telescope) * 10000.00)) / 10000.0;1599 double fov = ((int)(ocular->actualFOV(telescope, barlow) * 10000.00)) / 10000.0;
1509 QString fovString = QString::number(fov);1600 QString fovString = QString::number(fov);
1510 fovString.append(QChar(0x00B0));//Degree sign1601 fovString.append(QChar(0x00B0));//Degree sign
1511 QString fovLabel = QString(q_("FOV: %1")).arg(fovString);1602 QString fovLabel = QString(q_("FOV: %1")).arg(fovString);
@@ -1700,6 +1791,7 @@
1700 // core->setMaskType(StelProjector::MaskDisk);1791 // core->setMaskType(StelProjector::MaskDisk);
1701 Ocular *ocular = oculars[selectedOcularIndex];1792 Ocular *ocular = oculars[selectedOcularIndex];
1702 Telescope *telescope = NULL;1793 Telescope *telescope = NULL;
1794 Barlow *barlow = NULL;
1703 // Only consider flip is we're not binoculars1795 // Only consider flip is we're not binoculars
1704 if (ocular->isBinoculars())1796 if (ocular->isBinoculars())
1705 {1797 {
@@ -1708,12 +1800,14 @@
1708 }1800 }
1709 else1801 else
1710 {1802 {
1803 if (selectedBarlowIndex >= 0)
1804 barlow = barlows[selectedBarlowIndex];
1711 telescope = telescopes[selectedTelescopeIndex];1805 telescope = telescopes[selectedTelescopeIndex];
1712 core->setFlipHorz(telescope->isHFlipped());1806 core->setFlipHorz(telescope->isHFlipped());
1713 core->setFlipVert(telescope->isVFlipped());1807 core->setFlipVert(telescope->isVFlipped());
1714 }1808 }
17151809
1716 double actualFOV = ocular->actualFOV(telescope);1810 double actualFOV = ocular->actualFOV(telescope, barlow);
1717 // See if the mask was scaled; if so, correct the actualFOV.1811 // See if the mask was scaled; if so, correct the actualFOV.
1718 if (useMaxEyepieceAngle && ocular->appearentFOV() > 0.0 && !ocular->isBinoculars()) {1812 if (useMaxEyepieceAngle && ocular->appearentFOV() > 0.0 && !ocular->isBinoculars()) {
1719 actualFOV = maxEyepieceAngle * actualFOV / ocular->appearentFOV();1813 actualFOV = maxEyepieceAngle * actualFOV / ocular->appearentFOV();
@@ -1732,6 +1826,45 @@
1732 }1826 }
1733}1827}
17341828
1829Barlow* Oculars::selectedBarlow()
1830{
1831 if (selectedBarlowIndex >= 0 && selectedBarlowIndex < barlows.count())
1832 return barlows[selectedBarlowIndex];
1833 return NULL;
1834}
1835
1836QMenu* Oculars::addBarlowSubmenu(QMenu* parent)
1837{
1838 Q_ASSERT(parent);
1839
1840 QMenu *submenu = new QMenu(q_("&Barlow"), parent);
1841 submenu->addAction(q_("&Previous barlow"), this, SLOT(decrementBarlowIndex()));
1842 submenu->addAction(q_("&Next barlow"), this, SLOT(incrementBarlowIndex()));
1843 submenu->addSeparator();
1844 submenu->addAction(q_("None"), this, SLOT(disableBarlow()));
1845
1846 for (int index = 0; index < barlows.count(); ++index)
1847 {
1848 QString label;
1849 if (index < 10)
1850 {
1851 label = QString("&%1: %2").arg(index).arg(barlows[index]->name());
1852 }
1853 else
1854 {
1855 label = barlows[index]->name();
1856 }
1857 QAction* action = submenu->addAction(label, barlowSignalMapper, SLOT(map()));
1858 if (index == selectedBarlowIndex)
1859 {
1860 action->setCheckable(true);
1861 action->setChecked(true);
1862 }
1863 barlowSignalMapper->setMapping(action, QString("%1").arg(index));
1864 }
1865 return submenu;
1866}
1867
1735QMenu* Oculars::addTelescopeSubmenu(QMenu *parent)1868QMenu* Oculars::addTelescopeSubmenu(QMenu *parent)
1736{1869{
1737 Q_ASSERT(parent);1870 Q_ASSERT(parent);
17381871
=== modified file 'plugins/Oculars/src/Oculars.hpp'
--- plugins/Oculars/src/Oculars.hpp 2012-08-12 12:26:44 +0000
+++ plugins/Oculars/src/Oculars.hpp 2013-01-28 17:20:27 +0000
@@ -26,6 +26,7 @@
26#include "CCD.hpp"26#include "CCD.hpp"
27#include "Ocular.hpp"27#include "Ocular.hpp"
28#include "Telescope.hpp"28#include "Telescope.hpp"
29#include "Barlow.hpp"
2930
30#include <QFont>31#include <QFont>
31#include <QSettings>32#include <QSettings>
@@ -86,6 +87,7 @@
86 void decrementCCDIndex();87 void decrementCCDIndex();
87 void decrementOcularIndex();88 void decrementOcularIndex();
88 void decrementTelescopeIndex();89 void decrementTelescopeIndex();
90 void decrementBarlowIndex();
89 void displayPopupMenu();91 void displayPopupMenu();
90 //! This method is called with we detect that our hot key is pressed. It handles92 //! This method is called with we detect that our hot key is pressed. It handles
91 //! determining if we should do anything - based on a selected object.93 //! determining if we should do anything - based on a selected object.
@@ -93,10 +95,13 @@
93 void incrementCCDIndex();95 void incrementCCDIndex();
94 void incrementOcularIndex();96 void incrementOcularIndex();
95 void incrementTelescopeIndex();97 void incrementTelescopeIndex();
98 void incrementBarlowIndex();
99 void disableBarlow();
96 void rotateCCD(QString amount); //!< amount must be a number.100 void rotateCCD(QString amount); //!< amount must be a number.
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()
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()
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()
104 void selectBarlowAtIndex(QString indexString); //!< indexString must be an integer, in the range -1:barlows.count<()
100 //! Toggles the sensor frame overlay.105 //! Toggles the sensor frame overlay.
101 void toggleCCD(bool show);106 void toggleCCD(bool show);
102 //! Toggles the sensor frame overlay (overloaded for blind switching).107 //! Toggles the sensor frame overlay (overloaded for blind switching).
@@ -115,6 +120,7 @@
115 void selectedCCDChanged();120 void selectedCCDChanged();
116 void selectedOcularChanged();121 void selectedOcularChanged();
117 void selectedTelescopeChanged();122 void selectedTelescopeChanged();
123 void selectedBarlowChanged();
118124
119private slots:125private slots:
120 //! Signifies a change in ocular or telescope. Sets new zoom level.126 //! Signifies a change in ocular or telescope. Sets new zoom level.
@@ -129,7 +135,7 @@
129private:135private:
130 //! Set up the Qt actions needed to activate the plugin.136 //! Set up the Qt actions needed to activate the plugin.
131 void initializeActivationActions();137 void initializeActivationActions();
132 138
133 //! Returns TRUE if at least one bincular is defined.139 //! Returns TRUE if at least one bincular is defined.
134 bool isBinocularDefined();140 bool isBinocularDefined();
135141
@@ -168,16 +174,25 @@
168174
169 void hideUsageMessageIfDisplayed();175 void hideUsageMessageIfDisplayed();
170176
177 //! Creates the sub-menu listing barlow lenses in the pop-up menu
178 QMenu* addBarlowSubmenu(QMenu* parent);
179
171 //! Creates the sub-menu listing telescopes in the pop-up menu.180 //! Creates the sub-menu listing telescopes in the pop-up menu.
172 QMenu* addTelescopeSubmenu(QMenu* parent);181 QMenu* addTelescopeSubmenu(QMenu* parent);
173182
183 //! Returns selected barlow,or NULL if no barlow is selected
184 Barlow* selectedBarlow();
185
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.
175 QList<CCD *> ccds;187 QList<CCD *> ccds;
176 QList<Ocular *> oculars;188 QList<Ocular *> oculars;
177 QList<Telescope *> telescopes;189 QList<Telescope *> telescopes;
190 QList<Barlow *> barlows;
191
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.
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.
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.
195 int selectedBarlowIndex; //!< index of the current barlow lends, in the range of -1:barlows.count(). -1 means no barlow is selected
181196
182 QFont font; //!< The font used for drawing labels.197 QFont font; //!< The font used for drawing labels.
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.
@@ -209,6 +224,7 @@
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. */
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. */
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. */
227 QSignalMapper* barlowSignalMapper; //!< Used to determine which barlow was selected from the popup navigator */
212228
213 // for toolbar button229 // for toolbar button
214 QPixmap* pxmapGlow;230 QPixmap* pxmapGlow;
@@ -249,4 +265,3 @@
249};265};
250266
251#endif /*_OCULARS_HPP_*/267#endif /*_OCULARS_HPP_*/
252
253268
=== modified file 'plugins/Oculars/src/gui/OcularDialog.cpp'
--- plugins/Oculars/src/gui/OcularDialog.cpp 2012-08-14 05:48:00 +0000
+++ plugins/Oculars/src/gui/OcularDialog.cpp 2013-01-28 17:20:27 +0000
@@ -38,7 +38,7 @@
38#include <QStandardItemModel>38#include <QStandardItemModel>
39#include <limits>39#include <limits>
4040
41OcularDialog::OcularDialog(Oculars* pluginPtr, QList<CCD *>* ccds, QList<Ocular *>* oculars, QList<Telescope *>* telescopes) :41OcularDialog::OcularDialog(Oculars* pluginPtr, QList<CCD *>* ccds, QList<Ocular *>* oculars, QList<Telescope *>* telescopes, QList<Barlow *>* barlows) :
42 plugin(pluginPtr)42 plugin(pluginPtr)
43{43{
44 ui = new Ui_ocularDialogForm;44 ui = new Ui_ocularDialogForm;
@@ -60,12 +60,18 @@
60 telescopeModel,60 telescopeModel,
61 telescopeModel->propertyMap());61 telescopeModel->propertyMap());
62 62
63 this->barlows = barlows;
64 barlowTableModel = new PropertyBasedTableModel(this);
65 Barlow* barlowModel = Barlow::barlowModel();
66 barlowTableModel->init(reinterpret_cast<QList<QObject *>* >(barlows), barlowModel, barlowModel->propertyMap());
67
63 validatorPositiveInt = new QIntValidator(0, std::numeric_limits<int>::max(), this);68 validatorPositiveInt = new QIntValidator(0, std::numeric_limits<int>::max(), this);
64 validatorPositiveDouble = new QDoubleValidator(.0, std::numeric_limits<double>::max(), 24, this);69 validatorPositiveDouble = new QDoubleValidator(.0, std::numeric_limits<double>::max(), 24, this);
65 validatorOcularAFOV = new QDoubleValidator(1.0, 120.0, 1, this);70 validatorOcularAFOV = new QDoubleValidator(1.0, 120.0, 1, this);
66 validatorOcularEFL = new QDoubleValidator(1.0, 60.0, 1, this);71 validatorOcularEFL = new QDoubleValidator(1.0, 60.0, 1, this);
67 validatorTelescopeDiameter = new QDoubleValidator(1.0, 1000.0, 1, this);72 validatorTelescopeDiameter = new QDoubleValidator(1.0, 1000.0, 1, this);
68 validatorTelescopeFL = new QDoubleValidator(1.0, 10000.0, 1, this);73 validatorTelescopeFL = new QDoubleValidator(1.0, 10000.0, 1, this);
74 validatorBarlowMultipler = new QDoubleValidator(1.0, 6.0, 1, this);
69 QRegExp nameExp("^\\S.*");75 QRegExp nameExp("^\\S.*");
70 validatorName = new QRegExpValidator(nameExp, this);76 validatorName = new QRegExpValidator(nameExp, this);
71}77}
@@ -146,6 +152,17 @@
146 }152 }
147}153}
148154
155void OcularDialog::deleteSelectedBarlow()
156{
157 if (barlowTableModel->rowCount() > 0) {
158 barlowTableModel->removeRows(ui->barlowListView->currentIndex().row(), 1);
159 if (barlowTableModel->rowCount() > 0) {
160 ui->barlowListView->setCurrentIndex(barlowTableModel->index(0, 1));
161 }
162 plugin->updateLists();
163 }
164}
165
149void OcularDialog::insertNewCCD()166void OcularDialog::insertNewCCD()
150{167{
151 ccdTableModel->insertRows(ccdTableModel->rowCount(), 1);168 ccdTableModel->insertRows(ccdTableModel->rowCount(), 1);
@@ -164,6 +181,12 @@
164 ui->telescopeListView->setCurrentIndex(telescopeTableModel->index(telescopeTableModel->rowCount() - 1, 1));181 ui->telescopeListView->setCurrentIndex(telescopeTableModel->index(telescopeTableModel->rowCount() - 1, 1));
165}182}
166183
184void OcularDialog::insertNewBarlow()
185{
186 barlowTableModel->insertRows(barlowTableModel->rowCount(), 1);
187 ui->barlowListView->setCurrentIndex(barlowTableModel->index(barlowTableModel->rowCount() - 1, 1));
188}
189
167void OcularDialog::moveUpSelectedSensor()190void OcularDialog::moveUpSelectedSensor()
168{191{
169 int index = ui->ccdListView->currentIndex().row();192 int index = ui->ccdListView->currentIndex().row();
@@ -194,6 +217,16 @@
194 }217 }
195}218}
196219
220void OcularDialog::moveUpSelectedBarlow()
221{
222 int index = ui->barlowListView->currentIndex().row();
223 if (index > 0)
224 {
225 barlowTableModel->moveRowUp(index);
226 plugin->updateLists();
227 }
228}
229
197void OcularDialog::moveDownSelectedSensor()230void OcularDialog::moveDownSelectedSensor()
198{231{
199 int index = ui->ccdListView->currentIndex().row();232 int index = ui->ccdListView->currentIndex().row();
@@ -224,6 +257,16 @@
224 }257 }
225}258}
226259
260void OcularDialog::moveDownSelectedBarlow()
261{
262 int index = ui->barlowListView->currentIndex().row();
263 if (index >= 0 && index < barlowTableModel->rowCount() - 1)
264 {
265 barlowTableModel->moveRowDown(index);
266 plugin->updateLists();
267 }
268}
269
227/* ********************************************************************* */270/* ********************************************************************* */
228#if 0271#if 0
229#pragma mark -272#pragma mark -
@@ -288,6 +331,7 @@
288 ui->ccdListView->setModel(ccdTableModel);331 ui->ccdListView->setModel(ccdTableModel);
289 ui->ocularListView->setModel(ocularTableModel);332 ui->ocularListView->setModel(ocularTableModel);
290 ui->telescopeListView->setModel(telescopeTableModel);333 ui->telescopeListView->setModel(telescopeTableModel);
334 ui->barlowListView->setModel(barlowTableModel);
291 335
292 //Now the rest of the actions.336 //Now the rest of the actions.
293 connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));337 connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
@@ -301,6 +345,8 @@
301 connect(ui->deleteCCD, SIGNAL(clicked()), this, SLOT(deleteSelectedCCD()));345 connect(ui->deleteCCD, SIGNAL(clicked()), this, SLOT(deleteSelectedCCD()));
302 connect(ui->addOcular, SIGNAL(clicked()), this, SLOT(insertNewOcular()));346 connect(ui->addOcular, SIGNAL(clicked()), this, SLOT(insertNewOcular()));
303 connect(ui->deleteOcular, SIGNAL(clicked()), this, SLOT(deleteSelectedOcular()));347 connect(ui->deleteOcular, SIGNAL(clicked()), this, SLOT(deleteSelectedOcular()));
348 connect(ui->addBarlow, SIGNAL(clicked()), this, SLOT(insertNewBarlow()));
349 connect(ui->deleteBarlow, SIGNAL(clicked()), this, SLOT(deleteSelectedBarlow()));
304 connect(ui->addTelescope, SIGNAL(clicked()), this, SLOT(insertNewTelescope()));350 connect(ui->addTelescope, SIGNAL(clicked()), this, SLOT(insertNewTelescope()));
305 connect(ui->deleteTelescope, SIGNAL(clicked()), this, SLOT(deleteSelectedTelescope()));351 connect(ui->deleteTelescope, SIGNAL(clicked()), this, SLOT(deleteSelectedTelescope()));
306352
@@ -319,6 +365,8 @@
319 ui->telescopeDiameter->setValidator(validatorTelescopeDiameter);365 ui->telescopeDiameter->setValidator(validatorTelescopeDiameter);
320 ui->ocularName->setValidator(validatorName);366 ui->ocularName->setValidator(validatorName);
321 ui->telescopeName->setValidator(validatorName);367 ui->telescopeName->setValidator(validatorName);
368 ui->barlowName->setValidator(validatorName);
369 ui->barlowMultipler->setValidator(validatorBarlowMultipler);
322 370
323 // The key bindings371 // The key bindings
324 QString bindingString = Oculars::appSettings()->value("bindings/toggle_oculars", "Ctrl+O").toString();372 QString bindingString = Oculars::appSettings()->value("bindings/toggle_oculars", "Ctrl+O").toString();
@@ -348,6 +396,10 @@
348 this, SLOT(moveUpSelectedTelescope()));396 this, SLOT(moveUpSelectedTelescope()));
349 connect(ui->pushButtonMoveTelescopeDown, SIGNAL(pressed()),397 connect(ui->pushButtonMoveTelescopeDown, SIGNAL(pressed()),
350 this, SLOT(moveDownSelectedTelescope()));398 this, SLOT(moveDownSelectedTelescope()));
399 connect(ui->pushButtonMoveBarlowUp, SIGNAL(pressed()),
400 this, SLOT(moveUpSelectedBarlow()));
401 connect(ui->pushButtonMoveBarlowDown, SIGNAL(pressed()),
402 this, SLOT(moveDownSelectedBarlow()));
351403
352 // The CCD mapper404 // The CCD mapper
353 ccdMapper = new QDataWidgetMapper();405 ccdMapper = new QDataWidgetMapper();
@@ -379,6 +431,17 @@
379 ocularMapper, SLOT(setCurrentModelIndex(QModelIndex)));431 ocularMapper, SLOT(setCurrentModelIndex(QModelIndex)));
380 ui->ocularListView->setCurrentIndex(ocularTableModel->index(0, 1));432 ui->ocularListView->setCurrentIndex(ocularTableModel->index(0, 1));
381433
434 // The barlow lens mapper
435 barlowMapper = new QDataWidgetMapper();
436 barlowMapper->setModel(barlowTableModel);
437 barlowMapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit);
438 barlowMapper->addMapping(ui->barlowName, 0);
439 barlowMapper->addMapping(ui->barlowMultipler, 1);
440 barlowMapper->toFirst();
441 connect(ui->barlowListView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
442 barlowMapper, SLOT(setCurrentModelIndex(QModelIndex)));
443 ui->barlowListView->setCurrentIndex(barlowTableModel->index(0, 1));
444
382 // The telescope mapper445 // The telescope mapper
383 telescopeMapper = new QDataWidgetMapper();446 telescopeMapper = new QDataWidgetMapper();
384 telescopeMapper->setModel(telescopeTableModel);447 telescopeMapper->setModel(telescopeTableModel);
385448
=== modified file 'plugins/Oculars/src/gui/OcularDialog.hpp'
--- plugins/Oculars/src/gui/OcularDialog.hpp 2012-04-01 21:12:29 +0000
+++ plugins/Oculars/src/gui/OcularDialog.hpp 2013-01-28 17:20:27 +0000
@@ -27,6 +27,7 @@
27#include "StelDialog.hpp"27#include "StelDialog.hpp"
28#include "StelStyle.hpp"28#include "StelStyle.hpp"
29#include "Telescope.hpp"29#include "Telescope.hpp"
30#include "Barlow.hpp"
3031
31class Ui_ocularDialogForm;32class Ui_ocularDialogForm;
3233
@@ -46,7 +47,7 @@
46 Q_OBJECT47 Q_OBJECT
4748
48public:49public:
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);
50 virtual ~OcularDialog();51 virtual ~OcularDialog();
51 //! Notify that the application style changed52 //! Notify that the application style changed
52 void styleChanged();53 void styleChanged();
@@ -57,15 +58,19 @@
57 void deleteSelectedCCD();58 void deleteSelectedCCD();
58 void deleteSelectedOcular();59 void deleteSelectedOcular();
59 void deleteSelectedTelescope();60 void deleteSelectedTelescope();
61 void deleteSelectedBarlow();
60 void insertNewCCD();62 void insertNewCCD();
61 void insertNewOcular();63 void insertNewOcular();
62 void insertNewTelescope();64 void insertNewTelescope();
65 void insertNewBarlow();
63 void moveUpSelectedSensor();66 void moveUpSelectedSensor();
64 void moveUpSelectedOcular();67 void moveUpSelectedOcular();
65 void moveUpSelectedTelescope();68 void moveUpSelectedTelescope();
69 void moveUpSelectedBarlow();
66 void moveDownSelectedSensor();70 void moveDownSelectedSensor();
67 void moveDownSelectedOcular();71 void moveDownSelectedOcular();
68 void moveDownSelectedTelescope();72 void moveDownSelectedTelescope();
73 void moveDownSelectedBarlow();
69 void retranslate();74 void retranslate();
7075
71signals:76signals:
@@ -96,10 +101,14 @@
96 QDataWidgetMapper* telescopeMapper;101 QDataWidgetMapper* telescopeMapper;
97 QList<Telescope *>* telescopes;102 QList<Telescope *>* telescopes;
98 PropertyBasedTableModel* telescopeTableModel;103 PropertyBasedTableModel* telescopeTableModel;
104 QDataWidgetMapper* barlowMapper;
105 QList<Barlow *>* barlows;
106 PropertyBasedTableModel* barlowTableModel;
99 QDoubleValidator* validatorOcularAFOV;107 QDoubleValidator* validatorOcularAFOV;
100 QDoubleValidator* validatorOcularEFL;108 QDoubleValidator* validatorOcularEFL;
101 QDoubleValidator* validatorTelescopeDiameter;109 QDoubleValidator* validatorTelescopeDiameter;
102 QDoubleValidator* validatorTelescopeFL;110 QDoubleValidator* validatorTelescopeFL;
111 QDoubleValidator* validatorBarlowMultipler;
103 QRegExpValidator* validatorName;112 QRegExpValidator* validatorName;
104 QIntValidator* validatorPositiveInt;113 QIntValidator* validatorPositiveInt;
105 QDoubleValidator* validatorPositiveDouble;114 QDoubleValidator* validatorPositiveDouble;
106115
=== modified file 'plugins/Oculars/src/gui/OcularsGuiPanel.cpp'
--- plugins/Oculars/src/gui/OcularsGuiPanel.cpp 2012-07-06 17:00:39 +0000
+++ plugins/Oculars/src/gui/OcularsGuiPanel.cpp 2013-01-28 17:20:27 +0000
@@ -130,6 +130,9 @@
130 ocularControls = new QGraphicsWidget(this);130 ocularControls = new QGraphicsWidget(this);
131 ocularControls->setParentItem(this);131 ocularControls->setParentItem(this);
132 ocularControls->setVisible(false);132 ocularControls->setVisible(false);
133 barlowControls = new QGraphicsWidget(this);
134 barlowControls->setParentItem(this);
135 barlowControls->setVisible(false);
133 ccdControls = new QGraphicsWidget(this);136 ccdControls = new QGraphicsWidget(this);
134 ccdControls->setParentItem(this);137 ccdControls->setParentItem(this);
135 ccdControls->setVisible(false);138 ccdControls->setVisible(false);
@@ -147,6 +150,9 @@
147 fieldMagnification = new QGraphicsTextItem(telescopeControls);150 fieldMagnification = new QGraphicsTextItem(telescopeControls);
148 fieldFov = new QGraphicsTextItem(telescopeControls);151 fieldFov = new QGraphicsTextItem(telescopeControls);
149152
153 fieldBarlowName = new QGraphicsTextItem(barlowControls);
154 fieldBarlowMultipler = new QGraphicsTextItem(barlowControls);
155
150 QFont newFont = font();156 QFont newFont = font();
151 newFont.setPixelSize(12);157 newFont.setPixelSize(12);
152 setControlsFont(newFont);158 setControlsFont(newFont);
@@ -167,6 +173,9 @@
167 fieldMagnification->setTextWidth(maxWidth);173 fieldMagnification->setTextWidth(maxWidth);
168 fieldFov->setTextWidth(maxWidth);174 fieldFov->setTextWidth(maxWidth);
169175
176 fieldBarlowName->setTextWidth(maxWidth);
177 fieldBarlowMultipler->setTextWidth(maxWidth);
178
170 QPixmap pa(":/graphicGui/btTimeRewind-on.png");179 QPixmap pa(":/graphicGui/btTimeRewind-on.png");
171 QPixmap prevArrow = pa.scaledToHeight(lineHeight, Qt::SmoothTransformation);180 QPixmap prevArrow = pa.scaledToHeight(lineHeight, Qt::SmoothTransformation);
172 QPixmap paOff(":/graphicGui/btTimeRewind-off.png");181 QPixmap paOff(":/graphicGui/btTimeRewind-off.png");
@@ -190,6 +199,18 @@
190 QPixmap(),199 QPixmap(),
191 defaultAction);200 defaultAction);
192 nextOcularButton->setToolTip(q_("Next ocular"));201 nextOcularButton->setToolTip(q_("Next ocular"));
202 prevBarlowButton = new StelButton(barlowControls,
203 prevArrow,
204 prevArrowOff,
205 QPixmap(),
206 defaultAction);
207 prevBarlowButton->setToolTip(q_("Previous Barlow lens"));
208 nextBarlowButton = new StelButton(barlowControls,
209 nextArrow,
210 nextArrowOff,
211 QPixmap(),
212 defaultAction);
213 nextBarlowButton->setToolTip(q_("Next Barlow lens"));
193 prevCcdButton = new StelButton(ccdControls,214 prevCcdButton = new StelButton(ccdControls,
194 prevArrow,215 prevArrow,
195 prevArrowOff,216 prevArrowOff,
@@ -227,6 +248,10 @@
227 ocularsPlugin, SLOT(decrementCCDIndex()));248 ocularsPlugin, SLOT(decrementCCDIndex()));
228 connect(prevTelescopeButton, SIGNAL(triggered()),249 connect(prevTelescopeButton, SIGNAL(triggered()),
229 ocularsPlugin, SLOT(decrementTelescopeIndex()));250 ocularsPlugin, SLOT(decrementTelescopeIndex()));
251 connect(nextBarlowButton, SIGNAL(triggered()),
252 ocularsPlugin, SLOT(incrementBarlowIndex()));
253 connect(prevBarlowButton, SIGNAL(triggered()),
254 ocularsPlugin, SLOT(decrementBarlowIndex()));
230255
231 QColor cOn(255, 255, 255);256 QColor cOn(255, 255, 255);
232 QColor cOff(102, 102, 102);257 QColor cOff(102, 102, 102);
@@ -368,6 +393,7 @@
368 ocularControls->setMaximumWidth(width);393 ocularControls->setMaximumWidth(width);
369 ccdControls->setMaximumWidth(width);394 ccdControls->setMaximumWidth(width);
370 telescopeControls->setMaximumWidth(width);395 telescopeControls->setMaximumWidth(width);
396 barlowControls->setMaximumWidth(width);
371 resize(width + left + right, 10);397 resize(width + left + right, 10);
372 buttonBar->resize(width, size().height());398 buttonBar->resize(width, size().height());
373 updateMainButtonsPositions();399 updateMainButtonsPositions();
@@ -394,6 +420,8 @@
394 this, SLOT(updateCcdControls()));420 this, SLOT(updateCcdControls()));
395 connect(ocularsPlugin, SIGNAL(selectedTelescopeChanged()),421 connect(ocularsPlugin, SIGNAL(selectedTelescopeChanged()),
396 this, SLOT(updateTelescopeControls()));422 this, SLOT(updateTelescopeControls()));
423 connect(ocularsPlugin, SIGNAL(selectedBarlowChanged()),
424 this, SLOT(updateTelescopeControls()));
397425
398 //Night mode426 //Night mode
399 connect(&stelApp, SIGNAL(colorSchemeChanged(const QString&)),427 connect(&stelApp, SIGNAL(colorSchemeChanged(const QString&)),
@@ -418,6 +446,7 @@
418 {446 {
419 setOcularControlsVisible(false);447 setOcularControlsVisible(false);
420 setTelescopeControlsVisible(false);448 setTelescopeControlsVisible(false);
449 setBarlowControlsVisible(false);
421 updatePosition();450 updatePosition();
422 }451 }
423}452}
@@ -433,6 +462,7 @@
433 setOcularControlsVisible(false);462 setOcularControlsVisible(false);
434 setCcdControlsVisible(false);463 setCcdControlsVisible(false);
435 setTelescopeControlsVisible(false);464 setTelescopeControlsVisible(false);
465 setBarlowControlsVisible(false);
436 updatePosition();466 updatePosition();
437}467}
438468
@@ -545,6 +575,76 @@
545 updateTelescopeControls();//Contains a call to updatePosition()575 updateTelescopeControls();//Contains a call to updatePosition()
546}576}
547577
578void OcularsGuiPanel::updateBarlowControls()
579{
580 if (ocularsPlugin->flagShowCCD)
581 {
582 setBarlowControlsVisible(false);
583 return;
584 }
585 int index = ocularsPlugin->selectedOcularIndex;
586 Ocular* ocular = ocularsPlugin->oculars[index];
587
588 Barlow* barlow = ocularsPlugin->selectedBarlow();
589 index = ocularsPlugin->selectedBarlowIndex;
590
591 QString fullName;
592 QString multiplerString;
593 if (barlow != NULL)
594 {
595 QString name = barlow->name();
596 if (name.isEmpty())
597 {
598 fullName = QString(q_("Barlow #%1")).arg(index);
599 }
600 else
601 {
602 fullName = QString(q_("Barlow #%1: %2")).arg(index).arg(name);
603 }
604 multiplerString = QString(q_("Multiplicity: %1")).arg(barlow->multipler());
605 multiplerString.append(QChar(0x00D7));
606 }
607 else
608 {
609 fullName = QString(q_("Barlow: None"));
610 multiplerString = QString(q_("Multiplicity: N/A"));
611 }
612 fieldBarlowName->setPlainText(fullName);
613 fieldBarlowMultipler->setPlainText(multiplerString);
614 fieldOcularFl->setToolTip(q_("Multiplicity of barlow lens"));
615
616 qreal posX = 0.;
617 qreal posY = 0.;
618 qreal widgetWidth = 0.;
619 qreal widgetHeight = 0.;
620
621 //Prev button
622 qreal heightAdjustment = (fieldBarlowName->boundingRect().height() - prevBarlowButton->boundingRect().height()) / 2.;
623 prevBarlowButton->setPos(posX, round(posY + heightAdjustment));
624 posX += prevBarlowButton->boundingRect().width();
625 widgetWidth += prevBarlowButton->boundingRect().width();
626
627 //Name field
628 fieldBarlowName->setPos(posX, posY);
629 posX += fieldBarlowName->boundingRect().width();
630 widgetWidth += fieldBarlowName->boundingRect().width();
631 widgetHeight += fieldBarlowName->boundingRect().height();
632
633 //Next button
634 nextBarlowButton->setPos(posX, posY + heightAdjustment);
635 widgetWidth += nextBarlowButton->boundingRect().width();
636
637 posX = prevBarlowButton->boundingRect().width();
638 posY += fieldBarlowName->boundingRect().height();
639 fieldBarlowMultipler->setPos(posX, posY);
640 widgetHeight += fieldBarlowMultipler->boundingRect().height();
641
642 barlowControls->setMinimumSize(widgetWidth, widgetHeight);
643 barlowControls->resize(widgetWidth, widgetHeight);
644
645 setBarlowControlsVisible(true);
646}
647
548void OcularsGuiPanel::updateCcdControls()648void OcularsGuiPanel::updateCcdControls()
549{649{
550 setOcularControlsVisible(false);650 setOcularControlsVisible(false);
@@ -702,6 +802,8 @@
702 int index = ocularsPlugin->selectedOcularIndex;802 int index = ocularsPlugin->selectedOcularIndex;
703 Ocular* ocular = ocularsPlugin->oculars[index];803 Ocular* ocular = ocularsPlugin->oculars[index];
704 Q_ASSERT(ocular);804 Q_ASSERT(ocular);
805
806 Barlow *barlow = ocularsPlugin->selectedBarlow();
705807
706 if (ocular->isBinoculars())808 if (ocular->isBinoculars())
707 {809 {
@@ -720,12 +822,12 @@
720 nextTelescopeButton->setVisible(true);822 nextTelescopeButton->setVisible(true);
721 fieldTelescopeName->setVisible(true);823 fieldTelescopeName->setVisible(true);
722824
723 fieldMagnification->setToolTip(q_("Magnification provided by this ocular/telescope combination"));825 fieldMagnification->setToolTip(q_("Magnification provided by this ocular/barlow/telescope combination"));
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"));
725 }827 }
726828
727 //WTF? Rounding?829 //WTF? Rounding?
728 double magnification = ((int)(ocular->magnification(telescope) * 10.0)) / 10.0;830 double magnification = ((int)(ocular->magnification(telescope, barlow) * 10.0)) / 10.0;
729 QString magnificationString = QString::number(magnification);831 QString magnificationString = QString::number(magnification);
730 magnificationString.append(QChar(0x00D7));832 magnificationString.append(QChar(0x00D7));
731 QString magnificationLabel = QString(q_("Magnification: %1"))833 QString magnificationLabel = QString(q_("Magnification: %1"))
@@ -735,7 +837,7 @@
735 posY += fieldMagnification->boundingRect().height();837 posY += fieldMagnification->boundingRect().height();
736 widgetHeight += fieldMagnification->boundingRect().height();838 widgetHeight += fieldMagnification->boundingRect().height();
737839
738 double fov = ((int)(ocular->actualFOV(telescope) * 10000.00)) / 10000.0;840 double fov = ((int)(ocular->actualFOV(telescope, barlow) * 10000.00)) / 10000.0;
739 QString fovString = QString::number(fov) + QChar(0x00B0);841 QString fovString = QString::number(fov) + QChar(0x00B0);
740 QString fovLabel = QString(q_("FOV: %1")).arg(fovString);842 QString fovLabel = QString(q_("FOV: %1")).arg(fovString);
741 fieldFov->setPlainText(fovLabel);843 fieldFov->setPlainText(fovLabel);
@@ -759,9 +861,34 @@
759 telescopeControls->resize(widgetWidth, widgetHeight);861 telescopeControls->resize(widgetWidth, widgetHeight);
760 setTelescopeControlsVisible(true);862 setTelescopeControlsVisible(true);
761863
864 updateBarlowControls();
762 updatePosition();865 updatePosition();
763}866}
764867
868void OcularsGuiPanel::setBarlowControlsVisible(bool show)
869{
870 if (show)
871 {
872 if (!barlowControls->isVisible())
873 {
874 barlowControls->setVisible(true);
875 mainLayout->insertItem(2, barlowControls);
876 }
877 }
878 else
879 {
880 if (barlowControls->isVisible())
881 {
882 mainLayout->removeItem(barlowControls);
883 barlowControls->setVisible(false);
884 }
885 }
886 mainLayout->invalidate();
887 mainLayout->activate();
888 resize(mainLayout->geometry().width(),
889 mainLayout->geometry().height());
890}
891
765void OcularsGuiPanel::setOcularControlsVisible(bool show)892void OcularsGuiPanel::setOcularControlsVisible(bool show)
766{893{
767 if (show)894 if (show)
@@ -881,6 +1008,8 @@
881 Q_ASSERT(fieldTelescopeName);1008 Q_ASSERT(fieldTelescopeName);
882 Q_ASSERT(fieldMagnification);1009 Q_ASSERT(fieldMagnification);
883 Q_ASSERT(fieldFov);1010 Q_ASSERT(fieldFov);
1011 Q_ASSERT(fieldBarlowName);
1012 Q_ASSERT(fieldBarlowMultipler);
8841013
885 fieldOcularName->setDefaultTextColor(color);1014 fieldOcularName->setDefaultTextColor(color);
886 fieldOcularFl->setDefaultTextColor(color);1015 fieldOcularFl->setDefaultTextColor(color);
@@ -891,6 +1020,8 @@
891 fieldTelescopeName->setDefaultTextColor(color);1020 fieldTelescopeName->setDefaultTextColor(color);
892 fieldMagnification->setDefaultTextColor(color);1021 fieldMagnification->setDefaultTextColor(color);
893 fieldFov->setDefaultTextColor(color);1022 fieldFov->setDefaultTextColor(color);
1023 fieldBarlowName->setDefaultTextColor(color);
1024 fieldBarlowMultipler->setDefaultTextColor(color);
894}1025}
8951026
896void OcularsGuiPanel::setControlsFont(const QFont& font)1027void OcularsGuiPanel::setControlsFont(const QFont& font)
@@ -904,6 +1035,8 @@
904 Q_ASSERT(fieldTelescopeName);1035 Q_ASSERT(fieldTelescopeName);
905 Q_ASSERT(fieldMagnification);1036 Q_ASSERT(fieldMagnification);
906 Q_ASSERT(fieldFov);1037 Q_ASSERT(fieldFov);
1038 Q_ASSERT(fieldBarlowName);
1039 Q_ASSERT(fieldBarlowMultipler);
9071040
908 fieldOcularName->setFont(font);1041 fieldOcularName->setFont(font);
909 fieldOcularFl->setFont(font);1042 fieldOcularFl->setFont(font);
@@ -914,6 +1047,8 @@
914 fieldTelescopeName->setFont(font);1047 fieldTelescopeName->setFont(font);
915 fieldMagnification->setFont(font);1048 fieldMagnification->setFont(font);
916 fieldFov->setFont(font);1049 fieldFov->setFont(font);
1050 fieldBarlowName->setFont(font);
1051 fieldBarlowMultipler->setFont(font);
917}1052}
9181053
919void OcularsGuiPanel::setButtonsNightMode(bool nightMode)1054void OcularsGuiPanel::setButtonsNightMode(bool nightMode)
9201055
=== modified file 'plugins/Oculars/src/gui/OcularsGuiPanel.hpp'
--- plugins/Oculars/src/gui/OcularsGuiPanel.hpp 2012-01-11 10:50:37 +0000
+++ plugins/Oculars/src/gui/OcularsGuiPanel.hpp 2013-01-28 17:20:27 +0000
@@ -61,7 +61,8 @@
61 //! Updates the information that depends on the current telescope.61 //! Updates the information that depends on the current telescope.
62 //! Called in both updateOcularControls() and updateCcdControls().62 //! Called in both updateOcularControls() and updateCcdControls().
63 void updateTelescopeControls();63 void updateTelescopeControls();
6464 //! Updates the information that depends on the current barlow
65 void updateBarlowControls();
65 //! Sets the color scheme (day/night mode)66 //! Sets the color scheme (day/night mode)
66 void setColorScheme(const QString& schemeName);67 void setColorScheme(const QString& schemeName);
6768
@@ -78,6 +79,7 @@
78 //! Mini-toolbar holding StelButtons79 //! Mini-toolbar holding StelButtons
79 QGraphicsWidget* buttonBar;80 QGraphicsWidget* buttonBar;
80 QGraphicsWidget* ocularControls;81 QGraphicsWidget* ocularControls;
82 QGraphicsWidget* barlowControls;
81 QGraphicsWidget* ccdControls;83 QGraphicsWidget* ccdControls;
82 QGraphicsWidget* telescopeControls;84 QGraphicsWidget* telescopeControls;
8385
@@ -95,6 +97,10 @@
95 StelButton* nextTelescopeButton;97 StelButton* nextTelescopeButton;
96 StelButton* prevCcdButton;98 StelButton* prevCcdButton;
97 StelButton* nextCcdButton;99 StelButton* nextCcdButton;
100 StelButton* prevBarlowButton;
101 StelButton* nextBarlowButton;
102 QGraphicsTextItem* fieldBarlowName;
103 QGraphicsTextItem* fieldBarlowMultipler;
98 QGraphicsTextItem* fieldOcularName;104 QGraphicsTextItem* fieldOcularName;
99 QGraphicsTextItem* fieldOcularFl;105 QGraphicsTextItem* fieldOcularFl;
100 QGraphicsTextItem* fieldOcularAfov;106 QGraphicsTextItem* fieldOcularAfov;
@@ -118,6 +124,7 @@
118 void setOcularControlsVisible(bool show);124 void setOcularControlsVisible(bool show);
119 void setCcdControlsVisible(bool show);125 void setCcdControlsVisible(bool show);
120 void setTelescopeControlsVisible(bool show);126 void setTelescopeControlsVisible(bool show);
127 void setBarlowControlsVisible(bool show);
121 //! Updates the positions of the buttons inside the button bar.128 //! Updates the positions of the buttons inside the button bar.
122 void updateMainButtonsPositions();129 void updateMainButtonsPositions();
123130
124131
=== modified file 'plugins/Oculars/src/gui/ocularDialog.ui'
--- plugins/Oculars/src/gui/ocularDialog.ui 2012-08-10 14:45:17 +0000
+++ plugins/Oculars/src/gui/ocularDialog.ui 2013-01-28 17:20:27 +0000
@@ -596,6 +596,166 @@
596 </item>596 </item>
597 </layout>597 </layout>
598 </widget>598 </widget>
599 <widget class="QWidget" name="tab">
600 <attribute name="title">
601 <string>Barlow lenses</string>
602 </attribute>
603 <layout class="QHBoxLayout" name="horizontalLayout_4">
604 <item>
605 <layout class="QVBoxLayout" name="verticalLayout_10">
606 <item>
607 <widget class="QLabel" name="label_6">
608 <property name="text">
609 <string>Barlows</string>
610 </property>
611 </widget>
612 </item>
613 <item>
614 <widget class="QListView" name="barlowListView"/>
615 </item>
616 <item>
617 <widget class="QFrame" name="frame_5">
618 <property name="frameShape">
619 <enum>QFrame::StyledPanel</enum>
620 </property>
621 <property name="frameShadow">
622 <enum>QFrame::Raised</enum>
623 </property>
624 <layout class="QHBoxLayout" name="horizontalLayout_3">
625 <property name="leftMargin">
626 <number>0</number>
627 </property>
628 <property name="topMargin">
629 <number>5</number>
630 </property>
631 <property name="rightMargin">
632 <number>0</number>
633 </property>
634 <property name="bottomMargin">
635 <number>0</number>
636 </property>
637 <item>
638 <widget class="QPushButton" name="addBarlow">
639 <property name="minimumSize">
640 <size>
641 <width>0</width>
642 <height>24</height>
643 </size>
644 </property>
645 <property name="text">
646 <string>Add</string>
647 </property>
648 </widget>
649 </item>
650 <item>
651 <widget class="QPushButton" name="pushButtonMoveBarlowUp">
652 <property name="sizePolicy">
653 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
654 <horstretch>0</horstretch>
655 <verstretch>0</verstretch>
656 </sizepolicy>
657 </property>
658 <property name="minimumSize">
659 <size>
660 <width>24</width>
661 <height>24</height>
662 </size>
663 </property>
664 </widget>
665 </item>
666 <item>
667 <widget class="QPushButton" name="pushButtonMoveBarlowDown">
668 <property name="sizePolicy">
669 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
670 <horstretch>0</horstretch>
671 <verstretch>0</verstretch>
672 </sizepolicy>
673 </property>
674 <property name="minimumSize">
675 <size>
676 <width>24</width>
677 <height>24</height>
678 </size>
679 </property>
680 </widget>
681 </item>
682 <item>
683 <widget class="QPushButton" name="deleteBarlow">
684 <property name="minimumSize">
685 <size>
686 <width>0</width>
687 <height>24</height>
688 </size>
689 </property>
690 <property name="text">
691 <string>Delete</string>
692 </property>
693 </widget>
694 </item>
695 </layout>
696 </widget>
697 </item>
698 </layout>
699 </item>
700 <item>
701 <layout class="QVBoxLayout" name="verticalLayout_9">
702 <item>
703 <widget class="QFrame" name="frame_2">
704 <property name="frameShape">
705 <enum>QFrame::StyledPanel</enum>
706 </property>
707 <property name="frameShadow">
708 <enum>QFrame::Raised</enum>
709 </property>
710 <layout class="QFormLayout" name="formLayout_4">
711 <item row="0" column="0">
712 <widget class="QLabel" name="label_7">
713 <property name="text">
714 <string>Name</string>
715 </property>
716 </widget>
717 </item>
718 <item row="0" column="1">
719 <widget class="QLineEdit" name="barlowName">
720 <property name="maxLength">
721 <number>50</number>
722 </property>
723 </widget>
724 </item>
725 <item row="1" column="0">
726 <widget class="QLabel" name="label_13">
727 <property name="text">
728 <string>Multiplicity</string>
729 </property>
730 </widget>
731 </item>
732 <item row="1" column="1">
733 <widget class="QLineEdit" name="barlowMultipler">
734 <property name="maxLength">
735 <number>5</number>
736 </property>
737 </widget>
738 </item>
739 </layout>
740 </widget>
741 </item>
742 <item>
743 <spacer name="verticalSpacer_4">
744 <property name="orientation">
745 <enum>Qt::Vertical</enum>
746 </property>
747 <property name="sizeHint" stdset="0">
748 <size>
749 <width>20</width>
750 <height>40</height>
751 </size>
752 </property>
753 </spacer>
754 </item>
755 </layout>
756 </item>
757 </layout>
758 </widget>
599 <widget class="QWidget" name="CCD">759 <widget class="QWidget" name="CCD">
600 <attribute name="title">760 <attribute name="title">
601 <string>Sensors</string>761 <string>Sensors</string>