Menu

#451 Macroexecutor clear all input parameters when empty string parameter is deselected

Jan16
resolved
None
sardana-widgets
bug
2016-04-07
2016-04-04
Ludvig K
No

Macroexecutor clear all input parameters when empty string parameter is deselected.

I believe it occurs beacause the macro is translated to spockcommand and
the one line spock command has one parameter too little and when it is validated it clears all the parameters.

Steps for reproduction

  1. Start macroexecutor
  2. Select macro defmeas
  3. Enter ABCD in name input
  4. Click on #1 channel.
  5. Click on ABCD
  6. Here you see the bug: ABCD will be replaced by "None".

This bug also occurs for other macros with string parameters, e.g. fscan.

Workaround

As a workaround I decided to look at dataChanged and when a parameter is "" replace it with the parameter default value.
I think to really solve the bug one would have to refactor the validation methods. See workaround in attached diff.

1 Attachments

Related

OLD Tickets: #456

Discussion

  • Zbigniew Reszela

    • status: waiting --> active
    • assigned_to: Zbigniew Reszela
    • Milestone: unassigned --> Jan16
     
  • Zbigniew Reszela

    • status: active --> resolved
     
  • Zbigniew Reszela

    Ludvig, many thanks for your contribution, now it forms part of develop brach.
    It definitelly improves the current behavior, but we still need to provide a way to execute macros with parameters set to empty strings and strings containing white spaces. I've just checked it and in spock it is possible using quotes "".

    I agree with you that the validation require refactoring. I will create a feature-request for that.

    To facilitate the integration work in the future, please take a look on how to prepare patches using git format-patch [git-recipes].

     

    Related

    Wiki: git-recipes