Skip to content

Commit 55b383e

Browse files
67 guidance needed using module essentials on mac (#71)
* feat: add module essentials page * docs: add getting started * docs: add some pics for module essentials * docs: fix versioning terminology and improve architecture section * docs: fix typo in module architecture description * fix: solve conflicts --------- Co-authored-by: Daniel Schmitt <dsschmitt@siemens.com> Co-authored-by: dssAutomation <148949458+dssAutomation@users.noreply.github.com>
1 parent 209ca2f commit 55b383e

149 files changed

Lines changed: 6910 additions & 1726 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ WARN_LOGFILE =
949949
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
950950
# Note: If this tag is empty the current directory is searched.
951951

952-
INPUT = MAC_use_cases/Model ./docs/mainpage.md
952+
INPUT = MAC_use_cases/Model ./docs/mainpage.md ./docs/moduleEssentialsPage.md
953953

954954
# This tag can be used to specify the character encoding of the source files
955955
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
13.7 KB
Loading
19.2 KB
Loading
150 KB
Loading

MAC_use_cases/MAC_use_cases.csproj

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<AssemblyName>MAC_use_cases</AssemblyName>
1414
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1515
<FileAlignment>512</FileAlignment>
16-
<langVersion>8.0</langVersion>
16+
<langVersion>latest</langVersion>
1717
</PropertyGroup>
1818
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
1919
<DebugSymbols>true</DebugSymbols>
@@ -89,6 +89,12 @@ where to where -->
8989
in MPFProj12\ProjectNode.cs, ProcessFiles.
9090
-->
9191
<ItemGroup>
92+
<Compile Include="Model\ModuleEssentials\Base\BaseModelParameterOwner.cs" />
93+
<Compile Include="Model\ModuleEssentials\Base\BaseParameter.cs" />
94+
<Compile Include="Model\ModuleEssentials\Base\BaseParameterWithPredefinedTags.cs" />
95+
<Compile Include="Model\ModuleEssentials\Example\Parameter\Parameter_IsVirtualAxis.cs" />
96+
<Compile Include="Model\ModuleEssentials\Example\TechnologyObjectDataModel.cs" />
97+
<Compile Include="Model\ModuleEssentials\Example\TechnologyObjectViewModel.cs" />
9298
<Compile Include="Model\UseCases\HardwareGenerationExcelBased.cs" />
9399
<Compile Include="TiaImports\CustomLibraryClasses\Lib_Screen_1.cs" />
94100
<Compile Include="TiaImports\CustomLibraryClasses\Lib_MAC_use_cases_custom.cs" />
@@ -188,6 +194,9 @@ where to where -->
188194
<Version>20.1.6</Version>
189195
<PrivateAssets>all</PrivateAssets>
190196
</PackageReference>
197+
<PackageReference Include="Siemens.ModularApplicationCreator.ControlModules.ModuleEssentials">
198+
<Version>19.0.3</Version>
199+
</PackageReference>
191200
<PackageReference Include="Siemens.ModularApplicationCreator.Core">
192201
<Version>20.1.6</Version>
193202
<PrivateAssets>all</PrivateAssets>

MAC_use_cases/MAC_use_cases.nuspec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<dependencies>
1313
<group targetFramework=".NETFramework4.8">
1414
<dependency id="Newtonsoft.Json" version="13.0.3" />
15+
<dependency id="Siemens.ModularApplicationCreator.ControlModules.ModuleEssentials" version="19.0.3" />
1516
</group>
1617
</dependencies>
1718
<tags>MODULARAPPLICATIONCREATOR EQUIPMENTMODULE TIA-V19.0 FAILSAFE_CPU_REQUIRED</tags>
@@ -42,6 +43,7 @@
4243
<contentFiles>
4344
<files include="any/net48/AdditionalContent/HardwareGenerationExcelBased.xlsx" buildAction="Content" copyToOutput="false" />
4445
<files include="any/net48/Images/AddLibrary.png" buildAction="Content" copyToOutput="false" />
46+
<files include="any/net48/Images/Architecture.png" buildAction="Content" copyToOutput="false" />
4547
<files include="any/net48/Images/ClassExplanation.PNG" buildAction="Content" copyToOutput="false" />
4648
<files include="any/net48/Images/CodeExplanation.PNG" buildAction="Content" copyToOutput="false" />
4749
<files include="any/net48/Images/ConfigureTO.png" buildAction="Content" copyToOutput="false" />
@@ -68,6 +70,8 @@
6870
<files include="any/net48/Images/GetSafetySoftwareUnit.png" buildAction="Content" copyToOutput="false" />
6971
<files include="any/net48/Images/LocalizationXamlResourceDictionary.png" buildAction="Content" copyToOutput="false" />
7072
<files include="any/net48/Images/LogMessage.png" buildAction="Content" copyToOutput="false" />
73+
<files include="any/net48/Images/ModuleEssentials.png" buildAction="Content" copyToOutput="false" />
74+
<files include="any/net48/Images/ModuleEssentialsControlBinding.png" buildAction="Content" copyToOutput="false" />
7175
<files include="any/net48/Images/MultiInstanceFB.png" buildAction="Content" copyToOutput="false" />
7276
<files include="any/net48/Images/OpenLibrary.png" buildAction="Content" copyToOutput="false" />
7377
<files include="any/net48/Images/OpenTiares.png" buildAction="Content" copyToOutput="false" />

MAC_use_cases/Model/MAC_use_casesEM.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using MAC_use_cases.Model.ModuleEssentials.Example;
12
using System.Collections.ObjectModel;
23
using MAC_use_cases.Model.UseCases;
34
using MAC_use_cases.ViewModel;
@@ -41,6 +42,7 @@ public MAC_use_casesEM()
4142
InitAfterFirstCreationOrDeserialization();
4243

4344
MyTo = new TechnologyObjectClass(this);
45+
MyEssentialTechnologyObjectViewModel = new TechnologyObjectViewModel(new TechnologyObjectDataModel(this));
4446
}
4547

4648
// <auto-generated>
@@ -55,6 +57,7 @@ public MAC_use_casesEM(JsonConstructorMarker nullObj)
5557
InitAfterFirstCreationOrDeserialization();
5658

5759
MyTo = new TechnologyObjectClass(this);
60+
MyEssentialTechnologyObjectViewModel = new TechnologyObjectViewModel(new TechnologyObjectDataModel(this));
5861
}
5962

6063
//-------------------------------------------
@@ -76,6 +79,12 @@ public ModuleEdge ModuleStart
7679
/// </summary>
7780
public TechnologyObjectClass MyTo { get; set; }
7881

82+
/// <summary>
83+
/// Gets or sets the essential data model for the technology object (Example of using Module Essentials).
84+
/// </summary>
85+
[JsonIgnore]
86+
public TechnologyObjectViewModel MyEssentialTechnologyObjectViewModel { get; set; }
87+
7988
public bool IsGenerateHardwareChecked { get; set; } = false;
8089

8190
public bool IsGenerateSafetyBlockChecked { get; set; } = false;
@@ -125,8 +134,8 @@ public override bool GenerateTiaPortal(TiaTemplateContext tiaTemplateContext, st
125134
_plcDevice = GetPlcDevice(tiaTemplateContext);
126135
break;
127136

128-
// Add equipment module specific code for each generation phase here, which is
129-
// necessary before the ResourceManagement is called.
137+
// Add equipment module specific code for each generation phase here, which is
138+
// necessary before the ResourceManagement is called.
130139
}
131140

132141
ResourceManagement.Generate(tiaTemplateContext, this, generationPhaseName);
@@ -246,6 +255,9 @@ public override bool GenerateTiaPortal(TiaTemplateContext tiaTemplateContext, st
246255
CreateVariables.CreateTagInTagTable(myTagTable, "%I", "187", "0", "myTag_0", "Bool", "myTagComment");
247256
CreateVariables.CreateTagInTagTable(mySoftwareUnitTagTable, "%I", "188", "0", "myTag_1", "Bool",
248257
"myTagComment");
258+
this.MyEssentialTechnologyObjectViewModel.Model.AddTechnologicalObjectParams();
259+
this._plcDevice.TechnologicalObjects.GetOrCreateRootTO(MyEssentialTechnologyObjectViewModel.Model
260+
.TechObjectInfo, this);
249261

250262
if (IsGenerateHardwareChecked)
251263
{
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using Newtonsoft.Json;
2+
using Siemens.Automation.ModularApplicationCreator.ControlModules.ModuleEssentials.Objects.EssentialParameterOwner;
3+
4+
namespace MAC_use_cases.Model.ModuleEssentials.Base;
5+
6+
public class BaseModelParameterOwner : EssentialParameterOwner
7+
{
8+
[JsonIgnore]
9+
protected MAC_use_casesEM _module;
10+
11+
[JsonConstructor]
12+
public BaseModelParameterOwner()
13+
{
14+
15+
}
16+
17+
public BaseModelParameterOwner(MAC_use_casesEM module) : base(string.Empty)
18+
{
19+
_module = module;
20+
}
21+
22+
protected override void setup()
23+
{
24+
base.setup();
25+
CreateParameters();
26+
}
27+
28+
protected virtual void CreateParameters()
29+
{
30+
31+
}
32+
// Add code here for validation, additional logic, or other functionality as needed.
33+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using Newtonsoft.Json;
2+
using Siemens.Automation.ModularApplicationCreator.ControlModules.ModuleEssentials.Enums;
3+
using Siemens.Automation.ModularApplicationCreator.ControlModules.ModuleEssentials.Objects.EssentialParameter;
4+
5+
namespace MAC_use_cases.Model.ModuleEssentials.Base;
6+
7+
public class BaseParameter : EssentialParameter
8+
{
9+
[JsonConstructor]
10+
public BaseParameter()
11+
{
12+
13+
}
14+
15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="BaseParameter"/> class with the specified type, default value, and
17+
/// position unit.
18+
/// </summary>
19+
/// <param name="type">The type of the parameter, which determines its essential characteristics.</param>
20+
/// <param name="defaultValue">The default value assigned to the parameter. This value is used if no other value is provided.</param>
21+
/// <param name="posUnit">The position unit for the parameter in the user interface. Defaults to <see cref="PositionunitForUI.None"/> if
22+
/// not specified.</param>
23+
public BaseParameter(EssentialParameterType type, string defaultValue, PositionunitForUI posUnit = PositionunitForUI.None) : base(null!, type, defaultValue, posUnit)
24+
{
25+
26+
}
27+
28+
// Add code here for validation, additional logic, or other functionality as needed.
29+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using Newtonsoft.Json;
2+
using Siemens.Automation.ModularApplicationCreator.ControlModules.ModuleEssentials.Objects.EssentialParameter;
3+
4+
namespace MAC_use_cases.Model.ModuleEssentials.Base;
5+
6+
7+
public class BaseParameterWithPredefinedTags : EssentialParameterWithPredefinedTags, IEssentialParameterWithPredefinedTags
8+
{
9+
[JsonConstructor]
10+
public BaseParameterWithPredefinedTags()
11+
{
12+
13+
}
14+
15+
public BaseParameterWithPredefinedTags(string defaultValue) : base(defaultValue)
16+
{
17+
18+
}
19+
20+
// Add code here for validation, additional logic, or other functionality as needed.
21+
22+
}

0 commit comments

Comments
 (0)