def set(self,value): class_name = getattr(self,"name",self.__class__.__name__) if not "{name}" in name: if class_name: dbname = class_name+"."+name else: dbname = name else: dbname = name.replace("{name}",class_name) ##debug("persistent_property.set: %s: %r, %r: %r" % (name,self,class_name,dbname)) from DB import dbput dbput(dbname,repr(value))
def set_prefix(self, value): ##debug("EPICS_motor.prefix = %r" % value) from DB import dbput dbname = getattr(self, "__db_name__", "") if dbname: ##debug("EPICS_motor/"+dbname+".prefix: "+repr(value)) dbput("EPICS_motor/" + dbname + ".prefix", repr(value)) else: ##debug("EPCIS_motor.__my_prefix__ = %r" % value) self.__my_prefix__ = value
def save_settings(self): nrows = self.Descriptions.shape[0] for i in range(0, nrows): text = self.Descriptions[i].Value dbput("%s.line%d.description" % (self.name, i), text) text = self.Dates[i].Value dbput("%s.line%d.updated" % (self.name, i), text) for j in range(0, len(self.motors)): value = self.Positions[i, j].Value resname = "%s.line%d.%s" % (self.name, i, self.motor_names[j]) dbput(resname, value)
def set_auto_reverse(self, value): dbput("sample_translation/auto_reverse", repr(int(value)))
def set_steps(self, value): from numpy import rint value = int(rint(value)) dbput("sample_translation/steps", repr(value))
def set_rotation_center_y(self, value): x, y = self.rotation_center_x, self.rotation_center_y y = value dbput("sample.rotation_center", repr((x, y)))
def set_calibration_z(self, value): dbput("sample.calibration_z", repr(float(value)))
def set_calibrated_end_position_2(self, value): dbput("sample_translation/calibrated_end_position_2", repr(value))
def set_xy_rotating(self, value): dbput("sample.xy_rotating", repr(value))
def set_move_when_idle(self, value): dbput("sample_translation/move_when_idle", repr(int(value)))
def set_calibrated_start_position_1(self, value): dbput("sample_translation/calibrated_start_position_1", repr(value))
def set_current_configuration(self,value): from DB import dbput dbput("diffractometer.current_configuration",value)
def save_configuration(name): """name: 'NIH Diffractometer' or 'BioCARS Diffractometer'""" from DB import dbput for par in configuration_parameters: dbput("diffractometer/"+name+"."+par,repr(getattr(diffractometer,par)))
def set_serial_port_name(self, value): from DB import dbput dbput(self.name + ".serial_port", value)
def set_repeats(self, value): dbput("sample_translation.repeats", repr(value))
def set_normal_start_position(self, value): dbput("sample_translation.start_position", repr(value))
def OnTextCtrl(self, event): """TextCtrl was modified...""" debug("TextCtrl: '%s'" % self.TextCtrl.Value) from DB import dbput dbput("EditableControls_Test.TextCtrl", self.TextCtrl.Value)
def OnComboBox(self, event): """ComboxBox was meodified...""" debug("ComboBox: '%s'" % self.ComboBox.Value) from DB import dbput dbput("EditableControls_Test.ComboBox", self.ComboBox.Value)
def set_temperature_correction(self, value): dbput("sample_translation/temperature_correction", repr(int(value)))
def set_ip_address(self, value): dbput("sample_translation/ip_address", value)
def set_calibration_temperature_2(self, value): dbput("sample_translation/calibration_temperature_2", repr(value))
def set_home_position(self, value): dbput("sample_translation/home", repr(value))
def set_voltage(self, value): from DB import dbput dbput("Ensemble.illuminator.voltage", str(value))
def set_park_position(self, value): dbput("sample_translation/park", repr(value))
def set_phi_scale(self, value): dbput("sample.phi_scale", repr(float(value)))
def set_normal_end_position(self, value): dbput("sample_translation/end_position", repr(value))
def set_click_center_z(self, value): dbput("sample.click_center_z", repr(float(value)))
def set_acceleration(self, value): dbput("sample_translation/acceleration", repr(value))
def set_phi_motor_name(self, name): dbput("sample.phi_motor_name", repr(name))
def set_port(self, value): dbput("sample_translation/port", repr(value))