Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wizard/connectedap): create GSE and SMV elements #1019

Merged
merged 2 commits into from
Oct 15, 2022

Conversation

JakobVogelsang
Copy link
Collaborator

Closes #1013

This PR shall add GSE and SMV elements on creating a new ConnectedAP. This is needed as a preparation for the subscribing plugins. The logic here is

  • for each GSEControl add GSE element with unique MAC-Address and APPID
  • for each SampledValueControl add SMV element with unique MAC-Address and APPID
  • do this for access points that has a Server element and ServerAt element
  • first come first serve ... when an IED has two access points fisrt has the server the second pointing to the server in the first and the second is added to subnetwork all GSE and SMV is added in this ConnectedAP. When after that the first is added to the same or another subnetwork no new GSE or SMV element is added

I did want to prevent UI components and with that have added two new generator functions to the foundation:

  • MAC-Address
  • APPID

they can be re-used to generate unique MAC-Addresses and APPIDs within the valid ranges of both.

Copy link
Collaborator

@danyill danyill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few little comments, generally very nice and a learning experience for me, gracias 👍

src/wizards/connectedap.ts Show resolved Hide resolved
src/foundation/generators.ts Show resolved Hide resolved
test/unit/foundation/generators.test.ts Outdated Show resolved Hide resolved
@danyill
Copy link
Collaborator

danyill commented Sep 29, 2022

I had some fun testing this by completing removing all subnets in a large file, creating them and watching the SMV and GSE elements get created. LGTM.
Not all tools allow communication structures to be easily adapted so this is helpful to us.

first come first serve ... when an IED has two access points fisrt has the server the second pointing to the server in the first and the second is added to subnetwork all GSE and SMV is added in this ConnectedAP. When after that the first is added to the same or another subnetwork no new GSE or SMV element is added

I did not quite understand. What I do see is the same GSE is created with the same MAC-address in each different ConnectedAP that a device supports.

So for instance if a device has three ConnectedAPs (say M1, G1, S1) after using this I have three GSE elements each with the same MAC address.

Is that what was intended? I might have guessed only creating in one subnetwork is what was required.

@JakobVogelsang
Copy link
Collaborator Author

I had some fun testing this by completing removing all subnets in a large file, creating them and watching the SMV and GSE elements get created. LGTM. Not all tools allow communication structures to be easily adapted so this is helpful to us.

first come first serve ... when an IED has two access points fisrt has the server the second pointing to the server in the first and the second is added to subnetwork all GSE and SMV is added in this ConnectedAP. When after that the first is added to the same or another subnetwork no new GSE or SMV element is added

I did not quite understand. What I do see is the same GSE is created with the same MAC-address in each different ConnectedAP that a device supports.

So for instance if a device has three ConnectedAPs (say M1, G1, S1) after using this I have three GSE elements each with the same MAC address.

Is that what was intended? I might have guessed only creating in one subnetwork is what was required.

Not at all. This is the behaviour I am after: Say you have 3 accP M1, M2 and M3. The first carrying the Server and the second pointing to the server ServerAt apName="M1" the third does not have a server or server at. Let's further assume the Server has 3 GSEControl elements:

  1. case: no connections yet and you connect M1. outcome: three GSE in new connected ap with each unique MAC and APPID
  2. case: no connections yet and you connect M2. outcome: three GSE in new connected ap with each unique MAC and APPID
    1. case: no connections yet and you connect M3. outcome: no new GSE as M1 does not have server nor use a server
  3. case: M1 connected already and has one of the three GSE and you want to connect M2: two new GSE are created. the MACs in the new GSE are unique as well as APPID

I this the behavior you can see with your files?

@danyill
Copy link
Collaborator

danyill commented Sep 29, 2022

Thanks for the explanation, I am somewhat convinced. We will need ways to quickly allow users to select and remove if we don't provide this option while adding the ConnectedAP elements to the Subnet.

In the attached, I have merged the two branches (read only and this GSE/SMV element creator), then removed all subnetworks. Then created one. Then I have added all ConnectedAP elements to this subnet. Quite a few of the IEDs have ServerAt directives and multiple AccessPoints.

XAT_Prot1 (2).scd.zip

After this I extract and take a look at the Communication Section.

  • I have 5 repeats of the MAC address: 01-0C-CD-01-00-01
  • I have 5 repeats of the APPID 0001
  • I have 24 repeats of the MAC address: 01-0C-CD-04-00-01
  • I have similar repeats of APPID 4000 and 4001.

I think you intended for the MAC address and APPIDs to be globally unique. But we iterate based on the AccessPoint and reinstantiate the lists at the start.

@JakobVogelsang
Copy link
Collaborator Author

I got the issue. It happens when you select to create multiple ConnectedAPs at once. I do initialize the generator too late and do not write the new access points yet to the file. And this is where the discrepancy is coming from. Thanks for your tests!!

@JakobVogelsang
Copy link
Collaborator Author

Should be fixed now. Thanks for testing :)

@JakobVogelsang
Copy link
Collaborator Author

@danyill would you be so kind and have another look at this one :)

Copy link
Collaborator

@danyill danyill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@JakobVogelsang JakobVogelsang merged commit 984652a into main Oct 15, 2022
@JakobVogelsang JakobVogelsang deleted the add-smv-gse-on-connectedap-creation branch October 15, 2022 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing SMV and GSE element in ConnectedAP creation
2 participants