Interface IGenerationPluginTemplate
public interface IGenerationPluginTemplate
This interface provides the common methods used in the Jython templates to interact with the generation plug-ins.
- Author:
- Ivan Prieto Barreiro
-
Method Summary
Modifier and TypeMethodDescriptionformatNumberPLC(String excelParameter) Method used to get the correct number format for the PLC.Get the application name from the UnicosApplication.getLinkedExpertName(String theName) Function.Get the PLC manufacturer from the PLC declarationsGet the PLC name as defined in the UnicosApplication.xmlProvide access to the root of the input XML data (specs file instance)booleanMethod used from the templates to know if the specified parameter is a String or a FloatvoidWrite a file in the plug-in output folder.voidwriteXmlFile(String fileName, String content) Write an XML file in the plug-in output folder.
-
Method Details
-
getApplicationName
String getApplicationName()Get the application name from the UnicosApplication.- Returns:
- The application name.
-
formatNumberPLC
Method used to get the correct number format for the PLC. If the parameter is a float number applies the float format, otherwise returns the same value provided.- Parameters:
excelParameter- Value coming from the specs
-
isString
Method used from the templates to know if the specified parameter is a String or a Float- Parameters:
parameter- The parameter to be checked- Returns:
- False if the parameter is a float value, otherwise True.
-
getUnicosProject
ISpecFileTemplate getUnicosProject() throws research.ch.cern.unicos.plugins.interfaces.GenerationExceptionProvide access to the root of the input XML data (specs file instance)- Returns:
- The instance of the specifications file.
- Throws:
research.ch.cern.unicos.plugins.interfaces.GenerationException- if the specs file instance is null.
-
getLinkedExpertName
String getLinkedExpertName(String theName) throws research.ch.cern.unicos.plugins.interfaces.GenerationException Function. it's used to get the Expert Name (if it exists).- Parameters:
theName- Name of the device instance to look for.- Returns:
- If the instance doesn't exist returns 'theName' given as first argument. If the instance has an expert name, the expert name is returned, otherwise returns the instance name.
- Throws:
research.ch.cern.unicos.plugins.interfaces.GenerationException- If the specs file is not defined.
-
getPlcManufacturer
String getPlcManufacturer()Get the PLC manufacturer from the PLC declarations- Returns:
- a String containing the name of the PLC manufacturer of the application or null if the PLCManufacturer is not defined.
-
getPlcName
Get the PLC name as defined in the UnicosApplication.xml- Returns:
- The PLC name if it's defined, otherwise null.
- Throws:
research.ch.cern.unicos.plugins.interfaces.GenerationException
-
writeFile
Write a file in the plug-in output folder.- Parameters:
fileName- The output file name.content- The output file content.
-
writeXmlFile
Write an XML file in the plug-in output folder. The content of the XML file will be validated to verify the well-formedness.- Parameters:
fileName- The output file name.content- The output file content.
-