summaryrefslogtreecommitdiffstats
path: root/lab_control/test/mock_lab.py
diff options
context:
space:
mode:
Diffstat (limited to 'lab_control/test/mock_lab.py')
-rw-r--r--lab_control/test/mock_lab.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/lab_control/test/mock_lab.py b/lab_control/test/mock_lab.py
index 40893ca..75ba1bf 100644
--- a/lab_control/test/mock_lab.py
+++ b/lab_control/test/mock_lab.py
@@ -9,11 +9,13 @@ class MockLab(FunctionGenerator, Oscilloscope):
self.on = False
self.frequency = None
self.amplitude = None
+ self.function = None
class OscChannelState:
def __init__(self):
self.testFunction = None
self.connectedChannel = None
+ self.voltsPerDiv = None
def __init__(self):
self.fgChannels = [MockLab.FGChannelState() for i in range(0, 2)]
@@ -32,7 +34,7 @@ class MockLab(FunctionGenerator, Oscilloscope):
self.fgChannels[channel - 1].amplitude = amplitude
def setFunction(self, channel: int, function: int) -> None:
- pass
+ self.fgChannels[channel - 1].function = function
def measureAmplitude(self, channel: int) -> float:
fgChannel = self.oscChannels[channel - 1].connectedChannel
@@ -50,8 +52,17 @@ class MockLab(FunctionGenerator, Oscilloscope):
def measureFrequency(self, channel: int) -> float:
pass
+ def setVoltsPerDivision(self, channel: int, volts: float) -> None:
+ self.oscChannels[channel - 1].voltsPerDiv = volts
+
def setTestFunction(self, channel: int, f: Callable[[float], float]) -> None:
self.oscChannels[channel - 1].testFunction = f
def connectChannels(self, fg: int, osc: int) -> None:
self.oscChannels[osc - 1].connectedChannel = self.fgChannels[fg - 1]
+
+ def getFunctionGeneratorChannel(self, channel: int):
+ return self.fgChannels[channel - 1]
+
+ def getOscilloscopeChannel(self, channel: int):
+ return self.oscChannels[channel - 1]