def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'ldapServer': self.ldapConnection = self.getHardwareObject(newValue) elif propertyName == 'codes': self.setCodes(newValue) elif propertyName == 'localLogin': self.localLogin = self.getHardwareObject(newValue) elif propertyName == 'dbConnection': self.dbConnection = self.getHardwareObject(newValue) elif propertyName == 'instanceServer': if self.instanceServer is not None: self.disconnect(self.instanceServer, PYSIGNAL('passControl'), self.passControl) self.disconnect(self.instanceServer, PYSIGNAL('haveControl'), self.haveControl) self.instanceServer = self.getHardwareObject(newValue) if self.instanceServer is not None: self.connect(self.instanceServer, PYSIGNAL('passControl'), self.passControl) self.connect(self.instanceServer, PYSIGNAL('haveControl'), self.haveControl) elif propertyName == 'icons': icons_list = newValue.split() try: self.loginButton.setPixmap(Icons.load(icons_list[0])) except IndexError: pass try: self.logoutButton.setPixmap(Icons.load(icons_list[1])) except IndexError: pass elif propertyName == 'session': self.session_hwobj = self.getHardwareObject(newValue) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == "specVersion": if self.scanObject is not None: self.safeDisconnect() self.scanObject = None if self.scanObject is not None: self.safeConnect() elif property == "backgroundColor": if newValue == "white": self.setPaletteBackgroundColor(Qt.white) elif newValue == "default": self.setPaletteBackgroundColor( QWidget.paletteBackgroundColor(self)) elif property == "graphColor": if newValue == "white": self.graph.canvas().setPaletteBackgroundColor(Qt.white) elif newValue == "default": self.graph.canvas().setPaletteBackgroundColor( QWidget.paletteBackgroundColor(self)) else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'mnemonic': if self.energyScan is not None: self.disconnect(self.energyScan, 'energyScanStarted', self.scanStarted) self.disconnect(self.energyScan, 'energyScanFinished', self.scanFinished) self.disconnect(self.energyScan, 'energyScanFailed', self.scanFailed) self.disconnect(self.energyScan, 'scanStatusChanged', self.scanStatusChanged) self.disconnect(self.energyScan, 'energyScanReady', self.scanReady) self.disconnect(self.energyScan, 'connected', self.connected) self.disconnect(self.energyScan, 'disconnected', self.disconnected) self.clearEnergies() self.energyScan = self.getHardwareObject(newValue) if self.energyScan is not None: self.connect(self.energyScan, 'energyScanStarted', self.scanStarted) self.connect(self.energyScan, 'energyScanFinished', self.scanFinished) self.connect(self.energyScan, 'energyScanFailed', self.scanFailed) self.connect(self.energyScan, 'scanStatusChanged', self.scanStatusChanged) self.connect(self.energyScan, 'energyScanReady', self.scanReady) self.connect(self.energyScan, 'connected', self.connected) self.connect(self.energyScan, 'disconnected', self.disconnected) self.connect(self.energyScan, 'chooch_finished', self.chooch_finished) if self.energyScan.isConnected(): self.connected() else: self.disconnected() else: self.disconnected() elif propertyName == 'icons': self.setIcons(newValue) else: BlissWidget.propertyChanged(self,propertyName,oldValue,newValue)
def propertyChanged(self, property, oldValue, newValue): if property == "specVersion": if self.scanObject is not None: self.safeDisconnect() self.scanObject = None if self.scanObject is not None: self.safeConnect() elif property == "backgroundColor": if newValue == "white": self.setPaletteBackgroundColor(Qt.white) elif newValue == "default": self.setPaletteBackgroundColor(QWidget.paletteBackgroundColor(self)) elif property == "graphColor": if newValue == "white": self.graph.canvas().setPaletteBackgroundColor(Qt.white) elif newValue == "default": self.graph.canvas().setPaletteBackgroundColor( QWidget.paletteBackgroundColor(self) ) else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'mnemonic': self.setMotors(self.minikappa,disconnect=True) self.setCommands(self.minikappa,disconnect=True) self.setChannels(self.minikappa,disconnect=True) self.commands['mnemonic']=newValue self.commands['label']='Commands' self.minikappa = self.getHardwareObject(newValue) if self.minikappa is not None: self.setMotors(self.minikappa) self.setCommands(self.minikappa) self.setChannels(self.minikappa) elif property == 'commandIcons': self.commands['icons']=newValue elif property == 'motorIcons': self.motorChanged(self.motorsList.currentText()) elif property == 'formatString': self.currentMotor['formatString']=newValue elif property == 'decimalPlaces': self.currentMotor['decimalPlaces']=newValue else: BlissWidget.propertyChanged(self,property,oldValue,newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'mnemonic': if self.energy is not None: self.disconnect(self.energy,PYSIGNAL('energyChanged'),self.energyChanged) self.disconnect(self.energy,PYSIGNAL('connected'),self.connected) self.disconnect(self.energy,PYSIGNAL('disconnected'),self.disconnected) self.disconnect(self.energy,PYSIGNAL('moveEnergyStarted'),self.changeEnergyStarted) self.disconnect(self.energy,PYSIGNAL('moveEnergyFailed'),self.changeEnergyFailed) self.disconnect(self.energy,PYSIGNAL('moveEnergyFinished'),self.changeEnergyOk) self.disconnect(self.energy,PYSIGNAL('moveEnergyReady'),self.changeEnergyReady) self.disconnect(self.energy,PYSIGNAL('energyLimitsChanged'),self.energyLimitsChanged) self.disconnect(self.energy,PYSIGNAL('wavelengthLimitsChanged'),self.wavelengthLimitsChanged) self.units.clear() self.kevHistory=[] self.angHistory=[] self.energy = self.getHardwareObject(newValue) if self.energy is not None: self.units.insertItem('keV') self.units.insertItem(chr(197)) def_mode=self['defaultMode'] if def_mode=='Ang': def_mode=chr(197) self.units.setCurrentText(def_mode) self.unitChanged(def_mode) self.connect(self.energy,PYSIGNAL('energyChanged'),self.energyChanged) self.connect(self.energy,PYSIGNAL('connected'),self.connected) self.connect(self.energy,PYSIGNAL('disconnected'),self.disconnected) self.connect(self.energy,PYSIGNAL('moveEnergyStarted'),self.changeEnergyStarted) self.connect(self.energy,PYSIGNAL('moveEnergyFailed'),self.changeEnergyFailed) self.connect(self.energy,PYSIGNAL('moveEnergyFinished'),self.changeEnergyOk) self.connect(self.energy,PYSIGNAL('moveEnergyReady'),self.changeEnergyReady) self.connect(self.energy,PYSIGNAL('energyLimitsChanged'),self.energyLimitsChanged) self.connect(self.energy,PYSIGNAL('wavelengthLimitsChanged'),self.wavelengthLimitsChanged) if self.energy.isConnected(): self.connected() else: self.disconnected() else: self.updateGUI() elif propertyName == 'icons': icons_list=newValue.split() #try: # self.applyButton.setPixmap(Icons.load(icons_list[0])) #except IndexError: # pass try: self.stopButton.setPixmap(Icons.load(icons_list[1])) except IndexError: pass elif propertyName == 'alwaysReadonly': pass else: BlissWidget.propertyChanged(self,propertyName,oldValue,newValue)
def propertyChanged(self, property, oldValue, newValue): #print "SlitsBrick.propertyChanged",property,newValue if property == 'slitbox': self.slitbox = self.getHardwareObject(newValue) if self.slitbox is not None: s1v = self.slitbox.getDeviceByRole('s1v') s1h = self.slitbox.getDeviceByRole('s1h') else: s1v = None s1h = None self.beamHorSize.setMotor(s1h) self.beamVerSize.setMotor(s1v) self.motorsDialog.setSlitbox(self.slitbox) elif property == 'minidiff': if self.minidiff is not None: pass self.minidiff = self.getHardwareObject(newValue) if self.minidiff is not None: pass elif property == 'icons': self.setIcons(newValue) #elif property == 'title': # self.topBox.setTitle(newValue) elif property == 'motorIcons': self.beamHorSize['icons'] = newValue self.beamVerSize['icons'] = newValue self.motorsDialog.setMotorIcons(newValue) elif property == 'formatString': self.beamHorSize['formatString'] = newValue self.beamVerSize['formatString'] = newValue elif property == 'decimalPlaces': self.beamHorSize['decimalPlaces'] = newValue self.beamVerSize['decimalPlaces'] = newValue else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'mnemonic': if self.xfeSpectrum is not None: self.disconnect(self.xfeSpectrum, 'xfeSpectrumStarted', self.spectrumStarted) self.disconnect(self.xfeSpectrum, 'xfeSpectrumFinished', self.spectrumFinished) self.disconnect(self.xfeSpectrum, 'xfeSpectrumFailed', self.spectrumFailed) self.disconnect(self.xfeSpectrum, 'spectrumStatusChanged', self.spectrumStatusChanged) self.disconnect(self.xfeSpectrum, 'xfeSpectrumReady', self.spectrumReady) self.disconnect(self.xfeSpectrum, 'connected', self.connected) self.disconnect(self.xfeSpectrum, 'disconnected', self.disconnected) self.clearEnergies() self.xfeSpectrum = self.getHardwareObject(newValue) if self.xfeSpectrum is not None: self.connect(self.xfeSpectrum, 'xfeSpectrumStarted', self.spectrumStarted) self.connect(self.xfeSpectrum, 'xfeSpectrumFinished', self.spectrumFinished) self.connect(self.xfeSpectrum, 'xfeSpectrumFailed', self.spectrumFailed) self.connect(self.xfeSpectrum, 'spectrumStatusChanged', self.spectrumStatusChanged) self.connect(self.xfeSpectrum, 'xfeSpectrumReady', self.spectrumReady) self.connect(self.xfeSpectrum, 'connected', self.connected) self.connect(self.xfeSpectrum, 'disconnected', self.disconnected) if self.xfeSpectrum.isConnected(): self.connected() else: self.disconnected() else: self.disconnected() elif propertyName == 'icons': self.setIcons(newValue) else: BlissWidget.propertyChanged(self,propertyName,oldValue,newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == "ldapServer": self.ldapConnection = self.getHardwareObject(newValue) elif propertyName == "codes": self.setCodes(newValue) elif propertyName == "localLogin": self.localLogin = self.getHardwareObject(newValue) elif propertyName == "dbConnection": self.dbConnection = self.getHardwareObject(newValue) logging.getLogger().info("dbconnection is %s", str(newValue)) self.updateLoginID() elif propertyName == "instanceServer": if self.instanceServer is not None: self.disconnect(self.instanceServer, PYSIGNAL("passControl"), self.passControl) self.disconnect(self.instanceServer, PYSIGNAL("haveControl"), self.haveControl) self.instanceServer = self.getHardwareObject(newValue) if self.instanceServer is not None: self.connect(self.instanceServer, PYSIGNAL("passControl"), self.passControl) self.connect(self.instanceServer, PYSIGNAL("haveControl"), self.haveControl) elif propertyName == "icons": icons_list = newValue.split() try: self.loginButton.setPixmap(Icons.load(icons_list[0])) except IndexError: pass try: self.logoutButton.setPixmap(Icons.load(icons_list[1])) except IndexError: pass elif propertyName == "session": self.session_hwobj = self.getHardwareObject(newValue) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'mnemonic': if self.attenuators is not None: self.disconnect(self.attenuators, PYSIGNAL('deviceReady'), self.connected) self.disconnect(self.attenuators, PYSIGNAL('deviceNotReady'), self.disconnected) self.disconnect(self.attenuators, PYSIGNAL('attStateChanged'), self.attStateChanged) self.disconnect(self.attenuators, PYSIGNAL('attFactorChanged'), self.attFactorChanged) self.transHistory=[] self.attenuators = self.getHardwareObject(newValue) if self.attenuators is not None: self.connect(self.attenuators, PYSIGNAL('deviceReady'), self.connected) self.connect(self.attenuators, PYSIGNAL('deviceNotReady'), self.disconnected) self.connect(self.attenuators, PYSIGNAL('attStateChanged'), self.attStateChanged) self.connect(self.attenuators, PYSIGNAL('attFactorChanged'), self.attFactorChanged) if self.attenuators.isReady(): self.connected() self.attFactorChanged(self.attenuators.getAttFactor()) self.attStateChanged(self.attenuators.getAttState()) else: self.disconnected() else: self.disconnected() elif property == 'icons': icons_list=newValue.split() else: BlissWidget.propertyChanged(self,property,oldValue,newValue)
def propertyChanged(self, property, oldValue, newValue): #print "SlitsBrick.propertyChanged",property,newValue if property == 'slitbox': self.slitbox=self.getHardwareObject(newValue) if self.slitbox is not None: s1v = self.slitbox.getDeviceByRole('s1v') s1h = self.slitbox.getDeviceByRole('s1h') else: s1v = None s1h = None self.beamHorSize.setMotor(s1h) self.beamVerSize.setMotor(s1v) self.motorsDialog.setSlitbox(self.slitbox) elif property == 'minidiff': if self.minidiff is not None: pass self.minidiff=self.getHardwareObject(newValue) if self.minidiff is not None: pass elif property == 'icons': self.setIcons(newValue) #elif property == 'title': # self.topBox.setTitle(newValue) elif property == 'motorIcons': self.beamHorSize['icons']=newValue self.beamVerSize['icons']=newValue self.motorsDialog.setMotorIcons(newValue) elif property == 'formatString': self.beamHorSize['formatString']=newValue self.beamVerSize['formatString']=newValue elif property == 'decimalPlaces': self.beamHorSize['decimalPlaces']=newValue self.beamVerSize['decimalPlaces']=newValue else: BlissWidget.propertyChanged(self,property,oldValue,newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'mnemonic': if self.beamstop_hwobj is not None: self.disconnect(self.beamstop_hwobj, qt.PYSIGNAL('deviceReady'), self.connected) self.disconnect(self.beamstop_hwobj, qt.PYSIGNAL('deviceNotReady'), self.disconnected) self.disconnect(self.beamstop_hwobj, qt.PYSIGNAL('beamstopDistanceChanged'), self.beamstop_distance_changed) self.beamstop_hwobj = self.getHardwareObject(newValue) if self.beamstop_hwobj is not None: self.connect(self.beamstop_hwobj, qt.PYSIGNAL('deviceReady'), self.connected) self.connect(self.beamstop_hwobj, qt.PYSIGNAL('deviceNotReady'), self.disconnected) self.connect(self.beamstop_hwobj, qt.PYSIGNAL('beamstopDistanceChanged'), self.beamstop_distance_changed) if self.beamstop_hwobj.isReady(): self.connected() self.beamstop_hwobj.update_values() else: self.disconnected() else: self.disconnected() else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'mnemonic': if self.cryodev is not None: self.disconnect(self.cryodev, PYSIGNAL("levelChanged"), self.setLevel) self.disconnect(self.cryodev, PYSIGNAL("temperatureChanged"), self.setTemperature) #self.disconnect(self.cryodev, PYSIGNAL("cryoStatusChanged"), self.setIcing) #self.disconnect(self.cryodev, PYSIGNAL("dryStatusChanged"), self.setDrier) #self.disconnect(self.cryodev, PYSIGNAL("sdryStatusChanged"), self.setSDrier) self.cryodev = self.getHardwareObject(newValue) if self.cryodev is not None: self.containerBox.setEnabled(True) self.connect(self.cryodev, PYSIGNAL("levelChanged"), self.setLevel) self.connect(self.cryodev, PYSIGNAL("temperatureChanged"), self.setTemperature) #self.connect(self.cryodev, PYSIGNAL("cryoStatusChanged"), self.setIcing) #self.connect(self.cryodev, PYSIGNAL("dryStatusChanged"), self.setDrier) #self.connect(self.cryodev, PYSIGNAL("sdryStatusChanged"), self.setSDrier) self.setLevel(self.cryodev.n2level) self.setTemperature(self.cryodev.temp) #self.setIcing(self.cryodev.cryo_status) #self.setDrier(self.cryodev.dry_status) #self.setSDrier(self.cryodev.sdry_status) else: self.containerBox.setEnabled(False) self.setTemperature(None) #self.setDrier("UNKNOWN") #self.setSDrier("UNKNOWN") #self.setIcing("UNKNOWN") self.setLevel(None) else: BlissWidget.propertyChanged(self,property,oldValue,newValue)
def propertyChanged(self,propertyName,oldValue,newValue): if propertyName=='ldapServer': self.ldapConnection=self.getHardwareObject(newValue) elif propertyName=='codes': self.setCodes(newValue) elif propertyName=='localLogin': self.localLogin=self.getHardwareObject(newValue) elif propertyName=='dbConnection': self.dbConnection = self.getHardwareObject(newValue) elif propertyName=='instanceServer': if self.instanceServer is not None: self.disconnect(self.instanceServer,PYSIGNAL('passControl'), self.passControl) self.disconnect(self.instanceServer,PYSIGNAL('haveControl'), self.haveControl) self.instanceServer=self.getHardwareObject(newValue) if self.instanceServer is not None: self.connect(self.instanceServer,PYSIGNAL('passControl'), self.passControl) self.connect(self.instanceServer,PYSIGNAL('haveControl'), self.haveControl) elif propertyName == 'icons': icons_list=newValue.split() try: self.loginButton.setPixmap(Icons.load(icons_list[0])) except IndexError: pass try: self.logoutButton.setPixmap(Icons.load(icons_list[1])) except IndexError: pass elif propertyName == 'session': self.session_hwobj = self.getHardwareObject(newValue) else: BlissWidget.propertyChanged(self,propertyName,oldValue,newValue)
def propertyChanged(self, property, oldValue, newValue): # print "SlitsBrick.propertyChanged",property,newValue if property == "slitbox": self.slitbox = self.getHardwareObject(newValue) if self.slitbox is not None: s1v = self.slitbox.getDeviceByRole("s1v") s1h = self.slitbox.getDeviceByRole("s1h") else: s1v = None s1h = None self.beamHorSize.setMotor(s1h) self.beamVerSize.setMotor(s1v) self.motorsDialog.setSlitbox(self.slitbox) elif property == "minidiff": if self.minidiff is not None: pass self.minidiff = self.getHardwareObject(newValue) if self.minidiff is not None: pass elif property == "icons": self.setIcons(newValue) # elif property == 'title': # self.topBox.setTitle(newValue) elif property == "motorIcons": self.beamHorSize["icons"] = newValue self.beamVerSize["icons"] = newValue self.motorsDialog.setMotorIcons(newValue) elif property == "formatString": self.beamHorSize["formatString"] = newValue self.beamVerSize["formatString"] = newValue elif property == "decimalPlaces": self.beamHorSize["decimalPlaces"] = newValue self.beamVerSize["decimalPlaces"] = newValue else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): #print propertyName,oldValue,newValue if propertyName=='appearance': if newValue=='simple': self.containerBox.setFrameShape(self.containerBox.NoFrame) self.containerBox.setInsideMargin(0) self.containerBox.setInsideSpacing(0) self.labElapsed.hide() self.labTimeSpent.hide() self.labRemaining.hide() self.labTimeLeft.hide() elif newValue=='normal': self.containerBox.setFrameShape(self.containerBox.GroupBoxPanel) self.containerBox.setInsideMargin(4) self.containerBox.setInsideSpacing(2) self.labElapsed.show() self.labTimeSpent.show() self.labRemaining.show() self.labTimeLeft.show() if propertyName=='title': if newValue!="": self.containerBox.setTitle(newValue) self.updateGeometry() else: BlissWidget.propertyChanged(self,propertyName,oldValue,newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'icons': icons_list = newValue.split() elif propertyName == 'mnemonic': if self.sampleChanger is not None: self.disconnect(self.sampleChanger, PYSIGNAL("stateChanged"), self.sampleChangerStateChanged) self.sampleChanger = self.getHardwareObject(newValue) if self.sampleChanger is not None: self.connect(self.sampleChanger, PYSIGNAL("stateChanged"), self.sampleChangerStateChanged) self.connect(self.sampleChanger, PYSIGNAL("loadedSampleChanged"), self.loadedSampleChanged) self.connect(self.sampleChanger, PYSIGNAL("samplesMapChanged"), self.updateVials) self.connect(self.sampleChanger, PYSIGNAL("matrixCodesUpdate"), self.dataMatricesUpdated) self.connect(self.sampleChanger, PYSIGNAL("ioStatusChanged"), self.ioStatusChanged) else: self.sampleChangerStateChanged("UNKNOWN") else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'mnemonic': self.setMotors(self.minikappa, disconnect=True) self.setCommands(self.minikappa, disconnect=True) self.setChannels(self.minikappa, disconnect=True) self.commands['mnemonic'] = newValue self.commands['label'] = 'Commands' self.minikappa = self.getHardwareObject(newValue) if self.minikappa is not None: self.setMotors(self.minikappa) self.setCommands(self.minikappa) self.setChannels(self.minikappa) elif property == 'commandIcons': self.commands['icons'] = newValue elif property == 'motorIcons': self.motorChanged(self.motorsList.currentText()) elif property == 'formatString': self.currentMotor['formatString'] = newValue elif property == 'decimalPlaces': self.currentMotor['decimalPlaces'] = newValue else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self,propertyName,oldValue,newValue): if propertyName == "icons": icons_list=newValue.split() try: self.browseButton.setPixmap(Icons.load(icons_list[0])) except IndexError: pass try: self.reloadButton.setPixmap(Icons.load(icons_list[1])) except IndexError: pass elif propertyName == 'dataCollect': if self.collectObj is not None: self.disconnect(self.collectObj, PYSIGNAL('progressUpdate'), self.imageCollected) self.collectObj=self.getHardwareObject(newValue) if self.collectObj is not None: self.connect(self.collectObj, PYSIGNAL('progressUpdate'), self.imageCollected) elif propertyName == 'fileHistorySize': self.imageFilename.setMaxCount(newValue) elif propertyName == 'showLegends': if not newValue: self.lineSelection._graph.setTitle=lambda t:mySetTitle(self.lineSelection._graph,t) self.lineSelection._graph.enableAxis(self.lineSelection._graph.xTop,False) self.lineSelection._graph.enableAxis(self.lineSelection._graph.xBottom,False) elif propertyName == 'graphFixedHeight': if newValue!=-1: self.lineSelection._graph.setFixedHeight(newValue) else: BlissWidget.propertyChanged(self,propertyName,oldValue,newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == "dataCollect": if self.collectObj is not None: self.disconnect( self.collectObj, PYSIGNAL("collectOscillationFinished"), self.updateOscillation, ) self.disconnect(self.collectObj, PYSIGNAL("collectImageTaken"), self.imageCollected) self.collectObj = self.getHardwareObject(newValue) if self.collectObj is not None: self.connect( self.collectObj, PYSIGNAL("collectOscillationFinished"), self.updateOscillation, ) self.connect(self.collectObj, PYSIGNAL("collectImageTaken"), self.imageCollected) self.dbServer = self.collectObj.dbServerHO() elif propertyName == "icons": icons_list = newValue.split() try: self.commentsButton.setPixmap(Icons.load(icons_list[0])) except IndexError: pass else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == "icons": self.setIcons(newValue) elif property == "defaultFormat": self.formatType = newValue else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'specVersion': if self.scanObject is not None: self.safeDisconnect() self.scanObject = QSpecScan(newValue) if self.scanObject is not None: self.safeConnect() elif property == 'backgroundColor': if newValue == 'white': self.setPaletteBackgroundColor(Qt.white) elif newValue == 'default': self.setPaletteBackgroundColor( QWidget.paletteBackgroundColor(self)) elif property == 'graphColor': if newValue == 'white': self.graph.canvas().setPaletteBackgroundColor(Qt.white) elif newValue == 'default': self.graph.canvas().setPaletteBackgroundColor( QWidget.paletteBackgroundColor(self)) else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == "dataCollect": if self.collectObj is not None: self.disconnect( self.collectObj, PYSIGNAL("collectOscillationFinished"), self.updateOscillation, ) self.disconnect( self.collectObj, PYSIGNAL("collectImageTaken"), self.imageCollected ) self.collectObj = self.getHardwareObject(newValue) if self.collectObj is not None: self.connect( self.collectObj, PYSIGNAL("collectOscillationFinished"), self.updateOscillation, ) self.connect( self.collectObj, PYSIGNAL("collectImageTaken"), self.imageCollected ) self.dbServer = self.collectObj.dbServerHO() elif propertyName == "icons": icons_list = newValue.split() try: self.commentsButton.setPixmap(Icons.load(icons_list[0])) except IndexError: pass else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'mnemonic': if self.commandHO is not None: for but_name in self.commandButtons: but=self.commandButtons[but_name] QObject.disconnect(but,PYSIGNAL("macroStarted"),self.macroStarted) QObject.disconnect(but,PYSIGNAL("macroDone"),self.macroDone) QObject.disconnect(but,PYSIGNAL("macroFailed"),self.macroFailed) but.close(True) self.commandButtons = {} self.commandHO = self.getHardwareObject(newValue) if self.commandHO is None: return for cmd in self.commandHO.getCommands(): try: self.commands2Hide.index(cmd.name()) except ValueError: but=MenuButton(self.containerBox,cmd,self.isSearchDone) but.setMinimumSize(QSize(75,50)) QObject.connect(but,PYSIGNAL("macroStarted"),self.macroStarted) QObject.connect(but,PYSIGNAL("macroDone"),self.macroDone) QObject.connect(but,PYSIGNAL("macroFailed"),self.macroFailed) self.commandButtons[but.userName()]=but if cmd.isConnected(): but.connected() else: but.disconnected() self['icons']=self['icons'] self['label']=self['label'] self['confirmationMessages']=self['confirmationMessages'] self['toolTips']=self['toolTips'] elif property == 'safetyShutter': self.safetyShutter=self.getHardwareObject(newValue) if self.safetyShutter is None: logging.getLogger().warning("CommandMenuBrick: safety shutter not configured") elif property == 'icons': self.setIcons(newValue) elif property == 'label': if self.commandHO is not None: if self['showBorder']: self.containerBox.setTitle(newValue) #else: # self.containerBox.setTitle("") elif property == 'showBorder': if newValue: self.containerBox.setFrameShape(self.containerBox.GroupBoxPanel) self.containerBox.setInsideMargin(4) else: self.containerBox.setFrameShape(self.containerBox.NoFrame) #self.containerBox.setInsideMargin(0) self['label']=self['label'] elif property == 'confirmationMessages': self.setConfirmationMessages(newValue) elif property == 'toolTips': self.setToolTips(newValue) else: BlissWidget.propertyChanged(self,property,oldValue,newValue)
def propertyChanged(self, property, oldValue, newValue): if property == "mnemonic": if self.attenuators is not None: self.disconnect(self.attenuators, PYSIGNAL("deviceReady"), self.connected) self.disconnect(self.attenuators, PYSIGNAL("deviceNotReady"), self.disconnected) self.disconnect(self.attenuators, PYSIGNAL("attStateChanged"), self.attStateChanged) self.disconnect( self.attenuators, PYSIGNAL("attFactorChanged"), self.attFactorChanged, ) self.transHistory = [] self.attenuators = self.getHardwareObject(newValue) if self.attenuators is not None: self.filtersDialog.setAttenuators(self.attenuators) self.connect(self.attenuators, PYSIGNAL("deviceReady"), self.connected) self.connect(self.attenuators, PYSIGNAL("deviceNotReady"), self.disconnected) self.connect(self.attenuators, PYSIGNAL("attStateChanged"), self.attStateChanged) self.connect( self.attenuators, PYSIGNAL("attFactorChanged"), self.attFactorChanged, ) if self.attenuators.isReady(): self.connected() self.attFactorChanged(self.attenuators.getAttFactor()) self.attStateChanged(self.attenuators.getAttState()) else: self.disconnected() else: self.disconnected() elif property == "filtersMode": if newValue == "Disabled": self.filtersButton.hide() elif property == "icons": icons_list = newValue.split() # try: # self.applyButton.setPixmap(Icons.load(icons_list[0])) # except IndexError: # pass try: self.filtersButton.setPixmap(Icons.load(icons_list[1])) except IndexError: pass else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'mnemonic': if self.energyScan is not None: self.disconnect(self.energyScan, 'energyScanStarted', self.scanStarted) self.disconnect( self.energyScan, 'energyScanFinished2', self.scanFinished) self.disconnect(self.energyScan, 'energyScanFailed', self.scanFailed) self.disconnect( self.energyScan, 'scanStatusChanged', self.scanStatusChanged) self.disconnect(self.energyScan, 'energyScanReady', self.scanReady) self.disconnect(self.energyScan, 'connected', self.connected) self.disconnect(self.energyScan, 'disconnected', self.disconnected) self.disconnect(self.energyScan, 'addNewPoint', self.addNewPoint) self.disconnect(self.energyScan, 'newScan', self.newScan) self.disconnect(self.energyScan, 'setElement', self.setElement) self.disconnect(self.energyScan, 'setDirectory', self.setDirectory) self.clearEnergies() self.energyScan = self.getHardwareObject(newValue) if self.energyScan is not None: self.scanObject = None # try: # specversion = self.energyScan.getCommandObject("doEnergyScan").specVersion # except: # logging.getLogger().exception("%s: could not get spec version from Energy Scan Hardware Object", self.name()) # else: # self.scanObject = QSpecScan(specversion) self.connect(self.energyScan, 'energyScanStarted', self.scanStarted) self.connect(self.energyScan, 'energyScanFinished2', self.scanFinished) self.connect(self.energyScan, 'energyScanFailed', self.scanFailed) self.connect( self.energyScan, 'scanStatusChanged', self.scanStatusChanged) self.connect(self.energyScan, 'energyScanReady', self.scanReady) self.connect(self.energyScan, 'connected', self.connected) self.connect(self.energyScan, 'disconnected', self.disconnected) self.connect(self.energyScan, 'chooch_finished', self.chooch_finished) self.connect(self.energyScan, 'addNewPoint', self.addNewPoint) self.connect(self.energyScan, 'newScan', self.newScan) self.connect(self.energyScan, 'setElement', self.setElement) self.connect(self.energyScan, 'setDirectory', self.setDirectory) if self.energyScan.isConnected(): self.connected() else: self.disconnected() else: self.disconnected() elif propertyName == 'icons': self.setIcons(newValue) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'mnemonic': if self.energyScan is not None: self.disconnect(self.energyScan, 'energyScanStarted', self.scanStarted) self.disconnect(self.energyScan, 'energyScanFinished', self.scanFinished) self.disconnect(self.energyScan, 'energyScanFailed', self.scanFailed) self.disconnect(self.energyScan, 'scanStatusChanged', self.scanStatusChanged) self.disconnect(self.energyScan, 'energyScanReady', self.scanReady) self.disconnect(self.energyScan, 'connected', self.connected) self.disconnect(self.energyScan, 'disconnected', self.disconnected) self.clearEnergies() self.energyScan = self.getHardwareObject(newValue) if self.energyScan is not None: self.scanObject = None try: specversion = self.energyScan.getCommandObject( "doEnergyScan").specVersion except: logging.getLogger().exception( "%s: could not get spec version from Energy Scan Hardware Object", self.name()) else: self.scanObject = QSpecScan(specversion) self.connect(self.energyScan, 'energyScanStarted', self.scanStarted) self.connect(self.energyScan, 'energyScanFinished', self.scanFinished) self.connect(self.energyScan, 'energyScanFailed', self.scanFailed) self.connect(self.energyScan, 'scanStatusChanged', self.scanStatusChanged) self.connect(self.energyScan, 'energyScanReady', self.scanReady) self.connect(self.energyScan, 'connected', self.connected) self.connect(self.energyScan, 'disconnected', self.disconnected) self.connect(self.energyScan, 'chooch_finished', self.chooch_finished) if self.energyScan.isConnected(): self.connected() else: self.disconnected() else: self.disconnected() elif propertyName == 'icons': self.setIcons(newValue) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'icons': icons_list=newValue.split() try: self.status.setIcons(icons_list[0]) except IndexError: pass try: self.currentBasket.setIcons(icons_list[1]) except IndexError: pass try: self.scanBaskets.setIcons(icons_list[2],icons_list[3]) except IndexError: pass try: self.currentSample.setIcons(icons_list[5],icons_list[6]) except IndexError: pass elif propertyName == 'mnemonic': self.sampleChanger = self.getHardwareObject(newValue) if self.sampleChanger is not None: self.connect(self.sampleChanger, SampleChanger.STATUS_CHANGED_EVENT, self.sampleChangerStatusChanged) self.connect(self.sampleChanger, SampleChanger.STATE_CHANGED_EVENT, self.sampleChangerStateChanged) self.connect(self.sampleChanger, SampleChanger.INFO_CHANGED_EVENT, self.infoChanged) self.connect(self.sampleChanger, SampleChanger.SELECTION_CHANGED_EVENT, self.selectionChanged) #self.connect(self.sampleChanger, PYSIGNAL("sampleChangerCanLoad"), self.sampleChangerCanLoad) #self.connect(self.sampleChanger, PYSIGNAL("minidiffCanMove"), self.minidiffCanMove) #self.connect(self.sampleChanger, PYSIGNAL("sampleChangerInUse"), self.sampleChangerInUse) self.connect(self.sampleChanger, SampleChanger.LOADED_SAMPLE_CHANGED_EVENT, self.loadedSampleChanged) #self.currentSample.hideHolderLength(self.sampleChanger.isMicrodiff()) #self.status.hideOperationalControl(self.sampleChanger.isMicrodiff()) self.sampleChangerStatusChanged(self.sampleChanger.getStatus()) self.sampleChangerStateChanged(self.sampleChanger.getState()) self.infoChanged() self.selectionChanged() #self.sampleChangerInUse(self.sampleChanger.sampleChangerInUse()) #self.sampleChangerCanLoad(self.sampleChanger.sampleChangerCanLoad()) #self.minidiffCanMove(self.sampleChanger.minidiffCanMove()) self.loadedSampleChanged(self.sampleChanger.getLoadedSample()) #self.basketTransferModeChanged(self.sampleChanger.getBasketTransferMode()) elif propertyName == 'showSelectButton': self.scanBaskets.showSelectButton(newValue) for basket in self.baskets: basket.setUnselectable(newValue) elif propertyName == 'defaultHolderLength': self.currentSample.setHolderLength(newValue) elif propertyName == 'doubleClickLoads': self.doubleClickLoads.setChecked(False) #newValue) else: BlissWidget.propertyChanged(self,propertyName,oldValue,newValue)
def propertyChanged(self,propertyName,oldValue,newValue): if propertyName=='specstate': if self.specStateHO is not None: self.disconnect(self.specStateHO,'specStateChanged',self.specStateChanged) self.specStateHO=self.getHardwareObject(newValue) if self.specStateHO is not None: self.connect(self.specStateHO,'specStateChanged',self.specStateChanged) else: BlissWidget.propertyChanged(self,propertyName,oldValue,newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'mnemonic': if self.instanceServer is not None: self.disconnect(self.instanceServer,PYSIGNAL('instanceInitializing'),self.instanceInitializing) self.disconnect(self.instanceServer,PYSIGNAL('serverInitialized'),self.serverInitialized) self.disconnect(self.instanceServer,PYSIGNAL('clientInitialized'),self.clientInitialized) self.disconnect(self.instanceServer,PYSIGNAL('serverClosed'),self.serverClosed) self.disconnect(self.instanceServer,PYSIGNAL('newClient'), self.newClient) self.disconnect(self.instanceServer,PYSIGNAL('haveControl'), self.haveControl) self.disconnect(self.instanceServer,PYSIGNAL('passControl'), self.passControl) self.disconnect(self.instanceServer,PYSIGNAL('wantsControl'), self.wantsControl) self.disconnect(self.instanceServer,PYSIGNAL('widgetUpdate'), self.widgetUpdate) self.disconnect(self.instanceServer,PYSIGNAL('clientChanged'), self.clientChanged) self.disconnect(self.instanceServer,PYSIGNAL('clientClosed'), self.clientClosed) self.disconnect(self.instanceServer,PYSIGNAL('widgetCall'), self.widgetCall) self.instanceServer = self.getHardwareObject(newValue) if self.instanceServer is not None: self.connect(self.instanceServer,PYSIGNAL('instanceInitializing'),self.instanceInitializing) self.connect(self.instanceServer,PYSIGNAL('serverInitialized'),self.serverInitialized) self.connect(self.instanceServer,PYSIGNAL('clientInitialized'),self.clientInitialized) self.connect(self.instanceServer,PYSIGNAL('serverClosed'),self.serverClosed) self.connect(self.instanceServer,PYSIGNAL('newClient'), self.newClient) self.connect(self.instanceServer,PYSIGNAL('haveControl'), self.haveControl) self.connect(self.instanceServer,PYSIGNAL('passControl'), self.passControl) self.connect(self.instanceServer,PYSIGNAL('wantsControl'), self.wantsControl) self.connect(self.instanceServer,PYSIGNAL('widgetUpdate'), self.widgetUpdate) self.connect(self.instanceServer,PYSIGNAL('clientChanged'), self.clientChanged) self.connect(self.instanceServer,PYSIGNAL('clientClosed'), self.clientClosed) self.connect(self.instanceServer,PYSIGNAL('widgetCall'), self.widgetCall) elif propertyName=="xmlrpc_server": self.xmlrpc_server = self.getHardwareObject(newValue) elif propertyName == 'hutchtrigger': self.hutchtrigger = self.getHardwareObject(newValue) if self.hutchtrigger is not None: self.connect(self.hutchtrigger, PYSIGNAL("hutchTrigger"), self.hutchTriggerChanged) elif propertyName == 'icons': icons_list=newValue.split() try: self.serverIcon=Icons.load(icons_list[0]) except IndexError: pass try: self.clientIcon=Icons.load(icons_list[1]) except IndexError: pass try: self.takeControlButton.setPixmap(Icons.load(icons_list[2])) except IndexError: pass try: self.askForControlButton.setPixmap(Icons.load(icons_list[3])) except IndexError: pass else: BlissWidget.propertyChanged(self,propertyName,oldValue,newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == "appearance": if newValue == "simple": self.container_hbox.setFrameShape(self.container_hbox.NoFrame) self.container_hbox.setInsideMargin(0) self.container_hbox.setInsideSpacing(0) self.time_total_label.hide() self.time_total_value_label.hide() self.time_remaining_label.hide() self.time_remaining_value_label.hide() elif newValue == "normal": self.container_hbox.setFrameShape(self.container_hbox.GroupBoxPanel) self.container_hbox.setInsideMargin(4) self.container_hbox.setInsideSpacing(2) self.time_total_label.show() self.time_total_value_label.show() self.time_remaining_label.show() self.time_remaining_value_label.show() elif propertyName == "title": if newValue != "": self.container_hbox.setTitle(newValue) self.updateGeometry() elif propertyName == "timeFormat": self.time_format = newValue elif propertyName == "mnemonic": if self.collect_hwobj is not None: self.disconnect( self.collect_hwobj, qt.PYSIGNAL("collectNumberOfFrames"), self.set_progress_total_time, ) self.disconnect( self.collect_hwobj, qt.PYSIGNAL("collectImageTaken"), self.start_progress, ) self.disconnect( self.collect_hwobj, qt.PYSIGNAL("collectEnded"), self.stop_progress ) self.collect_hwobj = self.getHardwareObject(newValue) if self.collect_hwobj is not None: self.connect( self.collect_hwobj, qt.PYSIGNAL("collectNumberOfFrames"), self.set_progress_total_time, ) self.connect( self.collect_hwobj, qt.PYSIGNAL("collectImageTaken"), self.start_progress, ) self.connect( self.collect_hwobj, qt.PYSIGNAL("collectEnded"), self.stop_progress ) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == "appearance": if newValue == "simple": self.container_hbox.setFrameShape(self.container_hbox.NoFrame) self.container_hbox.setInsideMargin(0) self.container_hbox.setInsideSpacing(0) self.time_total_label.hide() self.time_total_value_label.hide() self.time_remaining_label.hide() self.time_remaining_value_label.hide() elif newValue == "normal": self.container_hbox.setFrameShape( self.container_hbox.GroupBoxPanel) self.container_hbox.setInsideMargin(4) self.container_hbox.setInsideSpacing(2) self.time_total_label.show() self.time_total_value_label.show() self.time_remaining_label.show() self.time_remaining_value_label.show() elif propertyName == "title": if newValue != "": self.container_hbox.setTitle(newValue) self.updateGeometry() elif propertyName == "timeFormat": self.time_format = newValue elif propertyName == "mnemonic": if self.collect_hwobj is not None: self.disconnect( self.collect_hwobj, qt.PYSIGNAL("collectNumberOfFrames"), self.set_progress_total_time, ) self.disconnect( self.collect_hwobj, qt.PYSIGNAL("collectImageTaken"), self.start_progress, ) self.disconnect(self.collect_hwobj, qt.PYSIGNAL("collectEnded"), self.stop_progress) self.collect_hwobj = self.getHardwareObject(newValue) if self.collect_hwobj is not None: self.connect( self.collect_hwobj, qt.PYSIGNAL("collectNumberOfFrames"), self.set_progress_total_time, ) self.connect( self.collect_hwobj, qt.PYSIGNAL("collectImageTaken"), self.start_progress, ) self.connect(self.collect_hwobj, qt.PYSIGNAL("collectEnded"), self.stop_progress) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == "mnemonic": if self.diffractometer_hwobj is not None: self.disconnect( self.diffractometer_hwobj, qt.PYSIGNAL("kappaMoved"), self.kappa_value_changed, ) self.disconnect( self.diffractometer_hwobj, qt.PYSIGNAL("kappPhiMoved"), self.phi_value_changed, ) self.diffractometer_hwobj = self.getHardwareObject(newValue) if self.diffractometer_hwobj is not None: self.connect( self.diffractometer_hwobj, qt.PYSIGNAL("kappaMoved"), self.kappa_value_changed, ) self.connect( self.diffractometer_hwobj, qt.PYSIGNAL("kappaPhiMoved"), self.phi_value_changed, ) elif propertyName == "label": self.setLabel(newValue) elif propertyName == "showLabel": if newValue: self.setLabel(self["label"]) else: self.setLabel(None) elif propertyName == "showStop": if newValue: self.stop_motors_button.show() else: self.stop_motors_button.hide() elif propertyName == "showBox": if newValue: self.container_hbox.setFrameShape(self.container_hbox.GroupBoxPanel) self.container_hbox.setInsideMargin(4) self.container_hbox.setInsideSpacing(0) else: self.container_hbox.setFrameShape(self.container_hbox.NoFrame) self.container_hbox.setInsideMargin(0) self.container_hbox.setInsideSpacing(0) self.setLabel(self["label"]) elif propertyName == "icons": icons_list = newValue.split() try: self.move_motors_button.setPixmap(Icons.load(icons_list[0])) except IndexError: pass else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'specstate': if self.specStateHO is not None: self.disconnect(self.specStateHO, 'specStateChanged', self.specStateChanged) self.specStateHO = self.getHardwareObject(newValue) if self.specStateHO is not None: self.connect(self.specStateHO, 'specStateChanged', self.specStateChanged) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == "light": if self.lightHO is not None: self.disconnect(self.lightHO, "wagoStateChanged", self.lightChanged) self.lightHO = self.getHardwareObject(newValue) if self.lightHO is not None: self.connect(self.lightHO, "wagoStateChanged", self.lightChanged) elif propertyName == "cryostream": if self.cryostreamHO is not None: self.disconnect(self.cryostreamHO, "wagoStateChanged", self.cryostreamChanged) self.cryostreamHO = self.getHardwareObject(newValue) if self.cryostreamHO is not None: self.connect(self.cryostreamHO, "wagoStateChanged", self.cryostreamChanged) elif propertyName == "fluodetector": if self.fluodetectorHO is not None: self.disconnect(self.fluodetectorHO, "wagoStateChanged", self.fluodetectorChanged) self.fluodetectorHO = self.getHardwareObject(newValue) if self.fluodetectorHO is not None: self.connect(self.fluodetectorHO, "wagoStateChanged", self.fluodetectorChanged) elif propertyName == "scintillator": if self.scintillatorHO is not None: self.disconnect(self.scintillatorHO, "wagoStateChanged", self.scintillatorChanged) self.scintillatorHO = self.getHardwareObject(newValue) if self.scintillatorHO is not None: self.connect(self.scintillatorHO, "wagoStateChanged", self.scintillatorChanged) elif propertyName == "aperture": if self.apertureHO is not None: self.disconnect(self.apertureHO, "wagoStateChanged", self.apertureChanged) self.apertureHO = self.getHardwareObject(newValue) if self.apertureHO is not None: self.connect(self.apertureHO, "wagoStateChanged", self.apertureChanged) elif propertyName == "hutchtrigger": if self.hutchtriggerHO is not None: self.disconnect(self.hutchtriggerHO, "hutchTrigger", self.hutchtriggerChanged) self.disconnect(self.hutchtriggerHO, "connected", self.hutchtriggerConnected) self.disconnect(self.hutchtriggerHO, "disconnected", self.hutchtriggerDisconnected) self.disconnect(self.hutchtriggerHO, "msgChanged", self.hutchtriggerMsgChanged) self.hutchtriggerHO = self.getHardwareObject(newValue) if self.hutchtriggerHO is not None: self.connect(self.hutchtriggerHO, "hutchTrigger", self.hutchtriggerChanged) self.connect(self.hutchtriggerHO, "connected", self.hutchtriggerConnected) self.connect(self.hutchtriggerHO, "disconnected", self.hutchtriggerDisconnected) self.connect(self.hutchtriggerHO, "msgChanged", self.hutchtriggerMsgChanged) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'mnemonic': if self.dataCollect is not None: #self.disconnect(self.dataCollect,'collectStarted', self.collectStarted) self.disconnect(self.dataCollect, 'collectNumberOfFrames', self.collectSpecStarted) #self.disconnect(self.dataCollect,'collectEnded', self.collectEnded) #self.disconnect(self.dataCollect,'collectFailed', self.collectFailed) #self.disconnect(self.dataCollect,'collectStartCentring', self.collectStartCentring) #self.disconnect(self.dataCollect,'collectCentringFinished', self.collectCentringFinished) self.disconnect(self.dataCollect, 'collectValidateCentring', self.collectValidateCentring) self.disconnect(self.dataCollect, 'collectRejectCentring', self.collectRejectCentring) #self.disconnect(self.dataCollect,'collectCentringFinished', self.collectCentringFinished) self.disconnect(self.dataCollect, 'collectMountingSample', self.collectMountingSample) #self.disconnect(self.dataCollect,'collectUnmountingSample', self.collectUnmountingSample) self.disconnect(self.dataCollect, 'collectOscillationStarted', self.collectOscillationStarted) self.disconnect(self.dataCollect, 'collectOscillationFailed', self.collectOscillationFailed) self.disconnect(self.dataCollect, 'collectOscillationFinished', self.collectOscillationFinished) self.dataCollect = self.getHardwareObject(newValue) if self.dataCollect is not None: #self.connect(self.dataCollect,'collectStarted', self.collectStarted) self.connect(self.dataCollect, 'collectNumberOfFrames', self.collectSpecStarted) #self.connect(self.dataCollect,'collectEnded', self.collectEnded) #self.connect(self.dataCollect,'collectFailed', self.collectFailed) #self.connect(self.dataCollect,'collectStartCentring', self.collectStartCentring) #self.connect(self.dataCollect,'collectCentringFinished', self.collectCentringFinished) self.connect(self.dataCollect, 'collectValidateCentring', self.collectValidateCentring) self.connect(self.dataCollect, 'collectRejectCentring', self.collectRejectCentring) self.connect(self.dataCollect, 'collectMountingSample', self.collectMountingSample) #self.connect(self.dataCollect,'collectUnmountingSample', self.collectUnmountingSample) self.connect(self.dataCollect, 'collectOscillationStarted', self.collectOscillationStarted) self.connect(self.dataCollect, 'collectOscillationFailed', self.collectOscillationFailed) self.connect(self.dataCollect, 'collectOscillationFinished', self.collectOscillationFinished) else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'backgroundColor': if newValue == 'white': self.setPaletteBackgroundColor(Qt.white) elif newValue == 'default': self.setPaletteBackgroundColor(QWidget.paletteBackgroundColor(self)) elif property == 'graphColor': if newValue == 'white': self.graph.canvas().setPaletteBackgroundColor(Qt.white) elif newValue == 'default': self.graph.canvas().setPaletteBackgroundColor(QWidget.paletteBackgroundColor(self)) else: BlissWidget.propertyChanged(self,property,oldValue,newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'mnemonic': if self.energyScan is not None: self.disconnect(self.energyScan, 'energyScanStarted', self.scanStarted) self.disconnect(self.energyScan, 'energyScanFinished', self.scanFinished) self.disconnect(self.energyScan, 'energyScanFailed', self.scanFailed) self.disconnect(self.energyScan, 'scanStatusChanged', self.scanStatusChanged) self.disconnect(self.energyScan, 'energyScanReady', self.scanReady) self.disconnect(self.energyScan, 'connected', self.connected) self.disconnect(self.energyScan, 'disconnected', self.disconnected) self.clearEnergies() self.energyScan = self.getHardwareObject(newValue) if self.energyScan is not None: self.connect(self.energyScan, 'energyScanStarted', self.scanStarted) self.connect(self.energyScan, 'energyScanFinished', self.scanFinished) self.connect(self.energyScan, 'energyScanFailed', self.scanFailed) self.connect(self.energyScan, 'scanStatusChanged', self.scanStatusChanged) self.connect(self.energyScan, 'energyScanReady', self.scanReady) self.connect(self.energyScan, 'connected', self.connected) self.connect(self.energyScan, 'disconnected', self.disconnected) self.connect(self.energyScan, 'chooch_finished', self.chooch_finished) if self.energyScan.isConnected(): self.connected() else: self.disconnected() else: self.disconnected() elif propertyName == 'icons': self.setIcons(newValue) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'mnemonic': energy = self.getHardwareObject(newValue) if energy is not None: #self.setElements(energy.getElements()) self.periodicTable.setElements(energy.getElements()) else: #self.setElements(()) self.periodicTable.setElements(()) elif property == 'title': self.topBox.setTitle(newValue) elif property == 'kevFormatString': pass elif property == 'maximumWidth': self.setMaximumWidth(newValue) else: BlissWidget.propertyChanged(self,property,oldValue,newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'mnemonic': if self.attenuators is not None: self.disconnect(self.attenuators, PYSIGNAL('deviceReady'), self.connected) self.disconnect(self.attenuators, PYSIGNAL('deviceNotReady'), self.disconnected) self.disconnect(self.attenuators, PYSIGNAL('attStateChanged'), self.attStateChanged) self.disconnect(self.attenuators, PYSIGNAL('attFactorChanged'), self.attFactorChanged) self.transHistory=[] self.attenuators = self.getHardwareObject(newValue) if self.attenuators is not None: self.filtersDialog.setAttenuators(self.attenuators) self.connect(self.attenuators, PYSIGNAL('deviceReady'), self.connected) self.connect(self.attenuators, PYSIGNAL('deviceNotReady'), self.disconnected) self.connect(self.attenuators, PYSIGNAL('attStateChanged'), self.attStateChanged) self.connect(self.attenuators, PYSIGNAL('attFactorChanged'), self.attFactorChanged) if self.attenuators.isReady(): self.connected() self.attFactorChanged(self.attenuators.getAttFactor()) self.attStateChanged(self.attenuators.getAttState()) else: self.disconnected() else: self.disconnected() elif property == 'filtersMode': if newValue == 'Disabled': self.filtersButton.hide() elif property == 'icons': icons_list=newValue.split() #try: # self.applyButton.setPixmap(Icons.load(icons_list[0])) #except IndexError: # pass try: self.filtersButton.setPixmap(Icons.load(icons_list[1])) except IndexError: pass else: BlissWidget.propertyChanged(self,property,oldValue,newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'mnemonic': energy = self.getHardwareObject(newValue) if energy is not None: #self.setElements(energy.getElements()) self.periodicTable.setElements(energy.getElements()) else: #self.setElements(()) self.periodicTable.setElements(()) elif property == 'title': self.topBox.setTitle(newValue) elif property == 'kevFormatString': pass elif property == 'maximumWidth': self.setMaximumWidth(newValue) else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == "mnemonic": if self.attenuators is not None: self.disconnect(self.attenuators, PYSIGNAL("deviceReady"), self.connected) self.disconnect(self.attenuators, PYSIGNAL("deviceNotReady"), self.disconnected) self.disconnect(self.attenuators, PYSIGNAL("attStateChanged"), self.attStateChanged) self.disconnect( self.attenuators, PYSIGNAL("attFactorChanged"), self.attFactorChanged, ) self.transHistory = [] self.attenuators = self.getHardwareObject(newValue) if self.attenuators is not None: self.connect(self.attenuators, PYSIGNAL("deviceReady"), self.connected) self.connect(self.attenuators, PYSIGNAL("deviceNotReady"), self.disconnected) self.connect(self.attenuators, PYSIGNAL("attStateChanged"), self.attStateChanged) self.connect( self.attenuators, PYSIGNAL("attFactorChanged"), self.attFactorChanged, ) if self.attenuators.isReady(): self.connected() self.attFactorChanged(self.attenuators.getAttFactor()) self.attStateChanged(self.attenuators.getAttState()) else: self.disconnected() else: self.disconnected() elif property == "icons": icons_list = newValue.split() else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'mnemonic': if self.xfeSpectrum is not None: self.disconnect(self.xfeSpectrum, 'xfeSpectrumStarted', self.spectrumStarted) self.disconnect(self.xfeSpectrum, 'xfeSpectrumFinished', self.spectrumFinished) self.disconnect(self.xfeSpectrum, 'xfeSpectrumFailed', self.spectrumFailed) self.disconnect(self.xfeSpectrum, 'spectrumStatusChanged', self.spectrumStatusChanged) self.disconnect(self.xfeSpectrum, 'xfeSpectrumReady', self.spectrumReady) self.disconnect(self.xfeSpectrum, 'connected', self.connected) self.disconnect(self.xfeSpectrum, 'disconnected', self.disconnected) self.clearEnergies() self.xfeSpectrum = self.getHardwareObject(newValue) if self.xfeSpectrum is not None: self.connect(self.xfeSpectrum, 'xfeSpectrumStarted', self.spectrumStarted) self.connect(self.xfeSpectrum, 'xfeSpectrumFinished', self.spectrumFinished) self.connect(self.xfeSpectrum, 'xfeSpectrumFailed', self.spectrumFailed) self.connect(self.xfeSpectrum, 'spectrumStatusChanged', self.spectrumStatusChanged) self.connect(self.xfeSpectrum, 'xfeSpectrumReady', self.spectrumReady) self.connect(self.xfeSpectrum, 'connected', self.connected) self.connect(self.xfeSpectrum, 'disconnected', self.disconnected) if self.xfeSpectrum.isConnected(): self.connected() else: self.disconnected() else: self.disconnected() elif propertyName == 'icons': self.setIcons(newValue) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == "icons": icons_list = newValue.split() try: self.browseButton.setPixmap(Icons.load(icons_list[0])) except IndexError: pass try: self.reloadButton.setPixmap(Icons.load(icons_list[1])) except IndexError: pass elif propertyName == "dataCollect": if self.collectObj is not None: self.disconnect( self.collectObj, PYSIGNAL("progressUpdate"), self.imageCollected ) self.collectObj = self.getHardwareObject(newValue) if self.collectObj is not None: self.connect( self.collectObj, PYSIGNAL("progressUpdate"), self.imageCollected ) elif propertyName == "fileHistorySize": self.imageFilename.setMaxCount(newValue) elif propertyName == "showLegends": if not newValue: self.lineSelection._graph.setTitle = lambda t: mySetTitle( self.lineSelection._graph, t ) self.lineSelection._graph.enableAxis( self.lineSelection._graph.xTop, False ) self.lineSelection._graph.enableAxis( self.lineSelection._graph.xBottom, False ) elif propertyName == "graphFixedHeight": if newValue != -1: self.lineSelection._graph.setFixedHeight(newValue) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'icons': icons_list=newValue.split() elif propertyName == 'mnemonic': if self.sampleChanger is not None: self.disconnect(self.sampleChanger, PYSIGNAL("stateChanged"), self.sampleChangerStateChanged) self.sampleChanger=self.getHardwareObject(newValue) if self.sampleChanger is not None: self.connect(self.sampleChanger, PYSIGNAL("stateChanged"),self.sampleChangerStateChanged) self.connect(self.sampleChanger, PYSIGNAL("loadedSampleChanged"), self.loadedSampleChanged) self.connect(self.sampleChanger, PYSIGNAL("samplesMapChanged"), self.updateVials) self.connect(self.sampleChanger, PYSIGNAL("matrixCodesUpdate"), self.dataMatricesUpdated) self.connect(self.sampleChanger, PYSIGNAL("ioStatusChanged"), self.ioStatusChanged) else: self.sampleChangerStateChanged("UNKNOWN") else: BlissWidget.propertyChanged(self,propertyName,oldValue,newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'mnemonic': if self.beamstop_hwobj is not None: self.disconnect(self.beamstop_hwobj, qt.PYSIGNAL('deviceReady'), self.connected) self.disconnect(self.beamstop_hwobj, qt.PYSIGNAL('deviceNotReady'), self.disconnected) self.disconnect(self.beamstop_hwobj, qt.PYSIGNAL('beamstopDistanceChanged'), self.beamstop_distance_changed) self.beamstop_hwobj = self.getHardwareObject(newValue) if self.beamstop_hwobj is not None: self.connect(self.beamstop_hwobj, qt.PYSIGNAL('deviceReady'), self.connected) self.connect(self.beamstop_hwobj, qt.PYSIGNAL('deviceNotReady'), self.disconnected) self.connect(self.beamstop_hwobj, qt.PYSIGNAL('beamstopDistanceChanged'), self.beamstop_distance_changed) if self.beamstop_hwobj.isReady(): self.connected() self.beamstop_hwobj.update_values() else: self.disconnected() else: self.disconnected() else: BlissWidget.propertyChanged(self,property,oldValue,newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == "ldapServer": self.ldapConnection = self.getHardwareObject(newValue) elif propertyName == "codes": self.setCodes(newValue) elif propertyName == "localLogin": self.localLogin = self.getHardwareObject(newValue) elif propertyName == "dbConnection": self.dbConnection = self.getHardwareObject(newValue) logging.getLogger().info("dbconnection is %s", str(newValue)) self.updateLoginID() elif propertyName == "instanceServer": if self.instanceServer is not None: self.disconnect( self.instanceServer, PYSIGNAL("passControl"), self.passControl ) self.disconnect( self.instanceServer, PYSIGNAL("haveControl"), self.haveControl ) self.instanceServer = self.getHardwareObject(newValue) if self.instanceServer is not None: self.connect( self.instanceServer, PYSIGNAL("passControl"), self.passControl ) self.connect( self.instanceServer, PYSIGNAL("haveControl"), self.haveControl ) elif propertyName == "icons": icons_list = newValue.split() try: self.loginButton.setPixmap(Icons.load(icons_list[0])) except IndexError: pass try: self.logoutButton.setPixmap(Icons.load(icons_list[1])) except IndexError: pass elif propertyName == "session": self.session_hwobj = self.getHardwareObject(newValue) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, propertyName, oldValue, newValue): if propertyName == 'mnemonic': if self.specShell is not None: self.disconnect(self.specShell, 'connected', self.specConnected) self.disconnect(self.specShell, 'disconnected', self.specDisconnected) self.disconnect(self.specShell, 'busy', self.specBusy) self.disconnect(self.specShell, 'ready', self.specReady) self.disconnect(self.specShell, 'started', self.commandStarted) self.disconnect(self.specShell, 'finished', self.commandFinished) self.disconnect(self.specShell, 'aborted', self.commandAborted) self.disconnect(self.specShell, 'failed', self.commandFailed) self.specShell = self.getHardwareObject(newValue) if self.specShell is not None: self.connect(self.specShell, 'connected', self.specConnected) self.connect(self.specShell, 'disconnected', self.specDisconnected) self.connect(self.specShell, 'busy', self.specBusy) self.connect(self.specShell, 'ready', self.specReady) self.connect(self.specShell, 'started', self.commandStarted) self.connect(self.specShell, 'finished', self.commandFinished) self.connect(self.specShell, 'aborted', self.commandAborted) self.connect(self.specShell, 'failed', self.commandFailed) if self.specShell.isConnected(): self.specConnected() else: self.specDisconnected() else: self.specDisconnected() elif propertyName == 'icons': pass elif propertyName == 'alwaysReadonly': pass else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == "mnemonic": if self.cryodev is not None: self.disconnect(self.cryodev, PYSIGNAL("levelChanged"), self.setLevel) self.disconnect( self.cryodev, PYSIGNAL("temperatureChanged"), self.setTemperature ) # self.disconnect(self.cryodev, PYSIGNAL("cryoStatusChanged"), self.setIcing) # self.disconnect(self.cryodev, PYSIGNAL("dryStatusChanged"), self.setDrier) # self.disconnect(self.cryodev, PYSIGNAL("sdryStatusChanged"), self.setSDrier) self.cryodev = self.getHardwareObject(newValue) if self.cryodev is not None: self.containerBox.setEnabled(True) self.connect(self.cryodev, PYSIGNAL("levelChanged"), self.setLevel) self.connect( self.cryodev, PYSIGNAL("temperatureChanged"), self.setTemperature ) # self.connect(self.cryodev, PYSIGNAL("cryoStatusChanged"), self.setIcing) # self.connect(self.cryodev, PYSIGNAL("dryStatusChanged"), self.setDrier) # self.connect(self.cryodev, PYSIGNAL("sdryStatusChanged"), self.setSDrier) self.setLevel(self.cryodev.n2level) self.setTemperature(self.cryodev.temp) # self.setIcing(self.cryodev.cryo_status) # self.setDrier(self.cryodev.dry_status) # self.setSDrier(self.cryodev.sdry_status) else: self.containerBox.setEnabled(False) self.setTemperature(None) # self.setDrier("UNKNOWN") # self.setSDrier("UNKNOWN") # self.setIcing("UNKNOWN") self.setLevel(None) else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == "mnemonic": if self.dataCollect is not None: # self.disconnect(self.dataCollect,'collectStarted', self.collectStarted) self.disconnect(self.dataCollect, "collectNumberOfFrames", self.collectSpecStarted) # self.disconnect(self.dataCollect,'collectEnded', self.collectEnded) # self.disconnect(self.dataCollect,'collectFailed', self.collectFailed) # self.disconnect(self.dataCollect,'collectStartCentring', self.collectStartCentring) # self.disconnect(self.dataCollect,'collectCentringFinished', self.collectCentringFinished) self.disconnect(self.dataCollect, "collectValidateCentring", self.collectValidateCentring) self.disconnect(self.dataCollect, "collectRejectCentring", self.collectRejectCentring) # self.disconnect(self.dataCollect,'collectCentringFinished', self.collectCentringFinished) self.disconnect(self.dataCollect, "collectMountingSample", self.collectMountingSample) # self.disconnect(self.dataCollect,'collectUnmountingSample', self.collectUnmountingSample) self.disconnect(self.dataCollect, "collectOscillationStarted", self.collectOscillationStarted) self.disconnect(self.dataCollect, "collectOscillationFailed", self.collectOscillationFailed) self.disconnect(self.dataCollect, "collectOscillationFinished", self.collectOscillationFinished) self.dataCollect = self.getHardwareObject(newValue) if self.dataCollect is not None: # self.connect(self.dataCollect,'collectStarted', self.collectStarted) self.connect(self.dataCollect, "collectNumberOfFrames", self.collectSpecStarted) # self.connect(self.dataCollect,'collectEnded', self.collectEnded) # self.connect(self.dataCollect,'collectFailed', self.collectFailed) # self.connect(self.dataCollect,'collectStartCentring', self.collectStartCentring) # self.connect(self.dataCollect,'collectCentringFinished', self.collectCentringFinished) self.connect(self.dataCollect, "collectValidateCentring", self.collectValidateCentring) self.connect(self.dataCollect, "collectRejectCentring", self.collectRejectCentring) self.connect(self.dataCollect, "collectMountingSample", self.collectMountingSample) # self.connect(self.dataCollect,'collectUnmountingSample', self.collectUnmountingSample) self.connect(self.dataCollect, "collectOscillationStarted", self.collectOscillationStarted) self.connect(self.dataCollect, "collectOscillationFailed", self.collectOscillationFailed) self.connect(self.dataCollect, "collectOscillationFinished", self.collectOscillationFinished) else: BlissWidget.propertyChanged(self, property, oldValue, newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'specVersion': if self.scanObject is not None: self.safeDisconnect() self.scanObject = QSpecScan(newValue) if self.scanObject is not None: self.safeConnect() elif property == 'backgroundColor': if newValue == 'white': self.setPaletteBackgroundColor(Qt.white) elif newValue == 'default': self.setPaletteBackgroundColor(QWidget.paletteBackgroundColor(self)) elif property == 'graphColor': if newValue == 'white': self.graph.canvas().setPaletteBackgroundColor(Qt.white) elif newValue == 'default': self.graph.canvas().setPaletteBackgroundColor(QWidget.paletteBackgroundColor(self)) else: BlissWidget.propertyChanged(self,property,oldValue,newValue)
def propertyChanged(self, property, oldValue, newValue): if property == 'resolution': if self.resolutionMotor is not None: self.disconnect(self.resolutionMotor,PYSIGNAL('deviceReady'),self.resolutionReady) self.disconnect(self.resolutionMotor,PYSIGNAL('deviceNotReady'),self.resolutionNotReady) self.disconnect(self.resolutionMotor,PYSIGNAL('stateChanged'),self.resolutionStateChanged) self.disconnect(self.resolutionMotor,PYSIGNAL('positionChanged'),self.resolutionChanged) if self.detectorMotor is not None: self.disconnect(self.detectorMotor,PYSIGNAL('deviceReady'),self.resolutionReady) self.disconnect(self.detectorMotor,PYSIGNAL('deviceNotReady'),self.resolutionNotReady) self.disconnect(self.detectorMotor,PYSIGNAL('stateChanged'),self.detectorStateChanged) self.disconnect(self.detectorMotor,PYSIGNAL('positionChanged'),self.detectorChanged) self.disconnect(self.detectorMotor,PYSIGNAL('limitsChanged'),self.detectorLimitsChanged) if self.energyHObj is not None: self.disconnect(self.energyHObj,PYSIGNAL('moveEnergyFinished'),self.energyChanged) self.units.clear() self.angHistory=[] self.mmHistory=[] available_units=[] self.resolutionMotor=self.getHardwareObject(newValue) self.detectorMotor = None self.energyHObj = None if self.resolutionMotor is not None: self.detectorMotor=self.resolutionMotor.dtox self.energyHObj = self.resolutionMotor.energy self.units.insertItem(chr(197)) available_units.append('Ang') if self.detectorMotor is not None: self.units.insertItem('mm') available_units.append('mm') try: self.connect(self.resolutionMotor,PYSIGNAL('deviceReady'),self.resolutionReady) self.connect(self.resolutionMotor,PYSIGNAL('deviceNotReady'),self.resolutionNotReady) self.connect(self.resolutionMotor,PYSIGNAL('stateChanged'),self.resolutionStateChanged) self.connect(self.resolutionMotor,PYSIGNAL('positionChanged'),self.resolutionChanged) except: logging.getLogger().exception('ResolutionBrick: problem connecting to the resolution motor') try: self.connect(self.detectorMotor,PYSIGNAL('deviceReady'),self.resolutionReady) self.connect(self.detectorMotor,PYSIGNAL('deviceNotReady'),self.resolutionNotReady) self.connect(self.detectorMotor,PYSIGNAL('stateChanged'),self.detectorStateChanged) self.connect(self.detectorMotor,PYSIGNAL('positionChanged'),self.detectorChanged) self.connect(self.detectorMotor,PYSIGNAL('limitsChanged'),self.detectorLimitsChanged) except: logging.getLogger().exception('ResolutionBrick: problem connecting to the detector distance motor') try: self.connect(self.energyHObj,PYSIGNAL('moveEnergyFinished'),self.energyChanged) except: logging.getLogger().exception('ResolutionBrick: problem connecting to the energy motor') if self.resolutionMotor.isReady(): self.resolutionReady() else: self.resolutionNotReady() else: if self.detectorMotor is not None: self.units.insertItem('mm') available_units.append('mm') self.updateGUI() try: i=available_units.index(self['defaultMode']) except ValueError: #curr=str(self.units.currentText()) curr=self.units.currentText() if curr!="": self.unitChanged(curr) else: def_mode=self['defaultMode'] if def_mode=='Ang': def_mode=chr(197) self.units.setCurrentText(def_mode) self.unitChanged(def_mode) elif property == 'icons': icons_list=newValue.split() try: self.stopButton.setPixmap(Icons.load(icons_list[1])) except IndexError: pass else: BlissWidget.propertyChanged(self,property,oldValue,newValue)
def propertyChanged(self, propertyName, oldValue, newValue): #print "HutchMenuBrick.propertyChanged",property,newValue if propertyName == 'minidiff': if self.minidiff is not None: self.disconnect( self.minidiff, PYSIGNAL('zoomMotorPredefinedPositionChanged'), self.zoomPositionChanged) self.disconnect( self.minidiff, PYSIGNAL('minidiffReady'), self.miniDiffReady) self.disconnect( self.minidiff, PYSIGNAL('minidiffNotReady'), self.miniDiffNotReady) self.disconnect( self.minidiff, PYSIGNAL('minidiffStateChanged'), self.miniDiffStateChanged) self.disconnect( self.minidiff, PYSIGNAL('centringStarted'), self.centringStarted) self.disconnect( self.minidiff, PYSIGNAL('centringSuccessful'), self.centringSuccessful) self.disconnect( self.minidiff, PYSIGNAL('centringFailed'), self.centringFailed) self.disconnect( self.minidiff, PYSIGNAL('centringMoving'), self.centringMoving) self.disconnect( self.minidiff, PYSIGNAL('centringInvalid'), self.centringInvalid) self.disconnect( self.minidiff, PYSIGNAL('centringSnapshots'), self.centringSnapshots) self.disconnect( self.minidiff, PYSIGNAL('progressMessage'), self.miniDiffMessage) self.disconnect( self.minidiff, PYSIGNAL('newAutomaticCentringPoint'), self.drawAutoCentringPoint) self.disconnect( self.minidiff, PYSIGNAL('zoomMotorPredefinedPositionChanged'), self.zoomPositionChanged) self.disconnect( self.minidiff, PYSIGNAL('centringAccepted'), self.centringAccepted) self.minidiff = self.getHardwareObject(newValue) if self.minidiff is not None: self.connect( self.minidiff, PYSIGNAL('zoomMotorPredefinedPositionChanged'), self.zoomPositionChanged) self.connect( self.minidiff, PYSIGNAL('minidiffReady'), self.miniDiffReady) self.connect( self.minidiff, PYSIGNAL('minidiffNotReady'), self.miniDiffNotReady) self.connect( self.minidiff, PYSIGNAL('minidiffStateChanged'), self.miniDiffStateChanged) self.connect( self.minidiff, PYSIGNAL('centringStarted'), self.centringStarted) self.connect( self.minidiff, PYSIGNAL('centringSuccessful'), self.centringSuccessful) self.connect( self.minidiff, PYSIGNAL('centringFailed'), self.centringFailed) self.connect( self.minidiff, PYSIGNAL('centringMoving'), self.centringMoving) self.connect( self.minidiff, PYSIGNAL('centringInvalid'), self.centringInvalid) self.connect( self.minidiff, PYSIGNAL('centringSnapshots'), self.centringSnapshots) self.connect( self.minidiff, PYSIGNAL('progressMessage'), self.miniDiffMessage) self.connect( self.minidiff, "newAutomaticCentringPoint", self.drawAutoCentringPoint) self.connect( self.minidiff, PYSIGNAL('zoomMotorPredefinedPositionChanged'), self.zoomPositionChanged) self.connect( self.minidiff, PYSIGNAL('centringAccepted'), self.centringAccepted) if self.minidiff.isReady(): self.miniDiffReady() else: self.miniDiffNotReady() else: self.miniDiffNotReady() # elif propertyName=='slitbox': # if self.slitbox is not None: # for role in ('s1v', 's2v', 's1h', 's2h'): # m = self.slitbox.getDeviceByRole(role) # m.disconnect('stateChanged', self.slitsPositionChanged) # self.slitbox=self.getHardwareObject(newValue) # if self.slitbox is not None: # for role in ('s1v', 's2v', 's1h', 's2h'): # m = self.slitbox.getDeviceByRole(role) # m.connect("stateChanged", self.slitsPositionChanged) # #self.slitsPositionChanged() elif propertyName == "beamInfo": if self.beamInfo is not None: self.disconnect( self.beamInfo, PYSIGNAL('beamInfoChanged'), self.beamInfoChanged) self.disconnect( self.beamInfo, PYSIGNAL('beamPosChanged'), self.beamPosChanged) self.beamInfo = self.getHardwareObject(newValue) if self.beamInfo is not None: self.connect( self.beamInfo, PYSIGNAL('beamInfoChanged'), self.beamInfoChanged) self.connect( self.beamInfo, PYSIGNAL('beamPosChanged'), self.beamPosChanged) elif propertyName == "samplechanger": self.sampleChanger = self.getHardwareObject(newValue) elif propertyName == "dataCollect": self.collectObj = self.getHardwareObject(newValue) elif propertyName == 'icons': self.setIcons(newValue) elif propertyName == 'label': pass # self.sampleCentreBox.setTitle(newValue) elif propertyName == 'extraCommands': self.extraCommands['mnemonic'] = newValue elif propertyName == 'extraCommandsIcons': self.extraCommands['icons'] = newValue elif propertyName == 'queue': self.queue_hwobj = self.getHardwareObject(newValue) else: BlissWidget.propertyChanged(self, propertyName, oldValue, newValue)