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

tLN: Instantiate supervision with valid control block reference but no related subscriptions #79

Open
danyill opened this issue Jan 20, 2024 · 4 comments
Labels
question Further information is requested
Milestone

Comments

@danyill
Copy link
Collaborator

danyill commented Jan 20, 2024

If a supervision exists but has no associated subscriptions on an IED I allow it to be overwritten. But our current scl-lib API does not allow this and so my test fails.

The cause is:

export function canInstantiateSubscriptionSupervision(
supervision: Supervision,
options: SupervisionOptions = {
newSupervisionLn: false,
fixedLnInst: -1,
checkEditableSrcRef: true,
checkDuplicateSupervisions: true,
checkMaxSupervisionLimits: true,
},
): boolean {
if (
options.checkDuplicateSupervisions &&
isControlBlockSupervised(supervision)
)
return false;
if (supervision.subscriberIedOrLn.tagName === "LN") {
const type =
supervision.sourceControlBlock.tagName === "GSEControl"
? "GoCBRef"
: "SvCBRef";
if (holdsValidObjRef(supervision.subscriberIedOrLn, type)) return false;
} else {

In the lower lines because there is a valid object reference I can't "remove" the supervision. I also don't have an option to force this.

Should we have:

  • a check on whether there are any ExtRefs subscribed (is it OK to supervise an unused control block?)
  • a "force" option here?
  • Or, once we fix up the remove subscription supervision (to only removal the Val text content, see (tLN) Remove subscription supervision #18) should I just remove the supervision first?
@danyill danyill added the question Further information is requested label Jan 20, 2024
@danyill
Copy link
Collaborator Author

danyill commented Jan 27, 2024

I think an option called replace would be sufficient.

@danyill danyill changed the title tLN: Remove supervision with valid control block reference but no related subscriptions tLN: Instantiate supervision with valid control block reference but no related subscriptions Jan 27, 2024
@JakobVogelsang
Copy link
Contributor

Dear @danyill. I took a deeper look into the issue and am afraid there is more work to be done. The function is now doing only insert, not remove. So replace is not possible out of the box. I feel the complexity in this function comes from the fact that we allow to have LN and IED as supervision sink. I would like to pull those apart and would suggest having an additional function like so

function editSubscriptionSupervision(ln: Element, options: ...)

It would be interesting to me what of the SupervisionOptions you would need for this function.

What do you think about this approach?

@danyill
Copy link
Collaborator Author

danyill commented Jan 30, 2024

I'm not sure how to answer this at the moment 🤷, we might need to discuss...

@danyill
Copy link
Collaborator Author

danyill commented Feb 18, 2024

I feel the complexity in this function comes from the fact that we allow to have LN and IED as supervision sink. I would like to pull those apart and would suggest having an additional function like so

function editSubscriptionSupervision(ln: Element, options: ...)

It would be interesting to me what of the SupervisionOptions you would need for this function.

I think pulling them apart is a good idea, the logic and different features required for the two cases was becoming excessively complex and difficult for end-users.

Regarding options, I think we should have:

  • checkDuplicateSupervisions - which would disallow supervising the same control block within the same IED
  • checkSubscriptionExists - which would disallow supervising a control block if the control block is not also subscripted onto an ExtRef

In my heart, I am unsure that checkEditableSrcRef is a required option - it seems to work around the intent of the standard and perhaps the best reason to retain is that the standard is not quite as clear as it could be. I'd most likely try to begin without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants