Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public override void CreateVariableDeclaration(IVariableDeclaration semantics, I
case IClassDeclaration @class:
AddMemberInitialization(@class, semantics, visitor);
break;
case IStructuredTypeDeclaration @struct:
AddMemberInitialization(@struct, semantics, visitor);
break;
}

AddToSource(semantics.SetProperties());
Expand Down Expand Up @@ -101,6 +104,14 @@ private void AddMemberInitialization(IClassDeclaration type, IVariableDeclaratio
AddToSource($"(this.Connector, \"\", \"{variable.Name}\");");
}

private void AddMemberInitialization(IStructuredTypeDeclaration type, IVariableDeclaration variable, IxNodeVisitor visitor)
{
AddToSource($"{variable.Name}");
AddToSource("= new");
type.Accept(visitor, this);
AddToSource($"(this.Connector, \"\", \"{variable.Name}\");");
}

private void AddMemberInitialization(IScalarTypeDeclaration type, IVariableDeclaration variable, IxNodeVisitor visitor)
{
AddToSource($"{variable.Name}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public void CreateFieldDeclaration(IFieldDeclaration fieldDeclaration, IxNodeVis
case IClassDeclaration @class:
AddMemberInitialization(@class, fieldDeclaration, visitor);
break;
case IStructuredTypeDeclaration @struct:
AddMemberInitialization(@struct, fieldDeclaration, visitor);
break;
}

AddToSource(fieldDeclaration.SetProperties());
Expand Down Expand Up @@ -258,6 +261,14 @@ private void AddMemberInitialization(IClassDeclaration type, IFieldDeclaration f
AddToSource($"(this, \"{field.GetAttributeNameValue(field.Name)}\", \"{field.Name}\");");
}

private void AddMemberInitialization(IStructuredTypeDeclaration type, IFieldDeclaration field, IxNodeVisitor visitor)
{
AddToSource($"{field.Name}");
AddToSource("= new");
type.Accept(visitor, this);
AddToSource($"(this, \"{field.GetAttributeNameValue(field.Name)}\", \"{field.Name}\");");
}

private void AddMemberInitialization(IScalarTypeDeclaration type, IFieldDeclaration field)
{
AddToSource($"{field.Name}");
Expand Down
4 changes: 4 additions & 0 deletions src/AXSharp.compiler/src/ixc/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"integration_plc": {
"commandName": "Project",
"workingDirectory": "c:\\W\\Develop\\gh\\ix-ax\\axsharp\\src\\sanbox\\integration\\ix-integration-plc\\"
},
"ixc-simple-template": {
"commandName": "Project",
"workingDirectory": "C:\\W\\Develop\\gh\\ix-ax\\ix.framework\\src\\templates.simple\\ctrl"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ public VariousMembers(AXSharp.Connector.ITwinObject parent, string readableTail,
HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail);
PreConstruct(parent, readableTail, symbolTail);
_SomeClass = new misc.SomeClass(this, "_SomeClass", "_SomeClass");
_Motor = new misc.Motor(this, "_Motor", "_Motor");
parent.AddChild(this);
parent.AddKid(this);
PostConstruct(parent, readableTail, symbolTail);
Expand Down Expand Up @@ -988,6 +989,7 @@ public Vehicle(AXSharp.Connector.ITwinObject parent, string readableTail, string
this.@Parent = parent;
HumanReadable = AXSharp.Connector.Connector.CreateHumanReadable(parent.HumanReadable, readableTail);
Symbol = AXSharp.Connector.Connector.CreateSymbol(parent.Symbol, symbolTail);
m = new misc.Motor(this, "m", "m");
displacement = @Connector.ConnectorAdapter.AdapterFactory.CreateINT(this, "displacement", "displacement");
parent.AddChild(this);
parent.AddKid(this);
Expand Down
Loading