Open jondoesntgit opened 6 years ago
# An example to get you started
class Instrument():
def __init__(self):
self._name = None
def identify(self):
print(self._name)
class FunctionGenerator(Instrument):
def __init__(self):
super().__init__()
self._frequency = None
@property
def frequency(self):
raise NotImplementedError
@frequency.setter
def frequency(self, val):
raise NotImplementedError
class WheelerInstruments2000(FunctionGenerator):
def __init__(self):
super().__init__()
self._frequency = 10
self._name = "Wheeler Instruments 2000, Serial Number 3.14159"
@property
def frequency(self):
return self._frequency
@frequency.setter
def frequency(self, val):
self._frequency = val
class WheelerInstruments3000(FunctionGenerator):
def __init__(self):
super().__init__()
self._name = "Wheeler Instruments 3000, Serial Number 2.718281828"
Each instrument should have a base class that it inherits methods like
identify
andlog_state
from.Furthermore, instruments should be divided into categories, like function generators, lock-in amplifiers