diff --git a/src/interface.jl b/src/interface.jl index 82136bd7019eb47b3e27bec6c535dbdb190ded7d..bff7bd93f227f32ac711a8ce6f9099d24f29d7dc 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -4,9 +4,12 @@ export num_outputs, outputrange, inputrange, isstable, + isasstable, sampletime, control, - measure + measure, + initialize, + finalize # Interface specification =================================================================== abstract type AbstractProcess end diff --git a/src/interface_documentation.jl b/src/interface_documentation.jl index 608897dc6344a82959bf5338af4c4ccf7c6c1640..fa3f18ff4d3f5a8293a74e109d23a4020199f135 100644 --- a/src/interface_documentation.jl +++ b/src/interface_documentation.jl @@ -5,60 +5,85 @@ Base abstract type for all lab processes. This should not be inherited from directly, see [`PhysicalProcess`](@ref), [`SimulatedProcess`](@ref) """ AbstractProcess + """ PhysicalProcess Pysical processes should inherit from this abstract type. """ PhysicalProcess + """ SimulatedProcess Simulated processes should inherit from this abstract type. """ SimulatedProcess + """ ny = num_outputs(P::AbstractProcess) Return the number of outputs (measurement signals) of the process. """ num_outputs + """ nu = num_inputs(P::AbstractProcess) Return the number of inputs (control signals) of the process. """ num_inputs + """ range = outputrange(P::AbstractProcess) Return the range of outputs (measurement signals) of the process. `range` is a vector of tuples, `length(range) = num_outputs(P), eltype(range) = Tuple(Real, Real)` """ outputrange + """ inputrange(P::AbstractProcess) Return the range of inputs (control signals) of the process. `range` is a vector of tuples, `length(range) = num_inputs(P), eltype(range) = Tuple(Real, Real)` """ inputrange + """ isstable(P::AbstractProcess) Return true/false indicating whether or not the process is stable """ isstable + """ isasstable(P::AbstractProcess) Return true/false indicating whether or not the process is asymptotically stable """ isasstable + """ h = sampletime(P::AbstractProcess) Return the sample time of the process in seconds. """ sampletime + """ control(P::AbstractProcess, u) Send a control signal to the process. `u` must have dimension equal to `num_inputs(P)` """ control + """ y = measure(P::AbstractProcess) Return a measurement from the process. `y` has length `num_outputs(P)` """ measure + +""" + initialize(P::AbstractProcess) +This function is called before any control or measurement operations are performed. During a call to `initialize`, one might set up external communications etc. After control is done, +the function [`finalize`](@ref) is called. +""" +initialize + +""" + finalize(P::AbstractProcess) +This function is called after any control or measurement operations are performed. During a call to `finalize`, one might finalize external communications etc. Before control is done, +the function [`initialize`](@ref) is called. +""" +finalize