Merge lp:~i-martividal/stellarium/Observability-1.0.2 into lp:stellarium

Proposed by Ivan Marti-Vidal
Status: Rejected
Rejected by: Alexander Wolf
Proposed branch: lp:~i-martividal/stellarium/Observability-1.0.2
Merge into: lp:stellarium
Diff against target: 413 lines (+103/-26)
5 files modified
plugins/Observability/src/Observability.cpp (+54/-18)
plugins/Observability/src/Observability.hpp (+7/-2)
plugins/Observability/src/gui/ObservabilityDialog.cpp (+17/-3)
plugins/Observability/src/gui/ObservabilityDialog.hpp (+1/-0)
plugins/Observability/src/gui/ObservabilityDialog.ui (+24/-3)
To merge this branch: bzr merge lp:~i-martividal/stellarium/Observability-1.0.2
Reviewer Review Type Date Requested Status
Alexander Wolf Needs Information
Review via email: mp+121449@code.launchpad.net

Description of the change

Dear all,

I've finally implemented also the "horizon altitude" feature. I think it may be interesting especially for the people who have limited visibility at low elevations, so they can know exactly when they can begin (or finish) to observe a given object.

I'm afraid I didn't have much time to hunt for possible bugs, but it seems to be working well for Sun, Moon, and stars. Notice that, if atmospheric refraction is On, the horizon altitude is corrected accordingly.

    Best Wishes,

           Ivan

P.S: The issue with the text being blocked by the config bars is also solved.

To post a comment you must log in.
Revision history for this message
Alexander Wolf (alexwolf) wrote :

Oops... Sorry. I'm add fix for information block and now your code has conflicts. Please look at my patch and drop or accept it.

review: Needs Information
5569. By Ivan Marti-Vidal

Solved conflict with current trunk

Revision history for this message
gzotti (georg-zotti) wrote :

There is IMHO no need to rush and merge this branch now on a half-weekly basis after every bugfix. 0.11.4 is out with the current version, and there are several ideas still to be implemented, like Heliacal events done properly. Test your branch thoroughly (Use it, compare with good almanacs, ...) for a week or so, find combinations with other plugins/settings that may conflict and struggle with screen locations etc., try to avoid these troubles, and wait for user reactions in the next 2-4 weeks or so. Branch merges make most sense shortly before releasing the next version.

But I don't want to inhibit your enthusiasm! Meanwhile, a few more ideas that relate to your plugin:

A challenge about the horizons: What I would like to see would be a reverse test that involves the current landscape (if landscape is active): if there is a steep valley, when will the object peek through the mountains? Or when will the object leave the trees? This would involve extensions in the landscape classes, though: check for texture transparency in a sampled pixel. Like a method bool Landscape::isBlocked(const float az, const float alt) or bool Landscape::isBlocked(const Vec3f v). I will likely not be able to do so in the next few weeks.

On the other hand, a feature that some observers have asked me for, maybe with your date/time search code you can help here: step "one day/week forward/backward with the sun at the current altitude". This allows the simulation of the sky at nightfall for longer passages than just stepping solar or sidereal days. Of course, if currently set solar altitude is no longer reached (e.g. "white nights" in the polar region), try to keep close to the conditions. This functionality would however likely go into StelCore and may involve just observer positions on earth (but not necessarily!)

If Alex wants to merge more frequently, it's OK for me of course.

Revision history for this message
Alexander Wolf (alexwolf) wrote :

I think you can develop version 1.0.3 or maybe 1.1 of plugin. With tests of course. I plan add some code for improvement of text display and proposed for merging to your branch, Ivan.

Unmerged revisions

5569. By Ivan Marti-Vidal

Solved conflict with current trunk

5568. By Ivan Marti-Vidal

Implemented altitude of horizon different than zero

5567. By Ivan Marti-Vidal

Refraction implemented. Text no longer is below config bars.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Observability/src/Observability.cpp'
2--- plugins/Observability/src/Observability.cpp 2012-08-27 13:29:14 +0000
3+++ plugins/Observability/src/Observability.cpp 2012-08-27 18:20:25 +0000
4@@ -93,6 +93,7 @@
5 MoonPerilune = 0.0024236308; // Smallest Earth-Moon distance (in AU).
6 nextFullMoon = 0.0;
7 prevFullMoon = 0.0;
8+ RefracHoriz = 0.0; // Geometric altitude at refraction-corrected horizon.
9 selName = "";
10
11
12@@ -123,6 +124,9 @@
13 if (!conf->contains("Observability/Sun_Altitude"))
14 conf->setValue("Observability/Sun_Altitude", 12);
15
16+ if (!conf->contains("Observability/Horizon_Altitude"))
17+ conf->setValue("Observability/Horizon_Altitude", 0);
18+
19 if (!conf->contains("Observability/show_FullMoon"))
20 conf->setValue("Observability/show_FullMoon", true);
21
22@@ -136,7 +140,9 @@
23 // Load settings from main config file
24 fontSize = conf->value("Observability/font_size",15).toInt();
25 iAltitude = conf->value("Observability/Sun_Altitude",12).toInt();
26+ iHorizAltitude = conf->value("Observability/Horizon_Altitude",0).toInt();
27 AstroTwiAlti = -((double) iAltitude)/Rad2Deg ;
28+ HorizAlti = ((double) iHorizAltitude)/Rad2Deg ;
29 font.setPixelSize(fontSize);
30 QString fontColorStr = conf->value("Observability/font_color", "0,0.5,1").toString();
31 fontColor = StelUtils::strToVec3f(fontColorStr);
32@@ -305,6 +311,24 @@
33 ObserverLoc[2] = currheight*std::sin(currlat);
34 };
35
36+
37+// Add refraction, if necessary:
38+ Vec3d TempRefr;
39+ TempRefr[0] = std::cos(HorizAlti); //1.0;
40+ TempRefr[1] = 0.0;
41+ TempRefr[2] = std::sin(HorizAlti); //0.0;
42+ Vec3d CorrRefr = core->altAzToEquinoxEqu(TempRefr,StelCore::RefractionAuto);
43+ TempRefr = core->equinoxEquToAltAz(CorrRefr,StelCore::RefractionOff);
44+ double RefracAlt = std::asin(TempRefr[2]);
45+
46+ if (std::abs(RefracHoriz-RefracAlt)>2.91e-4) // Diference larger than 1 arcminute.
47+ { // Configuration for refraction changed notably:
48+ RefracHoriz = RefracAlt;
49+ configChanged = true;
50+ souChanged = true;
51+ };
52+
53+
54 // If we have changed latitude (or year), we update the vector of Sun's hour
55 // angles at twilight, and re-compute Sun/Moon ephemeris (if selected):
56 if (locChanged || yearChanged || configChanged)
57@@ -412,7 +436,7 @@
58 /////////////////////////////////////////////////////////////////
59 // NOW WE COMPUTE RISE/SET/TRANSIT TIMES FOR THE CURRENT DAY:
60 double currH = HourAngle(mylat,alti,selDec);
61- horizH = HourAngle(mylat,0.0,selDec);
62+ horizH = HourAngle(mylat,RefracHoriz,selDec);
63 QString RS1, RS2, Cul; // strings with Rise/Set/Culmination times
64 double Rise, Set; // Actual Rise/Set times (in GMT).
65 int d1,m1,s1,d2,m2,s2,dc,mc,sc; // Integers for the time spans in hh:mm:ss.
66@@ -493,7 +517,7 @@
67 };
68 }
69 else { // The source is either circumpolar or never rises:
70- (alti>0.0)? RS1 = q_("Circumpolar."): RS1 = q_("No rise.");
71+ (alti>RefracHoriz)? RS1 = q_("Circumpolar."): RS1 = q_("No rise.");
72 RS2 = "";
73 };
74
75@@ -505,8 +529,8 @@
76 transit = LocPos[1]<0.0;
77 };
78
79- if (culmAlt<halfpi) { // Source can be observed.
80- double altiAtCulmi = Rad2Deg*(halfpi-culmAlt);
81+ if (culmAlt<halfpi-RefracHoriz) { // Source can be observed.
82+ double altiAtCulmi = Rad2Deg*(halfpi-culmAlt-RefracHoriz);
83 double2hms(TFrac*currH,dc,mc,sc);
84
85 // String with the time span for culmination:
86@@ -543,7 +567,7 @@
87 PlanetRADec(core);} // Re-compute ephemeris.
88
89 else { // Object is fixed on the sky.
90- double auxH = HourAngle(mylat,0.0,selDec);
91+ double auxH = HourAngle(mylat,RefracHoriz,selDec);
92 double auxSidT1 = toUnsignedRA(selRA - auxH);
93 double auxSidT2 = toUnsignedRA(selRA + auxH);
94 for (int i=0;i<nDays;i++) {
95@@ -559,7 +583,7 @@
96 if ((souChanged || locChanged || yearChanged)) {
97 bestNight=""; ObsRange = "";
98
99- if (culmAlt>=halfpi) { // Source cannot be seen.
100+ if (culmAlt>=halfpi-RefracHoriz) { // Source cannot be seen.
101 ObsRange = q_("Source is not observable.");
102 AcroCos = q_("No Acronychal nor Cosmical rise/set.");
103 }
104@@ -670,8 +694,8 @@
105
106 int spacing = (int) (1.3* ( (double) fontSize)); // between lines
107 int spacing2 = 6*fontSize; // between daily and yearly results
108- int yLine = 8*fontSize+110;
109- int xLine = 80;
110+ int yLine = 10*fontSize+70;
111+ int xLine = 70;
112
113 if (show_Today)
114 {
115@@ -758,7 +782,6 @@
116 hfloat = std::abs(hfloat);
117 double ffrac = std::modf(hfloat,&f1);
118 double ffrac2 = std::modf(60.*ffrac,&f2);
119- //FIXME: ffrac2 is unused variable; need fix
120 ffrac2 = std::modf(3600.*(ffrac-f2/60.),&f3);
121 h1 = (int)f1 ; h2 = (int)std::abs(f2+0.0*ffrac2) ; h3 = (int)std::abs(f3);
122 }
123@@ -770,7 +793,6 @@
124 double Observability::toUnsignedRA(double RA)
125 {
126 double tempRA,tempmod;
127- //FIXME: tempmod is unused variable; need fix
128 if (RA<0.0) {tempmod = std::modf(-RA/24.,&tempRA); RA += 24.*(tempRA+1.0)+0.0*tempmod;};
129 double auxRA = 24.*std::modf(RA/24.,&tempRA);
130 auxRA += (auxRA<0.0)?24.0:((auxRA>24.0)?-24.0:0.0);
131@@ -832,7 +854,7 @@
132
133 for (int i=0;i<nDays;i++) {
134 getPlanetCoords(core,yearJD[i],ObjectRA[i],ObjectDec[i],false);
135- TempH = HourAngle(mylat,0.0,ObjectDec[i]);
136+ TempH = HourAngle(mylat,RefracHoriz,ObjectDec[i]);
137 ObjectH0[i] = TempH;
138 ObjectSidT[0][i] = toUnsignedRA(ObjectRA[i]-TempH);
139 ObjectSidT[1][i] = toUnsignedRA(ObjectRA[i]+TempH);
140@@ -887,7 +909,7 @@
141
142 for (int i=0; i<nDays; i++) {
143 TempH = HourAngle(mylat,AstroTwiAlti,SunDec[i]);
144- TempH00 = HourAngle(mylat,0.0,SunDec[i]);
145+ TempH00 = HourAngle(mylat,RefracHoriz,SunDec[i]);
146 if (TempH>0.0) {
147 SunSidT[0][i] = toUnsignedRA(SunRA[i]-TempH*(1.00278));
148 SunSidT[1][i] = toUnsignedRA(SunRA[i]+TempH*(1.00278));}
149@@ -925,7 +947,7 @@
150 for (int j=0;j<nBin;j++) {
151 Hour = toUnsignedRA(SunSidT[1][i]+deltaT*(double)j - ObjectRA[i]);
152 Hour -= (Hour>12.)?24.0:0.0;
153- if (std::abs(Hour)<ObjectH0[i] || (ObjectH0[i] < 0.0 && alti>0.0)) {return true;};
154+ if (std::abs(Hour)<ObjectH0[i] || (ObjectH0[i] < 0.0 && alti>RefracHoriz)) {return true;};
155 };
156
157
158@@ -1150,7 +1172,7 @@
159 double Hhoriz, RA, Dec, RAS, DecS, TempH, jd1, tempEphH, currSidT;
160 Vec3d Observer;
161
162- Hhoriz = HourAngle(mylat,0.0,selDec);
163+ Hhoriz = HourAngle(mylat,RefracHoriz,selDec);
164 bool raises = Hhoriz > 0.0;
165
166
167@@ -1190,7 +1212,7 @@
168
169 toRADec(Pos2,RA,Dec);
170 Vec3d MoonAltAz = core->equinoxEquToAltAz(Pos2,StelCore::RefractionOff);
171- raised = MoonAltAz[2] > 0.0;
172+ raised = MoonAltAz[2] > RefracHoriz;
173
174 // Initial guesses of rise/set/transit times.
175 // They are called 'Moon', but are also used for the Sun or planet:
176@@ -1232,7 +1254,7 @@
177 Hcurr -= (Hcurr>12.)?24.0:0.0;
178
179 // H at horizon for mod. coordinates:
180- Hhoriz = HourAngle(mylat,0.0,Dec);
181+ Hhoriz = HourAngle(mylat,RefracHoriz,Dec);
182 // Compute eph. times for mod. coordinates:
183 TempH = (-Hhoriz-Hcurr)*TFrac;
184 if (raised==false) TempH += (TempH<0.0)?24.0:0.0;
185@@ -1266,7 +1288,7 @@
186 Hcurr -= (raised)?24.:0.;
187 Hcurr += (Hcurr<-12.)?24.0:0.0;
188 // H at horizon for mod. coordinates:
189- Hhoriz = HourAngle(mylat,0.0,Dec);
190+ Hhoriz = HourAngle(mylat,RefracHoriz,Dec);
191 // Compute eph. times for mod. coordinates:
192 TempH = (Hhoriz-Hcurr)*TFrac;
193 if (raised==false) TempH -= (TempH>0.0)?24.0:0.0;
194@@ -1521,6 +1543,7 @@
195 // Set defaults
196 conf->setValue("Observability/font_size", 15);
197 conf->setValue("Observability/Sun_Altitude", 12);
198+ conf->setValue("Observability/Horizon_Altitude", 0);
199 conf->setValue("Observability/font_color", "0,0.5,1");
200 conf->setValue("Observability/show_AcroCos", true);
201 conf->setValue("Observability/show_Good_Nights", true);
202@@ -1548,8 +1571,9 @@
203 // show_SuperMoon = conf->value("Observability/show_SuperMoon", true).toBool();
204
205 iAltitude = conf->value("Observability/Sun_Altitude", 12).toInt();
206+ iHorizAltitude = conf->value("Observability/Horizon_Altitude", 0).toInt();
207 AstroTwiAlti = -((double)iAltitude)/Rad2Deg ;
208-
209+ HorizAlti = ((double)iHorizAltitude)/Rad2Deg ;
210
211 }
212
213@@ -1560,6 +1584,7 @@
214 // Set updated values
215 conf->setValue("Observability/font_size", fontSize);
216 conf->setValue("Observability/Sun_Altitude", iAltitude);
217+ conf->setValue("Observability/Horizon_Altitude", iHorizAltitude);
218 conf->setValue("Observability/font_color", fontColorStr);
219 conf->setValue("Observability/show_AcroCos", show_AcroCos);
220 conf->setValue("Observability/show_Good_Nights", show_Good_Nights);
221@@ -1618,6 +1643,11 @@
222 return iAltitude;
223 }
224
225+int Observability::getHorizAltitude(void)
226+{
227+ return iHorizAltitude;
228+}
229+
230 void Observability::setFontColor(int color, int value)
231 {
232 float fValue = (float)(value) / 100.;
233@@ -1636,6 +1666,12 @@
234 configChanged = true;
235 }
236
237+void Observability::setHorizAltitude(int value)
238+{
239+ HorizAlti = ((double) value)/Rad2Deg ;
240+ iHorizAltitude = value;
241+ configChanged = true;
242+}
243
244 /// END OF STUFF FOR THE GUI CONFIG.
245 ///////////////////////////////
246
247=== modified file 'plugins/Observability/src/Observability.hpp'
248--- plugins/Observability/src/Observability.hpp 2012-08-23 09:21:20 +0000
249+++ plugins/Observability/src/Observability.hpp 2012-08-27 18:20:25 +0000
250@@ -71,6 +71,8 @@
251 //! Set the Sun altitude at twilight:
252 void setSunAltitude(int);
253
254+ //! Set the horizon altitude:
255+ void setHorizAltitude(int);
256
257 //! get Show Flags from current configuration:
258 bool getShowFlags(int);
259@@ -84,6 +86,9 @@
260 //! get current Sun altitude at twilight:
261 int getSunAltitude(void);
262
263+ //! get current horizon altitude:
264+ int getHorizAltitude(void);
265+
266 public slots:
267 //! Set whether observability will execute or not:
268 void enableObservability(bool b);
269@@ -194,7 +199,7 @@
270 virtual bool CheckRise(int i);
271
272 //! Some useful constants and variables(almost self-explanatory).
273- double Rad2Deg, Rad2Hr, AstroTwiAlti, UA, TFrac, JDsec, Jan1stJD, halfpi, MoonT, nextFullMoon, prevFullMoon, RefFullMoon, GMTShift, MoonPerilune;
274+ double Rad2Deg, Rad2Hr, AstroTwiAlti, UA, TFrac, JDsec, Jan1stJD, halfpi, MoonT, nextFullMoon, prevFullMoon, RefFullMoon, GMTShift, MoonPerilune, RefracHoriz, HorizAlti;
275
276 //! RA, Dec, observer latitude, object's elevation, and Hour Angle at horizon.
277 double selRA, selDec, mylat, mylon, alti, horizH, culmAlt, myJD;
278@@ -224,7 +229,7 @@
279
280
281 //! Current simulation year and number of days in the year.;
282- int currYear, nDays, iAltitude;
283+ int currYear, nDays, iAltitude, iHorizAltitude;
284
285 //! Useful auxiliary strings, to help checking changes in source/observer. Also to store results that must survive between iterations.
286 QString selName, bestNight, ObsRange, objname, AcroCos;
287
288=== modified file 'plugins/Observability/src/gui/ObservabilityDialog.cpp'
289--- plugins/Observability/src/gui/ObservabilityDialog.cpp 2012-08-15 19:29:49 +0000
290+++ plugins/Observability/src/gui/ObservabilityDialog.cpp 2012-08-27 18:20:25 +0000
291@@ -74,6 +74,7 @@
292 connect(ui->Blue, SIGNAL(sliderMoved(int)), this, SLOT(setBlue(int)));
293 connect(ui->fontSize, SIGNAL(sliderMoved(int)), this, SLOT(setSize(int)));
294 connect(ui->SunAltitude, SIGNAL(sliderMoved(int)), this, SLOT(setAltitude(int)));
295+ connect(ui->HorizAltitude, SIGNAL(sliderMoved(int)), this, SLOT(setHorizon(int)));
296
297 connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
298 connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults()));
299@@ -101,9 +102,10 @@
300
301 html += "<h3>" + q_("Explanation of some parameters") + "</h3><table width=\"90%\">";
302 html += QString("<tr><td>%1</td><td>%2</td></tr>").arg(q_("Sun altitude at twilight:")).arg(q_("Any celestial object will be considered visible when the Sun is below this altitude. The altitude at astronomical twilight ranges usually between -12 and -18 degrees. This parameter is only used for the estimate of the range of observable epochs (see below)."));
303+ html += QString("<tr><td>%1</td><td>%2</td></tr>").arg(q_("Horizon altitude:")).arg(q_("Minimum observable altitude (due to mountains, buildings, or just a limited telescope mount). Notice that the dates of Acronychal and Cosmical rise/set (see below) are also affected by this parameter."));
304 html += QString("<tr><td>%1</td><td>%2</td></tr>").arg(q_("Today ephemeris:")).arg(q_("Self-explanatory. The program will show the rise, set, and culmination (transit) times. The exact times for these ephemeris are given in two ways: as time spans (referred to the current time) and as clock hours (in local time)."));
305 html += QString("<tr><td>%1</td><td>%2</td></tr>").arg(q_("Acronychal/Cosmical rise/set:")).arg(q_("The Acronychal rise (or set) of an object happens when the object rises (or sets) just when the Sun sets (or rises), respectively. The exact dates of these ephemeris depend on the Observer's location. The dates between the Acronychal set and rise are those when the altitude of the celestial object uses to be high when the Sun is well below the horizon (hence the object can be well observed). On the contrary, the Cosmical rise (or set) happens when both, the object and the Sun, rise (or set) simultaneously. It is obvious that the source is hardly observable (or not observable at all) in the dates between Cosmical set and rise."));
306- html += QString("<tr><td>%1</td><td>%2</td></tr>").arg(q_("Largest Sun separation:")).arg(q_("Happens when the angular separation between the Sun and the celestial object are maximum. In most cases, this is equivalent to say that the Equatorial longitudes of the Sun and the object differ by 180 degrees, so the Sun is in opposition to the object. When an object is at its maximum possible angular separation from the Sun (no matter if it is a planet or a star), it culminates roughly at midnight, and on the darkest possible area of the Sky at that declination. Hence, that is the 'best' night to observe a particular object."));
307+ html += QString("<tr><td>%1</td><td>%2</td></tr>").arg(q_("Largest Sun separation:")).arg(q_("Happens when the angular separation between the Sun and the celestial object are maximum. In most cases, this is equivalent to say that the Ecliptical longitudes of the Sun and the object differ by 180 degrees, so the Sun is in opposition to the object. When an object is at its maximum possible angular separation from the Sun (no matter if it is a planet or a star), it culminates roughly at midnight, and on the darkest possible area of the Sky at that declination. Hence, that is the 'best' night to observe a particular object."));
308 html += QString("<tr><td>%1</td><td>%2</td></tr>").arg(q_("Nights with source above horizon:")).arg(q_("The program computes the range of dates when the celestial object is above the horizon at least during one moment of the night. By 'night', the program considers the time span when the Sun altitude is below that of the twilight (which can be set by the user; see above). When the objects are fixed on the sky (or are exterior planets), the range of observable epochs for the current year can have two possible forms: either a range from one date to another (e.g., 20 Jan to 15 Sep) or in two steps (from 1 Jan to a given date and from another date to 31 Dec). In the first case, the first date (20 Jan in our example) shall be close to the so-called 'Heliacal rise of a star' and the second date (15 Sep in our example) shall be close to the 'Heliacal set'. In the second case (e.g., a range in the form 1 Jan to 20 May and 21 Sep to 31 Dec), the first date (20 May in our example) would be close to the Heliacal set and the second one (21 Sep in our example) to the Heliacal rise. More exact equations to estimate the Heliacal rise/set of stars and planets (which will not depend on the mere input of a twilight Sun elevation by the user) will be implemented in future versions of this plugin."));
309 html += QString("<tr><td>%1</td><td>%2</td></tr>").arg(q_("Full Moon:")).arg(q_("When the Moon is selected, the program can compute the exact closest dates of the Moon's opposition to the Sun."));
310 html += "</table>";
311@@ -141,7 +143,14 @@
312 ui->fontSize->setValue(GETSTELMODULE(Observability)->getFontSize());
313 int SAlti = GETSTELMODULE(Observability)->getSunAltitude();
314 ui->SunAltitude->setValue(SAlti);
315- ui->AltiText->setText(QString("-%1 %2").arg(SAlti).arg(q_("deg.")));
316+ ui->AltiText->setText(QString("%1 -%2 %3").arg("Sun altitude at twilight (").arg(SAlti).arg(q_("deg.)")));
317+
318+ SAlti = GETSTELMODULE(Observability)->getHorizAltitude();
319+ ui->HorizAltitude->setValue(SAlti);
320+ ui->HorizText->setText(QString("%1 %2 %3").arg("Horizon altitude (").arg(SAlti).arg(q_("deg.)")));
321+
322+
323+
324 }
325
326 void ObservabilityDialog::saveSettings(void)
327@@ -213,9 +222,14 @@
328
329 void ObservabilityDialog::setAltitude(int Value)
330 {
331- ui->AltiText->setText(QString("-%1 %2").arg(Value).arg(q_("deg.")));
332+ ui->AltiText->setText(QString("%1 -%2 %3").arg("Sun altitude at twilight (").arg(Value).arg(q_("deg.)")));
333 GETSTELMODULE(Observability)->setSunAltitude(Value);
334 }
335
336+void ObservabilityDialog::setHorizon(int Value)
337+{
338+ ui->HorizText->setText(QString("%1 %2 %3").arg(q_("Horizon altitude (")).arg(Value).arg(q_("deg.)")));
339+ GETSTELMODULE(Observability)->setHorizAltitude(Value);
340+}
341
342
343
344=== modified file 'plugins/Observability/src/gui/ObservabilityDialog.hpp'
345--- plugins/Observability/src/gui/ObservabilityDialog.hpp 2012-08-10 15:26:42 +0000
346+++ plugins/Observability/src/gui/ObservabilityDialog.hpp 2012-08-27 18:20:25 +0000
347@@ -58,6 +58,7 @@
348 void setBlue(int);
349 void setSize(int);
350 void setAltitude(int);
351+ void setHorizon(int);
352
353 private:
354 Ui_ObservabilityDialog* ui;
355
356=== modified file 'plugins/Observability/src/gui/ObservabilityDialog.ui'
357--- plugins/Observability/src/gui/ObservabilityDialog.ui 2012-08-25 13:47:58 +0000
358+++ plugins/Observability/src/gui/ObservabilityDialog.ui 2012-08-27 18:20:25 +0000
359@@ -6,7 +6,7 @@
360 <rect>
361 <x>0</x>
362 <y>0</y>
363- <width>528</width>
364+ <width>530</width>
365 <height>556</height>
366 </rect>
367 </property>
368@@ -351,7 +351,7 @@
369 </font>
370 </property>
371 <property name="text">
372- <string>Sun altitude at twilight</string>
373+ <string>Observing conditions</string>
374 </property>
375 </widget>
376 </item>
377@@ -360,7 +360,7 @@
378 <item>
379 <widget class="QLabel" name="AltiText">
380 <property name="text">
381- <string>0 deg.</string>
382+ <string>Sun altitude at twilight (0 deg.)</string>
383 </property>
384 <property name="alignment">
385 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
386@@ -379,6 +379,27 @@
387 </item>
388 </layout>
389 </item>
390+ <item>
391+ <layout class="QHBoxLayout" name="horizontalLayout_6">
392+ <item alignment="Qt::AlignRight">
393+ <widget class="QLabel" name="HorizText">
394+ <property name="text">
395+ <string>Horizon altitude (0 deg.)</string>
396+ </property>
397+ </widget>
398+ </item>
399+ <item alignment="Qt::AlignLeft">
400+ <widget class="QSlider" name="HorizAltitude">
401+ <property name="maximum">
402+ <number>45</number>
403+ </property>
404+ <property name="orientation">
405+ <enum>Qt::Horizontal</enum>
406+ </property>
407+ </widget>
408+ </item>
409+ </layout>
410+ </item>
411 </layout>
412 </item>
413 </layout>