Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A basic implementation of fully compliant GMS machine type #783

Merged
merged 12 commits into from
Jun 28, 2022

Conversation

mindonwarp
Copy link
Contributor

I needed an example of how to create a GMS compliant machine so I ended up using my free time to create an example myself.
There is still work to do but I wanted to share this with others who might have need of it.

Please note that I have never worked with this and all I did was mostly done by looking at how the existing code works and by deciphering compiler and debugger error messages.

I hope this implementation is at least correct enough to serve as a base for a better implementation.

@CLAassistant
Copy link

CLAassistant commented Jun 4, 2022

CLA assistant check
All committers have signed the CLA.

@GoetzGoerisch GoetzGoerisch added the enhancement New feature or request label Jun 6, 2022
Copy link
Member

@GoetzGoerisch GoetzGoerisch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mindonwarp for your PR:
I have left a few comments inline. From the technical side, a further expert is going to review.

Looking forward to get this merged.

GMS/FullGMS.cpp Outdated Show resolved Hide resolved
.clang-format Outdated Show resolved Hide resolved
GMS/FullGMS.hpp Outdated Show resolved Hide resolved
GMS/InstantiatedGMS.cpp Outdated Show resolved Hide resolved
GMS/InstantiatedGMS.hpp Outdated Show resolved Hide resolved
TypeDefinition/ns0/DiscreteItem.hpp Outdated Show resolved Hide resolved
TypeDefinition/ns0/MultiStateDiscreteType.hpp Outdated Show resolved Hide resolved
UmatiServerLib/BindVariable.hpp Show resolved Hide resolved
UmatiServerLib/ConvertSimpleValue.cpp Show resolved Hide resolved
UmatiServerLib/ConvertSimpleValue.hpp Show resolved Hide resolved
mindonwarp added a commit to mindonwarp/Sample-Server that referenced this pull request Jun 7, 2022
Copy link
Member

@Kantiran91 Kantiran91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,

thank you for your contribution. It looks very good. I have some smaller ideas.
Also I think the umatiLib part should be reviewed by @ccvca.

Thank you
Sebastian Friedl

GMS/FullGMS.cpp Outdated Show resolved Hide resolved
GMS/FullGMS.cpp Outdated Show resolved Hide resolved
GMS/FullGMS.cpp Outdated Show resolved Hide resolved
TypeDefinition/GMS/GMSSensor.hpp Outdated Show resolved Hide resolved
@@ -114,8 +116,8 @@ class BindVariable {
if constexpr (std::is_enum<T>::value) {
return getToVariantFuncForEnumArray(value);
} else if constexpr (
std::is_class<T>::value &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ccvca : Can you look at this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be necessary, as LocalizedText is handled as a structured data type.

Copy link
Contributor Author

@mindonwarp mindonwarp Jun 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this the compiler spits out an error message: "error C3861: 'bindStructReflArray': identifier not found" while resolving a binding for a std::vector<LocalizedText_t>. The bindStructReflArray gets called inside the bindStructuredValueByPathArray method. What am I doing wrong? @ccvca

@GoetzGoerisch GoetzGoerisch requested a review from ccvca June 8, 2022 07:23
}
UA_Variant_setArray(dst, tmp, pVariable->size(), &UA_TYPES[UA_TYPES_LOCALIZEDTEXT]);
};
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library treats LocalizedText as a StructuredDataType, so it's not a "SimpleValue".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no match for a std::vector<LocalizedText_t> though. Where should this be handled? @ccvca

UmatiServerLib/ConvertSimpleValue.cpp Outdated Show resolved Hide resolved
UmatiServerLib/ConvertSimpleValue.cpp Outdated Show resolved Hide resolved
UmatiServerLib/ConvertSimpleValue.cpp Show resolved Hide resolved
@@ -114,8 +116,8 @@ class BindVariable {
if constexpr (std::is_enum<T>::value) {
return getToVariantFuncForEnumArray(value);
} else if constexpr (
std::is_class<T>::value &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be necessary, as LocalizedText is handled as a structured data type.

Copy link
Member

@GoetzGoerisch GoetzGoerisch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Alen for your contribution and the changes.

Please resolve the review comments from @Kantiran91 and @ccvca and fix the linter errors and rebase the branch to develop.

Merging when finished!

@mindonwarp
Copy link
Contributor Author

Thank you Alen for your contribution and the changes.

Please resolve the review comments from @Kantiran91 and @ccvca and fix the linter errors and rebase the branch to develop.

Merging when finished!

Hi @GoetzGoerisch, thank you. It will have to wait until this evening since I can only do it on my free time.

GoetzGoerisch pushed a commit that referenced this pull request Jun 8, 2022
@mindonwarp
Copy link
Contributor Author

The linter is complaining about "clang_format" and I can't find any issues in the code. Could it be a glitch? Maybe rerun the linter?

mindonwarp added a commit to mindonwarp/Sample-Server that referenced this pull request Jun 9, 2022
@GoetzGoerisch
Copy link
Member

GoetzGoerisch commented Jun 10, 2022

The linter is complaining about "clang_format" and I can't find any issues in the code. Could it be a glitch? Maybe rerun the linter?

Fixed in my commit, please incorporate this into the correct commits.

mindonwarp added a commit to mindonwarp/Sample-Server that referenced this pull request Jun 10, 2022
Copy link
Member

@Kantiran91 Kantiran91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my side the PR is okay.
The issue with the axis is a problem with the standard and should be fix there first.

mindonwarp added a commit to mindonwarp/Sample-Server that referenced this pull request Jun 13, 2022
mindonwarp added a commit to mindonwarp/Sample-Server that referenced this pull request Jun 13, 2022
mindonwarp added a commit to mindonwarp/Sample-Server that referenced this pull request Jun 15, 2022
mindonwarp added a commit to mindonwarp/Sample-Server that referenced this pull request Jun 17, 2022
@GoetzGoerisch
Copy link
Member

Just a side note: With the release of GMS 1.0 the open62541 PR should be taken into account:
open62541/open62541#5211

mindonwarp added a commit to mindonwarp/Sample-Server that referenced this pull request Jun 21, 2022
mindonwarp added a commit to mindonwarp/Sample-Server that referenced this pull request Jun 21, 2022
mindonwarp added a commit to mindonwarp/Sample-Server that referenced this pull request Jun 23, 2022
@GoetzGoerisch
Copy link
Member

@ccvca could you please to get this ready for merge?

@GoetzGoerisch
Copy link
Member

@mindonwarp after speaking with @ccvca we would merge as is, but Christian has to do some architecture adaptation afterwards due to the open discussions?

Agreed?

@mindonwarp
Copy link
Contributor Author

@mindonwarp after speaking with @ccvca we would merge as is, but Christian has to do some architecture adaptation afterwards due to the open discussions?

Agreed?

I'm definitely ok with that. 👍

GoetzGoerisch pushed a commit to mindonwarp/Sample-Server that referenced this pull request Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants