From 10190eace95ae02cec6e8b10de79e0d7c41b8b4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20F=C3=A4lt?= <mattiasf@control.lth.se>
Date: Thu, 14 Sep 2017 16:59:30 +0200
Subject: [PATCH] Update ballandbeam.jl

---
 src/interface_implementations/ballandbeam.jl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/interface_implementations/ballandbeam.jl b/src/interface_implementations/ballandbeam.jl
index 6b1a5c8..1764d1f 100644
--- a/src/interface_implementations/ballandbeam.jl
+++ b/src/interface_implementations/ballandbeam.jl
@@ -94,8 +94,11 @@ bias(p::AbstractBeamOrBallAndBeam)       = p.bias
 bias(p::BeamSimulator)                   = 0
 bias(p::BallAndBeamSimulator)            = 0
 
-
-control(p::AbstractBeamOrBallAndBeam, u) = send(p.control,u)
+function control(p::AbstractBeamOrBallAndBeam, u::AbstractArray)
+    length(u) == 1 || error("Process $(typeof(p)) only accepts one control signal, tried to send u=$u.")
+    send(p.control,u[1])
+end
+control(p::AbstractBeamOrBallAndBeam, u::Number) = send(p.control,u)
 control(p::BeamSimulator, u)             = p.s(u)
 control(p::BallAndBeamSimulator, u)      = error("Not yet implemented")
 
-- 
GitLab