Esempio n. 1
0
File: ops.py Progetto: TESSUser/FPE
 def dacreset(self):
     """Reset the DACs to the power-up state."""
     return self._fpe.upload_operating_parameter_memory(binary_files.write_clvmem(128 * [0xFFFF]))
Esempio n. 2
0
File: ops.py Progetto: TESSUser/FPE
            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))
Esempio n. 3
0
File: ops.py Progetto: TESSUser/FPE
 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)))
Esempio n. 4
0
 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)
Esempio n. 5
0
 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)
Esempio n. 6
0
        # 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))
Esempio n. 7
0
 def dacreset(self):
     """Reset the DACs to the power-up state."""
     return self._fpe.upload_operating_parameter_memory(
         binary_files.write_clvmem(128 * [0xffff]))
Esempio n. 8
0
 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)))