nasa / openmct

A web based mission control framework.
https://nasa.github.io/openmct/
Other
12.02k stars 1.24k forks source link

Add telemetry plugin for DSN station telemetry and status #1656

Open larkin opened 7 years ago

larkin commented 7 years ago

There's a website which shows you real time status for DSN called DSN now. It would be great to write a plugin that integrates this telemetry data into Open MCT.

https://eyes.nasa.gov/dsn/dsn.html

evenstensberg commented 7 years ago

Want me to work on this @larkin ?

tobiasbrown commented 7 years ago

@ev1stensberg , you beat me to this! I've made a very basic start following the Open MCT integration tutorial. I tried pushing my branch but realised I hadn't signed the ICLA. Once I have access, I'll push up what I have.

larkin commented 7 years ago

@tobiasbrown @ev1stensberg work on it as you like, let us know if you have questions.

evenstensberg commented 7 years ago

@tobiasbrown if you wanna work on this, I'll let you 👍 Available for back-up assistance if you need anything!

tobiasbrown commented 6 years ago

I've been trying to use the xml2js library but can't seem to get the right configuration. I end up with the following error in the Console:

Uncaught Error: Module name "defaults" has not been loaded yet for context: _. Use require([])

I've tried to work through some suggestions in the requirejs documentation but haven't had any success. Do I need to add a path in the requirejs.config for every dependency that xml2js references? You can see what I'm trying to do in this commit.

Where am I going wrong @larkin and @ev1stensberg ?

On a side note, is this plugin better off in a separate repo like the Kerbal and YAMCS plugins?

evenstensberg commented 6 years ago

@tobiasbrown Try looking at rollup.config.jsin the yamcs plugin. You'd need to add external dependencies in either require.js config or rollup

tobiasbrown commented 6 years ago

Thanks @ev1stensberg. I managed to use plain old JavaScript to achieve what I wanted to but I will have a look at the YAMCS config for future reference.

tobiasbrown commented 6 years ago

@larkin, what's the best approach to dynamically add and remove new domain objects like DSN signals and targets as new data comes in?

I've tried to update the object tree by calling: openmct.objects.mutate(parentDomainObject, 'composition', newComposition); This mutation results in a save error (possibly related to #1382?).

I've also tried: openmct.composition.get(parentDomainObject).add(newChildDomainObject, false); This calls add on my composition provider but I'm not sure what should happen next? A call to load?

akhenry commented 6 years ago

@tobiasbrown This seems to have slipped through the cracks and gone unanswered for a while, apologies for that.

The short answer right now is that there is not a great way to support this, so for first pass at this static composition will work.

The longer answer is that in future this will work via events emitted by composition providers. The composition provider interface will support registering listeners for added and removed events. This will allow composition providers to track listeners and to alert them when the composition changes. The wiring for this is in place in the API, but the object tree currently does not listen for changes emitted by composition providers, so it will not be updated.

akhenry commented 5 years ago

@tobiasbrown Hi! Just wanted to check in on this issue. Aside from the dynamic composition issue, is there any way we can help you out on this?

evenstensberg commented 5 years ago

I can pick up on this if wanted

tobiasbrown commented 5 years ago

Thanks for checking in @akhenry and your previous response in regards to the composition of dynamic objects. I was originally thinking of creating domain objects for each signal type but maybe the signal data can be easily expressed under each dish.

Apologies for the lack of action on this! I'll try and submit a PR soon.

tobiasbrown commented 5 years ago

Telemetry table for a dish's antenna image

  1. Will users benefit from spelling out MSPA and DDOR in the column headers?

Telemetry table for a dish's signals image

  1. Is it best to provide a default value when no telemetry is provided (eg. the empty data rate for the up signal)?
  2. Should the data rate, frequency and power values be formatted as they are on the DSN Now website? For example:
    • data rate = 2.00 kb/sec
    • frequency = 8.44 GHz
    • power = -150.01 dBM (9.61 x 10-22 kW)
  3. Is an additional column required to include a friendly version of the spacecraft's name? (eg. New Horizons). This could also be added to the table below.

Telemetry table for a dish's targets image

  1. Should the range and round-trip light time values be formatted as they are on the DSN Now website? For example:
    • range = 6.65 billion km (note this appears to be displayed as a single value)
    • rtlt = 12.31 hours
akhenry commented 5 years ago

@tobiasbrown

Thanks for all of your work with this, it's looking really awesome.

  1. I would stick with MSPA and DDOR for right now. It's fairly esoteric information, and I'm not sure the expanded names are any more enlightening 😄
  2. No default value necessary
  3. For now, you could put the units in the telemetry names so that they appear in the column headers. (eg. rename "Frequency" to "Frequency (GHz)"). You can round the values to 2 decimal places using printf formatting. This is a currently undocumented feature of the Telemetry API, but the Sinewave Generator has an example
  4. User-friendly naming would be great, but is not essential.
  5. Again, I would put the units in the header and specify the precision using printf formatting.
naknode commented 5 years ago

Hi @tobiasbrown 👋. Good to see dev work is going strong. Let me know if you need a helping hand.

tobiasbrown commented 5 years ago

Hi @tobiasbrown 👋. Good to see dev work is going strong. Let me know if you need a helping hand.

Thanks @naknode , I think I'm almost ready to open a PR for this. Will ask for a review when I do.

tobiasbrown commented 5 years ago

@akhenry

I discovered the telemetry formats in the API documentation and have experimented with them to display units. I thought this might be better than adding units to the column headers as some of these units can change (eg. data rate, power).

The tables are displaying data but the individual telemetry items are not displaying any values. Do you think this might be related to #2258 ?

naknode commented 5 years ago

@tobiasbrown Any update on this? What is left to wrap this PR up?

tobiasbrown commented 5 years ago

Thanks for the prompt @naknode . I've had a look at the problem I was experiencing displaying data for individual telemetry items with fresh eyes and fixed some key names in my dictionary. Stay tuned for the PR.

pharapeti commented 1 year ago

@tobiasbrown This seems to have slipped through the cracks and gone unanswered for a while, apologies for that.

The short answer right now is that there is not a great way to support this, so for first pass at this static composition will work.

The longer answer is that in future this will work via events emitted by composition providers. The composition provider interface will support registering listeners for added and removed events. This will allow composition providers to track listeners and to alert them when the composition changes. The wiring for this is in place in the API, but the object tree currently does not listen for changes emitted by composition providers, so it will not be updated.

Hi @tobiasbrown, are you aware of any plans to implement support for dynamic composition/object providers. In a comment you posted a few years ago, you mentioned that the Composition API does emit events that can be listened to. Therefore allowing other providers to essentially be 'regenerated' dynamically.

Here are some other examples of where the inability to have dynamic providers can be seen: https://github.com/nasa/openmct/issues/1656#issuecomment-414799410 https://github.com/nasa/openmct/issues/2546

tobiasbrown commented 1 year ago

Sorry for the late reply @pharapeti. This repo has changed significantly since I last looked at dynamic composition providers and I'm not sure whether it's possible or not. Perhaps @akhenry or @jvigliotta might be able to help?