blark.solution.TwincatPlcProject
- class blark.solution.TwincatPlcProject(guid: str, xti_path: Path | None, plcproj_path: Path | None, properties: dict[str, str], dependencies: dict[str, DependencyInformation], sources: list[TwincatSourceCodeItem])[source]
Bases:
object
A TwinCAT PLC project.
This typically corresponds to a single
.plcproj
file.Methods
__init__
(guid, xti_path, plcproj_path, ...)from_filename
(filename)Load a plcproj from its filename.
from_project_xml
(xml, root)Load a plcproj from the tsproj itself.
from_standalone_xml
(tsproj_or_xti_xml, ...)Load a PLC project from standalone XML code.
from_xti_filename
(xti_filename)Load a .plcproj from its XTI contents.
Attributes
The project name.
The globally unique identifier for the tsproj.
Path to an XTI file for the project.
The PLC Project - plcproj - path.
plcproj-defined properties (name, project build, etc.)
Dependencies for the PLC project.
Source code parts which blark can extract information from.
- dependencies: dict[str, DependencyInformation]
Dependencies for the PLC project.
- sources: list[TwincatSourceCodeItem]
Source code parts which blark can extract information from.
- classmethod from_standalone_xml(tsproj_or_xti_xml: Element | None, plcproj_xml: Element) Self [source]
Load a PLC project from standalone XML code.
- Parameters:
- tsproj_or_xti_xmlOptional[lxml.etree.Element]
lxml-loaded .tsproj or .xti contents.
- plcproj_xmllxml.etree.Element
lxml-loaded .plcproj contents.
- Returns:
- Self
[TODO:description]
- classmethod from_filename(filename: Path) Self [source]
Load a plcproj from its filename.
- Parameters:
- filenamepathlib.Path
- Returns:
- Self
- classmethod from_xti_filename(xti_filename: Path) Self [source]
Load a .plcproj from its XTI contents.
- Parameters:
- xti_filenamepathlib.Path
XTI filename.
- Returns:
- Self
- classmethod from_project_xml(xml: Element, root: Path) Self [source]
Load a plcproj from the tsproj itself.
The loading procedure typically happens in the following order:
Solution -> tsproj -> xti -> plcproj
- Parameters:
- xmllxml.etree.Element
- rootpathlib.Path
The root path to load files from the project.
- Returns:
- Self