1using System.Collections.Generic;
4using Siemens.Automation.ModularApplicationCreator.Core;
5using Siemens.Automation.ModularApplicationCreator.Tia;
6using Siemens.Automation.ModularApplicationCreatorBasics.Logging;
7using Siemens.Engineering.HW;
8using Siemens.Engineering.HW.Features;
9using Siemens.Engineering.SW;
10using Siemens.Engineering.SW.Blocks;
11using Device = Siemens.Automation.ModularApplicationCreator.Tia.Openness.Device;
12using Project = Siemens.Engineering.Project;
30 MacManagement.LoggingService.LogMessage(logType, logMessage, equipmentModule.Name);
44 return MacManagement.LanguageService.GetString(key);
58 var opennessDevice = (Siemens.Engineering.HW.Device)device;
59 return opennessDevice.DeviceItems.FirstOrDefault(x => x.Classification == DeviceItemClassifications.CPU);
67 Siemens.Automation.ModularApplicationCreator.Tia.Openness.Project tiaProject)
69 return (Project)tiaProject;
90 DeviceItem plc =
null;
91 foreach (var device
in ((Siemens.Engineering.Project)tiaTemplateContext.TiaProject).Devices)
93 foreach (var deviceItem
in device.DeviceItems)
95 if (deviceItem.Classification == DeviceItemClassifications.CPU)
102 var softwareContainer = plc.GetService<SoftwareContainer>().Software as PlcSoftware;
105 Application.Current.Dispatcher.Invoke(() =>
107 module.PlcBlockNames.Clear();
108 foreach (var block
in allBlocks)
110 module.PlcBlockNames.Add(block.Name);
123 var result =
new List<PlcBlock>();
125 foreach (var block
in group.Blocks)
130 foreach (var subGroup
in group.Groups)
This is the main class in which the workflow starts. Here are all sections for creating or generating...
This are functions that support you in different ways while using Modular Application Creator.
static DeviceItem GetOpennessDeviceItem(Device device)
Retrieves the CPU DeviceItem from a TIA Portal device using the Openness API.
static Project GetOpennessProject(Siemens.Automation.ModularApplicationCreator.Tia.Openness.Project tiaProject)
This call returns the openness object of the TIA Portal project.
static void LogMessage(LogTypes logType, string logMessage, MAC_use_casesEM equipmentModule)
This call generates a log message while generating a project.
static void ReadAdditionalInformationsFromTIAPortalProject(MAC_use_casesEM module, TiaTemplateContext tiaTemplateContext)
Reads additional information from the TIA Portal project and populates MAC_use_casesEM....
static List< PlcBlock > GetAllBlocksRecursive(PlcBlockGroup group)
Recursively collects all PlcBlock objects from the given PlcBlockGroup and all its nested subgroups.
static string GetLocalizedString(string key)
Retrieves a localized string value from the language resource dictionary using the specified key....