Modular Application Creator Use Case Based Documentation
Loading...
Searching...
No Matches
GeneralSupport.cs
1using System.Linq;
2using Siemens.Automation.ModularApplicationCreator.Core;
3using Siemens.Automation.ModularApplicationCreatorBasics.Logging;
4using Siemens.Engineering.HW;
5using Device = Siemens.Automation.ModularApplicationCreator.Tia.Openness.Device;
6using Project = Siemens.Engineering.Project;
7
9
13public class GeneralSupport
14{
22 public static void LogMessage(LogTypes logType, string logMessage, MAC_use_casesEM equipmentModule)
23 {
24 MacManagement.LoggingService.LogMessage(logType, logMessage, equipmentModule.Name);
25 }
26
36 public static string GetLocalizedString(string key)
37 {
38 return MacManagement.LanguageService.GetString(key);
39 }
40
50 public static DeviceItem GetOpennessDeviceItem(Device device)
51 {
52 var opennessDevice = (Siemens.Engineering.HW.Device)device;
53 return opennessDevice.DeviceItems.FirstOrDefault(x => x.Classification == DeviceItemClassifications.CPU);
54 }
55
60 public static Project GetOpennessProject(
61 Siemens.Automation.ModularApplicationCreator.Tia.Openness.Project tiaProject)
62 {
63 return (Project)tiaProject;
64 }
65}
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 string GetLocalizedString(string key)
Retrieves a localized string value from the language resource dictionary using the specified key....