tango-controls / jive

Jive is a standalone JAVA application designed to browse and edit the static TANGO database. jive moved to https://gitlab.com/tango-controls/jive
10 stars 6 forks source link

how to create a device alias? #53

Closed PhilLAL closed 6 years ago

PhilLAL commented 6 years ago

Hi, I would like to create an alias to access a device through a tool which does not accept dot character.

I red https://tango-controls.readthedocs.io/en/latest/development/general-guidelines/naming.html#device-and-attribute-name-alias and https://github.com/tango-controls/tango-webapp/issues/104. I understand well this last ticket is not jive doc but waltz doc (formerly webapp). However, it is the only way I found to add an alias so I hoped it should give it a try with jive.

Just in case, here is the steps I followed :

sys/database/2/DbPutDeviceAlias :
insufficient alias info fo device

Error:
---
Stack
+ DB_IncorrectArguments
  + Severity - ERROR
  + Origin - Database::db_put_device_alias()
  + Description - insufficient alias info for device
  + Reason - DB_incorrectArguments
+ TangoApi_CANNOT_EXECUTE_COMMAND
  + Severity - PANIC
  + Origin - Connection.command_inout()
  + Description - CAnnot execute command DbPutDeviceAlias on sys/database/2
  + Reason - TangoApu_CANNOT_EXECUTE_COMMAND
---

Trace:
---
fr.esrf.TangoApi.ConnectionFailed
 at
fr.esrf.TangoDs.Except.throw_connection_failed(Except.java:616)
fr.esrf.TangoDs.Except.throw_connection_failed(Except.java:569)
fr.esrf.TangoApi.ConnectionDAODefaultImpl.command_inout(ConnectionDAODefaultImpl.java:923)
fr.esrf.TangoApi.Connection.command_inout(Connection.java:375)
fr.esrf.tangoatk.core.Device.executeCommand(Device.java:747)
fr.esrf.tangoatk.core.command.ACommand.execute(ACommand.java:546)
fr.esrf.tangoatk.widget.command.AnyCommandViewer.commandInputPropertyChange(AnyCommandViewer.java:334)
fr.esrf.tangoatk.widget.command.AnyCommandViewer.access$300(AnyCommandViewer.java:46)
fr.esrf.tangoatk.widget.command.AnyCommandViewer$_cls1.propertyChange(AnyCommandViewer.java:522)
java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
java.awt.Component.firePropertyChange(Component.java:8428)
fr.esrf.tangoatk.widget.command.ArrayCommandInput.executeButtonActionPerformed(ArrayCommandInput.java:98)
fr.esrf.tangoatk.widget.command.ArrayCommandInput.access$000(ArrayCommandInput.java:37)
fr.esrf.tangoatk.widget.command.ArrayCommandInput$1.actionPerformed(ArrayCommandInput.java:83)
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
java.awt.Component.processMouseEvent(Component.java:6533)
javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
java.awt.Component.processEvent(Component.java:6298)
java.awt.Container.processEvent(Container.java:2238)
java.awt.Component.dispatchEventImpl(Component.java:4889)
java.awt.Container.dispatchEventImpl(Container.java:2296)
java.awt.Component.dispatchEvent(Component.java:4711)
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4897)
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4534)
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4475)
java.awt.Container.dispatchEventImpl(Container.java:2282)
java.awt.Window.dispatchEventImpl(Window.java:2746)
java.awt.Component.dispatchEvent(Component.java:4711)
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
java.awt.EventQueue.access$500(EventQueue.java:97)
java.awt.EventQueue$3.run(EventQueue.java:709)
java.awt.EventQueue$3.run(EventQueue.java:703)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
java.awt.EventQueue$4.run(EventQueue.java:733)
java.awt.EventQueue$4.run(EventQueue.java:731)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
---

Could you help me with this? Thanks.

PhilLAL commented 6 years ago

Hi again, juste a reminder :)

bourtemb commented 6 years ago

Hi Philippe,

I think your problem is only due to AtkPanel interface to enter command arguments which is not intuitive. I think you simply need to type ENTER after having entered your second argument and before clicking on execute button to ensure it is taken into account. This atkpanel behaviour is quite confusing and I think it would be good to improve it(?).

You could also use Test Device (tg_devtest) to execute the same command without any problem.

Please note that you can also define an alias from jive directly: simply right-click on a device node and select "Define device alias".

bourtemb commented 6 years ago

I created this issue to report this AtkPanel issue: https://github.com/tango-controls/atk-panel/issues/2

PhilLAL commented 6 years ago

I tried your solution with right click and "define device alias" and it worked, thank you Reynald!