RoboJackets / robocup-software

Georgia Tech RoboJackets Software for the RoboCup Small Size League
Apache License 2.0
178 stars 187 forks source link

Add the ability to have text layers in soccer default to hidden #307

Closed justbuchanan closed 9 years ago

justbuchanan commented 9 years ago

When drawing shapes or text on the soccer field view, we pass a string indicating the "layer" that these show up on. The "layers" tab has a check box for each layer to show or hide the content. Right now every layer defaults to being enabled, which can lead to a lot of unneeded debug content being drawn that clutters up our pretty soccer field view. It would be nice if we could add a way to hide some by default, then we can enable them when we're debugging specific things.

justbuchanan commented 9 years ago

cc @ashaw596

ashaw596 commented 9 years ago

Fiiiinnnneee. After the other one has been merged tho lol.

justbuchanan commented 9 years ago

Awesome! Let me know what your thoughts are on how to do this. Not sure at the moment where it would fit best.

justbuchanan commented 9 years ago

Hey @ashaw596, I'd like to use this feature when I finish #254. Do you think you'll be able to get to this soon or should I look into it?

ashaw596 commented 9 years ago

I'll take a look at it. On Jun 29, 2015 5:12 PM, "Justin Buchanan" notifications@github.com wrote:

Hey @ashaw596 https://github.com/ashaw596, I'd like to use this feature when I finish #254 https://github.com/RoboJackets/robocup-software/issues/254. Do you think you'll be able to get to this soon or should I look into it?

— Reply to this email directly or view it on GitHub https://github.com/RoboJackets/robocup-software/issues/307#issuecomment-116884739 .

ashaw596 commented 9 years ago

Ok. I've changed it to hide all layers by default to start. What exactly is the functionality that want? @justbuchanan

justbuchanan commented 9 years ago

Well there are many layers that we do want to have on by default, there are just some that are better to start off hidden. Maybe we can have a method setLayerDefaultVisibility(QString, bool), then we can call it with the appropriate layers in the constructor. We just need make a clear note of this functionality in the header.

ashaw596 commented 9 years ago

Do you know which ones we want by default. Well just have to create them when the program starts.

justbuchanan commented 9 years ago

If someone adds a new layer, I think it'd be confusing for it to be hidden when soccer runs. It'd be nice if we can just set visibility to false for the ones we know right now that we don't usually want to see.

For now, I think just the path-planning related ones like "reusing path", etc should be hidden. Another one I'd like to hide by default is the ssl-vision packet data, but I'll add that later.

ashaw596 commented 9 years ago

Well, most of them get dynamically created. So they'll need to be instantiated separately if we want different use cases. I'll make a seperate create function for the debug layers later tonight.

justbuchanan commented 9 years ago

What if we just have a map of default visibilities:

std::map<QString, bool> _defaultVisibilities;

This will only be read the first time an item is drawn to a layer - everything after that just goes by whether or not it's checked in the UI.

ashaw596 commented 9 years ago

=/ I don't know if that makes sense. I think it would be easier just to convert this to use a constructor type method. We can use a list to construct it if we want it to be easy to read.

justbuchanan commented 9 years ago

Not quite sure what you mean... What constructor are you talking about changing?

ashaw596 commented 9 years ago

Well I wanted to make it less strangely decoupled with the really weird creation mechanisms since blocking isn't terribly important since it only happens every once in a while. I refactored part of it in fieldView and Mainwindow, but gave up on the SystemState/logFrame system. I added the hiddenList String array to MainWindow.cpp.