Modular Application Creator Use Case Based Documentation
Loading...
Searching...
No Matches
TechnologyObjectDataModel.cs
1using System.Linq;
5using Newtonsoft.Json;
6using Siemens.Automation.ModularApplicationCreator.ControlModules.ModuleEssentials.Objects.EssentialParameter;
7using Siemens.Automation.ModularApplicationCreator.ControlModules.ModuleEssentials.Objects.EssentialParameter.Generation;
8using Siemens.Automation.ModularApplicationCreator.Tia.Openness;
9using Siemens.Automation.ModularApplicationCreator.Tia.Openness.TO;
10
12
13public class TechnologyObjectDataModel : BaseModelParameterOwner
14{
15 [JsonConstructor]
16 public TechnologyObjectDataModel()
17 {
18
19 }
20
21 public string MotionControlVersion => "8.0"; // Example version for TIA V19
22 public TechnologicalObjectInfo TechObjectInfo { get; set; }
23
24 public TechnologyObjectDataModel(MAC_use_casesEM parentModel) : base(parentModel)
25 {
26 TechObjectInfo = new TechnologicalObjectInfo("MyEssentialTechnologyObject", OpennessConstants.TO_POSITIONING_AXIS, MotionControlVersion, null);
27 parentModel.ProvidedTechnologicalObjects.Add(TechObjectInfo); // Register the technological object blueprint in the parent model.
28 // This step is necessary to ensure the object is recognized in other MAC structures like drive browser (UI Control).
29 }
30
31 protected override void setup()
32 {
33 base.setup();
34 //CreateParameters();
35 }
36
37 protected override void CreateParameters()
38 {
39 RegisterParameter(new Parameter_IsVirtualAxis()); // Example of registering a parameter
40 // Add other parameters as needed
41 }
42
43 public void AddTechnologicalObjectParams()
44 {
45 foreach (var parameter in this.Parameters.OfType<ITOParameter>())
46 {
47 this.TechObjectInfo.AdditionalParameter[parameter.ToPath] = parameter.GetValueForGeneration();
48 }
49 }
50}
This is the main class in which the workflow starts. Here are all sections for creating or generating...