Skip to content

Commit

Permalink
wip adds possibility of ignoring connector operation on poco
Browse files Browse the repository at this point in the history
  • Loading branch information
PTKu committed Sep 26, 2023
1 parent 862384e commit ad7e5fe
Show file tree
Hide file tree
Showing 49 changed files with 430 additions and 274 deletions.
5 changes: 5 additions & 0 deletions cake/BuildContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.IO.Compression;
using System.Linq;
using Build.FilteredSolution;
using Cake.Common.IO;
using Cake.Common.Tools.DotNet;
using Cake.Common.Tools.DotNet.Build;
using Cake.Common.Tools.DotNet.MSBuild;
Expand All @@ -22,6 +23,8 @@
using Cake.Core.Diagnostics;
using Cake.Core.IO;
using Cake.Frosting;
using Polly;
using static NuGet.Packaging.PackagingConstants;
using Path = System.IO.Path;

public class BuildContext : FrostingContext
Expand Down Expand Up @@ -90,6 +93,8 @@ public BuildContext(ICakeContext context, BuildParameters buildParameters)
public void UploadTestPlc(string workingDirectory, string targetIp,
string targetPlatform)
{
var lockFile = Path.Combine(workingDirectory, "apax-lock.json");
if (File.Exists(lockFile)) this.DeleteFile(lockFile);

this.Log.Information($"Installing dependencies for ax project '{workingDirectory}' at {targetIp}");

Expand Down
3 changes: 3 additions & 0 deletions cake/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
using Credentials = Octokit.Credentials;
using Path = System.IO.Path;
using ProductHeaderValue = Octokit.ProductHeaderValue;
using static NuGet.Packaging.PackagingConstants;


public static class Program
Expand Down Expand Up @@ -71,6 +72,8 @@ public override void Run(BuildContext context)
context.CleaUpAllBinsAndObjs();
context.CleanDirectory(context.Artifacts);
context.CleanDirectory(context.TestResults);


}
}

Expand Down
22 changes: 10 additions & 12 deletions src/AXSharp-L3-tests.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,40 @@
"AXSharp.abstractions\\src\\AXSharp.Abstractions\\AXSharp.Abstractions.csproj",
"AXSharp.blazor\\src\\AXSharp.Presentation.Blazor.Controls\\AXSharp.Presentation.Blazor.Controls.csproj",
"AXSharp.blazor\\src\\AXSharp.Presentation.Blazor\\AXSharp.Presentation.Blazor.csproj",
"AXSharp.blazor\\tests\\sandbox\\ComponentsExamples\\ComponentsExamples.csproj",
"AXSharp.blazor\\tests\\sandbox\\AXSharp.RenderableContent.Tests\\AXSharp.RenderableContent.Tests.csproj",
"AXSharp.blazor\\tests\\sandbox\\ComponentsExamples\\ComponentsExamples.csproj",
"AXSharp.blazor\\tests\\sandbox\\IxBlazor.App\\IxBlazor.App.csproj",
"AXSharp.blazor\\tests\\sandbox\\ax-blazor-example\\ix\\ax-blazor-example.csproj",
"AXSharp.blazor\\tests\\sandbox\\ax-blazor-example\\ix\\ax_blazor_example.csproj",
"AXSharp.compiler\\src\\AXSharp.Compiler.Abstractions\\AXSharp.Compiler.Abstractions.csproj",
"AXSharp.compiler\\src\\AXSharp.Compiler\\AXSharp.Compiler.csproj",
"AXSharp.compiler\\src\\AXSharp.Cs.Compiler\\AXSharp.Compiler.Cs.csproj",
"AXSharp.compiler\\src\\AXSharp.Compiler.Abstractions\\AXSharp.Compiler.Abstractions.csproj",
"AXSharp.compiler\\src\\ixc\\AXSharp.ixc.csproj",
"AXSharp.compiler\\src\\ixd\\AXSharp.ixd.csproj",
"AXSharp.compiler\\src\\ixr\\AXSharp.ixr.csproj",
"AXSharp.compiler\\tests\\AXSharp.CompilerTests\\AXSharp.CompilerTests.csproj",
"AXSharp.compiler\\tests\\AXSharp.Compiler.CsTests\\AXSharp.Compiler.CsTests.csproj",
"AXSharp.compiler\\tests\\AXSharp.CompilerTests\\AXSharp.CompilerTests.csproj",
"AXSharp.compiler\\tests\\AXSharp.ixc.Tests\\AXSharp.ixc.Tests.csproj",
"AXSharp.compiler\\tests\\AXSharp.ixr.Tests\\AXSharp.ixr.Tests.csproj",
"AXSharp.connectors\\src\\AXSharp.Connector.S71500.WebAPI\\AXSharp.Connector.S71500.WebAPI.csproj",
"AXSharp.connectors\\src\\AXSharp.Connector\\AXSharp.Connector.csproj",
"AXSharp.connectors\\src\\AXSharp.TIA.Connector\\AXSharp.TIA2AXSharp.csproj",
"AXSharp.connectors\\tests\\AXSharp.Connector.Sax.WebAPITests\\AXSharp.Connector.S71500.WebAPITests.csproj",
"AXSharp.connectors\\tests\\AXSharp.ConnectorLegacyTests\\AXSharp.ConnectorLegacyTests.csproj",
"AXSharp.connectors\\tests\\AXSharp.ConnectorTests\\AXSharp.ConnectorTests\\AXSharp.ConnectorTests.csproj",
"AXSharp.connectors\\tests\\AXSharp.TIA.ConnectorTests\\AXSharp.TIA2AXSharpTests_L3.csproj",
"AXSharp.connectors\\tests\\ax-test-project\\ix\\ax_test_project.csproj",
"AXSharp.connectors\\tests\\exploring\\Webserver.Api.Exploratory\\Webserver.Api.Exploratory.csproj",
"AXSharp.connectors\\tests\\exploring\\exploratory.consoleapp\\exploratory.consoleapp.csproj",
"AXSharp.examples\\hello.world.console\\hello.world.console.plc\\ix\\hello.world.console.plc.csproj",
"AXSharp.examples\\hello.world.console\\hello.world.console\\hello.world.console.csproj",
"AXSharp.templates\\working\\AXSharp.templates.csproj",
"AXSharp.templates\\working\\templates\\ixblazor\\ixblazor.app\\ixblazor.hmi.csproj",
"AXSharp.templates\\working\\templates\\ixblazor\\ixblazor.twin\\ixblazor.csproj",
"AXSharp.templates\\working\\templates\\ixconsole\\ixconsole.twin\\ixconsole.csproj",
"AXSharp.templates\\working\\templates\\ixconsole\\ixconsole\\ixconsole.app.csproj",
"AXSharp.templates\\working\\templates\\ixtwin\\ixtwin.csproj",
"AXSharp.tools\\tests\\AXSharp.LocalizablesToResx.Tests\\AXSharp.LocalizablesToResx.Tests.csproj"
"AXSharp.tools\\src\\AXSharp.LocalizablesToResx\\AXSharp.LocalizablesToResx.csproj",
"AXSharp.tools\\src\\AXSharp.TIA2AXTool\\AXSharp.TIA2AXTool.csproj",
"AXSharp.tools\\src\\AXSharp.nuget.update\\AXSharp.nuget.update.csproj",
"AXSharp.tools\\tests\\AXSharp.LocalizablesToResx.Tests\\AXSharp.LocalizablesToResx.Tests.csproj",
"AXSharp.tools\\tests\\AXSharp.nuget.update.Tests\\AXSharp.nuget.update.Tests.csproj",
"sanbox\\integration\\ix-integration-blazor\\ix-integration-blazor.csproj",
"sanbox\\integration\\ix-integration-library\\ix-integration-library.csproj",
"sanbox\\integration\\ix-integration-plc\\ix\\ix-integration-plc.csproj",
"sanbox\\integration\\ix-integration-plc\\ix\\ix_integration_plc.csproj",
"tests.integrations\\integrated\\src\\integrated.app\\integrated.hmi.csproj",
"tests.integrations\\integrated\\src\\integrated.twin\\integrated.csproj",
"tests.integrations\\integrated\\tests\\integrated.tests\\integrated.tests.csproj"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"OutputProjectFolder":"ix"}
{"OutputProjectFolder":"ix","UseBase":false}
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static CsOnlinerPlainerOnlineToPlainBuilder Create(IxNodeVisitor visitor,

builder.AddToSource($"public async Task<Pocos.{semantics.FullyQualifiedName}> {MethodName}Async(){{\n");
builder.AddToSource($"Pocos.{semantics.FullyQualifiedName} plain = new Pocos.{semantics.FullyQualifiedName}();");
builder.AddToSource("await this.ReadAsync();");
builder.AddToSource("await this.ReadAsync<IgnoreOnPocoOperation>();");

semantics.Fields.ToList().ForEach(p => p.Accept(visitor, builder));

Expand All @@ -140,7 +140,7 @@ public static CsOnlinerPlainerOnlineToPlainBuilder Create(IxNodeVisitor visitor,

builder.AddToSource($"public {qualifier} async Task<Pocos.{semantics.FullyQualifiedName}> {MethodName}Async(){{\n");
builder.AddToSource($"Pocos.{semantics.FullyQualifiedName} plain = new Pocos.{semantics.FullyQualifiedName}();");
builder.AddToSource("await this.ReadAsync();");
builder.AddToSource("await this.ReadAsync<IgnoreOnPocoOperation>();");

if (isExtended)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static CsOnlinerPlainerPlainToOnlineBuilder Create(IxNodeVisitor visitor,

semantics.Fields.ToList().ForEach(p => p.Accept(visitor, builder));

builder.AddToSource("return await this.WriteAsync();");
builder.AddToSource("return await this.WriteAsync<IgnoreOnPocoOperation>();");

builder.AddToSource($"}}");
return builder;
Expand All @@ -153,7 +153,7 @@ public static CsOnlinerPlainerPlainToOnlineBuilder Create(IxNodeVisitor visitor,

semantics.Fields.ToList().ForEach(p => p.Accept(visitor, builder));

builder.AddToSource("return await this.WriteAsync();");
builder.AddToSource("return await this.WriteAsync<IgnoreOnPocoOperation>();");

builder.AddToSource($"}}");
return builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async virtual Task<T> OnlineToPlain<T>()
public async Task<Pocos.ArrayDeclarationSimpleNamespace.array_declaration_class> OnlineToPlainAsync()
{
Pocos.ArrayDeclarationSimpleNamespace.array_declaration_class plain = new Pocos.ArrayDeclarationSimpleNamespace.array_declaration_class();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
plain.primitive = primitive.Select(p => p.LastValue).ToArray();
plain.complex = complex.Select(async p => await p.OnlineToPlainAsync()).Select(p => p.Result).ToArray();
return plain;
Expand All @@ -63,7 +63,7 @@ public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.ArrayDec
primitive.Select(p => p.Cyclic = plain.primitive[_primitive_i_FE8484DAB3++]).ToArray();
var _complex_i_FE8484DAB3 = 0;
complex.Select(p => p.PlainToOnlineAsync(plain.complex[_complex_i_FE8484DAB3++])).ToArray();
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async virtual Task<T> ShadowToPlain<T>()
Expand Down Expand Up @@ -199,7 +199,7 @@ public async virtual Task<T> OnlineToPlain<T>()
public async Task<Pocos.ArrayDeclarationSimpleNamespace.some_complex_type> OnlineToPlainAsync()
{
Pocos.ArrayDeclarationSimpleNamespace.some_complex_type plain = new Pocos.ArrayDeclarationSimpleNamespace.some_complex_type();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
return plain;
}

Expand All @@ -215,7 +215,7 @@ public async virtual Task PlainToOnline<T>(T plain)

public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.ArrayDeclarationSimpleNamespace.some_complex_type plain)
{
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async virtual Task<T> ShadowToPlain<T>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public async virtual Task<T> OnlineToPlain<T>()
public async Task<Pocos.class_all_primitives> OnlineToPlainAsync()
{
Pocos.class_all_primitives plain = new Pocos.class_all_primitives();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
plain.myBOOL = myBOOL.LastValue;
plain.myBYTE = myBYTE.LastValue;
plain.myWORD = myWORD.LastValue;
Expand Down Expand Up @@ -177,7 +177,7 @@ public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.class_al
myDATE_AND_TIME.Cyclic = plain.myDATE_AND_TIME;
mySTRING.Cyclic = plain.mySTRING;
myWSTRING.Cyclic = plain.myWSTRING;
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async virtual Task<T> ShadowToPlain<T>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async override Task<T> OnlineToPlain<T>()
public new async Task<Pocos.Simatic.Ax.StateFramework.State1Transition> OnlineToPlainAsync()
{
Pocos.Simatic.Ax.StateFramework.State1Transition plain = new Pocos.Simatic.Ax.StateFramework.State1Transition();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
await base.OnlineToPlainAsync(plain);
return plain;
}
Expand All @@ -44,7 +44,7 @@ public async override Task PlainToOnline<T>(T plain)
public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.Simatic.Ax.StateFramework.State1Transition plain)
{
await base.PlainToOnlineAsync(plain);
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async override Task<T> ShadowToPlain<T>()
Expand Down Expand Up @@ -121,7 +121,7 @@ public async virtual Task<T> OnlineToPlain<T>()
public async Task<Pocos.Simatic.Ax.StateFramework.AbstractState> OnlineToPlainAsync()
{
Pocos.Simatic.Ax.StateFramework.AbstractState plain = new Pocos.Simatic.Ax.StateFramework.AbstractState();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
plain.StateID = StateID.LastValue;
plain.StateName = StateName.LastValue;
return plain;
Expand All @@ -143,7 +143,7 @@ public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.Simatic.
{
StateID.Cyclic = plain.StateID;
StateName.Cyclic = plain.StateName;
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async virtual Task<T> ShadowToPlain<T>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async override Task<T> OnlineToPlain<T>()
public new async Task<Pocos.Extended> OnlineToPlainAsync()
{
Pocos.Extended plain = new Pocos.Extended();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
await base.OnlineToPlainAsync(plain);
return plain;
}
Expand All @@ -42,7 +42,7 @@ public async override Task PlainToOnline<T>(T plain)
public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.Extended plain)
{
await base.PlainToOnlineAsync(plain);
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async override Task<T> ShadowToPlain<T>()
Expand Down Expand Up @@ -110,7 +110,7 @@ public async virtual Task<T> OnlineToPlain<T>()
public async Task<Pocos.Extendee> OnlineToPlainAsync()
{
Pocos.Extendee plain = new Pocos.Extendee();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
return plain;
}

Expand All @@ -126,7 +126,7 @@ public async virtual Task PlainToOnline<T>(T plain)

public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.Extendee plain)
{
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async virtual Task<T> ShadowToPlain<T>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async override Task<T> OnlineToPlain<T>()
public new async Task<Pocos.ExtendsAndImplements> OnlineToPlainAsync()
{
Pocos.ExtendsAndImplements plain = new Pocos.ExtendsAndImplements();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
await base.OnlineToPlainAsync(plain);
return plain;
}
Expand All @@ -42,7 +42,7 @@ public async override Task PlainToOnline<T>(T plain)
public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.ExtendsAndImplements plain)
{
await base.PlainToOnlineAsync(plain);
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async override Task<T> ShadowToPlain<T>()
Expand Down Expand Up @@ -110,7 +110,7 @@ public async virtual Task<T> OnlineToPlain<T>()
public async Task<Pocos.ExtendeeExtendsAndImplements> OnlineToPlainAsync()
{
Pocos.ExtendeeExtendsAndImplements plain = new Pocos.ExtendeeExtendsAndImplements();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
return plain;
}

Expand All @@ -126,7 +126,7 @@ public async virtual Task PlainToOnline<T>(T plain)

public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.ExtendeeExtendsAndImplements plain)
{
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async virtual Task<T> ShadowToPlain<T>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async virtual Task<T> OnlineToPlain<T>()
public async Task<Pocos.Generics.Extender> OnlineToPlainAsync()
{
Pocos.Generics.Extender plain = new Pocos.Generics.Extender();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
return plain;
}

Expand All @@ -47,7 +47,7 @@ public async virtual Task PlainToOnline<T>(T plain)

public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.Generics.Extender plain)
{
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async virtual Task<T> ShadowToPlain<T>()
Expand Down Expand Up @@ -175,7 +175,7 @@ public async override Task<T> OnlineToPlain<T>()
public new async Task<Pocos.Generics.Extendee> OnlineToPlainAsync()
{
Pocos.Generics.Extendee plain = new Pocos.Generics.Extendee();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
await base.OnlineToPlainAsync(plain);
plain.SomeType = await SomeType.OnlineToPlainAsync();
plain.SomeTypeAsPoco = await SomeTypeAsPoco.OnlineToPlainAsync();
Expand All @@ -200,7 +200,7 @@ public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.Generics
await base.PlainToOnlineAsync(plain);
await this.SomeType.PlainToOnlineAsync(plain.SomeType);
await this.SomeTypeAsPoco.PlainToOnlineAsync(plain.SomeTypeAsPoco);
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async override Task<T> ShadowToPlain<T>()
Expand Down Expand Up @@ -271,7 +271,7 @@ public async override Task<T> OnlineToPlain<T>()
public new async Task<Pocos.Generics.Extendee2> OnlineToPlainAsync()
{
Pocos.Generics.Extendee2 plain = new Pocos.Generics.Extendee2();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
await base.OnlineToPlainAsync(plain);
plain.SomeType = await SomeType.OnlineToPlainAsync();
return plain;
Expand All @@ -293,7 +293,7 @@ public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.Generics
{
await base.PlainToOnlineAsync(plain);
await this.SomeType.PlainToOnlineAsync(plain.SomeType);
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async override Task<T> ShadowToPlain<T>()
Expand Down Expand Up @@ -364,7 +364,7 @@ public async virtual Task<T> OnlineToPlain<T>()
public async Task<Pocos.Generics.SomeType> OnlineToPlainAsync()
{
Pocos.Generics.SomeType plain = new Pocos.Generics.SomeType();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
return plain;
}

Expand All @@ -380,7 +380,7 @@ public async virtual Task PlainToOnline<T>(T plain)

public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos.Generics.SomeType plain)
{
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async virtual Task<T> ShadowToPlain<T>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async virtual Task<T> OnlineToPlain<T>()
public async Task<Pocos._NULL_CONTEXT> OnlineToPlainAsync()
{
Pocos._NULL_CONTEXT plain = new Pocos._NULL_CONTEXT();
await this.ReadAsync();
await this.ReadAsync<IgnoreOnPocoOperation>();
return plain;
}

Expand All @@ -45,7 +45,7 @@ public async virtual Task PlainToOnline<T>(T plain)

public async Task<IEnumerable<ITwinPrimitive>> PlainToOnlineAsync(Pocos._NULL_CONTEXT plain)
{
return await this.WriteAsync();
return await this.WriteAsync<IgnoreOnPocoOperation>();
}

public async virtual Task<T> ShadowToPlain<T>()
Expand Down
Loading

0 comments on commit ad7e5fe

Please sign in to comment.