Skip to content

Commit

Permalink
mend
Browse files Browse the repository at this point in the history
  • Loading branch information
PTKu committed Aug 2, 2023
1 parent 1ea720e commit f23d2e0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public array_declaration_class(AXSharp.Connector.ITwinObject parent, string read
HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail);
PreConstruct(parent, readableTail, symbolTail);
primitive = new OnlinerInt[100];
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(primitive, this, "primitive", "primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateINT(p, rt, st), new[]{(1, 100)});
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(primitive, this, "primitive", "primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateINT(p, rt, st), new[] { (1, 100) });
complex = new ArrayDeclarationSimpleNamespace.some_complex_type[100];
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(complex, this, "complex", "complex", (p, rt, st) => new ArrayDeclarationSimpleNamespace.some_complex_type(p, rt, st), new[]{(1, 100)});
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(complex, this, "complex", "complex", (p, rt, st) => new ArrayDeclarationSimpleNamespace.some_complex_type(p, rt, st), new[] { (1, 100) });
parent.AddChild(this);
parent.AddKid(this);
PostConstruct(parent, readableTail, symbolTail);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public ClassWithArrays(AXSharp.Connector.ITwinObject parent, string readableTail
PreConstruct(parent, readableTail, symbolTail);
_must_be_omitted_in_poco = new CompilerOmmits.Complex(this, "_must_be_omitted_in_poco", "_must_be_omitted_in_poco");
_primitive = new OnlinerByte[11];
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[]{(0, 10)});
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[] { (0, 10) });
parent.AddChild(this);
parent.AddKid(this);
PostConstruct(parent, readableTail, symbolTail);
Expand Down Expand Up @@ -1154,9 +1154,9 @@ public ClassWithArrays(AXSharp.Connector.ITwinObject parent, string readableTail
HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail);
PreConstruct(parent, readableTail, symbolTail);
_complexKnown = new UnknownArraysShouldNotBeTraspiled.Complex[11];
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_complexKnown, this, "_complexKnown", "_complexKnown", (p, rt, st) => new UnknownArraysShouldNotBeTraspiled.Complex(p, rt, st), new[]{(0, 10)});
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_complexKnown, this, "_complexKnown", "_complexKnown", (p, rt, st) => new UnknownArraysShouldNotBeTraspiled.Complex(p, rt, st), new[] { (0, 10) });
_primitive = new OnlinerByte[11];
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[]{(0, 10)});
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[] { (0, 10) });
parent.AddChild(this);
parent.AddKid(this);
PostConstruct(parent, readableTail, symbolTail);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,9 +829,9 @@ public ClassWithArrays(AXSharp.Connector.ITwinObject parent, string readableTail
HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail);
PreConstruct(parent, readableTail, symbolTail);
_complexKnown = new UnknownArraysShouldNotBeTraspiled.Complex[11];
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_complexKnown, this, "_complexKnown", "_complexKnown", (p, rt, st) => new UnknownArraysShouldNotBeTraspiled.Complex(p, rt, st), new[]{(0, 10)});
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_complexKnown, this, "_complexKnown", "_complexKnown", (p, rt, st) => new UnknownArraysShouldNotBeTraspiled.Complex(p, rt, st), new[] { (0, 10) });
_primitive = new OnlinerByte[11];
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[]{(0, 10)});
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(_primitive, this, "_primitive", "_primitive", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[] { (0, 10) });
parent.AddChild(this);
parent.AddKid(this);
PostConstruct(parent, readableTail, symbolTail);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public MonsterBase(AXSharp.Connector.ITwinObject parent, string readableTail, st
Description = @Connector.ConnectorAdapter.AdapterFactory.CreateSTRING(this, "Description", "Description");
Id = @Connector.ConnectorAdapter.AdapterFactory.CreateULINT(this, "Id", "Id");
ArrayOfBytes = new OnlinerByte[4];
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfBytes, this, "ArrayOfBytes", "ArrayOfBytes", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[]{(0, 3)});
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfBytes, this, "ArrayOfBytes", "ArrayOfBytes", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[] { (0, 3) });
ArrayOfDrives = new MonsterData.DriveBase[4];
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfDrives, this, "ArrayOfDrives", "ArrayOfDrives", (p, rt, st) => new MonsterData.DriveBase(p, rt, st), new[]{(0, 3)});
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfDrives, this, "ArrayOfDrives", "ArrayOfDrives", (p, rt, st) => new MonsterData.DriveBase(p, rt, st), new[] { (0, 3) });
parent.AddChild(this);
parent.AddKid(this);
PostConstruct(parent, readableTail, symbolTail);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public RealMonsterBase(AXSharp.Connector.ITwinObject parent, string readableTail
TestDateTime = @Connector.ConnectorAdapter.AdapterFactory.CreateDATE_AND_TIME(this, "TestDateTime", "TestDateTime");
TestTimeSpan = @Connector.ConnectorAdapter.AdapterFactory.CreateTIME_OF_DAY(this, "TestTimeSpan", "TestTimeSpan");
ArrayOfBytes = new OnlinerByte[4];
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfBytes, this, "ArrayOfBytes", "ArrayOfBytes", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[]{(0, 3)});
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfBytes, this, "ArrayOfBytes", "ArrayOfBytes", (p, rt, st) => @Connector.ConnectorAdapter.AdapterFactory.CreateBYTE(p, rt, st), new[] { (0, 3) });
ArrayOfDrives = new RealMonsterData.DriveBaseNested[4];
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfDrives, this, "ArrayOfDrives", "ArrayOfDrives", (p, rt, st) => new RealMonsterData.DriveBaseNested(p, rt, st), new[]{(0, 3)});
AXSharp.Connector.BuilderHelpers.Arrays.InstantiateArray(ArrayOfDrives, this, "ArrayOfDrives", "ArrayOfDrives", (p, rt, st) => new RealMonsterData.DriveBaseNested(p, rt, st), new[] { (0, 3) });
parent.AddChild(this);
parent.AddKid(this);
PostConstruct(parent, readableTail, symbolTail);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ public async Task StartPolling_should_update_cyclic_property()
public async Task StartPolling_polling_should_continue_until_last_subscriber()
{
var holderObject = new object();
var holderObject1 = new object();

//arrange
var polling = Entry.Plc.StartPolling_should_update_cyclic_property;
Expand All @@ -367,27 +368,27 @@ public async Task StartPolling_polling_should_continue_until_last_subscriber()
var pos = await polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.GetAsync();

polling.StartPolling(50, holderObject);
polling.StartPolling(150, holderObject);
polling.StartPolling(150, holderObject1);

Task.Delay(250).Wait();

Assert.True(polling.Id.Cyclic != id);
Assert.True(polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.Cyclic != pos);
Assert.NotEqual(id, polling.Id.Cyclic);
Assert.NotEqual(pos, polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.Cyclic);

polling.StopPolling(holderObject);

Task.Delay(250).Wait();

id = polling.Id.Cyclic;
pos = polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.Cyclic;

Task.Delay(250).Wait();

Assert.True(polling.Id.Cyclic != id);
Assert.True(polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.Cyclic != pos);
Assert.NotEqual(id, polling.Id.Cyclic);
Assert.NotEqual(pos, polling.DriveA.NestedLevelOne.NestedLevelTwo.NestedLevelThree.Position.Cyclic);


polling.StopPolling(holderObject);
polling.StopPolling(holderObject1);

Task.Delay(250).Wait();

Expand Down

0 comments on commit f23d2e0

Please sign in to comment.