blark.solution.TwincatTsProject
- class blark.solution.TwincatTsProject(guid: str, netid: str, path: Path | None, plcs: list[TwincatPlcProject])[source]
Bases:
object
Container for a loaded TwinCAT tsproj project.
This is typically instantiated after the
Solution
parser generates aProject
instance. This contains information about the target PLC and all loaded PLC projects.Methods
__init__
(guid, netid, path, plcs)from_filename
(filename)Load a tsproj project from its filename.
from_xml
(tsproj, root[, filename])Load a tsproj project from its XML source.
Attributes
A dictionary of PLCs by name.
The globally unique identifier for the tsproj.
The AMS Net ID of the target PLC.
The path to this project on disk.
PLC projects (.plcproj) part of this tsproj.
- plcs: list[TwincatPlcProject]
PLC projects (.plcproj) part of this tsproj.
- property plcs_by_name: dict[str, TwincatPlcProject]
A dictionary of PLCs by name.
- Returns:
- dict[str, TwincatPlcProject]
- classmethod from_xml(tsproj: Element, root: Path, filename: Path | None = None) Self [source]
Load a tsproj project from its XML source.
- Parameters:
- xmllxml.etree.Element
- filenamepathlib.Path
- Returns:
- TwincatTsProject