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

Re-implement the event generator as a new-style plugin #4552

Closed
akhenry opened this issue Dec 8, 2021 · 8 comments · Fixed by #4620
Closed

Re-implement the event generator as a new-style plugin #4552

akhenry opened this issue Dec 8, 2021 · 8 comments · Fixed by #4620
Labels
type:maintenance tests, chores, or project maintenance
Milestone

Comments

@akhenry
Copy link
Contributor

akhenry commented Dec 8, 2021

Summary

The Event Generator plugin provides an example of a telemetry source that produces strings. It was implemented using the legacy API (including the old type API, telemetry API, etc.).

The legacy API has not been used for new development for years and support will soon be removed completely. We want to maintain this useful example code, so we should migrate it to a plugin that defines the event type using the modern type api, as well as using the modern telemetry API.

A note on migrating Types

Types registered using the legacy bundle registration like so:

"types": [
  {
      "key": "folder",
      "name": "Folder",
      "cssClass": "icon-folder",
      "features": "creation",
      "description": "Create folders to organize other objects or links to objects.",
      "priority": 1000,
      "model": {
          "composition": []
      }
  }
]

Should be migrated to the types API:

  openmct.types.addType('folder', {
      name: "Folder",
      key: "folder",
      description: "Create folders to organize other objects or links to objects without the ability to edit it's properties.",
      cssClass: "icon-folder",
      creatable: true,
      initialize: function (domainObject) {
          domainObject.composition = [];
      }
  });

Code that was retrieving type definitions using the legacy TypeService like so:

typeService.getType(domainObject.type)

Should now use the Open MCT type API:

this.openmct.type.get(domainObject.type)
@akhenry akhenry added the type:maintenance tests, chores, or project maintenance label Dec 8, 2021
@akhenry
Copy link
Contributor Author

akhenry commented Dec 8, 2021

@scottbell Would you mind taking a look at this?

@akhenry akhenry self-assigned this Dec 8, 2021
@scottbell
Copy link
Contributor

@scottbell Would you mind taking a look at this?

Wilco!

@scottbell
Copy link
Contributor

scottbell commented Dec 9, 2021

@akhenry this looks pretty straightforward. One question though: do you want me to integrate this in with the other generators, or keep it standalone?

@scottbell
Copy link
Contributor

Talked with @akhenry about above 👆, will keep it separate.

@scottbell
Copy link
Contributor

FYI, I've got a working branch here:
https://github.com/nasa/openmct/compare/master...scottbell:mct4552?expand=1

@scottbell
Copy link
Contributor

scottbell commented Dec 21, 2021

Testing Instructions

  • Ensure you can still create an Event Message Generator
  • Ensure you receive event data with Local Clock & Fixed time spans
  • Ensure you can drop the Event Message Generator onto a Telemetry Table

@scottbell
Copy link
Contributor

I've opened a PR for review here:
#4620

@akhenry
Copy link
Contributor Author

akhenry commented Feb 17, 2022

Verified that the implementation works as specced.

Have filed a followup issue to address a low priority bug - #4879

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants