def get_panel(i): pargs = EXTRA_PANELS[i] if not fn.isSequence(pargs): return pargs elif len(pargs) == 3: return PanelDescription(pargs[0], classname=pargs[1], model=pargs[2]) else: return PanelDescription(pargs[0], classname=pargs[1], model=pargs[2], sharedDataRead=pargs[3], sharedDataWrite=pargs[4])
def getPanelDescription(name='VaccaDocker', model=''): """ :param name: Name for the Panel :param model: Model for the panel :return: """ return PanelDescription(name, 'vacca.panel.VaccaDocker')
def getVerticalGridPanelDescription(grid): class_name = get_grid(get_vertical_grid(grid)) gridPanel = PanelDescription( 'VaccaVGrid', classname='vacca.VaccaVerticalGrid', model=get_vertical_grid(grid), ) return gridPanel
def getGridPanelDescription(grid): class_name = get_grid(grid) gridPanel = PanelDescription( 'VaccaGrid', classname='vacca.VaccaGrid', model=grid, ) return gridPanel
def getPanelDescription(name='TangoDeviceProperties', model=''): """ :param name: Name for the Panel :param model: Model for the panel :return: """ return PanelDescription(name, classname='vacca.properties.VaccaPropTable', model=model)
def getPanelDescription(name='PANIC', model=''): """ :param name: Name for Panel :param model: Model for the Panel :return: Panel Descritption Object """ return PanelDescription( name, 'vacca.alarms.VaccaPanic', model, sharedDataWrite={'HighlightInstruments': 'devicesSelected'})
def getPanelDescription(name='VaccaDevicePanel', model=''): """ :param name: Name for the Panel :param model: Model for the panel :return: """ return PanelDescription( name, classname='vacca.panel.VaccaPanel', model=model, sharedDataRead={'SelectedInstrument': 'setModelHook'}, )
def onChoiceMade(self, choice): if choice == self.OTHER_TXT: wdesc, ok = ExpertWidgetChooserDlg.getDialog() if ok: self.widgetDescription.update(wdesc) else: return else: self.widgetDescription['classname'] = choice # the name will be set in self.validatePage self.wizard().setPanelDescription( PanelDescription('', **self.widgetDescription)) paneltype = str(self.widgetDescription['widgetname'] or self.widgetDescription['classname']) self.widgetTypeLB.setText("<b>Widget Type:</b> %s" % paneltype)
('Trends',['taurustrend','-a'],vpath('image/widgets/PressureTrend.jpg')), ] ############################################################################### # Add widgets/apps/panels for Alarms and Archiving if panic: try: EXTRA_APPS['PANIC'] = {'name': 'PANIC', 'class': vacca.VaccaPanic} EXTRA_WIDGETS.append(('panic.gui.AlarmGUI',wdir('image/icons/panic.gif'))) if not LIGHTWEIGHT: EXTRA_PANELS['PANIC'] = PanelDescription( 'PANIC','panic.gui.AlarmGUI',model='',#--- sharedDataWrite={'HighlightInstruments':'devicesSelected'}) except: print('Warning: Panic widgets not available') if PyTangoArchiving: try: EXTRA_WIDGETS.append(('PyTangoArchiving.widget.ArchivingBrowser.ArchivingBrowser',wdir('image/widgets/Archiving.png'))) EXTRA_APPS['Finder'] = {'name': 'Finder','class': c,'icon': wdir('image/icons/search.png')} if not LIGHTWEIGHT: try: import PyTangoArchiving.widget.browser c = PyTangoArchiving.widget.browser.ArchivingBrowser except:
print('\n' + '#' * 80 + '\n') print('In vacca.config(%s): loading classes\n' % VACCA_CONFIG) #=============================================================================== # Define panels to be shown. # To define a panel, instantiate a PanelDescription object (see documentation # for the gblgui_utils module) #=============================================================================== print('\t>>> Loading Trend panel ... %s' % ','.join(GAUGES)) #: If defined, the default trend will be shown in logarithmic scale GAUGES = GAUGES if GAUGES: trend = PanelDescription('Gauges', classname='vacca.plot.PressureTrend', model=GAUGES) trends = PanelDescription('Trends', classname='vacca.plot.VaccaTrend', model='') #: USE_DEVICE_TREE: True or False, To Show by default the Device_Tree USE_DEVICE_TREE = USE_DEVICE_TREE try: DEVICES = expand_device_list(DEVICES) DEVICES.extend(expand_device_list(EXTRA_DEVICES)) if DEVICE and DEVICE.lower() not in DEVICES: DEVICES.append(DEVICE.lower()) if DEVICES and not DEVICE:
#========================================================================= SYNOPTIC = ['images/example01.jdw', 'images/syn2.jdw'] #========================================================================= # Set INSTRUMENTS_FROM_POOL to True for enabling auto-creation of # instrument panels based on the Pool Instrument info #========================================================================= INSTRUMENTS_FROM_POOL = False #========================================================================= # Define panels to be shown. # To define a panel, instantiate a PanelDescription object #========================================================================= nxbrowser = PanelDescription( 'NeXus Browser', classname='taurus.qt.qtgui.extra_nexus.TaurusNeXusBrowser') i0 = PanelDescription('BigInstrument', classname='taurus.qt.qtgui.panel.TaurusAttrForm', model='sys/tg_test/1') i1 = PanelDescription('instrument1', classname='taurus.qt.qtgui.panel.TaurusForm', model=[ 'sys/tg_test/1/double_scalar', 'sys/tg_test/1/short_scalar_ro', 'sys/tg_test/1/float_spectrum_ro', 'sys/tg_test/1/double_spectrum' ])
SYNOPTIC = ['images/example01.jdw', 'images/syn2.jdw'] #========================================================================= # Set INSTRUMENTS_FROM_POOL to True for enabling auto-creation of # instrument panels based on the Pool Instrument info #========================================================================= INSTRUMENTS_FROM_POOL = False #========================================================================= # Define panels to be shown. # To define a panel, instantiate a PanelDescription object (see documentation # for the gblgui_utils module) #========================================================================= nxbrowser = PanelDescription('NeXus Browser', classname='TaurusNeXusBrowser', area=None) i0 = PanelDescription('BigInstrument', classname='TaurusAttrForm', model='sys/tg_test/1') i1 = PanelDescription('instrument1', classname='TaurusForm', model=[ 'sys/tg_test/1/double_scalar', 'sys/tg_test/1/short_scalar_ro', 'sys/tg_test/1/float_spectrum_ro', 'sys/tg_test/1/double_spectrum' ])
} libera_attributes = ['XPosSP', 'YPosSP', 'SumSP'] libera_models_attr = {} # Build panels for key, models in libera_models.iteritems(): device = models[0].upper() index = device.rfind("-") l_model = [] for attr in libera_attributes: l_model.append(device + attr) locals()[key] = PanelDescription( device[:index] + device[index + 1:], classname='LiberaBrilliancePlusMini', modulename='tgconf_libera_brilliance_plus.panels', model=l_model) # Build alarm panel # PanicGuiWidget = PanelDescription('Panic Taurus Widget', # classname = 'TaurusAlarmGUI', # modulename= "PanicGUI.gui", # model="I/PSS/Watchdog", # ) # ============================================================================== # Define which External Applications are to be inserted. # To define an external application, instantiate an ExternalApp object # See TauMainWindow.addExternalAppLauncher for valid values of ExternalApp
def getPanelDescription(NAME='Synoptic', JDRAW_FILE='', JDRAW_HOOK=None, JDRAW_TREE=[]): """ :param NAME: Name for the Panel :param JDRAW_FILE: synoptic configuration file :param JDRAW_HOOK: '' :param JDRAW_TREE: None :return: PanelDescription Object """ # CONNECTING FAKELOGGER FOR DEBUGGING try: import vacca sdm = vacca.utils.get_shared_data_manager() if sdm: v = sdm._SharedDataManager__models.get('SelectedInstrument') # An inline instantiated FakeLogger will print selected instrument on each click sdm.connectReader( 'SelectedInstrument', #<<< Works when triggered from tree FL( 'SDM.SelectedInstrument [%s,%s]' % (v.readerCount(), v.writerCount()), True).info, readOnConnect=False) except: print '#' * 80 print( 'Shared Data Manager is not available! (no TaurusGUI instance?)' ) traceback.print_exc() sdm = None print '#' * 80 print '>'*20+'Loading Synoptic panel new ... %s, %s, %s'%\ (JDRAW_FILE,JDRAW_HOOK,JDRAW_TREE) class_name, rsignal, wsignal = '', {}, {} if not JDRAW_FILE.endswith('.svg'): #Assuming a JDraw file print '>' * 20 + 'Creating JDW VaccaSynoptic' if JDRAW_HOOK is not None: print 'Enabling JDRAW_HOOK = %s' % JDRAW_HOOK VaccaSynoptic.in_hook = QSignalHook( JDRAW_HOOK) #MUST BE PERSISTENT VaccaSynoptic.out_hook = QSignalHook(JDRAW_HOOK) #Synoptic will write this signal wsignal = { 'JDrawOut': 'graphicItemSelected(QString)', } if sdm: sdm.connectWriter('SelectedInstrument', VaccaSynoptic.out_hook, 'modelChanged') sdm.connectReader( 'JDrawOut', VaccaSynoptic.out_hook.setModel, #ITS NOT CALLED!?!?!? readOnConnect=False) sdm.connectReader('JDrawOut', FL('SDM.JDrawOut', True).info, readOnConnect=False) v = sdm._SharedDataManager__models.get('JDrawOut') sdm.connectReader( 'JDrawOut', FL( 'SDM.JDrawOut DONE [%s,' '%s]' % (v.readerCount(), v.writerCount()), True).info, readOnConnect=False) sdm.connectWriter('JDrawIn', VaccaSynoptic.in_hook, 'modelChanged') sdm.connectReader('JDrawIn', FL('SDM.JDrawIn', True).info, readOnConnect=False) rsignal = { 'JDrawIn': 'selectGraphicItem', } sdm.connectReader('SelectedInstrument', VaccaSynoptic.in_hook.setModel, readOnConnect=False) v = sdm._SharedDataManager__models.get('JDrawIn') sdm.connectReader( 'JDrawIn', FL( 'SDM.JDrawIn DONE [%s,' '%s]' % (v.readerCount(), v.writerCount()), True).info, readOnConnect=False) else: rsignal = {'SelectedInstrument': 'selectGraphicItem'} rsignal['HighlightInstruments'] = 'setHighlightedItems' wsignal = { 'SelectedInstrument': 'graphicItemSelected(QString)' } if JDRAW_TREE: wsignal['LoadItems'] = 'modelsChanged' class_name = 'vacca.synoptics.VaccaSynoptic' elif JDRAW_FILE.endswith('.svg'): try: from svgsynoptic import SynopticWidget, Registry rsignal = {'SelectedInstrument': 'select_devices'} #@TODO: rsignal['HighlightInstruments'] = 'setHighlightedItems' wsignal = { 'SelectedInstrument': 'graphicItemSelected(QString)' } class_name = 'synoptic.SynopticWidget' except: print('Horreur!: svgsynoptic MODULE NOT AVAILABLE!') return None print 'Out of VaccaSynoptic.getPanelDescription(%s,%s)' % (class_name, JDRAW_FILE) return PanelDescription( NAME, #classname = 'vacca.VacuumSynoptic', classname=class_name, model=JDRAW_FILE, #Model loading is delayed by # VacuumSynoptic method sharedDataRead=rsignal, sharedDataWrite=wsignal, )
# This file is part of Taurus ## # http://taurus-scada.org ## # Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain ## # Taurus is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ## # Taurus is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. ## # You should have received a copy of the GNU Lesser General Public License # along with Taurus. If not, see <http://www.gnu.org/licenses/>. ## ########################################################################### '''An example of usage of TaurusGui in which the current file is a pure declarative configuration file that should be interpreted by the tarusgui script by running `taurusgui gui_pureconf` (if gui_pureconf.py is in the PYTHONPATH) or `taurusgui <full_path_to_gui_pureconf.py>` (if it is not in the PYTHONPATH)''' from taurus.qt.qtgui.taurusgui.utils import PanelDescription GUI_NAME = 'MyGui' panel = PanelDescription('Foo', classname='taurus.external.qt.Qt.QWidget')
libera_attributes = ['X', 'Y', 'Q', 'Sum'] libera_models_attr = {} # Build panels for key, models in libera_models.iteritems(): device = models[0].upper() index = device.rfind("-") l_model = [] for attr in libera_attributes: l_model.append(device + attr) locals()[key] = PanelDescription( device[:index] + device[index + 1:], classname='LiberaSinglePassEMini', modulename='tgconf_libera_single_pass_e.panels', model=l_model) # Build alarm panel # PanicGuiWidget = PanelDescription('Panic Taurus Widget', # classname = 'TaurusAlarmGUI', # modulename= "PanicGUI.gui", # model="I/PSS/Watchdog", # ) # ============================================================================== # Define which External Applications are to be inserted. # To define an external application, instantiate an ExternalApp object # See TauMainWindow.addExternalAppLauncher for valid values of ExternalApp