programmatically creating my object tree #5708
Replies: 3 comments
-
Hi. It's certainly possible to load an object tree on some asynchronous event like a button click. Object tree roots are resolved at start time in Open MCT based on the registered root providers. However, object composition can be resolved dynamically using a custom composition provider, which can emit events when the composition changes. So, roughly speaking, the steps involved would be to:
Each of these steps is covered in our tutorial, so that's a great place to start learning about object and composition providers. Hope this helps get you started, let us know how you get on. |
Beta Was this translation helpful? Give feedback.
-
I didn't do it the way it was suggested. It did not meet the requirements. what i did do is create a import object tree vue with a few buttons. Input parameters to create the vue was url and port for telemetry server. I used the objects api to get "My Items" tree. I used the "objectService" and the "instantiate" from the $injector. I used much of the import json code to get the job done. My telemetry server generates the object tree json based up what the user chooses in the the drop down. |
Beta Was this translation helpful? Give feedback.
-
@rhoran1961 Hi! What version of Open MCT are you using? We have moved away from Angular and it seems you may be using an older version that's still using it. If you click the Open MCT logo in the top right of your instance, it should show you the version info, we do recommend using the later versions. |
Beta Was this translation helpful? Give feedback.
-
I want to create my object tree programmatically. Based upon where I am getting my telemetry data I want that object tree to be loaded by pushing a button in my openmct browser.
I am thinking I have an external tool that creates the dictionary of objects (assume all the plugins are written and available to openmct). When that button is clicked, load up the json. I need some guidance on this. Is this possible? I believe it is, since I can import a json file manually.
I am not a javascript programmer. I am a programmer but this is my first javascript project.
What openmct api do i call to create a folder with all my objects?
When I export the json of an existing object tree I see a lot of uuids. Are these uuids necessary when loading a new object tree?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions