def getProjectId(self, sessiondata): try: projectdata = project.ProjectData() except project.NotConnectedError, e: self.logger.warning( 'Failed to associate the grid to a project: %s' % e) return None
def __init__(self, id, session, managerlocation, **kwargs): self.grids = Grids(self) self.insertion = None node.Node.__init__(self, id, session, managerlocation, **kwargs) targethandler.TargetWaitHandler.__init__(self) self.instrument = instrument.Proxy(self.objectservice, self.session) self.presetsclient = presets.PresetsClient(self) self.abortevent = threading.Event() calibrationclients = { 'image shift': calibrationclient.ImageShiftCalibrationClient, 'stage position': calibrationclient.StageCalibrationClient, 'modeled stage position': calibrationclient.ModeledStageCalibrationClient, 'image beam shift': calibrationclient.ImageBeamShiftCalibrationClient, } self.calibrationclients = {} for i, clientclass in calibrationclients.items(): self.calibrationclients[i] = clientclass(self) self.projectdata = None try: self.projectdata = project.ProjectData() except Exception, e: self.logger.warning( 'Failed to connect to the project database: %s' % e)
def getGridLocations(self, traylabel): try: gridboxid = self.gridtrayids[traylabel] except KeyError: raise ValueError('unknown tray label') try: projectdata = project.ProjectData() except project.NotConnectedError, e: self.logger.error('Failed to get grid locations: %s' % e) return None
def traysFromDB(self): # if label is same, kinda screwed self.gridtrayids = {} self.gridtraylabels = {} try: projectdata = project.ProjectData() gridboxes = projectdata.getGridBoxes() for i in gridboxes.getall(): self.gridtrayids[i['label']] = i['gridboxId'] self.gridtraylabels[i['gridboxId']] = i['label'] except Exception, e: self.logger.error('Failed to connect to the project database: %s' % e)
def __init__(self, id, session, managerlocation, **kwargs): self.loopstop = threading.Event() self.loopstop.set() node.Node.__init__(self, id, session, managerlocation, **kwargs) self.addEventInput(event.MakeTargetListEvent, self.setGrid) self.lowdosemode = None self.defocus = None try: self.projectdata = project.ProjectData() except: self.projectdata = None self.gridmapping = {} self.gridbox = None self.grid = None self.gridlabel = None self.insertion = None self.emgrid = None self.instrument = instrument.Proxy(self.objectservice, self.session, self.panel) self.dosecal = calibrationclient.DoseCalibrationClient(self) self.manualchecklock = threading.Lock() self.maskradius = 1.0 self.focexptime = 100.0 self.man_power = None self.man_image = None self.powmin = 0 self.powmax = 1e10 self.manualplayer = player.Player(callback=self.onManualPlayer) self.comment = '' self.published_images = [] self.viewstatus = None self.start()
def getGridLabels(self, gridlist): try: projectdata = project.ProjectData() except project.NotConnectedError, e: self.logger.error('Failed to get grid labels: %s' % e) return None
def publishEMGridData(self,gridid): try: projectdata = project.ProjectData() except project.NotConnectedError, e: self.logger.error('Failed to get grid labels: %s' % e) return None
def getGridID(self, gridboxid, gridnumber): try: projectdata = project.ProjectData() except project.NotConnectedError, e: self.logger.error('Failed to find grid information: %s' % e) return None