Skip to content

Commit 4557259

Browse files
Fix documentation issues from #399
- Enable Digital Gates module and add proper exports (Not, And, Nand, Or, Nor, Xor, Xnor) - Enable Digital Components module and add exports (HalfAdder, FullAdder, MUX, DEMUX, Encoder, Decoder) - Enable Digital Sources module and add exports (PulseDiff, Set, Reset, Pulse) - Export DigitalPin connector and logic functions (_not, _and, _or, _xor) - Fix PNP transistor variable error: changed V_BE to V_EB in lines 303 and 307 - Add cross-references to MechanicalPort and RealOutput in AccelerationSensor, PositionSensor, and ForceSensor documentation - Reorganize Digital module includes to ensure logic functions are loaded before gates/components These changes address missing docstrings and incorrect formatting mentioned in the issue. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent cb592ce commit 4557259

File tree

6 files changed

+38
-18
lines changed

6 files changed

+38
-18
lines changed

src/Electrical/Analog/transistors.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,11 @@ Early voltage effect.
300300

301301
C_jE ~ if V_EB > phi_E - Z_E
302302
((C_jE0 * gamma_E * (1 - ((phi_E - Z_E) / phi_E))^(-gamma_E - 1)) / phi_E) *
303-
V_BE -
303+
V_EB -
304304
((C_jE0 * gamma_E * (1 - ((phi_E - Z_E) / phi_E))^(-gamma_E - 1)) / phi_E) *
305305
(phi_E - Z_E) + (C_jE0) / (1 - (phi_E - Z_E) / phi_E)^gamma_E
306306
else
307-
(C_jE0) / (1 - V_BE / phi_E)^gamma_E
307+
(C_jE0) / (1 - V_EB / phi_E)^gamma_E
308308
end
309309
end
310310

src/Electrical/Digital/components.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
using ModelingToolkit: ODESystem, t_nounits as t
2+
using ..Electrical: DigitalPin, _not, _and, _or, _xor
3+
const System = ODESystem
4+
15
# Adders
26
"""
37
```julia

src/Electrical/Digital/gates.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
using ModelingToolkit: ODESystem, t_nounits as t
2+
using ..Electrical: DigitalPin, _not, _and, _or, _xor
3+
const System = ODESystem
4+
15
"""
26
```julia
37
Not(; name)

src/Electrical/Digital/sources.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
using ModelingToolkit: ODESystem, t_nounits as t
2+
using ..Electrical: DigitalPin
3+
const System = ODESystem
4+
15
"""
26
```julia
37
PulseDiff(; name, Val = 1, dt = 0.1)

src/Electrical/Electrical.jl

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using ..Thermal: HeatPort
1010
using ..Mechanical.Rotational: Flange, Support
1111
using ..Blocks: RealInput, RealOutput
1212

13-
export Pin, OnePort
13+
export Pin, OnePort, DigitalPin
1414
include("utils.jl")
1515

1616
export Capacitor,
@@ -30,14 +30,6 @@ include("Analog/mosfets.jl")
3030
export NPN, PNP
3131
include("Analog/transistors.jl")
3232

33-
# include("Digital/gates.jl")
34-
# include("Digital/sources.jl")
35-
36-
# TODO:
37-
# - digital
38-
# - machines
39-
# - multi-phase
40-
4133
export Logic
4234
include("Digital/logic.jl")
4335

@@ -47,7 +39,22 @@ export StdLogicVector, StdULogicVector,
4739
include("Digital/logic_vectors.jl")
4840

4941
export LogicTable,
50-
AndTable, OrTable, NotTable, XorTable
42+
AndTable, OrTable, NotTable, XorTable,
43+
_not, _and, _or, _xor
5144
include("Digital/tables.jl")
5245

46+
export Not, And, Nand, Or, Nor, Xor, Xnor
47+
include("Digital/gates.jl")
48+
49+
export HalfAdder, FullAdder, MUX, DEMUX, Encoder, Decoder
50+
include("Digital/components.jl")
51+
52+
export PulseDiff, Set, Reset, Pulse
53+
include("Digital/sources.jl")
54+
55+
# TODO:
56+
# - digital
57+
# - machines
58+
# - multi-phase
59+
5360
end

src/Mechanical/Translational/sensors.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Linear 1D force sensor, measures the force between two flanges.
55
66
# Connectors:
77
8-
- `flange`: 1-dim. translational flange
9-
- `output`: real output
8+
- `flange_a`: 1-dim. translational flange ([`MechanicalPort`](@ref))
9+
- `flange_b`: 1-dim. translational flange ([`MechanicalPort`](@ref))
10+
- `output`: real output ([`RealOutput`](@ref))
1011
"""
1112
@mtkmodel ForceSensor begin
1213
@components begin
@@ -33,8 +34,8 @@ Linear 1D position sensor.
3334
3435
# Connectors:
3536
36-
- `flange`: 1-dim. translational flange
37-
- `output`: real output
37+
- `flange`: 1-dim. translational flange ([`MechanicalPort`](@ref))
38+
- `output`: real output ([`RealOutput`](@ref))
3839
"""
3940
@mtkmodel PositionSensor begin
4041
@components begin
@@ -64,8 +65,8 @@ Linear 1D acceleration sensor.
6465
6566
# Connectors:
6667
67-
- `flange`: 1-dim. translational flange
68-
- `output`: real output
68+
- `flange`: 1-dim. translational flange ([`MechanicalPort`](@ref))
69+
- `output`: real output ([`RealOutput`](@ref))
6970
"""
7071
@mtkmodel AccelerationSensor begin
7172
@components begin

0 commit comments

Comments
 (0)