From 7634ee33120e7ef601ba1e806c63fe61c53e46bb Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 18 Jun 2021 10:00:10 +0200 Subject: WIP: Implement Transport --- src/camera.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/camera.go') diff --git a/src/camera.go b/src/camera.go index cc29f54..e836cf3 100644 --- a/src/camera.go +++ b/src/camera.go @@ -50,7 +50,7 @@ func singlePicture(m *Machine) { // create command var cmd *exec.Cmd - if !debug { + if !config.Flag.Debug { cmd = exec.Command("python3", "/usr/lib/python3.9/site-packages/birdscan/") } else { cmd = exec.Command("python3", "../python/birdscan", "--debug") @@ -68,7 +68,7 @@ func singlePicture(m *Machine) { if err != nil { log.Print(err) } - data,err := io.ReadAll(stdout) + _,err = io.ReadAll(stdout) if err != nil { log.Print(err) } @@ -78,8 +78,9 @@ func singlePicture(m *Machine) { } // process result - log.Println(string(data)) m.SendEvent("single_picture_taken") + log.Println("Picture taken. Sending transport_request ...") + transporter.statemachine.SendEvent("transport_request") } func (cam *Camera) run() { -- cgit v1.2.3-70-g09d2