Fixed remaining states, GuiPostprocessing and Worker not yet done

This commit is contained in:
Balthasar Reuter
2018-07-16 01:20:48 +02:00
parent 436c2fe6c9
commit f84fc20a62
3 changed files with 36 additions and 16 deletions

View File

@@ -70,7 +70,7 @@ class Camera:
def teardown(self, state):
if not self._cap is None:
if self._cap is not None:
self._cap.cleanup()
if state.target == StateMachine.TeardownEvent.EXIT:
sys.exit(0)
@@ -91,7 +91,7 @@ class Camera:
elif isinstance(state, StateMachine.CountdownState):
self.capturePreview()
elif isinstance(state, StateMachine.CaptureState):
self.capturePicture()
self.capturePicture(state)
elif isinstance(state, StateMachine.AssembleState):
self.assemblePicture()
elif isinstance(state, StateMachine.TeardownState):
@@ -119,7 +119,7 @@ class Camera:
self._comm.send(Workers.GUI,
StateMachine.CameraEvent('preview', picture))
def capturePicture(self):
def capturePicture(self, state):
self.setIdle()
picture = self._cap.getPicture()
@@ -130,12 +130,12 @@ class Camera:
self._comm.send(Workers.WORKER,
StateMachine.CameraEvent('capture', picture))
if len(self._pictures) < self._pic_dims.totalNumPictures:
if state.num_picture < self._pic_dims.totalNumPictures:
self._comm.send(Workers.MASTER,
StateMachine.CameraEvent('countdown', picture))
StateMachine.CameraEvent('countdown'))
else:
self._comm.send(Workers.MASTER,
StateMachine.CameraEvent('assemble', picture))
StateMachine.CameraEvent('assemble'))
def assemblePicture(self):