You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2022/02/25 12:26:47 UTC

[plc4x] 02/04: feat(codegen): Fixed an issue in the C# code gent

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/cleaned-up-type-references
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit b080c8783ac61ab8b1712b3d22d8a79b9be77521
Author: cdutz <ch...@c-ware.de>
AuthorDate: Fri Feb 25 13:25:28 2022 +0100

    feat(codegen): Fixed an issue in the C# code gent
---
 plc4c/generated-sources/modbus/src/data_item.c     | 13 ------------
 plc4c/generated-sources/s7/src/data_item.c         | 23 ----------------------
 plc4go/internal/plc4go/ads/fieldtype_string.go     | 17 ++++++++++++++++
 plc4go/internal/plc4go/modbus/fieldtype_string.go  | 17 ++++++++++++++++
 plc4go/internal/plc4go/s7/fieldtype_string.go      | 17 ++++++++++++++++
 .../plc4go/spi/testutils/steptype_string.go        | 17 ++++++++++++++++
 6 files changed, 68 insertions(+), 36 deletions(-)

diff --git a/plc4c/generated-sources/modbus/src/data_item.c b/plc4c/generated-sources/modbus/src/data_item.c
index 26a97db..adb08c9 100644
--- a/plc4c/generated-sources/modbus/src/data_item.c
+++ b/plc4c/generated-sources/modbus/src/data_item.c
@@ -55,7 +55,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_bool_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_BOOL) { /* List */
@@ -225,7 +224,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_int8_t_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_SINT) { /* List */
@@ -255,7 +253,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_int16_t_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_INT) { /* List */
@@ -285,7 +282,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_int32_t_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_DINT) { /* List */
@@ -315,7 +311,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_int64_t_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_LINT) { /* List */
@@ -357,7 +352,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint8_t_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_USINT) { /* List */
@@ -387,7 +381,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint16_t_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_UINT) { /* List */
@@ -417,7 +410,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint32_t_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_UDINT) { /* List */
@@ -447,7 +439,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint64_t_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_ULINT) { /* List */
@@ -477,7 +468,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_float_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_REAL) { /* List */
@@ -507,7 +497,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_double_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_LREAL) { /* List */
@@ -537,7 +526,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint8_t_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_CHAR) { /* List */
@@ -567,7 +555,6 @@ plc4c_return_code plc4c_modbus_read_write_data_item_parse(plc4c_spi_read_buffer*
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint16_t_data(value);
 
     } else         if(dataType == plc4c_modbus_read_write_modbus_data_type_WCHAR) { /* List */
diff --git a/plc4c/generated-sources/s7/src/data_item.c b/plc4c/generated-sources/s7/src/data_item.c
index 25aa858..9a5a254 100644
--- a/plc4c/generated-sources/s7/src/data_item.c
+++ b/plc4c/generated-sources/s7/src/data_item.c
@@ -55,7 +55,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_bool_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_BYTE") == 0) { /* List */
@@ -139,7 +138,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_int8_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_USINT") == 0) { /* USINT */
@@ -151,7 +149,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint8_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_INT") == 0) { /* INT */
@@ -163,7 +160,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_int16_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_UINT") == 0) { /* UINT */
@@ -175,7 +171,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint16_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_DINT") == 0) { /* DINT */
@@ -187,7 +182,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_int32_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_UDINT") == 0) { /* UDINT */
@@ -199,7 +193,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint32_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_LINT") == 0) { /* LINT */
@@ -211,7 +204,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_int64_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_ULINT") == 0) { /* ULINT */
@@ -223,7 +215,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint64_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_REAL") == 0) { /* REAL */
@@ -235,7 +226,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_float_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_LREAL") == 0) { /* LREAL */
@@ -247,7 +237,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_double_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_CHAR") == 0) { /* CHAR */
@@ -287,7 +276,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint32_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_LTIME") == 0) { /* LTIME */
@@ -299,7 +287,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint64_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_DATE") == 0) { /* DATE */
@@ -311,7 +298,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint16_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_TIME_OF_DAY") == 0) { /* TIME_OF_DAY */
@@ -323,7 +309,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint32_t_data(value);
 
     } else         if(strcmp(dataProtocolId, "IEC61131_DATE_AND_TIME") == 0) { /* DATE_AND_TIME */
@@ -335,7 +320,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint16_t_data(year);
 
 
@@ -346,7 +330,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint8_t_data(month);
 
 
@@ -357,7 +340,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint8_t_data(day);
 
 
@@ -368,7 +350,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint8_t_data(dayOfWeek);
 
 
@@ -379,7 +360,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint8_t_data(hour);
 
 
@@ -390,7 +370,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint8_t_data(minutes);
 
 
@@ -401,7 +380,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint8_t_data(seconds);
 
 
@@ -412,7 +390,6 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4c_spi_read_buffer* rea
                     return _res;
                 }
 
-                    // Hurz
                 *data_item = plc4c_data_create_uint32_t_data(nanos);
 
     }
diff --git a/plc4go/internal/plc4go/ads/fieldtype_string.go b/plc4go/internal/plc4go/ads/fieldtype_string.go
index 6c2fa73..4b0da39 100644
--- a/plc4go/internal/plc4go/ads/fieldtype_string.go
+++ b/plc4go/internal/plc4go/ads/fieldtype_string.go
@@ -1,3 +1,20 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
 // Code generated by "stringer -type FieldType"; DO NOT EDIT.
 
 package ads
diff --git a/plc4go/internal/plc4go/modbus/fieldtype_string.go b/plc4go/internal/plc4go/modbus/fieldtype_string.go
index 4ef728b..ec3ec50 100644
--- a/plc4go/internal/plc4go/modbus/fieldtype_string.go
+++ b/plc4go/internal/plc4go/modbus/fieldtype_string.go
@@ -1,3 +1,20 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
 // Code generated by "stringer -type FieldType"; DO NOT EDIT.
 
 package modbus
diff --git a/plc4go/internal/plc4go/s7/fieldtype_string.go b/plc4go/internal/plc4go/s7/fieldtype_string.go
index 02ae83f..3045fc1 100644
--- a/plc4go/internal/plc4go/s7/fieldtype_string.go
+++ b/plc4go/internal/plc4go/s7/fieldtype_string.go
@@ -1,3 +1,20 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
 // Code generated by "stringer -type FieldType"; DO NOT EDIT.
 
 package s7
diff --git a/plc4go/internal/plc4go/spi/testutils/steptype_string.go b/plc4go/internal/plc4go/spi/testutils/steptype_string.go
index 8506728..c99ce3e 100644
--- a/plc4go/internal/plc4go/spi/testutils/steptype_string.go
+++ b/plc4go/internal/plc4go/spi/testutils/steptype_string.go
@@ -1,3 +1,20 @@
+// Licensed to Apache Software Foundation (ASF) under one or more contributor
+// license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright
+// ownership. Apache Software Foundation (ASF) licenses this file to you under
+// the Apache License, Version 2.0 (the "License"); you may
+// not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
 // Code generated by "stringer -type StepType"; DO NOT EDIT.
 
 package testutils