Tekvel Magic
|
GOOSEPublisher class for simulating GOOSE message publishing. More...
Public Member Functions | |
def | __init__ (self, ServerSimulator ss=None, Subnetwork sn=None, goCbRef=None, sim=True, **kwargs) |
Initialize a GOOSEPublisher instance. More... | |
None | disable_all (cls) |
ServerSimulator | ss (self) |
Get the ServerSimulator instance associated with the GOOSEPublisher. More... | |
Subnetwork | sn (self) |
Get the Subnetwork instance associated with the GOOSEPublisher. More... | |
def | gocbref (self) |
Get the GOOSE control block reference. More... | |
None | enable (self) |
Enable the GOOSEPublisher. More... | |
None | disable (self) |
Disable the GOOSEPublisher. More... | |
def | get_fcda_ref_list (self, ref_type=ReferenceType.ObjectReference) |
Returns a list of data attribute references of dataset associated with GOOSE control block . More... | |
Static Public Attributes | |
list | instances = [] |
GOOSEPublisher class for simulating GOOSE message publishing.
The GOOSEPublisher class is used to simulate the publishing of GOOSE messages within a specified subnetwork. Each instance is associated with a ServerSimulator and a Subnetwork object. The class ensures that only one GOOSEPublisher instance is created for a specific GOOSE control block reference. If no Subnetwork or ServerSimulator is provided, new instances are created. This class is especially useful for testing GOOSE communication in a controlled environment.
stVal_ref
and q_ref
) are correctly defined as per the data model in use.Example usage of the GOOSEPublisher class:
def __init__ | ( | self, | |
ServerSimulator | ss = None , |
||
Subnetwork | sn = None , |
||
goCbRef = None , |
|||
sim = True , |
|||
** | kwargs | ||
) |
Initialize a GOOSEPublisher instance.
Initializes a GOOSEPublisher object, which simulates GOOSE message publishing. If no ServerSimulator or Subnetwork is provided, a new one is created. The method also validates the presence of control block references for the selected IED and AccessPoint.
ss | ServerSimulator object to be used for the GOOSEPublisher. |
sn | Subnetwork object that connects the GOOSEPublisher. |
goCbRef | The reference of the GOOSE control block to be used. |
sim | Boolean flag to indicate if the simulation flag is set in the GOOSE message (default is True). |
kwargs | Additional keyword arguments (such as scl, mms_port) used to customize the simulator. |
AttributeError | Raised when ServerSimulator is None and goCbRef is provided. |
Exception | Raised if no GOOSE control blocks are found for the specified IED and AccessPoint. |
Exception | Raised if the control block reference is not found in the IED's data model. |
None disable | ( | self | ) |
Disable the GOOSEPublisher.
This method is intended to disable the GOOSEPublisher, but it is not yet implemented. When implemented, it will deactivate the GOOSEPublisher and set the _enabled
flag to False.
None disable_all | ( | cls | ) |
None enable | ( | self | ) |
Enable the GOOSEPublisher.
This method enables the GOOSEPublisher by starting the associated ServerSimulator and setting the GOOSE control block to be enabled. If the ServerSimulator is not yet created or running, it is created and started before enabling the GOOSEPublisher.
def get_fcda_ref_list | ( | self, | |
ref_type = ReferenceType.ObjectReference |
|||
) |
Returns a list of data attribute references of dataset associated with GOOSE control block .
If no svcb_ref specified the function returns references to all control blocks associated with this SVSimulator instance.
ref_type | Type of reference for returned data. See ReferenceType for available types. |
def gocbref | ( | self | ) |
Get the GOOSE control block reference.
This property retrieves the GOOSE control block reference (GoCBRef) associated with the GOOSEPublisher.
Subnetwork sn | ( | self | ) |
Get the Subnetwork instance associated with the GOOSEPublisher.
This property retrieves the Subnetwork instance associated with the GOOSEPublisher.
ServerSimulator ss | ( | self | ) |
Get the ServerSimulator instance associated with the GOOSEPublisher.
This property retrieves the ServerSimulator instance associated with the GOOSEPublisher. If the ServerSimulator has not been assigned, an AttributeError is raised.
AttributeError | Raised if the ServerSimulator has not been assigned to the GOOSEPublisher instance. |
|
static |