Skip to content

Commit

Permalink
Fix: Added editCount to Sitipe
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Wilbrink <[email protected]>
  • Loading branch information
pascalwilbrink committed Aug 2, 2023
1 parent 449dd8f commit d216417
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion public/js/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export const officialPlugins = [
},
{
name: 'Sitipe',
src: '/src/editors/Sitipe.js',
src: '/src/compas-editors/Sitipe.js',
icon: 'precision_manufacturing',
default: true,
kind: 'editor',
Expand Down
6 changes: 6 additions & 0 deletions src/compas-editors/Sitipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ export default class SitipePlugin extends LitElement {
@property({ attribute: false })
doc!: XMLDocument;

@property({
type: Number,
})
editCount = -1;

header(): string {
return 'Sitipe';
}
Expand All @@ -23,6 +28,7 @@ export default class SitipePlugin extends LitElement {
html`<sitipe-substation
.doc=${this.doc}
.element=${substation}
.editCount=${this.editCount}
></sitipe-substation>`
)}
</section>`
Expand Down
15 changes: 5 additions & 10 deletions src/compas-editors/sitipe/sitipe-bay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ export class SitipeBay extends LitElement {
@property()
bayTypicals: BayTypical[] = [];

@property({
type: Number,
})
editCount = -1;

@property()
namingStrategy: NamingStrategy = defaultNamingStrategy;

Expand Down Expand Up @@ -567,21 +572,11 @@ export class SitipeBay extends LitElement {
this.importIED(ied);

if (iedName || oldIEDName) {
console.log('just before createelement');
console.log('doc element: ', this.doc.documentElement);

const privateIEDRef: Element = createElement(this.doc, 'Private', {
type: SIEMENS_SITIPE_IED_TEMPLATE_REF,
});
privateIEDRef.textContent = btComponent.name || oldIEDName;

console.log(
'Adding private iedRef element',
privateIEDRef,
'to ied: ',
ied
);

this.dispatchEvent(
newActionEvent({
title: get('editing.import', { name: ied.getAttribute('name')! }),
Expand Down
6 changes: 6 additions & 0 deletions src/compas-editors/sitipe/sitipe-substation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ export class SitipeSubstation extends LitElement {
@property({ attribute: false })
element!: Element;

@property({
type: Number,
})
editCount = -1;

@property()
namingStrategy: NamingStrategy = defaultNamingStrategy;

Expand Down Expand Up @@ -104,6 +109,7 @@ export class SitipeSubstation extends LitElement {
.bayTypicals=${this.bayTypicals}
.doc=${this.doc}
.namingStrategy=${this.namingStrategy}
.editCount=${this.editCount}
></sitipe-bay>`;
}

Expand Down

0 comments on commit d216417

Please sign in to comment.