Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using Push 1 and Push 2 at the same time #11

Open
Beennnn opened this issue Jul 8, 2017 · 1 comment
Open

Fix using Push 1 and Push 2 at the same time #11

Beennnn opened this issue Jul 8, 2017 · 1 comment

Comments

@Beennnn
Copy link

Beennnn commented Jul 8, 2017

The script uses a global parameter in global.cfg:
[Push]
Version = 2
Maybe this version could be detected automatically on the fly at init without the need to define it globally. Anybody interested ?

@Beennnn
Copy link
Author

Beennnn commented Jul 8, 2017

I made a change for this working. It consists in:

  • in Push and Push2 init files: call UbermapDevicesPatches.apply_ubermap_patches with one boolean parameter, True for Push and False for Push2
  • in UbermapDevicesPaches
    • add the parameter to the apply_ubermap_patches method and transmit it to the apply_device_component_patches method
    • add the parameter to the apply_device_component_patches method
    • rewrite it like this:
def apply_device_component_patches(is_v1):
    _get_provided_parameters_orig = DeviceComponent._get_provided_parameters
    if is_v1:
        from Push.parameter_mapping_sensitivities import parameter_mapping_sensitivity, fine_grain_parameter_mapping_sensitivity
    else:
        from Push2.parameter_mapping_sensitivities import parameter_mapping_sensitivity, fine_grain_parameter_mapping_sensitivity
    def _get_parameter_info(self, parameter):
        if not parameter:
            return None
        return ParameterInfo(parameter=parameter, name=parameter.custom_name, default_encoder_sensitivity=parameter_mapping_sensitivity(parameter), fine_grain_encoder_sensitivity=fine_grain_parameter_mapping_sensitivity(parameter))

Note : it also fixes compatibility with live version 9.7.1

@Beennnn Beennnn changed the title Push 1 and Push 2 at the same time : need to update code Fix using Push 1 and Push 2 at the same time Jul 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant