def dacreset(self): """Reset the DACs to the power-up state.""" return self._fpe.upload_operating_parameter_memory(binary_files.write_clvmem(128 * [0xFFFF]))
self.__dict__[name].value = value elif "_derived_keys" in self.__dict__ and name in self._derived_operating_parameters: self.__dict__[name].value = value else: super(OperatingParameters, self).__setattr__(name, value) @property def values(self): """The 12-bit unsigned values of the operating parameters""" return [0 if x is None else x.twelve_bit_value for x in self.address] def send(self): """Send the current DAC values to the hardware.""" return self._fpe.upload_operating_parameter_memory(binary_files.write_clvmem(values_to_5328(self.values))) def upload_operating_parameter_memory(self): """Synonym for send""" return self.send() def dacreset(self): """Reset the DACs to the power-up state.""" return self._fpe.upload_operating_parameter_memory(binary_files.write_clvmem(128 * [0xFFFF])) if __name__ == "__main__": import doctest from binary_files import write_clvmem doctest.testmod() print write_clvmem(values_to_5328(OperatingParameters().values))
def send(self): """Send the current DAC values to the hardware.""" return self._fpe.upload_operating_parameter_memory(binary_files.write_clvmem(values_to_5328(self.values)))
def write_clvmem(self, file_name=None): """Write the clock level voltage memory; contains values for programming FPE clock level voltages (also known as *operating parameters*) via DACs.""" return binary_files.write_clvmem(values_to_5328(self.raw_values), file_name)
# Get the frames status, restore it after we are done uploading the operating parameters frames_status = self._fpe.frames_running_status self._fpe.cam_stop_frames() try: return self._fpe.upload_operating_parameter_memory( self.write_clvmem()) finally: new_parameters = OperatingParameters(self._fpe) if self != new_parameters: self._fpe.frames_running_status = frames_status raise Exception("Could not set operating parameters") else: self.set_values_from_fpe() self._fpe.frames_running_status = frames_status def reset_to_defaults(self): """Reset the operating parameters to the defaults""" for a in self.address: if a is None: continue a.value = a.default return self.send() if __name__ == "__main__": import doctest from binary_files import write_clvmem doctest.testmod() print write_clvmem(values_to_5328(OperatingParameters().raw_values))
def dacreset(self): """Reset the DACs to the power-up state.""" return self._fpe.upload_operating_parameter_memory( binary_files.write_clvmem(128 * [0xffff]))
def send(self): """Send the current DAC values to the hardware.""" return self._fpe.upload_operating_parameter_memory( binary_files.write_clvmem(values_to_5328(self.values)))