Skip to content

Commit 3f3dee2

Browse files
committed
Adapted _buildFunction to Modia 0.11.0
1 parent f083686 commit 3f3dee2

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
authors = ["Andrea Neumayr <[email protected]>", "Martin Otter <[email protected]>", "Gerhard Hippmann <[email protected]>"]
22
name = "Modia3D"
33
uuid = "07f2c1e0-90b0-56cf-bda7-b44b56e34eed"
4-
version = "0.12.0"
4+
version = "0.12.1"
55

66
[compat]
77
Colors = "0.12, 0.11, 0.10"
@@ -12,7 +12,7 @@ HTTP = "0.9"
1212
JSON = "0.21"
1313
Measurements = "2"
1414
MeshIO = "0.4.10"
15-
Modia = "0.10.0"
15+
Modia = "0.11.0, 0.10.0"
1616
MonteCarloMeasurements = "1"
1717
OrderedCollections = "1"
1818
Reexport = "1.0"

src/Modia3D.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
module Modia3D
55

66
const path = dirname(dirname(@__FILE__)) # Absolute path of package directory
7-
const Version = "0.12.0"
8-
const Date = "2023-05-30"
7+
const Version = "0.12.1"
8+
const Date = "2023-06-04"
99

1010
println("\nImporting Modia3D Version $Version ($Date)")
1111

src/ModiaInterface/buildModel3D.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,19 @@ equations = :[
6565
]
6666
```
6767
"""
68-
function build_Model3D!(model::AbstractDict, FloatType::Type, TimeType::Type, unitless::Bool,
69-
ID, modelPath::Union{Expr,Symbol,Nothing},
70-
buildOption::String = "ComputeGeneralizedForces") # ComputeJointAccelerations, ComputeJointAccelerationsOn
68+
function build_Model3D!(model::AbstractDict, modelModule, FloatType::Type, TimeType::Type,
69+
instantiateModelOptions::OrderedDict{Symbol,Any},
70+
ID, modelPath::Union{Expr,Symbol,Nothing},
71+
buildOption::String = "ComputeGeneralizedForces") # ComputeJointAccelerations, ComputeJointAccelerationsOn
7172
@assert(buildOption == "ComputeGeneralizedForces")
73+
#println("modelPath = $modelPath")
74+
modelPathAsString = isnothing(modelPath) ? "" : string(modelPath)
75+
unitless = instantiateModelOptions[:unitless]
76+
if !unitless
77+
source = instantiateModelOptions[:source]
78+
modelName = instantiateModelOptions[:modelName]
79+
error("\nError from Model3D(..) in model $modelName at $source:\n@instantiatedModel(..., unitless=true, ...) required, because units not yet fully supported by Model3D.\n")
80+
end
7281
jointInfo = []
7382
getJointInfo!(model, jointInfo)
7483

@@ -111,9 +120,6 @@ function build_Model3D!(model::AbstractDict, FloatType::Type, TimeType::Type, un
111120
jointStatesFreeMotion_isrot123 = Expr[]
112121
freeMotionIndices = OrderedCollections.OrderedDict{String,Int}()
113122

114-
#println("modelPath = $modelPath")
115-
modelPathAsString = isnothing(modelPath) ? "" : string(modelPath)
116-
117123
i=1
118124
for joint in jointInfo
119125
path = joint.path

0 commit comments

Comments
 (0)