def test_summary(self): result = {} result["result_bit"] = True result["result_details"] = [] table_cells = [] for tine_prop in self['tine_props']: prop_names = eval(tine_prop.getProperty("prop_names")) if isinstance(prop_names, str): cell_str_list = [] cell_str_list.append(tine_prop.getProperty("prop_device")) cell_str_list.append(prop_names) cell_str_list.append(str(tine.get(tine_prop.getProperty("prop_device"), prop_names))) table_cells.append(cell_str_list) else: for index, property_name in enumerate(prop_names): cell_str_list = [] if index == 0: cell_str_list.append(tine_prop.getProperty("prop_device")) else: cell_str_list.append("") cell_str_list.append(property_name) cell_str_list.append(str(tine.get(tine_prop.getProperty("prop_device"), property_name))) table_cells.append(cell_str_list) result["result_details"] = SimpleHTML.create_table(\ ["Context/Server/Device", "Property", "Value"], table_cells) self.ready_event.set() return result
def test_summary(self): """ Descript. : """ result = {} result["result_bit"] = True result["result_details"] = [] table_cells = [] for tine_prop in self['tine_props']: prop_names = eval(tine_prop.getProperty("prop_names")) if isinstance(prop_names, str): cell_str_list = [] cell_str_list.append(tine_prop.getProperty("prop_device")) cell_str_list.append(prop_names) cell_str_list.append(str(tine.get(tine_prop.getProperty("prop_device"), prop_names))) table_cells.append(cell_str_list) else: for index, property_name in enumerate(prop_names): cell_str_list = [] if index == 0: cell_str_list.append(tine_prop.getProperty("prop_device")) else: cell_str_list.append("") cell_str_list.append(property_name) cell_str_list.append(str(tine.get(tine_prop.getProperty("prop_device"), property_name))) table_cells.append(cell_str_list) result["result_details"] = SimpleHTML.create_table(\ ["Context/Server/Device", "Property", "Value"], table_cells) self.ready_event.set() return result
def get(self): result = None try: result = tine.get(self.tineName, self.commandName, self.timeout) except IOError as strerror: logging.getLogger("HWR").error("%s" % strerror) except BaseException: pass return result
def get(self): """Returns result of cmd execution Returns: [type]: [description] """ result = None try: result = tine.get(self.tine_name, self.command_name, self.timeout) except IOError as strerror: logging.getLogger("HWR").error("%s" % strerror) except Exception: pass return result
def getValue(self, force=False): # logging.getLogger("HWR").debug('TINE channel %s, %s get at val=%s'%(self.tineName,self.attributeName,self.value)) # if self.tineName == "/P14/BCUIntensity/Device0": # print self.attributeName, self.value if self.value is None or force: try: # TODO remove this if not force: time.sleep(0.02) self.value = tine.get(self.tineName, self.attributeName, self.timeout) except IOError as strerror: logging.getLogger("HWR").error("%s" % strerror) return self.value
def getValue(self, force=False): #logging.getLogger("HWR").debug('TINE channel %s, %s get at val=%s'%(self.tineName,self.attributeName,self.value)) #if self.tineName == "/P14/BCUIntensity/Device0": # print self.attributeName, self.value if self.value is None or force: try: #TODO remove this if not force: time.sleep(0.02) self.value = tine.get(self.tineName, self.attributeName, self.timeout) except IOError as strerror: logging.getLogger("HWR").error("%s" % strerror) return self.value
def _synchronous_get(self): try: value = tine.get(self.tine_name, self.attribute_name, self.timeout) return value except IOError as strerror: logging.getLogger("HWR").error("%s" % strerror)
tine.set("/p14/collection/mx-standard", "exposure-time", 0.01) tine.set("/P14/pco-camera/pco-camera", "write-data", True) #for y in [ -5.25, -5.0, -4.75, -4.5, -4.25, -4.0, -3.75 ]: # ^ this is full range of motor position in vertical direction for y in [-4.0, -3.75]: tine.set("P14/MD3/MD3_0", "AlignmentYPosition", y) wait_md_ready() for z in (-2.194, -1.944, -1.694, -1.444, -1.194, -0.944, -0.694, -0.444, -0.194, 0.056, 0.306, 0.556, 0.806, 1.056, 1.306, 1.556, 1.806): # motor positions in hor directions time.sleep(0.1) tine.set("P14/MD3/MD3_0", "AlignmentZPosition", z) wait_md_ready() print "got y ", tine.get("P14/MD3/MD3_0", "AlignmentZPosition") n = n + 1 COLERROR = True while COLERROR == True: tine.set("/p14/collection/mx-standard", "ff-num-images", 30) tine.set("/p14/collection/mx-standard", "num-images", 3600) tine.set("/p14/collection/mx-standard", "ff-offset", [0, -5.95 - y, 0]) # this line below corresponds to the filename tine.set("/p14/collection/mx-standard", "template", "try0_full_135mm_%s_" % n + '%5d.tiff') tine.set("/p14/collection/mx-standard", "collect") time.sleep(1) wait_col_ready() print y, tine.get("P14/MD3/MD3_0",