Skip to content

Commit b6bbdac

Browse files
committed
Add docu page components
1 parent 9df8484 commit b6bbdac

File tree

5 files changed

+31
-4
lines changed

5 files changed

+31
-4
lines changed

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ makedocs(;
1515
),
1616
pages=[
1717
"Home" => "index.md",
18+
"Components" => "components.md",
1819
"Types" => "types.md",
1920
"Functions" => "functions.md"
2021
],

docs/src/components.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
```@meta
2+
CurrentModule = WinchControllers
3+
```
4+
## Integrator
5+
```@docs
6+
Integrator
7+
Integrator(dt, i=1.0, x0=0.0)
8+
reset
9+
calc_output
10+
on_timer
11+
```

docs/src/functions.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ CurrentModule = WinchControllers
44
## Input functions
55
```@docs
66
set_vset_pc
7-
reset
87
```
98

109
## Output functions
1110
```@docs
12-
calc_output
1311
calc_vro
1412
get_state
1513
```

docs/src/types.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ CurrentModule = WinchControllers
66

77
## Control components
88
```@docs
9-
Integrator
10-
Integrator(dt, i=1.0, x0=0.0)
119
UnitDelay
1210
RateLimiter
1311
Mixer_2CH

src/components.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,29 @@ function reset(int::Integrator, x0=0.0)
5757
nothing
5858
end
5959

60+
"""
61+
calc_output(int::Integrator, input)
62+
63+
Calculate and return the output without updating `last_output`.
64+
65+
# Parameters
66+
67+
- int::Integrator: An integrator struct
68+
- input: The input value
69+
"""
6070
function calc_output(int::Integrator, input)
6171
int.output = int.last_output + input * int.i * int.dt
6272
end
6373

74+
"""
75+
on_timer(int::Integrator)
76+
77+
Update the field `last_output`. Must be called once per time-step.
78+
79+
# Parameters
80+
81+
- int::Integrator: An integrator struct
82+
"""
6483
function on_timer(int::Integrator)
6584
int.last_output = int.output
6685
nothing

0 commit comments

Comments
 (0)