diff --git a/README.md b/README.md index 2aca568eeceab42d2312b51e947efa885036b927..4870e9799523ebceca07d361e4d615ee3052bee7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +## News +2018-12-07: Update to julia v1.0 is ongoing, check branch `julia1` + [](https://gitlab.control.lth.se/processes/LabProcesses.jl/commits/master) [](https://gitlab.control.lth.se/processes/LabProcesses.jl/commits/master) @@ -37,4 +40,4 @@ och lägga till tre rader som När .gitlab-ci.yml uppdateras i master triggas en pipline. Om denna lyckas kommer dokumentationen finnas under -http://processes.gitlab.control.lth.se/documentation/myfoldername/ \ No newline at end of file +http://processes.gitlab.control.lth.se/documentation/myfoldername/ diff --git a/REQUIRE b/REQUIRE index d5abd45daaab624c5b1cb14ccb404f76c0e1b6d6..ff86b9895ae7badf35f3dcec9383f2520c13e1ea 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,3 +1,4 @@ -julia 0.6 +julia 0.7 ControlSystems Parameters +DSP diff --git a/src/LabProcesses.jl b/src/LabProcesses.jl index e193536820120db4ad968a6e9feca62b01758c73..bc3b32b9a0627810a673e50c30f9fd272f291f8d 100644 --- a/src/LabProcesses.jl +++ b/src/LabProcesses.jl @@ -1,4 +1,5 @@ # __precompile__() +using Pkg installed_packages = Pkg.installed() if "LabConnections" ∉ keys(installed_packages) Pkg.clone("https://gitlab.control.lth.se/cont-frb/LabConnections.jl") @@ -8,7 +9,7 @@ end module LabProcesses -using ControlSystems, LabConnections.Computer, Parameters +using ControlSystems, LabConnections.Computer, Parameters, DSP include("utilities.jl") diff --git a/src/interface_implementations/define_beam_system.jl b/src/interface_implementations/define_beam_system.jl index 5aba53bb0a0869175490a92c9245dac0db997a96..76365fa6e4b9599118ccc32aec093bd3e38a30eb 100644 --- a/src/interface_implementations/define_beam_system.jl +++ b/src/interface_implementations/define_beam_system.jl @@ -1,4 +1,4 @@ -using ControlSystems +using ControlSystems, DSP """ beammodel, beamcontroller = define_beam_system(;doplot=false) diff --git a/src/utilities.jl b/src/utilities.jl index 3b4d1f2ffe14df0930d372b7bcf9e2515a208b87..6ae5a9df5c63e2e9ad3f86c700fcb2bdaa0e5c2e 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -9,7 +9,7 @@ macro periodically(h, body) local start_time = time() $(esc(body)) local execution_time = time()-start_time - sleep(max(0,$(esc(h))-execution_time)) + Libc.systemsleep(max(0,$(esc(h))-execution_time)) end end @@ -37,22 +37,22 @@ Create a SysFilter object that can be used to implement control loops and simula with LTI systems, i.e., `U(z) = C(z)E(z)`. To filter a signal `u` through the filter, call like `y = Csf(u)`. Calculates the filtered output `y` in `y = Cx+Du, x'=Ax+Bu` """ -struct SysFilter - sys::StateSpace +struct SysFilter{T<:StateSpace} + sys::T state::Vector{Float64} function SysFilter(sys::StateSpace, state::AbstractVector) @assert !ControlSystems.iscontinuous(sys) "Can not filter using continuous time model." @assert length(state) == sys.nx "length(state) != sys.nx" - new(sys, state) + new{typeof(sys)}(sys, state) end function SysFilter(sys::StateSpace) @assert !ControlSystems.iscontinuous(sys) "Can not filter using continuous time model. Supply sample time." - new(sys, init_sysfilter(sys)) + new{typeof(sys)}(sys, init_sysfilter(sys)) end function SysFilter(sys::StateSpace, h::Real) @assert ControlSystems.iscontinuous(sys) "Sample time supplied byt system model is already in discrete time." sysd = c2d(sys, h)[1] - new(sysd, init_sysfilter(sysd)) + new{typeof(sysd)}(sysd, init_sysfilter(sysd)) end end (s::SysFilter)(input) = sysfilter!(s.state, s.sys, input)