mirror of
https://github.com/jonathanhogg/scopething
synced 2025-07-14 11:12:09 +01:00
Small change to closing of scope
This commit is contained in:
6
scope.py
6
scope.py
@ -43,8 +43,8 @@ class Scope(vm.VirtualMachine):
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
raise RuntimeError("No matching serial device found")
|
raise RuntimeError("No matching serial device found")
|
||||||
Log.info(f"Connecting to scope at {url}")
|
|
||||||
self.close()
|
self.close()
|
||||||
|
Log.info(f"Connecting to scope at {url}")
|
||||||
parts = urlparse(url, scheme='file')
|
parts = urlparse(url, scheme='file')
|
||||||
if parts.scheme == 'file':
|
if parts.scheme == 'file':
|
||||||
self._reader = self._writer = streams.SerialStream(device=parts.path)
|
self._reader = self._writer = streams.SerialStream(device=parts.path)
|
||||||
@ -115,8 +115,8 @@ class Scope(vm.VirtualMachine):
|
|||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
super().close()
|
if super().close():
|
||||||
Log.info("Closed scope")
|
Log.info("Closed scope")
|
||||||
|
|
||||||
def calculate_lo_hi(self, low, high, params):
|
def calculate_lo_hi(self, low, high, params):
|
||||||
if not isinstance(params, self.AnalogParams):
|
if not isinstance(params, self.AnalogParams):
|
||||||
|
Reference in New Issue
Block a user