-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simer support for model.runtime.paths
Signed-off-by: Timothy Rule (VM/EMT3) <[email protected]>
- Loading branch information
1 parent
e19e1c5
commit 75316a7
Showing
12 changed files
with
219 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2025 Robert Bosch GmbH | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package simer | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestListYamlFiles(t *testing.T) { | ||
paths := []string{"testdata/sim/model/input/data"} | ||
exts := []string{".yaml", ".yml"} | ||
yamlFiles := listFiles(paths, exts) | ||
assert.Equal(t, 2, len(yamlFiles)) | ||
assert.Contains(t, yamlFiles, "testdata/sim/model/input/data/model.yaml") | ||
assert.Contains(t, yamlFiles, "testdata/sim/model/input/data/signalgroup.yaml") | ||
} |
59 changes: 59 additions & 0 deletions
59
extra/tools/simer/internal/app/simer/testdata/sim/data/simulation.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
kind: Stack | ||
metadata: | ||
name: default | ||
spec: | ||
connection: | ||
transport: | ||
redis: | ||
timeout: 60 | ||
uri: redis://localhost:6379 | ||
models: | ||
- channels: | ||
- expectedModelCount: 2 | ||
name: physical | ||
- expectedModelCount: 1 | ||
name: network | ||
model: | ||
name: simbus | ||
name: simbus | ||
uid: 0 | ||
- channels: | ||
- alias: scalar_channel | ||
name: physical | ||
selectors: | ||
channel: scalar_vector | ||
model: input | ||
model: | ||
name: dse.modelc.csv | ||
name: input | ||
runtime: | ||
env: | ||
CSV_FILE: model/input/data/input.csv | ||
paths: | ||
- model/input/data | ||
uid: 1 | ||
- channels: | ||
- alias: scalar_channel | ||
name: physical | ||
selectors: | ||
channel: scalar_vector | ||
model: linear | ||
- alias: network_channel | ||
name: network | ||
selectors: | ||
channel: network_vector | ||
model: linear | ||
model: | ||
name: dse.fmi.mcl | ||
name: linear | ||
runtime: | ||
env: {} | ||
paths: | ||
- model/linear/data | ||
uid: 2 | ||
--- | ||
kind: Model | ||
metadata: | ||
name: simbus | ||
spec: {} |
5 changes: 5 additions & 0 deletions
5
extra/tools/simer/internal/app/simer/testdata/sim/model/input/data/input.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Timestamp;input;factor;offset | ||
0.0000;1.0;2.0;3.0 | ||
0.0005;-1.1;2.1;3.1 | ||
0.0010;1.2;-2.2;3.2 | ||
0.0015;1.3;2.3;-3.3 |
27 changes: 27 additions & 0 deletions
27
extra/tools/simer/internal/app/simer/testdata/sim/model/input/data/model.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2024 Robert Bosch GmbH | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
kind: Model | ||
metadata: | ||
name: Csv | ||
spec: | ||
runtime: | ||
dynlib: | ||
- os: linux | ||
arch: amd64 | ||
path: sim/model/input/lib/libcsv.so | ||
- os: linux | ||
arch: x86 | ||
path: sim/model/input/lib/libcsv.so | ||
- os: windows | ||
arch: x64 | ||
path: sim/model/input/lib/libcsv.dll | ||
- os: windows | ||
arch: x86 | ||
path: sim/model/input/lib/libcsv.dll | ||
channels: | ||
- alias: scalar | ||
selectors: | ||
channel: scalar_channel |
12 changes: 12 additions & 0 deletions
12
extra/tools/simer/internal/app/simer/testdata/sim/model/input/data/signalgroup.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
kind: SignalGroup | ||
metadata: | ||
name: scalar_channel | ||
labels: | ||
model: input | ||
channel: signal_vector | ||
spec: | ||
signals: | ||
- signal: input | ||
- signal: factor | ||
- signal: offset |
5 changes: 5 additions & 0 deletions
5
extra/tools/simer/internal/app/simer/testdata/sim/model/input/data/valueset.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Timestamp;A;B;C | ||
0.0000;1.0;2.0;3.0 | ||
0.0005;-1.1;2.1;3.1 | ||
0.0010;1.2;-2.2;3.2 | ||
0.0015;1.3;2.3;-3.3 |
26 changes: 26 additions & 0 deletions
26
extra/tools/simer/internal/app/simer/testdata/sim/model/linear/data/model.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
kind: Model | ||
metadata: | ||
annotations: | ||
fmi_guid: '{71da084a-0998-4418-a29d-01af36a32568}' | ||
fmi_model_cosim: "true" | ||
fmi_model_version: "" | ||
fmi_resource_dir: model/linear/linear_fmu/resources | ||
fmi_stepsize: "0.0005" | ||
mcl_adapter: fmi | ||
mcl_version: "2.0" | ||
name: linear | ||
spec: | ||
channels: | ||
- alias: signal_channel | ||
selectors: | ||
channel: signal_vector | ||
model: linear | ||
runtime: | ||
dynlib: | ||
- arch: amd64 | ||
os: linux | ||
path: model/linear/lib/libfmimcl.so | ||
mcl: | ||
- arch: amd64 | ||
os: linux | ||
path: model/linear/linear_fmu/binaries/linux64/fmu2linear.so |
33 changes: 33 additions & 0 deletions
33
extra/tools/simer/internal/app/simer/testdata/sim/model/linear/data/signalgroup.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
kind: SignalGroup | ||
metadata: | ||
labels: | ||
channel: signal_vector | ||
model: linear | ||
name: linear | ||
spec: | ||
signals: | ||
- annotations: | ||
fmi_variable_causality: input | ||
fmi_variable_name: input | ||
fmi_variable_type: Real | ||
fmi_variable_vref: "1" | ||
signal: input | ||
- annotations: | ||
fmi_variable_causality: input | ||
fmi_variable_name: factor | ||
fmi_variable_type: Real | ||
fmi_variable_vref: "2" | ||
signal: factor | ||
- annotations: | ||
fmi_variable_causality: input | ||
fmi_variable_name: offset | ||
fmi_variable_type: Real | ||
fmi_variable_vref: "3" | ||
signal: offset | ||
- annotations: | ||
fmi_variable_causality: output | ||
fmi_variable_name: output | ||
fmi_variable_type: Real | ||
fmi_variable_vref: "4" | ||
signal: output |