FlexBE / flexbe_app

The classic user interface (editor + runtime control) for the FlexBE behavior engine. See the flexbe_webui for latest
BSD 3-Clause "New" or "Revised" License
48 stars 49 forks source link

State parameter pre-defined options imported incorrectly #65

Closed tcassell94 closed 3 years ago

tcassell94 commented 4 years ago

If you set some pre-defined options for parameter values (such as in this example state), they are accessed incorrectly in the behavior containing the state.

IE, the state itself would be imported as from flexbe_states_package.state_name import StateName in the behavior_name_sm.py file. But then the state's default parameters are accessed as flexbe_states_package.StateName.DefaultParameterName.

I think the fix is to just access the default parameters as StateName.DefaultParameterName.

tcassell94 commented 4 years ago

It's caused by the value of the default parameter being set in the FlexBE App as package_name.StateName.DefaultParameterName when you click your desired parameter value from the drop-down options. So I guess when you click the drop down the parameter should be set to StateName.DefaultParameterName.

pschillinger commented 4 years ago

This actually depends on whether the state class name is a duplicate in the workspace or if the respective setting is enabled to consider the state package in addition to the class in general. Still, the completion you pointed out is incorrect in both cases.

The above commit fixes it for both of them.