Exemple #1
0
 def open_unit(self, serial=None, resolution=None):
     """optional arguments:
     serial: If no serial number is provided, this function opens the first device discovered.
     resolution: for some devices, you may specify a resolution as you open the device. You should retrieve this
         numeric constant from the relevant driver module.
     returns: a Device instance, which has functions on it for collecting data and using the waveform generator (if
         present).
     Note: Either use this object in a context manager, or manually call .close() on it when you are finished."""
     return Device(self, self._python_open_unit(serial=serial, resolution=resolution))
    def test_invalid_config(self):
        request = TimebaseOptions(max_time_interval=0.005,
                                  no_of_samples=None,
                                  min_collection_time=1.)
        actual_timebase = 0.004
        required_max_samples = int(
            math.ceil(request.min_collection_time / actual_timebase))
        response = TimebaseInfo(timebase_id=7,
                                time_interval=0.004,
                                time_units=None,
                                max_samples=required_max_samples - 5,
                                segment_id=0)

        self.assertFalse(Device._validate_timebase(request, response))