sardana-org / sardana

Moved to GitLab: https://gitlab.com/sardana-org/sardana
39 stars 51 forks source link

Annoying debug message in Spock #378

Open cmft opened 7 years ago

cmft commented 7 years ago

If in a consoles I have spock running and in other I have the SardanaEditor for edit/create a Macro.

When you save and apply the changes in the editor, the next message is showing in Spock.

Door_cfalcon_1 [2]: TaurusTP.W001  DEBUG    2016-12-02 08:43:10,071 TaurusRootLogger: TangoAttrValue{'wvalue': None, '_attrRef': , 'rvalue': ('json', '{"new":[{"result":[],"name":"benchmac2","parent":"mywm","file_name":"mywm.py","interfaces":["MacroFunction","Function","Object","MacroServerObject","MacroCode"],"macro_server":"MS_cfalcon_1","id":0,"parameters":[{"default_value":null,"description":"Macro to benchmark","min":1,"max":null,"type":"String","name":"macro"}],"manager":"MS_cfalcon_1","module":"mywm","full_name":"mywm.benchmac2","path":"/home/cfalcon/tools/mis_macros","hints":null,"type":"MacroFunction","file_path":"/home/cfalcon/tools/mis_macros/mywm.py","description":""}],"del":[],"change":[{"elements":["mywa","_mywm","benchmac2","benchmac"],"name":"mywm","parent":"MS_cfalcon_1","file_name":"mywm.py","interfaces":["MacroServerObject","MacroLibrary","Library","Object"],"macro_server":"MS_cfalcon_1","file_path":"/home/cfalcon/tools/mis_macros/mywm.py","exc_summary":null,"manager":"MS_cfalcon_1","module":"mywm","full_name":"/home/cfalcon/tools/mis_macros/mywm.pyc","exc_info":null,"path":"/home/cfalcon/tools/mis_macros","type":"MacroLibrary","id":0,"description":"mywm in error!"},{"result":[],"name":"mywa","parent":"mywm","file_name":"mywm.py","interfaces":["MacroClass","MacroCode","Class","MacroServerObject","Object"],"macro_server":"MS_cfalcon_1","id":0,"parameters":[{"default_value":".*","description":"a regular expression filter","min":0,"max":1,"type":[{"default_value":".*","description":"a regular expression filter","min":1,"max":null,"type":"String","name":"filter"}],"name":"filter"}],"manager":"MS_cfalcon_1","module":"mywm","full_name":"mywm.mywa","path":"/home/cfalcon/tools/mis_macros","hints":{},"type":"MacroClass","file_path":"/home/cfalcon/tools/mis_macros/mywm.py","description":"Show all motor positions"},{"result":[],"name":"benchmac","parent":"mywm","file_name":"mywm.py","interfaces":["MacroFunction","Function","Object","MacroServerObject","MacroCode"],"macro_server":"MS_cfalcon_1","id":0,"parameters":[{"default_value":null,"description":"Macro to benchmark","min":1,"max":null,"type":"String","name":"macro"}],"manager":"MS_cfalcon_1","module":"mywm","full_name":"mywm.benchmac","path":"/home/cfalcon/tools/mis_macros","hints":null,"type":"MacroFunction","file_path":"/home/cfalcon/tools/mis_macros/mywm.py","description":""},{"result":[],"name":"_mywm","parent":"mywm","file_name":"mywm.py","interfaces":["MacroClass","MacroCode","Class","MacroServerObject","Object"],"macro_server":"MS_cfalcon_1","id":0,"parameters":[{"default_value":null,"description":"List of motor to show","min":1,"max":null,"type":[{"default_value":null,"description":"Motor to move","min":1,"max":null,"type":"Moveable","name":"motor"}],"name":"motor_list"}],"manager":"MS_cfalcon_1","module":"mywm","full_name":"mywm._mywm","path":"/home/cfalcon/tools/mis_macros","hints":{},"type":"MacroClass","file_path":"/home/cfalcon/tools/mis_macros/mywm.py","description":"Show motor positions"}]}'), '_pytango_dev_attr': DeviceAttribute(data_format = tango._tango.AttrDataFormat.SCALAR, dim_x = 1, dim_y = 0, has_failed = False, is_empty = False, name = 'elements', nb_read = 1, nb_written = 0, quality = tango._tango.AttrQuality.ATTR_VALID, r_dimension = AttributeDimension(dim_x = 1, dim_y = 0), time = TimeVal(tv_nsec = 0, tv_sec = 1480664590, tv_usec = 64285), type = tango._tango.CmdArgType.DevEncoded, value = ('json', '{"new":[{"result":[],"name":"benchmac2","parent":"mywm","file_name":"mywm.py","interfaces":["MacroFunction","Function","Object","MacroServerObject","MacroCode"],"macro_server":"MS_cfalcon_1","id":0,"parameters":[{"default_value":null,"description":"Macro to benchmark","min":1,"max":null,"type":"String","name":"macro"}],"manager":"MS_cfalcon_1","module":"mywm","full_name":"mywm.benchmac2","path":"/home/cfalcon/tools/mis_macros","hints":null,"type":"MacroFunction","file_path":"/home/cfalcon/tools/mis_macros/mywm.py","description":""}],"del":[],"change":[{"elements":["mywa","_mywm","benchmac2","benchmac"],"name":"mywm","parent":"MS_cfalcon_1","file_name":"mywm.py","interfaces":["MacroServerObject","MacroLibrary","Library","Object"],"macro_server":"MS_cfalcon_1","file_path":"/home/cfalcon/tools/mis_macros/mywm.py","exc_summary":null,"manager":"MS_cfalcon_1","module":"mywm","full_name":"/home/cfalcon/tools/mis_macros/mywm.pyc","exc_info":null,"path":"/home/cfalcon/tools/mis_macros","type":"MacroLibrary","id":0,"description":"mywm in error!"},{"result":[],"name":"mywa","parent":"mywm","file_name":"mywm.py","interfaces":["MacroClass","MacroCode","Class","MacroServerObject","Object"],"macro_server":"MS_cfalcon_1","id":0,"parameters":[{"default_value":".*","description":"a regular expression filter","min":0,"max":1,"type":[{"default_value":".*","description":"a regular expression filter","min":1,"max":null,"type":"String","name":"filter"}],"name":"filter"}],"manager":"MS_cfalcon_1","module":"mywm","full_name":"mywm.mywa","path":"/home/cfalcon/tools/mis_macros","hints":{},"type":"MacroClass","file_path":"/home/cfalcon/tools/mis_macros/mywm.py","description":"Show all motor positions"},{"result":[],"name":"benchmac","parent":"mywm","file_name":"mywm.py","interfaces":["MacroFunction","Function","Object","MacroServerObject","MacroCode"],"macro_server":"MS_cfalcon_1","id":0,"parameters":[{"default_value":null,"description":"Macro to benchmark","min":1,"max":null,"type":"String","name":"macro"}],"manager":"MS_cfalcon_1","module":"mywm","full_name":"mywm.benchmac","path":"/home/cfalcon/tools/mis_macros","hints":null,"type":"MacroFunction","file_path":"/home/cfalcon/tools/mis_macros/mywm.py","description":""},{"result":[],"name":"_mywm","parent":"mywm","file_name":"mywm.py","interfaces":["MacroClass","MacroCode","Class","MacroServerObject","Object"],"macro_server":"MS_cfalcon_1","id":0,"parameters":[{"default_value":null,"description":"List of motor to show","min":1,"max":null,"type":[{"default_value":null,"description":"Motor to move","min":1,"max":null,"type":"Moveable","name":"motor"}],"name":"motor_list"}],"manager":"MS_cfalcon_1","module":"mywm","full_name":"mywm._mywm","path":"/home/cfalcon/tools/mis_macros","hints":{},"type":"MacroClass","file_path":"/home/cfalcon/tools/mis_macros/mywm.py","description":"Show motor positions"}]}'), w_dim_x = 0, w_dim_y = 0, w_dimension = AttributeDimension(dim_x = 0, dim_y = 0), w_value = None), 'time': TimeVal(tv_nsec = 0, tv_sec = 1480664590, tv_usec = 64285), 'error': None, 'config': , 'quality': }
maxborn commented 6 years ago

Hi Carlos, I don't have an answer for this, but a question. I'm a new Sardana user, and could use some advice. You mentioned the SardanaEditor. I recently installed Sardana and couldn't find the editor, althoug is listed in the manual (http://www.taurus-scada.org/en/3.7.3/users/ui/sardanaeditor.html). Is that what you meant? Is there any way to install it? Thanks for taking the time to help, M.

cmft commented 6 years ago

Hi @maxborn , Welcome to the community.

(http://www.taurus-scada.org/en/3.7.3/users/ui/sardanaeditor.html).

Yes, it is. But now, it is part of Sardana, so I recomend you to looking for in the Sardana doc. It is more updated but the editor still not documented.

The editor is included with sardana code but is launcher was not migrated during the taurus and sardana split. To used you just need spider >=3 installed.

You can launch it python -m sardana.taurus.qt.qtgui.extra_sardana.sardanaeditor.py

The editor is not too much used, If you find any trouble do not hesitate to report it.

If you prefer write your macros in your favorite editor, see this tips

Hope this help you.

cpascual commented 6 years ago

If you prefer write your macros in your favorite editor, see this tips

For users who already program in python (i.e. who already have a python development environment setup) I personally would recommend using their own editor

IMHO, the Sardana editor is a legacy feature from times when good python-aware editors were less common. Nowadays, it only makes sense as a "casual" editor if you happen not to have a python devel environment at hand. I personally would even suggest to eventually drop support for it (or moving it to a second-class-citizen plugin).

maxborn commented 6 years ago

Hi Carlos, thanks for the reply. I got the editor working, and indeed is a simplify version of spider, so no real use for it these days. However, when I asked about the sardanaeditor I was thinking of what now I know it's called Sardana configuration GUI and it looks like this image (If the picture doesn't show, it's the last screenshot on this page: http://sardana-controls.org/en/latest/users/screenshots.html) Would you by any chance now anything about that configuration tool, and care sharing what you know, if it's not too much to ask, please? Thanks again for taking time to help. M.

reszelaz commented 6 years ago

Would you by any chance now anything about that configuration tool, and care sharing what you know, if it's not too much to ask, please?

This is an obsolete configuration tool. It used to work long time ago, before the Pool was migrated from C++ to Python, but since it was written in Java and we are strongly committed to Python we decided to not maintain it. To be honest, currently there is no such a complete configuration tool for Sardana. We have a set of macros that could be used to configure your system:

The ones that you could start with are:

Another alternative could be to use these “unofficial” tools. Personally, I used them some time ago and they worked fine.

In any case, the best would be to ask here on GitHub if you find any problems or something is not clear. We would be very glad to help you.

reszelaz commented 6 years ago

I got the editor working, and indeed is a simplify version of spider, so no real use for it these days.

Personally, I see the following benefits of the sardana editor:

As far as I know, this widget was never really used in the production environment so there was no so much effort put in order to complete its functionalities. Also, there are some other ideas on how to make it more attractive e.g. automatic versioning and an easy way of jumping between different versions (related to #566).

One could use the following argument in favor of eliminating the sardanaeditor: to encourage users to use the edmac tool, which BTW I think has currently the same limitations as the sardanaeditor. But this solution only works for spock (CLI), since it is implemented as the ipython’s magic command. IMHO the sardanaeditor is a good alternative for users who prefer the GUI solutions over the CLI.

maxborn commented 6 years ago

HI Carlos, thanks for taking time to help. I will follow your recommendations, including using the Sardana editor, and post to the forum next if I need help. Thanks again. M.

On Tue, Nov 28, 2017 at 9:34 AM, reszelaz notifications@github.com wrote:

I got the editor working, and indeed is a simplify version of spider, so no real use for it these days.

Personally, I see the following benefits of the sardana editor:

  • automatic apply of the code on the server (currently only implemented for the macros) on the file save
  • loading a template to the file for the new plugin being added to the system (currently working properly only for the macro functions)
  • explorer tool for navigating over all plugins present in the system (currently only implemented for the macros)

As far as I know, this widget was never really used in the production environment so there was no so much effort put in order to complete its functionalities. Also, there are some other ideas on how to make it more attractive e.g. automatic versioning and an easy way of jumping between different versions (related to #566 https://github.com/sardana-org/sardana/issues/566).

One could use the following argument in favor of eliminating the sardanaeditor: to encourage users to use the edmac tool, which BTW I think has currently the same limitations as the sardanaeditor. But this solution only works for spock (CLI), since it is implemented as the ipython’s magic command. IMHO the sardanaeditor is a good alternative for users who prefer the GUI solutions over the CLI.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sardana-org/sardana/issues/378#issuecomment-347561511, or mute the thread https://github.com/notifications/unsubscribe-auth/AZ6ndVu1QmlAVBHTSQ9XdEy8sjtQ24Evks5s7CgJgaJpZM4LCSeu .