Stellarium / stellarium

Stellarium is a free GPL software which renders realistic skies in real time with OpenGL. It is available for Linux/Unix, Windows and macOS. With Stellarium, you really see what you can see with your eyes, binoculars or a small telescope.
https://stellarium.org
GNU General Public License v2.0
7.81k stars 825 forks source link

Equatorial mode is not saved #505

Closed spud1259 closed 6 years ago

spud1259 commented 6 years ago

Equatorial mode (equatorial mount or azimuthal mount) is not saved.

Expected Behaviour

If I set Stellarium to display equatorial mode (ctrl-M) and save the settings I expect Stellarium to be in equitorial mode the next time I start Stellarium.

Actual Behaviour

Describe or maybe attach a screenshot? Stellarium starts in azimuthal mode after I have changed to equatorial mode and saved the settings.

Steps to reproduce

Select equatorial mode. Select "save view" and "save settings" in the configuration menu [f2].

System

Ubuntu

Logfile

If possible, attach the logfile log.txt from your user data directory. Look into the Guide for its location. 2018-10-13T15:59:30 Operating System: Linux version 4.15.0-36-generic (buildd@lgw01-amd64-031) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018 Product Name: Ubuntu 18.04.1 LTS Compiled using GCC 7.3.0 Qt runtime version: 5.9.5 Qt compilation version: 5.9.4 Addressing mode: 64-bit MemTotal: 8168260 kB MemFree: 3577180 kB MemAvailable: 5485832 kB SwapTotal: 4191228 kB model name : AMD Athlon(tm) II X3 435 Processor cpu MHz : 1700.000 model name : AMD Athlon(tm) II X3 435 Processor cpu MHz : 2900.000 model name : AMD Athlon(tm) II X3 435 Processor cpu MHz : 1700.000 01:00.0 VGA compatible controller: NVIDIA Corporation G98 [GeForce 8400 GS Rev. 2] (rev a1) (prog-if 00 [VGA controller]) Kernel driver in use: nvidia Kernel modules: nvidiafb, nouveau, nvidia /usr/bin/stellarium

alex-w commented 6 years ago

Cannot reproduce on the master - it works as expected

spud1259 commented 6 years ago

Cannot reproduce on the master - it works as expected What setting in the config.ini does the mode use?

alex-w commented 6 years ago

navigation/viewing_mode = equator

I've tried saving it through GUI - without problem

spud1259 commented 6 years ago

Hi, let me rephrase that. Here's a grep of mode from config.ini

realistic_mode_enabled = false extinction_mode_below_horizon = mirror flag_use_obj_models = false day_key_mode = calendar flag_indication_mount_mode = false startup_time_mode = actual viewing_mode = equator Here's a grep of equatorial from config.ini equatorial_J2000_color = 0.1,0.3,0.4 equatorial_color = 0.4,0.4,0.4 flag_equatorial_J2000_grid = false flag_equatorial_grid = false

Please tell me which settings line changes when you test saving the mode (eq or az).

alex-w commented 6 years ago

viewing_mode = equator|horizon

spud1259 commented 6 years ago

Thank you. I need to amend my bug report. It's being saved properly, but it's not being read and set when I start stellarium. The viewing_mode is equator in config.ini, but when I start stellarium it starts in horizon mode.

alex-w commented 6 years ago

Please enable equatorial grid and show screenshot

spud1259 commented 6 years ago

Ok, I started stellarium with viewing_mode set to equator then I pressed "e" and moused over lower screen to show active settings.

stell

alex-w commented 6 years ago

Hmm... please show your ~/.stellarium/config.ini

spud1259 commented 6 years ago

It would let me drag/drop an ini file, so I renamed config.ini to config.txt

config.txt

alex-w commented 6 years ago

Maybe the issue was in version 0.18.0...

Could you update Stellarium to version 0.18.2 and check it again?

sudo add-apt-repository ppa:stellarium/stellarium-releases
sudo apt-get update
spud1259 commented 6 years ago

Yes, I will do that. Thank you for your help. I'll post an update when I've updated to 0.18.2 and tested it.

spud1259 commented 6 years ago

Hi, I've upgraded to 0.18.2 and still have the same problem. spud1259@kbun1804:~$ sudo apt list | grep stellarium stellarium/bionic,now 0.18.2-1ubuntu1~ppa1~ubuntu18.04.1 amd64 [installed] stellarium-data/bionic,bionic,now 0.18.2-1ubuntu1~ppa1~ubuntu18.04.1 all [installed,automatic]

config.txt stell-02

alex-w commented 6 years ago

I've used your config.ini and startup Stellarium 0.18.2 at my Ubuntu - without problem.

Any errors or warnings in log.txt?

spud1259 commented 6 years ago

Okay, but I'm clueless why this is happening. I've got to leave for the day, but I'll look into this some more tonight, and tomorrow, to see if I can "get a clue."

Thanks for all your help!!

gzotti commented 6 years ago

I can confirm the issue (Win10), but don't see an obvious solution within minutes. Will also investigate.

spud1259 commented 6 years ago

Hi, I missed the line "any errors in log.txt" === begin paste === Creating GUI ... Loaded plugin "Oculars" Ocular plugin - press Command-O to toggle eyepiece view mode. Press ALT-o for configuration. Oculars::validateIniFile ocular.ini exists at: "/h2/dmac/.stellarium/modules/Oculars/ocular.ini" . Checking version... Oculars::validateIniFile found existing ini file version 3.1 Loaded plugin "Satellites" [Satellites] loading catalog file: "/h2/dmac/.stellarium/modules/Satellites/satellites.json" Satellite has invalid orbit: "IRIDIUM 15" "24869" Satellite has invalid orbit: "IRIDIUM 56" "25170" Dubious result: Landscape "Guereins" not calibrated. Opacity test represents mathematical horizon only. Unloaded plugin "Satellites" Unloaded plugin "Oculars" Downloaded 0 files (0 kbytes) in a session of 164.933 sec (average of 0 kB/s + 0 files from cache (0 kB)). LandscapeMgr: Clearing cache of 0 landscapes totalling about 0 MB. === end paste === I don't know if the line below means anyhting: Dubious result: Landscape "Guereins" not calibrated. ### Opacity test represents mathematical horizon only.

Here's my full log.txt log.txt

gzotti commented 6 years ago

This error is not relevant in the context. Just that the default Guereins landscape is lacking proper altitude calibration (photos adjusted by guesstimate?), and I cannot fix that without measurements.

alex-w commented 6 years ago

Georg, are you really can reproduce the issue? Any warnings in the log or something else?

gzotti commented 6 years ago

Yes, I see this issue. I have viewing_mode = equator but the view starts in azimuth mode. And I really don't see yet how this can happen. No log entries. But I cannot investigate further today.

alex-w commented 6 years ago

Georg, could you share your config.ini?

gzotti commented 6 years ago

I renamed my previous config.ini to create a new from default. Then switched to equatorial mode, moved view (see inclined horizon). Stored view and settings. Relaunched Stellarium. Azimuth mode. Here is this almost default config.ini (renamed for uploading here). Stored configuration: equator.

config.ini.txt

alex-w commented 6 years ago

Fun, I cannot reproduce the issue on my linux.

gzotti commented 6 years ago

I can try on Ubuntu, tonight or so.

spud1259 commented 6 years ago

Hi, I tried it on a second kubuntu 18.04 LTS system last night with all the latest upgrades. What version of the OS are you (Alex) using? FWIW, both my kubuntu systems are using the KDE window manager.

I also tripped across another config.ini file issue. If I change the "sky and viewing/landscape" to Geneva using stellarium and then save view and save settings it doesn't change the config.ini.

If I manually edit the [init_location]landscape_name = from guereins to landscape_name = geneva and restart stellarium it will display the new background landscape.

gzotti commented 6 years ago

No, this is on purpose. There is a separate "use as default" in the landscape tab.

spud1259 commented 6 years ago

HI Georg, Okay, thanks for the reply, but it made me wonder if we're dealing with a multi-language issue and not an actuall program logic issue. For example: if a string compare fails then the default setting would be used (eqtor and not equator would have program use azimuthal). Sorry, but I'm just grasping at staws.

alex-w commented 6 years ago

The code for reading value of _navigation/viewingmode option:

// we must set mount mode before potentially loading zenith views etc.
QString tmpstr = conf->value("navigation/viewing_mode", "horizon").toString();
if (tmpstr=="equator")
    setMountMode(StelMovementMgr::MountEquinoxEquatorial);
else
{
    if (tmpstr=="horizon")
        setMountMode(StelMovementMgr::MountAltAzimuthal);
    else
    {
        qWarning() << "ERROR: Unknown viewing mode type: " << tmpstr;
        setMountMode(StelMovementMgr::MountEquinoxEquatorial);
    }
}
gzotti commented 6 years ago

Yes. I dump this config string out into my log. Even with a bogus string, we go into the second branch, I see the warning/ERROR, but the view starts in azimuthal. Very odd.

alex-w commented 6 years ago

Georg, please check the latest commits.

gzotti commented 6 years ago

Does not change a thing.

I have finally found the trigger, though, in the block below:

addAction("actionSwitch_Equatorial_Mount", ...

I commented this out, and it just started in equatorial mode. Further investigation required.

spud1259 commented 6 years ago

Hi, I don't know how to fix it, but I can now explain what's happening. It took a while, but I grabbed the source and built it. I put a debug printout in StelMovementMgr.cpp void StelMovementMgr::setEquatorialMount(bool b) { // spud if (b) qWarning() << "SPUD:set mount EQ"; else qWarning() << "SPUD: set mount AZ";

Then I started stellarium. Here's cut/paste from the log Loaded plugin "Oculars" [StelPropertyMgr] Registering object "Oculars" Ocular plugin - press Command-O to toggle eyepiece view mode. Press ALT-o for configuration. Oculars::validateIniFile ocular.ini exists at: "/h2/dmac/.stellarium/modules/Oculars/ocular.ini" . Checking version... Oculars::validateIniFile found existing ini file version 3.1 SPUD: set mount AZ Loaded plugin "Satellites" [StelPropertyMgr] Registering object "Satellites" [Satellites] loading catalog file: "/h2/dmac/.stellarium/modules/Satellites/satellites.json" Initializing planets GL shaders... Unloaded plugin "Satellites" Unloaded plugin "Oculars"

In the configure oculars popup there's a checkbox for "Enable automatic switch of mount type." When this is not set the and the oclulars are loaded from the ini file, the code forces view mode to AZ. When this is checked, stellarium starts in EQ mode.

I hope this helps.

spud1259 commented 6 years ago

One last note: switching the view mode based on the telescope mount type is where the bug is located. Here's a stack trace of the offending call (see stack frame #6). stack-trace.txt

gzotti commented 6 years ago

Yes, I confirm there is no problem if oculars plugin is not loaded, and indeed there is some code which switches the respective property.

The current solution about mount mode is a bit hackish, we are using a Boolean property to track something which can actually have more than 2 values. Apparently at some point the propagation fails.

spud1259 commented 6 years ago

== begin paste == The current solution about mount mode is a bit hackish, we are using a Boolean property to track something which can actually have more than 2 values. Apparently at some point the propagation fails. == end paste == There are two issues. One is an outright bug and the other is a policy (or how to do something) issue. The bug is shown below.

`void Oculars::init() line 716 setFlagAutosetMountForCCD(settings->value("use_mount_autoset", false).toBool());

void Oculars::setFlagAutosetMountForCCD(const bool b) { flagAutosetMountForCCD = b; settings->setValue("use_mount_autoset", b); settings->sync();

if (!b)
{
    StelPropertyMgr* propMgr=StelApp::getInstance().getStelPropertyManager();
    Line 2493

=== BUG>>> propMgr->setStelPropertyValue("actionSwitch_Equatorial_Mount", equatorialMountEnabledMain); } emit flagAutosetMountForCCDChanged(b); } `

gzotti commented 6 years ago

Almost. Actually it is an error in the initialisation sequence. Almost finished, cleaning up...

spud1259 commented 6 years ago

Cool! Thank you!