core.selectObjectByName clearing function is not working for constellation selection

Bug #600889 reported by Jon Cluck
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stellarium
Fix Released
Medium
Matthew Gates

Bug Description

core.selectObjectByName("", false);
This should clear the currently selected object(s), but it does not do anything.

OS: Windows XP
Stellarium v0.10.5

Changed in stellarium:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Matthew Gates (matthew-porpoisehead)
Revision history for this message
Matthew Gates (matthew-porpoisehead) wrote :

This is weird. I replicated it before... now I can't replicate it on either Linux / development version or Windows Vista / version 0.10.5.

Revision history for this message
Matthew Gates (matthew-porpoisehead) wrote :

Jon Cluck: Please can you run this test script and see what it does? I expect it to zoom in on HP85927, and then the selection should toggle on and off a few times (including the selected object information).

core.clear("starchart");
core.selectObjectByName("HP85927",true);
StelMovementMgr.autoZoomIn(0.5);
core.wait(1);
core.selectObjectByName("HP85927", true);
core.wait(0.5);
core.selectObjectByName("", true);
core.wait(0.5);
core.selectObjectByName("HP85927", true);
core.wait(0.5);
core.selectObjectByName("", true);
core.wait(0.5);
core.selectObjectByName("HP85927", true);
core.wait(0.5);
core.selectObjectByName("", true);
core.wait(0.5);

Changed in stellarium:
status: Confirmed → In Progress
Revision history for this message
Jon Cluck (cluckj) wrote : Re: [Bug 600889] Re: core.selectObjectByName clearing function is not working

The script you posted works as expected, I forgot to post on the bug that it
showed up only with constellations. Try the following:

ConstellationMgr.setFlagIsolateSelected(true);
ConstellationMgr.setFlagLines(true);
core.selectObjectByName("Ursa Major",true);
core.wait(1.0);
core.selectObjectByName("", true);
core.wait(1.0);
core.selectObjectByName("Ursa Minor", true);
core.wait(1.0);
core.selectObjectByName("", true);
core.wait(1.0);

On Wed, Jul 7, 2010 at 6:49 PM, Matthew Gates <email address hidden> wrote:

> Jon Cluck: Please can you run this test script and see what it does? I
> expect it to zoom in on HP85927, and then the selection should toggle on
> and off a few times (including the selected object information).
>
> core.clear("starchart");
> core.selectObjectByName("HP85927",true);
> StelMovementMgr.autoZoomIn(0.5);
> core.wait(1);
> core.selectObjectByName("HP85927", true);
> core.wait(0.5);
> core.selectObjectByName("", true);
> core.wait(0.5);
> core.selectObjectByName("HP85927", true);
> core.wait(0.5);
> core.selectObjectByName("", true);
> core.wait(0.5);
> core.selectObjectByName("HP85927", true);
> core.wait(0.5);
> core.selectObjectByName("", true);
> core.wait(0.5);
>
>
>
> ** Changed in: stellarium
> Status: Confirmed => In Progress
>
> --
> core.selectObjectByName clearing function is not working
> https://bugs.launchpad.net/bugs/600889
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Stellarium: In Progress
>
> Bug description:
> core.selectObjectByName("", false);
> This should clear the currently selected object(s), but it does not do
> anything.
>
> OS: Windows XP
> Stellarium v0.10.5
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/stellarium/+bug/600889/+subscribe
>

summary: - core.selectObjectByName clearing function is not working
+ core.selectObjectByName clearing function is not working for
+ constellation selection
Changed in stellarium:
importance: High → Medium
Revision history for this message
Matthew Gates (matthew-porpoisehead) wrote :

I see. the

core.selectObjectByName("", true);

doesn't clear single constellation mode selections... ok. Got it :)

Revision history for this message
Matthew Gates (matthew-porpoisehead) wrote :

OK, so I think I worked out what is going on.

Firstly, de-selecting the selected object doesn't clear the isolated constellation selection. This is true both in scripting and in interactive mode. I think this behavior makes sense.

I think to clear the single selection, one should simply turn of isolated constellation mode. Currently this doesn't work quite as expected when there is an existing isolated constellation selection. Instead of clearing the current isolated constellation, it makes it so that existing isolated selection constellations are not cleared unless a non-constellation star is selected.

I feel that this behavior is wrong. When isolated constellation selection mode is turned off, isolated constellation selections should be cleared (and all constellations displayed). I will change this in the development version.

In the mean time, you can write a function which will do the clearing, and call this when you want to clear isolated constellation selections:

  function clearSingleConstellationMode() {
        var restoreValue = ConstellationMgr.getFlagIsolateSelected();
        ConstellationMgr.setFlagIsolateSelected(false);
        core.selectObjectByName("HP44504"); // this is just a star which is NOT part of a constellation line
        core.selectObjectByName("");
        ConstellationMgr.setFlagIsolateSelected(restoreValue);
  }

and then just call this when you want to clear isolated selections. Note that this will turn off isolated selection mode...

  clearSingleConstellationMode();

Changed in stellarium:
status: In Progress → Fix Committed
Changed in stellarium:
milestone: none → 0.10.6
Changed in stellarium:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.