From 55f6c08aa9aebc8ee1d3930ad9393d234252d95c Mon Sep 17 00:00:00 2001 From: IX-BOT <137874481+IX-BOT@users.noreply.github.com> Date: Fri, 24 Nov 2023 19:59:21 +0100 Subject: [PATCH] [NEW-FEATURE] Update to sld v2.0.5 (#264) * Create draft PR for #263 * [wip] taking s7 pragmas into account when compiling twins * adds missing accessibility pragmas * [wip] adds possiblity to ignore s7 pragmas for TIA2AX scenario * additions to documentation * mend --------- Co-authored-by: PTKu Co-authored-by: Peter <61538034+PTKu@users.noreply.github.com> --- GitVersion.yml | 2 +- README.md | 1 + docfx/articles/compiler/ADDED_MEMBERS.md | 4 + docfx/articles/compiler/ATTRIBUTES.md | 7 +- docfx/articles/compiler/README.md | 12 +- docfx/articles/connectors/WebAPI.md | 3 + .../ax-blazor-example/AXSharp.config.json | 2 +- .../sandbox/ax-blazor-example/apax-lock.json | 472 ++---- .../tests/sandbox/ax-blazor-example/apax.yml | 11 +- .../sandbox/ax-blazor-example/src/CU00x.st | 2 + .../ax-blazor-example/src/GroupBox_other.st | 1 + .../sandbox/ax-blazor-example/src/MAIN.st | 1 + .../ax-blazor-example/src/TcoVortexObject.st | 1 + .../ax-blazor-example/src/TestEmpty.st | 1 + .../src/TestLayoutOverwriting.st | 1 + .../ax-blazor-example/src/TestMixed.st | 1 + .../src/TestMultipleLayouts.st | 1 + .../ax-blazor-example/src/TestSimple.st | 1 + .../ax-blazor-example/src/TestSimpleNested.st | 1 + .../ax-blazor-example/src/TestStruct.st | 1 + .../src/TestStructMultipleGroups.st | 1 + .../src/TestStructOneGroupWithLayout.st | 1 + .../src/TestStructWithMainLayout.st | 1 + .../src/TestWithoutLayouts.st | 1 + .../ax-blazor-example/src/VortexComponents.st | 1 + .../ax-blazor-example/src/configuration.st | 3 + .../src/fbWorldWeatherWatch.st | 1 + .../src/prgWeatherStations.st | 1 + .../sandbox/ax-blazor-example/src/stBlazor.st | 1 + .../ax-blazor-example/src/stComplex.st | 1 + .../ax-blazor-example/src/stComplexUnknown.st | 1 + .../ax-blazor-example/src/stExample.st | 1 + .../ax-blazor-example/src/stLayouts.st | 1 + .../src/stMultipleLayouts.st | 1 + .../src/stSimplePrimitive.st | 1 + .../sandbox/ax-blazor-example/src/stTest.st | 1 + .../sandbox/ax-blazor-example/src/stTest2.st | 1 + .../sandbox/ax-blazor-example/src/stTest3.st | 1 + .../ax-blazor-example/src/stTestComplex.st | 1 + .../ax-blazor-example/src/stTestLayouts.st | 1 + .../src/stTestMultipleNested.st | 1 + .../ax-blazor-example/src/stTestNested.st | 1 + .../ax-blazor-example/src/stTestPrimitive.st | 1 + .../src/stTestRenderIgnore.st | 1 + .../src/structWeatherStation.st | 1 + .../ax-blazor-example/src/testingProgram.st | 1 + .../sandbox/ax-blazor-example/test/test.st | 1 + .../ICompilerOptions.cs | 2 + .../src/AXSharp.Compiler/AXSharpConfig.cs | 5 +- .../src/AXSharp.Compiler/AXSharpProject.cs | 2 + .../AXSharp.Compiler/Core/ISourceBuilder.cs | 6 +- .../Core/eCommAccessibility.cs | 15 + .../Helpers/SemanticsHelpers.cs | 135 +- ...sOnlinerConfigurationConstructorBuilder.cs | 2 +- .../Onliner/CsOnlinerConstructorBuilder.cs | 2 +- .../Onliner/CsOnlinerMemberBuilder.cs | 4 +- .../CsOnlinerPlainerOnlineToPlainBuilder.cs | 28 +- .../CsOnlinerPlainerPlainToOnlineBuilder.cs | 37 +- .../CsOnlinerPlainerPlainToShadowBuilder.cs | 29 +- .../CsOnlinerPlainerShadowToPlainBuilder.cs | 26 +- .../Onliner/CsOnlinerSourceBuilder.cs | 19 + .../Plain/CsPlainSourceBuilder.cs | 17 +- .../Pragmas/PragmaExtensions.cs | 9 +- src/AXSharp.compiler/src/ixc/Options.cs | 4 + src/AXSharp.compiler/src/ixd/Options.cs | 2 + src/AXSharp.compiler/src/ixr/Options.cs | 2 +- .../AXSharp.Compiler.CsTests.csproj | 21 +- .../Cs/CsSourceBuilderTests.cs | 9 + .../expected/.g/Onliners/mixed_access.g.cs | 1383 +++++++++++++++++ .../units/expected/.g/POCO/mixed_access.g.cs | 57 + .../samples/units/src/array_declaration.st | 3 +- .../samples/units/src/class_all_primitives.st | 1 + .../units/src/class_extended_by_known_type.st | 2 + .../samples/units/src/class_extends.st | 2 + .../units/src/class_extends_and_implements.st | 2 + .../units/src/class_generic_extension.st | 5 +- .../samples/units/src/class_implements.st | 1 + .../units/src/class_implements_multiple.st | 1 + .../samples/units/src/class_internal.st | 1 + .../units/src/class_no_access_modifier.st | 1 + .../units/src/class_with_complex_members.st | 2 + .../src/class_with_non_public_members.st | 3 +- .../samples/units/src/class_with_pragmas.st | 2 + .../units/src/class_with_primitive_members.st | 1 + .../units/src/class_with_using_directives.st | 1 + .../units/src/compileromitsattribute.st | 12 +- .../samples/units/src/configuration.st | 41 +- .../samples/units/src/makereadonce.st | 3 +- .../samples/units/src/makereadonly.st | 3 +- .../samples/units/src/misc.st | 9 +- .../samples/units/src/mixed_access.st | 72 + .../samples/units/src/ref_to_simple.st | 4 +- .../samples/units/src/simple_empty_class.st | 3 +- .../simple_empty_class_within_namespace.st | 1 + .../samples/units/src/struct_simple.st | 2 + .../samples/units/src/type_named_values.st | 3 +- .../units/src/type_named_values_literals.st | 1 + .../samples/units/src/type_with_enum.st | 1 + .../units/src/types_with_name_attributes.st | 3 + .../src/types_with_property_attributes.st | 1 + .../samples/units/test/test.st | 1 + .../AXSharp.CompilerTests/IxProjectTests.cs | 2 + .../actual/app/AXSharp.config.json | 2 +- .../actual/app/src/configuration.st | 2 + .../tests/integration/actual/app/test/test.st | 1 + .../actual/lib1/AXSharp.config.json | 2 +- .../integration/actual/lib1/src/library.st | 2 +- .../integration/actual/lib1/test/test.st | 1 + .../actual/lib2/AXSharp.config.json | 2 +- .../integration/actual/lib2/src/library.st | 1 + .../integration/actual/lib2/test/test.st | 1 + .../tests/ax-test-project/AXSharp.config.json | 2 +- .../tests/ax-test-project/apax-lock.json | 29 +- .../tests/ax-test-project/apax.yml | 2 +- .../tests/ax-test-project/go.ps1 | 3 +- .../ax-test-project/src/complexArrayItem.st | 1 + .../src/complexArrayItemNested.st | 1 + .../ax-test-project/src/configuration.st | 38 +- .../ax-test-project/src/full_of_primitives.st | 1 + .../src/full_of_primitives_match.st | 1 + .../tests/ax-test-project/src/hierarchy.st | 1 + .../tests/ax-test-project/src/hierarchy_0.st | 1 + .../tests/ax-test-project/src/hierarchy_2.st | 1 + .../tests/ax-test-project/src/hierarchy_4.st | 1 + .../tests/ax-test-project/src/hierarchy_6.st | 1 + .../src/issues/GH-PKTu-ix_56.st | 12 +- .../AXSharp.config.json | 2 +- .../hello.world.console.plc.sln | 31 + .../src/configuration.st | 2 + .../Properties/launchSettings.json | 4 + .../ix-integration-plc/AXSharp.config.json | 2 +- .../ix-integration-plc/ix-integration-plc.sln | 25 + .../ix/Resources/PlcStringResources.resx | 26 +- .../ix-integration-plc/src/all_primitives.st | 1 + .../ix-integration-plc/src/compositeLayout.st | 1 + .../ix-integration-plc/src/configuration.st | 13 + .../ix-integration-plc/src/example.st | 1 + .../ix-integration-plc/src/geolocation.st | 1 + .../ix-integration-plc/src/ixcomponent.st | 3 + .../ix-integration-plc/src/measurement.st | 3 +- .../ix-integration-plc/src/monster.st | 6 +- .../ix-integration-plc/src/stacked/weather.st | 3 +- .../ix-integration-plc/src/tabbed/weather.st | 1 + .../ix-integration-plc/src/taskExample.st | 1 + .../ix-integration-plc/src/test/border.st | 3 +- .../ix-integration-plc/src/test/groupbox.st | 1 + .../src/test/test_primitive.st | 1 + .../ix-integration-plc/src/weather.st | 3 + .../ix-integration-plc/src/weatherBase.st | 3 +- .../ix-integration-plc/src/wrapped/weather.st | 1 + .../ix-integration-plc/test/test.st | 1 + .../integrated/src/ax/AXSharp.config.json | 2 +- .../integrated/src/ax/apax-lock.json | 29 +- .../integrated/src/ax/apax.yml | 5 +- .../integrated/src/ax/ax.sln | 25 + .../integrated/src/ax/src/configuration.st | 35 +- .../src/ax/src/dataswapping/all_primitives.st | 2 + .../src/ax/src/dataswapping/moster.st | 3 + .../src/ax/src/dataswapping/realmonster.st | 6 + .../src/ax/src/issues/GH_ISSUE_183.st | 1 + .../.g/Onliners/configuration.g.cs | 66 - .../.g/POCO/configuration.g.cs | 5 - 162 files changed, 2404 insertions(+), 584 deletions(-) create mode 100644 src/AXSharp.compiler/src/AXSharp.Compiler/Core/eCommAccessibility.cs create mode 100644 src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/mixed_access.g.cs create mode 100644 src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs create mode 100644 src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/mixed_access.st create mode 100644 src/AXSharp.examples/hello.world.console/hello.world.console.plc/hello.world.console.plc.sln create mode 100644 src/sanbox/integration/ix-integration-plc/ix-integration-plc.sln create mode 100644 src/tests.integrations/integrated/src/ax/ax.sln diff --git a/GitVersion.yml b/GitVersion.yml index 6973ffdf..79d4e845 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,5 +1,5 @@ mode: ContinuousDeployment -next-version: 0.17.0 +next-version: 0.18.0 branches: main: regex: ^master$|^main$ diff --git a/README.md b/README.md index 54d8d268..f97d32c4 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ In simple terms, the AX# takes the PLC program and translates the data structure ### Write PLC code ~~~iecst +{S7.extern=ReadWrite} {#ix-attr:[Container(Layout.Stack)]} {#ix-attr:[Group(Layout.GroupBox)]} {#ix-set:AttributeName = "Location"} diff --git a/docfx/articles/compiler/ADDED_MEMBERS.md b/docfx/articles/compiler/ADDED_MEMBERS.md index a1f21c67..70c202dd 100644 --- a/docfx/articles/compiler/ADDED_MEMBERS.md +++ b/docfx/articles/compiler/ADDED_MEMBERS.md @@ -14,6 +14,7 @@ Syntax Example ~~~iecst +{S7.extern=ReadWrite} {#ix-prop:public string Description} CLASS PUBLIC MyClass VAR PUBLIC @@ -49,6 +50,7 @@ CLASS_DECLARATION | STRUCTURED_TYPE_DECLARATION Example ~~~iecst +{S7.extern=ReadWrite} {#ix-prop:public string Description} {#ix-set:Description = "This is my classy description."} CLASS PUBLIC MyClass @@ -81,6 +83,7 @@ FIELD_DECLARATION | VARIABLE_DECLARATION ~~~ ~~~iecst +{S7.extern=ReadWrite} CLASS PUBLIC MyClass VAR PUBLIC {#ix-set:Description = "This is my nested classy description."} @@ -88,6 +91,7 @@ CLASS PUBLIC MyClass END_VAR END_CLASS +{S7.extern=ReadWrite} {#ix-prop:public string Description} CLASS PUBLIC MyNestedStructure END_CLASS diff --git a/docfx/articles/compiler/ATTRIBUTES.md b/docfx/articles/compiler/ATTRIBUTES.md index 71b26582..9ffdbed6 100644 --- a/docfx/articles/compiler/ATTRIBUTES.md +++ b/docfx/articles/compiler/ATTRIBUTES.md @@ -11,6 +11,7 @@ Syntax Example ~~~iecst +{S7.extern=ReadWrite} {#ix-attr:[Container(Layout.Wrap)]} (* Example of an attribute declared at type level. *) CLASS PUBLIC MyClass VAR PUBLIC @@ -35,7 +36,7 @@ ReadOnce attribute can be only applied to members (property, field), not type (C Example ~~~iecst - +{S7.extern=ReadWrite} CLASS PUBLIC MyClass VAR PUBLIC {#ix-attr:[ReadOnce()]} // this structure will be read only once @@ -52,7 +53,7 @@ ReadOnly attribute render the member (variable) inaccessible for write operation ~~~iecst - +{S7.extern=ReadWrite} CLASS PUBLIC MyClass VAR PUBLIC {#ix-attr:[ReadOnly()]} // this structure will be read only @@ -75,6 +76,7 @@ CompilerOmits attribute instructs the compiler to skip the compilation of a memb ~~~iecst +{S7.extern=ReadWrite} CLASS PUBLIC MyClass VAR PUBLIC {#ix-attr:[CompilerOmits()]} @@ -94,6 +96,7 @@ END_CLASS To minimize the communication overhead between the application and the controller during POCO operations, you can annotate specific members of a type to bypass data exchange. This attribute should be applied when the compiler omits the compilation of particular members in the POCO object. ```iecst +{S7.extern=ReadWrite} CLASS PUBLIC MyClass VAR PUBLIC {#ix-attr:[CompilerOmits("POCO")]} diff --git a/docfx/articles/compiler/README.md b/docfx/articles/compiler/README.md index 65e970e8..00d80a63 100644 --- a/docfx/articles/compiler/README.md +++ b/docfx/articles/compiler/README.md @@ -2,12 +2,20 @@ **AXSharp Compiler (`ixc`) translates PLC data structures into C# (PLC .NET Twin), which makes the PLC data available in a structured way for any .NET application.** +### Adding types and members to the communication over WebAPI + +Starting from the version v2.0.0+ of `sld`, to make member or type accessible over the communication there is a need to add pragma `{S7.extern=ReadWrite}` or `{S7.extern=ReadOnly}` in the appropriate place in the code. + +For details see [here](https://console.simatic-ax.siemens.io/docs/sld/extern-accessibility) + + ### Write PLC code ~~~iecst {#ix-attr:[Container(Layout.Stack)]} {#ix-attr:[Group(Layout.GroupBox)]} {#ix-set:AttributeName = "Location"} +{S7.extern=ReadWrite} CLASS GeoLocation VAR PUBLIC {#ix-set:AttributeName = "Latitude [°]"} @@ -76,7 +84,7 @@ Entry.Plc.weather.GeoLocation.Write(); - [Config file](CONFIG_FILE.md) - [Packaging and dependency management](PACKAGING.md) -AXSharp compiles transpiles following project blocks: +AXSharp compiles transpiles the following project blocks: - [Configuration's global variables](https://console.simatic-ax.siemens.io/docs/st/language/program-structure/configuration#global-variables) - [Elementary data types](https://console.simatic-ax.siemens.io/docs/st/language/types-and-variables#elementary-data-types) @@ -84,7 +92,7 @@ AXSharp compiles transpiles following project blocks: - [User defined data types](https://console.simatic-ax.siemens.io/docs/st/language/types-and-variables#user-defined-data-types) - [Strucured types](https://console.simatic-ax.siemens.io/docs/st/language/types-and-variables#structured-type-without-relative-addressing) - [Data type with named values as enums](https://console.simatic-ax.siemens.io/docs/st/language/types-and-variables#data-type-with-named-values) --[Enumerations](https://console.simatic-ax.siemens.io/docs/st/language/types-and-variables#enumeration) +- [Enumerations](https://console.simatic-ax.siemens.io/docs/st/language/types-and-variables#enumeration) diff --git a/docfx/articles/connectors/WebAPI.md b/docfx/articles/connectors/WebAPI.md index 2cf41a8d..0d704c0d 100644 --- a/docfx/articles/connectors/WebAPI.md +++ b/docfx/articles/connectors/WebAPI.md @@ -4,12 +4,15 @@ This connector offers an interface to interact with S7-15XX PLC systems through the WebAPI. +For details how to make the data available see [extern accessibility](https://console.simatic-ax.siemens.io/docs/sld/extern-accessibility). + Here is an example of how to create an instance of this connector: ```C# public static Plc { get; } = new (ConnectorAdapterBuilder.Build().CreateWebApi(Environment.GetEnvironmentVariable("AXTARGET") ?? "10.10.101.1", "Everybody", "", true)); ``` + ## Considerations for WebAPI Connector Performance When working with S7-1500 based PLC systems, especially hardware-based ones, there are limitations regarding the volume of items that can be communicated over a specific communication interface. To prevent performance degradation, it's vital to prudently manage the number of PLC items your application uses at any given time. It is recommended to utilize polling instead of an automatic variable subscription. diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/AXSharp.config.json b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/AXSharp.config.json index 4c37acc9..40eec6b8 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/AXSharp.config.json +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/AXSharp.config.json @@ -1 +1 @@ -{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"ProjectFile":"ax_blazor_example.csproj"} \ No newline at end of file +{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"IgnoreS7Pragmas":false,"ProjectFile":"ax_blazor_example.csproj"} \ No newline at end of file diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/apax-lock.json b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/apax-lock.json index aa253605..864982e9 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/apax-lock.json +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/apax-lock.json @@ -1,111 +1,92 @@ { "@ax/apax-build": { - "version": "0.5.0", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/apax-build/-/apax-build-0.5.0.tgz", - "integrity": "sha512-6p9iZQfpmngx38r4p6XaVVPeEQzTt3UJcywsRSeVBnES6tx1pTVLM20K0RczqRYZmXbyNpz9effPxpvj5L/jKA==", - "dependencies": { - "@ax/third-party-licenses-apax-build": "0.5.0" - } + "version": "0.7.0", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/apax-build/-/apax-build-0.7.0.tgz", + "integrity": "sha512-OkmqLq6SI0gv9x/7FLFmABuJYylHHyOzZ4Kvmfys2RGiP06/WbOpycmuqYBneK1zAe3KoBu8ZmelPdXbxcK4+w==" }, "@ax/axunit": { - "version": "2.0.8", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/axunit/-/axunit-2.0.8.tgz", - "integrity": "sha512-pRM+X++jrS2n/dwBJBuyTtVAL0aQxrYjhbk7Xw3IdpT0aIX4L1DF8S+ftrt6V06HpcatgKhCttOSnpR8nECNzQ==", - "dependencies": { - "@ax/axunit-docs": "2.0.8", - "@ax/axunit-library": "2.0.8", - "@ax/axunit-llvm-runner-gen": "2.0.8", - "@ax/axunit-runner-llvm": "2.0.8", - "@ax/axunit-runner-mc7plus": "2.0.8", + "version": "4.0.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/axunit/-/axunit-4.0.6.tgz", + "integrity": "sha512-zuXuKxqHeP0fdn2cG/CbpogjYAweIwBKpDwZzSrzTG9tCM/axK/c3MZ/+DUN8aINdcyy0NdWTX6Z7kaU68nQBA==", + "dependencies": { + "@ax/axunit-docs": "4.0.6", + "@ax/axunit-library": "4.0.6", + "@ax/axunit-llvm-runner-gen": "4.0.6", + "@ax/axunit-runner-llvm": "4.0.6", + "@ax/axunit-runner-mc7plus": "4.0.6", "@ax/build-native": "10.1.1", - "@ax/target-axunit": "2.0.8", - "@ax/third-party-licenses-testingframework": "2.0.8" + "@ax/target-axunit": "4.0.6" } }, "@ax/axunit-docs": { - "version": "2.0.8", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/axunit-docs/-/axunit-docs-2.0.8.tgz", - "integrity": "sha512-uY9BbmqbvIOdBlAs7RYrFJH85R1/hsbZ248/NrdeFMdqToJPkQkjERENlXfN+Iz6+HjM60+D3Lz1MqVY6v69OA==", - "dependencies": { - "@ax/third-party-licenses-testingframework": "2.0.8" - } + "version": "4.0.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/axunit-docs/-/axunit-docs-4.0.6.tgz", + "integrity": "sha512-IjZke615I44O7NzPO3nuMzPyaaw6lwZ0zxNjNiNqqegITz7BTxhYfRsNEK2EUISc4S3c9f1vY6oT9AuY/cqm6g==" }, "@ax/axunit-library": { - "version": "2.0.8", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/axunit-library/-/axunit-library-2.0.8.tgz", - "integrity": "sha512-6yVIj8gXTHx4YVTxBYXqJ3q38N0KZe0GXnpyA1xXIapvjFT6Rm1S4WqylYng8M4cgsRfEMRGkzq2HSeIlqUzwQ==", - "dependencies": { - "@ax/third-party-licenses-testingframework": "2.0.8" - } + "version": "4.0.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/axunit-library/-/axunit-library-4.0.6.tgz", + "integrity": "sha512-sgg1SNngQ9lTP/v8e+AyZq6hCf+563P3S4xep6uCdHIZMmW9GYkvKTjh56+ZKQMpGFrcr9Sn0Aw6dE7mbINwXg==" }, "@ax/axunit-llvm-runner-gen": { - "version": "2.0.8", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/axunit-llvm-runner-gen/-/axunit-llvm-runner-gen-2.0.8.tgz", - "integrity": "sha512-CLLqMBSrCCVJwSnP4fvBYC2i18rpcRFbblVzkyU1ITPqaIJXFVjz21jYiaZO5nJnq0FMsOS1U9hhMxAEV4OgYw==", - "dependencies": { - "@ax/third-party-licenses-testingframework": "2.0.8" - } + "version": "4.0.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/axunit-llvm-runner-gen/-/axunit-llvm-runner-gen-4.0.6.tgz", + "integrity": "sha512-yL9TSEvBX1Wu5ohFAm07XRQfOHPUmHm6D17CB09mVssYec2VcBl1ORmqomVxTQhGVO4Zxsv5t+qgtBMx+/aytQ==" + }, + "@ax/axunit-ls-contrib": { + "version": "4.0.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/axunit-ls-contrib/-/axunit-ls-contrib-4.0.6.tgz", + "integrity": "sha512-BNES+gbcdqEnkzyNeEBnl35Vx8ABkaZOoMdTiiK4ffFy5Y51lY7ZLy9YXQdrvCev8b5xhViWlQMljLSiMRtyZA==" }, "@ax/axunit-runner-llvm": { - "version": "2.0.8", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/axunit-runner-llvm/-/axunit-runner-llvm-2.0.8.tgz", - "integrity": "sha512-3NUAtjSQymxtQejhgTp8Psr3S46VFpo6Rp9/8dO2pAU4WST57/LlVkHmWixBUlwYJH7wkZrbylpqirg9Hde6/A==", + "version": "4.0.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/axunit-runner-llvm/-/axunit-runner-llvm-4.0.6.tgz", + "integrity": "sha512-YMt1iet7rDxV0sDF0DDoLBmFZZ7O+qW3JhP4faUiOwJRy0GLkyrjYbVuMkOJAeScu4pykgjUe0yNjLZ9c/Nlxw==", "dependencies": { - "@ax/axunit-runner-llvm-linux-x64": "2.0.8", - "@ax/axunit-runner-llvm-win-x64": "2.0.8", - "@ax/third-party-licenses-testingframework": "2.0.8" + "@ax/axunit-runner-llvm-linux-x64": "4.0.6", + "@ax/axunit-runner-llvm-win-x64": "4.0.6" } }, "@ax/axunit-runner-llvm-linux-x64": { - "version": "2.0.8", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/axunit-runner-llvm-linux-x64/-/axunit-runner-llvm-linux-x64-2.0.8.tgz", - "integrity": "sha512-DHC0poRVuAMjrJPEnkyOhVFY43IvSswj4hakis61lKsmre7bffb5GigU5/t0u4oSdvN59DMu8i+iHujECpOS0Q==", + "version": "4.0.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/axunit-runner-llvm-linux-x64/-/axunit-runner-llvm-linux-x64-4.0.6.tgz", + "integrity": "sha512-Za0+ZaWLJDnSR+7Bsr1f1Chh55JvH1tdWtJNtIjNFfpI5dkhQJ60/WCffP7khyNpcRvi2u3wLd1gtbMnXGNJNA==", "os": [ "linux" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-testingframework": "2.0.8" - } + ] }, "@ax/axunit-runner-llvm-win-x64": { - "version": "2.0.8", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/axunit-runner-llvm-win-x64/-/axunit-runner-llvm-win-x64-2.0.8.tgz", - "integrity": "sha512-nso1/ZZW01aPl1J/yanwrTINXKgvSqVEnf7szJ4I+LyL7Jnaa2Gvs+3xFYBdwjL3bEVZdgpC8a3X2rqksgPp3A==", + "version": "4.0.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/axunit-runner-llvm-win-x64/-/axunit-runner-llvm-win-x64-4.0.6.tgz", + "integrity": "sha512-8TJ25XNcLvNLrc6U2r0lfd+CeAt+cMPFwShf3IlT21BS3KeZCmz8joG1YPTq5OyKChEjg5ez5mMg5BvleG7Ybg==", "os": [ "win32" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-testingframework": "2.0.8" - } + ] }, "@ax/axunit-runner-mc7plus": { - "version": "2.0.8", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/axunit-runner-mc7plus/-/axunit-runner-mc7plus-2.0.8.tgz", - "integrity": "sha512-76hxe36fRIymUPQwTfRP4oTtH8yDioxt+TrGRKftrHchWEkR2dy6yncrJAp6Myo6dTwL+25tBWaXUrJ7tDXx3Q==", + "version": "4.0.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/axunit-runner-mc7plus/-/axunit-runner-mc7plus-4.0.6.tgz", + "integrity": "sha512-TrXheqFtzGwUYXKLjaLINU0Gkl54Qp88OFjCnrmaF71z8vOP3xJ5wtGyzYx9b9bPlub7ZIcr7PvSakn2FA21PQ==", "dependencies": { - "@ax/axunit-runner-mc7plus-win-x64": "2.0.8", - "@ax/third-party-licenses-testingframework": "2.0.8" + "@ax/axunit-runner-mc7plus-win-x64": "4.0.6" } }, "@ax/axunit-runner-mc7plus-win-x64": { - "version": "2.0.8", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/axunit-runner-mc7plus-win-x64/-/axunit-runner-mc7plus-win-x64-2.0.8.tgz", - "integrity": "sha512-FRBFUWePIwIfy7st7pUs40L9M3CkC4HoA9kKbC19gpYuhA0K7PQNZn0rDiWeL7GpD3JSjZNomAZFtZN80sM5dw==", + "version": "4.0.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/axunit-runner-mc7plus-win-x64/-/axunit-runner-mc7plus-win-x64-4.0.6.tgz", + "integrity": "sha512-2oavPsnLEtgOeMCUjtTJSDwgDZ7SMZ6FVko51K4vO+T/O0ZRyD7eEgOBjBY0BjBTYLXTu5DNFxVnJqCvstSHzg==", "os": [ "win32" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-testingframework": "2.0.8" - } + ] }, "@ax/build-native": { "version": "10.1.1", @@ -145,243 +126,156 @@ "@ax/third-party-licenses-build-native": "10.1.1" } }, - "@ax/diag": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/diag/-/diag-0.17.4.tgz", - "integrity": "sha512-Z3RNRXWsJgP2DiGR5ed/MxuW9Tt92skjAYZBfHHOR8ni9obNbYG2Uh9Fma9ZrSmU7s+cFfVGyPPvurnPJhQwAg==", - "dependencies": { - "@ax/diag-linux-x64": "0.17.4", - "@ax/diag-win-x64": "0.17.4", - "@ax/third-party-licenses-monitor": "0.17.4" - } - }, - "@ax/diag-linux-x64": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/diag-linux-x64/-/diag-linux-x64-0.17.4.tgz", - "integrity": "sha512-xXyMhNxLENo8nL4IkQPw2c3w/hroSJMNcYCWNeinu3aLoOMup+i09evJNALYFkMT7sUo2FYqOURIz5O34sn/kw==", - "os": [ - "linux" - ], - "cpu": [ - "x64" - ], - "dependencies": { - "@ax/third-party-licenses-monitor": "0.17.4" - } - }, - "@ax/diag-win-x64": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/diag-win-x64/-/diag-win-x64-0.17.4.tgz", - "integrity": "sha512-HopU/QUggN2sUqMqrqhN11K5VMu1z25VPE5ChDbZpqqDkT0hjpx1+tQqP9pwryDgOL+QwQHG5/D1dEW2RGec+w==", - "os": [ - "win32" - ], - "cpu": [ - "x64" - ], - "dependencies": { - "@ax/third-party-licenses-monitor": "0.17.4" - } - }, "@ax/mod": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/mod/-/mod-0.17.4.tgz", - "integrity": "sha512-DBrN+0PB93BiZJ9v+LFtZt9p3k16yujJ21g3nYRGbbxlRvBaoVX36mxpn0HPGec8U1AQi7v7l2yy5UcSt3DHxA==", + "version": "0.19.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/mod/-/mod-0.19.6.tgz", + "integrity": "sha512-ox1VIJyq7UgI+73LIwzjCxLSfOLK1PTOveiW/JwqMJWhdpg0MK+UiV8N8LhTxdciXLb4KVB0TmsteEou12SfEQ==", "dependencies": { - "@ax/mod-linux-x64": "0.17.4", - "@ax/mod-win-x64": "0.17.4", - "@ax/third-party-licenses-monitor": "0.17.4" + "@ax/mod-linux-x64": "0.19.6", + "@ax/mod-win-x64": "0.19.6" } }, "@ax/mod-linux-x64": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/mod-linux-x64/-/mod-linux-x64-0.17.4.tgz", - "integrity": "sha512-CofHcxm9nusmMBIRej2OE6uvPFx3b2Q2pPC2hP6tuESqrfn5ZGRuI1es0AUPXaHZD01konfQ/w5a6FOkOS+cyg==", + "version": "0.19.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/mod-linux-x64/-/mod-linux-x64-0.19.6.tgz", + "integrity": "sha512-n1TP1N+e1CHWIi1BT8h2wu6oQgny23COPqK1q34HduS7Ws3DkNUwmSwt/ypzZcUkrs/ZDLJVzrzyZ9s2TcrCmA==", "os": [ "linux" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-monitor": "0.17.4" - } + ] }, "@ax/mod-win-x64": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/mod-win-x64/-/mod-win-x64-0.17.4.tgz", - "integrity": "sha512-K1M0BG/RRJFFfCk6SbseFsc7eaDl0/mWiQWvRBvJy6Nda7JjcyOpOJJJo2ENExj0dm6Iw1WP6b1JyZBJPhbKuQ==", + "version": "0.19.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/mod-win-x64/-/mod-win-x64-0.19.6.tgz", + "integrity": "sha512-RRo9oEoKL/XUxwHN3lPHgUDrAuDFQsN96ai9UnEuVrOV6ORNqV2UF3pEERT2Y9yPQBubwr94dPSbtZuGJLimkQ==", "os": [ "win32" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-monitor": "0.17.4" - } + ] }, "@ax/mon": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/mon/-/mon-0.17.4.tgz", - "integrity": "sha512-V2gtbf36wOiFPnHOTeXlmRpWlkXO33pO4cQ4UZlarhAVnv6+AzvolC0joBDH8NsE1uk9wK349+T283gaC991aw==", + "version": "0.19.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/mon/-/mon-0.19.6.tgz", + "integrity": "sha512-1DzxTbM7hezqKfjWvFppoVURyglO/vDx8yY/ygtOHzp2vN/fgkDS5b0i1ZMYNb8Cqh5bmWiUxef1KCPPuqiLcg==", "dependencies": { - "@ax/mon-linux-x64": "0.17.4", - "@ax/mon-win-x64": "0.17.4", - "@ax/third-party-licenses-monitor": "0.17.4" + "@ax/mon-linux-x64": "0.19.6", + "@ax/mon-win-x64": "0.19.6" } }, "@ax/mon-linux-x64": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/mon-linux-x64/-/mon-linux-x64-0.17.4.tgz", - "integrity": "sha512-NC5nPFdAyvCtjjtDnyYd23oSwMHR9NT3yLJhTLTo0oH+FM58zurDs2CygdkWZIX12aNEhsSJE0lMpJ6RaldiBQ==", + "version": "0.19.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/mon-linux-x64/-/mon-linux-x64-0.19.6.tgz", + "integrity": "sha512-aruXr5+pkXulrf7+AOr6BbtaIUuS2BEmRmr0p5xfxLVfFmqSGspYQK1KCVh4k3lS6f87BQPMviAHXxWElmyvWA==", "os": [ "linux" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-monitor": "0.17.4" - } + ] }, "@ax/mon-win-x64": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/mon-win-x64/-/mon-win-x64-0.17.4.tgz", - "integrity": "sha512-R3u02RGnQf3AEo0cicefdwSY/UIKlg9WepPiFuYNf4jq15Pv2dUtZbkFa+5nB8hmOdYDdj1RgbRcsSuLV0SWJw==", + "version": "0.19.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/mon-win-x64/-/mon-win-x64-0.19.6.tgz", + "integrity": "sha512-suwh5N+dFMNJIgukWp3pzw8QxRzD+ae+tIxZUzHKMV91QbPbcNKJztCqa9y1dRBZyeurz+De5VZUpxZMaRobvw==", "os": [ "win32" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-monitor": "0.17.4" - } + ] }, "@ax/sdb": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/sdb/-/sdb-0.17.4.tgz", - "integrity": "sha512-uuX4XonmzE3EUHZFxJpqg/oW/hRh260oE3I9s9C1b6LhENfY4M4w/4RWQclwy8kEMAZNJAmLu8mph3wjFPbcqg==", + "version": "0.19.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/sdb/-/sdb-0.19.6.tgz", + "integrity": "sha512-1H2E6VcaYfhGtxnFC58pjekMp8c3ule/byEISTc5G1AWgHV7+ANZtGAgXWIPimYIF5+u6JL/qd4JT94gCweJrA==", "dependencies": { - "@ax/sdb-linux-x64": "0.17.4", - "@ax/sdb-win-x64": "0.17.4", - "@ax/third-party-licenses-monitor": "0.17.4" + "@ax/sdb-linux-x64": "0.19.6", + "@ax/sdb-win-x64": "0.19.6" } }, "@ax/sdb-linux-x64": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/sdb-linux-x64/-/sdb-linux-x64-0.17.4.tgz", - "integrity": "sha512-Z968H7WATjAW35mItoV+LGWFo236gWwlJ5xzii0TXsiRAbbCr14MiTnObDZr3lGUKqe0hUwm3xOTj1hCUcFVrA==", + "version": "0.19.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/sdb-linux-x64/-/sdb-linux-x64-0.19.6.tgz", + "integrity": "sha512-7oVkmc8nCXIj7dPRHxwUipRVvxQpyYpCNpseWYYsgKyfzaeRKeZpwF3zuSe5I9NSsWenGT1HtvJhyfSJ2Dyebg==", "os": [ "linux" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-monitor": "0.17.4" - } + ] }, "@ax/sdb-win-x64": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/sdb-win-x64/-/sdb-win-x64-0.17.4.tgz", - "integrity": "sha512-SubrVGW/1JY5pZ+2UIgGuJSduDlXXRCL5vFyhGPS7J+RMki2TJCiEMMorxwbAdzUymv9uqTPbvMzQbE17y3XGQ==", + "version": "0.19.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/sdb-win-x64/-/sdb-win-x64-0.19.6.tgz", + "integrity": "sha512-Rkeb7x1I1t3tKpop+xYbNhWw4Qk0u7tU+maj8JsidQyuSEs/dcgOE95nCb32JhaMKRykwZ6uQ0SVsnrqtCvwrA==", "os": [ "win32" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-monitor": "0.17.4" - } + ] }, "@ax/sdk": { - "version": "3.0.2", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/sdk/-/sdk-3.0.2.tgz", - "integrity": "sha512-frtVc5Ohp5GT49Xurm17EsAYGN6janqLJQ316Ip20Y62/ibmntVNgA0fpmCv6H+Ht+IXefjTyCV9Q3I2siXG6Q==", - "dependencies": { - "@ax/axunit": "2.0.8", - "@ax/diag": "0.17.4", - "@ax/mod": "0.17.4", - "@ax/mon": "0.17.4", - "@ax/sdb": "0.17.4", - "@ax/sld": "0.12.1", - "@ax/st": "3.0.2", - "@ax/target-llvm": "4.1.6", - "@ax/target-mc7plus": "4.1.6" - } + "version": "4.0.12", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/sdk/-/sdk-4.0.12.tgz", + "integrity": "sha512-EXB8J2voETlwzYWe7GPt25NA/FM+qskre83oahARvS7/7hIoEhinfx7AhZqj63hUruAr9P1XcMZL8cTyQhOYgQ==", + "dependencies": { + "@ax/axunit": "4.0.6", + "@ax/axunit-ls-contrib": "4.0.6", + "@ax/mod": "0.19.6", + "@ax/mon": "0.19.6", + "@ax/sdb": "0.19.6", + "@ax/simatic-pragma-stc-plugin": "1.0.26", + "@ax/sld": "1.0.11", + "@ax/st": "4.0.12", + "@ax/target-llvm": "5.4.89", + "@ax/target-mc7plus": "5.4.89" + } + }, + "@ax/simatic-pragma-stc-plugin": { + "version": "1.0.26", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/simatic-pragma-stc-plugin/-/simatic-pragma-stc-plugin-1.0.26.tgz", + "integrity": "sha512-2Pj/Encd6bUgsRfXyj3rA4YOUpRroqwzODKU37T95dMNle+BpFXYS3V88FYJyTdOgSrJik4VVdV1AFzH7NUQ8g==" }, "@ax/sld": { - "version": "0.12.1", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/sld/-/sld-0.12.1.tgz", - "integrity": "sha512-9FqP80QhgOjgPEEiVXZBFdemPFIW76XZg7MHylijyGYT4x5vLq2dRa59Hx8zMEPRS5jJVcOrJ5lnQpGZCDJrDQ==", - "dependencies": { - "@ax/sld-linux-x64": "0.12.1", - "@ax/sld-win-x64": "0.12.1", - "@ax/third-party-licenses-plc-loader": "0.12.1" - } - }, - "@ax/sld-linux-x64": { - "version": "0.12.1", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/sld-linux-x64/-/sld-linux-x64-0.12.1.tgz", - "integrity": "sha512-NeacGQ4xptssaq6SVYqOd3w5su3c0pz+ceRbaBiCk1GgHDXIrsw6I6v6QLeza8P/u688L9q0/8RY4A+JP8+dLA==", - "os": [ - "linux" - ], - "cpu": [ - "x64" - ], - "dependencies": { - "@ax/third-party-licenses-plc-loader": "0.12.1" - } - }, - "@ax/sld-win-x64": { - "version": "0.12.1", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/sld-win-x64/-/sld-win-x64-0.12.1.tgz", - "integrity": "sha512-8Ou2iEPE1M3JgUmG1ttn8LHoDwZwcKxiZyTIsj2gTcoiaUYFP56EAABtjniXQM7x0l39M24RgG4GNHS2AN/wHw==", - "os": [ - "win32" - ], + "version": "2.0.5", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-2.0.5.tgz", + "integrity": "sha512-upa0HyRVdYyzNu6j7E+gTAnpzP2mfZxvo+0jbm8H6Ci9ergL56SHaCVBC35PnociMZpdZ5d1/LTy6f8lwpDxXA==", "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-plc-loader": "0.12.1" - } + ] }, "@ax/st": { - "version": "3.0.2", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/st/-/st-3.0.2.tgz", - "integrity": "sha512-uDi0fxvMz+12uHxSmBeP4GlnKuAc0WSxVR0muZ/NGn0ULbSILYQfWp+J7L+k6QGf010Os6WzmwszOK3FOcQc+Q==", + "version": "4.0.12", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/st/-/st-4.0.12.tgz", + "integrity": "sha512-Y/SZG+Y7Cf9C+kuFBpU0zunU0Jkr7PQaybnlPAnoSt3Vl9XIk1JWIlHi7axKz62TRzlqi2MyBFuAVZKXtSLkIg==", "dependencies": { - "@ax/apax-build": "0.5.0", - "@ax/stc": "4.1.6" + "@ax/apax-build": "0.7.0", + "@ax/stc": "5.4.89" } }, "@ax/st-docs": { - "version": "4.1.6", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/st-docs/-/st-docs-4.1.6.tgz", - "integrity": "sha512-7LwS86O52ydoh9avtehEBd4Bm5i9lKNZUZteK/MwpY0GMYNd5Ph2HwS6EmYih+3n95q6joRVBRd62XLVF3abQA==", - "dependencies": { - "@ax/third-party-licenses-st-compiler": "4.1.6" - } + "version": "5.4.89", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/st-docs/-/st-docs-5.4.89.tgz", + "integrity": "sha512-TogaSV69nQtoPVUFMna4rZOz64SEa5m8mfEjoXcYABI1GgDhqz9ptzzCLbpcz7l6+zimdv1erV36WxRYoX9guQ==" }, "@ax/stc": { - "version": "4.1.6", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/stc/-/stc-4.1.6.tgz", - "integrity": "sha512-KjqEcqA4+6IpClC5LJq4ZgrrZ1YiCeGc5Un8p6ideRoh4UZtl13EnCiAiZYXxXcu3uP8hylPN80I6AC2e2kipQ==", + "version": "5.4.89", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/stc/-/stc-5.4.89.tgz", + "integrity": "sha512-PylnoEsIPZj8IK2XwSnjHlDK66CJ7ABaZ9UqBLGP281JI5XLwP88+e9Xjb7RjZbyomeg+1lcvHT1juXZSyc8Ig==", "dependencies": { - "@ax/stc-linux-x64": "4.1.6", - "@ax/stc-win-x64": "4.1.6", - "@ax/third-party-licenses-st-compiler": "4.1.6" + "@ax/stc-linux-x64": "5.4.89", + "@ax/stc-win-x64": "5.4.89" } }, "@ax/stc-linux-x64": { - "version": "4.1.6", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/stc-linux-x64/-/stc-linux-x64-4.1.6.tgz", - "integrity": "sha512-V+deitre/miL6Az96kbXyRg6SXWccq+hcJcWBHPWich7oHu7NpkIeAaFvWDi4KQMdby2+FEh/9/I6Q++NBragw==", + "version": "5.4.89", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/stc-linux-x64/-/stc-linux-x64-5.4.89.tgz", + "integrity": "sha512-WFNqenCSEs+Qy1ZzSEEmmg7eOxUggPyVqJ+ZQjwR+LqAmVYJRm0yFzOFQvTghVO/znvSgGeKywK8W9OjFu2BEw==", "os": [ "linux" ], @@ -389,14 +283,13 @@ "x64" ], "dependencies": { - "@ax/st-docs": "4.1.6", - "@ax/third-party-licenses-st-compiler": "4.1.6" + "@ax/st-docs": "5.4.89" } }, "@ax/stc-win-x64": { - "version": "4.1.6", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/stc-win-x64/-/stc-win-x64-4.1.6.tgz", - "integrity": "sha512-IbeMwRZumkiLkOWegFO+iDw/WdM242jkBsAVx8/SIrEj10WVyv0FiIu11UIBx415kWEEOVNXIC3pwxbgUQZ4VQ==", + "version": "5.4.89", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/stc-win-x64/-/stc-win-x64-5.4.89.tgz", + "integrity": "sha512-ysCVJdJ3Gk7p+FzHhntapHYhvKkyHVU0HV36pMBrpYVTCgTOoHlFkeDeTy+JU6cfx7x4LVuIFTzQusJrFPUs8g==", "os": [ "win32" ], @@ -404,122 +297,79 @@ "x64" ], "dependencies": { - "@ax/st-docs": "4.1.6", - "@ax/third-party-licenses-st-compiler": "4.1.6" + "@ax/st-docs": "5.4.89" } }, "@ax/target-axunit": { - "version": "2.0.8", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/target-axunit/-/target-axunit-2.0.8.tgz", - "integrity": "sha512-aFRPFSR+WN84wFjy9H5EKLh80bb9GbNiCxhuAcD/uEzqS09QWBITfiTFIQVWvnUi/2DUCsNF8Aj+eYntwFAf4A==", - "dependencies": { - "@ax/third-party-licenses-testingframework": "2.0.8" - } + "version": "4.0.6", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/target-axunit/-/target-axunit-4.0.6.tgz", + "integrity": "sha512-JSxQsnT/1PjaPLVmv7mORqjhmE5weMUEZ8/xKDdKnH+UxRH8FkCuLMsKgsq+UCQUazdbePm9vFlZ6E4HhI5OGA==" }, "@ax/target-llvm": { - "version": "4.1.6", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/target-llvm/-/target-llvm-4.1.6.tgz", - "integrity": "sha512-++Ja6l5Nn3ef/S5RlWAzywlk/2M8rGcELZJiOt3BgmGN7KrSCpUzb7SNY9sUDg9HASIKA2ZjCxoqmlnqSfNXxQ==", + "version": "5.4.89", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/target-llvm/-/target-llvm-5.4.89.tgz", + "integrity": "sha512-gKooU/g7iFjalErbbmfBwwcYwBbH9GQeeICilgUK+0FFxyGLn28ML9ky4MrL6e3Yq/mWrHPnqZlKK4ZIZsMEDA==", "dependencies": { - "@ax/target-llvm-linux-x64": "4.1.6", - "@ax/target-llvm-win-x64": "4.1.6", - "@ax/third-party-licenses-st-compiler": "4.1.6" + "@ax/target-llvm-linux-x64": "5.4.89", + "@ax/target-llvm-win-x64": "5.4.89" } }, "@ax/target-llvm-linux-x64": { - "version": "4.1.6", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/target-llvm-linux-x64/-/target-llvm-linux-x64-4.1.6.tgz", - "integrity": "sha512-Jd/2VrJk2A7vYfweFzdbnEB3KRm0BZmQgZaLiOHBWzv3FdPlLhRCkuC5my9nPMB3d5YtVP/3somEufHNubRCug==", + "version": "5.4.89", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/target-llvm-linux-x64/-/target-llvm-linux-x64-5.4.89.tgz", + "integrity": "sha512-xOFn1jGf3EPCSSOu88lcdPlwW46n59xdiJT19WxBvaOowAzEoCAYQCTXfh3si/XiAix0vLWsnDY9DYRPMhx5qA==", "os": [ "linux" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-st-compiler": "4.1.6" - } + ] }, "@ax/target-llvm-win-x64": { - "version": "4.1.6", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/target-llvm-win-x64/-/target-llvm-win-x64-4.1.6.tgz", - "integrity": "sha512-iNll599705taC2Bin+gfUafVYtpAH7DqN7Gz7N3nUcIWt2DiSv4TOkz1SSULS5SEBRQAYCz3fZnvUdgL7xKbjw==", + "version": "5.4.89", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/target-llvm-win-x64/-/target-llvm-win-x64-5.4.89.tgz", + "integrity": "sha512-pQdi7/dtf4Hz10yMikkxcOKqDwPzsQTD/d8vG7rfHYLyGHezBslVNHnoVGufaSAbQkU9zwvZJ7EUT89oRrU2lg==", "os": [ "win32" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-st-compiler": "4.1.6" - } + ] }, "@ax/target-mc7plus": { - "version": "4.1.6", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/target-mc7plus/-/target-mc7plus-4.1.6.tgz", - "integrity": "sha512-ZIHBVwcBWe+P59fZHFa8NrLkJFhqV9GOerxodlJhu9G/m2szr+5MEi3nep4vw8r/dZzahx9UqAU/tnXTb8aJGA==", + "version": "5.4.89", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/target-mc7plus/-/target-mc7plus-5.4.89.tgz", + "integrity": "sha512-5W0MHwuBiAzcs/4SGKKd91ZtM3Dr4RFixU/3bXHdTpyEDHT6S3fGGPjhDO58Cnd9WORleOozFg95zoZgEodcBw==", "dependencies": { - "@ax/target-mc7plus-linux-x64": "4.1.6", - "@ax/target-mc7plus-win-x64": "4.1.6", - "@ax/third-party-licenses-st-compiler": "4.1.6" + "@ax/target-mc7plus-linux-x64": "5.4.89", + "@ax/target-mc7plus-win-x64": "5.4.89" } }, "@ax/target-mc7plus-linux-x64": { - "version": "4.1.6", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/target-mc7plus-linux-x64/-/target-mc7plus-linux-x64-4.1.6.tgz", - "integrity": "sha512-z6iURITvnVBnDFv/ifbDUPrpMmloBhmEfVIIZ+rEzKWxmZ57CWLQSBRGGkiXT+TiF8aRyaqEJmwwdWZxUTNPkA==", + "version": "5.4.89", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/target-mc7plus-linux-x64/-/target-mc7plus-linux-x64-5.4.89.tgz", + "integrity": "sha512-WPSfNJI4Ar4DuAH6WZLfoVPU9whR+1arPfvWvmJ3w5Ag38PpfZU8BNfJ8krGbLzZXm/nMvydnE4oyfz4mRgbwg==", "os": [ "linux" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-st-compiler": "4.1.6" - } + ] }, "@ax/target-mc7plus-win-x64": { - "version": "4.1.6", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/target-mc7plus-win-x64/-/target-mc7plus-win-x64-4.1.6.tgz", - "integrity": "sha512-wKlitqYXvFvaRnfOG3rUsCY1czOmwkawium+FRBVC0/RU6NrrDORXuOGuJWNriNwntACXrYhzoB/WX5KZZq0/A==", + "version": "5.4.89", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/target-mc7plus-win-x64/-/target-mc7plus-win-x64-5.4.89.tgz", + "integrity": "sha512-vnlDcCvwLzj06oQKR0sbrEfRf/s/RWKsnfqbhfNzKRt5T3mW+46dmcuR90SSNrYpHi4Szx/mwRl+O1BmxSJI8g==", "os": [ "win32" ], "cpu": [ "x64" - ], - "dependencies": { - "@ax/third-party-licenses-st-compiler": "4.1.6" - } - }, - "@ax/third-party-licenses-apax-build": { - "version": "0.5.0", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/third-party-licenses-apax-build/-/third-party-licenses-apax-build-0.5.0.tgz", - "integrity": "sha512-9okNwDaHttbFwcP1Ln/mFN8ARYL1g+ShCtcMm4OE/BYN98nzoTZBEaUdsdbhju4sL4bD6qDBPVvj9o/cwPIL7Q==" + ] }, "@ax/third-party-licenses-build-native": { "version": "10.1.1", "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/third-party-licenses-build-native/-/third-party-licenses-build-native-10.1.1.tgz", "integrity": "sha512-Da+AT0KujH3K9bKf4K4rqPA3Z+a/WDkw9p6328AlrSqgBIUFyUZzOM3eVOwhhjKCnmNAVSmtSp0r7crDFGICTw==" - }, - "@ax/third-party-licenses-monitor": { - "version": "0.17.4", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/third-party-licenses-monitor/-/third-party-licenses-monitor-0.17.4.tgz", - "integrity": "sha512-ac5nbrpOkX0EuaghbQc8G7AZEOow3aTGlNb/jv3P+iBFvdslrpgGFe5wbHnKxPgkt9TaIf/n48Wy/N8IfVdlKg==" - }, - "@ax/third-party-licenses-plc-loader": { - "version": "0.12.1", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/third-party-licenses-plc-loader/-/third-party-licenses-plc-loader-0.12.1.tgz", - "integrity": "sha512-6KmsG+8fwmbR7WwEOpaTu/87vvTMMun1g/PcPJQoTUTSAf0fxrDvNmIHYRSIp2gVpt/6v/mryDfIKAnvvSt91g==" - }, - "@ax/third-party-licenses-st-compiler": { - "version": "4.1.6", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/third-party-licenses-st-compiler/-/third-party-licenses-st-compiler-4.1.6.tgz", - "integrity": "sha512-rsbijfgPOvWe+NUsD/6D+/uI6b+gZC8vYW0/xLaorKcN2yOkz4dq1VL7Ighz163BjwRlKDNos9Au4Ao1vmG+pA==" - }, - "@ax/third-party-licenses-testingframework": { - "version": "2.0.8", - "resolved": "https://apax-prod-734703289705.d.codeartifact.eu-central-1.amazonaws.com:443/npm/ax/@ax/third-party-licenses-testingframework/-/third-party-licenses-testingframework-2.0.8.tgz", - "integrity": "sha512-pKjnmI18dCvDqM/o6xxTzKqAdF5KIo/pje1JkoZP64BIf5LAwz84NsmDFB1jlmlo3nv3arhSe7aKK9jhjYZAvw==" } } diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/apax.yml b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/apax.yml index bc0f334e..a72c034e 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/apax.yml +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/apax.yml @@ -5,9 +5,10 @@ targets: - "1500" - axunit-llvm devDependencies: - "@ax/sdk": 3.0.2 - "@ax/sld": ^0.14.2 + "@ax/sdk": ^4.0.12 + "@ax/sld": ^2.0.5 scripts: - ixc: - - dotnet run --project ..\\..\\..\\..\\AXSharp.compiler\\src\\ixc\\AXSharp.ixc.csproj --framework net7.0 - + ixc: + - dotnet run --project + ..\\..\\..\\..\\AXSharp.compiler\\src\\ixc\\AXSharp.ixc.csproj --framework + net7.0 diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/CU00x.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/CU00x.st index 801571c1..f0aa6724 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/CU00x.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/CU00x.st @@ -1,9 +1,11 @@ +{S7.extern=ReadWrite} CLASS CU00x EXTENDS CUBase VAR PUBLIC _cuName: STRING; END_VAR END_CLASS +{S7.extern=ReadWrite} CLASS CUBase VAR PUBLIC _baseName : STRING; diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/GroupBox_other.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/GroupBox_other.st index 2c989a00..475b80af 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/GroupBox_other.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/GroupBox_other.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS GroupBox_other VAR PUBLIC {#ix-set:AttributeName = "B1"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/MAIN.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/MAIN.st index 60b9c000..7a95d48f 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/MAIN.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/MAIN.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS MAIN VAR PUBLIC {#ix-set:AttributeName = "<#Hello#> <#World#>"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TcoVortexObject.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TcoVortexObject.st index 73e64864..9969a9f2 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TcoVortexObject.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TcoVortexObject.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TcoIxObject VAR PUBLIC ix_bool : BOOL; diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestEmpty.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestEmpty.st index e5dc78dd..8699fc15 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestEmpty.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestEmpty.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TestEmpty VAR PUBLIC diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestLayoutOverwriting.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestLayoutOverwriting.st index 693bd73f..51dd6bf4 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestLayoutOverwriting.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestLayoutOverwriting.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} {#ix-attr:[Container(Layout.UniformGrid)]} CLASS TestLayoutOverwriting VAR PUBLIC diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestMixed.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestMixed.st index 150b6161..8c15b7aa 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestMixed.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestMixed.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TestMixed VAR PUBLIC {#ix-attr:[Container(Layout.Wrap)]} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestMultipleLayouts.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestMultipleLayouts.st index 598a8d09..84757dd8 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestMultipleLayouts.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestMultipleLayouts.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TestMultipleLayouts VAR PUBLIC {#ix-set:AttributeName = "B1"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestSimple.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestSimple.st index b081f8dc..fb437cdb 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestSimple.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestSimple.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TestSimple VAR PUBLIC {#ix-set:AttributeName = "A1"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestSimpleNested.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestSimpleNested.st index 2bd679f4..db62e014 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestSimpleNested.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestSimpleNested.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TestSimpleNested VAR PUBLIC {#ix-attr:[Container(Layout.Tabs)]} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStruct.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStruct.st index 986000f1..2dd83e4f 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStruct.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStruct.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TestStruct VAR PUBLIC e:INT; diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructMultipleGroups.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructMultipleGroups.st index bb12b0b3..abe54935 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructMultipleGroups.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructMultipleGroups.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TestStructMultipleGroups VAR PUBLIC e:INT; diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructOneGroupWithLayout.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructOneGroupWithLayout.st index bcaa9df1..91fe4f9b 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructOneGroupWithLayout.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructOneGroupWithLayout.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TestStructOneGroupWithLayout VAR PUBLIC {#ix-attr:[Container(Layout.Wrap)]} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructWithMainLayout.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructWithMainLayout.st index 3e85b42d..8c5c4588 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructWithMainLayout.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestStructWithMainLayout.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TestStructWithMainLayout VAR PUBLIC e:INT; diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestWithoutLayouts.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestWithoutLayouts.st index f18fe3d8..0599bff1 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestWithoutLayouts.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/TestWithoutLayouts.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TestWithoutLayouts VAR PUBLIC ix_bool : BOOL; diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/VortexComponents.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/VortexComponents.st index daccace0..e18761e9 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/VortexComponents.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/VortexComponents.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS IxComponent VAR PUBLIC ix_bool : BOOL; diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/configuration.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/configuration.st index 325c4105..1266230f 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/configuration.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/configuration.st @@ -3,8 +3,11 @@ CONFIGURATION MyConfiguration PROGRAM P1 WITH Main: MyProgram; VAR_GLOBAL + {S7.extern=ReadWrite} testingProgram : testingProgram; + {S7.extern=ReadWrite} prgWeatherStations : prgWeatherStations; + {S7.extern=ReadWrite} MAINC : MAIN; END_VAR END_CONFIGURATION diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/fbWorldWeatherWatch.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/fbWorldWeatherWatch.st index dca0eeeb..de0c227b 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/fbWorldWeatherWatch.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/fbWorldWeatherWatch.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS fbWorldWeatherWatch VAR PUBLIC {#ix-attr:[Container(Layout.Stack)]} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/prgWeatherStations.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/prgWeatherStations.st index 90736573..6a262c23 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/prgWeatherStations.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/prgWeatherStations.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} {#ix-attr:[Container(Layout.Stack)]} CLASS prgWeatherStations VAR PUBLIC diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stBlazor.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stBlazor.st index 49e22a1a..32f548fd 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stBlazor.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stBlazor.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stBlazor VAR PUBLIC {#ix-set:AttributeName = "<#Integer From PLC#>"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stComplex.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stComplex.st index 945b34b0..9433e710 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stComplex.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stComplex.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stComplex VAR PUBLIC {#ix-set:AttributeName = "<#Integer From PLC#>"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stComplexUnknown.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stComplexUnknown.st index f2e0fec9..f9e68474 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stComplexUnknown.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stComplexUnknown.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stComplexUnknown VAR PUBLIC {#ix-set:AttributeName = "<#String unknown From PLC#>"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stExample.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stExample.st index f77290e9..3ba02261 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stExample.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stExample.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stExample VAR PUBLIC {#ix-attr:[Container(Layout.Tabs)]} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stLayouts.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stLayouts.st index ddd3ac1c..0044adfb 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stLayouts.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stLayouts.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stLayouts VAR {#ix-set:AttributeName = "B1"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stMultipleLayouts.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stMultipleLayouts.st index 7c1141a7..15c8be02 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stMultipleLayouts.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stMultipleLayouts.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stMultipleLayouts VAR PUBLIC {#ix-attr:[Container(Layout.Tabs)]} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stSimplePrimitive.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stSimplePrimitive.st index 7a79f601..81d0ab7c 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stSimplePrimitive.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stSimplePrimitive.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stSimplePrimitive VAR PUBLIC {#ix-set:AttributeName = "<#Test Integer#>"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest.st index 1e97541a..4f97ab7f 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stTest VAR PUBLIC p1:INT; diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest2.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest2.st index 0b5ae04d..e3b4de4a 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest2.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest2.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stTest2 VAR testVarString: STRING; diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest3.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest3.st index 7ae20fd6..50dbc25f 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest3.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTest3.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stTest3 VAR PUBLIC ix_bool : BOOL; diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestComplex.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestComplex.st index b9d79a78..e5abfdde 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestComplex.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestComplex.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stTestComplex VAR PUBLIC {#ix-set:AttributeName = "<#Integer From PLC#>"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestLayouts.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestLayouts.st index 727002c3..2daec52b 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestLayouts.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestLayouts.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stTestLayouts VAR PUBLIC {#ix-attr:[Container(Layout.Stack)]} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestMultipleNested.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestMultipleNested.st index c5b2f6ea..a8d6a6ba 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestMultipleNested.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestMultipleNested.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stTestMultipleNested VAR PUBLIC {#ix-attr:[Container(Layout.Tabs)]} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestNested.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestNested.st index 28c26248..61ccd6e6 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestNested.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestNested.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stTestNested VAR PUBLIC {#ix-attr:[Container(Layout.Wrap)]} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestPrimitive.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestPrimitive.st index 2eb1a8c1..ef13045f 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestPrimitive.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestPrimitive.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stTestPrimitive VAR PUBLIC {#ix-set:AttributeName = "<#Integer From PLC#>"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestRenderIgnore.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestRenderIgnore.st index d8748c15..96d37c40 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestRenderIgnore.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/stTestRenderIgnore.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS stTestRenderIgnore VAR PUBLIC {#ix-attr:[RenderIgnore()]} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/structWeatherStation.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/structWeatherStation.st index 3b4f4ff6..c11afc2e 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/structWeatherStation.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/structWeatherStation.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS structWeatherStation VAR PUBLIC {#ix-set:AttributeName = "Station name (ICAO)"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/testingProgram.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/testingProgram.st index 30ca42f9..90c65f05 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/testingProgram.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/src/testingProgram.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS testingProgram VAR PUBLIC {#ix-set:AttributeName = "instanceOfStPrimitive"} diff --git a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/test/test.st b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/test/test.st index 82bb243b..d1a79018 100644 --- a/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/test/test.st +++ b/src/AXSharp.blazor/tests/sandbox/ax-blazor-example/test/test.st @@ -3,6 +3,7 @@ USING AxUnit; NAMESPACE MyTest {TestFixture} + {S7.extern=ReadWrite} CLASS MyTestFixture {Test} METHOD PUBLIC MyTestMethod diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler.Abstractions/ICompilerOptions.cs b/src/AXSharp.compiler/src/AXSharp.Compiler.Abstractions/ICompilerOptions.cs index c9504e48..0bf37f39 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler.Abstractions/ICompilerOptions.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler.Abstractions/ICompilerOptions.cs @@ -14,4 +14,6 @@ public interface ICompilerOptions bool UseBase { get; set; } bool NoDependencyUpdate { get; set; } + + bool IgnoreS7Pragmas { get; set; } } \ No newline at end of file diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpConfig.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpConfig.cs index 7a34ca80..53eaeaea 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpConfig.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpConfig.cs @@ -50,7 +50,9 @@ public string OutputProjectFolder /// public bool UseBase { get; set; } - public bool NoDependencyUpdate { get; set; } + public bool NoDependencyUpdate { get; set; } + + public bool IgnoreS7Pragmas { get; set; } /// @@ -150,5 +152,6 @@ private static void OverridesFromCli(ICompilerOptions fromConfig, ICompilerOptio fromConfig.OutputProjectFolder = newCompilerOptions.OutputProjectFolder ?? fromConfig.OutputProjectFolder; fromConfig.ProjectFile = string.IsNullOrEmpty(newCompilerOptions.ProjectFile) ? fromConfig.ProjectFile : newCompilerOptions.ProjectFile; fromConfig.NoDependencyUpdate = newCompilerOptions.NoDependencyUpdate; + fromConfig.IgnoreS7Pragmas = newCompilerOptions.IgnoreS7Pragmas; } } \ No newline at end of file diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs index 5d998839..dfc86d35 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/AXSharpProject.cs @@ -47,6 +47,8 @@ public AXSharpProject(AxProject axProject, IEnumerable builderTypes, Type CompilerOptions = AXSharpConfig.UpdateAndGetAXSharpConfig(axProject.ProjectFolder, cliCompilerOptions); OutputFolder = Path.GetFullPath(Path.Combine(AxProject.ProjectFolder, CompilerOptions.OutputProjectFolder)); if (cliCompilerOptions != null) UseBaseSymbol = cliCompilerOptions.UseBase; + + BuilderTypes = builderTypes; TargetProject = Activator.CreateInstance(targetProjectType, this) as ITargetProject ?? throw new InvalidOperationException("Target project type must implement ITargetProject interface."); diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/Core/ISourceBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/Core/ISourceBuilder.cs index 26c14b00..d0c11541 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/Core/ISourceBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/Core/ISourceBuilder.cs @@ -39,5 +39,9 @@ public interface ISourceBuilder /// /// Get the semantic compilation for this builder. /// - public Compilation Compilation { get; } + Compilation Compilation { get; } + + ICompilerOptions? CompilerOptions { get; } + + eCommAccessibility TypeCommAccessibility { get; } } \ No newline at end of file diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/Core/eCommAccessibility.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/Core/eCommAccessibility.cs new file mode 100644 index 00000000..d2c8ebef --- /dev/null +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/Core/eCommAccessibility.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AXSharp.Compiler.Core +{ + public enum eCommAccessibility + { + None, + ReadWrite, + ReadOnly, + } +} diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Helpers/SemanticsHelpers.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Helpers/SemanticsHelpers.cs index a7ef0f1d..7b35f328 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Helpers/SemanticsHelpers.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Helpers/SemanticsHelpers.cs @@ -29,7 +29,7 @@ public static class SemanticsHelpers public static bool IsMemberEligibleForTranspile(this IFieldDeclaration field, ISourceBuilder sourceBuilder, string coBuilder = "") { return field.AccessModifier == AccessModifier.Public - && field.Type.IsTypeEligibleForTranspile(sourceBuilder) + && field.IsEligibleForTranspile(sourceBuilder) && !IsToBeOmitted(field, sourceBuilder, coBuilder); } @@ -75,28 +75,72 @@ private static bool IsToBeOmitted(this IStorageDeclaration fieldDeclaration, ISo /// /// Determines whether the member or type is eligible for generation. /// - /// + /// /// - /// - public static bool IsTypeEligibleForTranspile(this ITypeDeclaration typeDeclaration, ISourceBuilder sourceBuilder) + /// True when the type is eligible + public static bool IsEligibleForTranspile(this IFieldDeclaration fieldDeclaration, ISourceBuilder sourceBuilder) { - var asArray = typeDeclaration as IArrayTypeDeclaration; - var singleDimensionalArray = asArray is null || asArray.Dimensions.Count == 1; + var type = fieldDeclaration.Type; + return !(type is IReferenceTypeDeclaration) + && + fieldDeclaration.IsAvailableForComm(sourceBuilder) + && + (type is IScalarTypeDeclaration || + type is IStringTypeDeclaration || + type is IStructuredTypeDeclaration || + type is INamedValueTypeDeclaration || + sourceBuilder.Compilation.GetSemanticTree().Types.Any(p => + p.FullyQualifiedName == type.FullyQualifiedName)); + } + /// + /// Determines whether the member or type is eligible for generation. + /// + /// + /// + /// True when the type is eligible + public static bool IsEligibleForTranspile(this IVariableDeclaration variableDeclaration, ISourceBuilder sourceBuilder) + { + var type = variableDeclaration.Type; + return !(type is IReferenceTypeDeclaration) + && + variableDeclaration.IsAvailableForComm(sourceBuilder) + && + (type is IScalarTypeDeclaration || + type is IStringTypeDeclaration || + type is IStructuredTypeDeclaration || + type is INamedValueTypeDeclaration || + sourceBuilder.Compilation.GetSemanticTree().Types.Any(p => + p.FullyQualifiedName == type.FullyQualifiedName)); + } + + + /// + /// Determines whether the member is eligible for generation. + /// + /// + /// Source builder + /// + public static bool IsEligibleForTranspile(this IArrayTypeDeclaration arrayTypeDeclaration, ISourceBuilder sourceBuilder) + { + var singleDimensionalArray = arrayTypeDeclaration.Dimensions.Count == 1; - var isEligibleType = !(typeDeclaration is IReferenceTypeDeclaration) + var isEligibleType = !(arrayTypeDeclaration.ElementTypeAccess.Type is IReferenceTypeDeclaration) && - (typeDeclaration is IScalarTypeDeclaration || - typeDeclaration is IStringTypeDeclaration || - typeDeclaration is IStructuredTypeDeclaration || - typeDeclaration is INamedValueTypeDeclaration || + arrayTypeDeclaration.IsAvailableForComm(sourceBuilder) + && + (arrayTypeDeclaration.ElementTypeAccess.Type is IScalarTypeDeclaration || + arrayTypeDeclaration.ElementTypeAccess.Type is IStringTypeDeclaration || + arrayTypeDeclaration.ElementTypeAccess.Type is IStructuredTypeDeclaration || + arrayTypeDeclaration.ElementTypeAccess.Type is INamedValueTypeDeclaration || sourceBuilder.Compilation.GetSemanticTree().Types.Any(p => - p.FullyQualifiedName == typeDeclaration.FullyQualifiedName)); + p.FullyQualifiedName == arrayTypeDeclaration.ElementTypeAccess.Type.FullyQualifiedName)); return isEligibleType && singleDimensionalArray; } + /// /// Determines whether the member is eligible for generation. /// @@ -107,7 +151,7 @@ typeDeclaration is INamedValueTypeDeclaration || public static bool IsMemberEligibleForTranspile(this IVariableDeclaration variable, ISourceBuilder sourceBuilder, string coBuilder = "") { return variable.IsInGlobalMemory - && variable.Type.IsTypeEligibleForTranspile(sourceBuilder) + && variable.IsEligibleForTranspile(sourceBuilder) && !IsToBeOmitted(variable, sourceBuilder, coBuilder); } @@ -135,15 +179,66 @@ public static bool IsMemberEligibleForConstructor(this IVariableDeclaration vari return variable.IsMemberEligibleForTranspile(sourceBuilder, coBuilder); } - /// - /// Determines whether the member is eligible for generation. - /// - /// - /// Source builder - /// + private static bool IsAvailableForComm(this IDeclaration declaration, ISourceBuilder sourceBuilder) + { + if (sourceBuilder.CompilerOptions is { IgnoreS7Pragmas: true }) return true; + var pragmaReadWrite = "S7.extern=ReadWrite".ToLower(); + var pragmaRead = "S7.extern=ReadOnly".ToLower(); + return declaration.Pragmas.Any(p => + { + var prgma = p.Content.ToLower().Replace(" ", string.Empty, StringComparison.InvariantCulture); + return (prgma == pragmaReadWrite || prgma == pragmaRead); + }) || (sourceBuilder.TypeCommAccessibility == eCommAccessibility.ReadOnly || sourceBuilder.TypeCommAccessibility == eCommAccessibility.ReadWrite); + } + internal static bool IsAvailableReadOnlyForComm(this IDeclaration declaration, ISourceBuilder sourceBuilder) + { + if (sourceBuilder.CompilerOptions is { IgnoreS7Pragmas: true }) return false; + + var pargmaContent = "S7.extern=Read".ToLower(); + return declaration.Pragmas.Any(p => + { + var prgma = p.Content.ToLower().Replace(" ", string.Empty, StringComparison.InvariantCulture); + return (prgma == pargmaContent); + }); + } + + private static bool IsAvailableReadWriteForComm(this IDeclaration declaration, ISourceBuilder sourceBuilder) + { + if (sourceBuilder.CompilerOptions is { IgnoreS7Pragmas: true }) return false; + + var pargmaContent = "S7.extern=ReadWrite".ToLower(); + return declaration.Pragmas.Any(p => + { + var prgma = p.Content.ToLower().Replace(" ", string.Empty, StringComparison.InvariantCulture); + return (prgma == pargmaContent); + }); + } + + public static eCommAccessibility GetCommAccessibility(this IDeclaration declaration, ISourceBuilder sourceBuilder) + { + + if (declaration.IsAvailableReadOnlyForComm(sourceBuilder)) + { + return eCommAccessibility.ReadOnly; + } + + if (declaration.IsAvailableReadWriteForComm(sourceBuilder)) + { + return eCommAccessibility.ReadWrite; + } + + return eCommAccessibility.None; + } + + + + + + public static bool IsMemberEligibleForConstructor(this IArrayTypeDeclaration arrayTypeDeclaration, ISourceBuilder sourceBuilder) { - return arrayTypeDeclaration.ElementTypeAccess.Type.IsTypeEligibleForTranspile(sourceBuilder); + return IsEligibleForTranspile(arrayTypeDeclaration, sourceBuilder); + } /// diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerConfigurationConstructorBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerConfigurationConstructorBuilder.cs index 9d811a81..e1592e99 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerConfigurationConstructorBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerConfigurationConstructorBuilder.cs @@ -75,7 +75,7 @@ public override void CreateVariableDeclaration(IVariableDeclaration semantics, I } AddToSource(semantics.SetProperties()); - AddToSource(semantics.AddAnnotations()); + AddToSource(semantics.AddAnnotations(this.SourceBuilder)); } } diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerConstructorBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerConstructorBuilder.cs index d285be10..bf2da32a 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerConstructorBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerConstructorBuilder.cs @@ -94,7 +94,7 @@ public void CreateFieldDeclaration(IFieldDeclaration fieldDeclaration, IxNodeVis } AddToSource(fieldDeclaration.SetProperties()); - AddToSource(fieldDeclaration.AddAnnotations()); + AddToSource(fieldDeclaration.AddAnnotations(this.SourceBuilder)); } } diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerMemberBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerMemberBuilder.cs index 967ca34b..35105da0 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerMemberBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerMemberBuilder.cs @@ -72,7 +72,7 @@ public void CreateFieldDeclaration(IFieldDeclaration fieldDeclaration, IxNodeVis AddToSource("{get;}"); break; case IArrayTypeDeclaration array: - if (array.ElementTypeAccess.Type.IsTypeEligibleForTranspile(SourceBuilder)) + if (array.IsEligibleForTranspile(SourceBuilder)) { AddToSource($"{fieldDeclaration.AccessModifier.Transform()} "); fieldDeclaration.Type.Accept(visitor, this); @@ -161,7 +161,7 @@ public void CreateVariableDeclaration(IVariableDeclaration semantics, IxNodeVisi AddToSource("{get;}"); break; case IArrayTypeDeclaration array: - if (array.ElementTypeAccess.Type.IsTypeEligibleForTranspile(SourceBuilder)) + if (array.IsEligibleForTranspile(SourceBuilder)) { AddToSource($"public"); semantics.Type.Accept(visitor, this); diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerOnlineToPlainBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerOnlineToPlainBuilder.cs index 667fc36d..3e6e7928 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerOnlineToPlainBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerOnlineToPlainBuilder.cs @@ -54,6 +54,7 @@ public void CreateVariableDeclaration(IVariableDeclaration variableDeclaration, } } + internal void CreateAssignment(ITypeDeclaration typeDeclaration, IDeclaration declaration) { switch (typeDeclaration) @@ -68,18 +69,23 @@ internal void CreateAssignment(ITypeDeclaration typeDeclaration, IDeclaration de AddToSource($"#pragma warning restore CS0612\n"); break; case IArrayTypeDeclaration arrayTypeDeclaration: - switch (arrayTypeDeclaration.ElementTypeAccess.Type) + if (arrayTypeDeclaration.IsMemberEligibleForConstructor(SourceBuilder)) { - case IClassDeclaration classDeclaration: - case IStructuredTypeDeclaration structuredTypeDeclaration: - AddToSource($"#pragma warning disable CS0612\n"); - AddToSource($"plain.{declaration.Name} = {declaration.Name}.Select(async p => await p.{MethodNameNoac}Async()).Select(p => p.Result).ToArray();"); - AddToSource($"#pragma warning restore CS0612\n"); - break; - case IScalarTypeDeclaration scalarTypeDeclaration: - case IStringTypeDeclaration stringTypeDeclaration: - AddToSource($"plain.{declaration.Name} = {declaration.Name}.Select(p => p.LastValue).ToArray();"); - break; + switch (arrayTypeDeclaration.ElementTypeAccess.Type) + { + case IClassDeclaration classDeclaration: + case IStructuredTypeDeclaration structuredTypeDeclaration: + AddToSource($"#pragma warning disable CS0612\n"); + AddToSource( + $"plain.{declaration.Name} = {declaration.Name}.Select(async p => await p.{MethodNameNoac}Async()).Select(p => p.Result).ToArray();"); + AddToSource($"#pragma warning restore CS0612\n"); + break; + case IScalarTypeDeclaration scalarTypeDeclaration: + case IStringTypeDeclaration stringTypeDeclaration: + AddToSource( + $"plain.{declaration.Name} = {declaration.Name}.Select(p => p.LastValue).ToArray();"); + break; + } } break; case IReferenceTypeDeclaration referenceTypeDeclaration: diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerPlainToOnlineBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerPlainToOnlineBuilder.cs index 199f3e35..fd6ca8ec 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerPlainToOnlineBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerPlainToOnlineBuilder.cs @@ -69,25 +69,30 @@ private void CreateAssignment(ITypeDeclaration typeDeclaration, IDeclaration dec AddToSource($"#pragma warning restore CS0612\n"); break; case IArrayTypeDeclaration arrayTypeDeclaration: - - switch (arrayTypeDeclaration.ElementTypeAccess.Type) + if (arrayTypeDeclaration.IsMemberEligibleForConstructor(SourceBuilder)) { - case IClassDeclaration classDeclaration: - case IStructuredTypeDeclaration structuredTypeDeclaration: - AddToSource($"var _{declaration.Name}_i_FE8484DAB3 = 0;"); - AddToSource($"#pragma warning disable CS0612\n"); - AddToSource($"{declaration.Name}.Select(p => p.{MethodNameNoac}Async(plain.{declaration.Name}[_{declaration.Name}_i_FE8484DAB3++])).ToArray();"); - AddToSource($"#pragma warning restore CS0612\n"); - break; - case IScalarTypeDeclaration scalarTypeDeclaration: - case IStringTypeDeclaration stringTypeDeclaration: - AddToSource($"var _{declaration.Name}_i_FE8484DAB3 = 0;"); - AddToSource($"#pragma warning disable CS0612\n"); - AddToSource($"{declaration.Name}.Select(p => p.LethargicWrite(plain.{declaration.Name}[_{declaration.Name}_i_FE8484DAB3++])).ToArray();"); - AddToSource($"#pragma warning restore CS0612\n"); - break; + switch (arrayTypeDeclaration.ElementTypeAccess.Type) + { + case IClassDeclaration classDeclaration: + case IStructuredTypeDeclaration structuredTypeDeclaration: + AddToSource($"var _{declaration.Name}_i_FE8484DAB3 = 0;"); + AddToSource($"#pragma warning disable CS0612\n"); + AddToSource( + $"{declaration.Name}.Select(p => p.{MethodNameNoac}Async(plain.{declaration.Name}[_{declaration.Name}_i_FE8484DAB3++])).ToArray();"); + AddToSource($"#pragma warning restore CS0612\n"); + break; + case IScalarTypeDeclaration scalarTypeDeclaration: + case IStringTypeDeclaration stringTypeDeclaration: + AddToSource($"var _{declaration.Name}_i_FE8484DAB3 = 0;"); + AddToSource($"#pragma warning disable CS0612\n"); + AddToSource( + $"{declaration.Name}.Select(p => p.LethargicWrite(plain.{declaration.Name}[_{declaration.Name}_i_FE8484DAB3++])).ToArray();"); + AddToSource($"#pragma warning restore CS0612\n"); + break; + } } + break; case IReferenceTypeDeclaration referenceTypeDeclaration: break; diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerPlainToShadowBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerPlainToShadowBuilder.cs index 7574fa66..e23b1ea6 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerPlainToShadowBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerPlainToShadowBuilder.cs @@ -67,20 +67,25 @@ private void CreateAssignment(ITypeDeclaration typeDeclaration, IDeclaration dec break; case IArrayTypeDeclaration arrayTypeDeclaration: - - switch (arrayTypeDeclaration.ElementTypeAccess.Type) + if (arrayTypeDeclaration.IsMemberEligibleForConstructor(SourceBuilder)) { - case IClassDeclaration classDeclaration: - case IStructuredTypeDeclaration structuredTypeDeclaration: - AddToSource($"var _{declaration.Name}_i_FE8484DAB3 = 0;"); - AddToSource($"{declaration.Name}.Select(p => p.{MethodName}Async(plain.{declaration.Name}[_{declaration.Name}_i_FE8484DAB3++])).ToArray();"); - break; - case IScalarTypeDeclaration scalarTypeDeclaration: - case IStringTypeDeclaration stringTypeDeclaration: - AddToSource($"var _{declaration.Name}_i_FE8484DAB3 = 0;"); - AddToSource($"{declaration.Name}.Select(p => p.Shadow = plain.{declaration.Name}[_{declaration.Name}_i_FE8484DAB3++]).ToArray();"); - break; + switch (arrayTypeDeclaration.ElementTypeAccess.Type) + { + case IClassDeclaration classDeclaration: + case IStructuredTypeDeclaration structuredTypeDeclaration: + AddToSource($"var _{declaration.Name}_i_FE8484DAB3 = 0;"); + AddToSource( + $"{declaration.Name}.Select(p => p.{MethodName}Async(plain.{declaration.Name}[_{declaration.Name}_i_FE8484DAB3++])).ToArray();"); + break; + case IScalarTypeDeclaration scalarTypeDeclaration: + case IStringTypeDeclaration stringTypeDeclaration: + AddToSource($"var _{declaration.Name}_i_FE8484DAB3 = 0;"); + AddToSource( + $"{declaration.Name}.Select(p => p.Shadow = plain.{declaration.Name}[_{declaration.Name}_i_FE8484DAB3++]).ToArray();"); + break; + } } + break; case IReferenceTypeDeclaration referenceTypeDeclaration: break; diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerShadowToPlainBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerShadowToPlainBuilder.cs index 714ada20..3a0ede03 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerShadowToPlainBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerPlainerShadowToPlainBuilder.cs @@ -66,18 +66,24 @@ internal void CreateAssignment(ITypeDeclaration typeDeclaration, IDeclaration de AddToSource($" plain.{declaration.Name} = await {declaration.Name}.{MethodName}Async();"); break; case IArrayTypeDeclaration arrayTypeDeclaration: - switch (arrayTypeDeclaration.ElementTypeAccess.Type) + if (arrayTypeDeclaration.IsMemberEligibleForConstructor(SourceBuilder)) { - case IClassDeclaration classDeclaration: - case IStructuredTypeDeclaration structuredTypeDeclaration: - AddToSource($"plain.{declaration.Name} = {declaration.Name}.Select(async p => await p.{MethodName}Async()).Select(p => p.Result).ToArray();"); - break; - case IScalarTypeDeclaration scalarTypeDeclaration: - case IStringTypeDeclaration stringTypeDeclaration: - - AddToSource($"plain.{declaration.Name} = {declaration.Name}.Select(p => p.Shadow).ToArray();"); - break; + switch (arrayTypeDeclaration.ElementTypeAccess.Type) + { + case IClassDeclaration classDeclaration: + case IStructuredTypeDeclaration structuredTypeDeclaration: + AddToSource( + $"plain.{declaration.Name} = {declaration.Name}.Select(async p => await p.{MethodName}Async()).Select(p => p.Result).ToArray();"); + break; + case IScalarTypeDeclaration scalarTypeDeclaration: + case IStringTypeDeclaration stringTypeDeclaration: + + AddToSource( + $"plain.{declaration.Name} = {declaration.Name}.Select(p => p.Shadow).ToArray();"); + break; + } } + break; case IReferenceTypeDeclaration referenceTypeDeclaration: break; diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs index 5c841f88..9c410d0b 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs @@ -36,11 +36,14 @@ public CsOnlinerSourceBuilder(AXSharpProject project, { Project = project; Compilation = compilation; + CompilerOptions = project.CompilerOptions; } /// public Compilation Compilation { get; } + public ICompilerOptions? CompilerOptions { get; } + private AXSharpProject Project { get; } /// @@ -92,11 +95,15 @@ private string ReplaceGenericSignature(IClassDeclaration? classDeclaration) return genericSignature; } + public eCommAccessibility TypeCommAccessibility { get; private set; } + /// public void CreateClassDeclaration(IClassDeclarationSyntax classDeclarationSyntax, IClassDeclaration classDeclaration, IxNodeVisitor visitor) { + TypeCommAccessibility = classDeclaration.GetCommAccessibility(this); + classDeclarationSyntax.UsingDirectives.ToList().ForEach(p => p.Visit(visitor, this)); var generic = classDeclaration.GetGenericAttributes(); @@ -161,6 +168,8 @@ public void CreateConfigDeclaration(IConfigDeclarationSyntax configDeclarationSy IConfigurationDeclaration configurationDeclaration, IxNodeVisitor visitor) { + TypeCommAccessibility = eCommAccessibility.None; + AddToSource( $"public partial class {Project.TargetProject.ProjectRootNamespace}TwinController : ITwinController {{"); AddToSource($"public {typeof(Connector.Connector).n()} Connector {{ get; }}"); @@ -173,6 +182,8 @@ public void CreateConfigDeclaration(IConfigDeclarationSyntax configDeclarationSy /// public void CreateConfigDeclaration(IConfigurationDeclaration configurationDeclaration, IxNodeVisitor visitor) { + TypeCommAccessibility = eCommAccessibility.None; + AddToSource($"public partial class {Project.TargetProject.ProjectRootNamespace} : ITwinController {{"); AddToSource(@$"public {typeof(Connector.Connector).n()} Connector {{ get; }}"); AddToSource(CsOnlinerConstructorBuilder.Create(visitor, configurationDeclaration, Project, this).Output); @@ -184,6 +195,8 @@ public void CreateEnumTypeDeclaration(IEnumTypeDeclarationSyntax enumTypeDeclara ITypeDeclaration typeDeclaration, IxNodeVisitor visitor) { + TypeCommAccessibility = eCommAccessibility.None; + AddToSource($"public enum {enumTypeDeclarationSyntax.Name.Text} {{"); AddToSource(string.Join("\n,", enumTypeDeclarationSyntax.EnumValues.Select(p => p.Name.Text))); AddToSource("}"); @@ -193,6 +206,8 @@ public void CreateEnumTypeDeclaration(IEnumTypeDeclarationSyntax enumTypeDeclara public void CreateNamedValueTypeDeclaration(INamedValueTypeDeclarationSyntax namedValueTypeDeclarationSyntax, INamedValueTypeDeclaration namedValueTypeDeclaration, IxNodeVisitor visitor) { + TypeCommAccessibility = eCommAccessibility.None; + AddToSource( $"public enum {namedValueTypeDeclarationSyntax.Name.Text} : {namedValueTypeDeclarationSyntax.Type.TransformType()} {{"); @@ -242,6 +257,8 @@ public void CreateInterfaceDeclaration(IInterfaceDeclarationSyntax interfaceDecl IInterfaceDeclaration interfaceDeclaration, IxNodeVisitor visitor) { + TypeCommAccessibility = eCommAccessibility.None; + AddToSource($"{interfaceDeclaration.AccessModifier.Transform()} partial interface {interfaceDeclaration.Name} {{}}"); } @@ -256,6 +273,8 @@ public void CreateStructuredType(IStructTypeDeclarationSyntax structTypeDeclarat IStructuredTypeDeclaration structuredTypeDeclaration, IxNodeVisitor visitor) { + TypeCommAccessibility = structuredTypeDeclaration.GetCommAccessibility(this); + AddToSource(structuredTypeDeclaration.Pragmas.AddAttributes()); AddToSource( $"{structuredTypeDeclaration.AccessModifier.Transform()}partial class {structTypeDeclarationSyntax.Name.Text}"); diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs index 95e384ca..a44ced5d 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Plain/CsPlainSourceBuilder.cs @@ -33,6 +33,7 @@ public CsPlainSourceBuilder(AXSharpProject project, { Project = project; Compilation = compilation; + CompilerOptions = project.CompilerOptions; } private AXSharpProject Project { get; } @@ -40,6 +41,10 @@ public CsPlainSourceBuilder(AXSharpProject project, /// public Compilation Compilation { get; } + public ICompilerOptions? CompilerOptions { get; } + + public eCommAccessibility TypeCommAccessibility { get; private set; } + private StringBuilder _sourceBuilder { get; } = new(); @@ -48,6 +53,8 @@ public void CreateClassDeclaration(IClassDeclarationSyntax classDeclarationSynta IClassDeclaration classDeclaration, IxNodeVisitor visitor) { + TypeCommAccessibility = classDeclaration.GetCommAccessibility(this); + classDeclarationSyntax.UsingDirectives.ToList().ForEach(p => p.Visit(visitor, this)); AddToSource($"{classDeclaration.AccessModifier.Transform()}partial class {classDeclaration.Name}"); @@ -92,7 +99,7 @@ public void CreateFieldDeclaration(IFieldDeclaration fieldDeclaration, IxNodeVis switch (fieldDeclaration.Type) { case IArrayTypeDeclaration arrayType: - if (arrayType.ElementTypeAccess.Type.IsTypeEligibleForTranspile(this)) + if (arrayType.IsEligibleForTranspile(this)) { fieldDeclaration.Pragmas.AddAttributes(); AddToSource($"{fieldDeclaration.AccessModifier.Transform()}"); @@ -171,6 +178,8 @@ public void CreateConfigDeclaration(IConfigDeclarationSyntax configDeclarationSy IConfigurationDeclaration configurationDeclaration, IxNodeVisitor visitor) { + TypeCommAccessibility = eCommAccessibility.None; + AddToSource($"public partial class {Project.TargetProject.ProjectRootNamespace}TwinController{{"); configurationDeclaration.Variables.ToList().ForEach(p => p.Accept(visitor, this)); AddToSource("}"); @@ -232,7 +241,7 @@ public void CreateVariableDeclaration(IVariableDeclaration fieldDeclaration, IxN switch (fieldDeclaration.Type) { case IArrayTypeDeclaration arrayType: - if (arrayType.ElementTypeAccess.Type.IsTypeEligibleForTranspile(this)) + if (arrayType.IsEligibleForTranspile(this)) { fieldDeclaration.Pragmas.AddAttributes(); AddToSource($"public"); @@ -279,6 +288,8 @@ public void CreateStructuredType(IStructTypeDeclarationSyntax structTypeDeclarat IStructuredTypeDeclaration structuredTypeDeclaration, IxNodeVisitor visitor) { + TypeCommAccessibility = structuredTypeDeclaration.GetCommAccessibility(this); + AddToSource( $"{structuredTypeDeclaration.AccessModifier.Transform()}partial class {structTypeDeclarationSyntax.Name.Text} "); AddToSource("{"); @@ -319,7 +330,7 @@ public void CreateInterfaceDeclaration(IInterfaceDeclaration interfaceDeclaratio /// public void CreateArrayTypeDeclaration(IArrayTypeDeclaration arrayTypeDeclaration, IxNodeVisitor visitor) { - if (arrayTypeDeclaration.ElementTypeAccess.Type.IsTypeEligibleForTranspile(this)) return; + if (arrayTypeDeclaration.IsEligibleForTranspile(this)) return; arrayTypeDeclaration.ElementTypeAccess.Type.Accept(visitor, this); AddToSource("[]"); diff --git a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaExtensions.cs b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaExtensions.cs index 8812b015..ccb052fd 100644 --- a/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaExtensions.cs +++ b/src/AXSharp.compiler/src/AXSharp.Cs.Compiler/Pragmas/PragmaExtensions.cs @@ -9,6 +9,7 @@ using AX.ST.Semantic.Model.Declarations; using AX.ST.Semantic.Model.Declarations.Types; using AX.ST.Semantic.Pragmas; +using AXSharp.Compiler.Core; using AXSharp.Compiler.Cs.Pragmas.PragmaParser; namespace AXSharp.Compiler.Cs; @@ -135,8 +136,9 @@ public static string GetPropertyValue(this IDeclaration declaration, string prop /// Produces statement to annotate the member based on attributes. /// /// Declaration + /// Source builder. /// Annotation statements - public static string AddAnnotations(this IDeclaration declaration) + public static string AddAnnotations(this IDeclaration declaration, ISourceBuilder sourceBuilder) { var sb = new StringBuilder(); foreach (var attribute in @@ -157,6 +159,11 @@ public static string AddAnnotations(this IDeclaration declaration) sb.AppendLine($"{declaration.Name}.MakeReadOnly();"); break; } + + if (declaration.IsAvailableReadOnlyForComm(sourceBuilder)) + { + sb.AppendLine($"{declaration.Name}.MakeReadOnly();"); + } } diff --git a/src/AXSharp.compiler/src/ixc/Options.cs b/src/AXSharp.compiler/src/ixc/Options.cs index ce0fe9ad..76901a15 100644 --- a/src/AXSharp.compiler/src/ixc/Options.cs +++ b/src/AXSharp.compiler/src/ixc/Options.cs @@ -33,5 +33,9 @@ internal class Options : ICompilerOptions [Option('u', "no-dependency-update", Required = false, Default = false, HelpText = "Prevent dependency of twins from apax")] public bool NoDependencyUpdate { get; set; } + + [Option('s', "no-s7-pragmas", Required = false, Default = false, + HelpText = "Compiler ignores S7.Extern=ReadWrite & S7.Extern=ReadOnly. Compiles all types and members regardless comm settings.")] + public bool IgnoreS7Pragmas { get; set; } } diff --git a/src/AXSharp.compiler/src/ixd/Options.cs b/src/AXSharp.compiler/src/ixd/Options.cs index f3851f9d..28074e17 100644 --- a/src/AXSharp.compiler/src/ixd/Options.cs +++ b/src/AXSharp.compiler/src/ixd/Options.cs @@ -30,5 +30,7 @@ internal class Options : ICompilerOptions [Option('p', "project-file", Required = false, Default = "", HelpText = "(ignored here)Output project file")] public string? ProjectFile { get; set; } + + public bool IgnoreS7Pragmas { get; set; } } } diff --git a/src/AXSharp.compiler/src/ixr/Options.cs b/src/AXSharp.compiler/src/ixr/Options.cs index c78419f6..1d5fa6c4 100644 --- a/src/AXSharp.compiler/src/ixr/Options.cs +++ b/src/AXSharp.compiler/src/ixr/Options.cs @@ -30,6 +30,6 @@ internal class Options : ICompilerOptions HelpText = "Prevent dependency of twins from apax")] public bool NoDependencyUpdate { get; set; } - + public bool IgnoreS7Pragmas { get; set; } } } diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/AXSharp.Compiler.CsTests.csproj b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/AXSharp.Compiler.CsTests.csproj index b5e09d89..51b9e24e 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/AXSharp.Compiler.CsTests.csproj +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/AXSharp.Compiler.CsTests.csproj @@ -59,6 +59,18 @@ + + + PreserveNewest + + + + + + Always + + + PreserveNewest @@ -391,9 +403,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -440,5 +452,8 @@ Always + + Always + diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Cs/CsSourceBuilderTests.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Cs/CsSourceBuilderTests.cs index c06487a2..52058070 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Cs/CsSourceBuilderTests.cs +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/Cs/CsSourceBuilderTests.cs @@ -265,6 +265,15 @@ public void class_generic_extension() CompareOutputs(memberName); } + [Fact] + public void mixed_access() + { + var memberName = GetMethodName(); + CompareOutputs(memberName); + } + + + private void CompareOutputs(string memberName) { var sourceFile = Path.Combine(testFolder, $@"samples\units\src\{memberName}.st"); diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/mixed_access.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/mixed_access.g.cs new file mode 100644 index 00000000..75b51b17 --- /dev/null +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/Onliners/mixed_access.g.cs @@ -0,0 +1,1383 @@ +using System; +using AXSharp.Connector; +using AXSharp.Connector.ValueTypes; +using System.Collections.Generic; +using AXSharp.Connector.Localizations; + +public partial class unitsTwinController : ITwinController +{ + public AXSharp.Connector.Connector Connector { get; } + + public OnlinerBool MotorOn { get; } + + public OnlinerInt MotorState { get; } + + public Motor Motor1 { get; } + + public Motor Motor2 { get; } + + public struct1 s1 { get; } + + public struct4 s4 { get; } + + public SpecificMotorA mot1 { get; } + + public unitsTwinController(AXSharp.Connector.ConnectorAdapter adapter, object[] parameters) + { + this.Connector = adapter.GetConnector(parameters); + MotorOn = @Connector.ConnectorAdapter.AdapterFactory.CreateBOOL(this.Connector, "", "MotorOn"); + MotorState = @Connector.ConnectorAdapter.AdapterFactory.CreateINT(this.Connector, "", "MotorState"); + Motor1 = new Motor(this.Connector, "", "Motor1"); + Motor2 = new Motor(this.Connector, "", "Motor2"); + s1 = new struct1(this.Connector, "", "s1"); + s4 = new struct4(this.Connector, "", "s4"); + mot1 = new SpecificMotorA(this.Connector, "", "mot1"); + } + + public unitsTwinController(AXSharp.Connector.ConnectorAdapter adapter) + { + this.Connector = adapter.GetConnector(adapter.Parameters); + MotorOn = @Connector.ConnectorAdapter.AdapterFactory.CreateBOOL(this.Connector, "", "MotorOn"); + MotorState = @Connector.ConnectorAdapter.AdapterFactory.CreateINT(this.Connector, "", "MotorState"); + Motor1 = new Motor(this.Connector, "", "Motor1"); + Motor2 = new Motor(this.Connector, "", "Motor2"); + s1 = new struct1(this.Connector, "", "s1"); + s4 = new struct4(this.Connector, "", "s4"); + mot1 = new SpecificMotorA(this.Connector, "", "mot1"); + } +} + +public partial class Motor : AXSharp.Connector.ITwinObject +{ + public OnlinerBool Run { get; } + + partial void PreConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); + partial void PostConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); + public Motor(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) + { + Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); + this.@SymbolTail = symbolTail; + this.@Connector = parent.GetConnector(); + this.@Parent = parent; + HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); + PreConstruct(parent, readableTail, symbolTail); + Run = @Connector.ConnectorAdapter.AdapterFactory.CreateBOOL(this, "Run", "Run"); + parent.AddChild(this); + parent.AddKid(this); + PostConstruct(parent, readableTail, symbolTail); + } + + public async virtual Task OnlineToPlain() + { + return await (dynamic)this.OnlineToPlainAsync(); + } + + public async Task OnlineToPlainAsync() + { + Pocos.Motor plain = new Pocos.Motor(); + await this.ReadAsync(); + plain.Run = Run.LastValue; + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _OnlineToPlainNoacAsync() + { + Pocos.Motor plain = new Pocos.Motor(); + plain.Run = Run.LastValue; + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected async Task _OnlineToPlainNoacAsync(Pocos.Motor plain) + { + plain.Run = Run.LastValue; + return plain; + } + + public async virtual Task PlainToOnline(T plain) + { + await this.PlainToOnlineAsync((dynamic)plain); + } + + public async Task> PlainToOnlineAsync(Pocos.Motor plain) + { +#pragma warning disable CS0612 + Run.LethargicWrite(plain.Run); +#pragma warning restore CS0612 + return await this.WriteAsync(); + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _PlainToOnlineNoacAsync(Pocos.Motor plain) + { +#pragma warning disable CS0612 + Run.LethargicWrite(plain.Run); +#pragma warning restore CS0612 + } + + public async virtual Task ShadowToPlain() + { + return await (dynamic)this.ShadowToPlainAsync(); + } + + public async Task ShadowToPlainAsync() + { + Pocos.Motor plain = new Pocos.Motor(); + plain.Run = Run.Shadow; + return plain; + } + + protected async Task ShadowToPlainAsync(Pocos.Motor plain) + { + plain.Run = Run.Shadow; + return plain; + } + + public async virtual Task PlainToShadow(T plain) + { + await this.PlainToShadowAsync((dynamic)plain); + } + + public async Task> PlainToShadowAsync(Pocos.Motor plain) + { + Run.Shadow = plain.Run; + return this.RetrievePrimitives(); + } + + public void Poll() + { + this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); + } + + public Pocos.Motor CreateEmptyPoco() + { + return new Pocos.Motor(); + } + + private IList Children { get; } = new List(); + public IEnumerable GetChildren() + { + return Children; + } + + private IList Kids { get; } = new List(); + public IEnumerable GetKids() + { + return Kids; + } + + private IList ValueTags { get; } = new List(); + public IEnumerable GetValueTags() + { + return ValueTags; + } + + public void AddValueTag(AXSharp.Connector.ITwinPrimitive valueTag) + { + ValueTags.Add(valueTag); + } + + public void AddKid(AXSharp.Connector.ITwinElement kid) + { + Kids.Add(kid); + } + + public void AddChild(AXSharp.Connector.ITwinObject twinObject) + { + Children.Add(twinObject); + } + + protected AXSharp.Connector.Connector @Connector { get; } + + public AXSharp.Connector.Connector GetConnector() + { + return this.@Connector; + } + + public string GetSymbolTail() + { + return this.SymbolTail; + } + + public AXSharp.Connector.ITwinObject GetParent() + { + return this.@Parent; + } + + public string Symbol { get; protected set; } + + private string _attributeName; + public System.String AttributeName { get => string.IsNullOrEmpty(_attributeName) ? SymbolTail : _attributeName.Interpolate(this).CleanUpLocalizationTokens(); set => _attributeName = value; } + + public System.String GetAttributeName(System.Globalization.CultureInfo culture) + { + return this.Translate(_attributeName, culture).Interpolate(this); + } + + private string _humanReadable; + public string HumanReadable { get => string.IsNullOrEmpty(_humanReadable) ? SymbolTail : _humanReadable.Interpolate(this).CleanUpLocalizationTokens(); set => _humanReadable = value; } + + public System.String GetHumanReadable(System.Globalization.CultureInfo culture) + { + return this.Translate(_humanReadable, culture); + } + + protected System.String @SymbolTail { get; set; } + + protected AXSharp.Connector.ITwinObject @Parent { get; set; } + + public AXSharp.Connector.Localizations.Translator Interpreter => global::units.PlcTranslator.Instance; +} + +public partial class struct1 : AXSharp.Connector.ITwinObject +{ + public struct2 s2 { get; } + + public struct1(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) + { + this.@SymbolTail = symbolTail; + this.@Connector = parent.GetConnector(); + this.@Parent = parent; + HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); + Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); + s2 = new struct2(this, "s2", "s2"); + parent.AddChild(this); + parent.AddKid(this); + } + + public async virtual Task OnlineToPlain() + { + return await (dynamic)this.OnlineToPlainAsync(); + } + + public async Task OnlineToPlainAsync() + { + Pocos.struct1 plain = new Pocos.struct1(); + await this.ReadAsync(); +#pragma warning disable CS0612 + plain.s2 = await s2._OnlineToPlainNoacAsync(); +#pragma warning restore CS0612 + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _OnlineToPlainNoacAsync() + { + Pocos.struct1 plain = new Pocos.struct1(); +#pragma warning disable CS0612 + plain.s2 = await s2._OnlineToPlainNoacAsync(); +#pragma warning restore CS0612 + return plain; + } + + protected async Task OnlineToPlainAsync(Pocos.struct1 plain) + { +#pragma warning disable CS0612 + plain.s2 = await s2._OnlineToPlainNoacAsync(); +#pragma warning restore CS0612 + return plain; + } + + public async virtual Task PlainToOnline(T plain) + { + await this.PlainToOnlineAsync((dynamic)plain); + } + + public async Task> PlainToOnlineAsync(Pocos.struct1 plain) + { +#pragma warning disable CS0612 + await this.s2._PlainToOnlineNoacAsync(plain.s2); +#pragma warning restore CS0612 + return await this.WriteAsync(); + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _PlainToOnlineNoacAsync(Pocos.struct1 plain) + { +#pragma warning disable CS0612 + await this.s2._PlainToOnlineNoacAsync(plain.s2); +#pragma warning restore CS0612 + } + + public async virtual Task ShadowToPlain() + { + return await (dynamic)this.ShadowToPlainAsync(); + } + + public async Task ShadowToPlainAsync() + { + Pocos.struct1 plain = new Pocos.struct1(); + plain.s2 = await s2.ShadowToPlainAsync(); + return plain; + } + + protected async Task ShadowToPlainAsync(Pocos.struct1 plain) + { + plain.s2 = await s2.ShadowToPlainAsync(); + return plain; + } + + public async virtual Task PlainToShadow(T plain) + { + await this.PlainToShadowAsync((dynamic)plain); + } + + public async Task> PlainToShadowAsync(Pocos.struct1 plain) + { + await this.s2.PlainToShadowAsync(plain.s2); + return this.RetrievePrimitives(); + } + + public void Poll() + { + this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); + } + + public Pocos.struct1 CreateEmptyPoco() + { + return new Pocos.struct1(); + } + + private IList Children { get; } = new List(); + public IEnumerable GetChildren() + { + return Children; + } + + private IList Kids { get; } = new List(); + public IEnumerable GetKids() + { + return Kids; + } + + private IList ValueTags { get; } = new List(); + public IEnumerable GetValueTags() + { + return ValueTags; + } + + public void AddValueTag(AXSharp.Connector.ITwinPrimitive valueTag) + { + ValueTags.Add(valueTag); + } + + public void AddKid(AXSharp.Connector.ITwinElement kid) + { + Kids.Add(kid); + } + + public void AddChild(AXSharp.Connector.ITwinObject twinObject) + { + Children.Add(twinObject); + } + + protected AXSharp.Connector.Connector @Connector { get; } + + public AXSharp.Connector.Connector GetConnector() + { + return this.@Connector; + } + + public string GetSymbolTail() + { + return this.SymbolTail; + } + + public AXSharp.Connector.ITwinObject GetParent() + { + return this.@Parent; + } + + public string Symbol { get; protected set; } + + private string _attributeName; + public System.String AttributeName { get => string.IsNullOrEmpty(_attributeName) ? SymbolTail : _attributeName.Interpolate(this).CleanUpLocalizationTokens(); set => _attributeName = value; } + + public System.String GetAttributeName(System.Globalization.CultureInfo culture) + { + return this.Translate(_attributeName, culture).Interpolate(this); + } + + private string _humanReadable; + public string HumanReadable { get => string.IsNullOrEmpty(_humanReadable) ? SymbolTail : _humanReadable.Interpolate(this).CleanUpLocalizationTokens(); set => _humanReadable = value; } + + public System.String GetHumanReadable(System.Globalization.CultureInfo culture) + { + return this.Translate(_humanReadable, culture); + } + + protected System.String @SymbolTail { get; set; } + + protected AXSharp.Connector.ITwinObject @Parent { get; set; } + + public AXSharp.Connector.Localizations.Translator Interpreter => global::units.PlcTranslator.Instance; +} + +public partial class struct2 : AXSharp.Connector.ITwinObject +{ + public struct3 s3 { get; } + + public struct2(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) + { + this.@SymbolTail = symbolTail; + this.@Connector = parent.GetConnector(); + this.@Parent = parent; + HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); + Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); + s3 = new struct3(this, "s3", "s3"); + parent.AddChild(this); + parent.AddKid(this); + } + + public async virtual Task OnlineToPlain() + { + return await (dynamic)this.OnlineToPlainAsync(); + } + + public async Task OnlineToPlainAsync() + { + Pocos.struct2 plain = new Pocos.struct2(); + await this.ReadAsync(); +#pragma warning disable CS0612 + plain.s3 = await s3._OnlineToPlainNoacAsync(); +#pragma warning restore CS0612 + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _OnlineToPlainNoacAsync() + { + Pocos.struct2 plain = new Pocos.struct2(); +#pragma warning disable CS0612 + plain.s3 = await s3._OnlineToPlainNoacAsync(); +#pragma warning restore CS0612 + return plain; + } + + protected async Task OnlineToPlainAsync(Pocos.struct2 plain) + { +#pragma warning disable CS0612 + plain.s3 = await s3._OnlineToPlainNoacAsync(); +#pragma warning restore CS0612 + return plain; + } + + public async virtual Task PlainToOnline(T plain) + { + await this.PlainToOnlineAsync((dynamic)plain); + } + + public async Task> PlainToOnlineAsync(Pocos.struct2 plain) + { +#pragma warning disable CS0612 + await this.s3._PlainToOnlineNoacAsync(plain.s3); +#pragma warning restore CS0612 + return await this.WriteAsync(); + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _PlainToOnlineNoacAsync(Pocos.struct2 plain) + { +#pragma warning disable CS0612 + await this.s3._PlainToOnlineNoacAsync(plain.s3); +#pragma warning restore CS0612 + } + + public async virtual Task ShadowToPlain() + { + return await (dynamic)this.ShadowToPlainAsync(); + } + + public async Task ShadowToPlainAsync() + { + Pocos.struct2 plain = new Pocos.struct2(); + plain.s3 = await s3.ShadowToPlainAsync(); + return plain; + } + + protected async Task ShadowToPlainAsync(Pocos.struct2 plain) + { + plain.s3 = await s3.ShadowToPlainAsync(); + return plain; + } + + public async virtual Task PlainToShadow(T plain) + { + await this.PlainToShadowAsync((dynamic)plain); + } + + public async Task> PlainToShadowAsync(Pocos.struct2 plain) + { + await this.s3.PlainToShadowAsync(plain.s3); + return this.RetrievePrimitives(); + } + + public void Poll() + { + this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); + } + + public Pocos.struct2 CreateEmptyPoco() + { + return new Pocos.struct2(); + } + + private IList Children { get; } = new List(); + public IEnumerable GetChildren() + { + return Children; + } + + private IList Kids { get; } = new List(); + public IEnumerable GetKids() + { + return Kids; + } + + private IList ValueTags { get; } = new List(); + public IEnumerable GetValueTags() + { + return ValueTags; + } + + public void AddValueTag(AXSharp.Connector.ITwinPrimitive valueTag) + { + ValueTags.Add(valueTag); + } + + public void AddKid(AXSharp.Connector.ITwinElement kid) + { + Kids.Add(kid); + } + + public void AddChild(AXSharp.Connector.ITwinObject twinObject) + { + Children.Add(twinObject); + } + + protected AXSharp.Connector.Connector @Connector { get; } + + public AXSharp.Connector.Connector GetConnector() + { + return this.@Connector; + } + + public string GetSymbolTail() + { + return this.SymbolTail; + } + + public AXSharp.Connector.ITwinObject GetParent() + { + return this.@Parent; + } + + public string Symbol { get; protected set; } + + private string _attributeName; + public System.String AttributeName { get => string.IsNullOrEmpty(_attributeName) ? SymbolTail : _attributeName.Interpolate(this).CleanUpLocalizationTokens(); set => _attributeName = value; } + + public System.String GetAttributeName(System.Globalization.CultureInfo culture) + { + return this.Translate(_attributeName, culture).Interpolate(this); + } + + private string _humanReadable; + public string HumanReadable { get => string.IsNullOrEmpty(_humanReadable) ? SymbolTail : _humanReadable.Interpolate(this).CleanUpLocalizationTokens(); set => _humanReadable = value; } + + public System.String GetHumanReadable(System.Globalization.CultureInfo culture) + { + return this.Translate(_humanReadable, culture); + } + + protected System.String @SymbolTail { get; set; } + + protected AXSharp.Connector.ITwinObject @Parent { get; set; } + + public AXSharp.Connector.Localizations.Translator Interpreter => global::units.PlcTranslator.Instance; +} + +public partial class struct3 : AXSharp.Connector.ITwinObject +{ + public struct4 s4 { get; } + + public struct3(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) + { + this.@SymbolTail = symbolTail; + this.@Connector = parent.GetConnector(); + this.@Parent = parent; + HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); + Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); + s4 = new struct4(this, "s4", "s4"); + parent.AddChild(this); + parent.AddKid(this); + } + + public async virtual Task OnlineToPlain() + { + return await (dynamic)this.OnlineToPlainAsync(); + } + + public async Task OnlineToPlainAsync() + { + Pocos.struct3 plain = new Pocos.struct3(); + await this.ReadAsync(); +#pragma warning disable CS0612 + plain.s4 = await s4._OnlineToPlainNoacAsync(); +#pragma warning restore CS0612 + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _OnlineToPlainNoacAsync() + { + Pocos.struct3 plain = new Pocos.struct3(); +#pragma warning disable CS0612 + plain.s4 = await s4._OnlineToPlainNoacAsync(); +#pragma warning restore CS0612 + return plain; + } + + protected async Task OnlineToPlainAsync(Pocos.struct3 plain) + { +#pragma warning disable CS0612 + plain.s4 = await s4._OnlineToPlainNoacAsync(); +#pragma warning restore CS0612 + return plain; + } + + public async virtual Task PlainToOnline(T plain) + { + await this.PlainToOnlineAsync((dynamic)plain); + } + + public async Task> PlainToOnlineAsync(Pocos.struct3 plain) + { +#pragma warning disable CS0612 + await this.s4._PlainToOnlineNoacAsync(plain.s4); +#pragma warning restore CS0612 + return await this.WriteAsync(); + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _PlainToOnlineNoacAsync(Pocos.struct3 plain) + { +#pragma warning disable CS0612 + await this.s4._PlainToOnlineNoacAsync(plain.s4); +#pragma warning restore CS0612 + } + + public async virtual Task ShadowToPlain() + { + return await (dynamic)this.ShadowToPlainAsync(); + } + + public async Task ShadowToPlainAsync() + { + Pocos.struct3 plain = new Pocos.struct3(); + plain.s4 = await s4.ShadowToPlainAsync(); + return plain; + } + + protected async Task ShadowToPlainAsync(Pocos.struct3 plain) + { + plain.s4 = await s4.ShadowToPlainAsync(); + return plain; + } + + public async virtual Task PlainToShadow(T plain) + { + await this.PlainToShadowAsync((dynamic)plain); + } + + public async Task> PlainToShadowAsync(Pocos.struct3 plain) + { + await this.s4.PlainToShadowAsync(plain.s4); + return this.RetrievePrimitives(); + } + + public void Poll() + { + this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); + } + + public Pocos.struct3 CreateEmptyPoco() + { + return new Pocos.struct3(); + } + + private IList Children { get; } = new List(); + public IEnumerable GetChildren() + { + return Children; + } + + private IList Kids { get; } = new List(); + public IEnumerable GetKids() + { + return Kids; + } + + private IList ValueTags { get; } = new List(); + public IEnumerable GetValueTags() + { + return ValueTags; + } + + public void AddValueTag(AXSharp.Connector.ITwinPrimitive valueTag) + { + ValueTags.Add(valueTag); + } + + public void AddKid(AXSharp.Connector.ITwinElement kid) + { + Kids.Add(kid); + } + + public void AddChild(AXSharp.Connector.ITwinObject twinObject) + { + Children.Add(twinObject); + } + + protected AXSharp.Connector.Connector @Connector { get; } + + public AXSharp.Connector.Connector GetConnector() + { + return this.@Connector; + } + + public string GetSymbolTail() + { + return this.SymbolTail; + } + + public AXSharp.Connector.ITwinObject GetParent() + { + return this.@Parent; + } + + public string Symbol { get; protected set; } + + private string _attributeName; + public System.String AttributeName { get => string.IsNullOrEmpty(_attributeName) ? SymbolTail : _attributeName.Interpolate(this).CleanUpLocalizationTokens(); set => _attributeName = value; } + + public System.String GetAttributeName(System.Globalization.CultureInfo culture) + { + return this.Translate(_attributeName, culture).Interpolate(this); + } + + private string _humanReadable; + public string HumanReadable { get => string.IsNullOrEmpty(_humanReadable) ? SymbolTail : _humanReadable.Interpolate(this).CleanUpLocalizationTokens(); set => _humanReadable = value; } + + public System.String GetHumanReadable(System.Globalization.CultureInfo culture) + { + return this.Translate(_humanReadable, culture); + } + + protected System.String @SymbolTail { get; set; } + + protected AXSharp.Connector.ITwinObject @Parent { get; set; } + + public AXSharp.Connector.Localizations.Translator Interpreter => global::units.PlcTranslator.Instance; +} + +public partial class struct4 : AXSharp.Connector.ITwinObject +{ + public OnlinerInt s5 { get; } + + public struct4(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) + { + this.@SymbolTail = symbolTail; + this.@Connector = parent.GetConnector(); + this.@Parent = parent; + HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); + Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); + s5 = @Connector.ConnectorAdapter.AdapterFactory.CreateINT(this, "s5", "s5"); + parent.AddChild(this); + parent.AddKid(this); + } + + public async virtual Task OnlineToPlain() + { + return await (dynamic)this.OnlineToPlainAsync(); + } + + public async Task OnlineToPlainAsync() + { + Pocos.struct4 plain = new Pocos.struct4(); + await this.ReadAsync(); + plain.s5 = s5.LastValue; + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _OnlineToPlainNoacAsync() + { + Pocos.struct4 plain = new Pocos.struct4(); + plain.s5 = s5.LastValue; + return plain; + } + + protected async Task OnlineToPlainAsync(Pocos.struct4 plain) + { + plain.s5 = s5.LastValue; + return plain; + } + + public async virtual Task PlainToOnline(T plain) + { + await this.PlainToOnlineAsync((dynamic)plain); + } + + public async Task> PlainToOnlineAsync(Pocos.struct4 plain) + { +#pragma warning disable CS0612 + s5.LethargicWrite(plain.s5); +#pragma warning restore CS0612 + return await this.WriteAsync(); + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _PlainToOnlineNoacAsync(Pocos.struct4 plain) + { +#pragma warning disable CS0612 + s5.LethargicWrite(plain.s5); +#pragma warning restore CS0612 + } + + public async virtual Task ShadowToPlain() + { + return await (dynamic)this.ShadowToPlainAsync(); + } + + public async Task ShadowToPlainAsync() + { + Pocos.struct4 plain = new Pocos.struct4(); + plain.s5 = s5.Shadow; + return plain; + } + + protected async Task ShadowToPlainAsync(Pocos.struct4 plain) + { + plain.s5 = s5.Shadow; + return plain; + } + + public async virtual Task PlainToShadow(T plain) + { + await this.PlainToShadowAsync((dynamic)plain); + } + + public async Task> PlainToShadowAsync(Pocos.struct4 plain) + { + s5.Shadow = plain.s5; + return this.RetrievePrimitives(); + } + + public void Poll() + { + this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); + } + + public Pocos.struct4 CreateEmptyPoco() + { + return new Pocos.struct4(); + } + + private IList Children { get; } = new List(); + public IEnumerable GetChildren() + { + return Children; + } + + private IList Kids { get; } = new List(); + public IEnumerable GetKids() + { + return Kids; + } + + private IList ValueTags { get; } = new List(); + public IEnumerable GetValueTags() + { + return ValueTags; + } + + public void AddValueTag(AXSharp.Connector.ITwinPrimitive valueTag) + { + ValueTags.Add(valueTag); + } + + public void AddKid(AXSharp.Connector.ITwinElement kid) + { + Kids.Add(kid); + } + + public void AddChild(AXSharp.Connector.ITwinObject twinObject) + { + Children.Add(twinObject); + } + + protected AXSharp.Connector.Connector @Connector { get; } + + public AXSharp.Connector.Connector GetConnector() + { + return this.@Connector; + } + + public string GetSymbolTail() + { + return this.SymbolTail; + } + + public AXSharp.Connector.ITwinObject GetParent() + { + return this.@Parent; + } + + public string Symbol { get; protected set; } + + private string _attributeName; + public System.String AttributeName { get => string.IsNullOrEmpty(_attributeName) ? SymbolTail : _attributeName.Interpolate(this).CleanUpLocalizationTokens(); set => _attributeName = value; } + + public System.String GetAttributeName(System.Globalization.CultureInfo culture) + { + return this.Translate(_attributeName, culture).Interpolate(this); + } + + private string _humanReadable; + public string HumanReadable { get => string.IsNullOrEmpty(_humanReadable) ? SymbolTail : _humanReadable.Interpolate(this).CleanUpLocalizationTokens(); set => _humanReadable = value; } + + public System.String GetHumanReadable(System.Globalization.CultureInfo culture) + { + return this.Translate(_humanReadable, culture); + } + + protected System.String @SymbolTail { get; set; } + + protected AXSharp.Connector.ITwinObject @Parent { get; set; } + + public AXSharp.Connector.Localizations.Translator Interpreter => global::units.PlcTranslator.Instance; +} + +public partial class AbstractMotor : AXSharp.Connector.ITwinObject +{ + public OnlinerBool Run { get; } + + public OnlinerBool ReverseDirection { get; } + + partial void PreConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); + partial void PostConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); + public AbstractMotor(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) + { + Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); + this.@SymbolTail = symbolTail; + this.@Connector = parent.GetConnector(); + this.@Parent = parent; + HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); + PreConstruct(parent, readableTail, symbolTail); + Run = @Connector.ConnectorAdapter.AdapterFactory.CreateBOOL(this, "Run", "Run"); + ReverseDirection = @Connector.ConnectorAdapter.AdapterFactory.CreateBOOL(this, "ReverseDirection", "ReverseDirection"); + parent.AddChild(this); + parent.AddKid(this); + PostConstruct(parent, readableTail, symbolTail); + } + + public async virtual Task OnlineToPlain() + { + return await (dynamic)this.OnlineToPlainAsync(); + } + + public async Task OnlineToPlainAsync() + { + Pocos.AbstractMotor plain = new Pocos.AbstractMotor(); + await this.ReadAsync(); + plain.Run = Run.LastValue; + plain.ReverseDirection = ReverseDirection.LastValue; + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _OnlineToPlainNoacAsync() + { + Pocos.AbstractMotor plain = new Pocos.AbstractMotor(); + plain.Run = Run.LastValue; + plain.ReverseDirection = ReverseDirection.LastValue; + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected async Task _OnlineToPlainNoacAsync(Pocos.AbstractMotor plain) + { + plain.Run = Run.LastValue; + plain.ReverseDirection = ReverseDirection.LastValue; + return plain; + } + + public async virtual Task PlainToOnline(T plain) + { + await this.PlainToOnlineAsync((dynamic)plain); + } + + public async Task> PlainToOnlineAsync(Pocos.AbstractMotor plain) + { +#pragma warning disable CS0612 + Run.LethargicWrite(plain.Run); +#pragma warning restore CS0612 +#pragma warning disable CS0612 + ReverseDirection.LethargicWrite(plain.ReverseDirection); +#pragma warning restore CS0612 + return await this.WriteAsync(); + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _PlainToOnlineNoacAsync(Pocos.AbstractMotor plain) + { +#pragma warning disable CS0612 + Run.LethargicWrite(plain.Run); +#pragma warning restore CS0612 +#pragma warning disable CS0612 + ReverseDirection.LethargicWrite(plain.ReverseDirection); +#pragma warning restore CS0612 + } + + public async virtual Task ShadowToPlain() + { + return await (dynamic)this.ShadowToPlainAsync(); + } + + public async Task ShadowToPlainAsync() + { + Pocos.AbstractMotor plain = new Pocos.AbstractMotor(); + plain.Run = Run.Shadow; + plain.ReverseDirection = ReverseDirection.Shadow; + return plain; + } + + protected async Task ShadowToPlainAsync(Pocos.AbstractMotor plain) + { + plain.Run = Run.Shadow; + plain.ReverseDirection = ReverseDirection.Shadow; + return plain; + } + + public async virtual Task PlainToShadow(T plain) + { + await this.PlainToShadowAsync((dynamic)plain); + } + + public async Task> PlainToShadowAsync(Pocos.AbstractMotor plain) + { + Run.Shadow = plain.Run; + ReverseDirection.Shadow = plain.ReverseDirection; + return this.RetrievePrimitives(); + } + + public void Poll() + { + this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); + } + + public Pocos.AbstractMotor CreateEmptyPoco() + { + return new Pocos.AbstractMotor(); + } + + private IList Children { get; } = new List(); + public IEnumerable GetChildren() + { + return Children; + } + + private IList Kids { get; } = new List(); + public IEnumerable GetKids() + { + return Kids; + } + + private IList ValueTags { get; } = new List(); + public IEnumerable GetValueTags() + { + return ValueTags; + } + + public void AddValueTag(AXSharp.Connector.ITwinPrimitive valueTag) + { + ValueTags.Add(valueTag); + } + + public void AddKid(AXSharp.Connector.ITwinElement kid) + { + Kids.Add(kid); + } + + public void AddChild(AXSharp.Connector.ITwinObject twinObject) + { + Children.Add(twinObject); + } + + protected AXSharp.Connector.Connector @Connector { get; } + + public AXSharp.Connector.Connector GetConnector() + { + return this.@Connector; + } + + public string GetSymbolTail() + { + return this.SymbolTail; + } + + public AXSharp.Connector.ITwinObject GetParent() + { + return this.@Parent; + } + + public string Symbol { get; protected set; } + + private string _attributeName; + public System.String AttributeName { get => string.IsNullOrEmpty(_attributeName) ? SymbolTail : _attributeName.Interpolate(this).CleanUpLocalizationTokens(); set => _attributeName = value; } + + public System.String GetAttributeName(System.Globalization.CultureInfo culture) + { + return this.Translate(_attributeName, culture).Interpolate(this); + } + + private string _humanReadable; + public string HumanReadable { get => string.IsNullOrEmpty(_humanReadable) ? SymbolTail : _humanReadable.Interpolate(this).CleanUpLocalizationTokens(); set => _humanReadable = value; } + + public System.String GetHumanReadable(System.Globalization.CultureInfo culture) + { + return this.Translate(_humanReadable, culture); + } + + protected System.String @SymbolTail { get; set; } + + protected AXSharp.Connector.ITwinObject @Parent { get; set; } + + public AXSharp.Connector.Localizations.Translator Interpreter => global::units.PlcTranslator.Instance; +} + +public partial class GenericMotor : AbstractMotor +{ + partial void PreConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); + partial void PostConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); + public GenericMotor(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) : base(parent, readableTail, symbolTail) + { + Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); + PreConstruct(parent, readableTail, symbolTail); + PostConstruct(parent, readableTail, symbolTail); + } + + public async override Task OnlineToPlain() + { + return await (dynamic)this.OnlineToPlainAsync(); + } + + public new async Task OnlineToPlainAsync() + { + Pocos.GenericMotor plain = new Pocos.GenericMotor(); + await this.ReadAsync(); +#pragma warning disable CS0612 + await base._OnlineToPlainNoacAsync(plain); +#pragma warning restore CS0612 + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public new async Task _OnlineToPlainNoacAsync() + { + Pocos.GenericMotor plain = new Pocos.GenericMotor(); +#pragma warning disable CS0612 + await base._OnlineToPlainNoacAsync(plain); +#pragma warning restore CS0612 + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected async Task _OnlineToPlainNoacAsync(Pocos.GenericMotor plain) + { +#pragma warning disable CS0612 + await base._OnlineToPlainNoacAsync(plain); +#pragma warning restore CS0612 + return plain; + } + + public async override Task PlainToOnline(T plain) + { + await this.PlainToOnlineAsync((dynamic)plain); + } + + public async Task> PlainToOnlineAsync(Pocos.GenericMotor plain) + { + await base._PlainToOnlineNoacAsync(plain); + return await this.WriteAsync(); + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _PlainToOnlineNoacAsync(Pocos.GenericMotor plain) + { + await base._PlainToOnlineNoacAsync(plain); + } + + public async override Task ShadowToPlain() + { + return await (dynamic)this.ShadowToPlainAsync(); + } + + public new async Task ShadowToPlainAsync() + { + Pocos.GenericMotor plain = new Pocos.GenericMotor(); + await base.ShadowToPlainAsync(plain); + return plain; + } + + protected async Task ShadowToPlainAsync(Pocos.GenericMotor plain) + { + await base.ShadowToPlainAsync(plain); + return plain; + } + + public async override Task PlainToShadow(T plain) + { + await this.PlainToShadowAsync((dynamic)plain); + } + + public async Task> PlainToShadowAsync(Pocos.GenericMotor plain) + { + await base.PlainToShadowAsync(plain); + return this.RetrievePrimitives(); + } + + public new void Poll() + { + this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); + } + + public new Pocos.GenericMotor CreateEmptyPoco() + { + return new Pocos.GenericMotor(); + } +} + +public partial class SpecificMotorA : GenericMotor +{ + partial void PreConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); + partial void PostConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); + public SpecificMotorA(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) : base(parent, readableTail, symbolTail) + { + Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail); + PreConstruct(parent, readableTail, symbolTail); + PostConstruct(parent, readableTail, symbolTail); + } + + public async override Task OnlineToPlain() + { + return await (dynamic)this.OnlineToPlainAsync(); + } + + public new async Task OnlineToPlainAsync() + { + Pocos.SpecificMotorA plain = new Pocos.SpecificMotorA(); + await this.ReadAsync(); +#pragma warning disable CS0612 + await base._OnlineToPlainNoacAsync(plain); +#pragma warning restore CS0612 + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public new async Task _OnlineToPlainNoacAsync() + { + Pocos.SpecificMotorA plain = new Pocos.SpecificMotorA(); +#pragma warning disable CS0612 + await base._OnlineToPlainNoacAsync(plain); +#pragma warning restore CS0612 + return plain; + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `OnlineToPlain` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + protected async Task _OnlineToPlainNoacAsync(Pocos.SpecificMotorA plain) + { +#pragma warning disable CS0612 + await base._OnlineToPlainNoacAsync(plain); +#pragma warning restore CS0612 + return plain; + } + + public async override Task PlainToOnline(T plain) + { + await this.PlainToOnlineAsync((dynamic)plain); + } + + public async Task> PlainToOnlineAsync(Pocos.SpecificMotorA plain) + { + await base._PlainToOnlineNoacAsync(plain); + return await this.WriteAsync(); + } + + [Obsolete("This method should not be used if you indent to access the controllers data. Use `PlainToOnline` instead.")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public async Task _PlainToOnlineNoacAsync(Pocos.SpecificMotorA plain) + { + await base._PlainToOnlineNoacAsync(plain); + } + + public async override Task ShadowToPlain() + { + return await (dynamic)this.ShadowToPlainAsync(); + } + + public new async Task ShadowToPlainAsync() + { + Pocos.SpecificMotorA plain = new Pocos.SpecificMotorA(); + await base.ShadowToPlainAsync(plain); + return plain; + } + + protected async Task ShadowToPlainAsync(Pocos.SpecificMotorA plain) + { + await base.ShadowToPlainAsync(plain); + return plain; + } + + public async override Task PlainToShadow(T plain) + { + await this.PlainToShadowAsync((dynamic)plain); + } + + public async Task> PlainToShadowAsync(Pocos.SpecificMotorA plain) + { + await base.PlainToShadowAsync(plain); + return this.RetrievePrimitives(); + } + + public new void Poll() + { + this.RetrievePrimitives().ToList().ForEach(x => x.Poll()); + } + + public new Pocos.SpecificMotorA CreateEmptyPoco() + { + return new Pocos.SpecificMotorA(); + } +} \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs new file mode 100644 index 00000000..5ec06fdf --- /dev/null +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/expected/.g/POCO/mixed_access.g.cs @@ -0,0 +1,57 @@ +using System; + +namespace Pocos +{ + public partial class unitsTwinController + { + public Boolean MotorOn { get; set; } + + public Int16 MotorState { get; set; } + + public Motor Motor1 { get; set; } = new Motor(); + public Motor Motor2 { get; set; } = new Motor(); + public struct1 s1 { get; set; } = new struct1(); + public struct4 s4 { get; set; } = new struct4(); + public SpecificMotorA mot1 { get; set; } = new SpecificMotorA(); + } + + public partial class Motor : AXSharp.Connector.IPlain + { + public Boolean Run { get; set; } + } + + public partial class struct1 + { + public struct2 s2 { get; set; } = new struct2(); + } + + public partial class struct2 + { + public struct3 s3 { get; set; } = new struct3(); + } + + public partial class struct3 + { + public struct4 s4 { get; set; } = new struct4(); + } + + public partial class struct4 + { + public Int16 s5 { get; set; } + } + + public partial class AbstractMotor : AXSharp.Connector.IPlain + { + public Boolean Run { get; set; } + + public Boolean ReverseDirection { get; set; } + } + + public partial class GenericMotor : AbstractMotor, AXSharp.Connector.IPlain + { + } + + public partial class SpecificMotorA : GenericMotor, AXSharp.Connector.IPlain + { + } +} \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/array_declaration.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/array_declaration.st index cfbb35fc..91f2b21c 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/array_declaration.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/array_declaration.st @@ -1,4 +1,5 @@ NAMESPACE ArrayDeclarationSimpleNamespace + {S7.extern=ReadWrite} CLASS array_declaration_class VAR PUBLIC primitive : ARRAY[1..100] OF INT; @@ -8,7 +9,7 @@ NAMESPACE ArrayDeclarationSimpleNamespace primitive_multidim : ARRAY[1..100, 0..100, 0..300] OF INT; END_VAR END_CLASS - + {S7.extern=ReadWrite} CLASS some_complex_type VAR diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_all_primitives.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_all_primitives.st index 6fb713e1..d80e1a9e 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_all_primitives.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_all_primitives.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS class_all_primitives VAR PUBLIC myBOOL : BOOL ; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extended_by_known_type.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extended_by_known_type.st index f9813598..5c0a5287 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extended_by_known_type.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extended_by_known_type.st @@ -3,6 +3,7 @@ USING Simatic.Ax.StatePattern; NAMESPACE Simatic.Ax.StateFramework + {S7.extern=ReadWrite} CLASS State1Transition EXTENDS AbstractState METHOD PUBLIC OVERRIDE OnEntry @@ -25,6 +26,7 @@ END_NAMESPACE NAMESPACE Simatic.Ax.StateFramework + {S7.extern=ReadWrite} CLASS ABSTRACT AbstractState IMPLEMENTS IState, IStateMuteable VAR PUBLIC diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extends.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extends.st index bf1f7a91..a93a906e 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extends.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extends.st @@ -1,7 +1,9 @@ +{S7.extern=ReadWrite} CLASS PUBLIC Extended EXTENDS Extendee END_CLASS +{S7.extern=ReadWrite} CLASS PUBLIC Extendee END_CLASS \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extends_and_implements.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extends_and_implements.st index a1be5eae..da3ff088 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extends_and_implements.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_extends_and_implements.st @@ -1,7 +1,9 @@ +{S7.extern=ReadWrite} CLASS PUBLIC ExtendsAndImplements EXTENDS ExtendeeExtendsAndImplements IMPLEMENTS IImplementation1, IImplementation2 END_CLASS +{S7.extern=ReadWrite} CLASS PUBLIC ExtendeeExtendsAndImplements END_CLASS diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_generic_extension.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_generic_extension.st index 547ff3f8..f61f80fe 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_generic_extension.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_generic_extension.st @@ -1,10 +1,11 @@ NAMESPACE Generics {#ix-generic: where TOnline : ITwinObject} + {S7.extern=ReadWrite} CLASS PUBLIC Extender END_CLASS - + {S7.extern=ReadWrite} CLASS PUBLIC Extendee EXTENDS Extender VAR PUBLIC {#ix-generic:TOnline} @@ -14,6 +15,7 @@ NAMESPACE Generics END_VAR END_CLASS + {S7.extern=ReadWrite} CLASS PUBLIC Extendee2 EXTENDS Extender VAR PUBLIC {#ix-generic:TOnline} @@ -22,6 +24,7 @@ NAMESPACE Generics END_VAR END_CLASS + {S7.extern=ReadWrite} CLASS SomeType END_IF; END_NAMESPACE diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_implements.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_implements.st index 916493ef..d504d3b3 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_implements.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_implements.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS PUBLIC _NULL_CONTEXT IMPLEMENTS IContext END_CLASS diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_implements_multiple.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_implements_multiple.st index a7e4b491..0dbb7c45 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_implements_multiple.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_implements_multiple.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS PUBLIC _NULL_CONTEXT_MULTIPLE IMPLEMENTS IContext_Multiple, IObject_Multiple END_CLASS diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_internal.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_internal.st index b0eb1e4f..eee4f3b5 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_internal.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_internal.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS INTERNAL ClassWithComplexTypes END_CLASS diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_no_access_modifier.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_no_access_modifier.st index ab4d7c71..6a769734 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_no_access_modifier.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_no_access_modifier.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS NoAccessModifierClass END_CLASS diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_complex_members.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_complex_members.st index 1622baf3..1df8b797 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_complex_members.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_complex_members.st @@ -1,10 +1,12 @@ NAMESPACE ClassWithComplexTypesNamespace + {S7.extern=ReadWrite} CLASS PUBLIC ClassWithComplexTypes VAR PUBLIC myComplexType : ComplexType1; END_VAR END_CLASS + {S7.extern=ReadWrite} CLASS PUBLIC ComplexType1 END_CLASS diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_non_public_members.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_non_public_members.st index 9cbf8620..b74ce4e8 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_non_public_members.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_non_public_members.st @@ -1,4 +1,5 @@ NAMESPACE ClassWithNonTraspilableMemberssNamespace + {S7.extern=ReadWrite} CLASS PUBLIC ClassWithNonTraspilableMembers VAR PUBLIC myComplexType : ComplexType1; @@ -14,7 +15,7 @@ NAMESPACE ClassWithNonTraspilableMemberssNamespace myBooool1 : BOOL; END_VAR END_CLASS - + {S7.extern=ReadWrite} CLASS PUBLIC ComplexType1 END_CLASS diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_pragmas.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_pragmas.st index d4ef7cf9..a004c86a 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_pragmas.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_pragmas.st @@ -1,8 +1,10 @@ NAMESPACE ClassWithPragmasNamespace {#ix-attr:[Container(Layout.Stack)]} + {S7.extern=ReadWrite} CLASS PUBLIC ClassWithPragmas VAR PUBLIC {#ix-attr:[Container(Layout.Wrap)]} + {S7.extern=ReadWrite} myComplexType : ComplexType1; END_VAR END_CLASS diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_primitive_members.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_primitive_members.st index c7fd3e56..0fdf83bb 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_primitive_members.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_primitive_members.st @@ -1,4 +1,5 @@ NAMESPACE ClassWithPrimitiveTypesNamespace + {S7.extern=ReadWrite} CLASS PUBLIC ClassWithPrimitiveTypes VAR PUBLIC myBOOL : BOOL ; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_using_directives.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_using_directives.st index ca938ac2..b367c520 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_using_directives.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/class_with_using_directives.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS INTERNAL ClassWithUsingDirectives USING SimpleFirstLevelNamespace, SimpleQualifiedNamespace.Qualified; USING HelloLevelOne.HelloLevelTwo; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/compileromitsattribute.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/compileromitsattribute.st index d38431ba..115a81b9 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/compileromitsattribute.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/compileromitsattribute.st @@ -1,4 +1,5 @@ NAMESPACE CompilerOmmits + {S7.extern=ReadWrite} CLASS ClassWithArrays VAR PUBLIC {#ix-attr:[CompilerOmitsAttribute()]} @@ -12,7 +13,7 @@ NAMESPACE CompilerOmmits END_CLASS - + {S7.extern=ReadWrite} CLASS PUBLIC Complex VAR PUBLIC HelloString : STRING; @@ -22,6 +23,7 @@ NAMESPACE CompilerOmmits END_NAMESPACE NAMESPACE Enums + {S7.extern=ReadWrite} CLASS ClassWithEnums VAR PUBLIC colors : Colors; @@ -41,6 +43,7 @@ NAMESPACE Enums END_NAMESPACE NAMESPACE misc + {S7.extern=ReadWrite} CLASS PUBLIC VariousMembers VAR PUBLIC _SomeClass : SomeClass; @@ -48,7 +51,7 @@ NAMESPACE misc END_VAR END_CLASS - + {S7.extern=ReadWrite} CLASS SomeClass VAR PUBLIC SomeClassVariable : STRING; @@ -56,9 +59,11 @@ NAMESPACE misc END_CLASS TYPE + {S7.extern=ReadWrite} Motor : STRUCT isRunning : BOOL; END_STRUCT; + {S7.extern=ReadWrite} Vehicle : STRUCT m : Motor; displacement : INT; @@ -67,6 +72,7 @@ NAMESPACE misc END_NAMESPACE NAMESPACE UnknownArraysShouldNotBeTraspiled + {S7.extern=ReadWrite} CLASS ClassWithArrays VAR PUBLIC _complexKnown : ARRAY[0..10] OF Complex; @@ -76,7 +82,7 @@ NAMESPACE UnknownArraysShouldNotBeTraspiled END_CLASS - + {S7.extern=ReadWrite} CLASS PUBLIC Complex VAR PUBLIC HelloString : STRING; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/configuration.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/configuration.st index 293c03f6..37321911 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/configuration.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/configuration.st @@ -3,55 +3,92 @@ CONFIGURATION MyConfiguration PROGRAM P1 WITH Main: MyProgram; VAR_GLOBAL + {S7.extern=ReadWrite} Complex : ComplexForConfig; + {S7.extern=ReadWrite} myBOOL : BOOL ; + {S7.extern=ReadWrite} myBYTE : BYTE ; + {S7.extern=ReadWrite} myWORD : WORD ; + {S7.extern=ReadWrite} myDWORD : DWORD ; + {S7.extern=ReadWrite} myLWORD : LWORD ; + {S7.extern=ReadWrite} mySINT : SINT ; + {S7.extern=ReadWrite} myINT : INT ; + {S7.extern=ReadWrite} myDINT : DINT ; + {S7.extern=ReadWrite} myLINT : LINT ; + {S7.extern=ReadWrite} myUSINT : USINT ; + {S7.extern=ReadWrite} myUINT : UINT ; + {S7.extern=ReadWrite} myUDINT : UDINT ; + {S7.extern=ReadWrite} myULINT : ULINT ; + {S7.extern=ReadWrite} myREAL : REAL ; + {S7.extern=ReadWrite} myLREAL : LREAL ; + {S7.extern=ReadWrite} myTIME : TIME ; + {S7.extern=ReadWrite} myLTIME : LTIME ; + {S7.extern=ReadWrite} myDATE : DATE ; + {S7.extern=ReadWrite} myLDATE : LDATE ; + {S7.extern=ReadWrite} myTIME_OF_DAY : TIME_OF_DAY ; + {S7.extern=ReadWrite} myLTIME_OF_DAY : LTIME_OF_DAY ; + {S7.extern=ReadWrite} myDATE_AND_TIME : DATE_AND_TIME ; + {S7.extern=ReadWrite} myLDATE_AND_TIME : LDATE_AND_TIME; + {S7.extern=ReadWrite} myCHAR : CHAR ; + {S7.extern=ReadWrite} myWCHAR : WCHAR ; + {S7.extern=ReadWrite} mySTRING : STRING ; + {S7.extern=ReadWrite} myWSTRING : WSTRING ; + {S7.extern=ReadWrite} {#ix-attr:[ReadOnce()]} myWSTRING_readOnce : WSTRING ; {#ix-attr:[ReadOnly()]} + {S7.extern=ReadWrite} myWSTRING_readOnly : WSTRING ; {#ix-attr:[ReadOnce()]} + {S7.extern=ReadWrite} cReadOnce : ComplexForConfig; {#ix-attr:[ReadOnly()]} + {S7.extern=ReadWrite} cReadOnly : ComplexForConfig; + {S7.extern=ReadWrite} Colorss : Colorss; + {S7.extern=ReadWrite} Colorsss : Colorsss; + {S7.extern=ReadWrite} {#ix-attr:[CompilerOmitsAttribute()]} _must_be_omitted_everywhere : BOOL; + {S7.extern=ReadWrite} {#ix-attr:[CompilerOmitsAttribute("Onliner")]} _must_be_omitted_in_onliner : BOOL; + {S7.extern=ReadWrite} {#ix-attr:[CompilerOmitsAttribute("POCO")]} _must_be_omitted_in_poco : BOOL; END_VAR END_CONFIGURATION - +{S7.extern=ReadWrite} CLASS PUBLIC ComplexForConfig VAR PUBLIC myBOOL : BOOL ; @@ -94,9 +131,11 @@ TYPE END_TYPE TYPE + {S7.extern=ReadWrite} Motor : STRUCT isRunning : BOOL; END_STRUCT; + {S7.extern=ReadWrite} Vehicle : STRUCT m : Motor; displacement : INT; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/makereadonce.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/makereadonce.st index 2f8f05a3..ed95fb66 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/makereadonce.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/makereadonce.st @@ -1,4 +1,5 @@ NAMESPACE makereadonce + {S7.extern=ReadWrite} CLASS PUBLIC MembersWithMakeReadOnce VAR PUBLIC {#ix-attr:[ReadOnce()]} @@ -10,7 +11,7 @@ NAMESPACE makereadonce someotherComplexMember : ComplexMember; END_VAR END_CLASS - + {S7.extern=ReadWrite} CLASS PUBLIC ComplexMember VAR PUBLIC someMember : STRING; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/makereadonly.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/makereadonly.st index 9689ea70..a0abd175 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/makereadonly.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/makereadonly.st @@ -1,4 +1,5 @@ NAMESPACE makereadonly + {S7.extern=ReadWrite} CLASS PUBLIC MembersWithMakeReadOnly VAR PUBLIC {#ix-attr:[ReadOnly()]} @@ -10,7 +11,7 @@ NAMESPACE makereadonly someotherComplexMember : ComplexMember; END_VAR END_CLASS - + {S7.extern=ReadWrite} CLASS PUBLIC ComplexMember VAR PUBLIC someMember : STRING; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/misc.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/misc.st index 53b1afb1..a8945f2f 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/misc.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/misc.st @@ -1,4 +1,5 @@ NAMESPACE Enums +{S7.extern=ReadWrite} CLASS ClassWithEnums VAR PUBLIC colors : Colors; @@ -18,6 +19,7 @@ NAMESPACE Enums END_NAMESPACE NAMESPACE misc +{S7.extern=ReadWrite} CLASS PUBLIC VariousMembers VAR PUBLIC _SomeClass : SomeClass; @@ -25,7 +27,7 @@ NAMESPACE misc END_VAR END_CLASS - + {S7.extern=ReadWrite} CLASS SomeClass VAR PUBLIC SomeClassVariable : STRING; @@ -33,9 +35,11 @@ NAMESPACE misc END_CLASS TYPE + {S7.extern=ReadWrite} Motor : STRUCT isRunning : BOOL; END_STRUCT; + {S7.extern=ReadWrite} Vehicle : STRUCT m : Motor; displacement : INT; @@ -44,6 +48,7 @@ NAMESPACE misc END_NAMESPACE NAMESPACE UnknownArraysShouldNotBeTraspiled + {S7.extern=ReadWrite} CLASS ClassWithArrays VAR PUBLIC _complexKnown : ARRAY[0..10] OF Complex; @@ -53,7 +58,7 @@ NAMESPACE UnknownArraysShouldNotBeTraspiled END_CLASS - + {S7.extern=ReadWrite} CLASS PUBLIC Complex VAR PUBLIC HelloString : STRING; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/mixed_access.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/mixed_access.st new file mode 100644 index 00000000..cc1be691 --- /dev/null +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/mixed_access.st @@ -0,0 +1,72 @@ +CONFIGURATION config + VAR_GLOBAL + {S7.extern=ReadWrite} + MotorOn : BOOL; // variable can be read and written + + {S7.extern=ReadOnly} + MotorState: INT; // variable can only be read + + MotorFlags: UINT; // variable is not accessible by an external system (default: hidden) + + {S7.extern=ReadWrite} + Motor1 : Motor; // the variables in Motor1 be read and written if enabled + + {S7.extern=ReadOnly} + Motor2 : Motor; // the variables in Motor2 be only read if enabled + + {S7.extern=ReadWrite} + s1 : struct1; + {S7.extern=ReadWrite} + s4 : struct4; + + {S7.extern=ReadWrite} + mot1 : SpecificMotorA; + END_VAR +END_CONFIGURATION + +CLASS Motor + VAR PUBLIC + {S7.extern=ReadWrite} + Run : BOOL; + ReverseDirection : BOOL; + END_VAR + VAR INTERNAL + {S7.extern=ReadOnly} + ActualVelocity : LReal; + END_VAR + // ... +END_CLASS + +TYPE + struct1 : STRUCT {S7.extern=ReadWrite} s2 : struct2; END_STRUCT; + struct2 : STRUCT {S7.extern=ReadOnly} s3 : struct3; END_STRUCT; + struct3 : STRUCT {S7.extern=ReadWrite} s4 : struct4; END_STRUCT; + struct4 : STRUCT {S7.extern=ReadWrite} s5 : INT; END_STRUCT; +END_TYPE + +{S7.extern=ReadWrite} +CLASS ABSTRACT AbstractMotor + VAR PUBLIC + Run : BOOL; + ReverseDirection : BOOL; + END_VAR + ... +END_CLASS + +{S7.extern=ReadWrite} +CLASS GenericMotor EXTENDS AbstractMotor + VAR INTERNAL + {S7.extern=ReadOnly} + ActualVelocity : LReal; + END_VAR + ... +END_CLASS + +{S7.extern=ReadWrite} +CLASS SpecificMotorA EXTENDS GenericMotor + VAR INTERNAL + {S7.extern=ReadWrite} + MaxAcceleration : LReal; + END_VAR + ... +END_CLASS \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/ref_to_simple.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/ref_to_simple.st index 36a854d6..9a6aa2ee 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/ref_to_simple.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/ref_to_simple.st @@ -1,11 +1,13 @@ NAMESPACE RefToSimple + {S7.extern=ReadWrite} CLASS ref_to_simple VAR PUBLIC a : REF_TO INT; b : REF_TO referenced; END_VAR END_CLASS - + + {S7.extern=ReadWrite} CLASS referenced VAR PUBLIC b : INT; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/simple_empty_class.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/simple_empty_class.st index a68a3472..e6064eb5 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/simple_empty_class.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/simple_empty_class.st @@ -1,2 +1,3 @@ -CLASS PUBLIC simple_class +{S7.extern=ReadWrite} +CLASS PUBLIC simple_class END_CLASS \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/simple_empty_class_within_namespace.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/simple_empty_class_within_namespace.st index 76446bbf..fa9e7cac 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/simple_empty_class_within_namespace.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/simple_empty_class_within_namespace.st @@ -1,4 +1,5 @@ NAMESPACE sampleNamespace + {S7.extern=ReadWrite} CLASS PUBLIC simple_empty_class_within_namespace END_CLASS END_NAMESPACE \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/struct_simple.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/struct_simple.st index 696880c4..8e81ed49 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/struct_simple.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/struct_simple.st @@ -1,7 +1,9 @@ TYPE + {S7.extern=ReadWrite} Motor : STRUCT isRunning : BOOL; END_STRUCT; + {S7.extern=ReadWrite} Vehicle : STRUCT m : Motor; displacement : INT; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_named_values.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_named_values.st index 140a0cac..af7e87f2 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_named_values.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_named_values.st @@ -6,7 +6,8 @@ NAMESPACE NamedValuesNamespace LBLUE := 23 ); END_TYPE - + + {S7.extern=ReadWrite} CLASS PUBLIC using_type_named_values VAR PUBLIC LColors : LightColors; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_named_values_literals.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_named_values_literals.st index 5f1bc9da..c6b40457 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_named_values_literals.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_named_values_literals.st @@ -9,6 +9,7 @@ NAMESPACE Simatic.Ax.StateFramework ) := STATUS_NO_ERR; END_TYPE + {S7.extern=ReadWrite} CLASS PUBLIC using_type_named_values VAR PUBLIC LColors : StateControllerStatus; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_with_enum.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_with_enum.st index 1cf1ef4c..41c03a52 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_with_enum.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/type_with_enum.st @@ -24,6 +24,7 @@ NAMESPACE Simatic.Ax.StateFramework Condition : (GT, EQ, LT, NE, GE, LE); END_TYPE + {S7.extern=ReadWrite} CLASS CompareGuardLint IMPLEMENTS IGuard VAR PUBLIC Value : REF_TO LINT; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/types_with_name_attributes.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/types_with_name_attributes.st index 11843d34..a86c43a5 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/types_with_name_attributes.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/types_with_name_attributes.st @@ -1,9 +1,11 @@ NAMESPACE TypeWithNameAttributes TYPE {#ix-attr:[Container(Layout.Wrap)]} + {S7.extern=ReadWrite} Motor : STRUCT isRunning : BOOL; END_STRUCT; + {S7.extern=ReadWrite} Vehicle : STRUCT m : Motor; displacement : INT; @@ -11,6 +13,7 @@ NAMESPACE TypeWithNameAttributes END_TYPE {#ix-prop:public string AttributeName} + {S7.extern=ReadWrite} CLASS NoAccessModifierClass VAR PUBLIC SomeClassVariable : STRING; diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/types_with_property_attributes.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/types_with_property_attributes.st index 30ca6834..470c9b70 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/types_with_property_attributes.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/src/types_with_property_attributes.st @@ -1,6 +1,7 @@ NAMESPACE TypesWithPropertyAttributes {#ix-prop:public string Description} {#ix-set:Description = "Some added property name value"} + {S7.extern=ReadWrite} CLASS SomeAddedProperties VAR PUBLIC {#ix-set:AttributeName = "Pocitadlo"} diff --git a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/test/test.st b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/test/test.st index 82bb243b..d1a79018 100644 --- a/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/test/test.st +++ b/src/AXSharp.compiler/tests/AXSharp.Compiler.CsTests/samples/units/test/test.st @@ -3,6 +3,7 @@ USING AxUnit; NAMESPACE MyTest {TestFixture} + {S7.extern=ReadWrite} CLASS MyTestFixture {Test} METHOD PUBLIC MyTestMethod diff --git a/src/AXSharp.compiler/tests/AXSharp.CompilerTests/IxProjectTests.cs b/src/AXSharp.compiler/tests/AXSharp.CompilerTests/IxProjectTests.cs index 5a5c8fdf..9e57512c 100644 --- a/src/AXSharp.compiler/tests/AXSharp.CompilerTests/IxProjectTests.cs +++ b/src/AXSharp.compiler/tests/AXSharp.CompilerTests/IxProjectTests.cs @@ -89,6 +89,8 @@ public MockBuilder(AXSharpProject project, Compilation compilation) public string OutputFileSuffix => ".py"; public string BuilderType => "Mock"; public Compilation Compilation { get; } + public ICompilerOptions? CompilerOptions { get; } + public eCommAccessibility TypeCommAccessibility { get; } = eCommAccessibility.ReadWrite; #region ICombineThreeVisitor /// diff --git a/src/AXSharp.compiler/tests/integration/actual/app/AXSharp.config.json b/src/AXSharp.compiler/tests/integration/actual/app/AXSharp.config.json index 3640cb80..065d929a 100644 --- a/src/AXSharp.compiler/tests/integration/actual/app/AXSharp.config.json +++ b/src/AXSharp.compiler/tests/integration/actual/app/AXSharp.config.json @@ -1 +1 @@ -{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"ProjectFile":"app.csproj"} \ No newline at end of file +{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"IgnoreS7Pragmas":false,"ProjectFile":"app.csproj"} \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/integration/actual/app/src/configuration.st b/src/AXSharp.compiler/tests/integration/actual/app/src/configuration.st index d007c620..5dee9d82 100644 --- a/src/AXSharp.compiler/tests/integration/actual/app/src/configuration.st +++ b/src/AXSharp.compiler/tests/integration/actual/app/src/configuration.st @@ -3,7 +3,9 @@ CONFIGURATION MyConfiguration PROGRAM P1 WITH Main: MyProgram; VAR_GLOBAL + {S7.extern=ReadWrite} lib1_MyClass : lib1.MyClass; + {S7.extern=ReadWrite} lib2_MyClass : lib2.MyClass; END_VAR END_CONFIGURATION diff --git a/src/AXSharp.compiler/tests/integration/actual/app/test/test.st b/src/AXSharp.compiler/tests/integration/actual/app/test/test.st index 82bb243b..d1a79018 100644 --- a/src/AXSharp.compiler/tests/integration/actual/app/test/test.st +++ b/src/AXSharp.compiler/tests/integration/actual/app/test/test.st @@ -3,6 +3,7 @@ USING AxUnit; NAMESPACE MyTest {TestFixture} + {S7.extern=ReadWrite} CLASS MyTestFixture {Test} METHOD PUBLIC MyTestMethod diff --git a/src/AXSharp.compiler/tests/integration/actual/lib1/AXSharp.config.json b/src/AXSharp.compiler/tests/integration/actual/lib1/AXSharp.config.json index e329f0d1..a4158ea7 100644 --- a/src/AXSharp.compiler/tests/integration/actual/lib1/AXSharp.config.json +++ b/src/AXSharp.compiler/tests/integration/actual/lib1/AXSharp.config.json @@ -1 +1 @@ -{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"ProjectFile":"lib1.csproj"} \ No newline at end of file +{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"IgnoreS7Pragmas":false,"ProjectFile":"lib1.csproj"} \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/integration/actual/lib1/src/library.st b/src/AXSharp.compiler/tests/integration/actual/lib1/src/library.st index 0a325855..aeac64f5 100644 --- a/src/AXSharp.compiler/tests/integration/actual/lib1/src/library.st +++ b/src/AXSharp.compiler/tests/integration/actual/lib1/src/library.st @@ -1,5 +1,5 @@ NAMESPACE lib1 - + {S7.extern=ReadWrite} CLASS PUBLIC MyClass VAR PUBLIC MyString : STRING; diff --git a/src/AXSharp.compiler/tests/integration/actual/lib1/test/test.st b/src/AXSharp.compiler/tests/integration/actual/lib1/test/test.st index b43340ec..96f33008 100644 --- a/src/AXSharp.compiler/tests/integration/actual/lib1/test/test.st +++ b/src/AXSharp.compiler/tests/integration/actual/lib1/test/test.st @@ -4,6 +4,7 @@ USING MyLibrary; NAMESPACE MyTest {TestFixture} + {S7.extern=ReadWrite} CLASS MyTestFixture VAR PROTECTED diff --git a/src/AXSharp.compiler/tests/integration/actual/lib2/AXSharp.config.json b/src/AXSharp.compiler/tests/integration/actual/lib2/AXSharp.config.json index fbe02572..9ed58485 100644 --- a/src/AXSharp.compiler/tests/integration/actual/lib2/AXSharp.config.json +++ b/src/AXSharp.compiler/tests/integration/actual/lib2/AXSharp.config.json @@ -1 +1 @@ -{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"ProjectFile":"lib2.csproj"} \ No newline at end of file +{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"IgnoreS7Pragmas":false,"ProjectFile":"lib2.csproj"} \ No newline at end of file diff --git a/src/AXSharp.compiler/tests/integration/actual/lib2/src/library.st b/src/AXSharp.compiler/tests/integration/actual/lib2/src/library.st index d94c021e..afec9373 100644 --- a/src/AXSharp.compiler/tests/integration/actual/lib2/src/library.st +++ b/src/AXSharp.compiler/tests/integration/actual/lib2/src/library.st @@ -1,5 +1,6 @@ NAMESPACE lib2 + {S7.extern=ReadWrite} CLASS PUBLIC MyClass VAR PUBLIC MyString : STRING; diff --git a/src/AXSharp.compiler/tests/integration/actual/lib2/test/test.st b/src/AXSharp.compiler/tests/integration/actual/lib2/test/test.st index b43340ec..96f33008 100644 --- a/src/AXSharp.compiler/tests/integration/actual/lib2/test/test.st +++ b/src/AXSharp.compiler/tests/integration/actual/lib2/test/test.st @@ -4,6 +4,7 @@ USING MyLibrary; NAMESPACE MyTest {TestFixture} + {S7.extern=ReadWrite} CLASS MyTestFixture VAR PROTECTED diff --git a/src/AXSharp.connectors/tests/ax-test-project/AXSharp.config.json b/src/AXSharp.connectors/tests/ax-test-project/AXSharp.config.json index 35432311..04c938d9 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/AXSharp.config.json +++ b/src/AXSharp.connectors/tests/ax-test-project/AXSharp.config.json @@ -1 +1 @@ -{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"ProjectFile":"ax_test_project.csproj"} \ No newline at end of file +{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"IgnoreS7Pragmas":false,"ProjectFile":"ax_test_project.csproj"} \ No newline at end of file diff --git a/src/AXSharp.connectors/tests/ax-test-project/apax-lock.json b/src/AXSharp.connectors/tests/ax-test-project/apax-lock.json index 8da9f677..4ee8c260 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/apax-lock.json +++ b/src/AXSharp.connectors/tests/ax-test-project/apax-lock.json @@ -242,32 +242,9 @@ "integrity": "sha512-2Pj/Encd6bUgsRfXyj3rA4YOUpRroqwzODKU37T95dMNle+BpFXYS3V88FYJyTdOgSrJik4VVdV1AFzH7NUQ8g==" }, "@ax/sld": { - "version": "0.15.9", - "resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-0.15.9.tgz", - "integrity": "sha512-Moqh0zbGNcpD88Z3uax2iXL0exnjsgXQodaZXiIFy5CrQaJzM3X/EzEHKBXQ8q+Xr8hs/Q6fWTUkkbDezVBZ6Q==", - "dependencies": { - "@ax/sld-linux-x64": "0.15.9", - "@ax/sld-win-x64": "0.15.9" - } - }, - "@ax/sld-linux-x64": { - "version": "0.15.9", - "resolved": "https://registry.simatic-ax.siemens.io/@ax/sld-linux-x64/-/sld-linux-x64-0.15.9.tgz", - "integrity": "sha512-jChM/HtZIP+nfMdkKYpkDkllg+tGkK9Y8qpVmCUjmliJ1nyO2mprVMRJKI9Q3m81mGdzpuD+vew4Vgx2e6xptw==", - "os": [ - "linux" - ], - "cpu": [ - "x64" - ] - }, - "@ax/sld-win-x64": { - "version": "0.15.9", - "resolved": "https://registry.simatic-ax.siemens.io/@ax/sld-win-x64/-/sld-win-x64-0.15.9.tgz", - "integrity": "sha512-NYPJWNaNAZAL3t33gRb6cI9n1rvogbyrbb/Y0agBnvjY+MBqNxviyizFyMsloql//vZwKKl674TPFx4FFWcYDg==", - "os": [ - "win32" - ], + "version": "2.0.5", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-2.0.5.tgz", + "integrity": "sha512-upa0HyRVdYyzNu6j7E+gTAnpzP2mfZxvo+0jbm8H6Ci9ergL56SHaCVBC35PnociMZpdZ5d1/LTy6f8lwpDxXA==", "cpu": [ "x64" ] diff --git a/src/AXSharp.connectors/tests/ax-test-project/apax.yml b/src/AXSharp.connectors/tests/ax-test-project/apax.yml index 1bef8b06..0a4668c7 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/apax.yml +++ b/src/AXSharp.connectors/tests/ax-test-project/apax.yml @@ -9,7 +9,7 @@ targets: devDependencies: "@ax/sdk": ^4.0.8 "@ax/stc": ^5.4.89 - "@ax/sld": ^0.15.9 + "@ax/sld": ^2.0.5 scripts: postbuild: dotnet run --project ..//..//..//AXSharp.compiler//src//ixc//AXSharp.ixc.csproj --framework diff --git a/src/AXSharp.connectors/tests/ax-test-project/go.ps1 b/src/AXSharp.connectors/tests/ax-test-project/go.ps1 index 3e93b0b0..59231866 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/go.ps1 +++ b/src/AXSharp.connectors/tests/ax-test-project/go.ps1 @@ -4,4 +4,5 @@ $targetIP $targetInput apax install apax build -apax sld --accept-security-disclaimer -t $targetIP -i $targetInput -r --default-server-interface \ No newline at end of file +#apax sld --accept-security-disclaimer -t $targetIP -i $targetInput -r --default-server-interface +apax sld load -t $targetIP -i $targetInput -r --accept-security-disclaimer \ No newline at end of file diff --git a/src/AXSharp.connectors/tests/ax-test-project/src/complexArrayItem.st b/src/AXSharp.connectors/tests/ax-test-project/src/complexArrayItem.st index d9d9f092..fc5c3a4e 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/src/complexArrayItem.st +++ b/src/AXSharp.connectors/tests/ax-test-project/src/complexArrayItem.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS complexArrayItem VAR PUBLIC itemBOOL : BOOL ; diff --git a/src/AXSharp.connectors/tests/ax-test-project/src/complexArrayItemNested.st b/src/AXSharp.connectors/tests/ax-test-project/src/complexArrayItemNested.st index ab917e2a..a5953186 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/src/complexArrayItemNested.st +++ b/src/AXSharp.connectors/tests/ax-test-project/src/complexArrayItemNested.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS complexArrayItemNested VAR PUBLIC nesteditemBOOL : BOOL ; diff --git a/src/AXSharp.connectors/tests/ax-test-project/src/configuration.st b/src/AXSharp.connectors/tests/ax-test-project/src/configuration.st index 066fc1c7..505cecef 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/src/configuration.st +++ b/src/AXSharp.connectors/tests/ax-test-project/src/configuration.st @@ -9,53 +9,83 @@ CONFIGURATION MyConfiguration //myArrayString: ARRAY[0..10] OF STRING; // myArrayComplex: ARRAY[0..10] OF complexArrayItem; - + {S7.extern=ReadWrite} mins : full_of_primitives; + {S7.extern=ReadWrite} maxs : full_of_primitives; + {S7.extern=ReadWrite} minsmatch : full_of_primitives_match; + {S7.extern=ReadWrite} maxsmatch : full_of_primitives_match; - + {S7.extern=ReadWrite} myBOOL : BOOL := TRUE ; + {S7.extern=ReadWrite} myBYTE : BYTE ; + {S7.extern=ReadWrite} myWORD : WORD ; + {S7.extern=ReadWrite} myDWORD : DWORD ; + {S7.extern=ReadWrite} myLWORD : LWORD ; + {S7.extern=ReadWrite} mySINT : SINT ; + {S7.extern=ReadWrite} myINT : INT ; + {S7.extern=ReadWrite} myDINT : DINT ; + {S7.extern=ReadWrite} myLINT : LINT ; + {S7.extern=ReadWrite} myUSINT : USINT ; + {S7.extern=ReadWrite} myUINT : UINT ; + {S7.extern=ReadWrite} myUDINT : UDINT ; + {S7.extern=ReadWrite} myULINT : ULINT ; + {S7.extern=ReadWrite} myREAL : REAL ; + {S7.extern=ReadWrite} myLREAL : LREAL ; + {S7.extern=ReadWrite} myTIME : TIME ; + {S7.extern=ReadWrite} myLTIME : LTIME ; + {S7.extern=ReadWrite} myDATE : DATE ; + {S7.extern=ReadWrite} myLDATE : LDATE ; + {S7.extern=ReadWrite} myTIME_OF_DAY : TIME_OF_DAY ; + {S7.extern=ReadWrite} myLTIME_OF_DAY : LTIME_OF_DAY ; + {S7.extern=ReadWrite} myDATE_AND_TIME : DATE_AND_TIME ; + {S7.extern=ReadWrite} myLDATE_AND_TIME : LDATE_AND_TIME; + {S7.extern=ReadWrite} myCHAR : CHAR ; + {S7.extern=ReadWrite} myWCHAR : WCHAR ; + {S7.extern=ReadWrite} mySTRING : STRING ; + {S7.extern=ReadWrite} myWSTRING : WSTRING ; - + {S7.extern=ReadWrite} myColors : Colors; + {S7.extern=ReadWrite} Hierarchy : hierarchy; // Issues //GH_PKTu_ix_56_Base: GH.PKTu.ix_56.Base; // GH_PKTu_ix_56_FirstInheritance : GH.PKTu.ix_56.FirstInheritance; - + {S7.extern=ReadWrite} GH_PKTu_ix_56_SecondInheritance : GH.PKTu.ix_56.SecondInheritance; END_VAR END_CONFIGURATION diff --git a/src/AXSharp.connectors/tests/ax-test-project/src/full_of_primitives.st b/src/AXSharp.connectors/tests/ax-test-project/src/full_of_primitives.st index b2411872..ba0569c0 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/src/full_of_primitives.st +++ b/src/AXSharp.connectors/tests/ax-test-project/src/full_of_primitives.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS full_of_primitives VAR PUBLIC myBOOL : BOOL ; diff --git a/src/AXSharp.connectors/tests/ax-test-project/src/full_of_primitives_match.st b/src/AXSharp.connectors/tests/ax-test-project/src/full_of_primitives_match.st index b0b1112d..deca9061 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/src/full_of_primitives_match.st +++ b/src/AXSharp.connectors/tests/ax-test-project/src/full_of_primitives_match.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS full_of_primitives_match VAR PUBLIC diff --git a/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy.st b/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy.st index fbe5c107..142b49a3 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy.st +++ b/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS hierarchy VAR PUBLIC item : hierarchy_2; diff --git a/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_0.st b/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_0.st index b7133cca..5bb22f06 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_0.st +++ b/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_0.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS hierarchy_0 VAR PUBLIC item_member_property_1 : full_of_primitives; diff --git a/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_2.st b/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_2.st index 9f63cee2..ffce90b7 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_2.st +++ b/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_2.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS hierarchy_2 VAR PUBLIC item_member_property_1 : hierarchy_0; diff --git a/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_4.st b/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_4.st index 27008385..6fabd869 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_4.st +++ b/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_4.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS hierarchy_4 VAR PUBLIC item_member_property_1 : hierarchy_2; diff --git a/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_6.st b/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_6.st index 1da2f56e..a431fc77 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_6.st +++ b/src/AXSharp.connectors/tests/ax-test-project/src/hierarchy_6.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS hierarchy_6 VAR PUBLIC item_member_property_1 : hierarchy_4; diff --git a/src/AXSharp.connectors/tests/ax-test-project/src/issues/GH-PKTu-ix_56.st b/src/AXSharp.connectors/tests/ax-test-project/src/issues/GH-PKTu-ix_56.st index e566a4f8..92d6eb55 100644 --- a/src/AXSharp.connectors/tests/ax-test-project/src/issues/GH-PKTu-ix_56.st +++ b/src/AXSharp.connectors/tests/ax-test-project/src/issues/GH-PKTu-ix_56.st @@ -1,13 +1,13 @@ // https://github.com/ix-ax/axsharp/issues/56 NAMESPACE GH.PKTu.ix_56 - + {S7.extern=ReadWrite} CLASS ComplexMember VAR PUBLIC Counter : INT; END_VAR END_CLASS - + {S7.extern=ReadWrite} CLASS Base VAR PUBLIC baseMember : STRING; @@ -15,7 +15,7 @@ NAMESPACE GH.PKTu.ix_56 BaseDavid : DavidBase; END_VAR END_CLASS - + {S7.extern=ReadWrite} CLASS FirstInheritance EXTENDS Base VAR PUBLIC FirstInheritanceMember : STRING; @@ -23,7 +23,7 @@ NAMESPACE GH.PKTu.ix_56 FirstDavid : DavidBase; END_VAR END_CLASS - + {S7.extern=ReadWrite} CLASS SecondInheritance EXTENDS FirstInheritance VAR PUBLIC SecondInheritanceMember : STRING; @@ -31,13 +31,13 @@ NAMESPACE GH.PKTu.ix_56 SecodnDavid : DavidBase; END_VAR END_CLASS - + {S7.extern=ReadWrite} CLASS PedroBase VAR PUBLIC p : STRING; END_VAR END_CLASS - + {S7.extern=ReadWrite} CLASS DavidBase EXTENDS PedroBase VAR PUBLIC d : STRING; diff --git a/src/AXSharp.examples/hello.world.console/hello.world.console.plc/AXSharp.config.json b/src/AXSharp.examples/hello.world.console/hello.world.console.plc/AXSharp.config.json index d3b047ac..5834c807 100644 --- a/src/AXSharp.examples/hello.world.console/hello.world.console.plc/AXSharp.config.json +++ b/src/AXSharp.examples/hello.world.console/hello.world.console.plc/AXSharp.config.json @@ -1 +1 @@ -{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"ProjectFile":"hello_world_console_plc.csproj"} \ No newline at end of file +{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"IgnoreS7Pragmas":false,"ProjectFile":"hello_world_console_plc.csproj"} \ No newline at end of file diff --git a/src/AXSharp.examples/hello.world.console/hello.world.console.plc/hello.world.console.plc.sln b/src/AXSharp.examples/hello.world.console/hello.world.console.plc/hello.world.console.plc.sln new file mode 100644 index 00000000..ba015f16 --- /dev/null +++ b/src/AXSharp.examples/hello.world.console/hello.world.console.plc/hello.world.console.plc.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "hello.world.console.plc", "ix\hello.world.console.plc.csproj", "{95967F31-AD7A-45FB-99A5-9D93FF332979}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "hello_world_console_plc", "ix\hello_world_console_plc.csproj", "{4A4210C5-BB3A-49EA-A83C-E8BA2D7EEBF3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {95967F31-AD7A-45FB-99A5-9D93FF332979}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {95967F31-AD7A-45FB-99A5-9D93FF332979}.Debug|Any CPU.Build.0 = Debug|Any CPU + {95967F31-AD7A-45FB-99A5-9D93FF332979}.Release|Any CPU.ActiveCfg = Release|Any CPU + {95967F31-AD7A-45FB-99A5-9D93FF332979}.Release|Any CPU.Build.0 = Release|Any CPU + {4A4210C5-BB3A-49EA-A83C-E8BA2D7EEBF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A4210C5-BB3A-49EA-A83C-E8BA2D7EEBF3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A4210C5-BB3A-49EA-A83C-E8BA2D7EEBF3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A4210C5-BB3A-49EA-A83C-E8BA2D7EEBF3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {667D7F77-00F5-4DAB-B2AF-06185DE7B48D} + EndGlobalSection +EndGlobal diff --git a/src/AXSharp.examples/hello.world.console/hello.world.console.plc/src/configuration.st b/src/AXSharp.examples/hello.world.console/hello.world.console.plc/src/configuration.st index 43d09243..235c5515 100644 --- a/src/AXSharp.examples/hello.world.console/hello.world.console.plc/src/configuration.st +++ b/src/AXSharp.examples/hello.world.console/hello.world.console.plc/src/configuration.st @@ -3,7 +3,9 @@ CONFIGURATION MyConfiguration PROGRAM P1 WITH Main: MyProgram; VAR_GLOBAL + {S7.extern=ReadWrite} Counter : ULINT; + {S7.extern=ReadWrite} HelloWorld : STRING := 'Hello world'; END_VAR END_CONFIGURATION diff --git a/src/AXSharp.tools/src/AXSharp.TIA2AXTool/Properties/launchSettings.json b/src/AXSharp.tools/src/AXSharp.TIA2AXTool/Properties/launchSettings.json index e105d394..73c31f8b 100644 --- a/src/AXSharp.tools/src/AXSharp.TIA2AXTool/Properties/launchSettings.json +++ b/src/AXSharp.tools/src/AXSharp.TIA2AXTool/Properties/launchSettings.json @@ -19,6 +19,10 @@ "luki": { "commandName": "Project", "commandLineArgs": "-i 10.10.10.150 -o c:\\_TiaDataAx\\test.json -d DB_DataToTestAX" + }, + "axwebapitests": { + "commandName": "Project", + "commandLineArgs": "-i 192.168.0.10 -o c:\\W\\trash\\test.json -d TGlobalVariablesDB" } } } diff --git a/src/sanbox/integration/ix-integration-plc/AXSharp.config.json b/src/sanbox/integration/ix-integration-plc/AXSharp.config.json index 679db710..356beefb 100644 --- a/src/sanbox/integration/ix-integration-plc/AXSharp.config.json +++ b/src/sanbox/integration/ix-integration-plc/AXSharp.config.json @@ -1 +1 @@ -{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"ProjectFile":"ix_integration_plc.csproj"} \ No newline at end of file +{"OutputProjectFolder":"ix","UseBase":false,"NoDependencyUpdate":false,"IgnoreS7Pragmas":false,"ProjectFile":"ix_integration_plc.csproj"} \ No newline at end of file diff --git a/src/sanbox/integration/ix-integration-plc/ix-integration-plc.sln b/src/sanbox/integration/ix-integration-plc/ix-integration-plc.sln new file mode 100644 index 00000000..85eff274 --- /dev/null +++ b/src/sanbox/integration/ix-integration-plc/ix-integration-plc.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ix_integration_plc", "ix\ix_integration_plc.csproj", "{D26353F3-13BB-4EF2-8737-64394B9F727B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D26353F3-13BB-4EF2-8737-64394B9F727B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D26353F3-13BB-4EF2-8737-64394B9F727B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D26353F3-13BB-4EF2-8737-64394B9F727B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D26353F3-13BB-4EF2-8737-64394B9F727B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E0DF88D2-E674-451C-92AB-7F9FCDB9E244} + EndGlobalSection +EndGlobal diff --git a/src/sanbox/integration/ix-integration-plc/ix/Resources/PlcStringResources.resx b/src/sanbox/integration/ix-integration-plc/ix/Resources/PlcStringResources.resx index 056e541c..0f335fb9 100644 --- a/src/sanbox/integration/ix-integration-plc/ix/Resources/PlcStringResources.resx +++ b/src/sanbox/integration/ix-integration-plc/ix/Resources/PlcStringResources.resx @@ -60,54 +60,54 @@ Integer From PLC - src\compositeLayout.st,2 + src\compositeLayout.st,3 UInteger From PLC - src\compositeLayout.st,4 + src\compositeLayout.st,5 STRING From PLC - src\compositeLayout.st,6 + src\compositeLayout.st,7 Task - src\compositeLayout.st,8 + src\compositeLayout.st,9 LREAL From PLC - src\compositeLayout.st,11 + src\compositeLayout.st,12 BOOL From PLC - src\compositeLayout.st,13 + src\compositeLayout.st,14 DATE From PLC - src\compositeLayout.st,15 + src\compositeLayout.st,16 DATE_AND_TIME From PLC - src\compositeLayout.st,17 + src\compositeLayout.st,18 TIME_OF_DAY From PLC - src\compositeLayout.st,19 + src\compositeLayout.st,20 WORD From PLC - src\test\border.st,10 + src\test\border.st,11 BYTE From PLC - src\test\border.st,12 + src\test\border.st,13 REAL From PLC - src\test\border.st,14 + src\test\border.st,15 ENUM Station status - src\test\border.st,26 + src\test\border.st,27 \ No newline at end of file diff --git a/src/sanbox/integration/ix-integration-plc/src/all_primitives.st b/src/sanbox/integration/ix-integration-plc/src/all_primitives.st index 0e49e7e2..bdc3b5cd 100644 --- a/src/sanbox/integration/ix-integration-plc/src/all_primitives.st +++ b/src/sanbox/integration/ix-integration-plc/src/all_primitives.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS all_primitives VAR PUBLIC myBOOL : BOOL ; diff --git a/src/sanbox/integration/ix-integration-plc/src/compositeLayout.st b/src/sanbox/integration/ix-integration-plc/src/compositeLayout.st index 874c12f5..d898e944 100644 --- a/src/sanbox/integration/ix-integration-plc/src/compositeLayout.st +++ b/src/sanbox/integration/ix-integration-plc/src/compositeLayout.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS compositeLayout VAR PUBLIC {#ix-set:AttributeName = "<#Integer From PLC#>"} diff --git a/src/sanbox/integration/ix-integration-plc/src/configuration.st b/src/sanbox/integration/ix-integration-plc/src/configuration.st index bac342ce..e39ee932 100644 --- a/src/sanbox/integration/ix-integration-plc/src/configuration.st +++ b/src/sanbox/integration/ix-integration-plc/src/configuration.st @@ -4,25 +4,38 @@ CONFIGURATION MyConfiguration PROGRAM P1 WITH Main: MyProgram; VAR_GLOBAL + {S7.extern=ReadWrite} all_primitives : all_primitives; + {S7.extern=ReadWrite} weather : weather; + {S7.extern=ReadWrite} weathers : weathers; + {S7.extern=ReadWrite} {#ix-set:AttributeName = "Weather in a stack pannel and grouped in group box"} weather_stacked : Layouts.Stacked.weather; + {S7.extern=ReadWrite} {#ix-set:AttributeName = "Weather in a wrap pannel and grouped in group box"} weather_wrapped : Layouts.Wrapped.weather; + {S7.extern=ReadWrite} {#ix-set:AttributeName = "Weather in a tabs and grouped in group box"} weather_tabbed : Layouts.Tabbed.weather; + {S7.extern=ReadWrite} {#ix-set:AttributeName = "Weather structure set to read once"} {#ix-attr:[ReadOnce()]} weather_readOnce : Layouts.Stacked.weather; + {S7.extern=ReadWrite} {#ix-set:AttributeName = "Weather structure set to read only"} {#ix-attr:[ReadOnly()]} + {S7.extern=ReadWrite} weather_readOnly : Layouts.Stacked.weather; + {S7.extern=ReadWrite} test_example: example; + {S7.extern=ReadWrite} measurements : MeasurementExample.Measurements; + {S7.extern=ReadWrite} ixcomponent : ixcomponent; + {S7.extern=ReadWrite} monster : Monster; END_VAR END_CONFIGURATION diff --git a/src/sanbox/integration/ix-integration-plc/src/example.st b/src/sanbox/integration/ix-integration-plc/src/example.st index 0788ebeb..d807a7ca 100644 --- a/src/sanbox/integration/ix-integration-plc/src/example.st +++ b/src/sanbox/integration/ix-integration-plc/src/example.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS example VAR PUBLIC {#ix-attr:[Container(Layout.Stack)]} diff --git a/src/sanbox/integration/ix-integration-plc/src/geolocation.st b/src/sanbox/integration/ix-integration-plc/src/geolocation.st index c06bd2b6..b7106648 100644 --- a/src/sanbox/integration/ix-integration-plc/src/geolocation.st +++ b/src/sanbox/integration/ix-integration-plc/src/geolocation.st @@ -1,6 +1,7 @@ {#ix-attr:[Container(Layout.Stack)]} {#ix-attr:[Group(GroupLayout.GroupBox)]} {#ix-set:AttributeName = "Location"} +{S7.extern=ReadWrite} CLASS GeoLocation VAR PUBLIC {#ix-set:AttributeName = "Latitude [°]"} diff --git a/src/sanbox/integration/ix-integration-plc/src/ixcomponent.st b/src/sanbox/integration/ix-integration-plc/src/ixcomponent.st index 13dba3c0..14f82178 100644 --- a/src/sanbox/integration/ix-integration-plc/src/ixcomponent.st +++ b/src/sanbox/integration/ix-integration-plc/src/ixcomponent.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS ixcomponent VAR PUBLIC {#ix-set:AttributeName = "My integer"} @@ -14,6 +15,7 @@ CLASS ixcomponent END_CLASS NAMESPACE MySecondNamespace + {S7.extern=ReadWrite} CLASS ixcomponent VAR PUBLIC {#ix-set:AttributeName = "My integer"} @@ -27,6 +29,7 @@ NAMESPACE MySecondNamespace END_NAMESPACE NAMESPACE ThirdNamespace + {S7.extern=ReadWrite} CLASS ixcomponent VAR PUBLIC {#ix-set:AttributeName = "My integer"} diff --git a/src/sanbox/integration/ix-integration-plc/src/measurement.st b/src/sanbox/integration/ix-integration-plc/src/measurement.st index 5ddb2af8..95d7f2a1 100644 --- a/src/sanbox/integration/ix-integration-plc/src/measurement.st +++ b/src/sanbox/integration/ix-integration-plc/src/measurement.st @@ -1,6 +1,7 @@ NAMESPACE MeasurementExample {#ix-attr:[Container(Layout.Wrap)]} {#ix-attr:[Group(GroupLayout.GroupBox)]} + {S7.extern=ReadWrite} CLASS PUBLIC Measurement VAR PUBLIC {#ix-set:AttributeName = "Minimum"} @@ -29,7 +30,7 @@ NAMESPACE MeasurementExample ); END_TYPE - + {S7.extern=ReadWrite} CLASS PUBLIC Measurements VAR PUBLIC {#ix-attr:[Container(Layout.Stack)]} diff --git a/src/sanbox/integration/ix-integration-plc/src/monster.st b/src/sanbox/integration/ix-integration-plc/src/monster.st index 74f1bf87..20d18867 100644 --- a/src/sanbox/integration/ix-integration-plc/src/monster.st +++ b/src/sanbox/integration/ix-integration-plc/src/monster.st @@ -1,4 +1,5 @@ NAMESPACE MonsterData + {S7.extern=ReadWrite} CLASS MonsterBase VAR PUBLIC ArrayOfBytes : ARRAY[0..3] OF BYTE; @@ -6,12 +7,15 @@ NAMESPACE MonsterData ArrayOfIxComponent : ARRAY[0..3] OF ixcomponent; END_VAR END_CLASS + + {S7.extern=ReadWrite} CLASS Monster EXTENDS MonsterBase VAR PUBLIC DriveA : DriveBase; END_VAR END_CLASS - + + {S7.extern=ReadWrite} CLASS DriveBase VAR PUBLIC Position : LREAL; diff --git a/src/sanbox/integration/ix-integration-plc/src/stacked/weather.st b/src/sanbox/integration/ix-integration-plc/src/stacked/weather.st index c04775df..a1313643 100644 --- a/src/sanbox/integration/ix-integration-plc/src/stacked/weather.st +++ b/src/sanbox/integration/ix-integration-plc/src/stacked/weather.st @@ -1,6 +1,7 @@ NAMESPACE Layouts.Stacked {#ix-attr:[Container(Layout.Stack)]} - {#ix-attr:[Group(GroupLayout.GroupBox)]} + {#ix-attr:[Group(GroupLayout.GroupBox)]} + {S7.extern=ReadWrite} CLASS PUBLIC weather EXTENDS weatherBase END_CLASS diff --git a/src/sanbox/integration/ix-integration-plc/src/tabbed/weather.st b/src/sanbox/integration/ix-integration-plc/src/tabbed/weather.st index b858ff4e..84532b31 100644 --- a/src/sanbox/integration/ix-integration-plc/src/tabbed/weather.st +++ b/src/sanbox/integration/ix-integration-plc/src/tabbed/weather.st @@ -1,6 +1,7 @@ NAMESPACE Layouts.Tabbed {#ix-attr:[Container(Layout.Tabs)]} {#ix-attr:[Group(GroupLayout.GroupBox)]} + {S7.extern=ReadWrite} CLASS PUBLIC weather EXTENDS weatherBase END_CLASS diff --git a/src/sanbox/integration/ix-integration-plc/src/taskExample.st b/src/sanbox/integration/ix-integration-plc/src/taskExample.st index 79cdddaa..cea171da 100644 --- a/src/sanbox/integration/ix-integration-plc/src/taskExample.st +++ b/src/sanbox/integration/ix-integration-plc/src/taskExample.st @@ -1,3 +1,4 @@ +{S7.extern=ReadWrite} CLASS TaskExample VAR PUBLIC example : STRING; diff --git a/src/sanbox/integration/ix-integration-plc/src/test/border.st b/src/sanbox/integration/ix-integration-plc/src/test/border.st index c3da0bff..bd331321 100644 --- a/src/sanbox/integration/ix-integration-plc/src/test/border.st +++ b/src/sanbox/integration/ix-integration-plc/src/test/border.st @@ -1,5 +1,6 @@ {#ix-attr:[Container(Layout.Stack)]} -{#ix-attr:[Group(GroupLayout.Border)]} +{#ix-attr:[Group(GroupLayout.Border)]} +{S7.extern=ReadWrite} CLASS border VAR PUBLIC {#ix-set:AttributeName = "<#Integer From PLC#>"} diff --git a/src/sanbox/integration/ix-integration-plc/src/test/groupbox.st b/src/sanbox/integration/ix-integration-plc/src/test/groupbox.st index 6189b723..b4e25e7d 100644 --- a/src/sanbox/integration/ix-integration-plc/src/test/groupbox.st +++ b/src/sanbox/integration/ix-integration-plc/src/test/groupbox.st @@ -1,5 +1,6 @@ {#ix-attr:[Container(Layout.Stack)]} {#ix-attr:[Group(GroupLayout.GroupBox)]} +{S7.extern=ReadWrite} CLASS groupbox VAR PUBLIC {#ix-set:AttributeName = "<#Integer From PLC#>"} diff --git a/src/sanbox/integration/ix-integration-plc/src/test/test_primitive.st b/src/sanbox/integration/ix-integration-plc/src/test/test_primitive.st index 9343779c..1b1bab8f 100644 --- a/src/sanbox/integration/ix-integration-plc/src/test/test_primitive.st +++ b/src/sanbox/integration/ix-integration-plc/src/test/test_primitive.st @@ -1,4 +1,5 @@ {#ix-attr:[Container(Layout.Wrap)]} +{S7.extern=ReadWrite} CLASS test_primitive VAR PUBLIC {#ix-set:AttributeName = "<#Integer From PLC#>"} diff --git a/src/sanbox/integration/ix-integration-plc/src/weather.st b/src/sanbox/integration/ix-integration-plc/src/weather.st index 4305548d..d083c99d 100644 --- a/src/sanbox/integration/ix-integration-plc/src/weather.st +++ b/src/sanbox/integration/ix-integration-plc/src/weather.st @@ -1,4 +1,5 @@ {#ix[Container(Layout.Tabs)]} +{S7.extern=ReadWrite} CLASS weather VAR PUBLIC GeoLocation : GeoLocation; @@ -11,6 +12,7 @@ CLASS weather END_VAR END_CLASS +{S7.extern=ReadWrite} CLASS weathers VAR PUBLIC i : ARRAY[0..50] OF weatherBase; @@ -22,6 +24,7 @@ TYPE END_TYPE TYPE + {S7.extern=ReadWrite} Colors : INT ( RED := 12, GREEN := 14, diff --git a/src/sanbox/integration/ix-integration-plc/src/weatherBase.st b/src/sanbox/integration/ix-integration-plc/src/weatherBase.st index be123c59..a2ed5edd 100644 --- a/src/sanbox/integration/ix-integration-plc/src/weatherBase.st +++ b/src/sanbox/integration/ix-integration-plc/src/weatherBase.st @@ -1,6 +1,7 @@ {#ix-attr:[Container(Layout.Stack)]} - {#ix-attr:[Group(GroupLayout.GroupBox)]} + {#ix-attr:[Group(GroupLayout.GroupBox)]} + {S7.extern=ReadWrite} CLASS PUBLIC weatherBase VAR PUBLIC Latitude : REAL; diff --git a/src/sanbox/integration/ix-integration-plc/src/wrapped/weather.st b/src/sanbox/integration/ix-integration-plc/src/wrapped/weather.st index df7f3a51..423b9802 100644 --- a/src/sanbox/integration/ix-integration-plc/src/wrapped/weather.st +++ b/src/sanbox/integration/ix-integration-plc/src/wrapped/weather.st @@ -1,6 +1,7 @@ NAMESPACE Layouts.Wrapped {#ix-attr:[Container(Layout.Wrap)]} {#ix-attr:[Group(GroupLayout.GroupBox)]} + {S7.extern=ReadWrite} CLASS PUBLIC weather EXTENDS weatherBase END_CLASS diff --git a/src/sanbox/integration/ix-integration-plc/test/test.st b/src/sanbox/integration/ix-integration-plc/test/test.st index 82bb243b..d1a79018 100644 --- a/src/sanbox/integration/ix-integration-plc/test/test.st +++ b/src/sanbox/integration/ix-integration-plc/test/test.st @@ -3,6 +3,7 @@ USING AxUnit; NAMESPACE MyTest {TestFixture} + {S7.extern=ReadWrite} CLASS MyTestFixture {Test} METHOD PUBLIC MyTestMethod diff --git a/src/tests.integrations/integrated/src/ax/AXSharp.config.json b/src/tests.integrations/integrated/src/ax/AXSharp.config.json index bd515511..c745edaa 100644 --- a/src/tests.integrations/integrated/src/ax/AXSharp.config.json +++ b/src/tests.integrations/integrated/src/ax/AXSharp.config.json @@ -1 +1 @@ -{"OutputProjectFolder":"..\\integrated.twin","UseBase":false,"NoDependencyUpdate":false,"ProjectFile":"integrated.csproj"} \ No newline at end of file +{"OutputProjectFolder":"..\\integrated.twin","UseBase":false,"NoDependencyUpdate":false,"IgnoreS7Pragmas":false,"ProjectFile":"integrated.csproj"} \ No newline at end of file diff --git a/src/tests.integrations/integrated/src/ax/apax-lock.json b/src/tests.integrations/integrated/src/ax/apax-lock.json index 8da9f677..4ee8c260 100644 --- a/src/tests.integrations/integrated/src/ax/apax-lock.json +++ b/src/tests.integrations/integrated/src/ax/apax-lock.json @@ -242,32 +242,9 @@ "integrity": "sha512-2Pj/Encd6bUgsRfXyj3rA4YOUpRroqwzODKU37T95dMNle+BpFXYS3V88FYJyTdOgSrJik4VVdV1AFzH7NUQ8g==" }, "@ax/sld": { - "version": "0.15.9", - "resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-0.15.9.tgz", - "integrity": "sha512-Moqh0zbGNcpD88Z3uax2iXL0exnjsgXQodaZXiIFy5CrQaJzM3X/EzEHKBXQ8q+Xr8hs/Q6fWTUkkbDezVBZ6Q==", - "dependencies": { - "@ax/sld-linux-x64": "0.15.9", - "@ax/sld-win-x64": "0.15.9" - } - }, - "@ax/sld-linux-x64": { - "version": "0.15.9", - "resolved": "https://registry.simatic-ax.siemens.io/@ax/sld-linux-x64/-/sld-linux-x64-0.15.9.tgz", - "integrity": "sha512-jChM/HtZIP+nfMdkKYpkDkllg+tGkK9Y8qpVmCUjmliJ1nyO2mprVMRJKI9Q3m81mGdzpuD+vew4Vgx2e6xptw==", - "os": [ - "linux" - ], - "cpu": [ - "x64" - ] - }, - "@ax/sld-win-x64": { - "version": "0.15.9", - "resolved": "https://registry.simatic-ax.siemens.io/@ax/sld-win-x64/-/sld-win-x64-0.15.9.tgz", - "integrity": "sha512-NYPJWNaNAZAL3t33gRb6cI9n1rvogbyrbb/Y0agBnvjY+MBqNxviyizFyMsloql//vZwKKl674TPFx4FFWcYDg==", - "os": [ - "win32" - ], + "version": "2.0.5", + "resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-2.0.5.tgz", + "integrity": "sha512-upa0HyRVdYyzNu6j7E+gTAnpzP2mfZxvo+0jbm8H6Ci9ergL56SHaCVBC35PnociMZpdZ5d1/LTy6f8lwpDxXA==", "cpu": [ "x64" ] diff --git a/src/tests.integrations/integrated/src/ax/apax.yml b/src/tests.integrations/integrated/src/ax/apax.yml index e291eece..533e6118 100644 --- a/src/tests.integrations/integrated/src/ax/apax.yml +++ b/src/tests.integrations/integrated/src/ax/apax.yml @@ -8,7 +8,7 @@ targets: - swcpu devDependencies: "@ax/sdk": ^4.0.8 - "@ax/sld": ^0.15.9 + "@ax/sld": ^2.0.5 "@ax/stc": ^5.4.89 variables: @@ -24,5 +24,4 @@ scripts: - apax build # Here you will need to set the argumen -t to your plc OP and -i to platfrom you are dowloading to # --default-server-interface is a must if you are using WebAPI - - apax sld --accept-security-disclaimer -t $AXTARGET -i - $AXTARGETPLATFORMINPUT -r --default-server-interface + - apax sld load --accept-security-disclaimer -t $AXTARGET -i $AXTARGETPLATFORMINPUT -r diff --git a/src/tests.integrations/integrated/src/ax/ax.sln b/src/tests.integrations/integrated/src/ax/ax.sln new file mode 100644 index 00000000..80193bfb --- /dev/null +++ b/src/tests.integrations/integrated/src/ax/ax.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.002.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "integrated", "ix\integrated.csproj", "{DF21559F-EEFD-4415-8A15-889B8E4C059E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DF21559F-EEFD-4415-8A15-889B8E4C059E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DF21559F-EEFD-4415-8A15-889B8E4C059E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DF21559F-EEFD-4415-8A15-889B8E4C059E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DF21559F-EEFD-4415-8A15-889B8E4C059E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {83F81339-940A-43AE-AEE8-4D7495E2F4D6} + EndGlobalSection +EndGlobal diff --git a/src/tests.integrations/integrated/src/ax/src/configuration.st b/src/tests.integrations/integrated/src/ax/src/configuration.st index d3a4f288..2ca6497b 100644 --- a/src/tests.integrations/integrated/src/ax/src/configuration.st +++ b/src/tests.integrations/integrated/src/ax/src/configuration.st @@ -3,50 +3,83 @@ CONFIGURATION MyConfiguration TASK Main(Interval := T#10ms, Priority := 1); PROGRAM P1 WITH Main: MyProgram; - VAR_GLOBAL + VAR_GLOBAL + {S7.extern=ReadWrite} Monster : MonsterData.Monster; + {S7.extern=ReadWrite} OnlineToPlain_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} PlainToOnline_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} OnlineToShadowAsync_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} ShadowToOnlineAsync_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} ITwinObjectOnlineToPlain_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} ITwinObjectPlainToOnline_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} ITwinObjectOnlineToShadowAsync_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} ITwinObjectShadowToOnlineAsync_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} ShadowToPlainAsync_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} PlainToShadowAsync_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} ITwinObjectShadowToPlainAsync_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} ITwinObjectPlainToShadowAsync_should_copy_entire_structure : MonsterData.Monster; + {S7.extern=ReadWrite} Pokus : Pokus; + {S7.extern=ReadWrite} RealMonster : RealMonsterData.RealMonster; + {S7.extern=ReadWrite} OnlineToShadow_should_copy : RealMonsterData.RealMonster; + {S7.extern=ReadWrite} ShadowToOnline_should_copy : RealMonsterData.RealMonster; + {S7.extern=ReadWrite} OnlineToPlain_should_copy: RealMonsterData.RealMonster; + {S7.extern=ReadWrite} PlainToOnline_should_copy: RealMonsterData.RealMonster; + + {S7.extern=ReadWrite} ITwinObjectOnlineToShadow_should_copy : RealMonsterData.RealMonster; + {S7.extern=ReadWrite} ITwinObjectShadowToOnline_should_copy : RealMonsterData.RealMonster; + {S7.extern=ReadWrite} ITwinObjectOnlineToPlain_should_copy: RealMonsterData.RealMonster; + {S7.extern=ReadWrite} ITwinObjectPlainToOnline_should_copy: RealMonsterData.RealMonster; + {S7.extern=ReadWrite} p_online_shadow: all_primitives; + {S7.extern=ReadWrite} p_shadow_online: all_primitives; + {S7.extern=ReadWrite} p_online_plain: all_primitives; + {S7.extern=ReadWrite} p_plain_online: all_primitives; + {S7.extern=ReadWrite} p_shadow_plain: all_primitives; + {S7.extern=ReadWrite} p_plain_shadow: all_primitives; + {S7.extern=ReadWrite} StartPolling_should_update_cyclic_property : RealMonsterData.RealMonster; + {S7.extern=ReadWrite} StartPolling_ConcurentOverload : RealMonsterData.RealMonster; + {S7.extern=ReadWrite} GH_ISSUE_183 : GH_ISSUE_183.GH_ISSUE_183_1; END_VAR END_CONFIGURATION diff --git a/src/tests.integrations/integrated/src/ax/src/dataswapping/all_primitives.st b/src/tests.integrations/integrated/src/ax/src/dataswapping/all_primitives.st index 2f377a85..97e5f27b 100644 --- a/src/tests.integrations/integrated/src/ax/src/dataswapping/all_primitives.st +++ b/src/tests.integrations/integrated/src/ax/src/dataswapping/all_primitives.st @@ -1,3 +1,5 @@ + +{S7.extern=ReadWrite} CLASS all_primitives VAR PUBLIC myBOOL : BOOL ; diff --git a/src/tests.integrations/integrated/src/ax/src/dataswapping/moster.st b/src/tests.integrations/integrated/src/ax/src/dataswapping/moster.st index 3e7cea26..6ebafaab 100644 --- a/src/tests.integrations/integrated/src/ax/src/dataswapping/moster.st +++ b/src/tests.integrations/integrated/src/ax/src/dataswapping/moster.st @@ -1,4 +1,5 @@ NAMESPACE MonsterData + {S7.extern=ReadWrite} CLASS MonsterBase VAR PUBLIC Description : STRING; @@ -13,12 +14,14 @@ NAMESPACE MonsterData Description_tobeignoredbypocooperations : STRING; END_VAR END_CLASS + {S7.extern=ReadWrite} CLASS Monster EXTENDS MonsterBase VAR PUBLIC DriveA : DriveBase; END_VAR END_CLASS + {S7.extern=ReadWrite} CLASS DriveBase VAR PUBLIC Position : LREAL; diff --git a/src/tests.integrations/integrated/src/ax/src/dataswapping/realmonster.st b/src/tests.integrations/integrated/src/ax/src/dataswapping/realmonster.st index 39853034..fdc2a97d 100644 --- a/src/tests.integrations/integrated/src/ax/src/dataswapping/realmonster.st +++ b/src/tests.integrations/integrated/src/ax/src/dataswapping/realmonster.st @@ -1,4 +1,5 @@ NAMESPACE RealMonsterData + {S7.extern=ReadWrite} CLASS RealMonsterBase VAR PUBLIC Description : STRING; @@ -11,12 +12,14 @@ NAMESPACE RealMonsterData END_VAR END_CLASS + {S7.extern=ReadWrite} CLASS RealMonster EXTENDS RealMonsterBase VAR PUBLIC DriveA : DriveBaseNested; END_VAR END_CLASS + {S7.extern=ReadWrite} CLASS DriveBaseNested VAR PUBLIC Position : LREAL; @@ -27,6 +30,7 @@ NAMESPACE RealMonsterData END_VAR END_CLASS + {S7.extern=ReadWrite} CLASS NestedLevelOne VAR PUBLIC Position : LREAL; @@ -37,6 +41,7 @@ NAMESPACE RealMonsterData END_VAR END_CLASS + {S7.extern=ReadWrite} CLASS NestedLevelTwo VAR PUBLIC Position : LREAL; @@ -47,6 +52,7 @@ NAMESPACE RealMonsterData END_VAR END_CLASS + {S7.extern=ReadWrite} CLASS NestedLevelThree VAR PUBLIC Position : LREAL; diff --git a/src/tests.integrations/integrated/src/ax/src/issues/GH_ISSUE_183.st b/src/tests.integrations/integrated/src/ax/src/issues/GH_ISSUE_183.st index 3a41ab77..93e3de86 100644 --- a/src/tests.integrations/integrated/src/ax/src/issues/GH_ISSUE_183.st +++ b/src/tests.integrations/integrated/src/ax/src/issues/GH_ISSUE_183.st @@ -1,4 +1,5 @@ NAMESPACE GH_ISSUE_183 + {S7.extern=ReadWrite} CLASS GH_ISSUE_183_1 VAR PUBLIC NonZeroBasedArray : ARRAY[10..30] OF BYTE; diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/configuration.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/configuration.g.cs index c2b62ecb..7f738fa1 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/configuration.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/Onliners/configuration.g.cs @@ -150,8 +150,6 @@ public integratedTwinController(AXSharp.Connector.ConnectorAdapter adapter) public partial class Pokus : AXSharp.Connector.ITwinObject { - public Nested Nested { get; } - partial void PreConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); partial void PostConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); public Pokus(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) @@ -162,7 +160,6 @@ public Pokus(AXSharp.Connector.ITwinObject parent, string readableTail, string s this.@Parent = parent; HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); PreConstruct(parent, readableTail, symbolTail); - Nested = new Nested(this, "Nested", "Nested"); parent.AddChild(this); parent.AddKid(this); PostConstruct(parent, readableTail, symbolTail); @@ -177,9 +174,6 @@ public async virtual Task OnlineToPlain() { Pocos.Pokus plain = new Pocos.Pokus(); await this.ReadAsync(); -#pragma warning disable CS0612 - plain.Nested = await Nested._OnlineToPlainNoacAsync(); -#pragma warning restore CS0612 return plain; } @@ -188,9 +182,6 @@ public async virtual Task OnlineToPlain() public async Task _OnlineToPlainNoacAsync() { Pocos.Pokus plain = new Pocos.Pokus(); -#pragma warning disable CS0612 - plain.Nested = await Nested._OnlineToPlainNoacAsync(); -#pragma warning restore CS0612 return plain; } @@ -198,9 +189,6 @@ public async virtual Task OnlineToPlain() [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected async Task _OnlineToPlainNoacAsync(Pocos.Pokus plain) { -#pragma warning disable CS0612 - plain.Nested = await Nested._OnlineToPlainNoacAsync(); -#pragma warning restore CS0612 return plain; } @@ -211,9 +199,6 @@ public async virtual Task PlainToOnline(T plain) public async Task> PlainToOnlineAsync(Pocos.Pokus plain) { -#pragma warning disable CS0612 - await this.Nested._PlainToOnlineNoacAsync(plain.Nested); -#pragma warning restore CS0612 return await this.WriteAsync(); } @@ -221,9 +206,6 @@ public async Task> PlainToOnlineAsync(Pocos.Pokus pl [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public async Task _PlainToOnlineNoacAsync(Pocos.Pokus plain) { -#pragma warning disable CS0612 - await this.Nested._PlainToOnlineNoacAsync(plain.Nested); -#pragma warning restore CS0612 } public async virtual Task ShadowToPlain() @@ -234,13 +216,11 @@ public async virtual Task ShadowToPlain() public async Task ShadowToPlainAsync() { Pocos.Pokus plain = new Pocos.Pokus(); - plain.Nested = await Nested.ShadowToPlainAsync(); return plain; } protected async Task ShadowToPlainAsync(Pocos.Pokus plain) { - plain.Nested = await Nested.ShadowToPlainAsync(); return plain; } @@ -251,7 +231,6 @@ public async virtual Task PlainToShadow(T plain) public async Task> PlainToShadowAsync(Pocos.Pokus plain) { - await this.Nested.PlainToShadowAsync(plain.Nested); return this.RetrievePrimitives(); } @@ -342,12 +321,6 @@ public System.String GetHumanReadable(System.Globalization.CultureInfo culture) public partial class Nested : AXSharp.Connector.ITwinObject { - public OnlinerString SomeString { get; } - - public OnlinerInt SomeInt { get; } - - public OnlinerByte SomeByte { get; } - partial void PreConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); partial void PostConstruct(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail); public Nested(AXSharp.Connector.ITwinObject parent, string readableTail, string symbolTail) @@ -358,9 +331,6 @@ public Nested(AXSharp.Connector.ITwinObject parent, string readableTail, string this.@Parent = parent; HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail); PreConstruct(parent, readableTail, symbolTail); - SomeString = @Connector.ConnectorAdapter.AdapterFactory.CreateSTRING(this, "SomeString", "SomeString"); - SomeInt = @Connector.ConnectorAdapter.AdapterFactory.CreateINT(this, "SomeInt", "SomeInt"); - SomeByte = @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(this, "SomeByte", "SomeByte"); parent.AddChild(this); parent.AddKid(this); PostConstruct(parent, readableTail, symbolTail); @@ -375,9 +345,6 @@ public async virtual Task OnlineToPlain() { Pocos.Nested plain = new Pocos.Nested(); await this.ReadAsync(); - plain.SomeString = SomeString.LastValue; - plain.SomeInt = SomeInt.LastValue; - plain.SomeByte = SomeByte.LastValue; return plain; } @@ -386,9 +353,6 @@ public async virtual Task OnlineToPlain() public async Task _OnlineToPlainNoacAsync() { Pocos.Nested plain = new Pocos.Nested(); - plain.SomeString = SomeString.LastValue; - plain.SomeInt = SomeInt.LastValue; - plain.SomeByte = SomeByte.LastValue; return plain; } @@ -396,9 +360,6 @@ public async virtual Task OnlineToPlain() [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] protected async Task _OnlineToPlainNoacAsync(Pocos.Nested plain) { - plain.SomeString = SomeString.LastValue; - plain.SomeInt = SomeInt.LastValue; - plain.SomeByte = SomeByte.LastValue; return plain; } @@ -409,15 +370,6 @@ public async virtual Task PlainToOnline(T plain) public async Task> PlainToOnlineAsync(Pocos.Nested plain) { -#pragma warning disable CS0612 - SomeString.LethargicWrite(plain.SomeString); -#pragma warning restore CS0612 -#pragma warning disable CS0612 - SomeInt.LethargicWrite(plain.SomeInt); -#pragma warning restore CS0612 -#pragma warning disable CS0612 - SomeByte.LethargicWrite(plain.SomeByte); -#pragma warning restore CS0612 return await this.WriteAsync(); } @@ -425,15 +377,6 @@ public async Task> PlainToOnlineAsync(Pocos.Nested p [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public async Task _PlainToOnlineNoacAsync(Pocos.Nested plain) { -#pragma warning disable CS0612 - SomeString.LethargicWrite(plain.SomeString); -#pragma warning restore CS0612 -#pragma warning disable CS0612 - SomeInt.LethargicWrite(plain.SomeInt); -#pragma warning restore CS0612 -#pragma warning disable CS0612 - SomeByte.LethargicWrite(plain.SomeByte); -#pragma warning restore CS0612 } public async virtual Task ShadowToPlain() @@ -444,17 +387,11 @@ public async virtual Task ShadowToPlain() public async Task ShadowToPlainAsync() { Pocos.Nested plain = new Pocos.Nested(); - plain.SomeString = SomeString.Shadow; - plain.SomeInt = SomeInt.Shadow; - plain.SomeByte = SomeByte.Shadow; return plain; } protected async Task ShadowToPlainAsync(Pocos.Nested plain) { - plain.SomeString = SomeString.Shadow; - plain.SomeInt = SomeInt.Shadow; - plain.SomeByte = SomeByte.Shadow; return plain; } @@ -465,9 +402,6 @@ public async virtual Task PlainToShadow(T plain) public async Task> PlainToShadowAsync(Pocos.Nested plain) { - SomeString.Shadow = plain.SomeString; - SomeInt.Shadow = plain.SomeInt; - SomeByte.Shadow = plain.SomeByte; return this.RetrievePrimitives(); } diff --git a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs index 0f3c6bb6..12b25fe7 100644 --- a/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs +++ b/src/tests.integrations/integrated/src/integrated.twin/.g/POCO/configuration.g.cs @@ -42,14 +42,9 @@ public partial class integratedTwinController public partial class Pokus : AXSharp.Connector.IPlain { - public Nested Nested { get; set; } = new Nested(); } public partial class Nested : AXSharp.Connector.IPlain { - public string SomeString { get; set; } = string.Empty; - public Int16 SomeInt { get; set; } - - public Byte SomeByte { get; set; } } } \ No newline at end of file