diff options
-rw-r--r-- | doc/architecture.drawio | 2 | ||||
-rw-r--r-- | lab_control/sds1000xe.py | 7 | ||||
-rw-r--r-- | lab_control/test/sds1000xe_test.py | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/doc/architecture.drawio b/doc/architecture.drawio index cabb248..3c68dad 100644 --- a/doc/architecture.drawio +++ b/doc/architecture.drawio @@ -1 +1 @@ -<mxfile host="Electron" modified="2022-05-24T09:05:22.591Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/16.0.2 Chrome/96.0.4664.55 Electron/16.0.5 Safari/537.36" etag="51U_tqLsFPTbi-FRZO5Z" version="16.0.2" type="device"><diagram id="Aw8Itl_1nmNhQKuLZfUh" name="Page-1">7Vtbc9o4FP41zKQP6fiCHXgMkKSXZJsN2Ta7Lx1hC6yJbLm2INBfv5IlgS2ZS4kpmSkzmQQdHcnSuXzngtNy+/H8JgNpdEdCiFuOFc5b7qDlOB3fZ785YSEInucKwiRDoSDZK8IQ/YSSaEnqFIUwrzBSQjBFaZUYkCSBAa3QQJaRlyrbmODqU1MwgQZhGABsUr+hkEaSavvd1cQHiCaRfHTHuRATMVDM8iZ5BELyUiK5Vy23nxFCxad43oeYy07JRay7XjO7PFgGE7rLgkn0Nb76/g0+fE7/i0YXw++3n6bncpcZwFN54ZbjY7ZfL+VHpgspB//HlJ+zF4NsgpKWe8lmrXTOfjNicVtOP6ckFXPt0hyFc3oOMJrIdQE7MMxWe7JPE/m3eDIqEUDMNuxhc/SR7zEGAVySq0sqOzKhIP0po8ygKMKXPEAYkzwgKSxtMdIXMFqq06KMy02Zsbqivf62e8kZwzEtCXrd3nUHPMzzCl4I8mkGL+MUIzoN4RlK6DuxaowJoHWSL627f34k98/rFh3lKg93w10uccQTXmfwxxQmwWLfczqVEzozmFHE0O9SuOugcOiedN6BOFmPMC72EI5lY+YojDImCZXYbTtyfA1ihDnqf4B4Bvmu3D1ojDnT8tll/FJgxM4A5yWSxLMbS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w5bcw7ffYvO0X0DznHhar2btrOfc3gd+70eg7zf6x6O4R7924+GgzTbEe9cVC/tOWZH3K7riOvY0dwXpmZH/J/cLJNMnNDAoZJyrc2qVhHJK7vcRnd7hWs5u6ZiuwaeA+RiHT3eOHvGm64eb/SNDu1QZq5+C0asYmFVF8b8C/JT56URENGT7roG+lL5la/VVDnVPIqsa6GTPBDNl9L3KH6LHVnIoujOTATHugbdqUNT72avadHUmod3MOs4ddoPqN6al65q1XuoHo1649bwff0duQeYp0w48Ey+Ibd8F0R8XL02Y6w4YULjRtPZzWiaaNveDX6AvzL8OXj6O/o4m5L+MLmvefN5u9ZPCcOeVYdVrTpsy4QMx/dqEoYmyo5a9ZvFl8CMkHmSAAGMmJy8Hp2mTDpeTwGF+Ct854QKyiQ2uthrEoVas2giUag98Q5vZ/2BeUIzyq17N7tOuQ2kCbUHrvsmp3jJBszgI2P5esbEUX0Ns1onpJjQy3z49WYbIytyH8DLgOnmjM+/O+HJsUzOTDJqTc53DmRzZlV6wN7W2kC9Vwt4kwaO0qbSOr9LPPnlNlV3y0Z7t6nYcPXvfIJ99T+R7tX/</diagram></mxfile>
\ No newline at end of file +<mxfile host="Electron" modified="2022-05-26T14:43:31.818Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/18.0.6 Chrome/100.0.4896.143 Electron/18.2.3 Safari/537.36" etag="yj-ZX5OZNlBGnsCaUlsx" version="18.0.6" type="device"><diagram id="Aw8Itl_1nmNhQKuLZfUh" name="Page-1">7Vtbc9o4FP41zKQP6fiCHXgMkKSXZJsN2Ta7Lx1hC6yJbLm2TKC/fiVbwrZkLiWmZKbMZBJ0dCRL5/KdC07HHoaLmwTEwR3xIe5Yhr/o2KOOZZldy2B/OGVZUPp9uyDMEuQLppIwRj+hIIp1swz5MK0xUkIwRXGd6JEogh6t0UCSkJc625Tg+lNjMIMaYewBrFO/IZ8Ggmq6/XLiA0SzQDy6Z10UEyGQzOImaQB88lIh2Vcde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UY5bordCwbUOZeCg6ZqjAsNfrIFT46NzWt27rW7QYNYzCB+J6kiCczjJYUvIrmj6Vcx9pNub0D6bav6fbTaOy6hqGp+ATj7cB4t+ccGcblgTQcn4rGDGIiOaH4Rkfv72wGbwXFzaYe+gnG29HusWHc1BNyTblvrV4TQt5ar4mbHKNe6/adegruKFvsWq9dWPUgYPWVjQ5cr1k65JubDITEOc5WtK7YQx6eJbePQEgi/zHgzZ1a5Da7klA1LaZJmT4wXw3IjEQAX5XUbdgyESFaMUVmgcnyaXVeNviXz7y3HDkeLaqso6UcLRB9ylkNwxTjYqnpWGJcLuWD6sp7mCCmH574vNIjrF1bGN0dXUJYn2x5SCtuxTdWOaLatPpl33C3bHRo39AD48k3NN84Z85hKs7h2m/ROfpvwDkubKV307X2cw6nZ75XY5Dze93D0txjePtRc5B2O+K9i/qlHUvviJtNHXEVO9r7wlTviP+T6mWSjhMKONRSrrVZVRmRnKrLbXS3V7iWtWsqtmvgOUAu1lPjjbVnvOmr8Ubd6NAOpefqt2DCKhZWdWHMvyA/dV5aARE16W5qoK+UX/taTZZT7aPIuhY6Sb2i+VL5HsXtsCMXssi7M7OCY12D7tShaXaz17RoGs3DOZh1nDrtB1Rvw0tXjeo9VI9GvnGr+b76jtwDTGMmHHgm3pBbvQtSfCxfm9FWnDChdaPp7WY0bbRt70Y/wF8J/uw9/R18nGdkOI7uG9583q71U8KwZ9Vh1KsO09Ahw3KdhoShjbKjUf168VVghs88qQABjJicnAHNYiYdZyCBovhb+M4JFaRJbHSx1yQKjWbRRqLQeOId3s76A/OEdpTb9G52k3JbSBMaD9z0TU7+kg2Yw0fG8vWMiaP+Gma9TogxoZfp+OvNNkZW5D6AlxHTzRmff3fCk2OZnJ5kNJqcax3I5vSq9IC9rbWBeq8W8CYNHKVNpXR+V3jyy22q/paN9m5TsWH573wFe/lPkfbV/w==</diagram></mxfile>
\ No newline at end of file diff --git a/lab_control/sds1000xe.py b/lab_control/sds1000xe.py index c0654e0..a3ffe9c 100644 --- a/lab_control/sds1000xe.py +++ b/lab_control/sds1000xe.py @@ -5,12 +5,11 @@ from lab_control.oscilloscope import Oscilloscope class SDS1000XE(Oscilloscope): PORT = 5025 TIMEOUT = 0.2 - AVAILABLE_CHANNELS = range(1, 5) - def __init__(self, ip): + def __init__(self, address): self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self._socket.connect((ip, SDS1000XE.PORT)) + self._socket.connect((address, SDS1000XE.PORT)) self._socket.settimeout(SDS1000XE.TIMEOUT) def measureAmplitude(self, channel: int) -> float: @@ -28,7 +27,7 @@ class SDS1000XE(Oscilloscope): def _measure(self, channel: int, code: str) -> float: assert channel in SDS1000XE.AVAILABLE_CHANNELS - query = f"C{channel}:PAVA? {code}" + query = f"C{channel}:PAVA? {code}\r\n" self._socket.sendall(query.encode()) try: diff --git a/lab_control/test/sds1000xe_test.py b/lab_control/test/sds1000xe_test.py index 0112c9f..c7ec252 100644 --- a/lab_control/test/sds1000xe_test.py +++ b/lab_control/test/sds1000xe_test.py @@ -33,7 +33,7 @@ def test_RMSMeasurement(uut, mockServer): testCases = [(1, 16.23987), (2, 0.0), (3, -0.0164), (4, 10.1)] checkFloatMeasurement(testCases, mockServer.setRMS, uut.measureRMS) -def test_FrequencyMeasurement(uut, mockServer): +def test_frequencyMeasurement(uut, mockServer): testCases = [(1, 16.23987), (2, 0.0), (3, -0.0164), (4, 93489.15)] checkFloatMeasurement(testCases, mockServer.setFrequency, uut.measureFrequency) |