From bb88053aaa50cc6c55ccaa1d6b4bb501a71e2f0a Mon Sep 17 00:00:00 2001 From: wendtalexander Date: Thu, 19 Sep 2024 11:24:35 +0200 Subject: [PATCH] moving files to repro folder --- pyrelacs/input.py | 53 ---------------------------------------------- pyrelacs/output.py | 16 -------------- pyrelacs/repos.py | 20 ----------------- 3 files changed, 89 deletions(-) delete mode 100644 pyrelacs/input.py delete mode 100644 pyrelacs/output.py delete mode 100644 pyrelacs/repos.py diff --git a/pyrelacs/input.py b/pyrelacs/input.py deleted file mode 100644 index c1515bc..0000000 --- a/pyrelacs/input.py +++ /dev/null @@ -1,53 +0,0 @@ -from typing import Optional - -import uldaq -from IPython import embed -import typer -from typing_extensions import Annotated -import matplotlib.pyplot as plt - -from pyrelacs.util.logging import config_logging - -log = config_logging() - - -class ReadData: - def __init__(self) -> None: - devices = uldaq.get_daq_device_inventory(uldaq.InterfaceType.USB) - log.debug(f"Found daq devices {len(devices)}, connecting to the first one") - self.daq_device = uldaq.DaqDevice(devices[0]) - self.daq_device.connect() - log.debug("Connected") - - def read_analog_in(self, channel: Annotated[Optional[int], typer.Argument()] = 0): - # Get the Ananlog In device and Analog Info - ai_device = self.daq_device.get_ai_device() - ai_info = ai_device.get_info() - log.debug( - f"Analog info,\n Channels available {ai_info.get_num_chans()}, \n Max Samplerate: {ai_info.get_max_scan_rate()}" - ) - buffer_len = 1_000_000 - buf = uldaq.create_float_buffer(1, buffer_len) - - er = ai_device.a_in_scan( - 1, - 1, - uldaq.AiInputMode.SINGLE_ENDED, - uldaq.Range.BIP10VOLTS, - buffer_len, - 500_000, - uldaq.ScanOption.DEFAULTIO, - uldaq.AInScanFlag.DEFAULT, - data=buf, - ) - ai_device.scan_wait(uldaq.WaitType.WAIT_UNTIL_DONE, timeout=-1) - log.debug("Scanning") - embed() - - self.daq_device.disconnect() - self.daq_device.release() - - -if __name__ == "__main__": - daq_input = ReadData() - typer.run(daq_input.read_analog_in) diff --git a/pyrelacs/output.py b/pyrelacs/output.py deleted file mode 100644 index f910ddb..0000000 --- a/pyrelacs/output.py +++ /dev/null @@ -1,16 +0,0 @@ -import uldaq -from IPython import embed -import typer - -class Output_daq(): - def __init__(self) -> None: - devices = uldaq.get_daq_device_inventory(uldaq.InterfaceType.USB) - daq_device = uldaq.DaqDevice(devices[0]) - daq_device.connect() - - - - -if __name__ == '__main__': - daq_input = Input_daq() - diff --git a/pyrelacs/repos.py b/pyrelacs/repos.py deleted file mode 100644 index b9fccfd..0000000 --- a/pyrelacs/repos.py +++ /dev/null @@ -1,20 +0,0 @@ -import uldaq -from IPython import embed - -from pyrelacs.util.logging import config_logging - -log = config_logging() - - -class Repos: - def __init__(self) -> None: - pass - - def run_repo(self) -> None: - pass - - def stop_repo(self) -> None: - pass - - def reload_repo(self) -> None: - pass