PSU-CSAR / vb-bagis

Source code for BAGIS V3 ESRI Add-In
0 stars 1 forks source link

Elev-Precip Correlation Tool - GUI enable/disable logic for aggregate by zone layer option #33

Closed jdduh closed 7 years ago

jdduh commented 7 years ago

When a new Aggregate layer is specified, the Table and Maps buttons should be disabled and the 4. Generate Zones button should be enabled. This forces users to regenerate zones layers and is required for the zone layer aggregation to work correctly.

lbross commented 7 years ago

Should the aforementioned buttons also be disabled/enabled when the Aggregate layer is removed? When a new partition layer is specified/removed?

jdduh commented 7 years ago

If 4. Generate Zones is a required step, then please disable Tables and Maps buttons and enable the 4. Generate Zones button. What will happen if users reselected the same Aggregate Layer that is already used in 4. Generate Zones (i.e., the aggzone_ layer exists)? How about prompting a warning message when users click on the Clear button? The message would read "Click 4. Generate Zones button to apply the change or close and reopen the dialog window to cancel the change."

lbross commented 7 years ago
  1. Generate Zones is a required step if the user makes any changes to the Aggregate or Partition layer. The table and feature class that are used to create the Excel tables are generated at that time. Given our lack of sophistication in keeping track of the state of the Aggregate/Partition layers ie: no log file, I think we should keep it simple and not try to keep track if it is a layer that was already used. I am fine prompting a warning message when they click on the Clear button.

Do we want to handle the partition and the aggregate layers the same? Your response didn't address the partition layer.

jdduh commented 7 years ago

The behavior of the partition layer and the aggregate layer is different (?). For an AOI that used a partition layer previously, when users clear the partition layer, there is no need to regenerate any GIS layer (i.e., we can keep Tables and Maps button enabled and the 4. button disabled.) Is this correct? For the aggregate layer, users need to regenerate the zones for the change to take effect.

lbross commented 7 years ago

Yes. It is different if they remove a partition layer, but if they add, we need to regenerate the GIS layer. So ... Add aggregate layer: disable Tables and Maps buttons and enable the 4. Generate Zones button Remove aggregate layer: Warn user they will need to regenerate; Disable Tables and Maps buttons and enable the 4. Generate Zones button if they continue Add partition layer: disable Tables and Maps buttons and enable the 4. Generate Zones button Remove partition layer: No GUI button changes or warnings

Does that cover it?

lbross commented 7 years ago

I just realized that we probably shouldn't have a clear button for the aggregate layer. The user effectively clears the aggregate layer if they choose to aggregate by PRISM cells. This would also be the case if they used the 'select' button and then cancelled without picking a layer. Thoughts?

lbross commented 7 years ago

When looking at the code, I found that I had the clear button for the zonal aggregate layer wired incorrectly because I was using it for debugging purposes :-( I fixed this and am enabling the generate, tables, and maps buttons as you requested. It's tricky because I don't want to enable the generate button out-of-turn but I think it is working.

I posted a new release of vb-bagis to the release page but didn't change the version number. You can tell you have the new one because there is no 'clear' button for the aggregate zones layer. If you switch to aggregate by prism cells, it clears out the zones layer. Please test.