def __init__(self, hutch, *aliases): Dcfg.__init__(self, hutch, *aliases, typeid=0x10065) for i in range(4): ch = Channel(self, i) istring = "ch{}".format(i) self._add_subcfg(ch, istring) setattr(self, istring, ch)
def __init__(self, hutch, *aliases): """ Programatically sets up get_name and set_name methods during init. """ Dcfg.__init__(self, hutch, *aliases, typeid=0x10004) self._add_methods("sample_num", "horiz", "nbrSamples") self._add_methods("sample_interval", "horiz", "sampInterval") self._add_methods("delay_time", "horiz", "delayTime") self._add_methods("channel_num", "nbrChannels") self._add_methods("channel_mask", "channelMask") self._add_methods("conv_per_ch", "nbrConvertersPerChannel") self.trig = SubcfgDict(self, "trig") self.trig._add_methods("coupling", "coupling") self.trig._add_methods("input", "input") self.trig._add_methods("level", "level") self.trig._add_methods("slope", "slope") self._add_subcfg(self.trig, "trig") self.vert = SubcfgList(self, "vert") self.vert._add_methods("bandwidth", "bandwidth") self.vert._add_methods("coupling", "coupling") self.vert._add_methods("full_scale", "fullScale") self.vert._add_methods("offset", "offset") self.vert._add_methods("slope", "slope") self._add_subcfg(self.vert, "vert")
def __init__(self, hutch, *aliases): """ Hutch is a string representing the 3-letter hutch abbreviation associated with this daq evr. Aliases are strings and are all of the profiles to view and change. These profiles will be synced. """ Dcfg.__init__(self, hutch, *aliases, typeid=0x0008) self.pulses = SubcfgList(self, "pulses") self.pulses._add_methods("polarity", "polarity") self.pulses._add_methods("delay", "delay") self.pulses._add_methods("width", "width") self._add_subcfg(self.pulses, "Pulses") self.eventcodes = SubcfgList(self, "eventcodes") self.eventcodes._add_methods("code", "code") self.eventcodes._add_methods("type", "type") self.eventcodes._add_methods("desc", "desc") self._add_subcfg(self.eventcodes, "Event Codes") outputs = self.cfg_dict_get()["outputs"] modules = {d["module"] for d in outputs} for evr_num in modules: setattr(self, "evr{}".format(evr_num), Output(self, evr_num))
def commit(self): """ Commits all changes to the database using the current stored config dictionary. Does a sanity check before the commit. """ if self._sanity_check(): Dcfg.commit(self)
def _load(self): """ Overrides the standard load function to "poke" the dictionary... I do this because of the weird error mentioned in __init__. """ Dcfg._load(self) try: for key in self._dcurr: pass except: pass
def __init__(self, hutch, *aliases, **src_arg): """ Programatically sets up get_name and set_name methods during init. """ src = src_arg.get("src", None) Dcfg.__init__(self, hutch, *aliases, typeid=0x20056, src=src) self.beam_logic = SubcfgList(self, "beam_logic") self.beam_logic._add_methods("event_code", "event_code") self.beam_logic._add_methods("logic_op", "logic_op") self.beam_logic._add_enum("logic_op", "EventLogic") self._add_subcfg(self.beam_logic, "beam_logic") self.laser_logic = SubcfgList(self, "laser_logic") self.laser_logic._add_methods("event_code", "event_code") self.laser_logic._add_methods("logic_op", "logic_op") self.laser_logic._add_enum("logic_op", "EventLogic") self._add_subcfg(self.laser_logic, "laser_logic") for pre in ["ref", "sb", "sig"]: if pre != "sig": conv = "{}_convergence".format(pre) self._add_methods(conv, conv) for suf in ["hi", "lo"]: roi = "{0}_roi_{1}".format(pre, suf) setattr(self, roi, SubcfgDict(self, roi)) getattr(self, roi)._add_methods("column", "column") getattr(self, roi)._add_methods("row", "row") self._add_subcfg(getattr(self, roi), roi) self._add_methods("reference_projection_size", "reference_projection_size") self._add_methods("sideband_projection_size", "sideband_projection_size") self._add_methods("signal_projection_size", "signal_projection_size") self._add_methods("signal_cut", "signal_cut") self._add_methods("project_axis", "project_axis") self._add_enum("project_axis", "Axis") self._add_methods("calib_poly", "calib_poly") # self._add_methods("weights", "weights") self._add_methods("subtract_sideband", "subtract_sideband") self._add_options("subtract_sideband", "No", "Yes") self._add_methods("use_reference_roi", "use_reference_roi") self._add_options("use_reference_roi", "No", "Yes") self._add_methods("write_image", "write_image") self._add_options("write_image", "No", "Yes") self._add_methods("write_projections", "write_projections") self._add_options("write_projections", "No", "Yes")
def __init__(self, hutch, *aliases): Dcfg.__init__(self, hutch, *aliases, typeid=0x20049) #self.daq = daq # Pass in the main daq instance (at most 1 can be active) #self._rayonixID = rayonixID self._add_methods("readout_mode", "readoutMode") self._add_options("readout_mode", "Standard", "High gain", "High noise", "HDR") self._add_methods("_binning_f", "binning_f") self._add_methods("_binning_s", "binning_s") self._register("binning", "binning_f") self._add_methods("trigger_mode", "trigger") self._add_options("trigger_mode", "Frame transfer", "Bulb mode") self._add_methods("pedestal_mode", "darkFlag") self._add_options("pedestal_mode", "Keep Current Background", "Update background on config")
def __init__(self, daq, cspadID, hutch, src, *aliases): Dcfg.__init__(self, hutch, *aliases, typeid=0x2002b, src=src) self.daq = daq self._id = cspadID self._run = None self._add_methods("inactive_run_mode", "inactiveRunMode") self._add_options("inactive_run_mode", "No running", "Run but drop", "Run and send to server", "Run and send triggered by TTL", "External trigger send to server", "External trigger drop.") self._add_methods("active_run_mode", "activeRunMode") self._add_options("active_run_mode", "No running", "Run but drop", "Run and send to server", "Run and send triggered by TTL", "External trigger send to server", "External trigger drop.") self._add_methods("run_trig_delay", "runTriggerDelay") self._add_methods("test_data_index", "tdi") self._add_methods("acd_threshold", "protectionSystem", "adcThreshold") self._add_methods("pixel_count_threshold", "protectionSystem", "pixelCountThreshold") self._add_methods("bad_asic_mask", "badAsicMask") self._add_methods("sector_mask", "roiMask")