Skip to content

jarradraumati/oscd-subscriber-lb-siemens

 
 

Repository files navigation

OpenSCD Plugin: Subscriber Later Binding - Siemens Editor

This plugin is intended to allow a user to achieve certain improvements with the later binding subscriber:

  • Simultaneous subscriptions of quality together with other items for GOOSE and SV

  • Simultaneous subscriptions of multiple phases for SV

  • This is a plugin for open-scd-core, the core editor engine for OpenSCD.

  • This plugin is a web component and follows the open-wc recommendations.

  • This plugin uses the Apache License and is intended for you to use, study, share and improve.

Feel free to log issues to request fixes, improvements or new features.

  1. This plugin does only two things:

    • If two adjacent ExtRef elements have the same intAddr except there is a q then if in the subscribing dataset the adjacent FCDA elements are the same except the second is a quality attribute, then the quality will be automatically subscribed/unsubscribed.

    • For Sampled Values, a set of up to 4 TCTR or TVTR data attributes will be subscribed to associated ExtRef elements. For example the following:

        <FCDA ldInst="PowS_PhaseCT" prefix="" lnClass="TCTR" lnInst="1" doName="AmpSv" daName="instMag.i" fc="MX" />
        <FCDA ldInst="PowS_PhaseCT" prefix="" lnClass="TCTR" lnInst="1" doName="AmpSv" daName="q" fc="MX" />
        <FCDA ldInst="PowS_PhaseCT" prefix="" lnClass="TCTR" lnInst="2" doName="AmpSv" daName="instMag.i" fc="MX" />
        <FCDA ldInst="PowS_PhaseCT" prefix="" lnClass="TCTR" lnInst="2" doName="AmpSv" daName="q" fc="MX" />
        <FCDA ldInst="PowS_PhaseCT" prefix="" lnClass="TCTR" lnInst="3" doName="AmpSv" daName="instMag.i" fc="MX" />
        <FCDA ldInst="PowS_PhaseCT" prefix="" lnClass="TCTR" lnInst="3" doName="AmpSv" daName="q" fc="MX" />
        <FCDA ldInst="PowS_PhaseCT" prefix="" lnClass="TCTR" lnInst="4" doName="AmpSv" daName="instMag.i" fc="MX" />
        <FCDA ldInst="PowS_PhaseCT" prefix="" lnClass="TCTR" lnInst="4" doName="AmpSv" daName="q" fc="MX" />
        <FCDA ldInst="PowS_PhaseCT" prefix="" lnClass="TCTR" lnInst="1" doName="AmpSv" daName="instMag.i" fc="MX" />
        <FCDA ldInst="PowS_PhaseCT" prefix="" lnClass="TCTR" lnInst="1" doName="AmpSv" daName="q" fc="MX" />

      Can be subscribed to a group of ExtRefs as shown:

      <LDevice desc="PowS_BAY240MUCT" inst="PowS_CT242">
      	<LN prefix="" lnClass="TCTR" inst="1" lnType="SIPROTEC5_LNType_TCTR" desc="CT 1">
      		<ExtRef desc="PowS_BAY240MUCT.CT 1" intAddr="AmpSv;TCTR/AmpSv/instMag.i" serviceType="SMV" pServT="SMV" pLN="TCTR" pDO="AmpSv" pDA="instMag.i"/>
      		<ExtRef desc="PowS_BAY240MUCT.CT 1" intAddr="AmpSv;TCTR/AmpSv/q" serviceType="SMV" pServT="SMV" pLN="TCTR" pDO="AmpSv" pDA="q" />
      	</Inputs>
      </LN>
      <LN prefix="" lnClass="TCTR" inst="2" lnType="SIPROTEC5_LNType_TCTR" desc="CT 2">
      	<Inputs>
      		<ExtRef desc="PowS_BAY240MUCT.CT 2" intAddr="AmpSv;TCTR/AmpSv/instMag.i" serviceType="SMV" pServT="SMV" pLN="TCTR" pDO="AmpSv" pDA="instMag.i" />
      		<ExtRef desc="PowS_BAY240MUCT.CT 2" intAddr="AmpSv;TCTR/AmpSv/q" serviceType="SMV" pServT="SMV" pLN="TCTR" pDO="AmpSv" pDA="q" />
      	</Inputs>
      </LN>
      <LN prefix="" lnClass="TCTR" inst="3" lnType="SIPROTEC5_LNType_TCTR" desc="CT 3">
      	<Inputs>
      		<ExtRef desc="PowS_BAY240MUCT.CT 3" intAddr="AmpSv;TCTR/AmpSv/instMag.i" serviceType="SMV" pServT="SMV" pLN="TCTR" pDO="AmpSv" pDA="instMag.i" />
      		<ExtRef desc="PowS_BAY240MUCT.CT 3" intAddr="AmpSv;TCTR/AmpSv/q" serviceType="SMV" pServT="SMV" pLN="TCTR" pDO="AmpSv" pDA="q" />
      	</Inputs>
      </LN>
      <LN prefix="" lnClass="TCTR" inst="4" lnType="SIPROTEC5_LNType_TCTR" desc="CT 4">
      	<Inputs>
      		<ExtRef desc="PowS_BAY240MUCT.CT 4" intAddr="AmpSv;TCTR/AmpSv/instMag.i" serviceType="SMV" pServT="SMV" pLN="TCTR" pDO="AmpSv" pDA="instMag.i" />
      		<ExtRef desc="PowS_BAY240MUCT.CT 4" intAddr="AmpSv;TCTR/AmpSv/q" serviceType="SMV" pServT="SMV" pLN="TCTR" pDO="AmpSv" pDA="q" />
      	</Inputs>
      </LN>
      </LDevice>

Follow the steps in Loading the Plugin. Once the plugin is loaded:

  1. The plugin provides a menu option. Go to the menu in the top left and click on the plugin name.

  2. Then click enabled and then "Close".

    configure the plugin is initially disabled Chromium
  3. In either the publisher or subscriber view, click on the settings icon (a cog) and check that "Allow External Plugins" is checked.

  4. The plugin will automatic add or remove subscriptions as required.

Open SCD core allows plugins to be loaded from a URL.

You can click on this link to trial this plugin.

In this view it is without theming and only presents this plugin along with the open and save plugins.

  1. The latest core is available at https://openscd.github.io/open-scd/.

  2. Go to Menu  Add plugins…​

  3. Select Cancel - this is an editor plugin.

  4. Select OK to required a loaded document.

  5. Choose a plugin name of 'Subscriber Later Binding - Siemens'.

  6. Choose a plugin icon of 'link'

  7. Provide a plugin source URI of: https://danyill.github.io/oscd-subscriber-lb-siemens/oscd-subscriber-lb-siemens.js

  8. Click OK on the summary, it should indicate the parameters previously entered.

  9. Open a file and enjoy!

  1. Clone this project:

    $ git clone https://github.com/danyill/oscd-subscriber-lb-siemens
  2. Install dependencies

    $ npm i
  3. Start up a demo server

    $ npm run start
  4. Open in your browser locally at http://localhost:8000/demo/

Tip
OpenSCD is transitioning to use of open-scd-core, these instructions will require updating at the end of this transition.
  1. Open your OpenSCD distribution or use https://openscd.github.io.

  2. Create a custom extension by going to menu  Extensions  Add Custom Extension.

  3. Enter the name 'Subscriber Later Binding - Siemens', select 'Menu entry' and enter https://danyill.github.io/oscd-subscriber-lb-siemens/oscd-subscriber-lb-siemens.js as the URL.

    This is the URL of the bundle built by CI and is always the latest pre-release version of this plugin.

    screenshot add extension
    Figure 1. OpenSCD Add Custom Extension Screen
  4. Click on Add.

  5. This plugin is now available in the menu entry.

  1. Within the current OpenSCD distribution, plugins are stored in the public/js/plugins.js folder. Each plugin appears in the following form:

    {
        name: 'Subscriber Later Binding - Siemens', // (1)
        src: 'https://danyill.github.io/oscd-subscriber-lb-siemens/oscd-subscriber-lb-siemens.js', //  (2)
        icon: 'sim_card_download', // (3)
        default: true, // (4)
        kind: 'menu', // (5)
        requireDoc: true, // (6)
        position: 'middle' // (7)
      }
    1. Name of the plugin which appears in the editor menu at top of screen

    2. URL which can be a local or remote resource. For a local resource, begins without a forward slash, e.g. plugins/oscd-subscriber-lb-siemens/dist/oscd-subscriber-lb-siemens.js. In this case what is shown is loading a plugin from the build process.

    3. A material icon, see others at Material Symbols and Icons

    4. Whether the plugin is enabled by default or has to be enabled in the plugins menu

    5. The type of plugin, either menu or editor. This is an editor plugin.

    6. Whether a document must be loaded for this plugin to be available

    7. A string, either top, middle or bottom to give a location in the menu. Otherwise inferred from the order in the file relative to other plugins.

  2. You need to copy an entry like the above, ensure the src URL resolves and the plugin should be loaded when the distribution is built.

  3. If you are building locally you likely need to run an npm run bundle command in each plugin to make the dist folder, containing a single JavaScript file with the plugin available to OpenSCD.

Within an OpenSCD core distribution, plugins are also loaded from a json file with a slightly different schema.

  1. Typically the distribution will be served from a static web page and within the web page there will be a plugins property declared on an open-scd object, for instance:

    link:demo/index.html[role=include]
  2. This plugin is an editor plugin, editor plugins are an array of JSON of the following form:

    {
      "name": "Subscriber Later Binding - Siemens", // (1)
      "translations": { // (2)
        "de": "Kommunikationsexport",
        "pt":"Exportação de Comunicações"
      },
      "icon": "sim_card_download", // (3)
      "active": true, // (4)
      "requireDoc": true, // (5)
      "src": "/dist/oscd-subscriber-lb-siemens.js" // (6)
    }
    1. Name of the plugin which appears in the editor menu at top of screen

    2. Translations of the plugin name as required using standard locale names.

    3. A material icon, see others at Material Symbols and Icons

    4. Whether the plugin is enabled by default or has to be enabled in the plugins menu

    5. Whether a document must be loaded for this plugin to be available

    6. URL which can be a local or remote resource. For a local resource, begins with a forward slash, e.g. plugins/oscd-subscriber-lb-siemens/dist/oscd-subscriber-lb-siemens.js. In this case what is shown is loading a plugin from the internet using the continuous integration build process.

  3. You need to copy an entry like the above, ensure the src URL resolves and the plugin should be loaded when the distribution is built.

  4. If you are building locally you likely need to run an npm run bundle command in each plugin to make the dist folder, containing a single JavaScript file with the plugin available to OpenSCD.

To scan the project for linting and formatting errors, run

npm run lint

To automatically fix linting and formatting errors, run

npm run format

To execute a single test run:

npm run test

To run the tests in interactive watch mode run:

npm run test:watch

For most of the tools, the configuration is in the package.json to reduce the number of files in your project.

If you customize the configuration a lot, you can consider moving them to individual files.

To run a local development server that serves the basic demo located in demo/index.html

npm start

© 2023 Daniel Mulholland

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 92.1%
  • JavaScript 7.9%