documentation inconsistency?

Errors and unexpected results
Post Reply
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

documentation inconsistency?

Post by joleenf »

Hi,

In the documentation for setLayerVisible, the keyword "visible" is listed as required. So, I used

myLayer.setLayerVisible(visible=True)

which is consistent with the setLayerLabel structure. However, for setLayerVisible, this does not work. Instead, I must type

myLayer.setLayerVisible(True)

Either there is a mistake in the documentation or the command is not functioning as desired. Not sure which.

McIDAS-V 1.6 beta 1 build date 6/25/15

Thanks,
Joleen
User avatar
bobc
Posts: 988
Joined: Mon Nov 15, 2010 5:57 pm

Re: documentation inconsistency?

Post by bobc »

Hi Joleen -

Thanks for pointing this out. I looked in the Jython Library and saw that the keyword for setLayerVisible is 'status'. So, in the current nightly, you have two options:

myLayer.setLayerVisible(status=True)

or

myLayer.setLayerVisible(True)

I wrote up Inquiry 2084 to change the keyword for setLayerVisible to 'visible' instead of 'status'. This is to make it consistent with setLayerLabel and 'visible' is also more descriptive than 'status'. For now, I updated the User's Guide in the nightly to use 'status instead of 'visible'. This documentation change will appear in tomorrow's (06/26) nightly.

Thanks again -
Bob Carp
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: documentation inconsistency?

Post by joleenf »

Working in Version 1.6 beta 1 from 2015-07-10


lmaLayer=panel[0].createLayer(''Image Sequence Display', lma)
lmaLayer.setLayerLabel(visible=False) is not working, the label still appears. Am I using setLayerLabel incorrectly?

Thanks,
Joleen
User avatar
bobc
Posts: 988
Joined: Mon Nov 15, 2010 5:57 pm

Re: documentation inconsistency?

Post by bobc »

Hi Joleen -

I just tested this on a Windows 7 machine using today's nightly (07/15) and an OS X machine using yesterday's nightly (07/14) and it looks like you are using setLayerLabel correctly. Simply doing ImaLayer.setLayerLabel(visible=False) should turn off the layer label.

I don't think anything has changed since 07/10 that would affect the way setLayerLabel works so there's likely no need to update your nightly.

Can you please post your full script? Maybe something else is going on that is causing setLayerLabel to not work as expected.

Thanks -
Bob
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: documentation inconsistency?

Post by joleenf »

Hi Bob,

The script is attached, data is at

ftp://ftp.ssec.wisc.edu/pub/ssec/joleenf/

plot_vis_lma_ot.py
(3.6 KiB) Downloaded 321 times


Thanks,
Joleen
User avatar
bobc
Posts: 988
Joined: Mon Nov 15, 2010 5:57 pm

Re: documentation inconsistency?

Post by bobc »

Hi Joleen -

I'm having some trouble running your script. I noticed that the vis and lma AREAs you put on ftp are for different times:

vis: 2014-05-21 23:30:00Z -> 23:39:00Z
lma: 2014-05-21 22:30:00Z -> 22:39:00Z

Do these datasets need to have the same times to get the loadADDEImage calls to work?

Thanks -
Bob
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: documentation inconsistency?

Post by joleenf »

Bob,

I updated the visible areas.

Joleen
User avatar
bobc
Posts: 988
Joined: Mon Nov 15, 2010 5:57 pm

Re: documentation inconsistency?

Post by bobc »

Hi Joleen -

Thanks for the files. I'm replicating what you are seeing. The issue here is that there are multiple layers in the display. How setLayerLabel works right now is that most of the keywords (including visible, font, style, size, and color) are set as properties of the panel as a whole instead of individual layers. In your script, you are setting the layer label off for the lmaLayer and then setting the layer label for visLayer. When the visLayer layer label is set, the visible keyword is set to 'True' by default, which toggles the ImaLayer layer label back on.

I wrote up Inquiry 2108 to cover making setLayerLabel set the properties of an individual layer instead of the panel as a whole.

For now, you can use a workaround of setShowInDisplayList. For example, to turn off the layer label of lmaLayer, instead of:

Code: Select all

lmaLayer.setLayerLabel(visible=False)

use...

Code: Select all

lmaLayer.setShowInDisplayList(False)

Another thing to note, after the point data gets added to the display, there's an empty layer label that has a '.' as a placeholder. This causes the visLayer layer label to be shifted up from the bottom of the display. You can use the same setShowInDisplayList function for this layerOT as well to make layer label look better.

Code: Select all

layerOT.setShowInDisplayList(False)

Please let me know if you have any questions.

Thanks -
Bob
Post Reply