From 839bfdaaf33feefe390dd0a7bff32ca68bae3a97 Mon Sep 17 00:00:00 2001
From: Fredrik Bagge Carlson <cont-frb@ulund.org>
Date: Sun, 20 Aug 2017 22:03:11 +0200
Subject: [PATCH] More docstrings

---
 src/interface.jl               |  5 ++++-
 src/interface_documentation.jl | 25 +++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/src/interface.jl b/src/interface.jl
index 82136bd..bff7bd9 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 608897d..fa3f18f 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
-- 
GitLab