Merge lp:~daggerstab/stellarium/observability-cleanup into lp:stellarium

Proposed by Bogdan Marinov
Status: Merged
Merged at revision: 6699
Proposed branch: lp:~daggerstab/stellarium/observability-cleanup
Merge into: lp:stellarium
Diff against target: 5527 lines (+3310/-1334)
8 files modified
.bzrignore (+1/-0)
plugins/Observability/CMakeLists.txt (+1/-1)
plugins/Observability/Doxyfile (+1902/-0)
plugins/Observability/src/Observability.cpp (+870/-834)
plugins/Observability/src/Observability.hpp (+202/-108)
plugins/Observability/src/gui/ObservabilityDialog.cpp (+96/-130)
plugins/Observability/src/gui/ObservabilityDialog.hpp (+11/-19)
plugins/Observability/src/gui/ObservabilityDialog.ui (+227/-242)
To merge this branch: bzr merge lp:~daggerstab/stellarium/observability-cleanup
Reviewer Review Type Date Requested Status
Alexander Wolf Approve
Review via email: mp+214331@code.launchpad.net

This proposal supersedes a proposal from 2014-03-30.

Description of the change

This is my unfinished cleanup of the Observability plugin. I don't have time to finish it right now because of other Stellarium work, but the more time it sits as a separate branch, the more painful is synchronizing it with the trunk.

I had plans for this, but they'll have to stay on the backburner. I underestimated how much of a mess is the code and how hard it is to read unfamiliar mathematics from code.

Please test - I haven't had the time to do much testing. There's a number of TODOs left which I probably shouldn't have ignored.

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

This branch has errors in time calculation of rise and set for objects.

review: Needs Fixing
Revision history for this message
Bogdan Marinov (daggerstab) wrote : Posted in a previous version of this proposal

Question: How should I test for that? Is this a difference between the cleaned-up and the trunk version of the plug-in, or a difference between the cleaned-up version and some other source?

Revision history for this message
Bogdan Marinov (daggerstab) wrote : Posted in a previous version of this proposal

I can confirm a disparity between the trunk branch and this version: it looks like something is wrong with the rise/set times for planets (but not stars). Not only the ones in the cleanup version don't match the ones from the trunk, they also seem to be a function of the current time. That is, if you stop the time, open the observability report for a given object and then advance the time with hours/minutes, you'll notice that the rise/set time changes accordingly.

I'll try to fix this and resubmit the proposal.

Revision history for this message
Bogdan Marinov (daggerstab) wrote :

The problem seems to be fixed. I've also taken the chance to simplify the StelButton code.

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

OK. It works predictable now and we can improve current TODO list in trunk later.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2013-12-22 09:33:49 +0000
+++ .bzrignore 2014-04-04 19:38:38 +0000
@@ -12,3 +12,4 @@
12./util/locations-editor/locations-editor.pro.user12./util/locations-editor/locations-editor.pro.user
13./util/copy-translations.bat13./util/copy-translations.bat
14build14build
15./plugins/Observability/doc
1516
=== modified file 'plugins/Observability/CMakeLists.txt'
--- plugins/Observability/CMakeLists.txt 2013-07-23 20:06:05 +0000
+++ plugins/Observability/CMakeLists.txt 2014-04-04 19:38:38 +0000
@@ -1,4 +1,4 @@
1SET(OBSERVABILITY_VERSION "1.1.1")1SET(OBSERVABILITY_VERSION "1.2.0")
22
3IF(APPLE)3IF(APPLE)
4 SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/Library/Application\ Support/Stellarium)4 SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/Library/Application\ Support/Stellarium)
55
=== added file 'plugins/Observability/Doxyfile'
--- plugins/Observability/Doxyfile 1970-01-01 00:00:00 +0000
+++ plugins/Observability/Doxyfile 2014-04-04 19:38:38 +0000
@@ -0,0 +1,1902 @@
1# Doxyfile 1.8.3.1
2
3# This file describes the settings to be used by the documentation system
4# doxygen (www.doxygen.org) for a project
5#
6# All text after a hash (#) is considered a comment and will be ignored
7# The format is:
8# TAG = value [value, ...]
9# For lists items can also be appended using:
10# TAG += value [value, ...]
11# Values that contain spaces should be placed between quotes (" ")
12
13#---------------------------------------------------------------------------
14# Project related configuration options
15#---------------------------------------------------------------------------
16
17# This tag specifies the encoding used for all characters in the config file
18# that follow. The default is UTF-8 which is also the encoding used for all
19# text before the first occurrence of this tag. Doxygen uses libiconv (or the
20# iconv built into libc) for the transcoding. See
21# http://www.gnu.org/software/libiconv for the list of possible encodings.
22
23DOXYFILE_ENCODING = UTF-8
24
25# The PROJECT_NAME tag is a single word (or sequence of words) that should
26# identify the project. Note that if you do not use Doxywizard you need
27# to put quotes around the project name if it contains spaces.
28
29PROJECT_NAME = "Observability Analysis plug-in"
30
31# The PROJECT_NUMBER tag can be used to enter a project or revision number.
32# This could be handy for archiving the generated documentation or
33# if some version control system is used.
34
35PROJECT_NUMBER =
36
37# Using the PROJECT_BRIEF tag one can provide an optional one line description
38# for a project that appears at the top of each page and should give viewer
39# a quick idea about the purpose of the project. Keep the description short.
40
41PROJECT_BRIEF =
42
43# With the PROJECT_LOGO tag one can specify an logo or icon that is
44# included in the documentation. The maximum height of the logo should not
45# exceed 55 pixels and the maximum width should not exceed 200 pixels.
46# Doxygen will copy the logo to the output directory.
47
48PROJECT_LOGO =
49
50# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
51# base path where the generated documentation will be put.
52# If a relative path is entered, it will be relative to the location
53# where doxygen was started. If left blank the current directory will be used.
54
55OUTPUT_DIRECTORY = doc
56
57# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
58# 4096 sub-directories (in 2 levels) under the output directory of each output
59# format and will distribute the generated files over these directories.
60# Enabling this option can be useful when feeding doxygen a huge amount of
61# source files, where putting all generated files in the same directory would
62# otherwise cause performance problems for the file system.
63
64CREATE_SUBDIRS = NO
65
66# The OUTPUT_LANGUAGE tag is used to specify the language in which all
67# documentation generated by doxygen is written. Doxygen will use this
68# information to generate all constant output in the proper language.
69# The default language is English, other supported languages are:
70# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
71# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
72# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
73# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
74# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
75# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
76
77OUTPUT_LANGUAGE = English
78
79# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
80# include brief member descriptions after the members that are listed in
81# the file and class documentation (similar to JavaDoc).
82# Set to NO to disable this.
83
84BRIEF_MEMBER_DESC = YES
85
86# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
87# the brief description of a member or function before the detailed description.
88# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
89# brief descriptions will be completely suppressed.
90
91REPEAT_BRIEF = YES
92
93# This tag implements a quasi-intelligent brief description abbreviator
94# that is used to form the text in various listings. Each string
95# in this list, if found as the leading text of the brief description, will be
96# stripped from the text and the result after processing the whole list, is
97# used as the annotated text. Otherwise, the brief description is used as-is.
98# If left blank, the following values are used ("$name" is automatically
99# replaced with the name of the entity): "The $name class" "The $name widget"
100# "The $name file" "is" "provides" "specifies" "contains"
101# "represents" "a" "an" "the"
102
103ABBREVIATE_BRIEF = "The $name class" \
104 "The $name widget" \
105 "The $name file" \
106 is \
107 provides \
108 specifies \
109 contains \
110 represents \
111 a \
112 an \
113 the
114
115# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
116# Doxygen will generate a detailed section even if there is only a brief
117# description.
118
119ALWAYS_DETAILED_SEC = NO
120
121# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
122# inherited members of a class in the documentation of that class as if those
123# members were ordinary class members. Constructors, destructors and assignment
124# operators of the base classes will not be shown.
125
126INLINE_INHERITED_MEMB = NO
127
128# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
129# path before files name in the file list and in the header files. If set
130# to NO the shortest path that makes the file name unique will be used.
131
132FULL_PATH_NAMES = YES
133
134# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
135# can be used to strip a user-defined part of the path. Stripping is
136# only done if one of the specified strings matches the left-hand part of
137# the path. The tag can be used to show relative paths in the file list.
138# If left blank the directory from which doxygen is run is used as the
139# path to strip. Note that you specify absolute paths here, but also
140# relative paths, which will be relative from the directory where doxygen is
141# started.
142
143STRIP_FROM_PATH =
144
145# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
146# the path mentioned in the documentation of a class, which tells
147# the reader which header file to include in order to use a class.
148# If left blank only the name of the header file containing the class
149# definition is used. Otherwise one should specify the include paths that
150# are normally passed to the compiler using the -I flag.
151
152STRIP_FROM_INC_PATH =
153
154# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
155# (but less readable) file names. This can be useful if your file system
156# doesn't support long names like on DOS, Mac, or CD-ROM.
157
158SHORT_NAMES = NO
159
160# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
161# will interpret the first line (until the first dot) of a JavaDoc-style
162# comment as the brief description. If set to NO, the JavaDoc
163# comments will behave just like regular Qt-style comments
164# (thus requiring an explicit @brief command for a brief description.)
165
166JAVADOC_AUTOBRIEF = YES
167
168# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
169# interpret the first line (until the first dot) of a Qt-style
170# comment as the brief description. If set to NO, the comments
171# will behave just like regular Qt-style comments (thus requiring
172# an explicit \brief command for a brief description.)
173
174QT_AUTOBRIEF = YES
175
176# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
177# treat a multi-line C++ special comment block (i.e. a block of //! or ///
178# comments) as a brief description. This used to be the default behaviour.
179# The new default is to treat a multi-line C++ comment block as a detailed
180# description. Set this tag to YES if you prefer the old behaviour instead.
181
182MULTILINE_CPP_IS_BRIEF = NO
183
184# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
185# member inherits the documentation from any documented member that it
186# re-implements.
187
188INHERIT_DOCS = YES
189
190# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
191# a new page for each member. If set to NO, the documentation of a member will
192# be part of the file/class/namespace that contains it.
193
194SEPARATE_MEMBER_PAGES = NO
195
196# The TAB_SIZE tag can be used to set the number of spaces in a tab.
197# Doxygen uses this value to replace tabs by spaces in code fragments.
198
199TAB_SIZE = 4
200
201# This tag can be used to specify a number of aliases that acts
202# as commands in the documentation. An alias has the form "name=value".
203# For example adding "sideeffect=\par Side Effects:\n" will allow you to
204# put the command \sideeffect (or @sideeffect) in the documentation, which
205# will result in a user-defined paragraph with heading "Side Effects:".
206# You can put \n's in the value part of an alias to insert newlines.
207
208ALIASES =
209
210# This tag can be used to specify a number of word-keyword mappings (TCL only).
211# A mapping has the form "name=value". For example adding
212# "class=itcl::class" will allow you to use the command class in the
213# itcl::class meaning.
214
215TCL_SUBST =
216
217# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
218# sources only. Doxygen will then generate output that is more tailored for C.
219# For instance, some of the names that are used will be different. The list
220# of all members will be omitted, etc.
221
222OPTIMIZE_OUTPUT_FOR_C = NO
223
224# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
225# sources only. Doxygen will then generate output that is more tailored for
226# Java. For instance, namespaces will be presented as packages, qualified
227# scopes will look different, etc.
228
229OPTIMIZE_OUTPUT_JAVA = NO
230
231# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
232# sources only. Doxygen will then generate output that is more tailored for
233# Fortran.
234
235OPTIMIZE_FOR_FORTRAN = NO
236
237# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
238# sources. Doxygen will then generate output that is tailored for
239# VHDL.
240
241OPTIMIZE_OUTPUT_VHDL = NO
242
243# Doxygen selects the parser to use depending on the extension of the files it
244# parses. With this tag you can assign which parser to use for a given
245# extension. Doxygen has a built-in mapping, but you can override or extend it
246# using this tag. The format is ext=language, where ext is a file extension,
247# and language is one of the parsers supported by doxygen: IDL, Java,
248# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
249# C++. For instance to make doxygen treat .inc files as Fortran files (default
250# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
251# that for custom extensions you also need to set FILE_PATTERNS otherwise the
252# files are not read by doxygen.
253
254EXTENSION_MAPPING =
255
256# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
257# comments according to the Markdown format, which allows for more readable
258# documentation. See http://daringfireball.net/projects/markdown/ for details.
259# The output of markdown processing is further processed by doxygen, so you
260# can mix doxygen, HTML, and XML commands with Markdown formatting.
261# Disable only in case of backward compatibilities issues.
262
263MARKDOWN_SUPPORT = YES
264
265# When enabled doxygen tries to link words that correspond to documented classes,
266# or namespaces to their corresponding documentation. Such a link can be
267# prevented in individual cases by by putting a % sign in front of the word or
268# globally by setting AUTOLINK_SUPPORT to NO.
269
270AUTOLINK_SUPPORT = YES
271
272# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
273# to include (a tag file for) the STL sources as input, then you should
274# set this tag to YES in order to let doxygen match functions declarations and
275# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
276# func(std::string) {}). This also makes the inheritance and collaboration
277# diagrams that involve STL classes more complete and accurate.
278
279BUILTIN_STL_SUPPORT = NO
280
281# If you use Microsoft's C++/CLI language, you should set this option to YES to
282# enable parsing support.
283
284CPP_CLI_SUPPORT = NO
285
286# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
287# Doxygen will parse them like normal C++ but will assume all classes use public
288# instead of private inheritance when no explicit protection keyword is present.
289
290SIP_SUPPORT = NO
291
292# For Microsoft's IDL there are propget and propput attributes to indicate
293# getter and setter methods for a property. Setting this option to YES (the
294# default) will make doxygen replace the get and set methods by a property in
295# the documentation. This will only work if the methods are indeed getting or
296# setting a simple type. If this is not the case, or you want to show the
297# methods anyway, you should set this option to NO.
298
299IDL_PROPERTY_SUPPORT = YES
300
301# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
302# tag is set to YES, then doxygen will reuse the documentation of the first
303# member in the group (if any) for the other members of the group. By default
304# all members of a group must be documented explicitly.
305
306DISTRIBUTE_GROUP_DOC = NO
307
308# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
309# the same type (for instance a group of public functions) to be put as a
310# subgroup of that type (e.g. under the Public Functions section). Set it to
311# NO to prevent subgrouping. Alternatively, this can be done per class using
312# the \nosubgrouping command.
313
314SUBGROUPING = YES
315
316# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
317# unions are shown inside the group in which they are included (e.g. using
318# @ingroup) instead of on a separate page (for HTML and Man pages) or
319# section (for LaTeX and RTF).
320
321INLINE_GROUPED_CLASSES = NO
322
323# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
324# unions with only public data fields will be shown inline in the documentation
325# of the scope in which they are defined (i.e. file, namespace, or group
326# documentation), provided this scope is documented. If set to NO (the default),
327# structs, classes, and unions are shown on a separate page (for HTML and Man
328# pages) or section (for LaTeX and RTF).
329
330INLINE_SIMPLE_STRUCTS = NO
331
332# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
333# is documented as struct, union, or enum with the name of the typedef. So
334# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
335# with name TypeT. When disabled the typedef will appear as a member of a file,
336# namespace, or class. And the struct will be named TypeS. This can typically
337# be useful for C code in case the coding convention dictates that all compound
338# types are typedef'ed and only the typedef is referenced, never the tag name.
339
340TYPEDEF_HIDES_STRUCT = NO
341
342# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
343# determine which symbols to keep in memory and which to flush to disk.
344# When the cache is full, less often used symbols will be written to disk.
345# For small to medium size projects (<1000 input files) the default value is
346# probably good enough. For larger projects a too small cache size can cause
347# doxygen to be busy swapping symbols to and from disk most of the time
348# causing a significant performance penalty.
349# If the system has enough physical memory increasing the cache will improve the
350# performance by keeping more symbols in memory. Note that the value works on
351# a logarithmic scale so increasing the size by one will roughly double the
352# memory usage. The cache size is given by this formula:
353# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
354# corresponding to a cache size of 2^16 = 65536 symbols.
355
356SYMBOL_CACHE_SIZE = 0
357
358# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
359# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
360# their name and scope. Since this can be an expensive process and often the
361# same symbol appear multiple times in the code, doxygen keeps a cache of
362# pre-resolved symbols. If the cache is too small doxygen will become slower.
363# If the cache is too large, memory is wasted. The cache size is given by this
364# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
365# corresponding to a cache size of 2^16 = 65536 symbols.
366
367LOOKUP_CACHE_SIZE = 0
368
369#---------------------------------------------------------------------------
370# Build related configuration options
371#---------------------------------------------------------------------------
372
373# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
374# documentation are documented, even if no documentation was available.
375# Private class members and static file members will be hidden unless
376# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
377
378EXTRACT_ALL = YES
379
380# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
381# will be included in the documentation.
382
383EXTRACT_PRIVATE = YES
384
385# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
386# scope will be included in the documentation.
387
388EXTRACT_PACKAGE = NO
389
390# If the EXTRACT_STATIC tag is set to YES all static members of a file
391# will be included in the documentation.
392
393EXTRACT_STATIC = YES
394
395# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
396# defined locally in source files will be included in the documentation.
397# If set to NO only classes defined in header files are included.
398
399EXTRACT_LOCAL_CLASSES = YES
400
401# This flag is only useful for Objective-C code. When set to YES local
402# methods, which are defined in the implementation section but not in
403# the interface are included in the documentation.
404# If set to NO (the default) only methods in the interface are included.
405
406EXTRACT_LOCAL_METHODS = NO
407
408# If this flag is set to YES, the members of anonymous namespaces will be
409# extracted and appear in the documentation as a namespace called
410# 'anonymous_namespace{file}', where file will be replaced with the base
411# name of the file that contains the anonymous namespace. By default
412# anonymous namespaces are hidden.
413
414EXTRACT_ANON_NSPACES = NO
415
416# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
417# undocumented members of documented classes, files or namespaces.
418# If set to NO (the default) these members will be included in the
419# various overviews, but no documentation section is generated.
420# This option has no effect if EXTRACT_ALL is enabled.
421
422HIDE_UNDOC_MEMBERS = NO
423
424# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
425# undocumented classes that are normally visible in the class hierarchy.
426# If set to NO (the default) these classes will be included in the various
427# overviews. This option has no effect if EXTRACT_ALL is enabled.
428
429HIDE_UNDOC_CLASSES = NO
430
431# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
432# friend (class|struct|union) declarations.
433# If set to NO (the default) these declarations will be included in the
434# documentation.
435
436HIDE_FRIEND_COMPOUNDS = NO
437
438# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
439# documentation blocks found inside the body of a function.
440# If set to NO (the default) these blocks will be appended to the
441# function's detailed documentation block.
442
443HIDE_IN_BODY_DOCS = NO
444
445# The INTERNAL_DOCS tag determines if documentation
446# that is typed after a \internal command is included. If the tag is set
447# to NO (the default) then the documentation will be excluded.
448# Set it to YES to include the internal documentation.
449
450INTERNAL_DOCS = NO
451
452# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
453# file names in lower-case letters. If set to YES upper-case letters are also
454# allowed. This is useful if you have classes or files whose names only differ
455# in case and if your file system supports case sensitive file names. Windows
456# and Mac users are advised to set this option to NO.
457
458CASE_SENSE_NAMES = NO
459
460# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
461# will show members with their full class and namespace scopes in the
462# documentation. If set to YES the scope will be hidden.
463
464HIDE_SCOPE_NAMES = NO
465
466# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
467# will put a list of the files that are included by a file in the documentation
468# of that file.
469
470SHOW_INCLUDE_FILES = YES
471
472# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
473# will list include files with double quotes in the documentation
474# rather than with sharp brackets.
475
476FORCE_LOCAL_INCLUDES = NO
477
478# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
479# is inserted in the documentation for inline members.
480
481INLINE_INFO = YES
482
483# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
484# will sort the (detailed) documentation of file and class members
485# alphabetically by member name. If set to NO the members will appear in
486# declaration order.
487
488SORT_MEMBER_DOCS = YES
489
490# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
491# brief documentation of file, namespace and class members alphabetically
492# by member name. If set to NO (the default) the members will appear in
493# declaration order.
494
495SORT_BRIEF_DOCS = NO
496
497# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
498# will sort the (brief and detailed) documentation of class members so that
499# constructors and destructors are listed first. If set to NO (the default)
500# the constructors will appear in the respective orders defined by
501# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
502# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
503# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
504
505SORT_MEMBERS_CTORS_1ST = NO
506
507# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
508# hierarchy of group names into alphabetical order. If set to NO (the default)
509# the group names will appear in their defined order.
510
511SORT_GROUP_NAMES = NO
512
513# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
514# sorted by fully-qualified names, including namespaces. If set to
515# NO (the default), the class list will be sorted only by class name,
516# not including the namespace part.
517# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
518# Note: This option applies only to the class list, not to the
519# alphabetical list.
520
521SORT_BY_SCOPE_NAME = NO
522
523# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
524# do proper type resolution of all parameters of a function it will reject a
525# match between the prototype and the implementation of a member function even
526# if there is only one candidate or it is obvious which candidate to choose
527# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
528# will still accept a match between prototype and implementation in such cases.
529
530STRICT_PROTO_MATCHING = NO
531
532# The GENERATE_TODOLIST tag can be used to enable (YES) or
533# disable (NO) the todo list. This list is created by putting \todo
534# commands in the documentation.
535
536GENERATE_TODOLIST = YES
537
538# The GENERATE_TESTLIST tag can be used to enable (YES) or
539# disable (NO) the test list. This list is created by putting \test
540# commands in the documentation.
541
542GENERATE_TESTLIST = YES
543
544# The GENERATE_BUGLIST tag can be used to enable (YES) or
545# disable (NO) the bug list. This list is created by putting \bug
546# commands in the documentation.
547
548GENERATE_BUGLIST = YES
549
550# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
551# disable (NO) the deprecated list. This list is created by putting
552# \deprecated commands in the documentation.
553
554GENERATE_DEPRECATEDLIST= YES
555
556# The ENABLED_SECTIONS tag can be used to enable conditional
557# documentation sections, marked by \if section-label ... \endif
558# and \cond section-label ... \endcond blocks.
559
560ENABLED_SECTIONS =
561
562# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
563# the initial value of a variable or macro consists of for it to appear in
564# the documentation. If the initializer consists of more lines than specified
565# here it will be hidden. Use a value of 0 to hide initializers completely.
566# The appearance of the initializer of individual variables and macros in the
567# documentation can be controlled using \showinitializer or \hideinitializer
568# command in the documentation regardless of this setting.
569
570MAX_INITIALIZER_LINES = 30
571
572# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
573# at the bottom of the documentation of classes and structs. If set to YES the
574# list will mention the files that were used to generate the documentation.
575
576SHOW_USED_FILES = YES
577
578# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
579# This will remove the Files entry from the Quick Index and from the
580# Folder Tree View (if specified). The default is YES.
581
582SHOW_FILES = YES
583
584# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
585# Namespaces page. This will remove the Namespaces entry from the Quick Index
586# and from the Folder Tree View (if specified). The default is YES.
587
588SHOW_NAMESPACES = YES
589
590# The FILE_VERSION_FILTER tag can be used to specify a program or script that
591# doxygen should invoke to get the current version for each file (typically from
592# the version control system). Doxygen will invoke the program by executing (via
593# popen()) the command <command> <input-file>, where <command> is the value of
594# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
595# provided by doxygen. Whatever the program writes to standard output
596# is used as the file version. See the manual for examples.
597
598FILE_VERSION_FILTER =
599
600# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
601# by doxygen. The layout file controls the global structure of the generated
602# output files in an output format independent way. To create the layout file
603# that represents doxygen's defaults, run doxygen with the -l option.
604# You can optionally specify a file name after the option, if omitted
605# DoxygenLayout.xml will be used as the name of the layout file.
606
607LAYOUT_FILE =
608
609# The CITE_BIB_FILES tag can be used to specify one or more bib files
610# containing the references data. This must be a list of .bib files. The
611# .bib extension is automatically appended if omitted. Using this command
612# requires the bibtex tool to be installed. See also
613# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
614# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
615# feature you need bibtex and perl available in the search path. Do not use
616# file names with spaces, bibtex cannot handle them.
617
618CITE_BIB_FILES =
619
620#---------------------------------------------------------------------------
621# configuration options related to warning and progress messages
622#---------------------------------------------------------------------------
623
624# The QUIET tag can be used to turn on/off the messages that are generated
625# by doxygen. Possible values are YES and NO. If left blank NO is used.
626
627QUIET = NO
628
629# The WARNINGS tag can be used to turn on/off the warning messages that are
630# generated by doxygen. Possible values are YES and NO. If left blank
631# NO is used.
632
633WARNINGS = YES
634
635# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
636# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
637# automatically be disabled.
638
639WARN_IF_UNDOCUMENTED = YES
640
641# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
642# potential errors in the documentation, such as not documenting some
643# parameters in a documented function, or documenting parameters that
644# don't exist or using markup commands wrongly.
645
646WARN_IF_DOC_ERROR = YES
647
648# The WARN_NO_PARAMDOC option can be enabled to get warnings for
649# functions that are documented, but have no documentation for their parameters
650# or return value. If set to NO (the default) doxygen will only warn about
651# wrong or incomplete parameter documentation, but not about the absence of
652# documentation.
653
654WARN_NO_PARAMDOC = NO
655
656# The WARN_FORMAT tag determines the format of the warning messages that
657# doxygen can produce. The string should contain the $file, $line, and $text
658# tags, which will be replaced by the file and line number from which the
659# warning originated and the warning text. Optionally the format may contain
660# $version, which will be replaced by the version of the file (if it could
661# be obtained via FILE_VERSION_FILTER)
662
663WARN_FORMAT = "$file:$line: $text"
664
665# The WARN_LOGFILE tag can be used to specify a file to which warning
666# and error messages should be written. If left blank the output is written
667# to stderr.
668
669WARN_LOGFILE =
670
671#---------------------------------------------------------------------------
672# configuration options related to the input files
673#---------------------------------------------------------------------------
674
675# The INPUT tag can be used to specify the files and/or directories that contain
676# documented source files. You may enter file names like "myfile.cpp" or
677# directories like "/usr/src/myproject". Separate the files or directories
678# with spaces.
679
680INPUT = ./src
681
682# This tag can be used to specify the character encoding of the source files
683# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
684# also the default input encoding. Doxygen uses libiconv (or the iconv built
685# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
686# the list of possible encodings.
687
688INPUT_ENCODING = UTF-8
689
690# If the value of the INPUT tag contains directories, you can use the
691# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
692# and *.h) to filter out the source-files in the directories. If left
693# blank the following patterns are tested:
694# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
695# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
696# *.f90 *.f *.for *.vhd *.vhdl
697
698FILE_PATTERNS = *.c \
699 *.cc \
700 *.cxx \
701 *.cpp \
702 *.c++ \
703 *.d \
704 *.java \
705 *.ii \
706 *.ixx \
707 *.ipp \
708 *.i++ \
709 *.inl \
710 *.h \
711 *.hh \
712 *.hxx \
713 *.hpp \
714 *.h++ \
715 *.idl \
716 *.odl \
717 *.cs \
718 *.php \
719 *.php3 \
720 *.inc \
721 *.m \
722 *.markdown \
723 *.md \
724 *.mm \
725 *.dox \
726 *.py \
727 *.f90 \
728 *.f \
729 *.for \
730 *.vhd \
731 *.vhdl
732
733# The RECURSIVE tag can be used to turn specify whether or not subdirectories
734# should be searched for input files as well. Possible values are YES and NO.
735# If left blank NO is used.
736
737RECURSIVE = YES
738
739# The EXCLUDE tag can be used to specify files and/or directories that should be
740# excluded from the INPUT source files. This way you can easily exclude a
741# subdirectory from a directory tree whose root is specified with the INPUT tag.
742# Note that relative paths are relative to the directory from which doxygen is
743# run.
744
745EXCLUDE =
746
747# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
748# directories that are symbolic links (a Unix file system feature) are excluded
749# from the input.
750
751EXCLUDE_SYMLINKS = NO
752
753# If the value of the INPUT tag contains directories, you can use the
754# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
755# certain files from those directories. Note that the wildcards are matched
756# against the file with absolute path, so to exclude all test directories
757# for example use the pattern */test/*
758
759EXCLUDE_PATTERNS =
760
761# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
762# (namespaces, classes, functions, etc.) that should be excluded from the
763# output. The symbol name can be a fully qualified name, a word, or if the
764# wildcard * is used, a substring. Examples: ANamespace, AClass,
765# AClass::ANamespace, ANamespace::*Test
766
767EXCLUDE_SYMBOLS =
768
769# The EXAMPLE_PATH tag can be used to specify one or more files or
770# directories that contain example code fragments that are included (see
771# the \include command).
772
773EXAMPLE_PATH =
774
775# If the value of the EXAMPLE_PATH tag contains directories, you can use the
776# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
777# and *.h) to filter out the source-files in the directories. If left
778# blank all files are included.
779
780EXAMPLE_PATTERNS = *
781
782# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
783# searched for input files to be used with the \include or \dontinclude
784# commands irrespective of the value of the RECURSIVE tag.
785# Possible values are YES and NO. If left blank NO is used.
786
787EXAMPLE_RECURSIVE = NO
788
789# The IMAGE_PATH tag can be used to specify one or more files or
790# directories that contain image that are included in the documentation (see
791# the \image command).
792
793IMAGE_PATH =
794
795# The INPUT_FILTER tag can be used to specify a program that doxygen should
796# invoke to filter for each input file. Doxygen will invoke the filter program
797# by executing (via popen()) the command <filter> <input-file>, where <filter>
798# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
799# input file. Doxygen will then use the output that the filter program writes
800# to standard output. If FILTER_PATTERNS is specified, this tag will be
801# ignored.
802
803INPUT_FILTER =
804
805# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
806# basis. Doxygen will compare the file name with each pattern and apply the
807# filter if there is a match. The filters are a list of the form:
808# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
809# info on how filters are used. If FILTER_PATTERNS is empty or if
810# non of the patterns match the file name, INPUT_FILTER is applied.
811
812FILTER_PATTERNS =
813
814# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
815# INPUT_FILTER) will be used to filter the input files when producing source
816# files to browse (i.e. when SOURCE_BROWSER is set to YES).
817
818FILTER_SOURCE_FILES = NO
819
820# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
821# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
822# and it is also possible to disable source filtering for a specific pattern
823# using *.ext= (so without naming a filter). This option only has effect when
824# FILTER_SOURCE_FILES is enabled.
825
826FILTER_SOURCE_PATTERNS =
827
828# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that
829# is part of the input, its contents will be placed on the main page (index.html).
830# This can be useful if you have a project on for instance GitHub and want reuse
831# the introduction page also for the doxygen output.
832
833USE_MDFILE_AS_MAINPAGE =
834
835#---------------------------------------------------------------------------
836# configuration options related to source browsing
837#---------------------------------------------------------------------------
838
839# If the SOURCE_BROWSER tag is set to YES then a list of source files will
840# be generated. Documented entities will be cross-referenced with these sources.
841# Note: To get rid of all source code in the generated output, make sure also
842# VERBATIM_HEADERS is set to NO.
843
844SOURCE_BROWSER = NO
845
846# Setting the INLINE_SOURCES tag to YES will include the body
847# of functions and classes directly in the documentation.
848
849INLINE_SOURCES = NO
850
851# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
852# doxygen to hide any special comment blocks from generated source code
853# fragments. Normal C, C++ and Fortran comments will always remain visible.
854
855STRIP_CODE_COMMENTS = YES
856
857# If the REFERENCED_BY_RELATION tag is set to YES
858# then for each documented function all documented
859# functions referencing it will be listed.
860
861REFERENCED_BY_RELATION = NO
862
863# If the REFERENCES_RELATION tag is set to YES
864# then for each documented function all documented entities
865# called/used by that function will be listed.
866
867REFERENCES_RELATION = NO
868
869# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
870# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
871# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
872# link to the source code. Otherwise they will link to the documentation.
873
874REFERENCES_LINK_SOURCE = YES
875
876# If the USE_HTAGS tag is set to YES then the references to source code
877# will point to the HTML generated by the htags(1) tool instead of doxygen
878# built-in source browser. The htags tool is part of GNU's global source
879# tagging system (see http://www.gnu.org/software/global/global.html). You
880# will need version 4.8.6 or higher.
881
882USE_HTAGS = NO
883
884# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
885# will generate a verbatim copy of the header file for each class for
886# which an include is specified. Set to NO to disable this.
887
888VERBATIM_HEADERS = YES
889
890#---------------------------------------------------------------------------
891# configuration options related to the alphabetical class index
892#---------------------------------------------------------------------------
893
894# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
895# of all compounds will be generated. Enable this if the project
896# contains a lot of classes, structs, unions or interfaces.
897
898ALPHABETICAL_INDEX = YES
899
900# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
901# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
902# in which this list will be split (can be a number in the range [1..20])
903
904COLS_IN_ALPHA_INDEX = 5
905
906# In case all classes in a project start with a common prefix, all
907# classes will be put under the same header in the alphabetical index.
908# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
909# should be ignored while generating the index headers.
910
911IGNORE_PREFIX =
912
913#---------------------------------------------------------------------------
914# configuration options related to the HTML output
915#---------------------------------------------------------------------------
916
917# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
918# generate HTML output.
919
920GENERATE_HTML = YES
921
922# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
923# If a relative path is entered the value of OUTPUT_DIRECTORY will be
924# put in front of it. If left blank `html' will be used as the default path.
925
926HTML_OUTPUT = html
927
928# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
929# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
930# doxygen will generate files with .html extension.
931
932HTML_FILE_EXTENSION = .html
933
934# The HTML_HEADER tag can be used to specify a personal HTML header for
935# each generated HTML page. If it is left blank doxygen will generate a
936# standard header. Note that when using a custom header you are responsible
937# for the proper inclusion of any scripts and style sheets that doxygen
938# needs, which is dependent on the configuration options used.
939# It is advised to generate a default header using "doxygen -w html
940# header.html footer.html stylesheet.css YourConfigFile" and then modify
941# that header. Note that the header is subject to change so you typically
942# have to redo this when upgrading to a newer version of doxygen or when
943# changing the value of configuration settings such as GENERATE_TREEVIEW!
944
945HTML_HEADER =
946
947# The HTML_FOOTER tag can be used to specify a personal HTML footer for
948# each generated HTML page. If it is left blank doxygen will generate a
949# standard footer.
950
951HTML_FOOTER =
952
953# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
954# style sheet that is used by each HTML page. It can be used to
955# fine-tune the look of the HTML output. If left blank doxygen will
956# generate a default style sheet. Note that it is recommended to use
957# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this
958# tag will in the future become obsolete.
959
960HTML_STYLESHEET =
961
962# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional
963# user-defined cascading style sheet that is included after the standard
964# style sheets created by doxygen. Using this option one can overrule
965# certain style aspects. This is preferred over using HTML_STYLESHEET
966# since it does not replace the standard style sheet and is therefor more
967# robust against future updates. Doxygen will copy the style sheet file to
968# the output directory.
969
970HTML_EXTRA_STYLESHEET =
971
972# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
973# other source files which should be copied to the HTML output directory. Note
974# that these files will be copied to the base HTML output directory. Use the
975# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
976# files. In the HTML_STYLESHEET file, use the file name only. Also note that
977# the files will be copied as-is; there are no commands or markers available.
978
979HTML_EXTRA_FILES =
980
981# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
982# Doxygen will adjust the colors in the style sheet and background images
983# according to this color. Hue is specified as an angle on a colorwheel,
984# see http://en.wikipedia.org/wiki/Hue for more information.
985# For instance the value 0 represents red, 60 is yellow, 120 is green,
986# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
987# The allowed range is 0 to 359.
988
989HTML_COLORSTYLE_HUE = 220
990
991# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
992# the colors in the HTML output. For a value of 0 the output will use
993# grayscales only. A value of 255 will produce the most vivid colors.
994
995HTML_COLORSTYLE_SAT = 100
996
997# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
998# the luminance component of the colors in the HTML output. Values below
999# 100 gradually make the output lighter, whereas values above 100 make
1000# the output darker. The value divided by 100 is the actual gamma applied,
1001# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
1002# and 100 does not change the gamma.
1003
1004HTML_COLORSTYLE_GAMMA = 80
1005
1006# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
1007# page will contain the date and time when the page was generated. Setting
1008# this to NO can help when comparing the output of multiple runs.
1009
1010HTML_TIMESTAMP = YES
1011
1012# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
1013# documentation will contain sections that can be hidden and shown after the
1014# page has loaded.
1015
1016HTML_DYNAMIC_SECTIONS = NO
1017
1018# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
1019# entries shown in the various tree structured indices initially; the user
1020# can expand and collapse entries dynamically later on. Doxygen will expand
1021# the tree to such a level that at most the specified number of entries are
1022# visible (unless a fully collapsed tree already exceeds this amount).
1023# So setting the number of entries 1 will produce a full collapsed tree by
1024# default. 0 is a special value representing an infinite number of entries
1025# and will result in a full expanded tree by default.
1026
1027HTML_INDEX_NUM_ENTRIES = 100
1028
1029# If the GENERATE_DOCSET tag is set to YES, additional index files
1030# will be generated that can be used as input for Apple's Xcode 3
1031# integrated development environment, introduced with OSX 10.5 (Leopard).
1032# To create a documentation set, doxygen will generate a Makefile in the
1033# HTML output directory. Running make will produce the docset in that
1034# directory and running "make install" will install the docset in
1035# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
1036# it at startup.
1037# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
1038# for more information.
1039
1040GENERATE_DOCSET = NO
1041
1042# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
1043# feed. A documentation feed provides an umbrella under which multiple
1044# documentation sets from a single provider (such as a company or product suite)
1045# can be grouped.
1046
1047DOCSET_FEEDNAME = "Doxygen generated docs"
1048
1049# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
1050# should uniquely identify the documentation set bundle. This should be a
1051# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
1052# will append .docset to the name.
1053
1054DOCSET_BUNDLE_ID = org.doxygen.Project
1055
1056# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely
1057# identify the documentation publisher. This should be a reverse domain-name
1058# style string, e.g. com.mycompany.MyDocSet.documentation.
1059
1060DOCSET_PUBLISHER_ID = org.doxygen.Publisher
1061
1062# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
1063
1064DOCSET_PUBLISHER_NAME = Publisher
1065
1066# If the GENERATE_HTMLHELP tag is set to YES, additional index files
1067# will be generated that can be used as input for tools like the
1068# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
1069# of the generated HTML documentation.
1070
1071GENERATE_HTMLHELP = NO
1072
1073# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
1074# be used to specify the file name of the resulting .chm file. You
1075# can add a path in front of the file if the result should not be
1076# written to the html output directory.
1077
1078CHM_FILE =
1079
1080# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
1081# be used to specify the location (absolute path including file name) of
1082# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
1083# the HTML help compiler on the generated index.hhp.
1084
1085HHC_LOCATION =
1086
1087# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
1088# controls if a separate .chi index file is generated (YES) or that
1089# it should be included in the master .chm file (NO).
1090
1091GENERATE_CHI = NO
1092
1093# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
1094# is used to encode HtmlHelp index (hhk), content (hhc) and project file
1095# content.
1096
1097CHM_INDEX_ENCODING =
1098
1099# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
1100# controls whether a binary table of contents is generated (YES) or a
1101# normal table of contents (NO) in the .chm file.
1102
1103BINARY_TOC = NO
1104
1105# The TOC_EXPAND flag can be set to YES to add extra items for group members
1106# to the contents of the HTML help documentation and to the tree view.
1107
1108TOC_EXPAND = NO
1109
1110# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
1111# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
1112# that can be used as input for Qt's qhelpgenerator to generate a
1113# Qt Compressed Help (.qch) of the generated HTML documentation.
1114
1115GENERATE_QHP = NO
1116
1117# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
1118# be used to specify the file name of the resulting .qch file.
1119# The path specified is relative to the HTML output folder.
1120
1121QCH_FILE =
1122
1123# The QHP_NAMESPACE tag specifies the namespace to use when generating
1124# Qt Help Project output. For more information please see
1125# http://doc.trolltech.com/qthelpproject.html#namespace
1126
1127QHP_NAMESPACE = org.doxygen.Project
1128
1129# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
1130# Qt Help Project output. For more information please see
1131# http://doc.trolltech.com/qthelpproject.html#virtual-folders
1132
1133QHP_VIRTUAL_FOLDER = doc
1134
1135# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
1136# add. For more information please see
1137# http://doc.trolltech.com/qthelpproject.html#custom-filters
1138
1139QHP_CUST_FILTER_NAME =
1140
1141# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
1142# custom filter to add. For more information please see
1143# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
1144# Qt Help Project / Custom Filters</a>.
1145
1146QHP_CUST_FILTER_ATTRS =
1147
1148# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
1149# project's
1150# filter section matches.
1151# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
1152# Qt Help Project / Filter Attributes</a>.
1153
1154QHP_SECT_FILTER_ATTRS =
1155
1156# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
1157# be used to specify the location of Qt's qhelpgenerator.
1158# If non-empty doxygen will try to run qhelpgenerator on the generated
1159# .qhp file.
1160
1161QHG_LOCATION =
1162
1163# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
1164# will be generated, which together with the HTML files, form an Eclipse help
1165# plugin. To install this plugin and make it available under the help contents
1166# menu in Eclipse, the contents of the directory containing the HTML and XML
1167# files needs to be copied into the plugins directory of eclipse. The name of
1168# the directory within the plugins directory should be the same as
1169# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
1170# the help appears.
1171
1172GENERATE_ECLIPSEHELP = NO
1173
1174# A unique identifier for the eclipse help plugin. When installing the plugin
1175# the directory name containing the HTML and XML files should also have
1176# this name.
1177
1178ECLIPSE_DOC_ID = org.doxygen.Project
1179
1180# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
1181# at top of each HTML page. The value NO (the default) enables the index and
1182# the value YES disables it. Since the tabs have the same information as the
1183# navigation tree you can set this option to NO if you already set
1184# GENERATE_TREEVIEW to YES.
1185
1186DISABLE_INDEX = NO
1187
1188# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
1189# structure should be generated to display hierarchical information.
1190# If the tag value is set to YES, a side panel will be generated
1191# containing a tree-like index structure (just like the one that
1192# is generated for HTML Help). For this to work a browser that supports
1193# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
1194# Windows users are probably better off using the HTML help feature.
1195# Since the tree basically has the same information as the tab index you
1196# could consider to set DISABLE_INDEX to NO when enabling this option.
1197
1198GENERATE_TREEVIEW = NO
1199
1200# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
1201# (range [0,1..20]) that doxygen will group on one line in the generated HTML
1202# documentation. Note that a value of 0 will completely suppress the enum
1203# values from appearing in the overview section.
1204
1205ENUM_VALUES_PER_LINE = 4
1206
1207# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
1208# used to set the initial width (in pixels) of the frame in which the tree
1209# is shown.
1210
1211TREEVIEW_WIDTH = 250
1212
1213# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
1214# links to external symbols imported via tag files in a separate window.
1215
1216EXT_LINKS_IN_WINDOW = NO
1217
1218# Use this tag to change the font size of Latex formulas included
1219# as images in the HTML documentation. The default is 10. Note that
1220# when you change the font size after a successful doxygen run you need
1221# to manually remove any form_*.png images from the HTML output directory
1222# to force them to be regenerated.
1223
1224FORMULA_FONTSIZE = 10
1225
1226# Use the FORMULA_TRANPARENT tag to determine whether or not the images
1227# generated for formulas are transparent PNGs. Transparent PNGs are
1228# not supported properly for IE 6.0, but are supported on all modern browsers.
1229# Note that when changing this option you need to delete any form_*.png files
1230# in the HTML output before the changes have effect.
1231
1232FORMULA_TRANSPARENT = YES
1233
1234# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
1235# (see http://www.mathjax.org) which uses client side Javascript for the
1236# rendering instead of using prerendered bitmaps. Use this if you do not
1237# have LaTeX installed or if you want to formulas look prettier in the HTML
1238# output. When enabled you may also need to install MathJax separately and
1239# configure the path to it using the MATHJAX_RELPATH option.
1240
1241USE_MATHJAX = NO
1242
1243# When MathJax is enabled you can set the default output format to be used for
1244# thA MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and
1245# SVG. The default value is HTML-CSS, which is slower, but has the best
1246# compatibility.
1247
1248MATHJAX_FORMAT = HTML-CSS
1249
1250# When MathJax is enabled you need to specify the location relative to the
1251# HTML output directory using the MATHJAX_RELPATH option. The destination
1252# directory should contain the MathJax.js script. For instance, if the mathjax
1253# directory is located at the same level as the HTML output directory, then
1254# MATHJAX_RELPATH should be ../mathjax. The default value points to
1255# the MathJax Content Delivery Network so you can quickly see the result without
1256# installing MathJax. However, it is strongly recommended to install a local
1257# copy of MathJax from http://www.mathjax.org before deployment.
1258
1259MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
1260
1261# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
1262# names that should be enabled during MathJax rendering.
1263
1264MATHJAX_EXTENSIONS =
1265
1266# When the SEARCHENGINE tag is enabled doxygen will generate a search box
1267# for the HTML output. The underlying search engine uses javascript
1268# and DHTML and should work on any modern browser. Note that when using
1269# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
1270# (GENERATE_DOCSET) there is already a search function so this one should
1271# typically be disabled. For large projects the javascript based search engine
1272# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
1273
1274SEARCHENGINE = NO
1275
1276# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
1277# implemented using a web server instead of a web client using Javascript.
1278# There are two flavours of web server based search depending on the
1279# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
1280# searching and an index file used by the script. When EXTERNAL_SEARCH is
1281# enabled the indexing and searching needs to be provided by external tools.
1282# See the manual for details.
1283
1284SERVER_BASED_SEARCH = NO
1285
1286# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP
1287# script for searching. Instead the search results are written to an XML file
1288# which needs to be processed by an external indexer. Doxygen will invoke an
1289# external search engine pointed to by the SEARCHENGINE_URL option to obtain
1290# the search results. Doxygen ships with an example indexer (doxyindexer) and
1291# search engine (doxysearch.cgi) which are based on the open source search engine
1292# library Xapian. See the manual for configuration details.
1293
1294EXTERNAL_SEARCH = NO
1295
1296# The SEARCHENGINE_URL should point to a search engine hosted by a web server
1297# which will returned the search results when EXTERNAL_SEARCH is enabled.
1298# Doxygen ships with an example search engine (doxysearch) which is based on
1299# the open source search engine library Xapian. See the manual for configuration
1300# details.
1301
1302SEARCHENGINE_URL =
1303
1304# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
1305# search data is written to a file for indexing by an external tool. With the
1306# SEARCHDATA_FILE tag the name of this file can be specified.
1307
1308SEARCHDATA_FILE = searchdata.xml
1309
1310# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the
1311# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
1312# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
1313# projects and redirect the results back to the right project.
1314
1315EXTERNAL_SEARCH_ID =
1316
1317# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
1318# projects other than the one defined by this configuration file, but that are
1319# all added to the same external search index. Each project needs to have a
1320# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id
1321# of to a relative location where the documentation can be found.
1322# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...
1323
1324EXTRA_SEARCH_MAPPINGS =
1325
1326#---------------------------------------------------------------------------
1327# configuration options related to the LaTeX output
1328#---------------------------------------------------------------------------
1329
1330# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
1331# generate Latex output.
1332
1333GENERATE_LATEX = NO
1334
1335# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
1336# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1337# put in front of it. If left blank `latex' will be used as the default path.
1338
1339LATEX_OUTPUT = latex
1340
1341# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
1342# invoked. If left blank `latex' will be used as the default command name.
1343# Note that when enabling USE_PDFLATEX this option is only used for
1344# generating bitmaps for formulas in the HTML output, but not in the
1345# Makefile that is written to the output directory.
1346
1347LATEX_CMD_NAME = latex
1348
1349# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
1350# generate index for LaTeX. If left blank `makeindex' will be used as the
1351# default command name.
1352
1353MAKEINDEX_CMD_NAME = makeindex
1354
1355# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
1356# LaTeX documents. This may be useful for small projects and may help to
1357# save some trees in general.
1358
1359COMPACT_LATEX = NO
1360
1361# The PAPER_TYPE tag can be used to set the paper type that is used
1362# by the printer. Possible values are: a4, letter, legal and
1363# executive. If left blank a4wide will be used.
1364
1365PAPER_TYPE = a4
1366
1367# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
1368# packages that should be included in the LaTeX output.
1369
1370EXTRA_PACKAGES =
1371
1372# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
1373# the generated latex document. The header should contain everything until
1374# the first chapter. If it is left blank doxygen will generate a
1375# standard header. Notice: only use this tag if you know what you are doing!
1376
1377LATEX_HEADER =
1378
1379# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
1380# the generated latex document. The footer should contain everything after
1381# the last chapter. If it is left blank doxygen will generate a
1382# standard footer. Notice: only use this tag if you know what you are doing!
1383
1384LATEX_FOOTER =
1385
1386# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
1387# is prepared for conversion to pdf (using ps2pdf). The pdf file will
1388# contain links (just like the HTML output) instead of page references
1389# This makes the output suitable for online browsing using a pdf viewer.
1390
1391PDF_HYPERLINKS = YES
1392
1393# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
1394# plain latex in the generated Makefile. Set this option to YES to get a
1395# higher quality PDF documentation.
1396
1397USE_PDFLATEX = YES
1398
1399# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
1400# command to the generated LaTeX files. This will instruct LaTeX to keep
1401# running if errors occur, instead of asking the user for help.
1402# This option is also used when generating formulas in HTML.
1403
1404LATEX_BATCHMODE = NO
1405
1406# If LATEX_HIDE_INDICES is set to YES then doxygen will not
1407# include the index chapters (such as File Index, Compound Index, etc.)
1408# in the output.
1409
1410LATEX_HIDE_INDICES = NO
1411
1412# If LATEX_SOURCE_CODE is set to YES then doxygen will include
1413# source code with syntax highlighting in the LaTeX output.
1414# Note that which sources are shown also depends on other settings
1415# such as SOURCE_BROWSER.
1416
1417LATEX_SOURCE_CODE = NO
1418
1419# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
1420# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
1421# http://en.wikipedia.org/wiki/BibTeX for more info.
1422
1423LATEX_BIB_STYLE = plain
1424
1425#---------------------------------------------------------------------------
1426# configuration options related to the RTF output
1427#---------------------------------------------------------------------------
1428
1429# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
1430# The RTF output is optimized for Word 97 and may not look very pretty with
1431# other RTF readers or editors.
1432
1433GENERATE_RTF = NO
1434
1435# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
1436# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1437# put in front of it. If left blank `rtf' will be used as the default path.
1438
1439RTF_OUTPUT = rtf
1440
1441# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
1442# RTF documents. This may be useful for small projects and may help to
1443# save some trees in general.
1444
1445COMPACT_RTF = NO
1446
1447# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
1448# will contain hyperlink fields. The RTF file will
1449# contain links (just like the HTML output) instead of page references.
1450# This makes the output suitable for online browsing using WORD or other
1451# programs which support those fields.
1452# Note: wordpad (write) and others do not support links.
1453
1454RTF_HYPERLINKS = NO
1455
1456# Load style sheet definitions from file. Syntax is similar to doxygen's
1457# config file, i.e. a series of assignments. You only have to provide
1458# replacements, missing definitions are set to their default value.
1459
1460RTF_STYLESHEET_FILE =
1461
1462# Set optional variables used in the generation of an rtf document.
1463# Syntax is similar to doxygen's config file.
1464
1465RTF_EXTENSIONS_FILE =
1466
1467#---------------------------------------------------------------------------
1468# configuration options related to the man page output
1469#---------------------------------------------------------------------------
1470
1471# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
1472# generate man pages
1473
1474GENERATE_MAN = NO
1475
1476# The MAN_OUTPUT tag is used to specify where the man pages will be put.
1477# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1478# put in front of it. If left blank `man' will be used as the default path.
1479
1480MAN_OUTPUT = man
1481
1482# The MAN_EXTENSION tag determines the extension that is added to
1483# the generated man pages (default is the subroutine's section .3)
1484
1485MAN_EXTENSION = .3
1486
1487# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
1488# then it will generate one additional man file for each entity
1489# documented in the real man page(s). These additional files
1490# only source the real man page, but without them the man command
1491# would be unable to find the correct page. The default is NO.
1492
1493MAN_LINKS = NO
1494
1495#---------------------------------------------------------------------------
1496# configuration options related to the XML output
1497#---------------------------------------------------------------------------
1498
1499# If the GENERATE_XML tag is set to YES Doxygen will
1500# generate an XML file that captures the structure of
1501# the code including all documentation.
1502
1503GENERATE_XML = NO
1504
1505# The XML_OUTPUT tag is used to specify where the XML pages will be put.
1506# If a relative path is entered the value of OUTPUT_DIRECTORY will be
1507# put in front of it. If left blank `xml' will be used as the default path.
1508
1509XML_OUTPUT = xml
1510
1511# The XML_SCHEMA tag can be used to specify an XML schema,
1512# which can be used by a validating XML parser to check the
1513# syntax of the XML files.
1514
1515XML_SCHEMA =
1516
1517# The XML_DTD tag can be used to specify an XML DTD,
1518# which can be used by a validating XML parser to check the
1519# syntax of the XML files.
1520
1521XML_DTD =
1522
1523# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
1524# dump the program listings (including syntax highlighting
1525# and cross-referencing information) to the XML output. Note that
1526# enabling this will significantly increase the size of the XML output.
1527
1528XML_PROGRAMLISTING = YES
1529
1530#---------------------------------------------------------------------------
1531# configuration options for the AutoGen Definitions output
1532#---------------------------------------------------------------------------
1533
1534# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
1535# generate an AutoGen Definitions (see autogen.sf.net) file
1536# that captures the structure of the code including all
1537# documentation. Note that this feature is still experimental
1538# and incomplete at the moment.
1539
1540GENERATE_AUTOGEN_DEF = NO
1541
1542#---------------------------------------------------------------------------
1543# configuration options related to the Perl module output
1544#---------------------------------------------------------------------------
1545
1546# If the GENERATE_PERLMOD tag is set to YES Doxygen will
1547# generate a Perl module file that captures the structure of
1548# the code including all documentation. Note that this
1549# feature is still experimental and incomplete at the
1550# moment.
1551
1552GENERATE_PERLMOD = NO
1553
1554# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
1555# the necessary Makefile rules, Perl scripts and LaTeX code to be able
1556# to generate PDF and DVI output from the Perl module output.
1557
1558PERLMOD_LATEX = NO
1559
1560# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
1561# nicely formatted so it can be parsed by a human reader. This is useful
1562# if you want to understand what is going on. On the other hand, if this
1563# tag is set to NO the size of the Perl module output will be much smaller
1564# and Perl will parse it just the same.
1565
1566PERLMOD_PRETTY = YES
1567
1568# The names of the make variables in the generated doxyrules.make file
1569# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
1570# This is useful so different doxyrules.make files included by the same
1571# Makefile don't overwrite each other's variables.
1572
1573PERLMOD_MAKEVAR_PREFIX =
1574
1575#---------------------------------------------------------------------------
1576# Configuration options related to the preprocessor
1577#---------------------------------------------------------------------------
1578
1579# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
1580# evaluate all C-preprocessor directives found in the sources and include
1581# files.
1582
1583ENABLE_PREPROCESSING = YES
1584
1585# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
1586# names in the source code. If set to NO (the default) only conditional
1587# compilation will be performed. Macro expansion can be done in a controlled
1588# way by setting EXPAND_ONLY_PREDEF to YES.
1589
1590MACRO_EXPANSION = NO
1591
1592# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
1593# then the macro expansion is limited to the macros specified with the
1594# PREDEFINED and EXPAND_AS_DEFINED tags.
1595
1596EXPAND_ONLY_PREDEF = NO
1597
1598# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
1599# pointed to by INCLUDE_PATH will be searched when a #include is found.
1600
1601SEARCH_INCLUDES = YES
1602
1603# The INCLUDE_PATH tag can be used to specify one or more directories that
1604# contain include files that are not input files but should be processed by
1605# the preprocessor.
1606
1607INCLUDE_PATH =
1608
1609# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
1610# patterns (like *.h and *.hpp) to filter out the header-files in the
1611# directories. If left blank, the patterns specified with FILE_PATTERNS will
1612# be used.
1613
1614INCLUDE_FILE_PATTERNS =
1615
1616# The PREDEFINED tag can be used to specify one or more macro names that
1617# are defined before the preprocessor is started (similar to the -D option of
1618# gcc). The argument of the tag is a list of macros of the form: name
1619# or name=definition (no spaces). If the definition and the = are
1620# omitted =1 is assumed. To prevent a macro definition from being
1621# undefined via #undef or recursively expanded use the := operator
1622# instead of the = operator.
1623
1624PREDEFINED =
1625
1626# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
1627# this tag can be used to specify a list of macro names that should be expanded.
1628# The macro definition that is found in the sources will be used.
1629# Use the PREDEFINED tag if you want to use a different macro definition that
1630# overrules the definition found in the source code.
1631
1632EXPAND_AS_DEFINED =
1633
1634# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
1635# doxygen's preprocessor will remove all references to function-like macros
1636# that are alone on a line, have an all uppercase name, and do not end with a
1637# semicolon, because these will confuse the parser if not removed.
1638
1639SKIP_FUNCTION_MACROS = YES
1640
1641#---------------------------------------------------------------------------
1642# Configuration::additions related to external references
1643#---------------------------------------------------------------------------
1644
1645# The TAGFILES option can be used to specify one or more tagfiles. For each
1646# tag file the location of the external documentation should be added. The
1647# format of a tag file without this location is as follows:
1648# TAGFILES = file1 file2 ...
1649# Adding location for the tag files is done as follows:
1650# TAGFILES = file1=loc1 "file2 = loc2" ...
1651# where "loc1" and "loc2" can be relative or absolute paths
1652# or URLs. Note that each tag file must have a unique name (where the name does
1653# NOT include the path). If a tag file is not located in the directory in which
1654# doxygen is run, you must also specify the path to the tagfile here.
1655
1656TAGFILES =
1657
1658# When a file name is specified after GENERATE_TAGFILE, doxygen will create
1659# a tag file that is based on the input files it reads.
1660
1661GENERATE_TAGFILE =
1662
1663# If the ALLEXTERNALS tag is set to YES all external classes will be listed
1664# in the class index. If set to NO only the inherited external classes
1665# will be listed.
1666
1667ALLEXTERNALS = NO
1668
1669# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
1670# in the modules index. If set to NO, only the current project's groups will
1671# be listed.
1672
1673EXTERNAL_GROUPS = YES
1674
1675# The PERL_PATH should be the absolute path and name of the perl script
1676# interpreter (i.e. the result of `which perl').
1677
1678PERL_PATH = /usr/bin/perl
1679
1680#---------------------------------------------------------------------------
1681# Configuration options related to the dot tool
1682#---------------------------------------------------------------------------
1683
1684# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
1685# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
1686# or super classes. Setting the tag to NO turns the diagrams off. Note that
1687# this option also works with HAVE_DOT disabled, but it is recommended to
1688# install and use dot, since it yields more powerful graphs.
1689
1690CLASS_DIAGRAMS = YES
1691
1692# You can define message sequence charts within doxygen comments using the \msc
1693# command. Doxygen will then run the mscgen tool (see
1694# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
1695# documentation. The MSCGEN_PATH tag allows you to specify the directory where
1696# the mscgen tool resides. If left empty the tool is assumed to be found in the
1697# default search path.
1698
1699MSCGEN_PATH =
1700
1701# If set to YES, the inheritance and collaboration graphs will hide
1702# inheritance and usage relations if the target is undocumented
1703# or is not a class.
1704
1705HIDE_UNDOC_RELATIONS = YES
1706
1707# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
1708# available from the path. This tool is part of Graphviz, a graph visualization
1709# toolkit from AT&T and Lucent Bell Labs. The other options in this section
1710# have no effect if this option is set to NO (the default)
1711
1712HAVE_DOT = NO
1713
1714# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
1715# allowed to run in parallel. When set to 0 (the default) doxygen will
1716# base this on the number of processors available in the system. You can set it
1717# explicitly to a value larger than 0 to get control over the balance
1718# between CPU load and processing speed.
1719
1720DOT_NUM_THREADS = 0
1721
1722# By default doxygen will use the Helvetica font for all dot files that
1723# doxygen generates. When you want a differently looking font you can specify
1724# the font name using DOT_FONTNAME. You need to make sure dot is able to find
1725# the font, which can be done by putting it in a standard location or by setting
1726# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
1727# directory containing the font.
1728
1729DOT_FONTNAME = Helvetica
1730
1731# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
1732# The default size is 10pt.
1733
1734DOT_FONTSIZE = 10
1735
1736# By default doxygen will tell dot to use the Helvetica font.
1737# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
1738# set the path where dot can find it.
1739
1740DOT_FONTPATH =
1741
1742# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
1743# will generate a graph for each documented class showing the direct and
1744# indirect inheritance relations. Setting this tag to YES will force the
1745# CLASS_DIAGRAMS tag to NO.
1746
1747CLASS_GRAPH = YES
1748
1749# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
1750# will generate a graph for each documented class showing the direct and
1751# indirect implementation dependencies (inheritance, containment, and
1752# class references variables) of the class with other documented classes.
1753
1754COLLABORATION_GRAPH = YES
1755
1756# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
1757# will generate a graph for groups, showing the direct groups dependencies
1758
1759GROUP_GRAPHS = YES
1760
1761# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
1762# collaboration diagrams in a style similar to the OMG's Unified Modeling
1763# Language.
1764
1765UML_LOOK = NO
1766
1767# If the UML_LOOK tag is enabled, the fields and methods are shown inside
1768# the class node. If there are many fields or methods and many nodes the
1769# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
1770# threshold limits the number of items for each type to make the size more
1771# managable. Set this to 0 for no limit. Note that the threshold may be
1772# exceeded by 50% before the limit is enforced.
1773
1774UML_LIMIT_NUM_FIELDS = 10
1775
1776# If set to YES, the inheritance and collaboration graphs will show the
1777# relations between templates and their instances.
1778
1779TEMPLATE_RELATIONS = NO
1780
1781# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
1782# tags are set to YES then doxygen will generate a graph for each documented
1783# file showing the direct and indirect include dependencies of the file with
1784# other documented files.
1785
1786INCLUDE_GRAPH = YES
1787
1788# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
1789# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
1790# documented header file showing the documented files that directly or
1791# indirectly include this file.
1792
1793INCLUDED_BY_GRAPH = YES
1794
1795# If the CALL_GRAPH and HAVE_DOT options are set to YES then
1796# doxygen will generate a call dependency graph for every global function
1797# or class method. Note that enabling this option will significantly increase
1798# the time of a run. So in most cases it will be better to enable call graphs
1799# for selected functions only using the \callgraph command.
1800
1801CALL_GRAPH = NO
1802
1803# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
1804# doxygen will generate a caller dependency graph for every global function
1805# or class method. Note that enabling this option will significantly increase
1806# the time of a run. So in most cases it will be better to enable caller
1807# graphs for selected functions only using the \callergraph command.
1808
1809CALLER_GRAPH = NO
1810
1811# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
1812# will generate a graphical hierarchy of all classes instead of a textual one.
1813
1814GRAPHICAL_HIERARCHY = YES
1815
1816# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
1817# then doxygen will show the dependencies a directory has on other directories
1818# in a graphical way. The dependency relations are determined by the #include
1819# relations between the files in the directories.
1820
1821DIRECTORY_GRAPH = YES
1822
1823# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
1824# generated by dot. Possible values are svg, png, jpg, or gif.
1825# If left blank png will be used. If you choose svg you need to set
1826# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
1827# visible in IE 9+ (other browsers do not have this requirement).
1828
1829DOT_IMAGE_FORMAT = png
1830
1831# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
1832# enable generation of interactive SVG images that allow zooming and panning.
1833# Note that this requires a modern browser other than Internet Explorer.
1834# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
1835# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
1836# visible. Older versions of IE do not have SVG support.
1837
1838INTERACTIVE_SVG = NO
1839
1840# The tag DOT_PATH can be used to specify the path where the dot tool can be
1841# found. If left blank, it is assumed the dot tool can be found in the path.
1842
1843DOT_PATH =
1844
1845# The DOTFILE_DIRS tag can be used to specify one or more directories that
1846# contain dot files that are included in the documentation (see the
1847# \dotfile command).
1848
1849DOTFILE_DIRS =
1850
1851# The MSCFILE_DIRS tag can be used to specify one or more directories that
1852# contain msc files that are included in the documentation (see the
1853# \mscfile command).
1854
1855MSCFILE_DIRS =
1856
1857# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
1858# nodes that will be shown in the graph. If the number of nodes in a graph
1859# becomes larger than this value, doxygen will truncate the graph, which is
1860# visualized by representing a node as a red box. Note that doxygen if the
1861# number of direct children of the root node in a graph is already larger than
1862# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
1863# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
1864
1865DOT_GRAPH_MAX_NODES = 50
1866
1867# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
1868# graphs generated by dot. A depth value of 3 means that only nodes reachable
1869# from the root by following a path via at most 3 edges will be shown. Nodes
1870# that lay further from the root node will be omitted. Note that setting this
1871# option to 1 or 2 may greatly reduce the computation time needed for large
1872# code bases. Also note that the size of a graph can be further restricted by
1873# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
1874
1875MAX_DOT_GRAPH_DEPTH = 0
1876
1877# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
1878# background. This is disabled by default, because dot on Windows does not
1879# seem to support this out of the box. Warning: Depending on the platform used,
1880# enabling this option may lead to badly anti-aliased labels on the edges of
1881# a graph (i.e. they become hard to read).
1882
1883DOT_TRANSPARENT = NO
1884
1885# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
1886# files in one run (i.e. multiple -o and -T options on the command line). This
1887# makes dot run faster, but since only newer versions of dot (>1.8.10)
1888# support this, this feature is disabled by default.
1889
1890DOT_MULTI_TARGETS = NO
1891
1892# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
1893# generate a legend page explaining the meaning of the various boxes and
1894# arrows in the dot generated graphs.
1895
1896GENERATE_LEGEND = YES
1897
1898# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
1899# remove the intermediate dot files that are used to generate
1900# the various graphs.
1901
1902DOT_CLEANUP = YES
01903
=== modified file 'plugins/Observability/src/Observability.cpp'
--- plugins/Observability/src/Observability.cpp 2014-03-01 09:50:05 +0000
+++ plugins/Observability/src/Observability.cpp 2014-04-04 19:38:38 +0000
@@ -16,40 +16,41 @@
16 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.16 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
17 */17 */
1818
19#include <QDebug>
20#include <QKeyEvent>
21#include <QMouseEvent>
22#include <QPixmap>
19#include <QSettings>23#include <QSettings>
20#include <QPixmap>24#include <QString>
21#include <QTimer>25#include <QTimer>
22#include <QString>26
23#include <QDebug>27//#include <QtNetwork> // Why do we need a full part of the framwork again?
24#include <QKeyEvent>28
25#include <QtNetwork>29#include "Observability.hpp"
26#include <QKeyEvent>30#include "ObservabilityDialog.hpp"
27#include <QMouseEvent>31
2832#include "Planet.hpp"
29#include "StelIniParser.hpp"33#include "SolarSystem.hpp"
30#include "StelProjector.hpp"
31#include "StarMgr.hpp"34#include "StarMgr.hpp"
32#include "StelObject.hpp"35#include "StelActionMgr.hpp"
33#include "StelObserver.hpp"
34#include "StelUtils.hpp"
35#include "StelApp.hpp"36#include "StelApp.hpp"
36#include "StelObjectMgr.hpp"37#include "StelCore.hpp"
38#include "StelFader.hpp"
39#include "StelFileMgr.hpp"
40#include "StelGui.hpp"
41#include "StelGuiItems.hpp"
42#include "StelIniParser.hpp"
37#include "StelLocaleMgr.hpp"43#include "StelLocaleMgr.hpp"
38#include "StelModuleMgr.hpp"44#include "StelModuleMgr.hpp"
39#include "StelGui.hpp"
40#include "StelGuiItems.hpp"
41#include "StelMovementMgr.hpp"45#include "StelMovementMgr.hpp"
42#include "StelFileMgr.hpp"46#include "StelObject.hpp"
43#include "StelVertexArray.hpp"47#include "StelObjectMgr.hpp"
44#include "StelCore.hpp"48#include "StelObserver.hpp"
45#include "StelPainter.hpp"49#include "StelProjector.hpp"
46#include "StelSkyDrawer.hpp"50#include "StelSkyDrawer.hpp"
47#include "Observability.hpp"51#include "StelUtils.hpp"
48#include "ObservabilityDialog.hpp"52#include "ZoneArray.hpp"
4953
50#include "SolarSystem.hpp"
51#include "Planet.hpp"
52#include "StelFader.hpp"
5354
54StelModule* ObservabilityStelPluginInterface::getStelModule() const55StelModule* ObservabilityStelPluginInterface::getStelModule() const
55{56{
@@ -70,13 +71,15 @@
70 return info;71 return info;
71}72}
7273
74
75
73Observability::Observability()76Observability::Observability()
74 : flagShowObservability(false), OnIcon(NULL), OffIcon(NULL), GlowIcon(NULL),toolbarButton(NULL)77 : ObserverLoc(0.), flagShowReport(false), button(NULL)
75{78{
76 setObjectName("Observability");79 setObjectName("Observability");
77 configDialog = new ObservabilityDialog();80 configDialog = new ObservabilityDialog();
7881
7982 // TODO: Migrate to static const? --BM
80 // Some useful constants:83 // Some useful constants:
81 Rad2Deg = 180./3.1415927; // Convert degrees into radians84 Rad2Deg = 180./3.1415927; // Convert degrees into radians
82 Rad2Hr = 12./3.1415927; // Convert hours into radians85 Rad2Hr = 12./3.1415927; // Convert hours into radians
@@ -86,107 +89,37 @@
86 halfpi = 1.57079632675; // pi/289 halfpi = 1.57079632675; // pi/2
87 MoonT = 29.530588; // Moon synodic period (used as first estimate of Full Moon).90 MoonT = 29.530588; // Moon synodic period (used as first estimate of Full Moon).
88 RefFullMoon = 2451564.696; // Reference Julian date of a Full Moon.91 RefFullMoon = 2451564.696; // Reference Julian date of a Full Moon.
89 MoonPerilune = 0.0024236308; // Smallest Earth-Moon distance (in AU). 92 MoonPerilune = 0.0024236308; // Smallest Earth-Moon distance (in AU).
93
90 nextFullMoon = 0.0;94 nextFullMoon = 0.0;
91 prevFullMoon = 0.0;95 prevFullMoon = 0.0;
92 RefracHoriz = 0.0; // Geometric altitude at refraction-corrected horizon. 96 refractedHorizonAlt = 0.0;
93 selName = "";97 selName = "";
9498
95
96
97////////////////////////////
98// Read configuration:
99
100 QSettings* conf = StelApp::getInstance().getSettings();
101 // Setup defaults if not present
102 conf->beginGroup("Observability");
103 if (!conf->contains("font_size"))
104 conf->setValue("font_size", 15);
105
106 if (!conf->contains("font_color"))
107 conf->setValue("font_color", "0,0.5,1");
108
109 if (!conf->contains("show_AcroCos"))
110 conf->setValue("show_AcroCos", true);
111
112 if (!conf->contains("show_Good_Nights"))
113 conf->setValue("show_Good_Nights", true);
114
115 if (!conf->contains("show_Best_Night"))
116 conf->setValue("show_Best_Night", true);
117
118 if (!conf->contains("show_Today"))
119 conf->setValue("show_Today", true);
120
121 if (!conf->contains("Sun_Altitude"))
122 conf->setValue("Sun_Altitude", 12);
123
124 if (!conf->contains("Horizon_Altitude"))
125 conf->setValue("Horizon_Altitude", 0);
126
127 if (!conf->contains("show_FullMoon"))
128 conf->setValue("show_FullMoon", true);
129
130// if (!conf->contains("show_Crescent"))
131// conf->setValue("show_Crescent", true);
132
133// if (!conf->contains("show_SuperMoon"))
134// conf->setValue("show_SuperMoon", true);
135
136
137 // Load settings from main config file
138 fontSize = conf->value("font_size",15).toInt();
139 iAltitude = conf->value("Sun_Altitude",12).toInt();
140 iHorizAltitude = conf->value("Horizon_Altitude",0).toInt();
141 AstroTwiAlti = -((double) iAltitude)/Rad2Deg ;
142 HorizAlti = ((double) iHorizAltitude)/Rad2Deg ;
143 font.setPixelSize(fontSize);
144 QString fontColorStr = conf->value("font_color", "0,0.5,1").toString();
145 fontColor = StelUtils::strToVec3f(fontColorStr);
146 show_AcroCos = conf->value("show_AcroCos", true).toBool();
147 show_Good_Nights = conf->value("show_Good_Nights", true).toBool();
148 show_Best_Night = conf->value("show_Best_Night", true).toBool();
149 show_Today = conf->value("show_Today", true).toBool();
150 show_FullMoon = conf->value("show_FullMoon", true).toBool();
151// show_Crescent = conf->value("show_Crescent", true).toBool();
152// show_SuperMoon = conf->value("show_SuperMoon", true).toBool();
153
154 conf->endGroup();
155/////////////////////////////////
156
157 // Apply format for date from main settings
158 if (conf->value("localization/date_display_format", "system_default").toString() == "ddmmyyyy")
159 setDateFormat(true);
160 else
161 setDateFormat(false);
162
163 // Dummy initial values for parameters and data vectors:99 // Dummy initial values for parameters and data vectors:
164 mylat = 1000.; mylon = 1000.;100 mylat = 1000.; mylon = 1000.;
165 myJD = 0.0;101 myJD = 0.0;
166 currYear = 0;102 curYear = 0;
167 isStar = true;103 isStar = true;
168 isMoon = false;104 isMoon = false;
169 isSun = false;105 isSun = false;
170 isScreen = true;106 isScreen = true;
171 raised=false;107
172108 //Get pointer to the Earth:
173 ObserverLoc[0]=0.0;ObserverLoc[1]=0.0;ObserverLoc[2]=0.0;
174
175//Get pointer to the Earth:
176 PlanetP Earth = GETSTELMODULE(SolarSystem)->getEarth();109 PlanetP Earth = GETSTELMODULE(SolarSystem)->getEarth();
177 myEarth = Earth.data();110 myEarth = Earth.data();
178111
179// Get pointer to the Moon/Sun:112 // Get pointer to the Moon/Sun:
180 PlanetP Moon = GETSTELMODULE(SolarSystem)->getMoon();113 PlanetP Moon = GETSTELMODULE(SolarSystem)->getMoon();
181 myMoon = Moon.data();114 myMoon = Moon.data();
182115
183116 // I think this can be done in a more simple way...--BM
184 for (int i=0;i<366;i++) {117 for (int i=0;i<366;i++) {
185 SunRA[i] = 0.0; SunDec[i] = 0.0;118 sunRA[i] = 0.0; sunDec[i] = 0.0;
186 ObjectRA[i] = 0.0; ObjectDec[i]=0.0;119 objectRA[i] = 0.0; objectDec[i]=0.0;
187 SunSidT[0][i]=0.0; SunSidT[1][i]=0.0;120 sunSidT[0][i]=0.0; sunSidT[1][i]=0.0;
188 ObjectSidT[0][i]=0.0; ObjectSidT[1][i]=0.0;121 objectSidT[0][i]=0.0; objectSidT[1][i]=0.0;
189 ObjectH0[i] = 0.0;122 objectH0[i] = 0.0;
190 yearJD[i] = 0.0;123 yearJD[i] = 0.0;
191 };124 };
192125
@@ -194,26 +127,33 @@
194127
195Observability::~Observability()128Observability::~Observability()
196{129{
197 if (GlowIcon!=NULL)130 // Shouldn't this be in the deinit()? --BM
198 delete GlowIcon;131 if (configDialog != NULL)
199 if (OnIcon!=NULL)132 delete configDialog;
200 delete OnIcon;
201 if (OffIcon!=NULL)
202 delete OffIcon;
203 delete configDialog;
204}133}
205134
206void Observability::updateMessageText()135void Observability::updateMessageText()
207{136{
208 // Set names of the months:137 // Set names of the months:
209 QString mons[12]={qc_("Jan", "short month name"), qc_("Feb", "short month name"), qc_("Mar", "short month name"), qc_("Apr", "short month name"), qc_("May", "short month name"), qc_("Jun", "short month name"), qc_("Jul", "short month name"), qc_("Aug", "short month name"), qc_("Sep", "short month name"), qc_("Oct", "short month name"), qc_("Nov", "short month name"), qc_("Dec", "short month name")};138 monthNames.clear();
210139 monthNames << qc_("Jan", "short month name")
211 for (int i=0;i<12;i++) {140 << qc_("Feb", "short month name")
212 months[i]=mons[i];141 << qc_("Mar", "short month name")
213 };142 << qc_("Apr", "short month name")
214143 << qc_("May", "short month name")
144 << qc_("Jun", "short month name")
145 << qc_("Jul", "short month name")
146 << qc_("Aug", "short month name")
147 << qc_("Sep", "short month name")
148 << qc_("Oct", "short month name")
149 << qc_("Nov", "short month name")
150 << qc_("Dec", "short month name");
151
152 // TRANSLATORS: Short for "hours".
215 msgH = q_("h");153 msgH = q_("h");
154 // TRANSLATORS: Short for "minutes".
216 msgM = q_("m");155 msgM = q_("m");
156 // TRANSLATORS: Short for "seconds".
217 msgS = q_("s");157 msgS = q_("s");
218 msgSetsAt = q_("Sets at %1 (in %2)");158 msgSetsAt = q_("Sets at %1 (in %2)");
219 msgRoseAt = q_("Rose at %1 (%2 ago)");159 msgRoseAt = q_("Rose at %1 (%2 ago)");
@@ -224,79 +164,82 @@
224 msgCulminatesAt = q_("Culminates at %1 (in %2) at %3 deg.");164 msgCulminatesAt = q_("Culminates at %1 (in %2) at %3 deg.");
225 msgCulminatedAt = q_("Culminated at %1 (%2 ago) at %3 deg.");165 msgCulminatedAt = q_("Culminated at %1 (%2 ago) at %3 deg.");
226 msgSrcNotObs = q_("Source is not observable.");166 msgSrcNotObs = q_("Source is not observable.");
227 msgNoACRise = q_("No Acronychal nor Cosmical rise/set.");167 msgNoACRise = q_("No acronychal nor cosmical rise/set.");
228 msgGreatElong = q_("Greatest elongation: ");168 msgGreatElong = q_("Greatest elongation: %1 (at %2 deg.)");
229 msgLargSSep = q_("Largest Sun separation: ");169 msgLargSSep = q_("Largest Sun separation: %1 (at %2 deg.)");
230 msgAtDeg = q_(" (at %1 deg.)");
231 msgNone = q_("None");170 msgNone = q_("None");
232 msgAcroRise = q_("Acronychal rise/set");171 // TRANSLATORS: The space at the end is significant - another sentence may follow.
233 msgNoAcroRise = q_("No Acronychal rise/set.");172 msgAcroRise = q_("Acronychal rise/set: %1/%2. ");
234 msgCosmRise = q_("Cosmical rise/set");173 // TRANSLATORS: The space at the end is significant - another sentence may follow.
235 msgNoCosmRise = q_("No Cosmical rise/set.");174 msgNoAcroRise = q_("No acronychal rise/set. ");
175 msgCosmRise = q_("Cosmical rise/set: %1/%2.");
176 msgNoCosmRise = q_("No cosmical rise/set.");
236 msgWholeYear = q_("Observable during the whole year.");177 msgWholeYear = q_("Observable during the whole year.");
237 msgNotObs = q_("Not observable at dark night.");178 msgNotObs = q_("Not observable at dark night.");
238 msgAboveHoriz = q_("Nights above horizon: ");179 msgAboveHoriz = q_("Nights above horizon: %1");
239 msgToday = q_("TODAY:");180 msgToday = q_("TODAY:");
240 msgThisYear = q_("THIS YEAR:");181 msgThisYear = q_("THIS YEAR:");
182 // TRANSLATORS: The space at the end is significant - another sentence may follow.
241 msgPrevFullMoon = q_("Previous Full Moon: %1 %2 at %3:%4. ");183 msgPrevFullMoon = q_("Previous Full Moon: %1 %2 at %3:%4. ");
242 msgNextFullMoon = q_("Next Full Moon: %1 %2 at %3:%4. ");184 msgNextFullMoon = q_("Next Full Moon: %1 %2 at %3:%4. ");
243}185}
244186
245double Observability::getCallOrder(StelModuleActionName actionName) const187double Observability::getCallOrder(StelModuleActionName actionName) const
246{188{
247 if (actionName==StelModule::ActionDraw)189 if (actionName==StelModule::ActionDraw)
248 return StelApp::getInstance().getModuleMgr().getModule("LandscapeMgr")->getCallOrder(actionName)+10.;190 return StelApp::getInstance().getModuleMgr().getModule("LandscapeMgr")->getCallOrder(actionName)+10.;
249 return 0;191 return 0;
250}192}
251193
252void Observability::init()194void Observability::init()
253{195{
254 qDebug() << "init called for Observability";196 loadConfiguration();
255197
256 try 198 StelAction* actionShow = addAction("actionShow_Observability",
257 {199 N_("Observability"),
258 StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());200 N_("Observability"),
259 GlowIcon = new QPixmap(":/graphicGui/glow32x32.png");201 "flagShowReport");
260 OnIcon = new QPixmap(":/observability/bt_observab_on.png");202 // actionShow->setChecked(flagShowReport); //Unnecessary?
261 OffIcon = new QPixmap(":/observability/bt_observab_off.png");203 addAction("actionShow_Observability_ConfigDialog",
262204 N_("Observability"),
263 addAction("actionShow_Observability", N_("Observability"), N_("Observability"), "enabled");205 N_("Observability configuration window"),
264 addAction("actionShow_Observability_ConfigDialog", N_("Observability"), N_("Observability configuration window"), configDialog, "visible");206 configDialog, "visible");
265 toolbarButton = new StelButton(NULL, *OnIcon, *OffIcon, *GlowIcon, "actionShow_Observability");207
266 gui->getButtonBar()->addButton(toolbarButton, "065-pluginsGroup");208 StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
267 }209 button = new StelButton(NULL,
268 catch (std::exception &e)210 QPixmap(":/observability/bt_observab_on.png"),
269 {211 QPixmap(":/observability/bt_observab_off.png"),
270 qWarning() << "WARNING: unable create toolbar button for Observability plugin (or load gonfig GUI). " << e.what();212 QPixmap(":/graphicGui/glow32x32.png"),
271 };213 actionShow);
272214 gui->getButtonBar()->addButton(button, "065-pluginsGroup");
273 updateMessageText();215
274 connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(updateMessageText()));216 updateMessageText();
217 connect(&StelApp::getInstance(), SIGNAL(languageChanged()),
218 this, SLOT(updateMessageText()));
275}219}
276220
277/////////////////////////////////////////////221/////////////////////////////////////////////
278// MAIN CODE:222// MAIN CODE:
279void Observability::draw(StelCore* core)223void Observability::draw(StelCore* core)
280{224{
281225 if (!flagShowReport)
282 if (!flagShowObservability) return; // Button is off.226 return; // Button is off.
283227
284/////////////////////////////////////////////////////////////////228/////////////////////////////////////////////////////////////////
285// PRELIMINARS:229// PRELIMINARS:
286 bool locChanged, yearChanged;230 bool locChanged, yearChanged;
287 StelObjectP selectedObject;231 StelObjectP selectedObject;
288 Planet* currPlanet;232 PlanetP ssObject, parentPlanet;
289 PlanetP Object, parent;
290233
291// Only execute plugin if we are on Earth.234// Only execute plugin if we are on Earth.
292 if (core->getCurrentLocation().planetName != "Earth") {return;};235 if (core->getCurrentLocation().planetName != "Earth")
236 return;
293237
294// Set the painter:238// Set the painter:
295 StelPainter paintresult(core->getProjection2d());239 StelPainter painter(core->getProjection2d());
296 paintresult.setColor(fontColor[0],fontColor[1],fontColor[2],1);240 painter.setColor(fontColor[0],fontColor[1],fontColor[2],1);
297 font.setPixelSize(fontSize);241 font.setPixelSize(fontSize);
298 paintresult.setFont(font);242 painter.setFont(font);
299
300243
301// Get current date, location, and check if there is something selected.244// Get current date, location, and check if there is something selected.
302 double currlat = (core->getCurrentLocation().latitude)/Rad2Deg;245 double currlat = (core->getCurrentLocation().latitude)/Rad2Deg;
@@ -312,7 +255,7 @@
312 double currLocalT = 24.*modf(currJD + GMTShift,&currJDint);255 double currLocalT = 24.*modf(currJD + GMTShift,&currJDint);
313256
314 int auxm, auxd, auxy;257 int auxm, auxd, auxy;
315 StelUtils::getDateFromJulianDay(currJD,&auxy,&auxm,&auxd);258 StelUtils::getDateFromJulianDay(currJD, &auxy, &auxm, &auxd);
316 bool isSource = StelApp::getInstance().getStelObjectMgr().getWasSelected();259 bool isSource = StelApp::getInstance().getStelObjectMgr().getWasSelected();
317 bool show_Year = show_Best_Night || show_Good_Nights || show_AcroCos; 260 bool show_Year = show_Best_Night || show_Good_Nights || show_AcroCos;
318261
@@ -325,19 +268,25 @@
325// Update JD.268// Update JD.
326 myJD = currJD;269 myJD = currJD;
327270
328// If we have changed the year, we must recompute the Sun's position for each new day:271// If the year changed, we must recompute the Sun's position for each new day:
329 if (auxy != currYear) {272 if (auxy != curYear)
273 {
330 yearChanged = true;274 yearChanged = true;
331 currYear = auxy;275 curYear = auxy;
332 SunRADec(core);}276 updateSunData(core);
333 else {277 }
278 else
279 {
334 yearChanged = false;280 yearChanged = false;
335 };281 };
336282
337// Have we changed the latitude or longitude?283// Have we changed the latitude or longitude?
338 if (currlat == mylat && currlon == mylon) {284 if (currlat == mylat && currlon == mylon)
339 locChanged = false;}285 {
340 else {286 locChanged = false;
287 }
288 else
289 {
341 locChanged = true;290 locChanged = true;
342 mylat = currlat; mylon = currlon;291 mylat = currlat; mylon = currlon;
343 double temp1 = currheight*std::cos(currlat);292 double temp1 = currheight*std::cos(currlat);
@@ -350,16 +299,18 @@
350299
351// Add refraction, if necessary:300// Add refraction, if necessary:
352 Vec3d TempRefr; 301 Vec3d TempRefr;
353 TempRefr[0] = std::cos(HorizAlti); 302 TempRefr[0] = std::cos(horizonAltitude);
354 TempRefr[1] = 0.0; 303 TempRefr[1] = 0.0;
355 TempRefr[2] = std::sin(HorizAlti); 304 TempRefr[2] = std::sin(horizonAltitude);
356 Vec3d CorrRefr = core->altAzToEquinoxEqu(TempRefr,StelCore::RefractionAuto);305 Vec3d CorrRefr = core->altAzToEquinoxEqu(TempRefr,StelCore::RefractionAuto);
357 TempRefr = core->equinoxEquToAltAz(CorrRefr,StelCore::RefractionOff);306 TempRefr = core->equinoxEquToAltAz(CorrRefr,StelCore::RefractionOff);
358 double RefracAlt = std::asin(TempRefr[2]);307 double RefracAlt = std::asin(TempRefr[2]);
359308
360 if (std::abs(RefracHoriz-RefracAlt)>2.91e-4) // Diference larger than 1 arcminute.309 // If the diference is larger than 1 arcminute...
361 { // Configuration for refraction changed notably:310 if (std::abs(refractedHorizonAlt-RefracAlt)>2.91e-4)
362 RefracHoriz = RefracAlt;311 {
312 //... configuration for refraction changed notably.
313 refractedHorizonAlt = RefracAlt;
363 configChanged = true;314 configChanged = true;
364 souChanged = true;315 souChanged = true;
365 };316 };
@@ -372,7 +323,7 @@
372// angles at twilight, and re-compute Sun/Moon ephemeris (if selected):323// angles at twilight, and re-compute Sun/Moon ephemeris (if selected):
373 if (locChanged || yearChanged || configChanged) 324 if (locChanged || yearChanged || configChanged)
374 {325 {
375 SunHTwi();326 updateSunH();
376 lastJDMoon = 0.0;327 lastJDMoon = 0.0;
377 };328 };
378329
@@ -382,42 +333,48 @@
382//////////////////////////////////////////////////////////////////333//////////////////////////////////////////////////////////////////
383// NOW WE DEAL WITH THE SOURCE (OR SCREEN-CENTER) POSITION:334// NOW WE DEAL WITH THE SOURCE (OR SCREEN-CENTER) POSITION:
384335
385 if (isScreen) souChanged=true; // Always re-compute everything for the screen center.336 if (isScreen) // Always re-compute everything for the screen center.
337 souChanged = true;
386338
387 if (isSource) { // There is something selected!339 if (isSource) // There is something selected!
340 {
388341
389// Get the selected source and its name:342// Get the selected source and its name:
390 selectedObject = StelApp::getInstance().getStelObjectMgr().getSelectedObject()[0]; 343 selectedObject = StelApp::getInstance().getStelObjectMgr().getSelectedObject()[0];
391344
392// Don't do anything for satellites:345// Don't do anything for satellites:
393 if(selectedObject->getType()== "Satellite") return;346 if(selectedObject->getType() == "Satellite")
394347 return;
395 QString tempName = selectedObject->getEnglishName();348
396349 QString name = selectedObject->getEnglishName();
397// Check if the source is Sun or Moon (i.e., it changes quite a bit during one day):350 isMoon = ("Moon" == name);
398 isMoon = ("Moon" == tempName)?true:false;351 isSun = ("Sun" == name);
399 isSun = ("Sun" == tempName)?true:false;
400352
401// If Moon is not selected (or was unselected), force re-compute of Full Moon next time it is selected:353// If Moon is not selected (or was unselected), force re-compute of Full Moon next time it is selected:
402 if (!isMoon) {prevFullMoon=0.0; nextFullMoon=0.0;};354 if (!isMoon)
355 {
356 prevFullMoon = 0.0;
357 nextFullMoon = 0.0;
358 };
403359
404//Update position:360//Update position:
405 EquPos = selectedObject->getEquinoxEquatorialPos(core);361 EquPos = selectedObject->getEquinoxEquatorialPos(core);
406 EquPos.normalize();362 EquPos.normalize();
407 LocPos = core->equinoxEquToAltAz(EquPos,StelCore::RefractionOff);363 LocPos = core->equinoxEquToAltAz(EquPos, StelCore::RefractionOff);
408364
409// Check if the user has changed the source (or if the source is Sun/Moon). 365// Check if the user has changed the source (or if the source is Sun/Moon).
410 if (tempName == selName) 366 if (name == selName)
411 {367 {
412 souChanged = false;}368 souChanged = false;
369 }
413 else 370 else
414 { // Check also if the (new) source belongs to the Solar System:371 { // Check also if the (new) source belongs to the Solar System:
415372
416 souChanged = true;373 souChanged = true;
417 selName = tempName;374 selName = name;
418375
419 currPlanet = dynamic_cast<Planet*>(selectedObject.data());376 Planet* planet = dynamic_cast<Planet*>(selectedObject.data());
420 isStar = (currPlanet)?false:true;377 isStar = (planet == NULL);
421378
422 if (!isStar && !isMoon && !isSun) // Object in the Solar System, but is not Sun nor Moon.379 if (!isStar && !isMoon && !isSun) // Object in the Solar System, but is not Sun nor Moon.
423 { 380 {
@@ -425,39 +382,45 @@
425 int gene = -1;382 int gene = -1;
426383
427 // If object is a planet's moon, we get its parent planet:384 // If object is a planet's moon, we get its parent planet:
428 Object = GETSTELMODULE(SolarSystem)->searchByEnglishName(selName);385 ssObject = GETSTELMODULE(SolarSystem)->searchByEnglishName(selName);
429386 // TODO: Isn't it easier just to use the planet object we just cast? --BM
430 parent = Object->getParent();387
431388 parentPlanet = ssObject->getParent();
432 if (parent) 389 if (parentPlanet)
433 {390 {
434 while (parent) {391 while (parentPlanet)
435 gene += 1;392 {
436 parent = parent->getParent();}393 gene += 1;
437 };394 parentPlanet = parentPlanet->getParent();
438 for (int g=0; g<gene;g++) {395 }
439 Object = Object->getParent();396 }
440 };397 for (int g=0; g<gene; g++)
441 398 {
399 ssObject = ssObject->getParent();
400 }
401
442 // Now get a pointer to the planet's instance:402 // Now get a pointer to the planet's instance:
443 myPlanet = Object.data();403 myPlanet = ssObject.data();
444 };404 }
445405 }
446 };
447 }406 }
448 else { // There is no source selected!407 else // There is no source selected!
449408 {
450// If no source is selected, get the position vector of the screen center:409 // If no source is selected, get the position vector of the screen center:
451 selName = ""; isStar=true; isMoon = false; isSun = false; isScreen=true;410 selName.clear();
411 isStar = true;
412 isMoon = false;
413 isSun = false;
414 isScreen = true;
452 Vec3d currentPos = GETSTELMODULE(StelMovementMgr)->getViewDirectionJ2000();415 Vec3d currentPos = GETSTELMODULE(StelMovementMgr)->getViewDirectionJ2000();
453 currentPos.normalize();416 currentPos.normalize();
454 EquPos = core->j2000ToEquinoxEqu(currentPos);417 EquPos = core->j2000ToEquinoxEqu(currentPos);
455 LocPos = core->j2000ToAltAz(currentPos,StelCore::RefractionOff);418 LocPos = core->j2000ToAltAz(currentPos, StelCore::RefractionOff);
456 }419 }
457420
458421
459// Convert EquPos to RA/Dec:422// Convert EquPos to RA/Dec:
460 toRADec(EquPos,selRA,selDec);423 toRADec(EquPos, selRA, selDec);
461424
462// Compute source's altitude (in radians):425// Compute source's altitude (in radians):
463 alti = std::asin(LocPos[2]);426 alti = std::asin(LocPos[2]);
@@ -474,72 +437,92 @@
474437
475/////////////////////////////////////////////////////////////////438/////////////////////////////////////////////////////////////////
476// NOW WE COMPUTE RISE/SET/TRANSIT TIMES FOR THE CURRENT DAY:439// NOW WE COMPUTE RISE/SET/TRANSIT TIMES FOR THE CURRENT DAY:
477 double currH = HourAngle(mylat,alti,selDec);440 double currH = calculateHourAngle(mylat,alti,selDec);
478 horizH = HourAngle(mylat,RefracHoriz,selDec);441 horizH = calculateHourAngle(mylat,refractedHorizonAlt,selDec);
479 QString RS1, RS2, Cul; // strings with Rise/Set/Culmination times442 QString RS1, RS2, Cul; // strings with Rise/Set/Culmination times
480 double Rise=0, Set=0; // Actual Rise/Set times (in GMT).443 double risingTime = 0, settingTime = 0; // Actual Rise/Set times (in GMT).
481 int d1,m1,s1,d2,m2,s2,dc,mc,sc; // Integers for the time spans in hh:mm:ss.444 int d1,m1,s1,d2,m2,s2,dc,mc,sc; // Integers for the time spans in hh:mm:ss.
482 bool solvedMoon = false; // Check if solutions were found for Sun, Moon, or planet.445 bool solvedMoon = false; // Check if solutions were found for Sun, Moon, or planet.
483 bool transit = false; // Is the source above the horizon? Did it culminate?446 bool transit = false; // Is the source above the horizon? Did it culminate?
484447
485 int ephHour, ephMinute, ephSecond; // Local time for selected ephemeris448 int ephHour, ephMinute, ephSecond; // Local time for selected ephemeris
486449
487 if (show_Today) { // We show ephemeris for today (i.e., rise, set, and transit times).450 if (show_Today)
488451 {
489452 // Today's ephemeris (rise, set, and transit times)
490 if (!isStar) 453 if (!isStar)
491 {454 {
492 int Kind = (isSun)?1:0; // Set "Kind" according to the selected object.455 int type = (isSun) ? 1:0;
493 Kind += (isMoon)?2:0; Kind += (!isSun && !isMoon)?3:0;456 type += (isMoon) ? 2:0;
494457 type += (!isSun && !isMoon) ? 3:0;
495 solvedMoon = SolarSystemSolve(core, Kind); // False if fails; True otherwise.458
459 // Returns false if the calculation fails...
460 solvedMoon = calculateSolarSystemEvents(core, type);
496 currH = std::abs(24.*(MoonCulm-myJD)/TFrac);461 currH = std::abs(24.*(MoonCulm-myJD)/TFrac);
497 transit = MoonCulm-myJD<0.0;462 transit = MoonCulm-myJD<0.0;
498 if (solvedMoon) { // If failed, Set and Rise will be dummy.463 if (solvedMoon)
499 Set = std::abs(24.*(MoonSet-myJD)/TFrac);464 { // If failed, Set and Rise will be dummy.
500 Rise = std::abs(24.*(MoonRise-myJD)/TFrac);465 settingTime = std::abs(24.*(MoonSet-myJD)/TFrac);
501 };466 risingTime = std::abs(24.*(MoonRise-myJD)/TFrac);
502 } else if (horizH>0.0) { // The source is not circumpolar and can be seen from this latitude.467 }
503468 }
504 if ( LocPos[1]>0.0 ) { // The source is at the eastern side...469 else if (horizH>0.0)
505 if ( currH>horizH ) { // ... and below the horizon.470 { // The source is not circumpolar and can be seen from this latitude.
506 Set = 24.-currH-horizH;471
507 Rise = currH-horizH;472 if ( LocPos[1]>0.0 ) // The source is at the eastern side...
508 raised = false;}473 {
509 else { // ... and above the horizon.474 if ( currH>horizH ) // ... and below the horizon.
510 Rise = horizH-currH;475 {
511 Set = 2.*horizH-Rise;476 settingTime = 24.-currH-horizH;
512 raised = true;};477 risingTime = currH-horizH;
513 } 478 hasRisen = false;
514 else { // The source is at the western side...479 }
515 if ( currH>horizH ) { // ... and below the horizon. 480 else // ... and above the horizon.
516 Set = currH-horizH;481 {
517 Rise = 24.-currH-horizH;482 risingTime = horizH-currH;
518 raised = false;}483 settingTime = 2.*horizH-risingTime;
519 else { // ... and above the horizon.484 hasRisen = true;
520 Rise = horizH+currH;485 }
521 Set = horizH-currH;486 }
522 raised = true;};487 else // The source is at the western side...
523 };488 {
524 489 if ( currH>horizH ) // ... and below the horizon.
525 };490 {
526491 settingTime = currH-horizH;
492 risingTime = 24.-currH-horizH;
493 hasRisen = false;
494 }
495 else // ... and above the horizon.
496 {
497 risingTime = horizH+currH;
498 settingTime = horizH-currH;
499 hasRisen = true;
500 }
501 }
502 }
503
527 if ((solvedMoon && MoonRise>0.0) || (!isSun && !isMoon && horizH>0.0))504 if ((solvedMoon && MoonRise>0.0) || (!isSun && !isMoon && horizH>0.0))
528 {505 {
529 double2hms(TFrac*Set,d1,m1,s1);506 double2hms(TFrac*settingTime, d1, m1, s1);
530 double2hms(TFrac*Rise,d2,m2,s2);507 double2hms(TFrac*risingTime, d2, m2, s2);
531508
532// Strings with time spans for rise/set/transit:509 // Strings with time spans for rise/set/transit:
533 RS1 = (d1==0)?"":QString("%1%2 ").arg(d1).arg(msgH); RS1 += (m1==0)?"":QString("%1%2 ").arg(m1).arg(msgM); RS1 += QString("%1%2").arg(s1).arg(msgS);510 RS1 = (d1==0)?"":QString("%1%2 ").arg(d1).arg(msgH);
534 RS2 = (d2==0)?"":QString("%1%2 ").arg(d2).arg(msgH); RS2 += (m2==0)?"":QString("%1%2 ").arg(m2).arg(msgM); RS2 += QString("%1%2").arg(s2).arg(msgS);511 RS1 += (m1==0)?"":QString("%1%2 ").arg(m1).arg(msgM);
535 if (raised) 512 RS1 += QString("%1%2").arg(s1).arg(msgS);
513 RS2 = (d2==0)?"":QString("%1%2 ").arg(d2).arg(msgH);
514 RS2 += (m2==0)?"":QString("%1%2 ").arg(m2).arg(msgM);
515 RS2 += QString("%1%2").arg(s2).arg(msgS);
516 if (hasRisen)
536 {517 {
537 double2hms(toUnsignedRA(currLocalT+TFrac*Set+12.),ephHour,ephMinute,ephSecond);518 double2hms(toUnsignedRA(currLocalT+TFrac*settingTime+12.),
538 SetTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QLatin1Char('0')); // Local time for set.519 ephHour, ephMinute, ephSecond);
520 SetTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QChar('0')); // Local time for set.
539521
540 double2hms(toUnsignedRA(currLocalT-TFrac*Rise+12.),ephHour,ephMinute,ephSecond); // Local time for rise.522 double2hms(toUnsignedRA(currLocalT-TFrac*risingTime+12.),
523 ephHour, ephMinute, ephSecond); // Local time for rise.
541 RiseTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QLatin1Char('0'));524 RiseTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QLatin1Char('0'));
542525
543 //RS1 = q_("Sets at %1 (in %2)").arg(SetTime).arg(RS1);526 //RS1 = q_("Sets at %1 (in %2)").arg(SetTime).arg(RS1);
544 //RS2 = q_("Rose at %1 (%2 ago)").arg(RiseTime).arg(RS2);527 //RS2 = q_("Rose at %1 (%2 ago)").arg(RiseTime).arg(RS2);
545 RS1 = msgSetsAt.arg(SetTime).arg(RS1);528 RS1 = msgSetsAt.arg(SetTime).arg(RS1);
@@ -547,54 +530,61 @@
547 }530 }
548 else 531 else
549 {532 {
550 double2hms(toUnsignedRA(currLocalT-TFrac*Set+12.),ephHour,ephMinute,ephSecond);533 double2hms(toUnsignedRA(currLocalT-TFrac*settingTime+12.),
534 ephHour, ephMinute, ephSecond);
551 SetTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QLatin1Char('0'));535 SetTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QLatin1Char('0'));
552536
553 double2hms(toUnsignedRA(currLocalT+TFrac*Rise+12.),ephHour,ephMinute,ephSecond);537 double2hms(toUnsignedRA(currLocalT+TFrac*risingTime+12.),
538 ephHour, ephMinute, ephSecond);
554 RiseTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QLatin1Char('0'));539 RiseTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QLatin1Char('0'));
555540
556 //RS1 = q_("Set at %1 (%2 ago)").arg(SetTime).arg(RS1);541 //RS1 = q_("Set at %1 (%2 ago)").arg(SetTime).arg(RS1);
557 //RS2 = q_("Rises at %1 (in %2)").arg(RiseTime).arg(RS2);542 //RS2 = q_("Rises at %1 (in %2)").arg(RiseTime).arg(RS2);
558 RS1 = msgSetAt.arg(SetTime).arg(RS1);543 RS1 = msgSetAt.arg(SetTime).arg(RS1);
559 RS2 = msgRisesAt.arg(RiseTime).arg(RS2);544 RS2 = msgRisesAt.arg(RiseTime).arg(RS2);
560 }; 545 }
561 }546 }
562 else { // The source is either circumpolar or never rises:547 else // The source is either circumpolar or never rises:
563 (alti>RefracHoriz)? RS1 = msgCircumpolar: RS1 = msgNoRise;548 {
549 (alti>refractedHorizonAlt)? RS1 = msgCircumpolar: RS1 = msgNoRise;
564 RS2 = "";550 RS2 = "";
565 };551 };
566552
567// Culmination:553 // Culmination:
568554
569 if (isStar)555 if (isStar)
570 {556 {
571 culmAlt = std::abs(mylat-selDec); // 90.-altitude at transit.557 culmAlt = std::abs(mylat-selDec); // 90.-altitude at transit.
572 transit = LocPos[1]<0.0;558 transit = LocPos[1]<0.0;
573 };559 };
574560
575 if (culmAlt<halfpi-RefracHoriz) { // Source can be observed.561 if (culmAlt < (halfpi - refractedHorizonAlt)) // Source can be observed.
576 double altiAtCulmi = Rad2Deg*(halfpi-culmAlt-RefracHoriz);562 {
577 double2hms(TFrac*currH,dc,mc,sc);563 double altiAtCulmi = Rad2Deg*(halfpi-culmAlt-refractedHorizonAlt);
578564 double2hms(TFrac*currH,dc,mc,sc);
579// String with the time span for culmination: 565
580 Cul = (dc==0)?"":QString("%1%2 ").arg(dc).arg(msgH); Cul += (mc==0)?"":QString("%1%2 ").arg(mc).arg(msgM); Cul += QString("%1%2").arg(sc).arg(msgS);566 //String with the time span for culmination:
581 if (transit==false) { 567 Cul = (dc==0)?"":QString("%1%2 ").arg(dc).arg(msgH);
582568 Cul += (mc==0)?"":QString("%1%2 ").arg(mc).arg(msgM);
583 double2hms(toUnsignedRA(currLocalT+TFrac*currH+12.),ephHour,ephMinute,ephSecond); // Local time at transit.569 Cul += QString("%1%2").arg(sc).arg(msgS);
584 CulmTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QLatin1Char('0'));570 if (!transit)
585 //Cul = q_("Culminates at %1 (in %2) at %3 deg.").arg(CulmTime).arg(Cul).arg(altiAtCulmi,0,'f',1);571 {
586 Cul = msgCulminatesAt.arg(CulmTime).arg(Cul).arg(altiAtCulmi,0,'f',1);572 double2hms(toUnsignedRA(currLocalT + TFrac*currH + 12.),
573 ephHour, ephMinute, ephSecond); // Local time at transit.
574 CulmTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QLatin1Char('0'));
575 //Cul = q_("Culminates at %1 (in %2) at %3 deg.").arg(CulmTime).arg(Cul).arg(altiAtCulmi,0,'f',1);
576 Cul = msgCulminatesAt.arg(CulmTime).arg(Cul).arg(altiAtCulmi,0,'f',1);
577 }
578 else
579 {
580 double2hms(toUnsignedRA(currLocalT - TFrac*currH + 12.),
581 ephHour, ephMinute, ephSecond);
582 CulmTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QLatin1Char('0'));
583 //Cul = q_("Culminated at %1 (%2 ago) at %3 deg.").arg(CulmTime).arg(Cul).arg(altiAtCulmi,0,'f',1);
584 Cul = msgCulminatedAt.arg(CulmTime).arg(Cul).arg(altiAtCulmi,0,'f',1);
585 }
587 }586 }
588 else587 } // This comes from show_Today==True
589 {
590 double2hms(toUnsignedRA(currLocalT-TFrac*currH+12.),ephHour,ephMinute,ephSecond);
591 CulmTime = QString("%1:%2").arg(ephHour).arg(ephMinute,2,10,QLatin1Char('0'));
592 //Cul = q_("Culminated at %1 (%2 ago) at %3 deg.").arg(CulmTime).arg(Cul).arg(altiAtCulmi,0,'f',1);
593 Cul = msgCulminatedAt.arg(CulmTime).arg(Cul).arg(altiAtCulmi,0,'f',1);
594 };
595 };
596
597 }; // This comes from show_Today==True
598////////////////////////////////////////////////////////////588////////////////////////////////////////////////////////////
599589
600590
@@ -606,140 +596,175 @@
606596
607 if (isSun) 597 if (isSun)
608 {598 {
609 bestNight=""; ObsRange = "";599 lineBestNight.clear();
600 lineObservableRange.clear();
610 }601 }
611 else if (!isMoon && show_Year) {602 else if (!isMoon && show_Year)
612603 {
613 if (isStar==false && (souChanged || yearChanged)) { // Object moves.604
614 PlanetRADec(core);} // Re-compute ephemeris.605 if (!isStar && (souChanged || yearChanged)) // Object moves.
615606 updatePlanetData(core); // Re-compute ephemeris.
616 else { // Object is fixed on the sky.607 else
617 double auxH = HourAngle(mylat,RefracHoriz,selDec);608 { // Object is fixed on the sky.
609 double auxH = calculateHourAngle(mylat,refractedHorizonAlt,selDec);
618 double auxSidT1 = toUnsignedRA(selRA - auxH); 610 double auxSidT1 = toUnsignedRA(selRA - auxH);
619 double auxSidT2 = toUnsignedRA(selRA + auxH); 611 double auxSidT2 = toUnsignedRA(selRA + auxH);
620 for (int i=0;i<nDays;i++) {612 for (int i=0;i<nDays;i++) {
621 ObjectH0[i] = auxH;613 objectH0[i] = auxH;
622 ObjectRA[i] = selRA;614 objectRA[i] = selRA;
623 ObjectDec[i] = selDec;615 objectDec[i] = selDec;
624 ObjectSidT[0][i] = auxSidT1;616 objectSidT[0][i] = auxSidT1;
625 ObjectSidT[1][i] = auxSidT2;617 objectSidT[1][i] = auxSidT2;
626 };618 };
627 };619 };
628620
629// Determine source observability (only if something changed):621// Determine source observability (only if something changed):
630 if ((souChanged || locChanged || yearChanged)) {622 if ((souChanged || locChanged || yearChanged))
631 bestNight=""; ObsRange = "";623 {
624 lineBestNight.clear();
625 lineObservableRange.clear();
632626
633 if (culmAlt>=halfpi-RefracHoriz) { // Source cannot be seen.627 // Check if the target cannot be seen.
628 if (culmAlt >= (halfpi - refractedHorizonAlt))
629 {
634 //ObsRange = q_("Source is not observable.");630 //ObsRange = q_("Source is not observable.");
635 //AcroCos = q_("No Acronychal nor Cosmical rise/set.");631 //AcroCos = q_("No Acronychal nor Cosmical rise/set.");
636 ObsRange = msgSrcNotObs;632 lineObservableRange = msgSrcNotObs;
637 AcroCos = msgNoACRise;633 lineAcroCos = msgNoACRise;
638 }634 }
639 else { // Source can be seen.635 else
636 { // Source can be seen.
640637
641///////////////////////////638///////////////////////////
642// - Part 1. Determine the best observing night (i.e., opposition to the Sun):639// - Part 1. Determine the best observing night (i.e., opposition to the Sun):
643 if (show_Best_Night) {640 if (show_Best_Night)
641 {
644 int selday = 0;642 int selday = 0;
645 double deltaPhs = -1.0; // Initial dummy value643 double deltaPhs = -1.0; // Initial dummy value
646 double tempPhs; 644 double tempPhs;
647 for (int i=0;i<nDays;i++) { // Maximize the Sun-object separation.645 for (int i=0; i<nDays; i++) // Maximize the Sun-object separation.
648 tempPhs = Lambda(ObjectRA[i],ObjectDec[i],SunRA[i],SunDec[i]);646 {
649 if (tempPhs>deltaPhs) {selday=i;deltaPhs=tempPhs;};647 tempPhs = Lambda(objectRA[i], objectDec[i],
650 };648 sunRA[i], sunDec[i]);
649 if (tempPhs > deltaPhs)
650 {
651 selday = i;
652 deltaPhs = tempPhs;
653 }
654 }
651655
652 if (selName=="Mercury" || selName=="Venus")656 if (selName=="Mercury" || selName=="Venus")
653 {657 {
654 //bestNight = q_("Greatest elongation: ");658 lineBestNight = msgGreatElong;
655 bestNight = msgGreatElong;659 }
656 } else 660 else
657 {661 {
658 //bestNight = q_("Largest Sun separation: ");662 lineBestNight = msgLargSSep;
659 bestNight = msgLargSSep;663 }
660 };664
661665 lineBestNight = lineBestNight
662 //bestNight = bestNight + CalenDate(selday) + q_(" (at %1 deg.)").arg(deltaPhs*Rad2Deg,0,'f',1);666 .arg(formatAsDate(selday))
663 bestNight = bestNight + CalenDate(selday) + msgAtDeg.arg(deltaPhs*Rad2Deg,0,'f',1);667 .arg(deltaPhs*Rad2Deg, 0, 'f', 1);
664 };668 }
665669
666///////////////////////////////670///////////////////////////////
667// - Part 2. Determine Acronychal and Cosmical rise and set:671// - Part 2. Determine Acronychal and Cosmical rise and set:
668672
669 if (show_AcroCos) {673 if (show_AcroCos)
670 int selRise, selSet, selRise2, selSet2; // days of year for Acronical and Cosmical rise/set.674 {
671 int Acro = CheckAcro(selRise,selSet,selRise2,selSet2);675 int acroRise, acroSet, cosRise, cosSet;
672 QString AcroRiseStr, AcroSetStr;676 int result = calculateAcroCos(acroRise, acroSet,
673 QString CosmRiseStr, CosmSetStr;677 cosRise, cosSet);
674678 QString acroRiseStr, acroSetStr;
675 AcroRiseStr = (selRise>0)?CalenDate(selRise):msgNone;679 QString cosRiseStr, cosSetStr;
676 AcroSetStr = (selSet>0)?CalenDate(selSet):msgNone;680 // TODO: Possible error? Day 0 is 1 Jan.
677681 acroRiseStr = (acroRise>0)?formatAsDate(acroRise):msgNone;
678 CosmRiseStr = (selRise2>0)?CalenDate(selRise2):msgNone;682 acroSetStr = (acroSet>0)?formatAsDate(acroSet):msgNone;
679 CosmSetStr = (selSet2>0)?CalenDate(selSet2):msgNone;683 cosRiseStr = (cosRise>0)?formatAsDate(cosRise):msgNone;
680684 cosSetStr = (cosSet>0)?formatAsDate(cosSet):msgNone;
681 //AcroCos = (Acro==3 || Acro==1)?QString("%1: %2/%3.").arg(q_("Acronychal rise/set")).arg(AcroRiseStr).arg(AcroSetStr):q_("No Acronychal rise/set.");685
682 //AcroCos += (Acro==3 || Acro==2)?QString(" %1: %2/%3.").arg(q_("Cosmical rise/set")).arg(CosmRiseStr).arg(CosmSetStr):QString(" %1").arg(q_("No Cosmical rise/set."));686 if (result==3 || result==1)
683 AcroCos = (Acro==3 || Acro==1)?QString("%1: %2/%3.").arg(msgAcroRise).arg(AcroRiseStr).arg(AcroSetStr):msgNoAcroRise;687 lineAcroCos = msgAcroRise
684 AcroCos += (Acro==3 || Acro==2)?QString(" %1: %2/%3.").arg(msgCosmRise).arg(CosmRiseStr).arg(CosmSetStr):QString(" %1").arg(msgNoCosmRise);688 .arg(acroRiseStr)
685689 .arg(acroSetStr);
686 };690 else
691 lineAcroCos = msgNoAcroRise;
692
693 if (result==3 || result==2)
694 lineAcroCos += msgCosmRise
695 .arg(cosRiseStr)
696 .arg(cosSetStr);
697 else
698 lineAcroCos += msgNoCosmRise;
699 }
687700
688701
689////////////////////////////702////////////////////////////
690// - Part 3. Determine range of good nights 703// - Part 3. Determine range of good nights
691// (i.e., above horizon before/after twilight):704// (i.e., above horizon before/after twilight):
692705
693 if (show_Good_Nights) {706 if (show_Good_Nights)
707 {
694 int selday = 0;708 int selday = 0;
695 int selday2 = 0;709 int selday2 = 0;
696 bool bestBegun = false; // Are we inside a good time range?710 bool bestBegun = false; // Are we inside a good time range?
697 bool atLeastOne = false;711 bool atLeastOne = false;
698 QString dateRange = "";712 QString dateRange;
699 bool PoleNight, twiGood;713 bool poleNight, twiGood;
700714
701 for (int i=0;i<nDays;i++) {715 for (int i=0; i<nDays; i++)
702716 {
703 PoleNight = SunSidT[0][i]<0.0 && std::abs(SunDec[i]-mylat)>=halfpi; // Is it night during 24h?717
704 twiGood = (PoleNight && std::abs(ObjectDec[i]-mylat)<halfpi)?true:CheckRise(i);718 poleNight = sunSidT[0][i]<0.0 && std::abs(sunDec[i]-mylat)>=halfpi; // Is it night during 24h?
705 if (twiGood && bestBegun == false) {719 twiGood = (poleNight && std::abs(objectDec[i]-mylat)<halfpi)?true:CheckRise(i);
720
721 if (twiGood && bestBegun == false)
722 {
706 selday = i;723 selday = i;
707 bestBegun = true;724 bestBegun = true;
708 atLeastOne = true;725 atLeastOne = true;
709 };726 };
710727
711 if (!twiGood && bestBegun == true) {728 if (!twiGood && bestBegun == true)
729 {
712 selday2 = i;730 selday2 = i;
713 bestBegun = false;731 bestBegun = false;
714 if (selday2 > selday) {732 if (selday2 > selday)
715 if (dateRange!="") { dateRange += ", ";};733 {
716 dateRange += QString("%1").arg(RangeCalenDates(selday, selday2));734 // FIXME: This kind of concatenation is bad for i18n.
735 if (!dateRange.isEmpty())
736 dateRange += ", ";
737 dateRange += QString("%1").arg(formatAsDateRange(selday, selday2));
717 };738 };
718 };739 };
719 };740 };
720741
721 if (bestBegun) { // There were good dates till the end of the year.742 // Check if there were good dates till the end of the year.
722 if (dateRange!="") { dateRange += ", ";};743 if (bestBegun)
723 dateRange += RangeCalenDates(selday, 0);744 {
745 // FIXME: This kind of concatenation is bad for i18n.
746 if (!dateRange.isEmpty())
747 dateRange += ", ";
748 dateRange += formatAsDateRange(selday, 0);
724 };749 };
725 750
726 if (dateRange == "") 751 if (dateRange.isEmpty())
727 { 752 {
728 if (atLeastOne) 753 if (atLeastOne)
729 { // The whole year is good.754 {
730 //ObsRange = q_("Observable during the whole year.");755 //ObsRange = q_("Observable during the whole year.");
731 ObsRange = msgWholeYear;756 lineObservableRange = msgWholeYear;
732 }757 }
733 else758 else
734 {759 {
735 //ObsRange = q_("Not observable at dark night.");760 //ObsRange = q_("Not observable at dark night.");
736 ObsRange = msgNotObs;761 lineObservableRange = msgNotObs;
737 };762 };
738 }763 }
739 else764 else
740 {765 {
741 //ObsRange = QString("%1 %2").arg(q_("Nights above horizon: ")).arg(dateRange);766 // Nights when the target is above the horizon
742 ObsRange = QString("%1 %2").arg(msgAboveHoriz).arg(dateRange);767 lineObservableRange = msgAboveHoriz.arg(dateRange);
743 };768 };
744769
745 }; // Comes from show_Good_Nights==True"770 }; // Comes from show_Good_Nights==True"
@@ -749,41 +774,40 @@
749774
750// Print all results:775// Print all results:
751776
752 int spacing = (int) (1.3* ( (double) fontSize)); // between lines777 int lineSpacing = (int) (1.3* ( (double) fontSize)); // between lines
753 int spacing2 = 6*fontSize; // between daily and yearly results778 int groupSpacing = 6*fontSize; // between daily and yearly results
754 int yLine = 8*fontSize+110;779 int yLine = 8*fontSize+110;
755 int xLine = 80;780 int xLine = 80;
756781
757 if (show_Today) 782 if (show_Today)
758 {783 {
759 paintresult.drawText(xLine, yLine,q_("TODAY:"));784 //renderer->drawText(TextParams(xLine, yLine,q_("TODAY:")));
760 paintresult.drawText(xLine+fontSize, yLine-spacing, RS2);785 painter.drawText(xLine, yLine, msgToday);
761 paintresult.drawText(xLine+fontSize, yLine-spacing*2, RS1);786 painter.drawText(xLine + fontSize, yLine - lineSpacing, RS2);
762 paintresult.drawText(xLine+fontSize, yLine-spacing*3, Cul);787 painter.drawText(xLine + fontSize, yLine - lineSpacing*2, RS1);
763 yLine -= spacing2;788 painter.drawText(xLine + fontSize, yLine - lineSpacing*3, Cul);
764 };789 yLine -= groupSpacing;
790 }
765 791
766 if ((isMoon && show_FullMoon) || (!isSun && !isMoon && show_Year)) 792 if ((isMoon && show_FullMoon) || (!isSun && !isMoon && show_Year))
767 {793 {
768 paintresult.drawText(xLine,yLine,q_("THIS YEAR:"));794 painter.drawText(xLine, yLine, msgThisYear);
769 if (show_Best_Night || show_FullMoon)795 if (show_Best_Night || show_FullMoon)
770 {796 {
771 yLine -= spacing;797 yLine -= lineSpacing;
772 paintresult.drawText(xLine+fontSize, yLine, bestNight);798 painter.drawText(xLine + fontSize, yLine, lineBestNight);
773 };799 }
774 if (show_Good_Nights) 800 if (show_Good_Nights)
775 {801 {
776 yLine -= spacing;802 yLine -= lineSpacing;
777 paintresult.drawText(xLine+fontSize, yLine, ObsRange);803 painter.drawText(xLine + fontSize, yLine, lineObservableRange);
778 };804 }
779 if (show_AcroCos) 805 if (show_AcroCos)
780 {806 {
781 yLine -= spacing;807 yLine -= lineSpacing;
782 paintresult.drawText(xLine+fontSize, yLine, AcroCos);808 painter.drawText(xLine + fontSize, yLine, lineAcroCos);
783 };809 }
784810 }
785 };
786
787}811}
788812
789// END OF MAIN CODE813// END OF MAIN CODE
@@ -795,16 +819,21 @@
795819
796////////////////////////////////////820////////////////////////////////////
797// Returns the hour angle for a given altitude:821// Returns the hour angle for a given altitude:
798double Observability::HourAngle(double lat, double h, double Dec)822double Observability::calculateHourAngle(double latitude,
823 double elevation,
824 double declination)
799{825{
800 double Denom = std::cos(lat)*std::cos(Dec);826 double denom = std::cos(latitude)*std::cos(declination);
801 double Numer = (std::sin(h)-std::sin(lat)*std::sin(Dec));827 double numer = (std::sin(elevation)-std::sin(latitude)*std::sin(declination));
802828
803 if ( std::abs(Numer)>std::abs(Denom) ) 829 if ( std::abs(numer) > std::abs(denom) )
804 {return -0.5/86400.;} // Source doesn't reach that altitude. 830 {
805 else 831 return -0.5/86400.; // Source doesn't reach that altitude.
806 {return Rad2Hr*std::acos(Numer/Denom);}832 }
807833 else
834 {
835 return Rad2Hr * std::acos(numer/denom);
836 }
808}837}
809////////////////////////////////////838////////////////////////////////////
810839
@@ -823,9 +852,9 @@
823// Returns the hour angle for a given a Sid. Time:852// Returns the hour angle for a given a Sid. Time:
824double Observability::HourAngle2(double RA, double ST)853double Observability::HourAngle2(double RA, double ST)
825{854{
826 double Htemp = toUnsignedRA(RA-ST/15.);855 double result = toUnsignedRA(RA-ST/15.);
827 Htemp -= (Htemp>12.)?24.0:0.0;856 result -= (result > 12.) ? 24.0 : 0.0;
828 return Htemp;857 return result;
829858
830}859}
831////////////////////////////////////860////////////////////////////////////
@@ -859,91 +888,78 @@
859////////////////////////////////////888////////////////////////////////////
860889
861890
862///////////////////////////////////////////////891QString Observability::formatAsDate(int dayNumber)
863// Returns the day and month of year (to put it in format '25 Apr')
864QString Observability::CalenDate(int selday)
865{892{
866 int day,month,year;893 int day, month, year;
867 StelUtils::getDateFromJulianDay(yearJD[selday],&year,&month,&day);894 StelUtils::getDateFromJulianDay(yearJD[dayNumber], &year, &month, &day);
868895
869 QString r;896 QString formatString = (getDateFormat()) ? "%1 %2" : "%2 %1";
870 if (getDateFormat())897 QString result = formatString.arg(day).arg(monthNames[month-1]);
871 r = QString("%1 %2").arg(day).arg(months[month-1]);898 return result;
872 else
873 r = QString("%1 %2").arg(months[month-1]).arg(day);
874
875 return r;
876}899}
877//////////////////////////////////////////////
878900
879///////////////////////////////////////////////901///////////////////////////////////////////////
880// Returns the day and month of year (to put it in format '25 Apr')902// Returns the day and month of year (to put it in format '25 Apr')
881QString Observability::RangeCalenDates(int fDoY, int sDoY)903QString Observability::formatAsDateRange(int startDay, int endDay)
882{904{
883 int day1,month1,year1,day2,month2,year2;905 int sDay, sMonth, sYear, eDay, eMonth, eYear;
884 QString range;906 QString range;
885 StelUtils::getDateFromJulianDay(yearJD[fDoY],&year1,&month1,&day1);907 StelUtils::getDateFromJulianDay(yearJD[startDay], &sYear, &sMonth, &sDay);
886 StelUtils::getDateFromJulianDay(yearJD[sDoY],&year2,&month2,&day2);908 StelUtils::getDateFromJulianDay(yearJD[endDay], &eYear, &eMonth, &eDay);
887 if (sDoY==0)909 if (endDay == 0)
888 {910 {
889 day2 = 31;911 eDay = 31;
890 month2 = 12;912 eMonth = 12;
891 }913 }
892 if (fDoY==0)914 if (startDay == 0)
893 {915 {
894 day1 = 1;916 sDay = 1;
895 month1 = 1;917 sMonth = 1;
896 }918 }
897 if (month1==month2)919
898 {920 // If it's the same month, display "X-Y Month" or "Month X-Y"
899 if (getDateFormat())921 if (sMonth == eMonth)
900 range = QString("%1 - %2 %3").arg(day1).arg(day2).arg(months[month1-1]);922 {
901 else923 QString formatString = (getDateFormat()) ? "%1 - %2 %3" : "%3 %1 - %2";
902 range = QString("%3 %1 - %2").arg(day1).arg(day2).arg(months[month1-1]);924 range = formatString.arg(sDay).arg(eDay).arg(monthNames[sMonth-1]);;
903 }925 }
904 else926 else
905 {927 {
906 if (getDateFormat())928 QString formatString = (getDateFormat()) ? "%1 %2 - %3 %4"
907 range = QString("%1 %2 - %3 %4").arg(day1).arg(months[month1-1]).arg(day2).arg(months[month2-1]);929 : "%2 %1 - %4 %3";
908 else930 range = formatString.arg(sDay)
909 range = QString("%1 %2 - %3 %4").arg(months[month1-1]).arg(day1).arg(months[month2-1]).arg(day2);931 .arg(monthNames[sMonth-1])
932 .arg(eDay)
933 .arg(monthNames[eMonth-1]);
910 }934 }
911935
912 return range;936 return range;
913}937}
914//////////////////////////////////////////////938//////////////////////////////////////////////
915939
916
917//////////////////////////////////////////////////
918// Returns the RA and Dec of the selected planet
919//for each day of the current year:
920void Observability::PlanetRADec(StelCore *core)
921{
922 double TempH;
923
924// Compute planet's position for each day of the current year:940// Compute planet's position for each day of the current year:
925941void Observability::updatePlanetData(StelCore *core)
926 for (int i=0;i<nDays;i++) {942{
927 getPlanetCoords(core,yearJD[i],ObjectRA[i],ObjectDec[i],false);943 double tempH;
928 TempH = HourAngle(mylat,RefracHoriz,ObjectDec[i]);944 for (int i=0; i<nDays; i++)
929 ObjectH0[i] = TempH;945 {
930 ObjectSidT[0][i] = toUnsignedRA(ObjectRA[i]-TempH);946 getPlanetCoords(core, yearJD[i], objectRA[i], objectDec[i], false);
931 ObjectSidT[1][i] = toUnsignedRA(ObjectRA[i]+TempH);947 tempH = calculateHourAngle(mylat, refractedHorizonAlt, objectDec[i]);
948 objectH0[i] = tempH;
949 objectSidT[0][i] = toUnsignedRA(objectRA[i]-tempH);
950 objectSidT[1][i] = toUnsignedRA(objectRA[i]+tempH);
932 }951 }
933952
934// Return the planet to its current time:953// Return the planet to its current time:
935 getPlanetCoords(core,myJD,ObjectRA[0],ObjectDec[0],true);954 getPlanetCoords(core, myJD, objectRA[0], objectDec[0], true);
936
937
938}955}
939956
940/////////////////////////////////////////////////957/////////////////////////////////////////////////
941// Computes the Sun's RA and Dec (and the JD) for 958// Computes the Sun's RA and Dec (and the JD) for
942// each day of the current year.959// each day of the current year.
943void Observability::SunRADec(StelCore* core) 960void Observability::updateSunData(StelCore* core)
944{961{
945 int day,month,year,year2;962 int day, month, year, sameYear;
946
947// Get current date:963// Get current date:
948 StelUtils::getDateFromJulianDay(myJD,&year,&month,&day);964 StelUtils::getDateFromJulianDay(myJD,&year,&month,&day);
949965
@@ -951,18 +967,20 @@
951 StelUtils::getJDFromDate(&Jan1stJD,year,1,1,0,0,0);967 StelUtils::getJDFromDate(&Jan1stJD,year,1,1,0,0,0);
952968
953// Check if we are on a leap year:969// Check if we are on a leap year:
954 StelUtils::getDateFromJulianDay(Jan1stJD+365.,&year2,&month,&day);970 StelUtils::getDateFromJulianDay(Jan1stJD+365., &sameYear, &month, &day);
955 nDays = (year==year2)?366:365;971 nDays = (year==sameYear)?366:365;
956 972
957// Compute Earth's position throughout the year:973// Compute Earth's position throughout the year:
958 for (int i=0;i<nDays;i++) {974 Vec3d pos, sunPos;
959 yearJD[i] = Jan1stJD+(double)i;975 for (int i=0; i<nDays; i++)
976 {
977 yearJD[i] = Jan1stJD + (double)i;
960 myEarth->computePosition(yearJD[i]);978 myEarth->computePosition(yearJD[i]);
961 myEarth->computeTransMatrix(yearJD[i]);979 myEarth->computeTransMatrix(yearJD[i]);
962 Pos1 = myEarth->getHeliocentricEclipticPos();980 pos = myEarth->getHeliocentricEclipticPos();
963 Pos2 = core->j2000ToEquinoxEqu((core->matVsop87ToJ2000)*(-Pos1));981 sunPos = core->j2000ToEquinoxEqu((core->matVsop87ToJ2000)*(-pos));
964 EarthPos[i] = -Pos1;982 EarthPos[i] = -pos;
965 toRADec(Pos2,SunRA[i],SunDec[i]);983 toRADec(sunPos,sunRA[i],sunDec[i]);
966 };984 };
967985
968//Return the Earth to its current time:986//Return the Earth to its current time:
@@ -974,53 +992,63 @@
974992
975////////////////////////////////////////////993////////////////////////////////////////////
976// Computes Sun's Sidereal Times at twilight and culmination:994// Computes Sun's Sidereal Times at twilight and culmination:
977void Observability::SunHTwi()995void Observability::updateSunH()
978{996{
979 double TempH, TempH00;997 double tempH, tempH00;
980998
981 for (int i=0; i<nDays; i++) {999 for (int i=0; i<nDays; i++)
982 TempH = HourAngle(mylat,AstroTwiAlti,SunDec[i]);1000 {
983 TempH00 = HourAngle(mylat,RefracHoriz,SunDec[i]);1001 tempH = calculateHourAngle(mylat, twilightAltRad, sunDec[i]);
984 if (TempH>0.0) {1002 tempH00 = calculateHourAngle(mylat, refractedHorizonAlt, sunDec[i]);
985 SunSidT[0][i] = toUnsignedRA(SunRA[i]-TempH*(1.00278));1003 if (tempH > 0.0)
986 SunSidT[1][i] = toUnsignedRA(SunRA[i]+TempH*(1.00278));}1004 {
987 else {1005 sunSidT[0][i] = toUnsignedRA(sunRA[i]-tempH*(1.00278));
988 SunSidT[0][i] = -1000.0;1006 sunSidT[1][i] = toUnsignedRA(sunRA[i]+tempH*(1.00278));
989 SunSidT[1][i] = -1000.0;};1007 }
990 if (TempH00>0.0) {1008 else
991 SunSidT[2][i] = toUnsignedRA(SunRA[i]+TempH00);1009 {
992 SunSidT[3][i] = toUnsignedRA(SunRA[i]-TempH00);}1010 sunSidT[0][i] = -1000.0;
993 else {1011 sunSidT[1][i] = -1000.0;
994 SunSidT[2][i] = -1000.0;1012 }
995 SunSidT[3][i] = -1000.0;};1013
9961014 if (tempH00>0.0)
9971015 {
998 };1016 sunSidT[2][i] = toUnsignedRA(sunRA[i]+tempH00);
1017 sunSidT[3][i] = toUnsignedRA(sunRA[i]-tempH00);
1018 }
1019 else
1020 {
1021 sunSidT[2][i] = -1000.0;
1022 sunSidT[3][i] = -1000.0;
1023 }
1024 }
999}1025}
1000////////////////////////////////////////////1026////////////////////////////////////////////
10011027
10021028
1003///////////////////////////////////////////1029///////////////////////////////////////////
1004// Checks if a source can be observed with the Sun below the twilight altitude.1030// Checks if a source can be observed with the Sun below the twilight altitude.
1005bool Observability::CheckRise(int i)1031bool Observability::CheckRise(int day)
1006{1032{
10071033
1008 // If Sun can't reach twilight elevation, return false:1034 // If Sun can't reach twilight elevation, the target is not visible.
1009 if (SunSidT[0][i]<0.0 || SunSidT[1][i]<0.0) { return false;};1035 if (sunSidT[0][day]<0.0 || sunSidT[1][day]<0.0)
1036 return false;
10101037
1011 // Iterate over the whole year:1038 // Iterate over the whole year:
1012 int nBin = 1000;1039 int nBin = 1000;
1013 double auxSid1 = SunSidT[0][i];1040 double auxSid1 = sunSidT[0][day];
1014 auxSid1 += (SunSidT[0][i] < SunSidT[1][i])?24.0:0.0;1041 auxSid1 += (sunSidT[0][day] < sunSidT[1][day]) ? 24.0 : 0.0;
1015 double deltaT = (auxSid1-SunSidT[1][i])/((double)nBin);1042 double deltaT = (auxSid1-sunSidT[1][day]) / ((double)nBin);
10161043
1017 double Hour; 1044 double hour;
1018 for (int j=0;j<nBin;j++) {1045 for (int j=0; j<nBin; j++)
1019 Hour = toUnsignedRA(SunSidT[1][i]+deltaT*(double)j - ObjectRA[i]);1046 {
1020 Hour -= (Hour>12.)?24.0:0.0;1047 hour = toUnsignedRA(sunSidT[1][day]+deltaT*(double)j - objectRA[day]);
1021 if (std::abs(Hour)<ObjectH0[i] || (ObjectH0[i] < 0.0 && alti>0.0)) {return true;};1048 hour -= (hour>12.) ? 24.0 : 0.0;
1022 }; 1049 if (std::abs(hour)<objectH0[day] || (objectH0[day] < 0.0 && alti>0.0))
10231050 return true;
1051 }
10241052
1025 return false;1053 return false;
1026}1054}
@@ -1029,81 +1057,79 @@
10291057
1030///////////////////////////////////////////1058///////////////////////////////////////////
1031// Finds the dates of Acronichal (Rise, Set) and Cosmical (Rise2, Set2) dates.1059// Finds the dates of Acronichal (Rise, Set) and Cosmical (Rise2, Set2) dates.
1032// Returns 0 if no dates found, 1 if Acro exists, 2 if Cosm exists, and 3 if both are found.1060int Observability::calculateAcroCos(int &acroRise, int &acroSet,
1033int Observability::CheckAcro(int &Rise, int &Set, int &Rise2, int &Set2)1061 int &cosRise, int &cosSet)
1034{1062{
10351063 acroRise = -1;
1036 Rise = -1;1064 acroSet = -1;
1037 Set = -1;1065 cosRise = -1;
1038 Rise2 = -1;1066 cosSet = -1;
1039 Set2 = -1;1067
10401068 double bestDiffAcroRise = 12.0;
1041 double BestDiffRise = 12.0;1069 double bestDiffAcroSet = 12.0;
1042 double BestDiffSet = 12.0;1070 double bestDiffCosRise = 12.0;
1043 double BestDiffRise2 = 12.0;1071 double bestDiffCosSet = 12.0;
1044 double BestDiffSet2 = 12.0;1072
10451073 double hourDiffAcroRise, hourDiffAcroSet, hourDiffCosRise, hourCosDiffSet;
1046 double HourDiffRise, HourDiffSet, HourDiffRise2, HourDiffSet2;
1047 bool success = false;1074 bool success = false;
10481075
1049 for (int i=0;i<366;i++)1076 for (int i=0; i<366; i++)
1050 {1077 {
1051 if (ObjectH0[i]>0.0 && SunSidT[2][i]>0.0 && SunSidT[3][i]>0.0) {1078 if (objectH0[i]>0.0 && sunSidT[2][i]>0.0 && sunSidT[3][i]>0.0)
1079 {
1052 success = true;1080 success = true;
1053 HourDiffRise = toUnsignedRA(ObjectRA[i] - ObjectH0[i]);1081 hourDiffAcroRise = toUnsignedRA(objectRA[i] - objectH0[i]);
1054 HourDiffRise2 = HourDiffRise-SunSidT[3][i];1082 hourDiffCosRise = hourDiffAcroRise-sunSidT[3][i];
1055 HourDiffRise -= SunSidT[2][i];1083 hourDiffAcroRise -= sunSidT[2][i];
10561084
1057 HourDiffSet = toUnsignedRA(ObjectRA[i] + ObjectH0[i]);1085 hourDiffAcroSet = toUnsignedRA(objectRA[i] + objectH0[i]);
1058 HourDiffSet2 = HourDiffSet - SunSidT[2][i];1086 hourCosDiffSet = hourDiffAcroSet - sunSidT[2][i];
1059 HourDiffSet -= SunSidT[3][i];1087 hourDiffAcroSet -= sunSidT[3][i];
10601088
1061 // Acronychal Rise/Set:1089 // Acronychal rise/set:
1062 if (std::abs(HourDiffRise)<BestDiffRise) 1090 if (std::abs(hourDiffAcroRise) < bestDiffAcroRise)
1063 {1091 {
1064 BestDiffRise = std::abs(HourDiffRise);1092 bestDiffAcroRise = std::abs(hourDiffAcroRise);
1065 Rise = i;1093 acroRise = i;
1066 };1094 };
1067 if (std::abs(HourDiffSet)<BestDiffSet) 1095 if (std::abs(hourDiffAcroSet) < bestDiffAcroSet)
1068 {1096 {
1069 BestDiffSet = std::abs(HourDiffSet);1097 bestDiffAcroSet = std::abs(hourDiffAcroSet);
1070 Set = i;1098 acroSet = i;
1071 };1099 };
10721100
1073 // Cosmical Rise/Set:1101 // Cosmical Rise/Set:
1074 if (std::abs(HourDiffRise2)<BestDiffRise2) 1102 if (std::abs(hourDiffCosRise) < bestDiffCosRise)
1075 {1103 {
1076 BestDiffRise2 = std::abs(HourDiffRise2);1104 bestDiffCosRise = std::abs(hourDiffCosRise);
1077 Rise2 = i;1105 cosRise = i;
1078 };1106 };
1079 if (std::abs(HourDiffSet2)<BestDiffSet2) 1107 if (std::abs(hourCosDiffSet) < bestDiffCosSet)
1080 {1108 {
1081 BestDiffSet2 = std::abs(HourDiffSet2);1109 bestDiffCosSet = std::abs(hourCosDiffSet);
1082 Set2 = i;1110 cosSet = i;
1083 };1111 };
1084
1085
1086 };1112 };
1087 };1113 };
10881114
1089 Rise *= (BestDiffRise > 0.083)?-1:1; // Check that difference is lower than 5 minutes.1115 acroRise *= (bestDiffAcroRise > 0.083)?-1:1; // Check that difference is lower than 5 minutes.
1090 Set *= (BestDiffSet > 0.083)?-1:1; // Check that difference is lower than 5 minutes.1116 acroSet *= (bestDiffAcroSet > 0.083)?-1:1; // Check that difference is lower than 5 minutes.
1091 Rise2 *= (BestDiffRise2 > 0.083)?-1:1; // Check that difference is lower than 5 minutes.1117 cosRise *= (bestDiffCosRise > 0.083)?-1:1; // Check that difference is lower than 5 minutes.
1092 Set2 *= (BestDiffSet2 > 0.083)?-1:1; // Check that difference is lower than 5 minutes.1118 cosSet *= (bestDiffCosSet > 0.083)?-1:1; // Check that difference is lower than 5 minutes.
1093 int Result = (Rise>0 || Set>0)?1:0;1119 int result = (acroRise>0 || acroSet>0) ? 1 : 0;
1094 Result += (Rise2>0 || Set2>0)?2:0;1120 result += (cosRise>0 || cosSet>0) ? 2 : 0;
1095 return (success)?Result:0;1121 return (success) ? result : 0;
1096}1122}
1097///////////////////////////////////////////1123///////////////////////////////////////////
10981124
10991125
1100////////////////////////////////////////////1126////////////////////////////////////////////
1101// Convert an Equatorial Vec3d into RA and Dec:1127// Convert an Equatorial Vec3d into RA and Dec:
1102void Observability::toRADec(Vec3d TempLoc, double &RA, double &Dec)1128void Observability::toRADec(Vec3d vec3d, double& ra, double &dec)
1103{1129{
1104 TempLoc.normalize();1130 vec3d.normalize();
1105 Dec = std::asin(TempLoc[2]); // in radians1131 dec = std::asin(vec3d[2]); // in radians
1106 RA = toUnsignedRA(std::atan2(TempLoc[1],TempLoc[0])*Rad2Hr); // in hours.1132 ra = toUnsignedRA(std::atan2(vec3d[1],vec3d[0])*Rad2Hr); // in hours.
1107}1133}
1108////////////////////////////////////////////1134////////////////////////////////////////////
11091135
@@ -1122,39 +1148,43 @@
1122//////////////////////////1148//////////////////////////
1123// Get the coordinates of Sun or Moon for a given JD:1149// Get the coordinates of Sun or Moon for a given JD:
1124// getBack controls whether Earth and Moon must be returned to their original positions after computation.1150// getBack controls whether Earth and Moon must be returned to their original positions after computation.
1125void Observability::getSunMoonCoords(StelCore *core, double JD, double &RASun, double &DecSun, double &RAMoon, double &DecMoon, double &EclLon, bool getBack) //, Vec3d &AltAzVector)1151void Observability::getSunMoonCoords(StelCore *core, double jd,
1152 double &raSun, double &decSun,
1153 double &raMoon, double &decMoon,
1154 double &eclLon, bool getBack)
1155 //, Vec3d &AltAzVector)
1126{1156{
11271157
1128 if (getBack) // Return the Moon and Earth to their current position:1158 if (getBack) // Return the Moon and Earth to their current position:
1129 {1159 {
1130 myEarth->computePosition(JD);1160 myEarth->computePosition(jd);
1131 myEarth->computeTransMatrix(JD);1161 myEarth->computeTransMatrix(jd);
1132 myMoon->computePosition(JD);1162 myMoon->computePosition(jd);
1133 myMoon->computeTransMatrix(JD);1163 myMoon->computeTransMatrix(jd);
1134 } 1164 }
1135 else1165 else // Compute coordinates:
1136 { // Compute coordinates:1166 {
1137 myEarth->computePosition(JD);1167 myEarth->computePosition(jd);
1138 myEarth->computeTransMatrix(JD);1168 myEarth->computeTransMatrix(jd);
1139 Pos0 = myEarth->getHeliocentricEclipticPos();1169 Vec3d earthPos = myEarth->getHeliocentricEclipticPos();
1140 double currSidT;1170 double curSidT;
11411171
1142// Sun coordinates:1172// Sun coordinates:
1143 Pos2 = core->j2000ToEquinoxEqu((core->matVsop87ToJ2000)*(-Pos0));1173 Vec3d sunPos = core->j2000ToEquinoxEqu((core->matVsop87ToJ2000)*(-earthPos));
1144 toRADec(Pos2,RASun,DecSun);1174 toRADec(sunPos, raSun, decSun);
11451175
1146// Moon coordinates:1176// Moon coordinates:
1147 currSidT = myEarth->getSiderealTime(JD)/Rad2Deg;1177 curSidT = myEarth->getSiderealTime(jd)/Rad2Deg;
1148 RotObserver = (Mat4d::zrotation(currSidT))*ObserverLoc;1178 RotObserver = (Mat4d::zrotation(curSidT))*ObserverLoc;
1149 LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-Pos0));1179 LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos));
1150 myMoon->computePosition(JD);1180 myMoon->computePosition(jd);
1151 myMoon->computeTransMatrix(JD);1181 myMoon->computeTransMatrix(jd);
1152 Pos1 = myMoon->getHeliocentricEclipticPos();1182 Vec3d moonPos = myMoon->getHeliocentricEclipticPos();
1153 Pos2 = (core->j2000ToEquinoxEqu(LocTrans*Pos1))-RotObserver;1183 sunPos = (core->j2000ToEquinoxEqu(LocTrans*moonPos))-RotObserver;
11541184
1155 EclLon = Pos1[0]*Pos0[1] - Pos1[1]*Pos0[0];1185 eclLon = moonPos[0]*earthPos[1] - moonPos[1]*earthPos[0];
11561186
1157 toRADec(Pos2,RAMoon,DecMoon);1187 toRADec(sunPos,raMoon,decMoon);
1158 };1188 };
1159}1189}
1160//////////////////////////////////////////////1190//////////////////////////////////////////////
@@ -1164,37 +1194,37 @@
1164//////////////////////////1194//////////////////////////
1165// Get the Observer-to-Moon distance JD:1195// Get the Observer-to-Moon distance JD:
1166// getBack controls whether Earth and Moon must be returned to their original positions after computation.1196// getBack controls whether Earth and Moon must be returned to their original positions after computation.
1167void Observability::getMoonDistance(StelCore *core, double JD, double &Distance, bool getBack)1197void Observability::getMoonDistance(StelCore *core, double jd, double &distance, bool getBack)
1168{1198{
11691199
1170 if (getBack) // Return the Moon and Earth to their current position:1200 if (getBack) // Return the Moon and Earth to their current position:
1171 {1201 {
1172 myEarth->computePosition(JD);1202 myEarth->computePosition(jd);
1173 myEarth->computeTransMatrix(JD);1203 myEarth->computeTransMatrix(jd);
1174 myMoon->computePosition(JD);1204 myMoon->computePosition(jd);
1175 myMoon->computeTransMatrix(JD);1205 myMoon->computeTransMatrix(jd);
1176 } 1206 }
1177 else1207 else
1178 { // Compute coordinates:1208 { // Compute coordinates:
1179 myEarth->computePosition(JD);1209 myEarth->computePosition(jd);
1180 myEarth->computeTransMatrix(JD);1210 myEarth->computeTransMatrix(jd);
1181 Pos0 = myEarth->getHeliocentricEclipticPos();1211 Vec3d earthPos = myEarth->getHeliocentricEclipticPos();
1182// double currSidT;1212// double curSidT;
11831213
1184// Sun coordinates:1214// Sun coordinates:
1185// Pos2 = core->j2000ToEquinoxEqu((core->matVsop87ToJ2000)*(-Pos0));1215// Pos2 = core->j2000ToEquinoxEqu((core->matVsop87ToJ2000)*(-Pos0));
1186// toRADec(Pos2,RASun,DecSun);1216// toRADec(Pos2,RASun,DecSun);
11871217
1188// Moon coordinates:1218// Moon coordinates:
1189// currSidT = myEarth->getSiderealTime(JD)/Rad2Deg;1219// curSidT = myEarth->getSiderealTime(JD)/Rad2Deg;
1190// RotObserver = (Mat4d::zrotation(currSidT))*ObserverLoc;1220// RotObserver = (Mat4d::zrotation(curSidT))*ObserverLoc;
1191 LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-Pos0));1221 LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos));
1192 myMoon->computePosition(JD);1222 myMoon->computePosition(jd);
1193 myMoon->computeTransMatrix(JD);1223 myMoon->computeTransMatrix(jd);
1194 Pos1 = myMoon->getHeliocentricEclipticPos();1224 Pos1 = myMoon->getHeliocentricEclipticPos();
1195 Pos2 = (core->j2000ToEquinoxEqu(LocTrans*Pos1)); //-RotObserver;1225 Pos2 = (core->j2000ToEquinoxEqu(LocTrans*Pos1)); //-RotObserver;
11961226
1197 Distance = std::sqrt(Pos2*Pos2);1227 distance = std::sqrt(Pos2*Pos2);
11981228
1199// toRADec(Pos2,RAMoon,DecMoon);1229// toRADec(Pos2,RAMoon,DecMoon);
1200 };1230 };
@@ -1236,180 +1266,190 @@
12361266
12371267
1238//////////////////////////////////////////////1268//////////////////////////////////////////////
1239// Solves Moon's, Sun's, or Planet's ephemeris by bissection. Returns JD:1269// Solves Moon's, Sun's, or Planet's ephemeris by bissection.
1240bool Observability::SolarSystemSolve(StelCore* core, int Kind)1270bool Observability::calculateSolarSystemEvents(StelCore* core, int bodyType)
1241{1271{
12421272
1243 int Niter = 100;1273 const int NUM_ITER = 100;
1244 int i;1274 int i;
1245 double Hhoriz, RA, Dec, RAS, DecS, TempH, jd1, tempEphH, currSidT, EclLon;1275 double hHoriz, ra, dec, raSun, decSun, tempH, tempJd, tempEphH, curSidT, eclLon;
1246 Vec3d Observer;1276 //Vec3d Observer;
12471277
1248 Hhoriz = HourAngle(mylat,RefracHoriz,selDec);1278 hHoriz = calculateHourAngle(mylat, refractedHorizonAlt, selDec);
1249 bool raises = Hhoriz > 0.0;1279 bool raises = hHoriz > 0.0;
12501280
12511281
1252// Only recompute ephemeris from second to second (at least)1282// Only recompute ephemeris from second to second (at least)
1253// or if the source has changed (i.e., Sun <-> Moon). This saves resources:1283// or if the source has changed (i.e., Sun <-> Moon). This saves resources:
1254 if (std::abs(myJD-lastJDMoon)>JDsec || LastObject!=Kind || souChanged)1284 if (std::abs(myJD-lastJDMoon)>JDsec || lastType!=bodyType || souChanged)
1255 {1285 {
12561286
1257// qDebug() << q_("%1 %2 %3 %4").arg(Kind).arg(LastObject).arg(myJD,0,'f',5).arg(lastJDMoon,0,'f',5);1287// qDebug() << q_("%1 %2 %3 %4").arg(Kind).arg(LastObject).arg(myJD,0,'f',5).arg(lastJDMoon,0,'f',5);
12581288
1259 LastObject = Kind;1289 lastType = bodyType;
12601290
1261 myEarth->computePosition(myJD);1291 myEarth->computePosition(myJD);
1262 myEarth->computeTransMatrix(myJD);1292 myEarth->computeTransMatrix(myJD);
1263 Pos0 = myEarth->getHeliocentricEclipticPos();1293 Vec3d earthPos = myEarth->getHeliocentricEclipticPos();
12641294
1265 if (Kind==1)1295 if (bodyType == 1) // Sun position
1266 { // Sun position:1296 {
1267 Pos2 = core->j2000ToEquinoxEqu((core->matVsop87ToJ2000)*(-Pos0));1297 Pos2 = core->j2000ToEquinoxEqu((core->matVsop87ToJ2000)*(-earthPos));
1268 } else if (Kind==2)1298 }
1269 { // Moon position:1299 else if (bodyType==2) // Moon position
1270 currSidT = myEarth->getSiderealTime(myJD)/Rad2Deg;1300 {
1271 RotObserver = (Mat4d::zrotation(currSidT))*ObserverLoc;1301 curSidT = myEarth->getSiderealTime(myJD)/Rad2Deg;
1272 LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-Pos0));1302 RotObserver = (Mat4d::zrotation(curSidT))*ObserverLoc;
1303 LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos));
1273 myMoon->computePosition(myJD);1304 myMoon->computePosition(myJD);
1274 myMoon->computeTransMatrix(myJD);1305 myMoon->computeTransMatrix(myJD);
1275 Pos1 = myMoon->getHeliocentricEclipticPos();1306 Pos1 = myMoon->getHeliocentricEclipticPos();
1276 Pos2 = (core->j2000ToEquinoxEqu(LocTrans*Pos1))-RotObserver;1307 Pos2 = (core->j2000ToEquinoxEqu(LocTrans*Pos1))-RotObserver;
1277 } else 1308 }
1278 { // Planet position:1309 else // Planet position
1279 myPlanet->computePosition(myJD);1310 {
1280 myPlanet->computeTransMatrix(myJD);1311 myPlanet->computePosition(myJD);
1281 Pos1 = myPlanet->getHeliocentricEclipticPos();1312 myPlanet->computeTransMatrix(myJD);
1282 LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-Pos0));1313 Pos1 = myPlanet->getHeliocentricEclipticPos();
1283 Pos2 = core->j2000ToEquinoxEqu(LocTrans*Pos1);1314 LocTrans = (core->matVsop87ToJ2000)*(Mat4d::translation(-earthPos));
1315 Pos2 = core->j2000ToEquinoxEqu(LocTrans*Pos1);
1284 };1316 };
12851317
1286 toRADec(Pos2,RA,Dec);1318 toRADec(Pos2,ra,dec);
1287 Vec3d MoonAltAz = core->equinoxEquToAltAz(Pos2,StelCore::RefractionOff);1319 Vec3d moonAltAz = core->equinoxEquToAltAz(Pos2, StelCore::RefractionOff);
1288 raised = MoonAltAz[2] > RefracHoriz;1320 hasRisen = moonAltAz[2] > refractedHorizonAlt;
12891321
1290// Initial guesses of rise/set/transit times.1322// Initial guesses of rise/set/transit times.
1291// They are called 'Moon', but are also used for the Sun or planet:1323// They are called 'Moon', but are also used for the Sun or planet:
12921324
1293 double Hcurr = -HourAngle(mylat,alti,selDec)*sign(LocPos[1]);1325 double Hcurr = -calculateHourAngle(mylat,alti,selDec)*sign(LocPos[1]);
1294 double SidT = toUnsignedRA(selRA + Hcurr);1326 double SidT = toUnsignedRA(selRA + Hcurr);
12951327
1296 MoonCulm = -Hcurr; 1328 MoonCulm = -Hcurr;
1297 MoonRise = (-Hhoriz-Hcurr);1329 MoonRise = (-hHoriz-Hcurr);
1298 MoonSet = (Hhoriz-Hcurr);1330 MoonSet = (hHoriz-Hcurr);
12991331
1300 if (raises) {1332 if (raises)
1301 if (raised==false) {1333 {
1334 if (!hasRisen)
1335 {
1302 MoonRise += (MoonRise<0.0)?24.0:0.0;1336 MoonRise += (MoonRise<0.0)?24.0:0.0;
1303 MoonSet -= (MoonSet>0.0)?24.0:0.0;1337 MoonSet -= (MoonSet>0.0)?24.0:0.0;
1304 };1338 }
13051339
1306// Rise time:1340// Rise time:
1307 tempEphH = MoonRise*TFrac;1341 tempEphH = MoonRise*TFrac;
1308 MoonRise = myJD + (MoonRise/24.);1342 MoonRise = myJD + (MoonRise/24.);
1309 for (i=0; i<Niter; i++)1343 for (i=0; i<NUM_ITER; i++)
1310 {1344 {
1311 // Get modified coordinates:1345 // Get modified coordinates:
1312 jd1 = MoonRise;1346 tempJd = MoonRise;
1313 1347
1314 if (Kind<3)1348 if (bodyType<3)
1315 {1349 {
1316 getSunMoonCoords(core,jd1,RAS,DecS,RA,Dec,EclLon,false);1350 getSunMoonCoords(core, tempJd,
1351 raSun, decSun,
1352 ra, dec,
1353 eclLon, false);
1317 } else1354 } else
1318 {1355 {
1319 getPlanetCoords(core,jd1,RA,Dec,false);1356 getPlanetCoords(core, tempJd, ra, dec, false);
1320 };1357 };
13211358
1322 if (Kind==1) {RA = RAS; Dec = DecS;};1359 if (bodyType==1) {ra = raSun; dec = decSun;};
13231360
1324 // Current hour angle at mod. coordinates:1361 // Current hour angle at mod. coordinates:
1325 Hcurr = toUnsignedRA(SidT-RA);1362 Hcurr = toUnsignedRA(SidT-ra);
1326 Hcurr -= (raised)?0.0:24.;1363 Hcurr -= (hasRisen)?0.0:24.;
1327 Hcurr -= (Hcurr>12.)?24.0:0.0;1364 Hcurr -= (Hcurr>12.)?24.0:0.0;
13281365
1329 // H at horizon for mod. coordinates:1366 // H at horizon for mod. coordinates:
1330 Hhoriz = HourAngle(mylat,RefracHoriz,Dec);1367 hHoriz = calculateHourAngle(mylat,refractedHorizonAlt,dec);
1331 // Compute eph. times for mod. coordinates:1368 // Compute eph. times for mod. coordinates:
1332 TempH = (-Hhoriz-Hcurr)*TFrac;1369 tempH = (-hHoriz-Hcurr)*TFrac;
1333 if (raised==false) TempH += (TempH<0.0)?24.0:0.0;1370 if (hasRisen==false) tempH += (tempH<0.0)?24.0:0.0;
1334 // Check convergence:1371 // Check convergence:
1335 if (std::abs(TempH-tempEphH)<JDsec) break;1372 if (std::abs(tempH-tempEphH)<JDsec) break;
1336 // Update rise-time estimate:1373 // Update rise-time estimate:
1337 tempEphH = TempH;1374 tempEphH = tempH;
1338 MoonRise = myJD + (tempEphH/24.);1375 MoonRise = myJD + (tempEphH/24.);
1339 };1376 };
13401377
1341// Set time: 1378// Set time:
1342 tempEphH = MoonSet;1379 tempEphH = MoonSet;
1343 MoonSet = myJD + (MoonSet/24.);1380 MoonSet = myJD + (MoonSet/24.);
1344 for (i=0; i<Niter; i++)1381 for (i=0; i<NUM_ITER; i++)
1345 {1382 {
1346 // Get modified coordinates:1383 // Get modified coordinates:
1347 jd1 = MoonSet;1384 tempJd = MoonSet;
13481385
1349 if (Kind<3)1386 if (bodyType < 3)
1350 {1387 getSunMoonCoords(core, tempJd,
1351 getSunMoonCoords(core,jd1,RAS,DecS,RA,Dec,EclLon,false);1388 raSun, decSun,
1352 } else1389 ra, dec,
1353 {1390 eclLon, false);
1354 getPlanetCoords(core,jd1,RA,Dec,false);1391 else
1355 };1392 getPlanetCoords(core, tempJd, ra, dec, false);
13561393
1357 if (Kind==1) {RA = RAS; Dec = DecS;};1394 if (bodyType==1) {ra = raSun; dec = decSun;};
13581395
1359 // Current hour angle at mod. coordinates:1396 // Current hour angle at mod. coordinates:
1360 Hcurr = toUnsignedRA(SidT-RA);1397 Hcurr = toUnsignedRA(SidT-ra);
1361 Hcurr -= (raised)?24.:0.;1398 Hcurr -= (hasRisen)?24.:0.;
1362 Hcurr += (Hcurr<-12.)?24.0:0.0;1399 Hcurr += (Hcurr<-12.)?24.0:0.0;
1363 // H at horizon for mod. coordinates:1400 // H at horizon for mod. coordinates:
1364 Hhoriz = HourAngle(mylat,RefracHoriz,Dec);1401 hHoriz = calculateHourAngle(mylat, refractedHorizonAlt, dec);
1365 // Compute eph. times for mod. coordinates:1402 // Compute eph. times for mod. coordinates:
1366 TempH = (Hhoriz-Hcurr)*TFrac;1403 tempH = (hHoriz-Hcurr)*TFrac;
1367 if (raised==false) TempH -= (TempH>0.0)?24.0:0.0;1404 if (!hasRisen)
1405 tempH -= (tempH>0.0)?24.0:0.0;
1368 // Check convergence:1406 // Check convergence:
1369 if (std::abs(TempH-tempEphH)<JDsec) break;1407 if (std::abs(tempH-tempEphH)<JDsec)
1408 break;
1370 // Update set-time estimate:1409 // Update set-time estimate:
1371 tempEphH = TempH;1410 tempEphH = tempH;
1372 MoonSet = myJD + (tempEphH/24.);1411 MoonSet = myJD + (tempEphH/24.);
1373 };1412 };
1374 } 1413 }
1375 else // Comes from if(raises)1414 else // Comes from if(raises)
1376 {1415 {
1377 MoonSet = -1.0; MoonRise = -1.0;1416 MoonSet = -1.0;
1417 MoonRise = -1.0;
1378 };1418 };
13791419
1380// Culmination time:1420// Culmination time:
1381 tempEphH = MoonCulm;1421 tempEphH = MoonCulm;
1382 MoonCulm = myJD + (MoonCulm/24.);1422 MoonCulm = myJD + (MoonCulm/24.);
13831423
1384 for (i=0; i<Niter; i++)1424 for (i=0; i<NUM_ITER; i++)
1385 {1425 {
1386 // Get modified coordinates:1426 // Get modified coordinates:
1387 jd1 = MoonCulm;1427 tempJd = MoonCulm;
13881428
1389 if (Kind<3)1429 if (bodyType<3)
1390 {1430 {
1391 getSunMoonCoords(core,jd1,RAS,DecS,RA,Dec,EclLon,false);1431 getSunMoonCoords(core,tempJd,raSun,decSun,ra,dec,eclLon,false);
1392 } else1432 } else
1393 {1433 {
1394 getPlanetCoords(core,jd1,RA,Dec,false);1434 getPlanetCoords(core,tempJd,ra,dec,false);
1395 };1435 };
13961436
13971437
1398 if (Kind==1) {RA = RAS; Dec = DecS;};1438 if (bodyType==1) {ra = raSun; dec = decSun;};
13991439
14001440
1401 // Current hour angle at mod. coordinates:1441 // Current hour angle at mod. coordinates:
1402 Hcurr = toUnsignedRA(SidT-RA);1442 Hcurr = toUnsignedRA(SidT-ra);
1403 Hcurr += (LocPos[1]<0.0)?24.0:-24.0;1443 Hcurr += (LocPos[1]<0.0)?24.0:-24.0;
1404 Hcurr -= (Hcurr>12.)?24.0:0.0;1444 Hcurr -= (Hcurr>12.)?24.0:0.0;
14051445
1406 // Compute eph. times for mod. coordinates:1446 // Compute eph. times for mod. coordinates:
1407 TempH = -Hcurr*TFrac;1447 tempH = -Hcurr*TFrac;
1408 // Check convergence:1448 // Check convergence:
1409 if (std::abs(TempH-tempEphH)<JDsec) break;1449 if (std::abs(tempH-tempEphH)<JDsec) break;
1410 tempEphH = TempH;1450 tempEphH = tempH;
1411 MoonCulm = myJD + (tempEphH/24.);1451 MoonCulm = myJD + (tempEphH/24.);
1412 culmAlt = std::abs(mylat-Dec); // 90 - altitude at transit. 1452 culmAlt = std::abs(mylat-dec); // 90 - altitude at transit.
1413 };1453 };
14141454
1415// qDebug() << q_("%1").arg(MoonCulm,0,'f',5);1455// qDebug() << q_("%1").arg(MoonCulm,0,'f',5);
@@ -1423,7 +1463,7 @@
14231463
14241464
1425// Find out the days of Full Moon:1465// Find out the days of Full Moon:
1426 if (Kind==2 && show_FullMoon) // || show_SuperMoon))1466 if (bodyType==2 && show_FullMoon) // || show_SuperMoon))
1427 {1467 {
14281468
1429 // Only estimate date of Full Moon if we have changed Lunar month:1469 // Only estimate date of Full Moon if we have changed Lunar month:
@@ -1456,24 +1496,24 @@
1456 Sec1 = iniEst1; // TempFullMoon - 0.05*MoonT; // Initial estimates of Full-Moon dates1496 Sec1 = iniEst1; // TempFullMoon - 0.05*MoonT; // Initial estimates of Full-Moon dates
1457 Sec2 = iniEst2; // TempFullMoon + 0.05*MoonT; 1497 Sec2 = iniEst2; // TempFullMoon + 0.05*MoonT;
14581498
1459 getSunMoonCoords(core,Sec1,RAS,DecS,RA,Dec,EclLon,false);1499 getSunMoonCoords(core,Sec1,raSun,decSun,ra,dec,eclLon,false);
1460 Temp1 = EclLon; //Lambda(RA,Dec,RAS,DecS);1500 Temp1 = eclLon; //Lambda(RA,Dec,RAS,DecS);
1461 getSunMoonCoords(core,Sec2,RAS,DecS,RA,Dec,EclLon,false);1501 getSunMoonCoords(core,Sec2,raSun,decSun,ra,dec,eclLon,false);
1462 Temp2 = EclLon; //Lambda(RA,Dec,RAS,DecS);1502 Temp2 = eclLon; //Lambda(RA,Dec,RAS,DecS);
14631503
14641504
1465 for (int i=0; i<100; i++) // A limit of 100 iterations.1505 for (int i=0; i<100; i++) // A limit of 100 iterations.
1466 {1506 {
1467 Phase1 = (Sec2-Sec1)/(Temp1-Temp2)*Temp1+Sec1;1507 Phase1 = (Sec2-Sec1)/(Temp1-Temp2)*Temp1+Sec1;
1468 getSunMoonCoords(core,Phase1,RAS,DecS,RA,Dec,EclLon,false);1508 getSunMoonCoords(core,Phase1,raSun,decSun,ra,dec,eclLon,false);
14691509
1470 if (Temp1*EclLon < 0.0) 1510 if (Temp1*eclLon < 0.0)
1471 {1511 {
1472 Sec2 = Phase1;1512 Sec2 = Phase1;
1473 Temp2 = EclLon;1513 Temp2 = eclLon;
1474 } else {1514 } else {
1475 Sec1 = Phase1;1515 Sec1 = Phase1;
1476 Temp1 = EclLon;1516 Temp1 = eclLon;
14771517
1478 };1518 };
14791519
@@ -1509,23 +1549,23 @@
1509 double LocalNext = nextFullMoon+GMTShift+0.5;1549 double LocalNext = nextFullMoon+GMTShift+0.5;
1510 double intMoon;1550 double intMoon;
1511 double LocalTMoon = 24.*modf(LocalPrev,&intMoon);1551 double LocalTMoon = 24.*modf(LocalPrev,&intMoon);
1512 StelUtils::getDateFromJulianDay(intMoon,&fullYear,&fullMonth,&fullDay);1552 StelUtils::getDateFromJulianDay(intMoon, &fullYear, &fullMonth, &fullDay);
1513 double2hms(toUnsignedRA(LocalTMoon),fullHour,fullMinute,fullSecond);1553 double2hms(toUnsignedRA(LocalTMoon),fullHour,fullMinute,fullSecond);
1514 if (getDateFormat())1554 if (getDateFormat())
1515 bestNight = msgPrevFullMoon.arg(fullDay).arg(months[fullMonth-1]).arg(fullHour).arg(fullMinute,2,10,QLatin1Char('0'));1555 lineBestNight = msgPrevFullMoon.arg(fullDay).arg(monthNames[fullMonth-1]).arg(fullHour).arg(fullMinute,2,10,QLatin1Char('0'));
1516 else1556 else
1517 bestNight = msgPrevFullMoon.arg(months[fullMonth-1]).arg(fullDay).arg(fullHour).arg(fullMinute,2,10,QLatin1Char('0'));1557 lineBestNight = msgPrevFullMoon.arg(monthNames[fullMonth-1]).arg(fullDay).arg(fullHour).arg(fullMinute,2,10,QLatin1Char('0'));
15181558
1519 LocalTMoon = 24.*modf(LocalNext,&intMoon);1559 LocalTMoon = 24.*modf(LocalNext,&intMoon);
1520 StelUtils::getDateFromJulianDay(intMoon,&fullYear,&fullMonth,&fullDay);1560 StelUtils::getDateFromJulianDay(intMoon,&fullYear,&fullMonth,&fullDay);
1521 double2hms(toUnsignedRA(LocalTMoon),fullHour,fullMinute,fullSecond); 1561 double2hms(toUnsignedRA(LocalTMoon),fullHour,fullMinute,fullSecond);
1522 if (getDateFormat())1562 if (getDateFormat())
1523 bestNight += msgNextFullMoon.arg(fullDay).arg(months[fullMonth-1]).arg(fullHour).arg(fullMinute,2,10,QLatin1Char('0'));1563 lineBestNight += msgNextFullMoon.arg(fullDay).arg(monthNames[fullMonth-1]).arg(fullHour).arg(fullMinute,2,10,QLatin1Char('0'));
1524 else1564 else
1525 bestNight += msgNextFullMoon.arg(months[fullMonth-1]).arg(fullDay).arg(fullHour).arg(fullMinute,2,10,QLatin1Char('0'));1565 lineBestNight += msgNextFullMoon.arg(monthNames[fullMonth-1]).arg(fullDay).arg(fullHour).arg(fullMinute,2,10,QLatin1Char('0'));
15261566
1527 ObsRange = ""; 1567 lineObservableRange.clear();
1528 AcroCos = "";1568 lineAcroCos.clear();
15291569
15301570
1531 // Now, compute the days of all the Full Moons of the current year, and get the Earth/Moon distance:1571 // Now, compute the days of all the Full Moons of the current year, and get the Earth/Moon distance:
@@ -1553,22 +1593,22 @@
1553// ObsRange = q_("Greatest Full Moon: %1 "+months[fullMonth-1]+" (%2% of Moon at Perilune)").arg(fullDay).arg(MoonSize,0,'f',2);1593// ObsRange = q_("Greatest Full Moon: %1 "+months[fullMonth-1]+" (%2% of Moon at Perilune)").arg(fullDay).arg(MoonSize,0,'f',2);
1554 };1594 };
1555 } 1595 }
1556 else if (Kind <3)1596 else if (bodyType <3)
1557 {1597 {
1558 bestNight = "";1598 lineBestNight.clear();
1559 ObsRange = ""; 1599 lineObservableRange.clear();
1560 AcroCos = "";1600 lineAcroCos.clear();
1561
1562 }; 1601 };
15631602
15641603
1565// Return the Moon and Earth to its current position:1604// Return the Moon and Earth to its current position:
1566 if (Kind<3)1605 if (bodyType<3)
1567 {1606 {
1568 getSunMoonCoords(core,myJD,RAS,DecS,RA,Dec,EclLon,true);1607 getSunMoonCoords(core, myJD, raSun, decSun, ra, dec, eclLon, true);
1569 } else1608 }
1570 {1609 else
1571 getPlanetCoords(core,myJD,RA,Dec,true);1610 {
1611 getPlanetCoords(core, myJD, ra, dec, true);
1572 };1612 };
15731613
15741614
@@ -1588,38 +1628,17 @@
1588 return true;1628 return true;
1589}1629}
15901630
1591void Observability::restoreDefaults(void)1631void Observability::resetConfiguration()
1592{1632{
1593 restoreDefaultConfigIni();1633 // Remove the plug-in's group from the configuration,
1594 readSettingsFromConfig();1634 // after that it will be loaded with default values.
1595}
1596
1597void Observability::restoreDefaultConfigIni(void)
1598{
1599 QSettings* conf = StelApp::getInstance().getSettings();1635 QSettings* conf = StelApp::getInstance().getSettings();
16001636 Q_ASSERT(conf);
1601 conf->beginGroup("Observability");1637 conf->remove("Observability");
16021638 loadConfiguration();
1603 // delete all existing settings...
1604 conf->remove("");
1605
1606 // Set defaults
1607 conf->setValue("font_size", 15);
1608 conf->setValue("Sun_Altitude", 12);
1609 conf->setValue("Horizon_Altitude", 0);
1610 conf->setValue("font_color", "0,0.5,1");
1611 conf->setValue("show_AcroCos", true);
1612 conf->setValue("show_Good_Nights", true);
1613 conf->setValue("show_Best_Night", true);
1614 conf->setValue("show_Today", true);
1615 conf->setValue("show_FullMoon", true);
1616// conf->setValue("show_Crescent", true);
1617// conf->setValue("show_SuperMoon", true);
1618
1619 conf->endGroup();
1620}1639}
16211640
1622void Observability::readSettingsFromConfig(void)1641void Observability::loadConfiguration()
1623{1642{
1624 QSettings* conf = StelApp::getInstance().getSettings();1643 QSettings* conf = StelApp::getInstance().getSettings();
16251644
@@ -1637,25 +1656,37 @@
1637// show_Crescent = conf->value("show_Crescent", true).toBool();1656// show_Crescent = conf->value("show_Crescent", true).toBool();
1638// show_SuperMoon = conf->value("show_SuperMoon", true).toBool();1657// show_SuperMoon = conf->value("show_SuperMoon", true).toBool();
16391658
1640 iAltitude = conf->value("Sun_Altitude", 12).toInt();1659 // For backwards compatibility, the value of this key is stored with
1641 AstroTwiAlti = -((double)iAltitude)/Rad2Deg ;1660 // inverted sign.
1661 // TODO: Skip the sign inversion when the key is changed.
1662 int altitude = -(conf->value("Sun_Altitude", 12).toInt());
1663 setTwilightAltitude(altitude);
16421664
1643 iHorizAltitude = conf->value("Horizon_Altitude", 0).toInt();1665 altitude = conf->value("Horizon_Altitude", 0).toInt();
1644 HorizAlti = ((double)iHorizAltitude)/Rad2Deg ;1666 setHorizonAltitude(altitude);
1645 1667
1646
1647 conf->endGroup();1668 conf->endGroup();
1669
1670 // Load date format from main settings.
1671 // TODO: Handle date format properly.
1672 if (conf->value("localization/date_display_format", "system_default").toString() == "ddmmyyyy")
1673 setDateFormat(true);
1674 else
1675 setDateFormat(false);
1648}1676}
16491677
1650void Observability::saveSettingsToConfig(void)1678void Observability::saveConfiguration()
1651{1679{
1652 QSettings* conf = StelApp::getInstance().getSettings();1680 QSettings* conf = StelApp::getInstance().getSettings();
1653 QString fontColorStr = QString("%1,%2,%3").arg(fontColor[0],0,'f',2).arg(fontColor[1],0,'f',2).arg(fontColor[2],0,'f',2);1681 QString fontColorStr = QString("%1,%2,%3").arg(fontColor[0],0,'f',2).arg(fontColor[1],0,'f',2).arg(fontColor[2],0,'f',2);
1654 // Set updated values1682 // Set updated values
1655 conf->beginGroup("Observability");1683 conf->beginGroup("Observability");
1656 conf->setValue("font_size", fontSize);1684 conf->setValue("font_size", fontSize);
1657 conf->setValue("Sun_Altitude", iAltitude);1685 // For backwards compatibility, the value of this key is stored with
1658 conf->setValue("Horizon_Altitude", iHorizAltitude);1686 // inverted sign.
1687 // TODO: Skip the sign inversion when the key is changed.
1688 conf->setValue("Sun_Altitude", -twilightAltDeg);
1689 conf->setValue("Horizon_Altitude", horizonAltDeg);
1659 conf->setValue("font_color", fontColorStr);1690 conf->setValue("font_color", fontColorStr);
1660 conf->setValue("show_AcroCos", show_AcroCos);1691 conf->setValue("show_AcroCos", show_AcroCos);
1661 conf->setValue("show_Good_Nights", show_Good_Nights);1692 conf->setValue("show_Good_Nights", show_Good_Nights);
@@ -1667,20 +1698,33 @@
1667 conf->endGroup();1698 conf->endGroup();
1668}1699}
16691700
16701701void Observability::enableTodayField(bool enabled)
16711702{
1672void Observability::setShow(int output, bool setVal)1703 show_Today = enabled;
1673{1704 configChanged = true;
1674 switch(output)1705}
1675 {1706
1676 case 1: {show_Today = setVal; break;}1707void Observability::enableAcroCosField(bool enabled)
1677 case 2: {show_AcroCos = setVal; break;}1708{
1678 case 3: {show_Good_Nights = setVal; break;}1709 show_AcroCos = enabled;
1679 case 4: {show_Best_Night = setVal; break;}1710 configChanged = true;
1680 case 5: {show_FullMoon = setVal; nextFullMoon=0.0; prevFullMoon=0.0; break;}1711}
1681// case 6: {show_Crescent = setVal; break;}1712
1682// case 7: {show_SuperMoon = setVal; break;}1713void Observability::enableGoodNightsField(bool enabled)
1683 };1714{
1715 show_Good_Nights = enabled;
1716 configChanged = true;
1717}
1718
1719void Observability::enableOppositionField(bool enabled)
1720{
1721 show_Best_Night = enabled;
1722 configChanged = true;
1723}
1724
1725void Observability::enableFullMoonField(bool enabled)
1726{
1727 show_FullMoon = enabled;
1684 configChanged = true;1728 configChanged = true;
1685}1729}
16861730
@@ -1710,52 +1754,44 @@
1710 return fontSize;1754 return fontSize;
1711}1755}
17121756
1713int Observability::getSunAltitude(void)1757int Observability::getTwilightAltitude()
1714{1758{
1715 return iAltitude;1759 return twilightAltDeg;
1716}1760}
17171761
1718int Observability::getHorizAltitude(void)1762int Observability::getHorizonAltitude()
1719{1763{
1720 return iHorizAltitude;1764 return horizonAltDeg;
1721}1765}
17221766
17231767
1724void Observability::setFontColor(int color, int value)1768void Observability::setFontColor(const Vec3f& color)
1725{1769{
1726 float fValue = (float)(value) / 100.; 1770 fontColor = color; // Vector3::operator =() is overloaded. :)
1727 fontColor[color] = fValue;1771}
1728}1772
17291773void Observability::setFontSize(int size)
1730void Observability::setFontSize(int value)1774{
1731{1775 fontSize = size;
1732 fontSize = value;1776}
1733}1777
17341778void Observability::setTwilightAltitude(int altitude)
1735void Observability::setSunAltitude(int value)1779{
1736{1780 twilightAltRad = ((double) altitude)/Rad2Deg ;
1737 AstroTwiAlti = -((double) value)/Rad2Deg ;1781 twilightAltDeg = altitude;
1738 iAltitude = value;1782 configChanged = true;
1739 configChanged = true;1783}
1740}1784
17411785void Observability::setHorizonAltitude(int altitude)
1742void Observability::setHorizAltitude(int value)1786{
1743{1787 horizonAltitude = ((double) altitude)/Rad2Deg ;
1744 HorizAlti = ((double) value)/Rad2Deg ;1788 horizonAltDeg = altitude;
1745 iHorizAltitude = value;1789 configChanged = true;
1746 configChanged = true;1790}
1747}1791
17481792
17491793void Observability::showReport(bool b)
1750/// END OF STUFF FOR THE GUI CONFIG.1794{
1751///////////////////////////////1795 flagShowReport = b;
1752
1753
1754
1755
1756// Enable the Observability:
1757void Observability::enableObservability(bool b)
1758{
1759 flagShowObservability = b;
1760}1796}
17611797
17621798
=== modified file 'plugins/Observability/src/Observability.hpp'
--- plugins/Observability/src/Observability.hpp 2013-09-11 09:43:19 +0000
+++ plugins/Observability/src/Observability.hpp 2014-04-04 19:38:38 +0000
@@ -30,10 +30,23 @@
30class StelButton;30class StelButton;
31class ObservabilityDialog;31class ObservabilityDialog;
3232
33//! Main class of the %Observability Analysis plug-in.
34//! It provides an observability report for the currently selected object,
35//! or for the point in the center of the screen if no object is selected.
36//! The output is drawn directly onto the viewport. The color and font size can
37//! be selected by the user from the plug-in's configuration window.
38//! @see ObservabilityDialog
39//! @todo Find a way to (optionally) put the report in the upper left corner
40//! infobox.
41//! @todo Decide whether to use flags or separate getters/setters to communicate
42//! with the configuration window; if using flags, implement them properly w Qt.
43//! @todo Handle re-loading of the Solar System at runtime.
44//! @todo For each suspicious member variable, check if it can't be actually
45//! a local variable.
33class Observability : public StelModule46class Observability : public StelModule
34{47{
35 Q_OBJECT48 Q_OBJECT
36 Q_PROPERTY(bool enabled READ getEnableObservability WRITE enableObservability)49 Q_PROPERTY(bool flagShowReport READ isShownReport WRITE showReport)
37public:50public:
38 Observability();51 Observability();
39 virtual ~Observability();52 virtual ~Observability();
@@ -42,39 +55,14 @@
42 virtual void draw(StelCore* core);55 virtual void draw(StelCore* core);
43 virtual double getCallOrder(StelModuleActionName actionName) const;56 virtual double getCallOrder(StelModuleActionName actionName) const;
4457
45
46 //! Implement this to tell the main Stellarium GUI that there is a GUI element to configure this plugin.58 //! Implement this to tell the main Stellarium GUI that there is a GUI element to configure this plugin.
47 virtual bool configureGui(bool show=true);59 virtual bool configureGui(bool show=true);
4860
4961
50 //! Set up the plugin with default values.62 //! Read (or re-read) settings from the main config file.
51 void restoreDefaults(void);63 //! Default values are provided for all settings.
52 void restoreDefaultConfigIni(void);64 //! Called in init() and resetConfiguration().
5365 void loadConfiguration();
54 //! Read (or re-read) settings from the main config file. This will be called from init and also
55 //! when restoring defaults (i.e. from the configuration dialog / restore defaults button).
56 void readSettingsFromConfig(void);
57
58 //! Save the settings to the main configuration file.
59 void saveSettingsToConfig(void);
60
61 //! Set which output is shown.
62 //! @param output is the index of the output (e.g., 1 for today's ephemeris, 5 for Full Moon).
63 //! @param show is a boolean (true to show the output; false to hide it).
64 void setShow(int output, bool show);
65
66 //! Set the font colors. Color is (0,1,2) for (R,G,B):
67 void setFontColor(int Color, int Value);
68
69 //! Set the font size:
70 void setFontSize(int);
71
72 //! Set the Sun altitude at twilight:
73 void setSunAltitude(int);
74
75 //! Set the Sun altitude at twilight:
76 void setHorizAltitude(int);
77
7866
79 //! get Show Flags from current configuration:67 //! get Show Flags from current configuration:
80 bool getShowFlags(int);68 bool getShowFlags(int);
@@ -85,55 +73,107 @@
85 //! get current font size:73 //! get current font size:
86 int getFontSize(void);74 int getFontSize(void);
8775
88 //! get current Sun altitude at twilight:76 //! Get the user-defined Sun altitude at twilight.
89 int getSunAltitude(void);77 //! @returns A value in degrees.
9078 int getTwilightAltitude();
91 //! get current Horizon altitude:79
92 int getHorizAltitude(void);80 //! Get the user-defined altitude of the visual horizon.
9381 int getHorizonAltitude();
94 bool getEnableObservability() const {return flagShowObservability;}82
83 bool isShownReport() const {return flagShowReport;}
95public slots:84public slots:
96//! Set whether observability will execute or not:85 //! Restore and reload the default plug-in settings.
97 void enableObservability(bool b);86 void resetConfiguration();
9887 //! Save the plug-in's configuration to the main configuration file.
88 void saveConfiguration();
89
90 //! @name Fields displayed in the observability report.
91 //! @{
92
93 //! Display today's events (rise, set and transit times).
94 void enableTodayField(bool enabled = true);
95 //! Display acronychal and cosmical rising/setting.
96 void enableAcroCosField(bool enabled = true);
97 //! Display nights when the object is above the horizon after darkness.
98 void enableGoodNightsField(bool enabled = true);
99 //! Display when selected object is in opposition.
100 void enableOppositionField(bool enabled = true);
101 //! Display date of the full moon.
102 //! Has any effect only if the Moon is selected.
103 void enableFullMoonField(bool enabled = true);
104 //! @}
105
106
107 //! Set the color of the font used to display the report.
108 //! Applies only to what is drawn on the viewport.
109 //! @param color Color vector in Stellarium's RGB format.
110 void setFontColor(const Vec3f& color);
111 //! Set the size of the font used to display the report.
112 //! Applies only to what is drawn on the viewport.
113 void setFontSize(int size);
114
115 //! Set the angular altitude below the horizon of the Sun at twilight.
116 //! This determines the boundaries of day/night for observation purposes.
117 //! @param altitude An angle in degrees; as this is altitude below
118 //! the horizon, it should be negative.
119 //! @note If you want the slider in the configuration dialog to be inverted,
120 //! you can use the @c invertedAppearance property of QSlider.
121 //! @todo Check if parameter is in the acceptable range?
122 void setTwilightAltitude(int altitude);
123
124 //! Set the angular altitude of the visual horizon.
125 //! @param altitude An angle in degrees.
126 //! @todo Check if parameter is in the acceptable range?
127 void setHorizonAltitude(int altitude);
128
129 //! Controls whether an observability report will be displayed.
130 void showReport(bool b);
131
132
99private slots:133private slots:
134 //! Retranslates the user-visible strings when the language is changed.
100 void updateMessageText();135 void updateMessageText();
101136
137
102private:138private:
103139 //! Configuration window.
104
105//! Stuff for the configuration GUI:
106 ObservabilityDialog* configDialog;140 ObservabilityDialog* configDialog;
107 QByteArray normalStyleSheet;
108 QByteArray nightStyleSheet;
109141
110 void setDateFormat(bool b) { dmyFormat=b; }142 void setDateFormat(bool b) { dmyFormat=b; }
111 bool getDateFormat(void) { return dmyFormat; }143 bool getDateFormat(void) { return dmyFormat; }
112144
113//! Computes the Hour Angle (culmination=0h) in absolute value (from 0h to 12h).145//! Computes the Hour Angle (culmination=0h) in absolute value (from 0h to 12h).
146//! @todo The hour angle of what, exactly? --BM
114//! @param latitude latitude of the observer (in radians).147//! @param latitude latitude of the observer (in radians).
115//! @param elevation elevation angle of the object (horizon=0) in radians.148//! @param elevation elevation angle of the object (horizon=0) in radians.
116//! @param declination declination of the object in radians. 149//! @param declination declination of the object in radians.
117 virtual double HourAngle(double latitude,double elevation,double declination);150 double calculateHourAngle(double latitude,
151 double elevation,
152 double declination);
118153
119//! Computes the Hour Angle for a given Right Ascension and Sidereal Time.154//! Computes the Hour Angle for a given Right Ascension and Sidereal Time.
120//! @param RA right ascension (hours).155//! @param RA right ascension (hours).
121//! @param ST sidereal time (degrees).156//! @param ST sidereal time (degrees).
122 virtual double HourAngle2(double RA, double ST);157 double HourAngle2(double RA, double ST);
123158
124//! Solves Moon/Sun/Planet Rise/Set/Transit times for the current Julian day. This function updates the variables MoonRise, MoonSet, MoonCulm. Returns success status.159//! Solves Moon/Sun/Planet Rise/Set/Transit times for the current Julian day.
125//! @param Kind is 1 for Sun, 2 for Moon, 3 for Solar-System planet.160//! This function updates the variables MoonRise, MoonSet, MoonCulm.
126 virtual bool SolarSystemSolve(StelCore* core, int Kind);161//! Returns success status.
162//! @param[in] bodyType is 1 for Sun, 2 for Moon, 3 for Solar System object.
163 bool calculateSolarSystemEvents(StelCore* core, int bodyType);
127164
128//! Finds the heliacal rise/set dates of the year for the currently-selected object.165//! Finds the heliacal rise/set dates of the year for the currently-selected object.
129//! @param Rise day of year of the Acronycal rise.166//! @param[out] acroRise day of year of the Acronycal rise.
130//! @param Set day of year of the Acronycal set.167//! @param[out] acroSet day of year of the Acronycal set.
131//! @param Rise2 day of year of the Cosmical rise.168//! @param[out] cosRise day of year of the Cosmical rise.
132//! @param Set2 day of year of the Cosmical set.169//! @param[out] cosSet day of year of the Cosmical set.
133 virtual int CheckAcro(int &Rise, int &Set, int &Rise2, int &Set2);170//! @returns 0 if no dates found, 1 if acronycal dates exist,
134171//! 2 if cosmical dates exist, and 3 if both are found.
135172 int calculateAcroCos(int& acroRise, int& acroSet,
136//! computes the Sun or Moon coordinates at a given Julian date.173 int& cosRise, int& cosSet);
174
175
176//! Computes the Sun or Moon coordinates at a given Julian date.
137//! @param core the stellarium core.177//! @param core the stellarium core.
138//! @param JD double for the Julian date.178//! @param JD double for the Julian date.
139//! @param RASun right ascension of the Sun (in hours).179//! @param RASun right ascension of the Sun (in hours).
@@ -142,7 +182,10 @@
142//! @param DecMoon idem for the Moon.182//! @param DecMoon idem for the Moon.
143//! @param EclLon is the module of the vector product of Heliocentric Ecliptic Coordinates of Sun and Moon (projected over the Ecliptic plane). Useful to derive the dates of Full Moon.183//! @param EclLon is the module of the vector product of Heliocentric Ecliptic Coordinates of Sun and Moon (projected over the Ecliptic plane). Useful to derive the dates of Full Moon.
144//! @param getBack controls whether Earth and Moon must be returned to their original positions after computation.184//! @param getBack controls whether Earth and Moon must be returned to their original positions after computation.
145 virtual void getSunMoonCoords(StelCore* core, double JD, double &RASun, double &DecSun, double &RAMoon, double &DecMoon, double &EclLon, bool getBack);185 void getSunMoonCoords(StelCore* core, double jd,
186 double& raSun, double& decSun,
187 double& raMoon, double& decMoon,
188 double& eclLon, bool getBack);
146189
147190
148//! computes the selected-planet coordinates at a given Julian date.191//! computes the selected-planet coordinates at a given Julian date.
@@ -151,73 +194,103 @@
151//! @param RA right ascension of the planet (in hours).194//! @param RA right ascension of the planet (in hours).
152//! @param Dec declination of the planet (in radians).195//! @param Dec declination of the planet (in radians).
153//! @param getBack controls whether the planet must be returned to its original positions after computation.196//! @param getBack controls whether the planet must be returned to its original positions after computation.
154 virtual void getPlanetCoords(StelCore* core, double JD, double &RA, double &Dec, bool getBack);197 void getPlanetCoords(StelCore* core, double JD, double &RA, double &Dec, bool getBack);
155198
156//! Comptues the Earth-Moon distance (in AU) at a given Julian date. The parameters are similar to those of getSunMoonCoords or getPlanetCoords.199//! Comptues the Earth-Moon distance (in AU) at a given Julian date.
157 virtual void getMoonDistance(StelCore* core, double JD, double &Distance, bool getBack);200//! The parameters are similar to those of getSunMoonCoords or getPlanetCoords.
201 void getMoonDistance(StelCore* core,
202 double jd,
203 double& distance,
204 bool getBack);
158205
159//! Returns the angular separation (in radians) between two points.206//! Returns the angular separation (in radians) between two points.
160//! @param RA1 right ascension of point 1 (in hours)207//! @param RA1 right ascension of point 1 (in hours)
161//! @param Dec1 declination of point 1 (in radians)208//! @param Dec1 declination of point 1 (in radians)
162//! @param RA2 idem for point 2209//! @param RA2 idem for point 2
163//! @param Dec2 idem for point 2210//! @param Dec2 idem for point 2
164 virtual double Lambda(double RA1, double Dec1, double RA2, double Dec2);211 double Lambda(double RA1, double Dec1, double RA2, double Dec2);
165212
166//! Converts a time span in hours (given as double) in hh:mm:ss (integers).213//! Converts a time span in hours (given as double) in hh:mm:ss (integers).
167//! @param t time span (double, in hours).214//! @param t time span (double, in hours).
168//! @param h hour (integer).215//! @param h hour (integer).
169//! @param m minute (integer).216//! @param m minute (integer).
170//! @param s second (integer).217//! @param s second (integer).
171 virtual void double2hms(double t, int &h,int &m,int &s);218 void double2hms(double t, int &h,int &m,int &s);
172219
173//! Just returns the sign of a double;220//! Just returns the sign of a double;
174 virtual double sign(double d);221 double sign(double d);
175222
176//! Returns a string of date (e.g. "25 Apr") from a Day of Year (integer).223//! Get a date string ("25 Apr") from an ordinal date (Xth day of the year).
177//! @param DoY Day of the year.224//! @param dayNumber The ordinal number of a day of the year. (For example,
178 virtual QString CalenDate(int DoY);225//! 25 April is the 115 or 116 day of the year.)
179226//! @todo Determine the exact format - leap year handling, etc.
180//! Returns a string of range dates (e.g. "25 Apr - 10 May") from a two Days of Year (integer).227 QString formatAsDate(int dayNumber);
181//! @param fDoY first Day of the year.228
182//! @param sDoY second Day of the year.229//! Get a date range string ("25 Apr - 10 May") from two ordinal dates.
183 virtual QString RangeCalenDates(int fDoY, int sDoY);230//! @see formatAsDate()
231//! @param startDay number of the first day in the period.
232//! @param endDay number of the last day in the period.
233 QString formatAsDateRange(int startDay, int endDay);
184234
185//! Just subtracts/adds 24h to a RA (or HA), to make it fall within 0-24h.235//! Just subtracts/adds 24h to a RA (or HA), to make it fall within 0-24h.
186//! @param RA right ascension (in hours).236//! @param RA right ascension (in hours).
187 virtual double toUnsignedRA(double RA);237 double toUnsignedRA(double RA);
188238
189//! Computes the RA, Dec and Rise/Set Sid. times of the selected planet for each day of the current year.239//! Prepare arrays with data for the selected object for each day of the year.
240//! Computes the RA, Dec and rise/set sidereal times of the selected planet
241//! for each day of the current year.
190//! @param core the current Stellarium core.242//! @param core the current Stellarium core.
191 virtual void PlanetRADec(StelCore *core);243 void updatePlanetData(StelCore* core);
192244
193//! Computes the Sun's RA and Dec for each day of a given year.245//! Computes the Sun's RA and Dec for each day of a given year.
194//! @param core current Stellarium core.246//! @param core current Stellarium core.
195 virtual void SunRADec(StelCore* core);247 void updateSunData(StelCore* core);
196248
197//! Computes the Sun's Sid. Times at astronomical twilight (for each year's day)249//! Computes the Sun's Sid. Times at astronomical twilight (for each year's day)
198 virtual void SunHTwi();250 void updateSunH();
199251
200//! Just convert the Vec3d named TempLoc into RA/Dec:252 //! Convert an equatorial position vector to RA/Dec.
201 virtual void toRADec(Vec3d TempLoc, double &RA, double &Dec);253 void toRADec(Vec3d vec3d, double& ra, double& dec);
202254
203//! Vector to store the Julian Dates for the current year:255 //! Table containing the Julian Dates of the days of the current year.
204 double yearJD[366];256 double yearJD[366];
205257
206//! Check if a source is observable during a given date:258//! Check if a source is observable during a given date.
207//! @aparm i the day of the year.259//! @param i the day of the year.
208 virtual bool CheckRise(int i);260 bool CheckRise(int day);
209261
210//! Some useful constants and variables(almost self-explanatory).262//! Some useful constants and variables(almost self-explanatory).
211 double Rad2Deg, Rad2Hr, AstroTwiAlti, UA, TFrac, JDsec, Jan1stJD, halfpi, MoonT, nextFullMoon, prevFullMoon, RefFullMoon, GMTShift, MoonPerilune,RefracHoriz,HorizAlti;263 double Rad2Deg, Rad2Hr, UA, TFrac, JDsec, Jan1stJD, halfpi, MoonT, nextFullMoon, prevFullMoon, RefFullMoon, GMTShift, MoonPerilune;
264
265 //! User-defined angular altitude of astronomical twilight in radians.
266 //! See setTwilightAltitude() and getTwilightAltitude().
267 double twilightAltRad;
268 //! User-defined angular altitude of astronomical twilight in degrees.
269 //! See setTwilightAltitude() and getTwilightAltitude().
270 int twilightAltDeg;
271
272 //! Geometric altitude at refraction-corrected horizon.
273 double refractedHorizonAlt;
274 //! User-defined angular altitude of the visual horizon in radians.
275 double horizonAltitude;
276 //! User-defined angular altitude of the visual horizon in degrees.
277 int horizonAltDeg;
212278
213//! RA, Dec, observer latitude, object's elevation, and Hour Angle at horizon.279//! RA, Dec, observer latitude, object's elevation, and Hour Angle at horizon.
214 double selRA, selDec, mylat, mylon, alti, horizH, culmAlt, myJD;280 double selRA, selDec, mylat, mylon, alti, horizH, culmAlt, myJD;
215281
216//! Vectors to store Sun's RA, Dec, and Sid. Time at twilight and rise/set.282//! Vectors to store Sun's RA, Dec, and Sid. Time at twilight and rise/set.
217 double SunRA[366], SunDec[366], SunSidT[4][366];283 double sunRA[366];
284 double sunDec[366];
285 //! Sidereal time of the Sun at twilight and rise/set through the year.
286 double sunSidT[4][366];
218287
219//! Vectors to store planet's RA, Dec, and Sid. Time at rise/set.288//! Vectors to store planet's RA, Dec, and Sid. Time at rise/set.
220 double ObjectRA[366], ObjectDec[366], ObjectH0[366], ObjectSidT[2][366];289 double objectRA[366];
290 double objectDec[366];
291 double objectH0[366];
292 //! Table of the sidereal time of the object's rising/setting.
293 double objectSidT[2][366];
221294
222//! Rise/Set/Transit times for the Moon at current day:295//! Rise/Set/Transit times for the Moon at current day:
223 double MoonRise, MoonSet, MoonCulm, lastJDMoon;296 double MoonRise, MoonSet, MoonCulm, lastJDMoon;
@@ -226,7 +299,7 @@
226 Vec3d EarthPos[366];299 Vec3d EarthPos[366];
227300
228//! Position of the observer relative to the Earth Center or other coordinates:301//! Position of the observer relative to the Earth Center or other coordinates:
229 Vec3d ObserverLoc, Pos0, Pos1, Pos2, RotObserver; //, Pos3;302 Vec3d ObserverLoc, Pos1, Pos2, RotObserver; //, Pos3;
230303
231//! Matrix to transform coordinates for Sun/Moon ephemeris:304//! Matrix to transform coordinates for Sun/Moon ephemeris:
232 Mat4d LocTrans;305 Mat4d LocTrans;
@@ -237,44 +310,65 @@
237 Planet* myPlanet;310 Planet* myPlanet;
238311
239312
240//! Current simulation year and number of days in the year.;313 //! Current simulation year.
241 int currYear, nDays, iAltitude, iHorizAltitude;314 int curYear;
315 //! Days in the current year (366 on leap years).
316 int nDays;
242317
243//! Useful auxiliary strings, to help checking changes in source/observer. Also to store results that must survive between iterations.318 //! Untranslated name of the currently selected object.
244 QString selName, bestNight, ObsRange, objname, AcroCos;319 //! Used to check if the selection has changed.
320 QString selName;
321 //! Cached copy of the "best night" line in the report.
322 QString lineBestNight;
323 //! Cached copy of the line reporting when the target is observable.
324 QString lineObservableRange;
325 //! Cached copy of the line reporting the acronical/cosmical rise and set.
326 QString lineAcroCos;
245327
246//! Strings to save ephemeris Times:328//! Strings to save ephemeris Times:
247 QString RiseTime, SetTime, CulmTime;329 QString RiseTime, SetTime, CulmTime;
248330
249//! Just the names of the months.331 //! Just the names of the months.
250 QString months[12];332 QStringList monthNames;
251333
252//! Using for storage date format [i18n]334 //! Using for storage date format [i18n]
253 bool dmyFormat;335 bool dmyFormat;
254336
255//! Equatorial and local coordinates of currently-selected source.337//! Equatorial and local coordinates of currently-selected source.
256 Vec3d EquPos, LocPos;338 Vec3d EquPos, LocPos;
257339
258//! Some booleans to check the kind of source selected and the kind of output to produce.340//! Some booleans to check the kind of source selected and the kind of output to produce.
259 bool isStar,isMoon,isSun,isScreen, raised, configChanged, souChanged;341 bool isStar, isMoon, isSun, isScreen;
260 int LastObject;
261342
262//! Some booleans to select the kind of output.343 //! This really shouldn't be handled like this...
344 bool hasRisen;
345 bool configChanged;
346 bool souChanged;
347 //! The last object type for which calculateSolarSystemEvents() was called.
348 int lastType;
349
350 //! @name Flags controlling report contents.
351 //! @{
263 bool show_AcroCos, show_Good_Nights, show_Best_Night, show_Today, show_FullMoon; //, show_Crescent, show_SuperMoon;352 bool show_AcroCos, show_Good_Nights, show_Best_Night, show_Today, show_FullMoon; //, show_Crescent, show_SuperMoon;
353 //! @}
264354
265//! Parameters for the graphics (i.e., font, icons, etc.):355 //! @name GUI elements
356 //! @{
357 //! Parameters for the graphics.
266 QFont font;358 QFont font;
267 Vec3f fontColor;359 Vec3f fontColor;
268 bool flagShowObservability;360 bool flagShowReport;
269 int fontSize;361 int fontSize;
270 QPixmap* OnIcon;362 StelButton* button;
271 QPixmap* OffIcon;363 //! @}
272 QPixmap* GlowIcon;
273 StelButton* toolbarButton;
274364
365 //! @name Cached translated GUI strings.
366 //! @todo Decide whether to keep translation caching.
367 //! @{
275 QString msgSetsAt, msgRoseAt, msgSetAt, msgRisesAt, msgCircumpolar, msgNoRise, msgCulminatesAt, msgCulminatedAt, msgH, msgM, msgS;368 QString msgSetsAt, msgRoseAt, msgSetAt, msgRisesAt, msgCircumpolar, msgNoRise, msgCulminatesAt, msgCulminatedAt, msgH, msgM, msgS;
276 QString msgSrcNotObs, msgNoACRise, msgGreatElong, msgLargSSep, msgAtDeg, msgNone, msgAcroRise, msgNoAcroRise, msgCosmRise, msgNoCosmRise;369 QString msgSrcNotObs, msgNoACRise, msgGreatElong, msgLargSSep, msgNone, msgAcroRise, msgNoAcroRise, msgCosmRise, msgNoCosmRise;
277 QString msgWholeYear, msgNotObs, msgAboveHoriz, msgToday, msgThisYear, msgPrevFullMoon, msgNextFullMoon;370 QString msgWholeYear, msgNotObs, msgAboveHoriz, msgToday, msgThisYear, msgPrevFullMoon, msgNextFullMoon;
371 //! @}
278372
279};373};
280374
281375
=== modified file 'plugins/Observability/src/gui/ObservabilityDialog.cpp'
--- plugins/Observability/src/gui/ObservabilityDialog.cpp 2014-03-01 15:42:49 +0000
+++ plugins/Observability/src/gui/ObservabilityDialog.cpp 2014-04-04 19:38:38 +0000
@@ -52,6 +52,7 @@
52 {52 {
53 ui->retranslateUi(dialog);53 ui->retranslateUi(dialog);
54 setAboutHtml();54 setAboutHtml();
55 updateControls(); // Also re-translate the dynamic slider labels
55 }56 }
56}57}
5758
@@ -60,27 +61,55 @@
60{61{
61 ui->setupUi(dialog);62 ui->setupUi(dialog);
62 ui->tabs->setCurrentIndex(0);63 ui->tabs->setCurrentIndex(0);
63 connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));64 connect(&StelApp::getInstance(),
65 SIGNAL(languageChanged()), this, SLOT(retranslate()));
6466
67 Observability* plugin = GETSTELMODULE(Observability);
68
65 // Settings:69 // Settings:
66 connect(ui->Today, SIGNAL(stateChanged(int)), this, SLOT(setTodayFlag(int)));70
67 connect(ui->AcroCos, SIGNAL(stateChanged(int)), this, SLOT(setAcroCosFlag(int)));71 // clicked() is called only when the user makes an input,
68 connect(ui->Opposition, SIGNAL(stateChanged(int)), this, SLOT(setOppositionFlag(int)));72 // so we avoid an endless loop when setting the value in updateControls().
69 connect(ui->Goods, SIGNAL(stateChanged(int)), this, SLOT(setGoodDatesFlag(int)));73 connect(ui->todayCheckBox, SIGNAL(clicked(bool)),
70 connect(ui->FullMoon, SIGNAL(stateChanged(int)), this, SLOT(setFullMoonFlag(int)));74 plugin, SLOT(enableTodayField(bool)));
71// connect(ui->Crescent, SIGNAL(stateChanged(int)), this, SLOT(setCrescentMoonFlag(int)));75 connect(ui->acroCosCheckBox, SIGNAL(clicked(bool)),
72// connect(ui->SuperMoon, SIGNAL(stateChanged(int)), this, SLOT(setSuperMoonFlag(int)));76 plugin, SLOT(enableAcroCosField(bool)));
77 connect(ui->oppositionCheckBox, SIGNAL(clicked(bool)),
78 plugin, SLOT(enableOppositionField(bool)));
79 connect(ui->goodNightsCheckBox, SIGNAL(clicked(bool)),
80 plugin, SLOT(enableGoodNightsField(bool)));
81 connect(ui->fullMoonCheckBox, SIGNAL(clicked(bool)),
82 plugin, SLOT(enableFullMoonField(bool)));
7383
74 connect(ui->Red, SIGNAL(sliderMoved(int)), this, SLOT(setRed(int)));84 connect(ui->redSlider, SIGNAL(sliderMoved(int)),
75 connect(ui->Green, SIGNAL(sliderMoved(int)), this, SLOT(setGreen(int)));85 this, SLOT(setColor()));
76 connect(ui->Blue, SIGNAL(sliderMoved(int)), this, SLOT(setBlue(int)));86 connect(ui->greenSlider, SIGNAL(sliderMoved(int)),
77 connect(ui->fontSize, SIGNAL(sliderMoved(int)), this, SLOT(setSize(int)));87 this, SLOT(setColor()));
78 connect(ui->SunAltitude, SIGNAL(sliderMoved(int)), this, SLOT(setAltitude(int)));88 connect(ui->blueSlider, SIGNAL(sliderMoved(int)),
79 connect(ui->HorizAltitude, SIGNAL(sliderMoved(int)), this, SLOT(setHorizon(int)));89 this, SLOT(setColor()));
90
91 // Isn't valueChanged() better? But then we'll have to block
92 // signlas when settting the slider values.
93 connect(ui->fontSize, SIGNAL(sliderMoved(int)),
94 plugin, SLOT(setFontSize(int)));
95 connect(ui->sunAltitudeSlider, SIGNAL(sliderMoved(int)),
96 plugin, SLOT(setTwilightAltitude(int)));
97 connect(ui->sunAltitudeSlider, SIGNAL(sliderMoved(int)),
98 this, SLOT(updateAltitudeLabel(int)));
99 connect(ui->horizonAltitudeSlider, SIGNAL(sliderMoved(int)),
100 plugin, SLOT(setHorizonAltitude(int)));
101 connect(ui->horizonAltitudeSlider, SIGNAL(sliderMoved(int)),
102 this, SLOT(updateHorizonLabel(int)));
80103
81 connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));104 connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
82 connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults()));105 connect(ui->restoreDefaultsButton, SIGNAL(clicked()),
83 connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings()));106 plugin, SLOT(resetConfiguration()));
107 // TODO: The plug-in should emit a signal when settings are changed.
108 // This works, because slots are called in the order they were connected.
109 connect(ui->restoreDefaultsButton, SIGNAL(clicked()),
110 this, SLOT(updateControls()));
111 connect(ui->saveSettingsButton, SIGNAL(clicked()),
112 plugin, SLOT(saveConfiguration()));
84113
85 // About tab114 // About tab
86 setAboutHtml();115 setAboutHtml();
@@ -88,8 +117,7 @@
88 Q_ASSERT(gui);117 Q_ASSERT(gui);
89 ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));118 ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));
90119
91 updateGuiFromSettings();120 updateControls();
92
93}121}
94122
95void ObservabilityDialog::setAboutHtml(void)123void ObservabilityDialog::setAboutHtml(void)
@@ -118,121 +146,59 @@
118 ui->aboutTextBrowser->setHtml(html);146 ui->aboutTextBrowser->setHtml(html);
119}147}
120148
121149void ObservabilityDialog::updateControls()
122void ObservabilityDialog::restoreDefaults(void)150{
123{151 Observability* plugin = GETSTELMODULE(Observability);
124 qDebug() << "Observability::restoreDefaults";152
125 GETSTELMODULE(Observability)->restoreDefaults();153 ui->todayCheckBox->setChecked(plugin->getShowFlags(1));
126 GETSTELMODULE(Observability)->readSettingsFromConfig();154 ui->acroCosCheckBox->setChecked(plugin->getShowFlags(2));
127 updateGuiFromSettings();155 ui->goodNightsCheckBox->setChecked(plugin->getShowFlags(3));
128}156 ui->oppositionCheckBox->setChecked(plugin->getShowFlags(4));
129157 ui->fullMoonCheckBox->setChecked(plugin->getShowFlags(5));
130void ObservabilityDialog::updateGuiFromSettings(void)
131{
132 ui->Today->setChecked(GETSTELMODULE(Observability)->getShowFlags(1));
133 ui->AcroCos->setChecked(GETSTELMODULE(Observability)->getShowFlags(2));
134 ui->Goods->setChecked(GETSTELMODULE(Observability)->getShowFlags(3));
135 ui->Opposition->setChecked(GETSTELMODULE(Observability)->getShowFlags(4));
136 ui->FullMoon->setChecked(GETSTELMODULE(Observability)->getShowFlags(5));
137// ui->Crescent->setChecked(GETSTELMODULE(Observability)->getShowFlags(6));158// ui->Crescent->setChecked(GETSTELMODULE(Observability)->getShowFlags(6));
138// ui->SuperMoon->setChecked(GETSTELMODULE(Observability)->getShowFlags(7));159// ui->SuperMoon->setChecked(GETSTELMODULE(Observability)->getShowFlags(7));
139160
140 Vec3f currFont = GETSTELMODULE(Observability)->getFontColor();161 Vec3f fontColor = plugin->getFontColor();
141 int Rv = (int)(100.*currFont[0]);162 int red = (int)(100.*fontColor[0]);
142 int Gv = (int)(100.*currFont[1]);163 int green = (int)(100.*fontColor[1]);
143 int Bv = (int)(100.*currFont[2]);164 int blue = (int)(100.*fontColor[2]);
144 ui->Red->setValue(Rv);165 ui->redSlider->setValue(red);
145 ui->Green->setValue(Gv);166 ui->greenSlider->setValue(green);
146 ui->Blue->setValue(Bv);167 ui->blueSlider->setValue(blue);
147 ui->fontSize->setValue(GETSTELMODULE(Observability)->getFontSize());168
148 int SAlti = GETSTELMODULE(Observability)->getSunAltitude();169 ui->fontSize->setValue(plugin->getFontSize());
149 ui->SunAltitude->setValue(SAlti);170 int sunAltitude = plugin->getTwilightAltitude();
150 ui->AltiText->setText(QString("%1 -%2 %3").arg(q_("Sun altitude at twilight:")).arg(SAlti).arg(q_("deg.")));171 ui->sunAltitudeSlider->setValue(sunAltitude);
151172 updateAltitudeLabel(sunAltitude);
152 SAlti = GETSTELMODULE(Observability)->getHorizAltitude();173 int horizonAltitude = plugin->getHorizonAltitude();
153 ui->HorizAltitude->setValue(SAlti);174 ui->horizonAltitudeSlider->setValue(horizonAltitude);
154 ui->HorizText->setText(QString("%1 %2 %3").arg(q_("Horizon altitude:")).arg(SAlti).arg(q_("deg.")));175 updateHorizonLabel(horizonAltitude);
155176}
156}177
157178void ObservabilityDialog::setColor()
158void ObservabilityDialog::saveSettings(void)179{
159{180 int red = ui->redSlider->value();
160 GETSTELMODULE(Observability)->saveSettingsToConfig();181 int green = ui->greenSlider->value();
161}182 int blue = ui->blueSlider->value();
162183
163void ObservabilityDialog::setTodayFlag(int checkState)184 float fRed = (float)(red) / 100.;
164{185 float fGreen = (float)(green) / 100.;
165 bool b = checkState != Qt::Unchecked;186 float fBlue = (float)(blue) / 100.;
166 GETSTELMODULE(Observability)->setShow(1,b);187
167}188 Vec3f color(fRed, fGreen, fBlue);
168189 GETSTELMODULE(Observability)->setFontColor(color);
169void ObservabilityDialog::setAcroCosFlag(int checkState)190}
170{191
171 bool b = checkState != Qt::Unchecked;192void ObservabilityDialog::updateAltitudeLabel(int altitude)
172 GETSTELMODULE(Observability)->setShow(2,b);193{
173}194 // This allows translators to use their own conventions for degree signs.
174195 ui->sunAltitudeLabel->setText(q_("Sun altitude at twilight: %1 deg.").arg(altitude));
175void ObservabilityDialog::setGoodDatesFlag(int checkState)196}
176{197
177 bool b = checkState != Qt::Unchecked;198void ObservabilityDialog::updateHorizonLabel(int horizon)
178 GETSTELMODULE(Observability)->setShow(3,b);199{
179}200 // This allows translators to use their own conventions for degree signs.
180201 ui->horizonAltitudeLabel->setText(q_("Horizon altitude: %1 deg.").arg(horizon));
181void ObservabilityDialog::setOppositionFlag(int checkState)
182{
183 bool b = checkState != Qt::Unchecked;
184 GETSTELMODULE(Observability)->setShow(4,b);
185}
186
187void ObservabilityDialog::setFullMoonFlag(int checkState)
188{
189 bool b = checkState != Qt::Unchecked;
190 GETSTELMODULE(Observability)->setShow(5,b);
191}
192
193//void ObservabilityDialog::setCrescentMoonFlag(int checkState)
194//{
195// bool b = checkState != Qt::Unchecked;
196// GETSTELMODULE(Observability)->setShow(6,b);
197//}
198
199//void ObservabilityDialog::setSuperMoonFlag(int checkState)
200//{
201// bool b = checkState != Qt::Unchecked;
202// GETSTELMODULE(Observability)->setShow(7,b);
203//}
204
205void ObservabilityDialog::setRed(int Value)
206{
207 GETSTELMODULE(Observability)->setFontColor(0,Value);
208}
209
210void ObservabilityDialog::setGreen(int Value)
211{
212 GETSTELMODULE(Observability)->setFontColor(1,Value);
213}
214
215void ObservabilityDialog::setBlue(int Value)
216{
217 GETSTELMODULE(Observability)->setFontColor(2,Value);
218}
219
220void ObservabilityDialog::setSize(int Value)
221{
222 GETSTELMODULE(Observability)->setFontSize(Value);
223}
224
225void ObservabilityDialog::setAltitude(int Value)
226{
227 ui->AltiText->setText(QString("%1 -%2 %3").arg(q_("Sun altitude at twilight:")).arg(Value).arg(q_("deg.")));
228 GETSTELMODULE(Observability)->setSunAltitude(Value);
229}
230
231
232void ObservabilityDialog::setHorizon(int Value)
233{
234 ui->HorizText->setText(QString("%1 %2 %3").arg(q_("Horizon altitude:")).arg(Value).arg(q_("deg.")));
235 GETSTELMODULE(Observability)->setHorizAltitude(Value);
236}202}
237203
238204
239205
=== modified file 'plugins/Observability/src/gui/ObservabilityDialog.hpp'
--- plugins/Observability/src/gui/ObservabilityDialog.hpp 2013-01-17 13:17:38 +0000
+++ plugins/Observability/src/gui/ObservabilityDialog.hpp 2014-04-04 19:38:38 +0000
@@ -27,6 +27,8 @@
2727
28class Ui_ObservabilityDialog;28class Ui_ObservabilityDialog;
2929
30//! Configuration window of the %Observability Analysis plug-in.
31//! @see Observability
30class ObservabilityDialog : public StelDialog32class ObservabilityDialog : public StelDialog
31{33{
32 Q_OBJECT34 Q_OBJECT
@@ -43,28 +45,18 @@
43 void retranslate();45 void retranslate();
4446
45private slots:47private slots:
46 void setTodayFlag(int);
The diff has been truncated for viewing.