Compare commits

...

6 Commits

Author SHA1 Message Date
7a0041b663 Add static root plugin files 2022-01-28 11:43:15 -06:00
44f5372c31 fix typo when using fallback template (#4784) 2022-01-26 13:34:22 -08:00
2f292fbd07 Follow domain object changes for Independent time conductor (#4783)
* Track if domain object changes when independent time conductor is in use.
2022-01-26 13:04:47 -08:00
205dc67809 Observe changes to sub-objects in flexible layouts. (#4780)
* Get child of flex layout as mutable if possible

* Fix bug when no default notebook defined
2022-01-25 23:22:42 -08:00
169c23dbcc update copyright (#4775) 2022-01-25 12:27:27 -08:00
457cd42987 Update version number (#4759) 2022-01-20 18:57:05 -08:00
23 changed files with 81 additions and 40 deletions

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -195,6 +195,7 @@
)); ));
openmct.install(openmct.plugins.Clock({ enableClockIndicator: true })); openmct.install(openmct.plugins.Clock({ enableClockIndicator: true }));
openmct.install(openmct.plugins.Timer()); openmct.install(openmct.plugins.Timer());
openmct.install(openmct.plugins.StaticRootPlugin('root', './dist/static-root.json'));
openmct.start(); openmct.start();
</script> </script>
</html> </html>

View File

@ -1,6 +1,6 @@
{ {
"name": "openmct", "name": "openmct",
"version": "1.8.4-SNAPSHOT", "version": "1.8.4",
"description": "The Open MCT core platform", "description": "The Open MCT core platform",
"devDependencies": { "devDependencies": {
"@braintree/sanitize-url": "^5.0.2", "@braintree/sanitize-url": "^5.0.2",

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -97,7 +97,14 @@ export default {
}, },
mounted() { mounted() {
if (this.frame.domainObjectIdentifier) { if (this.frame.domainObjectIdentifier) {
this.openmct.objects.get(this.frame.domainObjectIdentifier).then((object) => { let domainObjectPromise;
if (this.openmct.objects.supportsMutation(this.frame.domainObjectIdentifier)) {
domainObjectPromise = this.openmct.objects.getMutable(this.frame.domainObjectIdentifier);
} else {
domainObjectPromise = this.openmct.objects.get(this.frame.domainObjectIdentifier);
}
domainObjectPromise.then((object) => {
this.setDomainObject(object); this.setDomainObject(object);
}); });
} }
@ -105,6 +112,10 @@ export default {
this.dragGhost = document.getElementById('js-fl-drag-ghost'); this.dragGhost = document.getElementById('js-fl-drag-ghost');
}, },
beforeDestroy() { beforeDestroy() {
if (this.domainObject.isMutable) {
this.openmct.objects.destroyMutable(this.domainObject);
}
if (this.unsubscribeSelection) { if (this.unsubscribeSelection) {
this.unsubscribeSelection(); this.unsubscribeSelection();
} }

View File

@ -632,7 +632,8 @@ export default {
updateDefaultNotebook(updatedNotebookStorageObject) { updateDefaultNotebook(updatedNotebookStorageObject) {
if (!this.isDefaultNotebook()) { if (!this.isDefaultNotebook()) {
const persistedNotebookStorageObject = getDefaultNotebook(); const persistedNotebookStorageObject = getDefaultNotebook();
if (persistedNotebookStorageObject.identifier !== undefined) { if (persistedNotebookStorageObject
&& persistedNotebookStorageObject.identifier !== undefined) {
this.removeDefaultClass(persistedNotebookStorageObject.identifier); this.removeDefaultClass(persistedNotebookStorageObject.identifier);
} }

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -278,7 +278,7 @@ export default {
// Have to throw away the old canvas elements and replace with new // Have to throw away the old canvas elements and replace with new
// canvas elements in order to get new drawing contexts. // canvas elements in order to get new drawing contexts.
const div = document.createElement('div'); const div = document.createElement('div');
div.innerHTML = this.TEMPLATE; div.innerHTML = this.canvasTemplate + this.canvasTemplate;
const mainCanvas = div.querySelectorAll("canvas")[1]; const mainCanvas = div.querySelectorAll("canvas")[1];
const overlayCanvas = div.querySelectorAll("canvas")[0]; const overlayCanvas = div.querySelectorAll("canvas")[0];
this.canvas.parentNode.replaceChild(mainCanvas, this.canvas); this.canvas.parentNode.replaceChild(mainCanvas, this.canvas);

View File

@ -32,6 +32,8 @@ define([
} }
}); });
console.log(JSON.parse(objectString));
return JSON.parse(objectString); return JSON.parse(objectString);
} }

View File

@ -95,6 +95,11 @@ export default {
isUTCBased: timeSystem.isUTCBased isUTCBased: timeSystem.isUTCBased
}; };
}, },
watch: {
keyString() {
this.setTimeContext();
}
},
mounted() { mounted() {
this.handleNewBounds = _.throttle(this.handleNewBounds, 300); this.handleNewBounds = _.throttle(this.handleNewBounds, 300);
this.setTimeSystem(JSON.parse(JSON.stringify(this.openmct.time.timeSystem()))); this.setTimeSystem(JSON.parse(JSON.stringify(this.openmct.time.timeSystem())));

View File

@ -115,6 +115,11 @@ export default {
isUTCBased: timeSystem.isUTCBased isUTCBased: timeSystem.isUTCBased
}; };
}, },
watch: {
keyString() {
this.setTimeContext();
}
},
mounted() { mounted() {
this.handleNewBounds = _.throttle(this.handleNewBounds, 300); this.handleNewBounds = _.throttle(this.handleNewBounds, 300);
this.setTimeSystem(JSON.parse(JSON.stringify(this.openmct.time.timeSystem()))); this.setTimeSystem(JSON.parse(JSON.stringify(this.openmct.time.timeSystem())));

View File

@ -105,42 +105,49 @@ export default {
watch: { watch: {
domainObject: { domainObject: {
handler(domainObject) { handler(domainObject) {
this.independentTCEnabled = domainObject.configuration.useIndependentTime === true; const key = this.openmct.objects.makeKeyString(domainObject.identifier);
if (key !== this.keyString) {
if (!domainObject.configuration.timeOptions || !this.independentTCEnabled) { //domain object has changed
this.destroyIndependentTime(); this.destroyIndependentTime();
return; this.independentTCEnabled = domainObject.configuration.useIndependentTime === true;
} this.timeOptions = domainObject.configuration.timeOptions || {
clockOffsets: this.openmct.time.clockOffsets(),
fixedOffsets: this.openmct.time.bounds()
};
if (this.timeOptions.start !== domainObject.configuration.timeOptions.start this.initialize();
|| this.timeOptions.end !== domainObject.configuration.timeOptions.end) {
this.timeOptions = domainObject.configuration.timeOptions;
this.destroyIndependentTime();
this.registerIndependentTimeOffsets();
} }
}, },
deep: true deep: true
} }
}, },
mounted() { mounted() {
this.setTimeContext(); this.initialize();
if (this.timeOptions.mode) {
this.mode = this.timeOptions.mode;
} else {
this.timeOptions.mode = this.mode = this.timeContext.clock() === undefined ? { key: 'fixed' } : { key: Object.create(this.timeContext.clock()).key};
}
if (this.independentTCEnabled) {
this.registerIndependentTimeOffsets();
}
}, },
beforeDestroy() { beforeDestroy() {
this.stopFollowingTimeContext(); this.stopFollowingTimeContext();
this.destroyIndependentTime(); this.destroyIndependentTime();
}, },
methods: { methods: {
initialize() {
this.keyString = this.openmct.objects.makeKeyString(this.domainObject.identifier);
this.setTimeContext();
if (this.timeOptions.mode) {
this.mode = this.timeOptions.mode;
} else {
if (this.timeContext.clock() === undefined) {
this.timeOptions.mode = this.mode = { key: 'fixed' };
} else {
this.timeOptions.mode = this.mode = { key: Object.create(this.timeContext.clock()).key};
}
}
if (this.independentTCEnabled) {
this.registerIndependentTimeOffsets();
}
},
toggleIndependentTC() { toggleIndependentTC() {
this.independentTCEnabled = !this.independentTCEnabled; this.independentTCEnabled = !this.independentTCEnabled;
if (this.independentTCEnabled) { if (this.independentTCEnabled) {
@ -213,10 +220,9 @@ export default {
offsets = this.timeOptions.clockOffsets; offsets = this.timeOptions.clockOffsets;
} }
const key = this.openmct.objects.makeKeyString(this.domainObject.identifier); const timeContext = this.openmct.time.getIndependentContext(this.keyString);
const timeContext = this.openmct.time.getIndependentContext(key);
if (!timeContext.hasOwnContext()) { if (!timeContext.hasOwnContext()) {
this.unregisterIndependentTime = this.openmct.time.addIndependentContext(key, offsets, this.isFixed ? undefined : this.mode.key); this.unregisterIndependentTime = this.openmct.time.addIndependentContext(this.keyString, offsets, this.isFixed ? undefined : this.mode.key);
} else { } else {
if (this.isFixed) { if (this.isFixed) {
timeContext.stopClock(); timeContext.stopClock();

View File

@ -1,5 +1,5 @@
<!-- <!--
Open MCT, Copyright (c) 2014-2021, United States Government Open MCT, Copyright (c) 2014-2022, United States Government
as represented by the Administrator of the National Aeronautics and Space as represented by the Administrator of the National Aeronautics and Space
Administration. All rights reserved. Administration. All rights reserved.

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

1
static-root.json Normal file
View File

@ -0,0 +1 @@
{"openmct":{"c1b7f449-459e-4f37-ac00-07b91936d079":{"identifier":{"key":"c1b7f449-459e-4f37-ac00-07b91936d079","namespace":""},"name":"A Folder","type":"folder","composition":[{"key":"3e1b49d7-4b95-47a6-9744-93d18c1f7d86","namespace":""},{"key":"da052eaf-1631-48e4-944f-c4688276181b","namespace":""}],"modified":1641506166404,"location":"mine","persisted":1641506166404},"3e1b49d7-4b95-47a6-9744-93d18c1f7d86":{"identifier":{"key":"3e1b49d7-4b95-47a6-9744-93d18c1f7d86","namespace":""},"name":"Test Clock","type":"clock","configuration":{"baseFormat":"YYYY/MM/DD hh:mm:ss","use24":"clock12","timezone":"UTC"},"modified":1641506137466,"location":"c1b7f449-459e-4f37-ac00-07b91936d079","persisted":1641506137466},"da052eaf-1631-48e4-944f-c4688276181b":{"identifier":{"key":"da052eaf-1631-48e4-944f-c4688276181b","namespace":""},"name":"B Hyperlink","type":"hyperlink","displayFormat":"link","linkTarget":"_self","url":"www.google.com","displayText":"Google","modified":1641506166402,"location":"c1b7f449-459e-4f37-ac00-07b91936d079","persisted":1641506166402}},"rootId":"c1b7f449-459e-4f37-ac00-07b91936d079"}

View File

@ -1,5 +1,6 @@
const { merge } = require('webpack-merge'); const { merge } = require('webpack-merge');
const common = require('./webpack.common'); const common = require('./webpack.common');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const path = require('path'); const path = require('path');
const webpack = require('webpack'); const webpack = require('webpack');
@ -14,6 +15,14 @@ module.exports = merge(common, {
plugins: [ plugins: [
new webpack.DefinePlugin({ new webpack.DefinePlugin({
__OPENMCT_ROOT_RELATIVE__: '"dist/"' __OPENMCT_ROOT_RELATIVE__: '"dist/"'
}),
new CopyWebpackPlugin({
patterns: [
{
from: './static-root.json',
to: '.'
}
]
}) })
], ],
devtool: 'eval-source-map' devtool: 'eval-source-map'