You can subscribe to this list here.
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
(5) |
May
(34) |
Jun
(30) |
Jul
(65) |
Aug
(34) |
Sep
(9) |
Oct
(39) |
Nov
(147) |
Dec
(73) |
| 2016 |
Jan
(89) |
Feb
(42) |
Mar
(41) |
Apr
(28) |
May
(39) |
Jun
(59) |
Jul
(119) |
Aug
(48) |
Sep
(10) |
Oct
(19) |
Nov
(13) |
Dec
|
| 2017 |
Jan
(2) |
Feb
|
Mar
(3) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
(3) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2021 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
(1) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
(3) |
Sep
(2) |
Oct
(3) |
Nov
(4) |
Dec
(3) |
| 2024 |
Jan
|
Feb
(3) |
Mar
(3) |
Apr
(4) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(2) |
| 2025 |
Jan
(1) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(2) |
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
|
From: <cpa...@ce...> - 2016-01-29 15:24:22
|
From: cpascual <cpa...@ce...>
Detect non-increasing x values and ignore such events. They happen when
using a time mode and clicking on the TaurusModel tool.
---
lib/taurus/qt/qtgui/extra_guiqwt/image.py | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/image.py b/lib/taurus/qt/qtgui/extra_guiqwt/image.py
index 087f623..4aedefa 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/image.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/image.py
@@ -256,7 +256,6 @@ class TaurusTrend2DItem(XYImageItem, TaurusBaseComponent):
if evt_value is None or getattr(evt_value,'value', None) is None:
self.debug('Ignoring event from %s'%repr(evt_src))
return
-
plot = self.plot()
if plot is None:
return
@@ -278,28 +277,33 @@ class TaurusTrend2DItem(XYImageItem, TaurusBaseComponent):
#update x values
if self.stackMode == 'datetime':
+ x = evt_value.time.totime()
if self.__timeOffset is None:
- self.__timeOffset = evt_value.time.totime()
+ self.__timeOffset = x
plot.set_axis_title('bottom', 'Time')
plot.set_axis_unit('bottom', '')
- self._xBuffer.append(evt_value.time.totime())
elif self.stackMode == 'deltatime':
try:
- self._xBuffer.append(evt_value.time.totime() - self.__timeOffset)
+ x = evt_value.time.totime() - self.__timeOffset
except TypeError: #this will happen if self.__timeOffset has not been initialized
self.__timeOffset = evt_value.time.totime()
- self._xBuffer.append(0)
+ x = 0
plot.set_axis_title('bottom', 'Time since %s'%evt_value.time.isoformat())
plot.set_axis_unit('bottom', '')
else:
try:
step = 1 # +numpy.random.randint(0,4) #for debugging we can put a variable step
- self._xBuffer.append(self._xBuffer[-1]+step)
+ x = self._xBuffer[-1]+step
except IndexError: #this will happen when the x buffer is empty
- self._xBuffer.append(0)
+ x = 0
plot.set_axis_title('bottom', 'Event #')
plot.set_axis_unit('bottom', '')
+
+ if len(self._xBuffer) and x <= self._xBuffer[-1]:
+ self.info('Ignoring event (non-increasing x value)')
+ return
+ self._xBuffer.append(x)
#update z
self._zBuffer.append(evt_value.value)
--
2.6.4
|
|
From: Zbigniew R. <zre...@ce...> - 2016-01-29 15:13:58
|
Hi Carlos, Thanks for the patch. I have applied it to the develop branch. Cheers, Zibi On 01/20/2016 11:33 AM, cpa...@ce... wrote: > From: cpascual <cpa...@ce...> > > When using a TaurusValue customized with an extra widget, the grid > layout behaves in an unexpected way regarding to its rows/columns > stretch (see http://sf.net/p/tauruslib/tickets/142/#f4e4/9e68). > Prevent this by inserting a spacer in the extrawidget column if no > extrawidget is used. > --- > lib/taurus/qt/qtgui/panel/taurusvalue.py | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/lib/taurus/qt/qtgui/panel/taurusvalue.py b/lib/taurus/qt/qtgui/panel/taurusvalue.py > index 543ba0e..dff58d2 100644 > --- a/lib/taurus/qt/qtgui/panel/taurusvalue.py > +++ b/lib/taurus/qt/qtgui/panel/taurusvalue.py > @@ -833,11 +833,17 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget): > 1, 1, -1, alignment) > > def addExtraWidgetToLayout(self): > - if self._extraWidget is not None and self.parent() is not None: > - alignment = getattr(self._extraWidget, 'layoutAlignment', > - Qt.Qt.AlignmentFlag(0)) > - self.parent().layout().addWidget(self._extraWidget, self._row, > - 5, 1, 1, alignment) > + parent = self.parent() > + if parent is not None: > + if self._extraWidget is None: > + # Adding this spacer is some voodoo magic to avoid bug #142 > + # See: http://sf.net/p/tauruslib/tickets/142/ > + parent.layout().addItem(Qt.QSpacerItem(0, 0), self._row, 5) > + else: > + alignment = getattr(self._extraWidget, 'layoutAlignment', > + Qt.Qt.AlignmentFlag(0)) > + parent.layout().addWidget(self._extraWidget, self._row, > + 5, 1, 1, alignment) > > @Qt.pyqtSignature("parentModelChanged(const QString &)") > def parentModelChanged(self, parentmodel_name): -- ALBA Synchrotron <http://www.albasynchrotron.es> Zbigniew Reszela Controls Section - Computing Division ALBA SYNCHROTRON LIGHT SOURCE Carrer de la Llum 2-26 | 08290 | Cerdanyola del Vallès| Barcelona | Spain <http://www.albasynchrotron.es/AboutUs/Access> (+34) 93 592 4407 www.albasynchrotron.es <http://www.albasynchrotron.es>| zre...@ce... <mailto:zre...@ce...> **Please, do not print this e-mail unless it is absolutely necessary. **Si heu rebut aquest correu per error, us informo que pot contenir informació confidencial i privada i que està prohibit el seu ús. Us agrairíem que ho comuniqueu al remitent i l'elimineu. Gràcies. Si ha recibido este correo por error, le informo de que puede contener información confidencial y privada y que está prohibido su uso. Le agradeceré que lo comunique a su remitente y lo elimine. Gracias. If you have received this e-mail in error, please note that it may contain confidential and private information, therefore, the use of this information is strictly forbidden. Please inform the sender of the error and delete the information received. Thank you. |
|
From: Carlos P. <cpa...@ce...> - 2016-01-28 11:33:51
|
I did a complete rework based on cfalcon's work and pushed it to
taurus4.
On Wed 2 December 2015 09:57:35 Carlos Pascual wrote:
> Hi, the changes seem ok to me, but the implementation has one problem:
>
> It assumesthat the "normal_name" returned by the validator is
> equivalent to the device name (and it psses it to setTable). But this
> is not always the case. The normal name may contain the DB name in it
> if it is not the default one.
>
> For example, in my system I have constrols02:10000 as my default DB,
> and the device cpascual/pysignalsimulator/1 is exported only in
> controls01 (not in controls02) then:
>
> This fails:
>
> ~~~~
> python taurusdevicepropertytable.py \
> tango://controls01:10000/cpascual/pysignalsimulator/1
> ~~~~
>
> This also fails:
>
> ~~~~
> devenv python taurusdevicepropertytable.py \
> --tango-host=controls01:10000 cpascual/pysignalsimulator/1
> ~~~~
>
> And this works:
>
> ~~~~
> TANGO_HOST=controls01:10000 python taurusdevicepropertytable.py \
> cpascual/pysignalsimulator/1
> ~~~~
>
> Apart from this, simply running `python taurusdevicepropertytable.py`
> I get this exception (the widget seems to work anyway):
>
> ~~~~
> Traceback (most recent call last):
> File
> "/home/cpascual/src/taurus/lib/taurus/qt/qtgui/base/taurusbase.py",
> line 341, in filterEvent
> self.handleEvent(*evt)
> File
> "/home/cpascual/src/taurus/lib/taurus/qt/qtgui/base/taurusbase.py",
> line 1257, in handleEvent
> self._setText(text)
> TypeError: setText() takes exactly 4 arguments (2 given)
>
> ~~~~
>
> Finally,
> it would be nice if you test the implementation on taurus4-preview as
> well (I haven't yet)
>
> Can you please resubmit addressing this problems?
>
> Note: if it is too much work, I think the current implementation is
> more or less ok and can be applied with just a TODO notifying of the
> currently known limitations
>
> Cheers,
>
> Carlos
>
> On Wed 11 November 2015 11:56:56 cfalcon wrote:
> > setModel of taurus.qt.qtgui.table.TaurusPropTable does not work.
> >
> > TaurusPropTable uses the inherit setModel method of TaurusBaseWidget
> > class that does not cover the funcionality of this widget.
> >
> > Implement a setModel method acording the specifications provided
> > by S.Rubio.
> > ---
> >
> > .../qt/qtgui/table/taurusdevicepropertytable.py | 57
> >
> > ++++++++++++++-------- 1 file changed, 38 insertions(+), 19
> > deletions(-)
> >
> > diff --git a/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py
> > b/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py index
> > 9901ec3..cc9722e 100644
> > --- a/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py
> > +++ b/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py
> > @@ -31,14 +31,15 @@ __all__ = ["TaurusPropTable"]
> >
> > from taurus.external.qt import Qt, QtCore, QtGui
> > from taurus.qt.qtgui.base import TaurusBaseWidget
> >
> > -import taurus.core
> > -import PyTango
> > +import taurus
> > +from taurus.core.taurusdevice import TaurusDevice
> >
> > class TaurusPropTable(QtGui.QTableWidget, TaurusBaseWidget):
> > '''
> > This widget will show a list of properties of device and the
> > list
> >
> > of values. @todo add a frame for Add, Delete and Refresh buttons!
> >
> > '''
> >
> > + # TODO This widget is Tango-centric
> >
> > __pyqtSignals__ = ("modelChanged(const QString &)",)
> >
> > def __init__(self, parent=None, designMode = False):
> > @@ -59,6 +60,14 @@ class TaurusPropTable(QtGui.QTableWidget,
> > TaurusBaseWidget):
> > #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
> > ~
> > -~-~-~- # TaurusBaseWidget over writing methods
> >
> > #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
> > ~
> > -~-~-~- + def setModel(self, model):
> > + name_validator = TaurusDevice.getNameValidator()
> > + TaurusBaseWidget.setModel(self, model)
> > + try:
> > + _, normal_name, _ = name_validator.getNames(model)
> > + self.setTable(normal_name)
> > + except ValueError:
> > + self.debug('Wrong model!! %s' %(model))
> >
> > def sizeHint(self):
> > return QtGui.QTableWidget.sizeHint(self)
> >
> > @@ -67,7 +76,7 @@ class TaurusPropTable(QtGui.QTableWidget,
> > TaurusBaseWidget): return QtGui.QTableWidget.minimumSizeHint(self)
> >
> > def getModelClass(self):
> > - return taurus.core.taurusdatabase.TaurusDatabase
> > + return TaurusDevice
> >
> > @classmethod
> >
> > def getQtDesignerPluginInfo(cls):
> > @@ -82,7 +91,7 @@ class TaurusPropTable(QtGui.QTableWidget,
> > TaurusBaseWidget):
> > #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
> > ~
> > -~-~-~-
> >
> > model = QtCore.pyqtProperty("QString",
> > TaurusBaseWidget.getModel,
> >
> > - TaurusBaseWidget.setModel,
> > + setModel,
> >
> > TaurusBaseWidget.resetModel)
> >
> > useParentModel = QtCore.pyqtProperty("bool",
> >
> > @@ -95,30 +104,37 @@ class TaurusPropTable(QtGui.QTableWidget,
> > TaurusBaseWidget):
> > #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
> > ~
> > -~-~-~-
> >
> > @QtCore.pyqtSignature("setTable(QString)")
> >
> > - def setTable(self,dev_name):
> >
> > + def setTable(self, dev_name):
> > '''
> > This method is used to connect TaurusPropTable widget with
> >
> > TaurusClassTable widget This method fill the table with the names of
> > properties and values for the device selected in the
> > TaurusClassTable
> > '''
> > -
> > QtCore.QObject.disconnect(self,QtCore.SIGNAL("cellChanged(int,int)")
> > ,
> > self.valueChanged) - self.db = PyTango.Database()
> > + QtCore.QObject.disconnect(self,
> > QtCore.SIGNAL("cellChanged(int, int)"), +
> >
> > self.valueChanged)
> >
> > + self.db = taurus.Database()
> >
> > dev_name = str(dev_name)
> >
> > - self.list_prop =
> > list(self.db.get_device_property_list(dev_name,'*')) +
> > self.list_prop = list(self.db.get_device_property_list(dev_name,
> > '*')) self.setRowCount(len(self.list_prop))
> >
> > for i in range(0,len(self.list_prop)):
> > elem = self.list_prop[i]
> > self.setText(elem,i,0)
> >
> > -
> > self.dictionary=self.db.get_device_property(dev_name,self.list_prop)
> > - self.debug('Getting %s properties: %s ->
> > %s'%(dev_name,self.list_prop,self.dictionary)) +
> > self.dictionary= self.db.get_device_property(dev_name, +
> >
> > self.list_prop) +
> >
> > self.debug('Getting %s properties: %s -> %s' %(dev_name, +
> >
> > self.list_prop, +
> >
> > self.dictionary)) value=self.dictionary[elem]
> > - self.debug('TaurusPropsTable: property %s is type
> > %s'%(elem,type(value))) - USE_TABLES=False
> > + self.debug('TaurusPropsTable: property %s is type %s'
> > %(elem, +
> >
> > type(value)) + )
> >
> > + USE_TABLES= False
> >
> > if USE_TABLES: self.setPropertyValue(value,i,1)
> >
> > else:
> > if not isinstance(value,str): #not something like
> > an
> >
> > string #if isinstance(value,list):#type(value) is list: heigh1 =
> > len(value)
> > - value = '\n'.join(str(v) for v in value) #
> > adding new lines in between elements in the list +
> > # adding new lines in between elements in the list +
> > value = '\n'.join(str(v) for v in value)
> > self.setText(str(value),i,1)
> >
> > self.updateStyle()
> >
> > @@ -372,12 +388,15 @@ class Delegate(QtGui.QItemDelegate):
> > return size
> >
> > if __name__ == '__main__':
> > - import sys,os
> > - app = QtGui.QApplication([])
> > + import sys
> > + from taurus.qt.qtgui.application import TaurusApplication
> > + app = TaurusApplication(app_name="TaurusDevice property table")
> >
> > widget = TaurusPropTable()
> >
> > - args = sys.argv[1:]
> > - if not args: args =
> > ['tango/admin/%s'%(os.environ['TANGO_HOST'].split(':')[0])] -
> > widget.setTable(sys.args)
> > + args = sys.argv
> > + if len(args) == 1:
> > + model = 'sys/tg_test/1'
> > + else:
> > + model = str(args[1])
> > + widget.setModel(model)
> >
> > widget.show()
> > app.exec_()
> >
> > -
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
ALBA Synchrotron [http://www.albasynchrotron.es]
Carrer de la Llum 2-26
E-08290 Cerdanyola del Valles (Barcelona), Spain
E-mail: cpa...@ce...
Phone: +34 93 592 4428
+----------------------------------------------------+
|
|
From: Carlos P. <cpa...@ce...> - 2016-01-27 17:29:53
|
Forget this patch. If this approach is to be followed, some more things need to be done: -clean the _parentObj ref in TaurusModel.cleanUp -remove the TaurusAttribute.__parentDevice member (created in constructor) since it is unneeded (also, see discussion in https://sf.net/p/tauruslib/tickets/256/#02a4 ) On Wed 27 January 2016 16:36:30 cpa...@ce... wrote: > From: cpascual <cpa...@ce...> > > TaurusModel stores a weak ref to its parent. If the parent is not > referenced elsewhere, the getParentObj API does not work as expected. > Fix by making TaurusModel store a strong ref to parent instead of a > weak one. > --- > lib/taurus/core/taurusmodel.py | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/lib/taurus/core/taurusmodel.py > b/lib/taurus/core/taurusmodel.py index 4f11b9d..e5cbc4f 100644 > --- a/lib/taurus/core/taurusmodel.py > +++ b/lib/taurus/core/taurusmodel.py > @@ -58,10 +58,7 @@ class TaurusModel(Logger): > serializationMode = s_obj.getSerializationMode() > self._serialization_mode = serializationMode > > - try: > - self._parentObj = weakref.ref(parent) > - except Exception: > - self._parentObj = None > + self._parentObj = parent > self._listeners = [] > > def __str__name__(self, name): > @@ -121,8 +118,7 @@ class TaurusModel(Logger): > > #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ > -~-~-~- > > def getParentObj(self): > - if self._parentObj is None: return None > - return self._parentObj() > + return self._parentObj > > def getChildObj(self,child_name): > return None -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carrer de la Llum 2-26 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |
|
From: <cpa...@ce...> - 2016-01-27 15:36:46
|
From: cpascual <cpa...@ce...>
TaurusModel stores a weak ref to its parent. If the parent is not
referenced elsewhere, the getParentObj API does not work as expected.
Fix by making TaurusModel store a strong ref to parent instead of a weak
one.
---
lib/taurus/core/taurusmodel.py | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lib/taurus/core/taurusmodel.py b/lib/taurus/core/taurusmodel.py
index 4f11b9d..e5cbc4f 100644
--- a/lib/taurus/core/taurusmodel.py
+++ b/lib/taurus/core/taurusmodel.py
@@ -58,10 +58,7 @@ class TaurusModel(Logger):
serializationMode = s_obj.getSerializationMode()
self._serialization_mode = serializationMode
- try:
- self._parentObj = weakref.ref(parent)
- except Exception:
- self._parentObj = None
+ self._parentObj = parent
self._listeners = []
def __str__name__(self, name):
@@ -121,8 +118,7 @@ class TaurusModel(Logger):
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
def getParentObj(self):
- if self._parentObj is None: return None
- return self._parentObj()
+ return self._parentObj
def getChildObj(self,child_name):
return None
--
2.6.4
|
|
From: <sr...@ce...> - 2016-01-22 11:18:54
|
From: Sergio Rubio Manrique <sr...@ce...>
---
lib/taurus/qt/qtgui/taurusgui/taurusgui.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/taurus/qt/qtgui/taurusgui/taurusgui.py b/lib/taurus/qt/qtgui/taurusgui/taurusgui.py
index c2b8d64..fcd68d3 100644
--- a/lib/taurus/qt/qtgui/taurusgui/taurusgui.py
+++ b/lib/taurus/qt/qtgui/taurusgui/taurusgui.py
@@ -1449,8 +1449,7 @@ class TaurusGui(TaurusMainWindow):
#w = Qt.QMessageBox( self)
text = 'Currently managing %i shared data objects:\n%s' % (len(Qt.qApp.SDM.activeDataUIDs()), ', '.join(Qt.qApp.SDM.activeDataUIDs()))
nfo = Qt.qApp.SDM.info()
- w = Qt.QMessageBox (Qt.QMessageBox.Information, 'Shared Data Manager Information', text,
- buttons=Qt.QMessageBox.Close, parent=self)
+ w = Qt.QMessageBox (Qt.QMessageBox.Information, 'Shared Data Manager Information', text,Qt.QMessageBox.Close,self)
w.setDetailedText(nfo)
w.show()
self.info(nfo)
--
2.4.6
|
|
From: Carlos P. <cpa...@ce...> - 2016-01-20 12:33:32
|
Applied.
Now, could you also submit a patch for the related #252?
Thx!
On Thu 14 January 2016 15:26:24 cfalcon wrote:
> TaurusManager only set the given polling period to the default scheme
> (by default Tango). Do the indicated TODO in the
> changeDefaultPollingPeriod method, and set the given value to all
> schemes.
>
> Adapt the evaluationFactory getAttribute method following the Tango
> implementation to set the PollingPeriod for the evaluationAttributes.
> ---
> lib/taurus/core/evaluation/evalfactory.py | 15 +++++++++------
> lib/taurus/core/taurusmanager.py | 7 ++++---
> 2 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/lib/taurus/core/evaluation/evalfactory.py
> b/lib/taurus/core/evaluation/evalfactory.py index 6521057..9e4d2dc
> 100644
> --- a/lib/taurus/core/evaluation/evalfactory.py
> +++ b/lib/taurus/core/evaluation/evalfactory.py
> @@ -345,12 +345,12 @@ class EvaluationAttribute(TaurusAttribute):
> pyVar_RegExp = re.compile("[a-zA-Z_][a-zA-Z0-9_]*") #regexp for a
> variable/method name (symbol) cref_RegExp = re.compile("\{(.+?)\}")
> #regexp for references to other taurus models within operation model
> names
>
> - def __init__(self, name, parent, storeCallback = None):
> - self.call__init__(TaurusAttribute, name, parent,
> storeCallback=storeCallback) -
> + def __init__(self, name, parent, **kwargs):
> + self.call__init__(TaurusAttribute, name, parent, **kwargs)
> +
> self._value = TaurusAttrValue()
> self._value.config.writable = False #Evaluation Attributes
> are always read-only (at least for now) - self._references =
> []
> + self._references = []
> self._validator= self.getNameValidator()
> self._transformation = None
> # reference to the configuration object
> @@ -736,7 +736,7 @@ class EvaluationFactory(Singleton, TaurusFactory,
> Logger): d = DevClass(fullname, parent=db,
> storeCallback=self._storeDev) #use full name return d
>
> - def getAttribute(self, attr_name):
> + def getAttribute(self, attr_name, **kwargs):
> """Obtain the object corresponding to the given attribute
> name. If the corresponding attribute already exists, the existing
> instance is returned. Otherwise a new instance is stored and
> returned. The evaluator @@ -759,7 +759,10 @@ class
> EvaluationFactory(Singleton, TaurusFactory, Logger): a =
> self.eval_attrs.get(fullname, None)
> if a is None: #if the full name is not there, create one
> dev =
> self.getDevice(validator.getDeviceName(attr_name)) - a
> = EvaluationAttribute(fullname, parent=dev,
> storeCallback=self._storeAttr) #use full name +
> kwargs['storeCallback'] = self._storeAttr
> + if not kwargs.has_key('pollingPeriod'):
> + kwargs['pollingPeriod'] =
> self.getDefaultPollingPeriod() + a =
> EvaluationAttribute(fullname, parent=dev, **kwargs) #use full name
> return a
>
> def getConfiguration(self, param):
> diff --git a/lib/taurus/core/taurusmanager.py
> b/lib/taurus/core/taurusmanager.py index d140b26..de116b8 100644
> --- a/lib/taurus/core/taurusmanager.py
> +++ b/lib/taurus/core/taurusmanager.py
> @@ -361,9 +361,10 @@ class TaurusManager(Singleton, Logger):
> o.execute()
>
> def changeDefaultPollingPeriod(self, period):
> - self.getFactory()().changeDefaultPollingPeriod(period)
> - # todo: go through all known plugin factories and change
> their polling - # period
> + plugin_classes = self._get_plugin_classes()
> + for plugin_class in plugin_classes:
> + scheme = plugin_class.schemes[0]
> +
> self.getFactory(scheme)().changeDefaultPollingPeriod(period)
>
> def __str__name__(self, name):
> return '{0}({1})'.format(self.__class__.__name__, name)
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
ALBA Synchrotron [http://www.albasynchrotron.es]
Carrer de la Llum 2-26
E-08290 Cerdanyola del Valles (Barcelona), Spain
E-mail: cpa...@ce...
Phone: +34 93 592 4428
+----------------------------------------------------+
|
|
From: Carlos P. <cpa...@ce...> - 2016-01-20 12:03:52
|
Applied to develop with reworded subject
On Wed 13 January 2016 11:09:30 cfalcon wrote:
> The handleEvent method of TaurusTrend2DItem raises an AttributeError
> when the plot object is not present.
>
> Fix it, ignoring the events when the plot object is None.
> ---
> lib/taurus/qt/qtgui/extra_guiqwt/image.py | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/image.py
> b/lib/taurus/qt/qtgui/extra_guiqwt/image.py index e20a766..087f623
> 100644
> --- a/lib/taurus/qt/qtgui/extra_guiqwt/image.py
> +++ b/lib/taurus/qt/qtgui/extra_guiqwt/image.py
> @@ -256,8 +256,10 @@ class TaurusTrend2DItem(XYImageItem,
> TaurusBaseComponent): if evt_value is None or
> getattr(evt_value,'value', None) is None: self.debug('Ignoring event
> from %s'%repr(evt_src)) return
> -
> +
> plot = self.plot()
> + if plot is None:
> + return
>
> #initialization
> ySize = len(evt_value.value)
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
ALBA Synchrotron [http://www.albasynchrotron.es]
Carrer de la Llum 2-26
E-08290 Cerdanyola del Valles (Barcelona), Spain
E-mail: cpa...@ce...
Phone: +34 93 592 4428
+----------------------------------------------------+
|
|
From: <cpa...@ce...> - 2016-01-20 11:51:27
|
From: cpascual <cpa...@ce...>
Handle the case of applying an empty model list with the model selection
tool in extra_guiqwt.
---
lib/taurus/qt/qtgui/extra_guiqwt/tools.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/tools.py b/lib/taurus/qt/qtgui/extra_guiqwt/tools.py
index 5ecd2bd..0c55967 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/tools.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/tools.py
@@ -100,7 +100,10 @@ class TaurusModelChooserTool(CommandTool):
models, ok = TaurusModelChooser.modelChooserDlg(parent=plot, selectables=[TaurusElementType.Attribute], singleModel=self.singleModel)
if ok:
if self.singleModel:
- self.manager.setModel(models[0])
+ if models:
+ self.manager.setModel(models[0])
+ else:
+ self.manager.setModel('')
else:
self.manager.setModel(models)
--
2.6.4
|
|
From: <cpa...@ce...> - 2016-01-20 10:33:42
|
From: cpascual <cpa...@ce...> When using a TaurusValue customized with an extra widget, the grid layout behaves in an unexpected way regarding to its rows/columns stretch (see http://sf.net/p/tauruslib/tickets/142/#f4e4/9e68). Prevent this by inserting a spacer in the extrawidget column if no extrawidget is used. --- lib/taurus/qt/qtgui/panel/taurusvalue.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/taurus/qt/qtgui/panel/taurusvalue.py b/lib/taurus/qt/qtgui/panel/taurusvalue.py index 543ba0e..dff58d2 100644 --- a/lib/taurus/qt/qtgui/panel/taurusvalue.py +++ b/lib/taurus/qt/qtgui/panel/taurusvalue.py @@ -833,11 +833,17 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget): 1, 1, -1, alignment) def addExtraWidgetToLayout(self): - if self._extraWidget is not None and self.parent() is not None: - alignment = getattr(self._extraWidget, 'layoutAlignment', - Qt.Qt.AlignmentFlag(0)) - self.parent().layout().addWidget(self._extraWidget, self._row, - 5, 1, 1, alignment) + parent = self.parent() + if parent is not None: + if self._extraWidget is None: + # Adding this spacer is some voodoo magic to avoid bug #142 + # See: http://sf.net/p/tauruslib/tickets/142/ + parent.layout().addItem(Qt.QSpacerItem(0, 0), self._row, 5) + else: + alignment = getattr(self._extraWidget, 'layoutAlignment', + Qt.Qt.AlignmentFlag(0)) + parent.layout().addWidget(self._extraWidget, self._row, + 5, 1, 1, alignment) @Qt.pyqtSignature("parentModelChanged(const QString &)") def parentModelChanged(self, parentmodel_name): -- 2.6.4 |
|
From: Carlos P. <cpa...@ce...> - 2016-01-20 10:25:56
|
Sorry, I just realized that this patch is wrong. Ignore it. I'll send a new one right now. On Wed 20 January 2016 11:02:55 cpa...@ce... wrote: > From: cpascual <cpa...@ce...> > > When using a TaurusValue customized with an extra widget, the grid > layout behaves in an unexpected way regarding to its rows/columns > stretch (see http://sf.net/p/tauruslib/tickets/142/#f4e4/9e68). > Prevent this by inserting a spacer in the extrawidget column if no > extrawidget is used. > --- > lib/taurus/qt/qtgui/panel/taurusvalue.py | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/lib/taurus/qt/qtgui/panel/taurusvalue.py > b/lib/taurus/qt/qtgui/panel/taurusvalue.py index 543ba0e..83db8ec > 100644 > --- a/lib/taurus/qt/qtgui/panel/taurusvalue.py > +++ b/lib/taurus/qt/qtgui/panel/taurusvalue.py > @@ -350,7 +350,7 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget): > > #insert self into the 0-column > pl.addWidget(self, self._row, 0) #this widget is invisible > (except in design mode) - > + > #Create/update the subwidgets (this also inserts them in the > layout) if not self._designMode: #in design mode, no subwidgets are > created self.updateLabelWidget() > @@ -833,7 +833,11 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget): > 1, 1, -1, alignment) > > def addExtraWidgetToLayout(self): > - if self._extraWidget is not None and self.parent() is not > None: + if self._extraWidget is None: > + # Adding this spacer is some voodoo magic to avoid bug > #142 + # See: http://sf.net/p/tauruslib/tickets/142/ > + self.parent().layout().addItem(Qt.QSpacerItem(0, 0), > self._row, 5) + elif self.parent() is not None: > alignment = getattr(self._extraWidget, 'layoutAlignment', > Qt.Qt.AlignmentFlag(0)) > self.parent().layout().addWidget(self._extraWidget, > self._row, -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carrer de la Llum 2-26 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |
|
From: <cpa...@ce...> - 2016-01-20 10:03:25
|
From: cpascual <cpa...@ce...> When using a TaurusValue customized with an extra widget, the grid layout behaves in an unexpected way regarding to its rows/columns stretch (see http://sf.net/p/tauruslib/tickets/142/#f4e4/9e68). Prevent this by inserting a spacer in the extrawidget column if no extrawidget is used. --- lib/taurus/qt/qtgui/panel/taurusvalue.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/taurus/qt/qtgui/panel/taurusvalue.py b/lib/taurus/qt/qtgui/panel/taurusvalue.py index 543ba0e..83db8ec 100644 --- a/lib/taurus/qt/qtgui/panel/taurusvalue.py +++ b/lib/taurus/qt/qtgui/panel/taurusvalue.py @@ -350,7 +350,7 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget): #insert self into the 0-column pl.addWidget(self, self._row, 0) #this widget is invisible (except in design mode) - + #Create/update the subwidgets (this also inserts them in the layout) if not self._designMode: #in design mode, no subwidgets are created self.updateLabelWidget() @@ -833,7 +833,11 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget): 1, 1, -1, alignment) def addExtraWidgetToLayout(self): - if self._extraWidget is not None and self.parent() is not None: + if self._extraWidget is None: + # Adding this spacer is some voodoo magic to avoid bug #142 + # See: http://sf.net/p/tauruslib/tickets/142/ + self.parent().layout().addItem(Qt.QSpacerItem(0, 0), self._row, 5) + elif self.parent() is not None: alignment = getattr(self._extraWidget, 'layoutAlignment', Qt.Qt.AlignmentFlag(0)) self.parent().layout().addWidget(self._extraWidget, self._row, -- 2.6.4 |
|
From: Carlos P. <cpa...@ce...> - 2016-01-20 10:00:05
|
Hi, your patch fixes the problem, but it adds many unnecessary spacers. I will send (right now) an alternative patch based on the same idea as yours but which is much less "aggressive". It works for me, but I would prefer someonelse to try and integrate it. On Tue 12 January 2016 16:24:40 cfalcon wrote: > TaurusForm layout missalignment when using TaurusValue with an extra > widget. The error comes because there are rows with differents > columns. > > A workaround to fix the problem is create the empty placeholders > during the creation of the taurusvalue. > --- > lib/taurus/qt/qtgui/panel/taurusvalue.py | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/lib/taurus/qt/qtgui/panel/taurusvalue.py > b/lib/taurus/qt/qtgui/panel/taurusvalue.py index 543ba0e..c69b07a > 100644 > --- a/lib/taurus/qt/qtgui/panel/taurusvalue.py > +++ b/lib/taurus/qt/qtgui/panel/taurusvalue.py > @@ -350,7 +350,14 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget): > > #insert self into the 0-column > pl.addWidget(self, self._row, 0) #this widget is invisible > (except in design mode) - > + > + #Add QSpacerItem as placeholder for the subwidgets > + pl.addItem(Qt.QSpacerItem(1, 0), self._row, 1) > + pl.addItem(Qt.QSpacerItem(1, 0), self._row, 2) > + pl.addItem(Qt.QSpacerItem(1, 0), self._row, 3) > + pl.addItem(Qt.QSpacerItem(1, 0), self._row, 4) > + pl.addItem(Qt.QSpacerItem(1, 0), self._row, 5) > + > #Create/update the subwidgets (this also inserts them in the > layout) if not self._designMode: #in design mode, no subwidgets are > created self.updateLabelWidget() -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carrer de la Llum 2-26 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |
|
From: <cpa...@ce...> - 2016-01-19 15:08:18
|
From: cpascual <cpa...@ce...>
When launching taurusform as an standalone application, store the window
geometry in the config dict/file so that it is restored when loading the
stored settings.
---
lib/taurus/qt/qtgui/panel/taurusform.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/taurus/qt/qtgui/panel/taurusform.py b/lib/taurus/qt/qtgui/panel/taurusform.py
index 99c2ec5..4b38c58 100644
--- a/lib/taurus/qt/qtgui/panel/taurusform.py
+++ b/lib/taurus/qt/qtgui/panel/taurusform.py
@@ -947,6 +947,10 @@ def taurusFormMain():
dialog.setModifiableByUser(True)
dialog.setModelInConfig(True)
dialog.setWindowTitle(options.window_name)
+
+ # Make sure the window size and position are restored
+ dialog.registerConfigProperty(dialog.saveGeometry, dialog.restoreGeometry,
+ 'MainWindowGeometry')
from taurus.qt.qtgui.resource import getThemeIcon
quitApplicationAction = Qt.QAction(getThemeIcon("process-stop"),'Close Form', dialog)
--
2.6.4
|
|
From: Carlos P. <cpa...@ce...> - 2016-01-19 14:34:24
|
Hi, According to our release schedule, we should make an official release of Taurus during this month. So this email is to coordinate the Jan16 release of Taurus and give the community an update of the release plans. For Jan16 we will release Taurus 3.7.0, which will fix some bugs and provide a few new features (see [1]), but not introducing large changes with respect to v 3.6. Then, immediately after that release we intend to start integrating the code of Taurus 4 into the develop branch. See [2] for more details. Here at Alba we'll focus the next week on solving as much as possible from [1]. If you think that some specific ticket should/can be closed before this release, please mention it (or, even better, provide a patch) ;) Cheers, Carlos [1] http://sf.net/p/tauruslib/tickets/milestone/Jan16/ [2] http://sf.net/p/tauruslib/taurus-devel/message/34643400/ -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carrer de la Llum 2-26 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |
|
From: cfalcon <cf...@ce...> - 2016-01-18 16:46:01
|
addSafe and removeSafe methods of SafeEvaluator class do not modify
the _originalSafeDict attribute used in resetmoSafe to restore the
dict, so the modification of the safe_dict are not permanent.
Add a flag, "permanent" by default False, in those methods
to do also the modification in the _originalSafeDict, when the
flag is True.
---
lib/taurus/core/util/safeeval.py | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/lib/taurus/core/util/safeeval.py b/lib/taurus/core/util/safeeval.py
index 77cd312..ee9d5f6 100644
--- a/lib/taurus/core/util/safeeval.py
+++ b/lib/taurus/core/util/safeeval.py
@@ -72,16 +72,23 @@ class SafeEvaluator:
"""safe eval"""
return eval(expr, {"__builtins__":None}, self.safe_dict)
- def addSafe(self,safedict):
+ def addSafe(self,safedict, permanent=False):
"""The values in safedict will be evaluable (whitelisted)
The safedict is as follows: {"eval_name":object, ...}. The evaluator will interpret eval_name as object.
"""
self.safe_dict.update(safedict)
-
- def removeSafe(self, name):
+ if permanent:
+ self._originalSafeDict.update(safedict)
+
+ def removeSafe(self, name, permanent=False):
"""Removes an object from the whitelist"""
self.safe_dict.pop(name)
-
+ if permanent:
+ try:
+ self._originalSafeDict.pop(name)
+ except KeyError:
+ pass
+
def resetSafe(self):
"""restores the safe dict with wich the evaluator was instantiated"""
self.safe_dict = self._originalSafeDict.copy()
--
2.4.0
|
|
From: cfalcon <cf...@ce...> - 2016-01-14 14:26:33
|
TaurusManager only set the given polling period to the default scheme
(by default Tango). Do the indicated TODO in the changeDefaultPollingPeriod
method, and set the given value to all schemes.
Adapt the evaluationFactory getAttribute method following the Tango
implementation to set the PollingPeriod for the evaluationAttributes.
---
lib/taurus/core/evaluation/evalfactory.py | 15 +++++++++------
lib/taurus/core/taurusmanager.py | 7 ++++---
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/lib/taurus/core/evaluation/evalfactory.py b/lib/taurus/core/evaluation/evalfactory.py
index 6521057..9e4d2dc 100644
--- a/lib/taurus/core/evaluation/evalfactory.py
+++ b/lib/taurus/core/evaluation/evalfactory.py
@@ -345,12 +345,12 @@ class EvaluationAttribute(TaurusAttribute):
pyVar_RegExp = re.compile("[a-zA-Z_][a-zA-Z0-9_]*") #regexp for a variable/method name (symbol)
cref_RegExp = re.compile("\{(.+?)\}") #regexp for references to other taurus models within operation model names
- def __init__(self, name, parent, storeCallback = None):
- self.call__init__(TaurusAttribute, name, parent, storeCallback=storeCallback)
-
+ def __init__(self, name, parent, **kwargs):
+ self.call__init__(TaurusAttribute, name, parent, **kwargs)
+
self._value = TaurusAttrValue()
self._value.config.writable = False #Evaluation Attributes are always read-only (at least for now)
- self._references = []
+ self._references = []
self._validator= self.getNameValidator()
self._transformation = None
# reference to the configuration object
@@ -736,7 +736,7 @@ class EvaluationFactory(Singleton, TaurusFactory, Logger):
d = DevClass(fullname, parent=db, storeCallback=self._storeDev) #use full name
return d
- def getAttribute(self, attr_name):
+ def getAttribute(self, attr_name, **kwargs):
"""Obtain the object corresponding to the given attribute name. If the
corresponding attribute already exists, the existing instance is
returned. Otherwise a new instance is stored and returned. The evaluator
@@ -759,7 +759,10 @@ class EvaluationFactory(Singleton, TaurusFactory, Logger):
a = self.eval_attrs.get(fullname, None)
if a is None: #if the full name is not there, create one
dev = self.getDevice(validator.getDeviceName(attr_name))
- a = EvaluationAttribute(fullname, parent=dev, storeCallback=self._storeAttr) #use full name
+ kwargs['storeCallback'] = self._storeAttr
+ if not kwargs.has_key('pollingPeriod'):
+ kwargs['pollingPeriod'] = self.getDefaultPollingPeriod()
+ a = EvaluationAttribute(fullname, parent=dev, **kwargs) #use full name
return a
def getConfiguration(self, param):
diff --git a/lib/taurus/core/taurusmanager.py b/lib/taurus/core/taurusmanager.py
index d140b26..de116b8 100644
--- a/lib/taurus/core/taurusmanager.py
+++ b/lib/taurus/core/taurusmanager.py
@@ -361,9 +361,10 @@ class TaurusManager(Singleton, Logger):
o.execute()
def changeDefaultPollingPeriod(self, period):
- self.getFactory()().changeDefaultPollingPeriod(period)
- # todo: go through all known plugin factories and change their polling
- # period
+ plugin_classes = self._get_plugin_classes()
+ for plugin_class in plugin_classes:
+ scheme = plugin_class.schemes[0]
+ self.getFactory(scheme)().changeDefaultPollingPeriod(period)
def __str__name__(self, name):
return '{0}({1})'.format(self.__class__.__name__, name)
--
2.4.0
|
|
From: Sergi R. <sr...@ce...> - 2016-01-13 16:19:23
|
Hi minoans, Apart of the last 5 patches I sent to the mailing list, I confirm that the patches needed in QWheel/Tauruswheel widgets are already corrected in the develop branch. Thanks, Sergi Rubio |
|
From: Sergi R. <sr...@ce...> - 2016-01-13 16:16:04
|
Although not critical, this hook (or a similar implementation) would allow specific applications to modify/bypass the event management if needed. I'm using it to implement event grouping in synoptics, Sergi Rubio On 01/13/2016 05:08 PM, sr...@ce... wrote: > From: Sergio Rubio Manrique <sr...@ce...> > > --- > lib/taurus/core/util/eventfilters.py | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/lib/taurus/core/util/eventfilters.py b/lib/taurus/core/util/eventfilters.py > index 8dc52a1..52eb0ba 100644 > --- a/lib/taurus/core/util/eventfilters.py > +++ b/lib/taurus/core/util/eventfilters.py > @@ -156,8 +156,7 @@ class RepeatedEventFilter(object): > self._lastValues[(s, t)] = new_value > return s, t, v > > - > -def filterEvent(evt_src=-1, evt_type=-1, evt_value=-1, filters=()): > +def filterEvent(evt_src=-1, evt_type=-1, evt_value=-1 ,filters=(), hook=None): > """The event is processed by each and all filters in strict order > unless one of them returns None (in which case the event is discarded) > > @@ -168,6 +167,8 @@ def filterEvent(evt_src=-1, evt_type=-1, evt_value=-1, filters=()): > either None (to discard the event) or the tuple (with > possibly transformed values) of > (evt_src, evt_type, evt_value) > + :param hook: a callable to be executed if the event passed all the filters; > + if None, then just returns the event > > :return: (None or tuple) The result of piping the event through the given > filters. > @@ -178,4 +179,8 @@ def filterEvent(evt_src=-1, evt_type=-1, evt_value=-1, filters=()): > evt = f(*evt) > if evt is None: > return None > - return evt > + > + if hook: > + return hook(*evt) > + else: > + return evt |
|
From: <sr...@ce...> - 2016-01-13 16:08:37
|
From: Sergio Rubio Manrique <sr...@ce...>
---
lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py b/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py
index 9901ec3..6f4f59c 100644
--- a/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py
+++ b/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py
@@ -31,8 +31,7 @@ __all__ = ["TaurusPropTable"]
from taurus.external.qt import Qt, QtCore, QtGui
from taurus.qt.qtgui.base import TaurusBaseWidget
-import taurus.core
-import PyTango
+import taurus,taurus.core
class TaurusPropTable(QtGui.QTableWidget, TaurusBaseWidget):
'''
@@ -67,7 +66,7 @@ class TaurusPropTable(QtGui.QTableWidget, TaurusBaseWidget):
return QtGui.QTableWidget.minimumSizeHint(self)
def getModelClass(self):
- return taurus.core.taurusdatabase.TaurusDatabase
+ return taurus.core.TaurusDevice
@classmethod
def getQtDesignerPluginInfo(cls):
@@ -94,6 +93,10 @@ class TaurusPropTable(QtGui.QTableWidget, TaurusBaseWidget):
# My methods
#-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
+ def setModel(self,model):
+ TaurusBaseWidget.setModel(self,model)
+ self.setTable(model)
+
@QtCore.pyqtSignature("setTable(QString)")
def setTable(self,dev_name):
'''
@@ -101,7 +104,7 @@ class TaurusPropTable(QtGui.QTableWidget, TaurusBaseWidget):
This method fill the table with the names of properties and values for the device selected in the TaurusClassTable
'''
QtCore.QObject.disconnect(self,QtCore.SIGNAL("cellChanged(int,int)"),self.valueChanged)
- self.db = PyTango.Database()
+ self.db = taurus.Database()
dev_name = str(dev_name)
self.list_prop = list(self.db.get_device_property_list(dev_name,'*'))
self.setRowCount(len(self.list_prop))
@@ -377,7 +380,7 @@ if __name__ == '__main__':
widget = TaurusPropTable()
args = sys.argv[1:]
if not args: args = ['tango/admin/%s'%(os.environ['TANGO_HOST'].split(':')[0])]
- widget.setTable(sys.args)
+ widget.setTable(args)
widget.show()
app.exec_()
--
2.4.6
|
|
From: <sr...@ce...> - 2016-01-13 16:08:37
|
From: Sergio Rubio Manrique <sr...@ce...>
---
lib/taurus/core/util/eventfilters.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/taurus/core/util/eventfilters.py b/lib/taurus/core/util/eventfilters.py
index 8dc52a1..52eb0ba 100644
--- a/lib/taurus/core/util/eventfilters.py
+++ b/lib/taurus/core/util/eventfilters.py
@@ -156,8 +156,7 @@ class RepeatedEventFilter(object):
self._lastValues[(s, t)] = new_value
return s, t, v
-
-def filterEvent(evt_src=-1, evt_type=-1, evt_value=-1, filters=()):
+def filterEvent(evt_src=-1, evt_type=-1, evt_value=-1 ,filters=(), hook=None):
"""The event is processed by each and all filters in strict order
unless one of them returns None (in which case the event is discarded)
@@ -168,6 +167,8 @@ def filterEvent(evt_src=-1, evt_type=-1, evt_value=-1, filters=()):
either None (to discard the event) or the tuple (with
possibly transformed values) of
(evt_src, evt_type, evt_value)
+ :param hook: a callable to be executed if the event passed all the filters;
+ if None, then just returns the event
:return: (None or tuple) The result of piping the event through the given
filters.
@@ -178,4 +179,8 @@ def filterEvent(evt_src=-1, evt_type=-1, evt_value=-1, filters=()):
evt = f(*evt)
if evt is None:
return None
- return evt
+
+ if hook:
+ return hook(*evt)
+ else:
+ return evt
--
2.4.6
|
|
From: <sr...@ce...> - 2016-01-13 16:08:37
|
From: Sergio Rubio Manrique <sr...@ce...>
---
lib/taurus/qt/qtgui/tree/taurusdevicetree.py | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/lib/taurus/qt/qtgui/tree/taurusdevicetree.py b/lib/taurus/qt/qtgui/tree/taurusdevicetree.py
index 7f18130..27b67b7 100644
--- a/lib/taurus/qt/qtgui/tree/taurusdevicetree.py
+++ b/lib/taurus/qt/qtgui/tree/taurusdevicetree.py
@@ -825,7 +825,7 @@ class TaurusDevTree(TaurusTreeNodeContainer,Qt.QTreeWidget, TaurusBaseWidget):
@Qt.pyqtSignature("findInTree(const QString &)")
def findInTree(self,regexp,collapseAll=None,exclude=None,select=True,queue=True):
- self.trace( 'In TauTree.findInTree(%s)'%regexp)
+ self.trace( 'In TaurusDevTree.findInTree(%s)'%regexp)
if collapseAll is None: collapseAll = self.collapsing_search
regexp = str(regexp).lower().strip()
exclude = (lambda x: x if hasattr(x,'__iter__') else [x])(exclude or self.excludeFromSearch or [])
@@ -1075,13 +1075,13 @@ class TaurusDevTree(TaurusTreeNodeContainer,Qt.QTreeWidget, TaurusBaseWidget):
node.ContextMenu.append(("Open Panel", self.showPanel))
node.ContextMenu.append(("Show Attributes",self.addAttrToNode))
+ node.ContextMenu.append(("Show Properties", self.showProperties))
if self.getNodeAdmin(node):
node.ContextMenu.append(("Go to %s"%self.getNodeAdmin(node),\
lambda p=self.getNodeAdmin(node): p and self.findInTree(p)
))
if not hasattr(node,'ExpertMenu'): setattr(node,'ExpertMenu',self.ExpertMenu)#[])
- if not 'Show Properties' in [k for k,a in node.ExpertMenu]:
- node.ExpertMenu.append(("Show Properties", self.showProperties))
+ if not 'Test Device' in [k for k,a in node.ExpertMenu]:
def test_device():
device = str(self.getNodeDeviceName())
if device:
@@ -1454,6 +1454,20 @@ class TaurusSearchTree(TaurusWidget):
"expandAll",
"loadTree",
)
+
+ #THIS SLOTS ARE NEEDED BECAUSE METHODS REDIRECTED DYNAMICALLY ARE NOT VISIBLE TO THE SharedDataManager OBJECT
+ def setTangoHost(self,*a,**k): self.tree.setTangoHost(*a,**k)
+ def addModels(self,*a,**k): self.tree.addModels(*a,**k)
+ def setModel(self,*a,**k): self.tree.setModel(*a,**k)
+ def setModelCheck(self,*a,**k): self.tree.setModelCheck(*a,**k)
+ def setTree(self,*a,**k): self.tree.setTree(*a,**k)
+ def findInTree(self,*a,**k): self.tree.findInTree(*a,**k)
+ def expandAll(self,*a,**k): self.tree.expandAll(*a,**k)
+ def loadTree(self,*a,**k): self.tree.loadTree(*a,**k)
+ @staticmethod
+ def setDefaultPanelClass(*a,**k): self.tree.setDefaultPanelClass(*a,**k)
+ @staticmethod
+ def setDefaultAttrFilter(*a,**k): self.tree.setDefaultAttrFilter(*a,**k)
@staticmethod
def method_forwarder(*args,**kwargs):
--
2.4.6
|
|
From: <sr...@ce...> - 2016-01-13 16:08:34
|
From: Sergio Rubio Manrique <sr...@ce...>
---
lib/taurus/qt/qtgui/panel/taurusvalue.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/taurus/qt/qtgui/panel/taurusvalue.py b/lib/taurus/qt/qtgui/panel/taurusvalue.py
index 543ba0e..194ebf0 100644
--- a/lib/taurus/qt/qtgui/panel/taurusvalue.py
+++ b/lib/taurus/qt/qtgui/panel/taurusvalue.py
@@ -318,7 +318,7 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget):
used, it returns the switcher's writeWidget instead of None.
'''
if followCompact and self.isCompact():
- return getattr(self._readWidget,'writeWidget', None)
+ return self._readWidget.writeWidget
return self._writeWidget
def unitsWidget(self):
--
2.4.6
|
|
From: <sr...@ce...> - 2016-01-13 16:08:27
|
From: Sergio Rubio Manrique <sr...@ce...>
---
lib/taurus/core/tango/search.py | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/lib/taurus/core/tango/search.py b/lib/taurus/core/tango/search.py
index 0cc8428..f0c2dec 100644
--- a/lib/taurus/core/tango/search.py
+++ b/lib/taurus/core/tango/search.py
@@ -35,25 +35,34 @@ import taurus
###############################################################################
# Utils
-def searchCl(regexp,target):
- return re.search(extend_regexp(regexp).lower(),target.lower())
+def searchCl(regexp,target,extend=False):
+ return re.search((extend_regexp if extend else toCl)(regexp),target.lower())
-def matchCl(regexp,target):
- return re.match(extend_regexp(regexp).lower(),target.lower())
+def matchCl(regexp,target,extend=False):
+ return re.match((extend_regexp if extend else toCl)(regexp),target.lower())
def is_regexp(s):
return any(c in s for c in '.*[]()+?')
-def extend_regexp(s):
- s = str(s).strip()
- if '.*' not in s:
- s = s.replace('*','.*')
- if '.*' not in s:
- if ' ' in s: s = s.replace(' ','.*')
+def toCl(exp,terminate=False,wildcards=('*',' '),lower=True):
+ """ Convertes exp into a Careless Expression.
+ Replaces * by .* and ? by . in the given expression.
+ """
+ exp = str(exp).strip()
+ if lower: exp = exp.lower()
+ if not any(s in exp for s in ('.*','\*')):
+ for w in wildcards:
+ exp = exp.replace(w,'.*')
+ if terminate and not exp.strip().endswith('$'): exp += '$'
+ exp = exp.replace('(?p<','(?P<') #Preventing missing P<name> clausses
+ return exp
+
+def extend_regexp(r):
+ s = toCl(r,terminate=True)
+ if '.*' not in r:
if '/' not in s: s = '.*'+s+'.*'
else:
if not s.startswith('^'): s = '^'+s
- if not s.endswith('$'): s = s+'$'
return s
def isString(s):
@@ -99,7 +108,7 @@ def get_matching_devices(expressions,limit=0,exported=False):
#all_devs.extend('%s/%s'%(host,d) for d in odb.get_device_name('*','*'))
result = [e for e in expressions if e.lower() in all_devs]
expressions = [extend_regexp(e) for e in expressions if e not in result]
- result.extend(filter(lambda d: any(matchCl(extend_regexp(e),d) for e in expressions),all_devs))
+ result.extend(filter(lambda d: any(matchCl(e,d,extend=False) for e in expressions),all_devs))
return result
def get_device_for_alias(alias):
@@ -113,11 +122,13 @@ def get_alias_for_device(dev):
db = taurus.Database()
try:
result = db.get_alias(dev) #.get_database_device().DbGetDeviceAlias(dev)
+ assert(result!='nada','no alias found')
return result
except Exception,e:
if 'no alias found' in str(e).lower(): return None
return None #raise e
def get_alias_dict(exp='*'):
+ #Returns an alias/device dict
tango = taurus.Database()
return dict((k,tango.get_device_alias(k)) for k in tango.get_device_alias_list(exp))
\ No newline at end of file
--
2.4.6
|
|
From: cfalcon <cf...@ce...> - 2016-01-13 10:09:39
|
The handleEvent method of TaurusTrend2DItem raises an AttributeError
when the plot object is not present.
Fix it, ignoring the events when the plot object is None.
---
lib/taurus/qt/qtgui/extra_guiqwt/image.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/image.py b/lib/taurus/qt/qtgui/extra_guiqwt/image.py
index e20a766..087f623 100644
--- a/lib/taurus/qt/qtgui/extra_guiqwt/image.py
+++ b/lib/taurus/qt/qtgui/extra_guiqwt/image.py
@@ -256,8 +256,10 @@ class TaurusTrend2DItem(XYImageItem, TaurusBaseComponent):
if evt_value is None or getattr(evt_value,'value', None) is None:
self.debug('Ignoring event from %s'%repr(evt_src))
return
-
+
plot = self.plot()
+ if plot is None:
+ return
#initialization
ySize = len(evt_value.value)
--
2.4.0
|