Coder Social home page Coder Social logo

taurus's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

taurus's Issues

Exceptions due to unsubscribed TangoConfiguration

Running the following code causes an exception because a "zombie" TangoConfiguration object is still subscribed to PyTango events:

import sys
import taurus
from taurus.qt.qtgui.display import TaurusLabel
from taurus.qt.qtgui.application import TaurusApplication
from taurus.qt import Qt

devname = 'sys/tg_test/1'
attrname = 'ampli'
model1 = '%s/%s?configuration=label'%(devname,attrname)
model2 = None

def changeConfig():
    #I use pytango instead of taurus for changing the config 
    #to avoid adding a reference to the attribute in the taurus factory
    print '!!! CHANGING CONFIG OF MODEL1'
    print "  ! Registered attrs / configs :",f.tango_attrs.keys(), f.tango_configs.keys()
    import PyTango 
    d = PyTango.DeviceProxy(devname)
    c = d.get_attribute_config(attrname)
    d.set_attribute_config(c)
 
app = TaurusApplication()

#app.setLogLevel(taurus.Trace)
f = taurus.Factory()


print "!!! START "
w = TaurusLabel()
w.show()
print "  ! Registered attrs / configs :",f.tango_attrs.keys(), f.tango_configs.keys()

print "!!! SET MODEL 1 "
w.setModel(model1)
print "  ! Registered attrs / configs :",f.tango_attrs.keys(), f.tango_configs.keys()

print "!!! SET MODEL 2 "
w.setModel(model2)
print "  ! Registered attrs / configs :",f.tango_attrs.keys(), f.tango_configs.keys()

w.show()

#provoke 2 config events on the first model
Qt.QTimer.singleShot(1, changeConfig) # I delay the call because if not, it sometimes works (race condition)
Qt.QTimer.singleShot(1000, changeConfig) # I delay the call because if not, it sometimes works (race condition)

sys.exit(app.exec_())   
```````````````~~

Reported by: cpascual ( http://sf.net/u/cpascual )

JDraw files parsing improvement

With JDraw, you can map an object to a scalar attribute and assign a custom color map to this object depending on the tango attribute value. Do you think you can add this behaviour?

Inside the JDraw file, it is this section.

backgroundmapper:{
  mapping_type:2
  mode:0
  default:255,255,0
  map:1,1,0,255,0
  map:2,2,255,0,0
  map:3,3,0,0,255
  map:4,4,0,0,0
}

And also another one request will be with the Font applied, because sometimes, the value displayed is so small!!! Maybe only the font size and not the complete Font management.

Inside the JDraw file, it is this section.

font:"Dialog",1,21

Thanks

Reported by: NexeyaSGara ( http://sf.net/u/nexeya )

tauruspanel refresh button does not work

This issue was reported by Frederic Picca.

Refresh button in tauruspanel seems to not reload information from the database.

How to reproduce:

  1. Open tauruspanel.
  2. Select view ByServer (I doubt if it works in others).
  3. Create a new server in the Tango database.
  4. Press the refresh button.
  5. Check that your server is not the tree.

Reported by: reszelaz ( http://sf.net/u/zreszela )

Exception when closing image widget launched from taurusform

If launching "taurusform sys/tg_test/1/float_image"
Then clicking on the view button (the image widget appears) and then closing the image widget, this exception is thrown:

Traceback (most recent call last):
  File "/homelocal/sicilia/lib/python/site-packages/taurus/qt/qtgui/button/taurusbutton.py", line 76, in closeEvent
    self.setWidget(None)
  File "/homelocal/sicilia/lib/python/site-packages/taurus/qt/qtgui/button/taurusbutton.py", line 62, in setWidget
    oldWidget.deleteLater()
  File "/homelocal/sicilia/lib/python/site-packages/taurus/qt/qtgui/base/taurusbase.py", line 149, in deleteLater
    self.resetModel()
  File "/homelocal/sicilia/lib/python/site-packages/taurus/qt/qtgui/base/taurusbase.py", line 865, in resetModel
    self.setModel('')
  File "/homelocal/sicilia/lib/python/site-packages/taurus/qt/qtgui/extra_guiqwt/plot.py", line 457, in setModel
    self.imgItem = make.image(taurusmodel=model)
  File "/homelocal/sicilia/lib/python/site-packages/taurus/qt/qtgui/extra_guiqwt/builder.py", line 134, in image
    if Attribute(taurusmodel).read().type == DevEncoded:
  File "/homelocal/sicilia/lib/python/site-packages/taurus/core/taurushelper.py", line 388, in Attribute
    return Factory(scheme=getSchemeFromName(dev_or_attr_name)).getAttribute(dev_or_attr_name)
  File "/homelocal/sicilia/lib/python/site-packages/taurus/core/tango/tangofactory.py", line 393, in getAttribute
    raise TaurusException("Invalid Tango attribute name %s" % attr_name)
taurus.core.taurusexception.TaurusException: Invalid Tango attribute name 
````````````~~

Reported by: cpascual ( http://sf.net/u/cpascual )

Syntax error in TaurusTrend2DScanItem._scanLineReceived

Syntax errors in
TaurusTrend2DScanItem._scanLineReceived:

Description Resource Path Location Type
Undefined variable: yval image.py /sardana/taurus/lib/taurus/qt/qtgui/extra_guiqwt line 349 PyDev Problem
Undefined variable: yval image.py /sardana/taurus/lib/taurus/qt/qtgui/extra_guiqwt line 348 PyDev Problem

Reported by: cpascual ( http://sf.net/u/cpascual )

segfault in taurusimage with debian8

I got this segfault

> taurusimage sys/tg_test/1/float_image --taurus-log-level=trace
taurusimage sys/tg_test/1/float_image --taurus-log-level=trace
MainThread     TRACE    2013-11-12 09:43:04,313 TaurusManager: reInit()
MainThread     DEBUG    2013-11-12 09:43:04,313 TaurusManager.TaurusTP: Starting TaurusTP.W001
MainThread     DEBUG    2013-11-12 09:43:04,313 TaurusManager.TaurusTP: Starting TaurusTP.W002
MainThread     DEBUG    2013-11-12 09:43:04,313 TaurusManager.TaurusTP: Starting TaurusTP.W003
MainThread     DEBUG    2013-11-12 09:43:04,314 TaurusManager.TaurusTP: Starting TaurusTP.W004
MainThread     DEBUG    2013-11-12 09:43:04,314 TaurusManager.TaurusTP: Starting TaurusTP.W005
MainThread     DEBUG    2013-11-12 09:43:04,322 TaurusManager: Found plugin EvaluationFactory
MainThread     DEBUG    2013-11-12 09:43:04,322 TaurusManager: Found plugin TangoFactory
MainThread     DEBUG    2013-11-12 09:43:04,324 TaurusManager: Found plugin SimulationFactory
MainThread     DEBUG    2013-11-12 09:43:04,328 TaurusManager: Found plugin EpicsFactory
MainThread     DEBUG    2013-11-12 09:43:04,330 TaurusManager: Found plugin ResourcesFactory
/home/cpascual/bin/devenv: line 7: 27275 Segmentation fault      $*

`````````~~~


This fails when using the with my Debian testing but does not fail in debian7 or Suse11-Suse12

The problem occurs in Debian8 with both taurus from the official packages and from git. But it works ok on debian7 and Suse11/Suse12 even with the latest taurus, so it may be related with the guiqwt version or the Qt version.

Reported by: cpascual ( http://sf.net/u/cpascual )

TaurusDeisgner won't launch on Windows

On a fresh windows platform with:
Tango 8.1.2b
PyTango 8.1.1
PythonXY 2.7.5.2
lxml 3.3.1
Taurus 3.2.0

On a command Dos window, I have some DEBUG information, but nothing really important.

If I launch a TaurForm or TaurusDevicePanel, there is no problem.

Reported by: NexeyaSGara ( http://sf.net/u/nexeya )

Isolate taurus external dependencies that need patching

Description

Today taurus uses some external libraries that need local customization.
This customization may be required for different reasons:

  1. dependency on the actual implementation (ex.: PyQt vs PySide)
  2. dependency on python version (ex.: ordereddict exists only on python >= 2.7)
  3. soft dependency, ie, if library X is not installed then a local implementation
    of X can be used instead (ex.: pint for units).

Local customizations are being made inline. This has some weakenesses.
For example, Qt is being wrapped inside taurus/qt/. It is not possible to extend
the wrapping for the PyQt4.uic package because before the Qt wrapping concept
was added to taurus, an internal taurus sub-package called taurus/qt/uic already
existed to help handle code generation in taurusuic4 tool. It is therefore not
possible to wrap PyQt4.uic inside taurus.

This is a request to clearly isolate dependencies in a taurus sub package.
I propose to make a taurus.external which isolates the management of these
dependencies.

Here is the list of packages that need to be "externalized" and the reason:

  1. Qt - a lot of boilerplate code to manage different Qt implementations.
  2. enum ([SEP12]) - present on python >= 3.4 only, there is a backport for python >= 2.4.
    It should be a soft dependency: if not installed it should use a local implementation.
  3. ordereddict - present on python >= 2.7 only, there is a backport for python >= 2.4
    It should be a soft dependency: if not installed it should use a local implementation.
  4. argparse - present on python >= 3.2 only, there is a backport for python >= 2.3
    It should be a soft dependency: if not installed it should use a local implementation.
  5. unittest - taurus needs implementation new features of python >= 2.7. A backport exists (unittest2) for python >= 2.4
    It should not be a soft dependency: if not installed you should not be able to run tests with python 2.6
  6. pint - taurus requires pint of unit management ([SEP3]).
    Some boilerplate initialization code needs to be done before using pint.
    pint should be a soft dependency: if not installed it should use a local implementation.
  7. setuptools - maybe in the future. Not absolutely required for now

In practice, the import statements in taurus should be changed from:

:::python
try:
    import argparse
except ImportError:
    import optparse as argparse

to:

:::python
from taurus.external import argparse

and from:

:::python
from taurus.qt import Qt
from taurus.qt import QtCore
from taurus.qt import QtGui

to:

:::python
from taurus.external.qt import Qt
from taurus.external.qt import QtCore
from taurus.external.qt import QtGui

Special note for the Qt package

Backward compatibility

Since many taurus applications are relying on taurus.qt.Qt[Core|Gui], the implementation must take into account backward compatibility.

Handling of PyQt4.Qt

The PyQt4.Qt sub-package is a helper for the following packages:
QtDBus
QtHelp
QtNetwork
QtOpenGL
QtScriptTools
QtScript
QtDeclarative
QtCore
QtGui

Today taurus uses Qt to address only QtCore and QtGui symbols. When taurus imports PyQt4.Qt indirectly a waste of ~25Mb of RAM (depends on implementation) is made by process which only needs QtCore and QtGui.

This package doesn't exist in PySide. The QtNetwork was only added in PyQt4 4.4.

Because of these problems it is proposed that an implementation of taurus.external.qt.Qt includes only symbols from QtCore and QtGui.

Colaborative Qt

Taurus Qt usage should depend on the private taurus qt configuration. The configuration describes the policy for using a specific Qt implementation. The usage of a specific Qt implementation should correspond to the following algorithm:

if a Qt is already in memory:
    if config.[use specific Qt implementation]:
        if config.[specific Qt implementation] != Qt in memory:
            <raise Failed to use Qt X because Qt Y is already in use>
else:
    <find best Qt according to config.[prefered Qts] and installed Qts>
    if no Qt found:
        <raise no Qt implementation found>

if Qt as not been initialized:
    <initialize Qt implementation>

the Qt configuration could be based on taurus.tauruscustomsettings. Example:

:::python
# ----------------------------------------------------------------------------
# Qt configuration
# ----------------------------------------------------------------------------

#: Auto initialize Qt
DEFAULT_QT_AUTO_INIT = True

#: Set preffered API if not is already loaded
DEFAULT_QT_AUTO_API = 'PyQt4'

#: Whether or not should be strict in choosing Qt API
DEFAULT_QT_AUTO_STRICT = False

#: Auto initialize Qt logging to python logging
DEFAULT_QT_AUTO_INIT_LOG = True

#: Auto initialize taurus resources (icons)
DEFAULT_QT_AUTO_INIT_RES = True

#: Remove input hook (only valid for PyQt4)
DEFAULT_QT_AUTO_REMOVE_INPUTHOOK = True

#: Auto initialize Qt
QT_AUTO_INIT = DEFAULT_QT_AUTO_INIT

#: Set preffered API if not is already loaded
QT_AUTO_API = DEFAULT_QT_AUTO_API

#: Whether or not should be strict in choosing Qt API
QT_AUTO_STRICT = DEFAULT_QT_AUTO_STRICT

#: Auto initialize Qt logging to python logging
QT_AUTO_INIT_LOG = DEFAULT_QT_AUTO_INIT_LOG

#: Auto initialize taurus resources (icons)
QT_AUTO_INIT_RES = DEFAULT_QT_AUTO_INIT_RES

#: Remove input hook (only valid for PyQt4)
QT_AUTO_REMOVE_INPUTHOOK = DEFAULT_QT_AUTO_REMOVE_INPUTHOOK

References

The implementation I propose is based on the success story of IPython management
of external dependencies through the usage of IPython.external pattern.

This implementation has also proved to work before on the Qarbon project with a similar External pattern

Reported by: tiagocoutinho ( http://sf.net/u/tiagocoutinho )

jdraw_view - list index out of range

Hi,
It is possible get an out of range with jdraw_view qtgui when the model has not been given.

sardana-sardana.git/taurus/lib/taurus/qt/qtgui/graphic/jdraw/jdraw_view.py", line 267, in getModelMimeData
model = getattr(self.scene()._selectedItems[0],'_name','')
IndexError: list index out of range

This could be repeated with taurusgui example01 without launch TangoTest test device server and clicking repeatedly on jdraw viewer (into a red square)

Reported by: cmft ( http://sf.net/u/cmft )

TaurusWidgetFactory returns wrong widget package

TaurusWidgetFactory algorithm is not taking into account the real module where a widget is defined.

Example

# TaurusWidget is defined in: taurus.qt.qtgui.container.tauruswidget
from taurus.qt.qtgui.util.tauruswidgetfactory import TaurusWidgetFactory
factory = TaurusWidgetFactory()
print(factory.getWidgets()['TaurusWidget']
```~~

generates:

```~~
('taurus.qt.qtgui.panel', <class 'taurus.qt.qtgui.container.tauruswidget.TaurusWidget'>)
```~~

it should generate:

```~~
('taurus.qt.qtgui.container.tauruswidget', <class 'taurus.qt.qtgui.container.tauruswidget.TaurusWidget'>)
```~~

as a reference, a better algorithm to handle class/package can be found in Sardana MacroServer:

https://sourceforge.net/p/sardana/sardana.git/ci/master/tree/src/sardana/macroserver/msmacromanager.py


Reported by: tiagocoutinho ( http://sf.net/u/tiagocoutinho )

Installing PySide breaks Taurus

Taurus has some incomplete support for PySide.
The problem is that, if PySide is installed in the system, an unsuccessful attempt to import PySide is done which prevents any taurus Qt code from working.
See, e.g.:

$ taurusform
Traceback (most recent call last):
  File "/usr/bin/taurusform", line 26, in <module>
    from taurus.qt.qtgui.panel.taurusform import taurusFormMain
  File "/usr/lib/python2.7/dist-packages/taurus/qt/qtgui/panel/__init__.py", line 31, in <module>
    from .qrawdatachooser import *
  File "/usr/lib/python2.7/dist-packages/taurus/qt/qtgui/panel/qrawdatachooser.py", line 32, in <module>
    from taurus.qt import Qt
  File "/usr/lib/python2.7/dist-packages/taurus/qt/Qt.py", line 139, in <module>
    from PySide.Qt import *
ImportError: No module named Qt
`````````~

Note: as a **workaround** (other than uninstalling PySide), setting the QT_API environment variable to "pyqt" prevents this bug.



Reported by: cpascual ( http://sf.net/u/cpascual )

TaurusJDrawSynopticsView

On windows platform, when I try to launch a panel from a right click on the graphicsItem, it fails beacause of error :
Cannot launch application:
taurusdevicepanel
Hint: Check thaht taurusdevicepanel is installed and in path

Reported by: NexeyaSGara ( http://sf.net/u/nexeya )

TaurusImageDialog bug

Calling setModel on a TaurusImageDialog raises an exception if the device is not started.

taurus\qt\qtgui\extra_guiqwt\builder.py

Lines 134 -137:

if Attribute(taurusmodel).read().type == DevEncoded:
image = TaurusEncodedImageItem(param)
else:
image = TaurusImageItem(param)

The line responsible for this behavior is line 134. It tries to read the attribute and fails.
I don’t know if there’s a different way to check the attribute type.

Reported by: NexeyaSGara ( http://sf.net/u/nexeya )

TaurusLed doesn't update color on Device not exported

See screenshot attached with a TaurusLabel and a TaurusLed both pointing to a device state. The TaurusLed widget is the one assigned by Taurus automatically when you drop an State into a form.

After killing a running device the TaurusLabel shows "----" to reflect that the attribute is not readable anymore. The TaurusLed instead is still showing BLUE, the color of the last valid state read.

The color should be BLACK, the color that the led shows if you restart the widget and not the device.

This behavior of TaurusLed lead to some confusions in users as they still see some leds in Green color for devices that are not running anymore.

Reported by: sergirubio ( http://sf.net/u/sergi_rubio )

TaurusWidgetFactory won't load widgets from $TAURUSQTDESIGNERPATH

Hi,
Loading extra widgets from $TAURUSQTDESIGNERPATH doesn't work anymore. The test at line 178 trows an exception that is silently ignored:

if issubclass(attr, taurus.qt.qtgui.base.TaurusBaseWidget):
..

The import of taurus.qt.qtgui.base was removed by commit #22465 in tango-cs svn before the move to git. Adding back the import solves the problem (patch attached).

Reported by: andreaspersson ( http://sf.net/u/andreaspersson )

X11 Widgets

Requirements

New widgets to handle X11 embedable applications:

  1. a taurus widget that embeds a generic x11 embed able GUI. The widget should start the GUI from a desired command as a subprocess

  2. a taurus widget that embeds a xterm widget (specialization of 1.). It must be able to start a remote xterm.

  3. window version of these widgets 1 and 2. It should have a customizable toolbar with at least a restart button

The existing widget taurus.qt.qtgui.extra_xterm.QXTermWidget does not fulfill first and third requirements. It is intended specifically for Xterm. It is impossible to re-factor the current widget maintaining backward compatibility.
Since this widget inherits directly from QWidget, it needs to restart the xterm subprocess if the widget re-sizes. Instead, the feature request proposes to refactor the taurus.qt.qtgui.extra_xterm.QXTermWidget to use the new xterm widget maintaining the backward compatibility. It also proposes that the extra_xterm is marked as deprecated.

Implementation

I propose to create a new package taurus.qt.qtgui.x11 to contain all the new x11 widgets. It should contain the widgets XCommandWidget, XCommandWindow, XTermWidget and XTermWindow.

Reported by: tiagocoutinho ( http://sf.net/u/tiagocoutinho )

Taurus.Device(...) hungs when using tango host un URI

In pcbl0401 this kind of code hungs when called from
ipython/app/composer/alarm:

import taurus
d =
taurus.Device('ctblgateway01:10000/expchan/id04scw_machine_attribute/8')

It just waits for a looooong time before returning an exception (~1min)
Doing...
taurus.Database('tbl0401:10000')
...works well
taurus.Database('nonexistingname:10000')
...gives an exception quickly (that's ok)
taurus.Database(ctblgateway01:10000')
...it takes a LOOOONG time (>>10s), but finally it gives an exception.
taurus.Device('ctblgateway01:10000/expchan/id04scw_machine_attribute/8')
...it takes a LOOOONG time (>>10s), but finally it gives an exception.

The same can be reproduced in controls02 using the latest svn version.
taurus.Database('controls01:10000')
...works well
taurus.Database('nonexistingname:10000')
...gives an exception quickly
taurus.Database('alba03:10000')
...gives an exception... but only after long time
taurus.Database('ctblgateway01:10000')
...gives an exception... but only after long time

Reported by: sergirubio ( http://sf.net/u/sergi_rubio )

taurusgui Segmentation fault

Segmentation fault when taurusgui has been launched before that device server was started. In the normal order, it is totally safe.

I.e.
launch taurusgui example01 and then start TangoTest test device server.

In [2]: taurus.__R.version
Out[2]: '3.1.1'

In [3]: taurus.check_dependencies()
Checking required dependencies of taurus.core...
Checking for Python >=2.6.0... [OK] (Found 2.6.6)
Checking for PyTango >=7.1.0... [OK] (Found 8.1.0)
Checking required dependencies of taurus.qt...
Checking for PyQt >=4.4.0... [OK] (Found 4.6.3)
Checking for PyQwt >=5.2.0... [OK] (Found 5.2.0)
Checking OPTIONAL dependencies of taurus.qt...
Checking for Qub >=1.0.0... [WARNING] (Not found])
Checking for spyderlib >=2.0.0... [OK] (Found 2.1.8)
Checking for qtcontrols >=1.0.0... [WARNING] (Not found])

Reported by: cmft ( http://sf.net/u/cmft )

Improve JDraw Synoptyc rendering

There is a lot difference between Tango JDraw rendering and the Taurus JDraw rendering.

More important ones are:

  • Splines are not displayed with the right shape
  • Texts are not at the right position
  • Gradiens are not well displayed (most of the time i just have no gradien at all)

Reported by: vallsv ( http://sf.net/u/valentinvalls )

TaurusDevTree error in designer

When launching taurusdesigner
on a machine without TANGO_HOST env var set, I get:

taurus designer plugin error creating TaurusDevTree: 'TANGO_HOST'
----------------------------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/carlos/src/sardana/taurus/lib/taurus/qt/qtdesigner/taurusplugin/taurusplugin.py", line 79, in createWidget
    w = klass(parent, designMode = True)
  File "/home/carlos/src/sardana/taurus/lib/taurus/qt/qtgui/tree/taurusdevicetree.py", line 347, in __init__
    self.setTangoHost(os.environ['TANGO_HOST'])
  File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__
    raise KeyError(key)
KeyError: 'TANGO_HOST'
Designer: The custom widget factory registered for widgets of class TaurusDevTree returned 0.
** WARNING Factory failed to create  "TaurusDevTree" 

Reported by: cpascual ( http://sf.net/u/cpascual )

TaurusManager getAttribute

Hi,

I have an exception in a gui (Alba's power supplies 'ctpcgrid') when a individual magnet gui ('ctpcgui') is opened from the general view.

This is happening in Alba's installation of taurus 3.1.1, but the same code is running in taurus 3.0.1.

The given exception traceback is:

File "/remotenfs/sicilia-controls.storagesa/lib/python/site-packages/ctpc/base.py", line 218, in changeModel
self.form.mode_widget.setModel(subdevName+"/RemoteMode")
File "/remotenfs/sicilia-controls.storagesa/lib/python/site-packages/ctpc/base.py", line 108, in setModel
obj = TaurusManager().getAttribute(name)
File "/homelocal/sicilia/lib/python/site-packages/taurus/core/taurusmanager.py", line 248, in getAttribute
return self.getObject(TaurusAttribute, name)
NameError: global name 'TaurusAttribute' is not defined

Current workaround has been to change base.py:108 to 'obj = Taurus.Attribute(name)'. This workaround works in both mentioned taurus versions.

Reported by: sergiblanch ( http://sf.net/u/sergiblanch )

Qt window dies if TaurusLabel with model set in main window

From emails by Teresa Nunez to the devel mailing list (with attached files in bug34.zip):

Hi Carlos,
sorry ... still something more ...here another version
of the testopenwidgets.py file using TaurusApplication,
the effect is exactly the same as using Qt.Application.
Running with --taurus-log-level=trace does not gives any information,
there is not an especial message when the window dissapears.

               Regards,
                        Teresa

On 08/27/13 12:15, Maria-Teresa, Nunez-Pardo-de-Vera wrote:

Only some additional info: the problems happens with dummy motors using
DummyMotoController, so you can test it.

On 08/27/13 11:58, Maria-Teresa, Nunez-Pardo-de-Vera wrote:

Hello Carlos,
I send you now some files with wich I get the error I
talked to you about.
Here the description of the problem:

I have a qt widget (I call it 'main') with a button opening a
new qt widget. If in the 'main' widget I have a TaurusLabel
and I set the model of this TaurusLabel to the position of
one motor device FROM THE POOL the widget that I open
pushing the button disapears after some time (this time
varies from time to time, and I think it also depends on
how many TaurusLabels I have in the main widget, it is
not correlated at all with changes in the value of
the attributed attached to these values, I keep the
attributes without changes).

This doesn't happen if instead of TaurusLabels I have
TaurusLineEdits.

This also doesn't happen if I set the model to any
motor of my system (NOT FROM THE POOL).

Do you have any idea where the problem can be?.
What could produce a difference between setting the model to
a motor from the pool or not from the pool?, I guess the
event configuration, but I put to my external motor the same
configuration the motors of the pool have ('Change
event' to 1) and even like this I could not reproduce the problem
(even if both motors are actually the same ... the motor in
the Pool is connecting to the other one via the controller, is
reading from it).
And the difference between using TaurusLabel and TaurusLineEdit?.

The example would be run like:

python testopenwidgets.py

Play changing the setModel argument.

Well, let's see if you can reproduce it.
Many thanks.

                 Regards,
                             Teresa

Reported by: cpascual ( http://sf.net/u/cpascual )

getQtDesignerPlugin could be simpler

The getQtDesignerPlugin class method of taurus widgets demands that the python module where the widget is defined is returned.

This is unnecessary since the taurus QtDesigner extension can determine the module in which the widget is defined automatically.

Also is error prone if you happen to move a widget from one package to another.

Reported by: tiagocoutinho ( http://sf.net/u/tiagocoutinho )

Wrong Synoptic selection?

When i select an object from the synoptic. Other object which use are same device name (but not the same attribute) are also selected.

On the screenshot bellow, i only select the box "BPM3", and objects with the text are not selectable with the mouse.

Is that a normal behaviour? I guess only the clicked object should be selected. If it is the expected behaviour, maybe i can provide a patch.

Reported by: vallsv ( http://sf.net/u/valentinvalls )

External widget not exported correctly in config.xml in Taurus

When trying create a new panel in Taurus with a Widget that is external to Taurus (for example mirror_alignment.py), and we try to export it to the config.xml, the config.xml file is not well created.

In my specific case the config.xml indicates only the class name:
MirrorAlignment

Indicating only the class name, when we try to open the taurus application, the new panel is not found from the config.xml (it only reads it from the .ini).

Thus, the class name it is not enough.
Following the advice of Carlos, we have to indicate in the config.xml as well the name of the library and the module, like that:
alignmentlib.mirror_alignment.MirrorAlignment

That is:

  • Folder where the module can be found.
  • Module name.
  • Class name.

With this change the external widget is saved correctly in the config.xml.


Taurus should be modified in order that the file config.xml is automatically created correctly taking into account the folder where the module can be found and the module name (besides the class name).

Reported by: sagiss ( http://sf.net/u/mrosanes )

TaurusWidget use by default setAutoFillBackground=true

Hi,

TaurusWidget use by default setAutoFillBackground=true, which is i think not a good idea.

QWidget use setAutoFillBackground=false by default.

TaurusWidget should only be a container and should not display things by itself, if i understand it well. The problem is TaurusWidget inherite from TaurusBaseContainer which initilise this background property in updateStyle().

Then maybe it can be inhibited for TaurusWidget.

What do you think about that?

Reported by: vallsv ( http://sf.net/u/valentinvalls )

Synoptic selection using outline of object instead of ellipse

Hi

I dont like the use of the ellipse to display selection on the synoptic. Then i create a patch to highlight the outline of the object.

Then i would like to know what you think about. If i can merge it to Taurus and how can i do it.

Right now i create a property to set to "ellipse" or to "outline", but i think it would be better to limit the grow of the code, or the code should be refactored. I unfortunatly did not really understand the meaning of many functions relative to the selection, then i am not very happy with this patch.

Then are you interested in and can you help me?

Reported by: vallsv ( http://sf.net/u/valentinvalls )

TaurusCommandButton Signal error

We don't receive the signal commandExecuted from the taurusCommandButton.
For fixing it :
File taurus\qt\qtgui\button\taurusbutton.py

Line 260 :
Replace: pyqtSignals = ("commandExecuted()",)
By: pyqtSignals = ("commandExecuted(PyQt_PyObject)",)

Ligne 333
Replace: self.emit(Qt.SIGNAL('commandExecuted'), result)
By: self.emit(Qt.SIGNAL('commandExecuted(PyQt_PyObject)'), result)

Reported by: NexeyaSGara ( http://sf.net/u/nexeya )

pip/easy_install taurus does not work

UPDATE: This is no longer an issue in Taurus v>4 since the change to setuptools in [9f976f]. And as a workaround, the --egg parameter solves the problem for Taurus < 4 , as mentioned in the comments

Installing taurus with easy_install appears to work, but:

-resources are not built
-extra_packages are not installed

IMHO, doing "easy_install taurus" should yield similar results than downloading the tgz and doing "python setup.py install"

As a hint:
during easy_install, the following is printed:

cpascual@pc218:~/src/svn/taurus/dist$ PYTHONPATH=/tmp/kkinstdirtaurus311 easy_install --install-dir=/tmp/kkinstdirtaurus311 taurus-3.1.1.tar.gz
Processing taurus-3.1.1.tar.gz
Running taurus-3.1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Tmbuxl/taurus-3.1.1/egg-dist-tmp-elgCV3
`````````~~

But surprisingly to me, the command "bdist_egg" cannot be called manually (?)

Reported by: cpascual ( http://sf.net/u/cpascual )

Exclude style tags in TaurusLabel._shouldTrim length check

Texts that include style tag (custom fonts, colors, styles, symbols) are shown like '...' because how the length check in taurus label is done.

To solve this TaurusLabel._shouldTrim method should ignore style tags

I suggest to replace html-like tags at the beginning of the method:

def _shouldTrim(self, label, text):
import re #<<< added
text = re.sub('<[^<]*>','',text) #<<< added
if not label.autoTrim:
return False
font_metrics = Qt.QFontMetrics(label.font())
size, textSize = label.size().width(), font_metrics.width(text)
return textSize > size

Reported by: sergirubio ( http://sf.net/u/sergi_rubio )

taurus.Device as PyTango.DeviceProxy for writing attributes

Hi,
concerning the writing and reading of Tango attribute, we (at DESY) would like to have in a Tango device instantiated from taurus.Device:

dev = taurus.Device('my/device/name')

the same behavior as if it is instantiated as a PyTango.DeviceProxy.
Just now in a device from PyTango.DeviceProxy it is possible to read and write attributes simply using:

dev.MyAttribute
dev.MyAttribute = newvalue

If the device is instance of taurus.Device, one can read the attribute using:

dev.MyAttribute

but it is not possible to write it using:

dev.MyAttribute = newvalue

One can think that it works because one does not get any error (what is really
dangerous) but one is only creating a new member of the dev object ... not affecting at all to the attribute MyAttribute of the device.
This different behavior between using taurus.Device and PyTango.DeviceProxy can be really confusing for our users, since they for sure will try to use the same when they are programming python scripts, in which they use only PyTango, or sardana macros, that are using taurus.Device instances for the devices. This is why we would like to have the same implementation for both.

                     Regards,
                                 Teresa

Reported by: teresanunez ( http://sf.net/u/tere29 )

Removing designMode from widget constructor

Using designMode as constructor parameter is not very nice.
If you create a widget by composition and use it with QtDesigner (*) , the children of the widget will not be in designerMode and it will create a mess.

(*) for example by importing a .ui file. But in pure python code, providing designerMode everywhere it is needed is also a mess.


One way to fix that, the one i use with the help of Tiago is to check the modules:

designMode = 'PyQt4.QtDesigner' in sys.modules

It does not support all the cases, but it can be improved


Another way is to inject the context to the class when we create the QtDesignerPlugin

klass.QTDESIGNER_CONTEXT = True

And using something like that on the class:

designMode = hasattr(self, "QTDESIGNER_CONTEXT")

Reported by: vallsv ( http://sf.net/u/valentinvalls )

errors reported by lintian4py for taurus

Hello,

during the packaging process I run the lintian4py program.

I put here the error messages reported by this tool

e: python-taurus: string-exception usr/share/pyshared/taurus/console/table.py:95
w: python-taurus: inconsistent-use-of-tabs-and-spaces-in-indentation usr/share/pyshared/taurus/qt/qtgui/panel/taurusconfigurationpanel.py:55
e: python-taurus: syntax-error usr/share/pyshared/taurus/qt/qtgui/util/tauruswidget_template:9: invalid syntax
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/evaluation/evalfactory.py:807: DoubleRegistration
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/evaluation/evalfactory.py:810: DoubleRegistration
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/evaluation/evalfactory.py:819: DoubleRegistration
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/evaluation/evalfactory.py:822: DoubleRegistration
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/evaluation/evalfactory.py:832: DoubleRegistration
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/evaluation/evalfactory.py:835: DoubleRegistration
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/simulation/simfactory.py:374: taurus
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/tango/sardana/motion.py:155: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/tango/sardana/motion.py:344: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/taurusbasetypes.py:268: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/util/codecs.py:408: bson
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/util/codecs.py:410: decode
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/util/codecs.py:470: ccdName
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/util/singleton.py:48: MyManager
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/core/util/singleton.py:51: MyManager
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtcore/util/emitter.py:177: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtcore/util/emitter.py:178: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtcore/util/emitter.py:181: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtcore/util/emitter.py:182: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtcore/util/emitter.py:186: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtcore/util/emitter.py:187: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtcore/util/emitter.py:337: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtcore/util/emitter.py:338: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtcore/util/emitter.py:342: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/button/qbuttonbox.py:96: TaurusButtonBox
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/display/qsevensegment.py:501: digitWidget
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/display/qsevensegment.py:507: digitWidget
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/display/qsevensegment.py:513: digitWidget
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/display/qsevensegment.py:519: digitWidget
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/display/qsevensegment.py:525: digitWidget
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/display/taurusboolled.py:147: BoolIndex
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/editor/tauruseditor.py:106: is_file_opened
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/editor/tauruseditor.py:233: TaurusEditor
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/extra_macroexecutor/macroparameterseditor/customeditors/senv.py:370: MacroNode
w: python-taurus: pyflakes-undefined-export usr/share/pyshared/taurus/qt/qtgui/extra_nexus/taurusnexuswidget.py:30: TaurusNexusBrowser
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/extra_nexus/taurusnexuswidget.py:48: HDF5GeneralInfoWidget
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/extra_nexus/taurusnexuswidget.py:49: HDF5AttributesInfoWidget
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/extra_nexus/taurusnexuswidget.py:55: NeXusPreviewWidgetFactory
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/extra_sardana/sardanabasewizard.py:73: QtGui
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/extra_sardana/sardanabasewizard.py:77: QtGui
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/graphic/taurusgraphic.py:83: item_rects
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/image/taurusqub.py:136: numpy
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/panel/qdataexportdialog.py:167: t
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/panel/qrawdatachooser.py:79: QApplication
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/panel/ui/ui_TaurusConfigurationPanel.py:203: Ui_Form
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/table/qdictionary.py:144: self
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/table/taurusvaluestable.py:304: val
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/qtgui/table/taurusvaluestable_ro.py:154: TaurusValuesTable
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/uic/pyuic4/taurus.py:28: CW_FILTER
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/uic/pyuic4/taurus.py:52: MATCH
e: python-taurus: pyflakes-undefined-name usr/share/pyshared/taurus/qt/uic/pyuic4/taurus.py:54: NO_MATCH
w: python-taurus: pyflakes-undefined-export usr/share/pyshared/taurus/qt/uic/tau2taurus_map.py:28:

I hope that they speaks enought by themself.

Cheers

Fred

Reported by: picca ( http://sf.net/u/piccaf )

taurusvalue not deletting old widgets

When the internal widgets of a TaurusValue need to be replaced (e.g. the attribute being shown changes from not being reachable to being reachable), the TaurusValue._newSubwidget() method is suppossed to:

a) hide the old widget
b) make sure all its connections/subscriptions are disabled
c) request Qt to delete it (calling deleteLater())

But if I do:

  1. kill TaurusTest server
  2. launch "taurusform sys/tg_test/1/boolean_scalar" (I get what is hown in snapshot called "before_...")
  3. start TaurusTest server

I can see the old widget (a QLabel) still below the new one (a TaurusLed). See snapshot called "after_...".

This has been pointed out before in
https://sourceforge.net/p/sardana/tickets/45/#c288
but I think it deserves its own separate bug report.

Reported by: cpascual ( http://sf.net/u/cpascual )

exception in tauruscurve (API2 problem)

:~$ tauruscurve --demo

#(click on the taurus button)

Traceback (most recent call last):
  File "/home/cpascual/src/sardana/taurus/lib/taurus/qt/qtgui/extra_guiqwt/curvesmodel.py", line 201, in headerData
    return Qt.QVariant(Qt.QString.number(section+1))
AttributeError: type object 'str' has no attribute 'number'
`````````~~

Reported by: cpascual ( http://sf.net/u/cpascual )

Taurus JDraw Synoptic change the background color of the SimpleScalarViewer classes

You can see on the screenshot that the Tango JDraw viewer and the Taurus one do not display the Swing component fr.esrf.tangoatk.widget.attribute.SimpleScalarViewer (which is the text) in the same way.

Do you have rules relative to JDraw? Must we do something closer to the original?

Anyway, is there any problem if we remove the background/text color update in case of fr.esrf.tangoatk.widget.attribute.SimpleScalarViewer item? I guess a normal text will still have the same behaviour than before.

If you agree, i think i can do a patch which will only fix the SimpleScalarViewer swing item rendering.

Reported by: vallsv ( http://sf.net/u/valentinvalls )

taurusImage - representation bug

TaurusImage is incapable to represent image with depth different than 1. Showing a wrong representation. i.e. A 1024x1024x2 image is represented 1024x2048x1

Attached one file with three pictures

  • info & image using atkpanel
  • taurusimage output

Reported by: cmft ( http://sf.net/u/cmft )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.