blark.solution.TwincatSourceCodeItem
- class blark.solution.TwincatSourceCodeItem(saved_path: PurePath, local_path: Path | None, subtype: str | None, link_always: bool, raw_contents: bytes, contents: TcDUT | TcPOU | TcIO | TcGVL | TcTTO, guid: str | None = None, parent: TwincatPlcProject | None = None)[source]
Bases:
object
A wrapper for all TwinCAT project source code files.
Information from the project may be stored here alongside that of the source code file itself. The contents of the source code file are stored in
contents
, withraw_contents
holding raw bytes from the file.Methods
__init__
(saved_path, local_path, subtype, ...)from_compile_xml
(xml[, parent])save_to
(path[, delimiter])to_file_contents
([delimiter])Attributes
The globally unique identifier for the source code item.
The parent project, if applicable.
The path according to the solution:r likely a Windows-formatted path which is case-insensitive.
The corresponding local filename.
The subtype of the file.
Link always set?
Raw file contents.
Contents loaded into a type-specific class.
- saved_path: PurePath
The path according to the solution:r likely a Windows-formatted path which is case-insensitive.
- parent: TwincatPlcProject | None = None
The parent project, if applicable.
- classmethod from_compile_xml(xml: Element, parent: TwincatPlcProject | None = None) Self | None [source]