Skip to content

Commit

Permalink
fix test script
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Mar 29, 2024
1 parent 8737c70 commit 482d2e2
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions test/test_mixer2.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
using KiteControllers, Plots
# activate the test environment if needed
using Pkg
if ! ("ControlPlots" keys(Pkg.project().dependencies))
using TestEnv; TestEnv.activate()
end

using KiteControllers, ControlPlots

PERIOD_TIME = 0.05

m2 = KiteControllers.Mixer_2CH(PERIOD_TIME, 1.0)
x = ones(10)
y = 2*x
out = zeros(10)
for i in 1:length(x)
for i in eachindex(x)
in1=x[i]
in2=y[i]
out[i] = calc_output(m2, x[i], y[i])
select_b(m2, i > 2)
on_timer(m2)
end
plot(1:10, x, label="input_a", width=2, xtickfontsize=12, ytickfontsize=12, legendfontsize=12)
plot!(1:10, y, label="input_b", width=2)
plot!(1:10, out, label="output", width=2)
plt.plot(1:10, x, label="input_a")
plt.plot(1:10, y, label="input_b")
plt.plot(1:10, out, label="output")
plt.grid(true)
plt.legend()
plt.pause(0.01)
plt.show(block=false)

0 comments on commit 482d2e2

Please sign in to comment.