From c324aa20552672c117aaa58eee4c60ac62253345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20F=C3=A4lt?= <faldt.mattias@gmail.com> Date: Mon, 28 Aug 2017 20:49:44 +0200 Subject: [PATCH] Exports --- src/Computer/10V.jl | 2 +- src/Computer/BeagleBoneStream.jl | 13 ++++++------- src/Computer/Computer.jl | 1 + src/Computer/LabStream.jl | 2 ++ src/Computer/SysLED.jl | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/Computer/10V.jl b/src/Computer/10V.jl index 3da2a8b..facf505 100644 --- a/src/Computer/10V.jl +++ b/src/Computer/10V.jl @@ -1,4 +1,4 @@ -export AnalogInput10V +export AnalogInput10V, AnalogOutput10V mutable struct AnalogInput10V <: AbstractDevice i::Int32 diff --git a/src/Computer/BeagleBoneStream.jl b/src/Computer/BeagleBoneStream.jl index 24bd09f..ee9253d 100644 --- a/src/Computer/BeagleBoneStream.jl +++ b/src/Computer/BeagleBoneStream.jl @@ -30,19 +30,19 @@ end function send(bbstream::BeagleBoneStream) ncmds = length(bbstream.sendbuffer) - serialize(bbstream.stream, (true, ncmds, bbstream.sendbuffer)) + serialize(bbstream.stream, (true, Int32(ncmds), bbstream.sendbuffer...)) empty!(bbstream.sendbuffer) return end function read(comedistream::BeagleBoneStream) ncmds = length(bbstream.readbuffer) - serialize(bbstream.stream, (false, ncmds, bbstream.sendbuffer)) + serialize(bbstream.stream, (false, Int32(ncmds), bbstream.readbuffer...)) #TODO wait for answer vals = nothing - empty!(bbstream.sendbuffer) + empty!(bbstream.readbuffer) return vals end -# +# # function send(stream::BeagleBoneStream) # cmds = Tuple[] # for dev in stream.devices @@ -82,14 +82,13 @@ end function send(bbstream::BeagleBoneStream, cmd) allcmds = (true, Int32(1), cmd) println("Sending single command: $allcmds") - serialize(stream, allcmds) + serialize(bbstream.stream, allcmds) return end function read(bbstream::BeagleBoneStream, cmd) - cmd, stream = safe_getreadcommand(dev) allcmds = (false, Int32(1), cmd) println("Sending single command: $allcmds") - serialize(stream, allcmds) + serialize(bbstream.stream, allcmds) #TODO get, wait for and return response return end diff --git a/src/Computer/Computer.jl b/src/Computer/Computer.jl index c494e99..19e6ab5 100644 --- a/src/Computer/Computer.jl +++ b/src/Computer/Computer.jl @@ -34,3 +34,4 @@ include("BeagleBoneStream.jl") #Include the device definitions include("SysLED.jl") +include("10V.jl") diff --git a/src/Computer/LabStream.jl b/src/Computer/LabStream.jl index 3856de7..9f8738d 100644 --- a/src/Computer/LabStream.jl +++ b/src/Computer/LabStream.jl @@ -1,3 +1,5 @@ +export LabStream + abstract type LabStream end function close(stream::LabStream) diff --git a/src/Computer/SysLED.jl b/src/Computer/SysLED.jl index 2d0837a..855858f 100644 --- a/src/Computer/SysLED.jl +++ b/src/Computer/SysLED.jl @@ -3,7 +3,7 @@ export SysLED mutable struct SysLED <: AbstractDevice i::Int32 stream::LabStream - SysLED(i::Int32) = new(i, false, false) + SysLED(i::Int32) = new(i) end SysLED(i::Int64) = SysLED(convert(Int32, i)) -- GitLab