def add_lumencor(self, settings): self.constructed_object.fields[ settings[1]] = Controllers.LumencorController(settings[3])
weird way of loading a 8 bit dac. :param value: :return: """ bit_0 = bytes([value & int('00001111', 2) << 4]) bit_1 = bytes([int('11110000', 2) | (value >> 4)]) return bit_0, bit_1 class FilterWheelFactory(UtilityFactory): """ Determines the type of xy utility object to return according to the daqcontroller id""" def build_object(self, controller, role, *args): if controller.id == 'micromanager': return MicroManagerFilterWheel(controller, role) elif controller.id == 'pycromanager': return PycromanagerFilter(controller, role) elif controller.id == 'prior': return PriorFilter(controller, role) elif controller.id == 'lumencor' or controller.id == 'simulator': return LumencorFilter(controller, role) else: return None if __name__ == "__main__": from L1 import Controllers ctl = Controllers.LumencorController(port="COM7") ctl.open() fw = LumencorFilter(ctl, 'lol')