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
|
Sep
|
Oct
|
Nov
|
Dec
|
From: cpascual <cpa...@ce...> - 2015-07-10 12:51:44
|
Hi, these are (partial)fixes for mem leaks in Taurusplot . After applying them, the leaks are stopped in debian (AFAIK) and reduced in suse11. [PATCH 1/2] Fix memleak in TaurusPlot (partial fix of bug-171) [PATCH 2/2] Change width of default pen (workaround for bug-171) |
From: Carlos P. <cpa...@ce...> - 2015-07-08 10:44:47
|
Both patches have been integrated into develop (with some changes). On Thu 2 July 2015 17:28:32 cfalcon wrote: > Improve the already existing ExternalApp buttons mechanism by > allowing the user to add/remove buttons on execution time. > > Adapt the existing widgets to manage the external applications. > Add options to create and delete the external applications. > --- > lib/taurus/qt/qtgui/taurusgui/taurusgui.py | 137 > +++++++++++++++++++++++++++-- 1 file changed, 129 insertions(+), 8 > deletions(-) > > diff --git a/lib/taurus/qt/qtgui/taurusgui/taurusgui.py > b/lib/taurus/qt/qtgui/taurusgui/taurusgui.py index 2d2fbfe..2a0f890 > 100644 > --- a/lib/taurus/qt/qtgui/taurusgui/taurusgui.py > +++ b/lib/taurus/qt/qtgui/taurusgui/taurusgui.py > @@ -46,10 +46,13 @@ from taurus.qt.qtcore.communication import > SharedDataManager from taurus.qt.qtgui.util import > TaurusWidgetFactory > from taurus.qt.qtgui.base import TaurusBaseWidget, > TaurusBaseComponent from taurus.qt.qtgui.container import > TaurusMainWindow > -from taurus.qt.qtgui.taurusgui.utils import ExternalApp, > PanelDescription, \ - ToolBarDescription, AppletDescription > +from taurus.qt.qtgui.taurusgui.utils import (ExternalApp, > PanelDescription, + > ToolBarDescription, + > AppletDescription) +from taurus.qt.qtgui.taurusgui.appsettingswizard > import ExternalAppEditor from taurus.qt.qtgui.panel import > QDoubleListDlg > from taurus.qt.qtgui.util.ui import UILoadable > +from taurus.qt.qtgui.taurusgui.utils import ExternalAppAction > > > @UILoadable(with_ui='ui') > @@ -272,11 +275,18 @@ class TaurusGui(TaurusMainWindow): > self.defaultConfigRecursionDepth = configRecursionDepth > > self.__panels = {} > + self.__external_app = {} > + self.__external_app_actions = {} > + self._external_app_names = [] > + self.__permanet_ext_apps = [] > self.__synoptics = [] > self.__instrumentToPanelMap = {} > self.__panelToInstrumentMap = {} > self.setDockNestingEnabled(True) > > + self.registerConfigProperty(self._getPermanentExternalApps, > + self._setPermanentExternalApps, > + 'permanentexternalapps') > self.registerConfigProperty(self._getPermanentCustomPanels, > self._setPermanentCustomPanels, 'permanentCustomPanels') > self.registerConfigProperty(self.getAllInstrumentAssociations, > self.setAllInstrumentAssociations, 'instrumentAssociation') > > @@ -288,11 +298,11 @@ class TaurusGui(TaurusMainWindow): > > self.__initPanelsMenu() > self.__initViewMenu() > - self.__initPanelsToolBar() > self.__initQuickAccessToolBar() > self.__initJorgBar() > self.__initSharedDataConnections() > self.__initToolsMenu() > + self.__initPanelsToolBar() > > self.loadConfiguration(confname) > > @@ -374,6 +384,7 @@ class TaurusGui(TaurusMainWindow): > self.panelsToolBar = self.addToolBar("Panels") > self.panelsToolBar.setObjectName("PanelsToolbar") > self.panelsToolBar.addAction(self.newPanelAction) > + self.panelsToolBar.addAction(self.newExternalApp) > > self.viewToolBarsMenu.addAction(self.panelsToolBar.toggleViewAction() > ) > > def __initQuickAccessToolBar(self): > @@ -406,9 +417,71 @@ class TaurusGui(TaurusMainWindow): > def __initToolsMenu(self): > if self.toolsMenu is None: > self.toolsMenu = Qt.QMenu("Tools") > - > self.toolsMenu.addAction(getIcon(":/apps/preferences-system-session.s > vg"), "manage instrument-panel associations", > self.onShowAssociationDialog) - > self.toolsMenu.addAction(getThemeIcon("document-save"), "Export > current Panel configuration to XML", > self.onExportCurrentPanelConfiguration) - > self.toolsMenu.addAction(getIcon(":/actions/data-transfer.svg"), > "Show Shared Data Manager connections", self.showSDMInfo) + tm > = self.toolsMenu > + > tm.addAction(getIcon(":/apps/preferences-system-session.svg"), > "manage instrument-panel associations", self.onShowAssociationDialog) > + tm.addAction(getThemeIcon("document-save"), "Export current > Panel configuration to XML", self.onExportCurrentPanelConfiguration) > + tm.addAction(getIcon(":/actions/data-transfer.svg"), "Show > Shared Data Manager connections", self.showSDMInfo) + icon = > getThemeIcon('bookmark-new') > + self.newExternalApp = tm.addAction(icon, "Add > ExternalApp...", + > self.createExternalApp) + icon = getThemeIcon('edit-clear') > + self.removeExternalApp = tm.addAction(icon, "Remove > ExternalApp...", + > self.removeExternalApp) + > + def createExternalApp(self): > + '''Add a new external application on execution time''' > + app_editor = ExternalAppEditor(self) > + name, xml, ok = app_editor.getDialog() > + if name in self._external_app_names: > + msg = ('The "%s" external application exists in your > GUI.' + ' If you want to create a new one, ' > + 'please use other text label' % name) > + taurus.warning(msg) > + return > + > + if ok: > + extapp = ExternalApp.fromXml(xml) > + action = extapp.getAction() > + action_name = str(action.text()) > + self.__external_app[action_name] = extapp > + self._addExternalAppLauncher(name, action) > + > + def _addExternalAppLauncher(self, name, action): > + action_name = str(action.text()) > + self.__external_app_actions[action_name] = action > + self.addExternalAppLauncher(action) > + self._external_app_names.append(name) > + > + def removeExternalApp(self, name=None): > + ''' remove the given external application from the GUI. > + :param name: (str or None) the name of the external > application to be + removed > + If None given, the user will be prompted > + ''' > + apps = self.__external_app.keys() + self.__permanet_ext_apps > + if name is None: > + items = sorted(apps) > + msg1 = "Remove External application" > + msg2 = ("External application to be removed " > + "(only custom external applications can be > removed).") + name, ok = Qt.QInputDialog.getItem (self, > msg1, msg2, items, 0, + > False) > + if not ok: > + return > + name = unicode(name) > + if name not in apps: > + msg = ('Cannot remove the external application "%s"' > + ' (not found)' % name) > + self.debug(msg) > + return > + if name in self.__external_app.keys(): > + self.__external_app.pop(name) > + else: > + self.__permanet_ext_apps.remove(name) > + action = self.__external_app_actions.pop(name) > + self._external_app_names.remove(name) > + self.deleteExternalAppLauncher(action) > + self.debug('External application "%s" removed' % name) > > def setCustomWidgetMap(self, map): > ''' > @@ -439,7 +512,9 @@ class TaurusGui(TaurusMainWindow): > def createConfig(self, *args, **kwargs): > '''reimplemented from TaurusMainWindow.createConfig''' > self.updatePermanentCustomPanels(showAlways=False) > - return TaurusMainWindow.createConfig(self, *args, **kwargs) > + self.updatePermanentExternalApplications(showAlways=False) > + cfg = TaurusMainWindow.createConfig(self, *args, **kwargs) > + return cfg > > def removePanel(self, name=None): > ''' remove the given panel from the GUI. > @@ -560,6 +635,22 @@ class TaurusGui(TaurusMainWindow): > ''' > return copy.deepcopy(self.__panels.keys()) > > + def _setPermanentExternalApps(self, permExternalApps): > + '''creates empty panels for restoring custom panels. > + > + :param permCustomPanels: (list<str>) list of names of custom > panels + ''' > + #first create the panels if they don't actually exist > + for name in permExternalApps: > + if name not in self._external_app_names: > + # create empty action > + self.__permanet_ext_apps.append(name) > + action = ExternalAppAction('', name) > + self._addExternalAppLauncher(name, action) > + > + def _getPermanentExternalApps(self): > + return self.__permanet_ext_apps > + > def _setPermanentCustomPanels(self, permCustomPanels): > '''creates empty panels for restoring custom panels. > > @@ -608,6 +699,34 @@ class TaurusGui(TaurusMainWindow): > self.__panels[name].setPermanent(False) > self.unregisterConfigurableItem(name, > raiseOnError=False) > > + def updatePermanentExternalApplications(self, showAlways=True): > + ''' > + Shows a dialog for selecting which new externals applications > + should be permanently stored in the configuration. > + > + :param showAlways: (bool) forces showing the dialog > + ''' > + #check if there are some newly created external applications > that may + # be made permanent > + #permanet_ext_app = list(self._external_app_names) > + if len(self.__external_app) > 0 or showAlways: > + msg = 'Select which of the external applications should > be stored' + dlg = QDoubleListDlg(winTitle='Stored > external applications', + > mainLabel=msg, > + label1='Temporary (to be > discarded)', + label2='Permanent (to > be stored)', + > list1=self.__external_app.keys(), + > list2=self.__permanet_ext_apps) + result = dlg.exec_() > + if result == Qt.QDialog.Accepted: > + # update the temporally external applications > + for name in dlg.getAll2(): > + self.__permanet_ext_apps.append(str(name)) > + > + for name in dlg.getAll1(): > + self.unregisterConfigurableItem("_extApp[%s]" % > str(name), + > raiseOnError=False) + > def createCustomPanel(self, paneldesc=None): > ''' > Creates a panel from a Panel Description and sets it as > "custom panel". @@ -1046,6 +1165,7 @@ class > TaurusGui(TaurusMainWindow): > EXTERNAL_APPS.append(ea) > > for a in EXTERNAL_APPS: > + > self._external_app_names.append(str(a.getAction().text())) > self.addExternalAppLauncher(a.getAction()) > > > @@ -1073,7 +1193,8 @@ class TaurusGui(TaurusMainWindow): > for panel in self.__panels.values(): > panel.toggleViewAction().setEnabled(modifiable) > panel.setFeatures(dwfeat) > - for action in (self.newPanelAction, self.showAllPanelsAction, > self.hideAllPanelsAction): + for action in > (self.newPanelAction, self.showAllPanelsAction, + > self.hideAllPanelsAction): > action.setEnabled(modifiable) > > self._lockviewAction.setChecked(not modifiable) -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |
From: Zbigniew R. <zre...@ce...> - 2015-07-06 16:12:26
|
Hi, First of all, I reply to both lists (taurus and sardana) since this ticket was initially created in the sardana queue, and the patch sent by CarlosP, was also sent to the sardana mailing list. After the taurus and sardana projects separation this is the corresponding ticket: http://sourceforge.net/p/tauruslib/tickets/145 Carlos, I have applied your patch to the develop branch. There were just two small corrections: +) in the dftclean.run() you forgot to pass "self" +) I have modified the commit subject to reflect the ticket number change Additionally I have added doc/~thumbnails.zip to the clean. Thanks for your contribution, Zibi On 02/09/2015 10:56 AM, cpa...@ce... wrote: > From: cpascual <cpa...@ce...> > > Running "python setup.py clean" does not remove certain files that > are created by the build command outside of the build directory > (and which, strictly, shouldn't be created there in the first > place). Make the clean command remove those files too. > --- > taurus/setup.py | 47 ++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 46 insertions(+), 1 deletion(-) > > diff --git a/taurus/setup.py b/taurus/setup.py > index 63073a9..6c42097 100644 > --- a/taurus/setup.py > +++ b/taurus/setup.py > @@ -35,6 +35,7 @@ import StringIO > from distutils import log > from distutils.core import setup, Command > from distutils.command.build import build as dftbuild > +from distutils.command.clean import clean as dftclean > from distutils.command.install import install as dftinstall > from distutils.command.install_lib import install_lib as dftinstall_lib > from distutils.command.install_scripts import install_scripts as dftinstall_scripts > @@ -749,6 +750,49 @@ class build_doc_api(Command): > print(i, file=out) > > > +class clean(dftclean): > + def run(self): > + dftclean.run() > + > + # This is a very crude approach to clean the garbage created by taurus > + # outside of the build dir when running the build command > + # see: https://sourceforge.net/p/sardana/tickets/324/ > + import glob > + from distutils.dir_util import remove_tree > + > + # collect the garbage *files* to be deleted > + garbage = [] > + > + resource = abspath('lib', 'taurus', 'qt', 'qtgui', 'resource') > + garbage.extend(glob.glob(os.path.join(resource, '*.rcc'))) > + garbage.extend(glob.glob(os.path.join(resource, '*.qrc'))) > + garbage.append(os.path.join(resource, 'catalog.html')) > + > + jdraw = abspath('lib', 'taurus', 'qt', 'qtgui', 'graphic', 'jdraw') > + garbage.append(os.path.join(jdraw, 'jdraw_lextab.py')) > + garbage.append(os.path.join(jdraw, 'jdraw_yacctab.py')) > + > + doc_devel = abspath('doc', 'source', 'devel') > + garbage.append(os.path.join(doc_devel, 'catalog.html')) > + > + # delete the garbage files > + for fn in garbage: > + if os.path.exists(fn): > + log.info("removing '%s'", fn) > + if self.dry_run: > + continue > + os.remove(fn) > + else: > + log.debug("'%s' does not exist -- can't clean it", fn) > + > + # now delete the api dir > + api_dir = os.path.join(doc_devel, 'api') > + if os.path.exists(api_dir): > + remove_tree(api_dir, dry_run=self.dry_run) > + else: > + log.debug("'%s' does not exist -- can't clean it", api_dir) > + > + > cmdclass = { 'build' : build, > 'build_resources' : build_resources, > 'install' : install, > @@ -756,7 +800,8 @@ cmdclass = { 'build' : build, > 'install_man' : install_man, > 'install_html' : install_html, > 'install_scripts' : install_scripts, > - 'build_doc_api' : build_doc_api } > + 'build_doc_api' : build_doc_api, > + 'clean' : clean } > > if sphinx: > from sphinx.setup_command import BuildDoc -- -- ALBA Synchrotron <http://www.albasynchrotron.es> Zbigniew Reszela Controls Section - Computing Division ALBA SYNCHROTRON LIGHT SOURCE Ctra. BP 1413 km. 3,3 | 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: cfalcon <cf...@ce...> - 2015-07-06 13:25:41
|
The taurus patch for the bug 159 introduces a bug related with misunderstanding of the format representation ("N1.N2%format_type"). Where N1 is the total number of digits for represent the value and N2 is the number of the N1 digits that will be used to represent the decimal part of the value. --- lib/taurus/qt/qtgui/input/tauruswheel.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/taurus/qt/qtgui/input/tauruswheel.py b/lib/taurus/qt/qtgui/input/tauruswheel.py index 58218f3..4c4d791 100644 --- a/lib/taurus/qt/qtgui/input/tauruswheel.py +++ b/lib/taurus/qt/qtgui/input/tauruswheel.py @@ -59,24 +59,31 @@ class TaurusWheelEdit(QWheelEdit, TaurusBaseWritableWidget): # get the minimal valid format format_value = self.getFormatFromValue(self._value) f = evt_value.format.lower() - if f[-1] not in ('d', 'f', 'g'): - raise ValueError("'%s' format unsupported" % f) + format_type = f[-1] f = f.replace('g','f') - if 'd' == f[-1]: + if format_type not in ('d', 'f'): + raise ValueError("'%s' format unsupported" % f) + # The format representation is giving by nb.dec_nb%ft + # int_nb = numb. of digits (n_digits) - numb. of decimals (dec_nb) + # (i.e.) 6.2 means 6 digits where 2 will be used for the + # representation of the decimal part, so 4 digits will be used for + # represent the integer part. + if 'd' == format_type: dec_nb = 0 - try: int_nb = int(f[1:-1]) - except: int_nb = 6 + try: + n_digits = int(f[1:-1]) + except: n_digits = 6 else: fmap = map(int, f[1:-1].split('.', 1)) - int_nb = fmap[int_part] - if len(fmap)>1: + n_digits = fmap[int_part] + if len(fmap) > 1: dec_nb = fmap[dec_part] else: dec_nb = 2 if dec_nb < format_value[dec_part]: warning = True dec_nb = format_value[dec_part] - + int_nb = n_digits - dec_nb if int_nb < format_value[int_part]: warning = True int_nb = format_value[int_part] -- 2.4.0 |
From: cfalcon <cf...@ce...> - 2015-07-06 07:35:51
|
The sign label (align right) does not follow the value label (center) when the qwhell is expanded. Fix it, adding a vertical alignment to the sign label. --- lib/taurus/qt/qtgui/input/qwheel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/taurus/qt/qtgui/input/qwheel.py b/lib/taurus/qt/qtgui/input/qwheel.py index b7481c9..04e8892 100644 --- a/lib/taurus/qt/qtgui/input/qwheel.py +++ b/lib/taurus/qt/qtgui/input/qwheel.py @@ -259,7 +259,7 @@ class QWheelEdit(Qt.QFrame): signLabel = _DigitLabel('+') signLabel.setFocusPolicy(Qt.Qt.NoFocus) - signLabel.setAlignment(Qt.Qt.AlignRight) + signLabel.setAlignment(Qt.Qt.AlignRight | Qt.Qt.AlignVCenter) self._digitLabels.append(signLabel) l.addWidget(signLabel, 1, 0) l.setRowMinimumHeight(1, signLabel.minimumSizeHint().height()) -- 2.4.0 |
From: Zbigniew R. <zre...@ce...> - 2015-07-03 14:43:03
|
Hi Carlos, Your patch was applied to the develop branch. Thanks fro your contribution, Zibi On 05/18/2015 12:06 PM, cpascual wrote: > When exporting data from a plot (or trend) to ascii, the sorting > order is alphabetical, which may not correspond to the order in > which the curves are ordered in the plot, and this confuses the > users. Use Z-order of the plot instead of alphabetical. > > Also, fix a bug preventing the export of "all sets in one file" > feature. > --- > lib/taurus/qt/qtgui/panel/qdataexportdialog.py | 29 ++++++++++++++++---------- > lib/taurus/qt/qtgui/plot/taurusplot.py | 3 ++- > 2 files changed, 20 insertions(+), 12 deletions(-) > > diff --git a/lib/taurus/qt/qtgui/panel/qdataexportdialog.py b/lib/taurus/qt/qtgui/panel/qdataexportdialog.py > index 7dfaaaf..ecd2cb9 100644 > --- a/lib/taurus/qt/qtgui/panel/qdataexportdialog.py > +++ b/lib/taurus/qt/qtgui/panel/qdataexportdialog.py > @@ -50,7 +50,7 @@ class QDataExportDialog(Qt.QDialog): > allInSingleFile = "All sets in a single file (table like)" > allInMultipleFiles = "All set in multiple files" > > - def __init__(self, parent=None, datadict=None): > + def __init__(self, parent=None, datadict=None, sortedNames=None): > super(QDataExportDialog,self).__init__(parent) > self.loadUi() > self._xIsTime = False > @@ -59,17 +59,21 @@ class QDataExportDialog(Qt.QDialog): > Qt.QObject.connect(self.exportBT,Qt.SIGNAL("clicked()"),self.exportData) > Qt.QObject.connect(self.dataSetCB,Qt.SIGNAL("currentIndexChanged(const QString&)"),self.onDataSetCBChange) > > - self.setDataSets(datadict) > + self.setDataSets(datadict, sortedNames) > + > > > - def setDataSets(self, datadict): > + def setDataSets(self, datadict, sortedNames=None): > """Used to set the sets that are to be offered for exporting. It overwrites previous values. > """ > if datadict is None: return > + if sortedNames is None: > + sortedNames = sorted(self.datadict.keys()) > + self.sortedNames = sortedNames > self.datatime=datetime.now() > self.datadict=datadict > self.dataSetCB.clear() > - self.dataSetCB.insertItems(0,sorted(self.datadict.keys())) > + self.dataSetCB.insertItems(0, sortedNames) > if len(self.datadict.keys()) > 1: > self.dataSetCB.insertItems(0,[self.allInSingleFile, self.allInMultipleFiles]) > > @@ -118,7 +122,7 @@ class QDataExportDialog(Qt.QDialog): > outputdir=Qt.QFileDialog.getExistingDirectory (self, 'Export Directory', Qt.QString()) > if not outputdir:return False > preffix=os.path.join(str(outputdir),"set") > - for i,k in zip(range(len(self.datadict)),sorted(self.datadict.keys())): > + for i,k in zip(range(len(self.datadict)), self.sortedNames): > ofile="%s%03i.dat"%(preffix,i+1) > try: > self.exportCurrentData(set=k,ofile=ofile,verbose=False,AllowCloseAfter=False) > @@ -143,9 +147,12 @@ class QDataExportDialog(Qt.QDialog): > header = "# DATASET= " > body = "" > previous = None > - for curve_name in sorted(self.datadict.keys()): > + for curve_name in self.sortedNames: > xdata, ydata = self.datadict[curve_name] > - if (previous is not None) and (previous != xdata): > + if previous is None: > + previous = xdata > + header +=' "abscissa"' > + elif previous != xdata: > if (key==self.allInSingleFile): > self.dataTE.clear() > Qt.QMessageBox.critical(self,\ > @@ -158,17 +165,17 @@ class QDataExportDialog(Qt.QDialog): > self.dataTE.insertPlainText("Unable to display because abscissas are different.\n"\ > "Curves will be saved each one in its own file") > return > - else: > - previous = xdata > - header +=' "abscissa", "%s"' % curve_name > + header +=' , "%s"' % curve_name > + > header+="\n# SNAPSHOT_TIME= %s\n"%self.datatime.isoformat('_') > #if we reached this point x axes are equal, so fill the editor with the data > for i, x in enumerate(previous): > if self.xIsTime(): > + t=datetime.fromtimestamp(x) > body += "%s" % t.isoformat('_') > else: > body += "%g" % x > - for curve_name in sorted(self.datadict.keys()): > + for curve_name in self.sortedNames: > xdata, ydata = self.datadict[curve_name] > body += ("\t%g" % ydata[i]) > body+="\n" > diff --git a/lib/taurus/qt/qtgui/plot/taurusplot.py b/lib/taurus/qt/qtgui/plot/taurusplot.py > index d67f826..f841615 100644 > --- a/lib/taurus/qt/qtgui/plot/taurusplot.py > +++ b/lib/taurus/qt/qtgui/plot/taurusplot.py > @@ -2535,7 +2535,8 @@ class TaurusPlot(Qwt5.QwtPlot, TaurusBaseWidget): > if klass is None: > from taurus.qt.qtgui.panel import QDataExportDialog > klass = QDataExportDialog > - dialog = klass(parent=self, datadict=frozendata) > + dialog = klass(parent=self, datadict=frozendata, > + sortedNames=self.getCurveNamesSorted()) > dialog.setXIsTime(self.getXIsTime()) > return dialog.exec_() > -- -- ALBA Synchrotron <http://www.albasynchrotron.es> Zbigniew Reszela Controls Section - Computing Division ALBA SYNCHROTRON LIGHT SOURCE Ctra. BP 1413 km. 3,3 | 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...> - 2015-07-03 08:49:00
|
applied to develop (with changed commit subject) Thanks! On Thu 2 July 2015 17:18:44 Marc Josep Rosanes Siscart wrote: > When a widget TaurusImageDialog is docked in the Main Window, the > shown context menu is the one of the Main Window and it is not > the one of the TaurusImageDialog. > > Show the context menu of TaurusImageDialog when right-clicking in > a TaurusImageDialog widget, even if this widget is docked in the > Main Window. > > Solve this bug also for TaurusCurveDialog and for TaurusTrendDialog. > --- > lib/taurus/qt/qtgui/extra_guiqwt/plot.py | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/plot.py > b/lib/taurus/qt/qtgui/extra_guiqwt/plot.py index c2fc04c..17c555a > 100644 > --- a/lib/taurus/qt/qtgui/extra_guiqwt/plot.py > +++ b/lib/taurus/qt/qtgui/extra_guiqwt/plot.py > @@ -63,7 +63,8 @@ class TaurusCurveDialog(CurveDialog, > TaurusBaseWidget): from taurus.qt.qtgui.extra_guiqwt.tools import > TaurusCurveChooserTool self.add_tool(TaurusCurveChooserTool) > self.setModifiableByUser(self._modifiableByUser) > - > + self.setContextMenuPolicy(Qt.Qt.CustomContextMenu) > + > def keyPressEvent(self,event): > if(event.key() == Qt.Qt.Key_Escape): > event.ignore() > @@ -203,7 +204,8 @@ class TaurusTrendDialog(CurveDialog, > TaurusBaseWidget): if taurusparam is None: > taurusparam = TaurusTrendParam() > self.defaultTaurusparam = taurusparam > - > + self.setContextMenuPolicy(Qt.Qt.CustomContextMenu) > + > def keyPressEvent(self,event): > if(event.key() == Qt.Qt.Key_Escape): > event.ignore() > @@ -417,7 +419,8 @@ class TaurusImageDialog(ImageDialog, > TaurusBaseWidget): from taurus.qt.qtgui.extra_guiqwt.tools import > TaurusModelChooserTool self.add_tool(TaurusModelChooserTool, > singleModel=True) self.setModifiableByUser(True) > - > + self.setContextMenuPolicy(Qt.Qt.CustomContextMenu) > + > def keyPressEvent(self,event): > if(event.key() == Qt.Qt.Key_Escape): > event.ignore() > @@ -623,5 +626,5 @@ def taurusImageDlgMain(): > if __name__ == "__main__": > # taurusCurveDlgMain() > taurusTrendDlgMain() > -# taurusImageDlgMain() > - > +# taurusImageDlgMain() > + -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |
From: Carlos P. <cpa...@ce...> - 2015-07-03 08:28:34
|
Applied to develop with a minor modification in a message string Thanks! On Tue 30 June 2015 16:14:23 cfalcon wrote: > TaurusWheelEdit writes 0 to attribute when the w_value is > higher than the TaurusWheelEdit limits. > Fix it, setting the ranges in the consturctor to +inf, -inf by > default instead of the max/min possible value acording with the > current format. > > The limits can be defined using the proper methods or defining the > limits in the attribute configuration (e.g. using jive for a tango > attribute) --- > lib/taurus/qt/qtgui/input/qwheel.py | 19 +++++----- > lib/taurus/qt/qtgui/input/tauruswheel.py | 63 > +++++++++++++++++++++++++------- 2 files changed, 59 insertions(+), > 23 deletions(-) > > diff --git a/lib/taurus/qt/qtgui/input/qwheel.py > b/lib/taurus/qt/qtgui/input/qwheel.py index 41a6852..b7481c9 100644 > --- a/lib/taurus/qt/qtgui/input/qwheel.py > +++ b/lib/taurus/qt/qtgui/input/qwheel.py > @@ -31,11 +31,11 @@ __docformat__ = 'restructuredtext' > > import os > import math > +import numpy > > +import taurus > from taurus.external.qt import Qt > > -#from taurus.qt.qtgui.resource.qrc_extra_icons import * > - > class _ArrowButton(Qt.QPushButton): > """Private class to be used by QWheelEdit for an arrow button""" > > @@ -201,14 +201,14 @@ class QWheelEdit(Qt.QFrame): > self._previous_value = 0 > self._value = 0 > self._value_str = '0' > - self._minValue = float('-inf') > - self._maxValue = float('+inf') > + self._minValue = numpy.finfo('d').min # -inf > + self._maxValue = numpy.finfo('d').max # inf > self._editor = None > self._editing = False > self._showArrowButtons = True > self._setDigits(QWheelEdit.DefaultIntDigitCount, > QWheelEdit.DefaultDecDigitCount) - > - self._setMinMax( self._getMinPossibleValue(), > self._getMaxPossibleValue()) + # set as default min and max > value to "-inf" & "+inf" + self._setMinMax( self._minValue, > self._maxValue) > self._setValue(0) > > self._build() > @@ -480,6 +480,7 @@ class QWheelEdit(Qt.QFrame): > if self._roundFunc: > v = self._roundFunc(v) > if v > self._maxValue or v < self._minValue: > + taurus.warning('You are trying to set a value out of > limits') return > self._previous_value = self._value > self._value = v > @@ -739,7 +740,7 @@ class QWheelEdit(Qt.QFrame): > rect = Qt.QRect(l.cellRect(1, 0).topLeft(), l.cellRect(1, > l.columnCount() - 1).bottomRight()) > ed.setGeometry(rect) > - ed.setAlignment(Qt.Qt.AlignRight); > + ed.setAlignment(Qt.Qt.AlignRight) > ed.setMaxLength(self.getDigitCount() + 2) > ed.setText(self.getValueStr()) > ed.selectAll() > @@ -888,8 +889,8 @@ def main(): > button_layout.addWidget(resetbutton) > isb.setValue(arrowWidget.getIntDigitCount()) > dsb.setValue(arrowWidget.getDecDigitCount()) > - minv.setRange(float('-inf'), float('+inf')) > - maxv.setRange(float('-inf'), float('+inf')) > + minv.setRange(numpy.finfo('d').min, numpy.finfo('d').max) > + maxv.setRange(numpy.finfo('d').min, numpy.finfo('d').max) > minv.setValue(arrowWidget.getMinValue()) > maxv.setValue(arrowWidget.getMaxValue()) > showarrowbutton.setChecked(arrowWidget.getShowArrowButtons()) > diff --git a/lib/taurus/qt/qtgui/input/tauruswheel.py > b/lib/taurus/qt/qtgui/input/tauruswheel.py index a9ad071..3918c95 > 100644 > --- a/lib/taurus/qt/qtgui/input/tauruswheel.py > +++ b/lib/taurus/qt/qtgui/input/tauruswheel.py > @@ -29,9 +29,10 @@ __all__ = ["TaurusWheelEdit" ] > > __docformat__ = 'restructuredtext' > > +import taurus > from taurus.external.qt import Qt > > -import taurus.core > +from taurus.core.taurusbasetypes import TaurusEventType > from taurus.qt.qtgui.base import TaurusBaseWritableWidget > from qwheel import QWheelEdit > > @@ -51,30 +52,64 @@ class TaurusWheelEdit(QWheelEdit, > TaurusBaseWritableWidget): > #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ > -~-~-~- > > def handleEvent(self, evt_src, evt_type, evt_value): > - if evt_type == > taurus.core.taurusbasetypes.TaurusEventType.Config and not evt_value > is None: + if evt_type == TaurusEventType.Config and evt_value > is not None: + int_part = 0 > + dec_part = 1 > + warning = False > + # get the minimal valid format > + format_value = self.getFormatFromValue(self._value) > f = evt_value.format.lower() > if f[-1] not in ('d', 'f', 'g'): > raise ValueError("'%s' format unsupported" % f) > f = f.replace('g','f') > if 'd' == f[-1]: > dec_nb = 0 > - try: total = int(f[1:-1]) > - except: total = 6 > + try: int_nb = int(f[1:-1]) > + except: int_nb = 6 > else: > - f = map(int, f[1:-1].split('.', 1)) > - total = f[0] > - if len(f)>1: > - dec_nb = f[1] > + fmap = map(int, f[1:-1].split('.', 1)) > + int_nb = fmap[int_part] > + if len(fmap)>1: > + dec_nb = fmap[dec_part] > else: > dec_nb = 2 > - int_nb = total-dec_nb > + if dec_nb < format_value[dec_part]: > + warning = True > + dec_nb = format_value[dec_part] > + > + if int_nb < format_value[int_part]: > + warning = True > + int_nb = format_value[int_part] > + > + if warning: > + msg = ('Your setting format is not valid for the > current value.' + 'Please use at least > "%s.%s%s" instead' + %(int_nb, dec_nb, f[-1])) > + taurus.warning(msg) > + > self.setDigitCount(int_nb=int_nb, dec_nb=dec_nb) > - try: self.setMinValue(float(evt_value.min_value)) > - except: pass > - try: self.setMaxValue(float(evt_value.max_value)) > - except: pass > + try: > + self.setMinValue(float(evt_value.min_value)) > + except: > + pass > + try: > + self.setMaxValue(float(evt_value.max_value)) > + except: > + pass > TaurusBaseWritableWidget.handleEvent(self, evt_src, evt_type, > evt_value) - > + > + def getFormatFromValue(self, value): > + int_part = 0 > + dec_part = 1 > + str_value = str(value) > + int_dec = str_value.split('.') > + int_nb = len(int_dec[int_part]) > + try: > + dec_nb = len(int_dec[dec_part]) > + except: > + dec_nb = 0 > + return int_nb, dec_nb > + > def updateStyle(self): > TaurusBaseWritableWidget.updateStyle(self) > if self.hasPendingOperations(): -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |
From: cfalcon <cf...@ce...> - 2015-07-03 06:58:37
|
The plots ignore the settings of Symbol fill and color. Fix it, doing little changes in the code related with set/get QwtSymbol's properties. --- lib/taurus/qt/qtgui/plot/taurusplot.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/taurus/qt/qtgui/plot/taurusplot.py b/lib/taurus/qt/qtgui/plot/taurusplot.py index d67f826..aea9fb5 100644 --- a/lib/taurus/qt/qtgui/plot/taurusplot.py +++ b/lib/taurus/qt/qtgui/plot/taurusplot.py @@ -668,11 +668,22 @@ class TaurusCurve(Qwt5.QwtPlotCurve, TaurusBaseComponent): if prop.sStyle is not None: s.setStyle(Qwt5.QwtSymbol.Style(prop.sStyle)) if prop.sSize is not None: s.setSize(prop.sSize) if prop.sColor is not None: - s.brush().setColor(Qt.QColor(prop.sColor)) - s.pen().setColor(s.brush().color()) #the symbol pen color is the same as the symbol filling + b = s.brush() + p = s.pen() + color = Qt.QColor(prop.sColor) + p.setColor(color) + b.setColor(color) + b.setStyle(Qt.Qt.NoBrush) + s.setBrush(b) + s.setPen(p) if prop.sFill is not None: - if prop.sFill: s.brush().setStyle(Qt.Qt.SolidPattern) - else: s.brush().setStyle(Qt.Qt.NoBrush) + b = s.brush() + if prop.sFill: + b.setStyle(Qt.Qt.SolidPattern) + s.setBrush(b) + else: + s.brush().setStyle(Qt.Qt.NoBrush) + s.setBrush(b) p = Qt.QPen(self.pen()) if prop.lStyle is not None: p.setStyle(prop.lStyle) if prop.lWidth is not None: p.setWidth(prop.lWidth) -- 2.4.0 |
From: cfalcon <cf...@ce...> - 2015-07-02 15:28:45
|
Improve the already existing ExternalApp buttons mechanism by allowing the user to add/remove buttons on execution time. Adapt the existing widgets to manage the external applications. Add options to create and delete the external applications. --- lib/taurus/qt/qtgui/taurusgui/taurusgui.py | 137 +++++++++++++++++++++++++++-- 1 file changed, 129 insertions(+), 8 deletions(-) diff --git a/lib/taurus/qt/qtgui/taurusgui/taurusgui.py b/lib/taurus/qt/qtgui/taurusgui/taurusgui.py index 2d2fbfe..2a0f890 100644 --- a/lib/taurus/qt/qtgui/taurusgui/taurusgui.py +++ b/lib/taurus/qt/qtgui/taurusgui/taurusgui.py @@ -46,10 +46,13 @@ from taurus.qt.qtcore.communication import SharedDataManager from taurus.qt.qtgui.util import TaurusWidgetFactory from taurus.qt.qtgui.base import TaurusBaseWidget, TaurusBaseComponent from taurus.qt.qtgui.container import TaurusMainWindow -from taurus.qt.qtgui.taurusgui.utils import ExternalApp, PanelDescription, \ - ToolBarDescription, AppletDescription +from taurus.qt.qtgui.taurusgui.utils import (ExternalApp, PanelDescription, + ToolBarDescription, + AppletDescription) +from taurus.qt.qtgui.taurusgui.appsettingswizard import ExternalAppEditor from taurus.qt.qtgui.panel import QDoubleListDlg from taurus.qt.qtgui.util.ui import UILoadable +from taurus.qt.qtgui.taurusgui.utils import ExternalAppAction @UILoadable(with_ui='ui') @@ -272,11 +275,18 @@ class TaurusGui(TaurusMainWindow): self.defaultConfigRecursionDepth = configRecursionDepth self.__panels = {} + self.__external_app = {} + self.__external_app_actions = {} + self._external_app_names = [] + self.__permanet_ext_apps = [] self.__synoptics = [] self.__instrumentToPanelMap = {} self.__panelToInstrumentMap = {} self.setDockNestingEnabled(True) + self.registerConfigProperty(self._getPermanentExternalApps, + self._setPermanentExternalApps, + 'permanentexternalapps') self.registerConfigProperty(self._getPermanentCustomPanels, self._setPermanentCustomPanels, 'permanentCustomPanels') self.registerConfigProperty(self.getAllInstrumentAssociations, self.setAllInstrumentAssociations, 'instrumentAssociation') @@ -288,11 +298,11 @@ class TaurusGui(TaurusMainWindow): self.__initPanelsMenu() self.__initViewMenu() - self.__initPanelsToolBar() self.__initQuickAccessToolBar() self.__initJorgBar() self.__initSharedDataConnections() self.__initToolsMenu() + self.__initPanelsToolBar() self.loadConfiguration(confname) @@ -374,6 +384,7 @@ class TaurusGui(TaurusMainWindow): self.panelsToolBar = self.addToolBar("Panels") self.panelsToolBar.setObjectName("PanelsToolbar") self.panelsToolBar.addAction(self.newPanelAction) + self.panelsToolBar.addAction(self.newExternalApp) self.viewToolBarsMenu.addAction(self.panelsToolBar.toggleViewAction()) def __initQuickAccessToolBar(self): @@ -406,9 +417,71 @@ class TaurusGui(TaurusMainWindow): def __initToolsMenu(self): if self.toolsMenu is None: self.toolsMenu = Qt.QMenu("Tools") - self.toolsMenu.addAction(getIcon(":/apps/preferences-system-session.svg"), "manage instrument-panel associations", self.onShowAssociationDialog) - self.toolsMenu.addAction(getThemeIcon("document-save"), "Export current Panel configuration to XML", self.onExportCurrentPanelConfiguration) - self.toolsMenu.addAction(getIcon(":/actions/data-transfer.svg"), "Show Shared Data Manager connections", self.showSDMInfo) + tm = self.toolsMenu + tm.addAction(getIcon(":/apps/preferences-system-session.svg"), "manage instrument-panel associations", self.onShowAssociationDialog) + tm.addAction(getThemeIcon("document-save"), "Export current Panel configuration to XML", self.onExportCurrentPanelConfiguration) + tm.addAction(getIcon(":/actions/data-transfer.svg"), "Show Shared Data Manager connections", self.showSDMInfo) + icon = getThemeIcon('bookmark-new') + self.newExternalApp = tm.addAction(icon, "Add ExternalApp...", + self.createExternalApp) + icon = getThemeIcon('edit-clear') + self.removeExternalApp = tm.addAction(icon, "Remove ExternalApp...", + self.removeExternalApp) + + def createExternalApp(self): + '''Add a new external application on execution time''' + app_editor = ExternalAppEditor(self) + name, xml, ok = app_editor.getDialog() + if name in self._external_app_names: + msg = ('The "%s" external application exists in your GUI.' + ' If you want to create a new one, ' + 'please use other text label' % name) + taurus.warning(msg) + return + + if ok: + extapp = ExternalApp.fromXml(xml) + action = extapp.getAction() + action_name = str(action.text()) + self.__external_app[action_name] = extapp + self._addExternalAppLauncher(name, action) + + def _addExternalAppLauncher(self, name, action): + action_name = str(action.text()) + self.__external_app_actions[action_name] = action + self.addExternalAppLauncher(action) + self._external_app_names.append(name) + + def removeExternalApp(self, name=None): + ''' remove the given external application from the GUI. + :param name: (str or None) the name of the external application to be + removed + If None given, the user will be prompted + ''' + apps = self.__external_app.keys() + self.__permanet_ext_apps + if name is None: + items = sorted(apps) + msg1 = "Remove External application" + msg2 = ("External application to be removed " + "(only custom external applications can be removed).") + name, ok = Qt.QInputDialog.getItem (self, msg1, msg2, items, 0, + False) + if not ok: + return + name = unicode(name) + if name not in apps: + msg = ('Cannot remove the external application "%s"' + ' (not found)' % name) + self.debug(msg) + return + if name in self.__external_app.keys(): + self.__external_app.pop(name) + else: + self.__permanet_ext_apps.remove(name) + action = self.__external_app_actions.pop(name) + self._external_app_names.remove(name) + self.deleteExternalAppLauncher(action) + self.debug('External application "%s" removed' % name) def setCustomWidgetMap(self, map): ''' @@ -439,7 +512,9 @@ class TaurusGui(TaurusMainWindow): def createConfig(self, *args, **kwargs): '''reimplemented from TaurusMainWindow.createConfig''' self.updatePermanentCustomPanels(showAlways=False) - return TaurusMainWindow.createConfig(self, *args, **kwargs) + self.updatePermanentExternalApplications(showAlways=False) + cfg = TaurusMainWindow.createConfig(self, *args, **kwargs) + return cfg def removePanel(self, name=None): ''' remove the given panel from the GUI. @@ -560,6 +635,22 @@ class TaurusGui(TaurusMainWindow): ''' return copy.deepcopy(self.__panels.keys()) + def _setPermanentExternalApps(self, permExternalApps): + '''creates empty panels for restoring custom panels. + + :param permCustomPanels: (list<str>) list of names of custom panels + ''' + #first create the panels if they don't actually exist + for name in permExternalApps: + if name not in self._external_app_names: + # create empty action + self.__permanet_ext_apps.append(name) + action = ExternalAppAction('', name) + self._addExternalAppLauncher(name, action) + + def _getPermanentExternalApps(self): + return self.__permanet_ext_apps + def _setPermanentCustomPanels(self, permCustomPanels): '''creates empty panels for restoring custom panels. @@ -608,6 +699,34 @@ class TaurusGui(TaurusMainWindow): self.__panels[name].setPermanent(False) self.unregisterConfigurableItem(name, raiseOnError=False) + def updatePermanentExternalApplications(self, showAlways=True): + ''' + Shows a dialog for selecting which new externals applications + should be permanently stored in the configuration. + + :param showAlways: (bool) forces showing the dialog + ''' + #check if there are some newly created external applications that may + # be made permanent + #permanet_ext_app = list(self._external_app_names) + if len(self.__external_app) > 0 or showAlways: + msg = 'Select which of the external applications should be stored' + dlg = QDoubleListDlg(winTitle='Stored external applications', + mainLabel=msg, + label1='Temporary (to be discarded)', + label2='Permanent (to be stored)', + list1=self.__external_app.keys(), + list2=self.__permanet_ext_apps) + result = dlg.exec_() + if result == Qt.QDialog.Accepted: + # update the temporally external applications + for name in dlg.getAll2(): + self.__permanet_ext_apps.append(str(name)) + + for name in dlg.getAll1(): + self.unregisterConfigurableItem("_extApp[%s]" % str(name), + raiseOnError=False) + def createCustomPanel(self, paneldesc=None): ''' Creates a panel from a Panel Description and sets it as "custom panel". @@ -1046,6 +1165,7 @@ class TaurusGui(TaurusMainWindow): EXTERNAL_APPS.append(ea) for a in EXTERNAL_APPS: + self._external_app_names.append(str(a.getAction().text())) self.addExternalAppLauncher(a.getAction()) @@ -1073,7 +1193,8 @@ class TaurusGui(TaurusMainWindow): for panel in self.__panels.values(): panel.toggleViewAction().setEnabled(modifiable) panel.setFeatures(dwfeat) - for action in (self.newPanelAction, self.showAllPanelsAction, self.hideAllPanelsAction): + for action in (self.newPanelAction, self.showAllPanelsAction, + self.hideAllPanelsAction): action.setEnabled(modifiable) self._lockviewAction.setChecked(not modifiable) -- 2.4.0 |
From: cfalcon <cf...@ce...> - 2015-07-02 15:28:41
|
Sorry, I resend the last patch because I forgot the git add before the git commit --amend :P |
From: Marc J. R. S. <mro...@ce...> - 2015-07-02 15:18:53
|
When a widget TaurusImageDialog is docked in the Main Window, the shown context menu is the one of the Main Window and it is not the one of the TaurusImageDialog. Show the context menu of TaurusImageDialog when right-clicking in a TaurusImageDialog widget, even if this widget is docked in the Main Window. Solve this bug also for TaurusCurveDialog and for TaurusTrendDialog. --- lib/taurus/qt/qtgui/extra_guiqwt/plot.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/taurus/qt/qtgui/extra_guiqwt/plot.py b/lib/taurus/qt/qtgui/extra_guiqwt/plot.py index c2fc04c..17c555a 100644 --- a/lib/taurus/qt/qtgui/extra_guiqwt/plot.py +++ b/lib/taurus/qt/qtgui/extra_guiqwt/plot.py @@ -63,7 +63,8 @@ class TaurusCurveDialog(CurveDialog, TaurusBaseWidget): from taurus.qt.qtgui.extra_guiqwt.tools import TaurusCurveChooserTool self.add_tool(TaurusCurveChooserTool) self.setModifiableByUser(self._modifiableByUser) - + self.setContextMenuPolicy(Qt.Qt.CustomContextMenu) + def keyPressEvent(self,event): if(event.key() == Qt.Qt.Key_Escape): event.ignore() @@ -203,7 +204,8 @@ class TaurusTrendDialog(CurveDialog, TaurusBaseWidget): if taurusparam is None: taurusparam = TaurusTrendParam() self.defaultTaurusparam = taurusparam - + self.setContextMenuPolicy(Qt.Qt.CustomContextMenu) + def keyPressEvent(self,event): if(event.key() == Qt.Qt.Key_Escape): event.ignore() @@ -417,7 +419,8 @@ class TaurusImageDialog(ImageDialog, TaurusBaseWidget): from taurus.qt.qtgui.extra_guiqwt.tools import TaurusModelChooserTool self.add_tool(TaurusModelChooserTool, singleModel=True) self.setModifiableByUser(True) - + self.setContextMenuPolicy(Qt.Qt.CustomContextMenu) + def keyPressEvent(self,event): if(event.key() == Qt.Qt.Key_Escape): event.ignore() @@ -623,5 +626,5 @@ def taurusImageDlgMain(): if __name__ == "__main__": # taurusCurveDlgMain() taurusTrendDlgMain() -# taurusImageDlgMain() - +# taurusImageDlgMain() + -- 1.8.1.4 |
From: cfalcon <cf...@ce...> - 2015-07-02 14:30:06
|
Improve the already existing ExternalApp buttons mechanism by allowing the user to add/remove buttons on execution time. Adapt the existing widgets to manage the external applications. Add options to create and delete the external applications. --- lib/taurus/qt/qtgui/taurusgui/taurusgui.py | 117 +++++++++++++++++++++++++++-- 1 file changed, 112 insertions(+), 5 deletions(-) diff --git a/lib/taurus/qt/qtgui/taurusgui/taurusgui.py b/lib/taurus/qt/qtgui/taurusgui/taurusgui.py index 2d2fbfe..364ed38 100644 --- a/lib/taurus/qt/qtgui/taurusgui/taurusgui.py +++ b/lib/taurus/qt/qtgui/taurusgui/taurusgui.py @@ -46,10 +46,13 @@ from taurus.qt.qtcore.communication import SharedDataManager from taurus.qt.qtgui.util import TaurusWidgetFactory from taurus.qt.qtgui.base import TaurusBaseWidget, TaurusBaseComponent from taurus.qt.qtgui.container import TaurusMainWindow -from taurus.qt.qtgui.taurusgui.utils import ExternalApp, PanelDescription, \ - ToolBarDescription, AppletDescription +from taurus.qt.qtgui.taurusgui.utils import (ExternalApp, PanelDescription, + ToolBarDescription, + AppletDescription) +from taurus.qt.qtgui.taurusgui.appsettingswizard import ExternalAppEditor from taurus.qt.qtgui.panel import QDoubleListDlg from taurus.qt.qtgui.util.ui import UILoadable +from taurus.qt.qtgui.taurusgui.utils import ExternalAppAction @UILoadable(with_ui='ui') @@ -272,11 +275,18 @@ class TaurusGui(TaurusMainWindow): self.defaultConfigRecursionDepth = configRecursionDepth self.__panels = {} + self.__external_app = {} + self.__external_app_actions = {} + self._external_app_names = [] + self.__permanet_ext_apps = [] self.__synoptics = [] self.__instrumentToPanelMap = {} self.__panelToInstrumentMap = {} self.setDockNestingEnabled(True) + self.registerConfigProperty(self._getPermanentExternalApps, + self._setPermanentExternalApps, + 'permanentexternalapps') self.registerConfigProperty(self._getPermanentCustomPanels, self._setPermanentCustomPanels, 'permanentCustomPanels') self.registerConfigProperty(self.getAllInstrumentAssociations, self.setAllInstrumentAssociations, 'instrumentAssociation') @@ -288,11 +298,11 @@ class TaurusGui(TaurusMainWindow): self.__initPanelsMenu() self.__initViewMenu() - self.__initPanelsToolBar() self.__initQuickAccessToolBar() self.__initJorgBar() self.__initSharedDataConnections() self.__initToolsMenu() + self.__initPanelsToolBar() self.loadConfiguration(confname) @@ -374,6 +384,7 @@ class TaurusGui(TaurusMainWindow): self.panelsToolBar = self.addToolBar("Panels") self.panelsToolBar.setObjectName("PanelsToolbar") self.panelsToolBar.addAction(self.newPanelAction) + self.panelsToolBar.addAction(self.newExternalApp) self.viewToolBarsMenu.addAction(self.panelsToolBar.toggleViewAction()) def __initQuickAccessToolBar(self): @@ -409,6 +420,57 @@ class TaurusGui(TaurusMainWindow): self.toolsMenu.addAction(getIcon(":/apps/preferences-system-session.svg"), "manage instrument-panel associations", self.onShowAssociationDialog) self.toolsMenu.addAction(getThemeIcon("document-save"), "Export current Panel configuration to XML", self.onExportCurrentPanelConfiguration) self.toolsMenu.addAction(getIcon(":/actions/data-transfer.svg"), "Show Shared Data Manager connections", self.showSDMInfo) + self.newExternalApp = self.toolsMenu.addAction(getThemeIcon(':/actions/go-top.svg'), "Add ExternalApp...", self.createExternalApp) + self.removeExternalApp = self.toolsMenu.addAction(getThemeIcon(':/actions/down.svg'), "Remove ExternalApp...", self.removeExternalApp) + + def createExternalApp(self): + '''Add a new external application on execution time''' + app_editor = ExternalAppEditor(self) + name, xml, ok = app_editor.getDialog() + if name in self._external_app_names: + msg = ('The "%s" external application exists in your GUI.' + ' If you want to create a new one, ' + 'please use other text label' % name) + taurus.warning(msg) + return + + if ok: + extapp = ExternalApp.fromXml(xml) + action = extapp.getAction() + action_name = str(action.text()) + self.__external_app[action_name] = extapp + self._addExternalAppLauncher(name, action) + + def _addExternalAppLauncher(self, name, action): + action_name = str(action.text()) + self.__external_app_actions[action_name] = action + self.addExternalAppLauncher(action) + self._external_app_names.append(name) + + def removeExternalApp(self, name=None): + ''' remove the given external application from the GUI. + :param name: (str or None) the name of the external application to be removed + If None given, the user will be prompted + ''' + apps = self.__external_app.keys() + self.__permanet_ext_apps + if name is None: + items = sorted(apps) + name, ok = Qt.QInputDialog.getItem (self, "Remove External application", + "External application to be removed (only custom external applications can be removed).", items, 0, False) + if not ok: + return + name = unicode(name) + if name not in apps: + self.debug('Cannot remove the external application "%s" (not found)' % name) + return + if name in self.__external_app.keys(): + self.__external_app.pop(name) + else: + self.__permanet_ext_apps.remove(name) + action = self.__external_app_actions.pop(name) + self._external_app_names.remove(name) + self.deleteExternalAppLauncher(action) + self.debug('External application "%s" removed' % name) def setCustomWidgetMap(self, map): ''' @@ -439,7 +501,9 @@ class TaurusGui(TaurusMainWindow): def createConfig(self, *args, **kwargs): '''reimplemented from TaurusMainWindow.createConfig''' self.updatePermanentCustomPanels(showAlways=False) - return TaurusMainWindow.createConfig(self, *args, **kwargs) + self.updatePermanentExternalApplications(showAlways=False) + cfg = TaurusMainWindow.createConfig(self, *args, **kwargs) + return cfg def removePanel(self, name=None): ''' remove the given panel from the GUI. @@ -560,6 +624,22 @@ class TaurusGui(TaurusMainWindow): ''' return copy.deepcopy(self.__panels.keys()) + def _setPermanentExternalApps(self, permExternalApps): + '''creates empty panels for restoring custom panels. + + :param permCustomPanels: (list<str>) list of names of custom panels + ''' + #first create the panels if they don't actually exist + for name in permExternalApps: + if name not in self._external_app_names: + # create empty action + self.__permanet_ext_apps.append(name) + action = ExternalAppAction('', name) + self._addExternalAppLauncher(name, action) + + def _getPermanentExternalApps(self): + return self.__permanet_ext_apps + def _setPermanentCustomPanels(self, permCustomPanels): '''creates empty panels for restoring custom panels. @@ -608,6 +688,31 @@ class TaurusGui(TaurusMainWindow): self.__panels[name].setPermanent(False) self.unregisterConfigurableItem(name, raiseOnError=False) + def updatePermanentExternalApplications(self, showAlways=True): + ''' + Shows a dialog for selecting which new externals applications + should be permanently stored in the configuration. + + :param showAlways: (bool) forces showing the dialog + ''' + #check if there are some newly created external applications that may + # be made permanent + #permanet_ext_app = list(self._external_app_names) + if len(self.__external_app) > 0 or showAlways: + dlg = QDoubleListDlg(winTitle='Stored external applications', + mainLabel='Select which of the external applications should be stored', + label1='Temporary (to be discarded)', label2='Permanent (to be stored)', + list1=self.__external_app.keys(), list2=self.__permanet_ext_apps) + result = dlg.exec_() + if result == Qt.QDialog.Accepted: + # update the temporally external applications + for name in dlg.getAll2(): + self.__permanet_ext_apps.append(str(name)) + + for name in dlg.getAll1(): + self.unregisterConfigurableItem("_extApp[%s]" % str(name), + raiseOnError=False) + def createCustomPanel(self, paneldesc=None): ''' Creates a panel from a Panel Description and sets it as "custom panel". @@ -1046,6 +1151,7 @@ class TaurusGui(TaurusMainWindow): EXTERNAL_APPS.append(ea) for a in EXTERNAL_APPS: + self._external_app_names.append(str(a.getAction().text())) self.addExternalAppLauncher(a.getAction()) @@ -1073,7 +1179,8 @@ class TaurusGui(TaurusMainWindow): for panel in self.__panels.values(): panel.toggleViewAction().setEnabled(modifiable) panel.setFeatures(dwfeat) - for action in (self.newPanelAction, self.showAllPanelsAction, self.hideAllPanelsAction): + for action in (self.newPanelAction, self.showAllPanelsAction, + self.hideAllPanelsAction): action.setEnabled(modifiable) self._lockviewAction.setChecked(not modifiable) -- 2.4.0 |
From: cfalcon <cf...@ce...> - 2015-07-02 14:30:03
|
taurusmainwindow class has not a method to deleteExternalAppConfig. This method is needed for the feature request #158 in order to delete external applications. --- lib/taurus/qt/qtgui/container/taurusmainwindow.py | 49 ++++++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/lib/taurus/qt/qtgui/container/taurusmainwindow.py b/lib/taurus/qt/qtgui/container/taurusmainwindow.py index 48d8f4c..687dda4 100644 --- a/lib/taurus/qt/qtgui/container/taurusmainwindow.py +++ b/lib/taurus/qt/qtgui/container/taurusmainwindow.py @@ -89,6 +89,25 @@ class ConfigurationDialog(Qt.QDialog, BaseConfigurableClass): self.externalAppsPage.widget().layout().addRow(label, editWidget) self.connect(editWidget, Qt.SIGNAL("textEdited(QString)"), extapp.setCmdArgs) self.connect(extapp, Qt.SIGNAL("cmdArgsChanged"), editWidget.setCmdText) + + def deleteExternalAppConfig(self, extapp): + '''Remove the given external application configuration''' + from taurus.external.qt import Qt + layout = self.externalAppsPage.widget().layout() + for cnt in reversed(range(layout.count())): + widget = layout.itemAt(cnt).widget() + if widget is not None: + text = str(widget.text()) # command1 + if isinstance(widget, Qt.QLabel): + dialog_text = "Command line for %s" % unicode(extapp.text()) + if text == dialog_text: + layout.removeWidget(widget) + widget.close() + else: + cmdargs = " ".join(extapp.cmdArgs()) + if text == cmdargs: + layout.removeWidget(widget) + widget.close() def show(self): ''' calls :meth:`Qt.QDialog.show` only if there is something to configure''' @@ -750,7 +769,8 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer): ''' if not isinstance(extapp, ExternalAppAction): extapp = ExternalAppAction(extapp, parent = self) - if extapp.parentWidget() is None: extapp.setParent(self) + if extapp.parentWidget() is None: + extapp.setParent(self) self.configurationDialog.addExternalAppConfig(extapp) self.configurationAction.setEnabled(True) @@ -770,7 +790,32 @@ class TaurusMainWindow(Qt.QMainWindow, TaurusBaseContainer): self.externalAppsMenu.addAction(extapp) #register this action for config self.registerConfigDelegate(extapp, "_extApp[%s]"%str(extapp.text())) - + + def deleteExternalAppLauncher(self, action): + ''' + Remove launchers for an external application to the Tools Menu + and/or to the Tools ToolBar. + + :param extapp: <ExternalAppAction> the external application + to be removed passed as a :class:`ExternalAppAction` + ''' + self.configurationDialog.deleteExternalAppConfig(action) + try: + # if is in ToolBar + self.extAppsBar.removeAction(action) + self.extAppsBar.update() + except: + pass + try: + # if is in Menu + self.externalAppsMenu.removeAction(action) + self.externalAppsMenu.update + except: + pass + #unregister this action for config + self.unregisterConfigurableItem("_extApp[%s]" % str(action.text()), + raiseOnError=False) + def _onChangeTangoHostAction(self): ''' slot called when the Change Tango Host is triggered. It prompts for a -- 2.4.0 |
From: Sergi R. <sr...@ce...> - 2015-07-01 13:32:08
|
Many thanks for the effort! Sergi On 07/01/2015 02:45 PM, Carlos Pascual wrote: > > Reproduced on a debian 9 using: > > taurustrend 'eval://rand()' -r 1 -b 100 & > export TTREND_PID=$! > ps u -p$TTREND_PID | awk '{sum=sum+$6}; END{print sum}' > ------------------------------------------------------------------------ > > *[tickets:#171] <http://sourceforge.net/p/tauruslib/tickets/171> > Memory leak in taurustrend* > > *Status:* waiting > *Milestone:* Jul15 > *Created:* Wed Jul 01, 2015 11:04 AM UTC by marc > *Last Updated:* Wed Jul 01, 2015 11:04 AM UTC > *Owner:* nobody > > How to reproduce (it can be reproduced both using tango or using eval): > > For example launching: > taurustrend 'eval://sin(rand())' -r 10 -b 1000 > > or launching: > taurustrend sys/tg_test/double_scalar -r 10 -b 1000 > > and then monitoring the memory of the taurustrend process (use your > own pid of the taurustrend process instead of 12000): > ps u -p 12000 | awk '{sum=sum+$6}; END {print sum}' > > -- > > The leak appears after some minutes (from 1 to 10 minutes). > > ------------------------------------------------------------------------ > > To be noted: > Bug appears in suse 11.1 and 12.1 (in 32 and 64 bits). > Bug does NOT appear on suse 13.2 > > ------------------------------------------------------------------------ > > Sent from sourceforge.net because > tau...@li... is subscribed to > https://sourceforge.net/p/tauruslib/tickets/ > <https://sourceforge.net/p/tauruslib/tickets> > > To unsubscribe from further messages, a project admin can change > settings at https://sourceforge.net/p/tauruslib/admin/tickets/options. > Or, if this is a mailing list, you can unsubscribe from the mailing list. > > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > > > _______________________________________________ > Tauruslib-devel mailing list > Tau...@li... > https://lists.sourceforge.net/lists/listinfo/tauruslib-devel |
From: Sergi R. <sr...@ce...> - 2015-07-01 07:58:09
|
Hi Carlos, Valentin This month I'll have to work on the Synoptic widgets to implement the new Taurus filters, as I'll be "opening the box" I can also add a new ExtendedSelection boolean property to control whether selection should select all device elements or not. Sergi On 06/30/2015 01:44 PM, Carlos Pascual wrote: > > Hi Valentin. > Just checking queued tickets. > > Do you think that you can provide a patch keeping in mind what srubio > asked? > > ------------------------------------------------------------------------ > > *[tickets:#44] Wrong Synoptic selection?* > > *Status:* waiting > *Milestone:* unassigned > *Created:* Tue Feb 25, 2014 02:25 PM UTC by Valentin Valls > *Last Updated:* Mon Mar 30, 2015 09:22 AM UTC > *Owner:* nobody > > 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. > > ------------------------------------------------------------------------ > > Sent from sourceforge.net because > tau...@li... is subscribed to > https://sourceforge.net/p/tauruslib/tickets/ > <https://sourceforge.net/p/tauruslib/tickets> > > To unsubscribe from further messages, a project admin can change > settings at https://sourceforge.net/p/tauruslib/admin/tickets/options. > Or, if this is a mailing list, you can unsubscribe from the mailing list. > > > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > > > _______________________________________________ > Tauruslib-devel mailing list > Tau...@li... > https://lists.sourceforge.net/lists/listinfo/tauruslib-devel |
From: cfalcon <cf...@ce...> - 2015-06-30 14:14:33
|
TaurusWheelEdit writes 0 to attribute when the w_value is higher than the TaurusWheelEdit limits. Fix it, setting the ranges in the consturctor to +inf, -inf by default instead of the max/min possible value acording with the current format. The limits can be defined using the proper methods or defining the limits in the attribute configuration (e.g. using jive for a tango attribute) --- lib/taurus/qt/qtgui/input/qwheel.py | 19 +++++----- lib/taurus/qt/qtgui/input/tauruswheel.py | 63 +++++++++++++++++++++++++------- 2 files changed, 59 insertions(+), 23 deletions(-) diff --git a/lib/taurus/qt/qtgui/input/qwheel.py b/lib/taurus/qt/qtgui/input/qwheel.py index 41a6852..b7481c9 100644 --- a/lib/taurus/qt/qtgui/input/qwheel.py +++ b/lib/taurus/qt/qtgui/input/qwheel.py @@ -31,11 +31,11 @@ __docformat__ = 'restructuredtext' import os import math +import numpy +import taurus from taurus.external.qt import Qt -#from taurus.qt.qtgui.resource.qrc_extra_icons import * - class _ArrowButton(Qt.QPushButton): """Private class to be used by QWheelEdit for an arrow button""" @@ -201,14 +201,14 @@ class QWheelEdit(Qt.QFrame): self._previous_value = 0 self._value = 0 self._value_str = '0' - self._minValue = float('-inf') - self._maxValue = float('+inf') + self._minValue = numpy.finfo('d').min # -inf + self._maxValue = numpy.finfo('d').max # inf self._editor = None self._editing = False self._showArrowButtons = True self._setDigits(QWheelEdit.DefaultIntDigitCount, QWheelEdit.DefaultDecDigitCount) - - self._setMinMax( self._getMinPossibleValue(), self._getMaxPossibleValue()) + # set as default min and max value to "-inf" & "+inf" + self._setMinMax( self._minValue, self._maxValue) self._setValue(0) self._build() @@ -480,6 +480,7 @@ class QWheelEdit(Qt.QFrame): if self._roundFunc: v = self._roundFunc(v) if v > self._maxValue or v < self._minValue: + taurus.warning('You are trying to set a value out of limits') return self._previous_value = self._value self._value = v @@ -739,7 +740,7 @@ class QWheelEdit(Qt.QFrame): rect = Qt.QRect(l.cellRect(1, 0).topLeft(), l.cellRect(1, l.columnCount() - 1).bottomRight()) ed.setGeometry(rect) - ed.setAlignment(Qt.Qt.AlignRight); + ed.setAlignment(Qt.Qt.AlignRight) ed.setMaxLength(self.getDigitCount() + 2) ed.setText(self.getValueStr()) ed.selectAll() @@ -888,8 +889,8 @@ def main(): button_layout.addWidget(resetbutton) isb.setValue(arrowWidget.getIntDigitCount()) dsb.setValue(arrowWidget.getDecDigitCount()) - minv.setRange(float('-inf'), float('+inf')) - maxv.setRange(float('-inf'), float('+inf')) + minv.setRange(numpy.finfo('d').min, numpy.finfo('d').max) + maxv.setRange(numpy.finfo('d').min, numpy.finfo('d').max) minv.setValue(arrowWidget.getMinValue()) maxv.setValue(arrowWidget.getMaxValue()) showarrowbutton.setChecked(arrowWidget.getShowArrowButtons()) diff --git a/lib/taurus/qt/qtgui/input/tauruswheel.py b/lib/taurus/qt/qtgui/input/tauruswheel.py index a9ad071..3918c95 100644 --- a/lib/taurus/qt/qtgui/input/tauruswheel.py +++ b/lib/taurus/qt/qtgui/input/tauruswheel.py @@ -29,9 +29,10 @@ __all__ = ["TaurusWheelEdit" ] __docformat__ = 'restructuredtext' +import taurus from taurus.external.qt import Qt -import taurus.core +from taurus.core.taurusbasetypes import TaurusEventType from taurus.qt.qtgui.base import TaurusBaseWritableWidget from qwheel import QWheelEdit @@ -51,30 +52,64 @@ class TaurusWheelEdit(QWheelEdit, TaurusBaseWritableWidget): #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- def handleEvent(self, evt_src, evt_type, evt_value): - if evt_type == taurus.core.taurusbasetypes.TaurusEventType.Config and not evt_value is None: + if evt_type == TaurusEventType.Config and evt_value is not None: + int_part = 0 + dec_part = 1 + warning = False + # get the minimal valid format + format_value = self.getFormatFromValue(self._value) f = evt_value.format.lower() if f[-1] not in ('d', 'f', 'g'): raise ValueError("'%s' format unsupported" % f) f = f.replace('g','f') if 'd' == f[-1]: dec_nb = 0 - try: total = int(f[1:-1]) - except: total = 6 + try: int_nb = int(f[1:-1]) + except: int_nb = 6 else: - f = map(int, f[1:-1].split('.', 1)) - total = f[0] - if len(f)>1: - dec_nb = f[1] + fmap = map(int, f[1:-1].split('.', 1)) + int_nb = fmap[int_part] + if len(fmap)>1: + dec_nb = fmap[dec_part] else: dec_nb = 2 - int_nb = total-dec_nb + if dec_nb < format_value[dec_part]: + warning = True + dec_nb = format_value[dec_part] + + if int_nb < format_value[int_part]: + warning = True + int_nb = format_value[int_part] + + if warning: + msg = ('Your setting format is not valid for the current value.' + 'Please use at least "%s.%s%s" instead' + %(int_nb, dec_nb, f[-1])) + taurus.warning(msg) + self.setDigitCount(int_nb=int_nb, dec_nb=dec_nb) - try: self.setMinValue(float(evt_value.min_value)) - except: pass - try: self.setMaxValue(float(evt_value.max_value)) - except: pass + try: + self.setMinValue(float(evt_value.min_value)) + except: + pass + try: + self.setMaxValue(float(evt_value.max_value)) + except: + pass TaurusBaseWritableWidget.handleEvent(self, evt_src, evt_type, evt_value) - + + def getFormatFromValue(self, value): + int_part = 0 + dec_part = 1 + str_value = str(value) + int_dec = str_value.split('.') + int_nb = len(int_dec[int_part]) + try: + dec_nb = len(int_dec[dec_part]) + except: + dec_nb = 0 + return int_nb, dec_nb + def updateStyle(self): TaurusBaseWritableWidget.updateStyle(self) if self.hasPendingOperations(): -- 2.4.0 |
From: cfalcon <cf...@ce...> - 2015-06-29 11:21:01
|
From: srubio <sr...@ce...> The format is initialized in the init method, so it is not updated once the gui was launching. Fix it, moving the min. and max. value calculation ("_setMinMax" method) in the _setDigits method. --- lib/taurus/qt/qtgui/input/qwheel.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/taurus/qt/qtgui/input/qwheel.py b/lib/taurus/qt/qtgui/input/qwheel.py index 41a6852..e02bdf5 100644 --- a/lib/taurus/qt/qtgui/input/qwheel.py +++ b/lib/taurus/qt/qtgui/input/qwheel.py @@ -208,7 +208,6 @@ class QWheelEdit(Qt.QFrame): self._showArrowButtons = True self._setDigits(QWheelEdit.DefaultIntDigitCount, QWheelEdit.DefaultDecDigitCount) - self._setMinMax( self._getMinPossibleValue(), self._getMaxPossibleValue()) self._setValue(0) self._build() @@ -253,13 +252,12 @@ class QWheelEdit(Qt.QFrame): self._upButtons = Qt.QButtonGroup() self._downButtons = Qt.QButtonGroup() self._digitLabels = [] - for l in self._digitLabels: l.setAlignment(Qt.AlignCenter) - + showDot = self.getDecDigitCount() > 0 signLabel = _DigitLabel('+') signLabel.setFocusPolicy(Qt.Qt.NoFocus) - signLabel.setAlignment(Qt.Qt.AlignRight) + signLabel.setAlignment(Qt.Qt.AlignCenter) self._digitLabels.append(signLabel) l.addWidget(signLabel, 1, 0) l.setRowMinimumHeight(1, signLabel.minimumSizeHint().height()) @@ -389,6 +387,8 @@ class QWheelEdit(Qt.QFrame): if self._decDigitCount > 0: total_chars += 1 # for dot self._valueFormat = '%%+0%d.%df' % (total_chars, self._decDigitCount) + self._setMinMax( self._getMinPossibleValue(), + self._getMaxPossibleValue()) # we call setValue to update the self._value_str self._setValue(self.getValue()) @@ -403,10 +403,11 @@ class QWheelEdit(Qt.QFrame): @return (str) a proper string representation of the given value """ if v is None: - return (self._valueFormat % 0).replace('0', '-') - ret = self._valueFormat % v - if ret.endswith('nan'): - ret = ret.replace('0',' ') + ret = (self._valueFormat % 0).replace('0', '-') + else: + ret = self._valueFormat % v + if ret.endswith('nan'): + ret = ret.replace('0',' ') self._value_str = ret return ret -- 2.4.0 |
From: cfalcon <cf...@ce...> - 2015-06-29 11:20:56
|
Hi Sergi, Thanks for send us a patch, it was very useful. I added a cosmetic change and the commit message and your author name, please verify that these are right. Please, the next time that you send a patch, use the git patch system to make more easier the integration. Best, C.Falcon |
From: Carlos P. <cpa...@ce...> - 2015-06-22 08:58:39
|
Hi, According to our agreed release schedule, we should make an official release of Taurus and Sardana during the next month. So this email is to coordinate the Jul15 release of *Taurus* and give the community an update of the release plans. Our initial goal was to have a deep refactoring of the taurus core (TEP3 and TEP14) integrated in develop prior to the Jul15 release, and therefore make a major version number jump for this release (e.g. to Taurus-4.0.0). Unfortunately, both TEP3 integration and TEP14 development are going slower than expected, so instead of delaying the Jul15 release we decided to ship it with just some bugfixes (i.e., no major version change) and leave the Taurus-4.0.0 for a latter "extra" release which, hopefully, should be ready by October. Here at Alba we'll be doing a bug-squashing sprint in the coming weeks, where priority will be given to the most urgent and/or easier-to-solve pending tickets. Those selected will be assigned to the "Jul15" milestone: http://sf.net/p/tauruslib/tickets/milestone/Jul15/ We will also try to integrate as much contributed patches as we can before the Jul15 release. 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 -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |
From: Carlos P. <cpa...@ce...> - 2015-05-27 10:46:56
|
Patch applied to develop, Thanks! On Tue 26 May 2015 17:08:42 cfalcon wrote: > The time.sleep of 3 seconds in both methods (startDs and stopDS) > have been commented to reduce the execution time. > These methods have been tested without reproduce the previously > failures. > --- > lib/taurus/core/tango/starter.py | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/lib/taurus/core/tango/starter.py > b/lib/taurus/core/tango/starter.py index 65b129e..10dd16e 100644 > --- a/lib/taurus/core/tango/starter.py > +++ b/lib/taurus/core/tango/starter.py > @@ -88,7 +88,9 @@ class Starter(object): > if self.isRunning(): > time.sleep(1) > else: > - time.sleep(3) #TODO: figure out why we have to wait > here + ## TODO: figure out why we have to wait here > (see isRunning) + #time.sleep(3) > + ## > _log.info('Server %s has been stopped' % > self.ds_name) return > _log.warning('Server %s did not stop within %d seconds'% > @@ -107,7 +109,9 @@ class Starter(object): > (self.ds_name, i)) > if self.isRunning(): > _log.info('Server %s has been started' % > self.ds_name) - time.sleep(3) #TODO: figure out why we > have to wait here + ## TODO: figure out why we have to > wait here (see isRunning) + #time.sleep(3) > + ## > return > else: > time.sleep(1) > @@ -173,6 +177,8 @@ class Starter(object): > > > def isRunning(self): > + # TODO: In case of we will need to add the sleep again. > + # We should study another implementation for this method. > if self.dserver is None: > return False > try: -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |
From: cfalcon <cf...@ce...> - 2015-05-26 15:08:57
|
The time.sleep of 3 seconds in both methods (startDs and stopDS) have been commented to reduce the execution time. These methods have been tested without reproduce the previously failures. --- lib/taurus/core/tango/starter.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/taurus/core/tango/starter.py b/lib/taurus/core/tango/starter.py index 65b129e..10dd16e 100644 --- a/lib/taurus/core/tango/starter.py +++ b/lib/taurus/core/tango/starter.py @@ -88,7 +88,9 @@ class Starter(object): if self.isRunning(): time.sleep(1) else: - time.sleep(3) #TODO: figure out why we have to wait here + ## TODO: figure out why we have to wait here (see isRunning) + #time.sleep(3) + ## _log.info('Server %s has been stopped' % self.ds_name) return _log.warning('Server %s did not stop within %d seconds'% @@ -107,7 +109,9 @@ class Starter(object): (self.ds_name, i)) if self.isRunning(): _log.info('Server %s has been started' % self.ds_name) - time.sleep(3) #TODO: figure out why we have to wait here + ## TODO: figure out why we have to wait here (see isRunning) + #time.sleep(3) + ## return else: time.sleep(1) @@ -173,6 +177,8 @@ class Starter(object): def isRunning(self): + # TODO: In case of we will need to add the sleep again. + # We should study another implementation for this method. if self.dserver is None: return False try: -- 2.4.0 |
From: Carlos P. <cpa...@ce...> - 2015-05-26 07:05:44
|
Applied to develop. Thanks for contributing! On Mon 25 May 2015 18:27:31 Jens Krüger wrote: > Hello Carlos, > > enclosed I'll send you a small patch related to the tauruslib. > > Regards > > Jens -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carretera BP 1413 de Cerdanyola-Sant Cugat, Km. 3.3 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |
From: Jens K. <Jen...@fr...> - 2015-05-26 06:33:18
|
Hello Carlos, enclosed I'll send you a small patch related to the tauruslib. Regards Jens -- Dipl.-Phys. Jens Krüger Leiter Gruppe Instrumentsteuerung Head of Instrument control group Technische Universität München Forschungsneutronenquelle Heinz Maier-Leibnitz (FRM II) Lichtenberg-Str. 1 D-85748 Garching Tel: + 49 89 289 14716 Fax: + 49 89 289 14620 mailto: jen...@fr... http://www.frm2.tum.de http://www.mlz-garching.de |
From: Carlos P. <cpa...@ce...> - 2015-05-18 20:50:17
|
Hi, We thought that the coming Tango Meeting may be a good opportunity to talk about what are our priorities for the development of Taurus and Sardana. In the following wiki pages, you can find a table which you are invited (encouraged) to edit in order to facilitate the discussion. You are also welcome to use the comments on the wiki page to discuss/propose modifications. priorities for sardana: https://sourceforge.net/p/sardana/wiki/priorities-may2015/ priorities for taurus: https://sourceforge.net/p/tauruslib/wiki/priorities-may2015/ Cheers, Zibi & Carlos PS: if you do not have permissions to edit the wiki, do not hessitate to provide us with your sourceforge user name and we will give them to you |