def stop_transmission(self):
     # Stop transmission
     ret = llt.transfer_profiles(self.hLLT,
                                 llt.TTransferProfileType.NORMAL_TRANSFER,
                                 0)
     if ret < 1:
         raise ValueError("Error stopping transfer profiles: " + str(ret))
    raise ValueError("Error idle time: " + str(ret))

# Set rearrangement (z only)
rec_log2 = 1.0 / m.log(2.0)
container_resolution = m.floor((m.log(resolution) * rec_log2) + 0.5)
ret = llt.set_feature(hLLT, llt.FEATURE_FUNCTION_REARRANGEMENT_PROFILE, llt.CONTAINER_DATA_Z | llt.CONTAINER_STRIPE_1 | (container_resolution << 12))
if ret < 1:
    raise ValueError("Error setting rearrangement: " + str(ret))

# Set container size
ret = llt.set_profile_container_size(hLLT, resolution, container_size)
if ret < 1:
    raise ValueError("Error setting profile container size: " + str(ret))

# Start transfer
ret = llt.transfer_profiles(hLLT, llt.TTransferProfileType.NORMAL_CONTAINER_MODE, 1)
if ret < 1:
    raise ValueError("Error starting transfer profiles: " + str(ret))

# Warm-up time
time.sleep(2)

ret = llt.get_actual_profile(hLLT, profile_buffer, len(profile_buffer), llt.TProfileConfig.CONTAINER,
                           ct.byref(lost_profiles))
if ret != len(profile_buffer):
    raise ValueError("Error get profile buffer data: " + str(ret))

# Stop transmission
ret = llt.transfer_profiles(hLLT, llt.TTransferProfileType.NORMAL_CONTAINER_MODE, 0)
if ret < 1:
    raise ValueError("Error stopping transfer profiles: " + str(ret))
Esempio n. 3
0
# Set partial profile
ret = llt.set_profile_config(hLLT, llt.TProfileConfig.PARTIAL_PROFILE)
if ret < 1:
    raise ValueError("Error setting profile config: " + str(ret))

ret = llt.set_partial_profile(hLLT, ct.byref(partial_profile_struct))
if ret < 1:
    raise ValueError("Error setting partial profile: " + str(ret))

ret = llt.register_buffer_callback(hLLT, get_profile_cb,
                                   ct.byref(cb_user_data))
if ret < 1:
    raise ValueError("Error setting callback: " + str(ret))

# Start transfer
ret = llt.transfer_profiles(hLLT, llt.TTransferProfileType.NORMAL_TRANSFER, 1)
if ret < 1:
    raise ValueError("Error starting transfer profiles: " + str(ret))

# Warm-up time
time.sleep(0.1)

fig, ax = plt.subplots()
line, = ax.plot([], [], ".b", lw=2)
ax.grid()
ax.set_xlim(-60, 60)
ax.set_ylim(25, 350)
line.set_data(x, z)


def data_gen(*args):