Commit Graph

150 Commits

Author SHA1 Message Date
Noel Graf
9a1652af76 fix(nc): Handling of symbolic names during data type generation. 2024-01-12 08:30:21 +01:00
Stefan Profanter
73c5bff7cc
fix(build): Use #!/usr/bin/env python3 instead of #!/usr/bin/env python (#4862)
The newer Ubuntu since 20.04 do not have the `python` binary.
There one explicitly needs to choose between `python2` or `python3`.

See also:
https://askubuntu.com/q/1296790/141958
2021-12-20 12:09:38 +01:00
Stefan Profanter
08acd2d0ab fix(datatype-generator): Cleaning up the NAMESPACE_MAP setting to also inherit it if DEPENDS is used 2020-10-02 17:39:18 +02:00
Stefan Profanter
8103c27992 fix(nodeset-compiler): Use correct namespace mapping to fix ExtensionObject initialization
This also introduces a breaking change as it is now necessary to use the `NAMESPACE_MAP` parameter for the CMake macro, instead of the `NAMESPACE_IDX`.

Up to now, complex extension objects initialized in the nodeset were not correctly set, especially if a data type from an dependent nodeset was used.
2020-10-02 08:36:05 +02:00
Ari
916653022b Refactor generate_datatypes (#3138)
* Move generate_datatypes

* Move generate_datatypes

* Refactor datatypes

* Fix Codacy errors in backend

* Fix Codacy errors in parser
2019-10-22 15:22:14 +02:00
Stefan Profanter
6418309cf5 DatatypeGenerator: Allow to import additional types as dependency
Fixes #2896

Exemplary call for GDS:

```
    # Generate types and namespace for GDS
    ua_generate_datatypes(
        NAME "types_gds"
        TARGET_SUFFIX "types-gds"
        NAMESPACE_IDX 0
        FILE_CSV "${FILE_NS_DIRPREFIX}/GDS/OpcUaGdsModel.csv"
        FILES_BSD "${FILE_NS_DIRPREFIX}/GDS/Opc.Ua.Gds.Types.bsd"
        IMPORT_BSD "UA_TYPES#${FILE_NS_DIRPREFIX}/Schema/Opc.Ua.Types.bsd"
    )
```
2019-07-23 12:26:26 +02:00
Stefan Profanter
63f3653ff1 Additional header cleanup and consistent name of ns generated files 2019-03-21 20:16:31 +01:00
Julius Pfrommer
c9c818868f Move header files to a more unix-like structure
This commit drops the 'ua_' prefix and changes the public includes
to the form `#include <open62541/server.h>` instead of the old
`#include <ua_server.h>`
2019-03-21 20:16:31 +01:00
Stefan Profanter
8c77bf35d5 DatatypeGenerator: Check for valid node id in csv
If there's a type definition in the .bsd file, but there is no corresponding
entry in the .csv, then the old code silently set the type id to NODEID_NULL.

This will then cause the server to fail on a later stage. To avoid this,
the datatype generator should check this immediately and inform the user.
2019-02-27 11:43:53 +01:00
Jojakim Stahl
3fea4d8090 Review: Added custom opaque type mappings (#2433)
* Added custom opaque type mappings via --opaque-map option parameter to generate_datatypes.py

* Removed unused import
2019-02-15 12:00:15 +11:00
Sumedha Widyadharma
2cc5475a22 Fix membership test to be more pythonic in datatype generator 2019-02-07 11:06:25 +01:00
Sumedha Widyadharma
a4f7e9d984 Remove unnecessary backslashes in datatype generator 2019-02-07 11:06:25 +01:00
Sumedha Widyadharma
e11f3b13ce Whitespace cleanup in datatype generator 2019-02-07 11:06:25 +01:00
Sumedha Widyadharma
7ef2d099e1 Replace explicit counter with enumerate() in datatype generator 2019-02-07 11:06:25 +01:00
Sumedha Widyadharma
97a41e2171 Whitespace fix in datatype generator 2019-02-07 11:06:25 +01:00
Sumedha Widyadharma
702d583588 Remove dead code in datatype generator 2019-02-07 11:06:25 +01:00
Sumedha Widyadharma
d9f740da06 Remove unused index variable in datatype generator 2019-02-07 11:06:25 +01:00
Julius Pfrommer
c75efc25cb Stack: Tag DataTypes with a "kind" for explicit dispatch in jumptables 2019-02-02 21:45:20 +01:00
Stefan Profanter
a066163a36 DatatypeGenerator: Also build types which have 'Test' in Name
Fixes #2398
2019-01-31 13:46:12 +01:00
Stefan Profanter
36641ad6a5
cmake: Remove UA_NO_AMALGAMATION and use UA_ENABLE_AMALGAMATION instead
Since default build is without amalgamation, we should assume that and only
ifdefs is amalgamation is enabled
2018-12-19 01:59:38 +01:00
Sumedha Widyadharma
12747742ba Use the index provided by enumerate 2018-12-06 23:40:12 +01:00
Sumedha Widyadharma
d92eca0005 Remove trailing semicolon 2018-12-06 23:40:12 +01:00
Stefan Profanter
81148ab1eb Fix various python code quality issues
See also https://lgtm.com/projects/g/open62541/open62541/alerts
2018-11-28 16:12:12 +01:00
Martin Lang
df58cf8f36 Prepare python script for usage of define UA_INTERNAL_FUNC_ATTR_WARN_UNUSED_RESULT
Only the inserted dataTypes in list whitelistFuncAttrWarnUnusedResult will be generated with the define UA_INTERNAL_FUNC_ATTR_WARN_UNUSED_RESULT in front of the function declaration.
2018-11-22 21:50:22 +01:00
Julius Pfrommer
17d4a6b908 Stack: Add _clear as a shorter alternative to _deleteMembers
_deleteMembers is so common that we cannot deprecate it. Possibly after
the 0.4 release cycle.
2018-11-17 22:57:25 +01:00
Stefan Profanter
300257c307 Reduce line length of generated datatype code. Fixes #2104 2018-10-30 18:11:26 +01:00
Stefan Profanter
e2d4b0bf03
Merge pull request #2085 from open62541/runtime_custom_types
Custom types at runtime
2018-10-23 10:21:16 +02:00
Stefan Profanter
8f6761686b Correctly handle datatypes with string NodeIds 2018-10-22 17:35:35 +02:00
Julius Pfrommer
49e0a0bb1e Types: Add UA_DataTypeArray as a linked list for client/server 2018-09-28 17:09:22 +02:00
mtenberge
bff2010449 [Review] Fix/cleanup unsafe c names (#2064)
* Escape quotes in (Expanded)NodeIds

(but only if they are not already escaped). Node ID strings are allowed
to contain quotation marks (encoded as &quot; in XML), but they mess up
the generated C strings.

* Strip non-alnum chars from C identifiers

The names of dataTypeNodes may contain unsafe characters, which leads to
invalid C code if they end up in the generated code

* Use C-safe type names for code generation

OPC-UA type names may contain special characters, such as quotes, dots,
spaces etc. They should not end up in the generated code.

* Fix quote-escaping in makeCLiteral and splitStringLiterals

* Re-use makeCLiteral from ..._datatypes

* Separate makeCLiteral and makeCIdentifier
2018-09-19 18:29:49 +02:00
Mark Giraud
12962880f7 deleteMembers now always memsets to 0 2018-08-20 14:46:34 +02:00
zanettea
6d96066155 NodesetGenerator: CharArray is now considered as String (#1974) 2018-08-14 13:54:44 +00:00
Julius Pfrommer
c4217b44e2 Use macro shortcuts for extern "C" declarations in the public API 2018-08-04 16:42:26 +00:00
Julius Pfrommer
a1d520317f Use specific encoding functions for all builtin types
This removes "hacks" for special cases that reduced the binary size a
bit. But this turned out to be problematic when adding JSON encoding.
2018-05-07 22:31:00 +02:00
Julius Pfrommer
426559fa8b simplify generate_datatypes 2018-05-07 22:31:00 +02:00
Julius Pfrommer
bb57e4e5f9 Generated type member descriptions start with upper case 2018-05-07 22:31:00 +02:00
Julius Pfrommer
97a284465a Prepare fine-grained generation of datatype descriptions 2018-04-26 16:02:35 +02:00
Julius Pfrommer
b21808aac1 Always generate opaque types 2018-04-02 01:37:12 +02:00
Julius Pfrommer
12ca35901f simplify the signature for _calcSizeBinary 2018-03-27 06:47:01 +02:00
Stefan Profanter
0568c56d0a
Merge remote-tracking branch 'upstream/0.3' into master_03_merge 2018-03-22 22:56:58 +01:00
Stefan Profanter
fb64f4a9bb Various fixes for doc generation 2018-03-22 17:14:04 +01:00
Julius Pfrommer
0d856f97c1 generate calcSizeBinary for all types 2018-03-22 13:09:02 +01:00
Julius Pfrommer
ef02e88fae simplify generated encoding API 2018-03-22 13:09:02 +01:00
Jose Cabral
9ca5403d47 Add missing ifdef for compiling namespace externally 2018-03-15 09:31:30 +01:00
Jose Cabral
a6b99dc057 Add missing ifdef for compiling namespace externally 2018-03-06 15:48:58 +01:00
StalderT
c586ad73f5 fix nodesetcompiler for cpplint 2018-02-05 22:41:09 +01:00
StalderT
7332a100ee remove unneeded whitespaces (#1552)
* remove unneeded whitespaces

* fix generate_datatypes.py
2018-01-26 14:12:36 +01:00
StalderT
4330edc8f4 be more compliant fix #1362 (fix NS Compiler for opaque type) (#1405)
* be more compliant

* Generates the correct dataType for nodes with an opaque dataType

* don't generate dataType for opaque dataType

* fix UA_TYPES_COUNT

* force valueRank = -1 for scalar VariableNode

* new implementation

* remove iter_opaque_types

* force rebuild
2018-01-17 21:15:15 +01:00
Julius Pfrommer
c4c2c6f316 set executable bit on python scripts 2018-01-06 10:40:42 +01:00
Stefan Profanter
b9346bac3d Fix #1180 ensure enums are 32bit integers
If that's not the case, the error during compile time will be similar to
`error: named bit-field 'static_assertion_failed_enum_must_be_32bit' has zero width`
2017-10-29 16:00:00 +01:00