openMSL / sl-1-0-sensor-model-repository-template

Template repository: Clone and build your ASAM OSI sensor model.
Mozilla Public License 2.0
9 stars 2 forks source link

Separate OSMP and model #42

Closed ClemensLinnhoff closed 1 year ago

ClemensLinnhoff commented 1 year ago

Reference to a related issue in the repository

41

Add a description Split OSMP and model to have a separation between packaging and model logic. This also entails a clean separation of licenses, as the model logic can have a different license from the OSMP (which is licensed under MPL-2.0).

Take this checklist as orientation for yourself, if this PR is ready for Maintainer Review

github-actions[bot] commented 1 year ago

:speech_balloon: Output from clang-tidy

src/MySensorModel.cpp
/src/MySensorModel.cpp:85:85: warning: [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] > 2.0 is a magic number; consider replacing it with a named constant

```cpp obj->mutable_header()->set_existence_probability(cos((2.0 * distance - actual_range) / actual_range)); ^ ```

/src/MySensorModel.cpp:151:13: warning: [cppcoreguidelines-pro-bounds-constant-array-index] > do not use array subscript when the index is not an integer constant expression

```cpp matrix_trans[j][i] = matrix_in[i][j]; ^ ```

/src/MySensorModel.cpp:151:34: warning: [cppcoreguidelines-pro-bounds-constant-array-index] > do not use array subscript when the index is not an integer constant expression

```cpp matrix_trans[j][i] = matrix_in[i][j]; ^ ```


src/OSMP.cpp
/src/OSMP.cpp:60:5: warning: [cppcoreguidelines-pro-type-member-init] > uninitialized record type: 'myaddr'

```cpp union Addrconv ^ ```

/src/OSMP.cpp:69:12: warning: [cppcoreguidelines-pro-type-union-access] > do not access members of unions; use (boost::)variant instead

```cpp myaddr.base.lo = lo; ^ ```

/src/OSMP.cpp:70:12: warning: [cppcoreguidelines-pro-type-union-access] > do not access members of unions; use (boost::)variant instead

```cpp myaddr.base.hi = hi; ^ ```

/src/OSMP.cpp:71:12: warning: [cppcoreguidelines-pro-type-reinterpret-cast] > do not use reinterpret_cast

```cpp return reinterpret_cast(myaddr.address); ^ ```

/src/OSMP.cpp:71:43: warning: [cppcoreguidelines-pro-type-union-access] > do not access members of unions; use (boost::)variant instead

```cpp return reinterpret_cast(myaddr.address); ^ ```

/src/OSMP.cpp:82:5: warning: [cppcoreguidelines-pro-type-member-init] > uninitialized record type: 'myaddr'

```cpp union Addrconv ^ ```

/src/OSMP.cpp:91:12: warning: [cppcoreguidelines-pro-type-union-access] > do not access members of unions; use (boost::)variant instead

```cpp myaddr.address = reinterpret_cast(ptr); ^ ```

/src/OSMP.cpp:91:22: warning: [cppcoreguidelines-pro-type-reinterpret-cast] > do not use reinterpret_cast

```cpp myaddr.address = reinterpret_cast(ptr); ^ ```

/src/OSMP.cpp:92:17: warning: [cppcoreguidelines-pro-type-union-access] > do not access members of unions; use (boost::)variant instead

```cpp hi = myaddr.base.hi; ^ ```

/src/OSMP.cpp:93:17: warning: [cppcoreguidelines-pro-type-union-access] > do not access members of unions; use (boost::)variant instead

```cpp lo = myaddr.base.lo; ^ ```

/src/OSMP.cpp:231:18: warning: [readability-convert-member-functions-to-static] > method 'DoStart' can be made static

```cpp fmi2Status OSMP::DoStart(fmi2Boolean tolerance_defined, fmi2Real tolerance, fmi2Real start_time, fmi2Boolean stop_time_defined, fmi2Real stop_time) ^ ```

/src/OSMP.cpp:236:18: warning: [readability-convert-member-functions-to-static] > method 'DoEnterInitializationMode' can be made static

```cpp fmi2Status OSMP::DoEnterInitializationMode() ^ ```

/src/OSMP.cpp:295:18: warning: [readability-convert-member-functions-to-static] > method 'DoTerm' can be made static

```cpp fmi2Status OSMP::DoTerm() ^ ```

/src/OSMP.cpp:306:1: warning: [cppcoreguidelines-pro-type-member-init] > constructor does not initialize these fields: boolean_vars_, integer_vars_, real_vars_, my_sensor_model_

```cpp OSMP::OSMP(fmi2String theinstance_name, ^ ```

/src/OSMP.cpp:466:24: warning: [cppcoreguidelines-pro-bounds-constant-array-index] > do not use array subscript when the index is not an integer constant expression

```cpp value[i] = real_vars_[vr[i]]; ^ ```

/src/OSMP.cpp:490:24: warning: [cppcoreguidelines-pro-bounds-constant-array-index] > do not use array subscript when the index is not an integer constant expression

```cpp value[i] = integer_vars_[vr[i]]; ^ ```

/src/OSMP.cpp:507:24: warning: [cppcoreguidelines-pro-bounds-constant-array-index] > do not use array subscript when the index is not an integer constant expression

```cpp value[i] = boolean_vars_[vr[i]]; ^ ```

/src/OSMP.cpp:524:24: warning: [cppcoreguidelines-pro-bounds-constant-array-index] > do not use array subscript when the index is not an integer constant expression

```cpp value[i] = string_vars_[vr[i]].c_str(); ^ ```

/src/OSMP.cpp:541:13: warning: [cppcoreguidelines-pro-bounds-constant-array-index] > do not use array subscript when the index is not an integer constant expression

```cpp real_vars_[vr[i]] = value[i]; ^ ```

/src/OSMP.cpp:558:13: warning: [cppcoreguidelines-pro-bounds-constant-array-index] > do not use array subscript when the index is not an integer constant expression

```cpp integer_vars_[vr[i]] = value[i]; ^ ```

/src/OSMP.cpp:575:13: warning: [cppcoreguidelines-pro-bounds-constant-array-index] > do not use array subscript when the index is not an integer constant expression

```cpp boolean_vars_[vr[i]] = value[i]; ^ ```

/src/OSMP.cpp:592:13: warning: [cppcoreguidelines-pro-bounds-constant-array-index] > do not use array subscript when the index is not an integer constant expression

```cpp string_vars_[vr[i]] = value[i]; ^ ```