Compare commits

..

2 Commits

Author SHA1 Message Date
Deep Tailor
6419fc4678 Merge branch 'master' into plan-accept-json-or-file 2021-03-03 14:06:41 -08:00
Joshi
fd959f748a Accept plans from a file OR from JSON object (couchDB) 2021-03-03 13:44:46 -08:00
12 changed files with 68 additions and 86 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "openmct",
"version": "1.6.3-SNAPSHOT",
"version": "1.6.2-SNAPSHOT",
"description": "The Open MCT core platform",
"dependencies": {},
"devDependencies": {

View File

@@ -37,7 +37,7 @@ define([
context.domainObject.getModel(),
objectUtils.parseKeyString(context.domainObject.getId())
);
const providers = mct.propertyEditors.get(domainObject, mct.router.path);
const providers = mct.propertyEditors.get(domainObject);
if (providers.length > 0) {
action.dialogService = Object.create(action.dialogService);

View File

@@ -27,6 +27,7 @@
>
<CompassHUD
v-if="hasCameraFieldOfView"
:heading="heading"
:sun-heading="sunHeading"
:camera-angle-of-view="cameraAngleOfView"
:camera-pan="cameraPan"
@@ -78,20 +79,26 @@ export default {
},
computed: {
hasCameraFieldOfView() {
return this.cameraPan !== undefined && this.cameraAngleOfView > 0;
return this.heading !== undefined && this.cameraPan !== undefined;
},
// horizontal rotation from north in degrees
// compass direction from north in degrees
heading() {
return this.image.heading;
},
// horizontal rotation from north in degrees
pitch() {
return this.image.pitch;
},
// compass direction from north in degrees
sunHeading() {
return this.image.sunOrientation;
},
// horizontal rotation from north in degrees
// relative direction from heading in degrees
cameraPan() {
return this.image.cameraPan;
},
cameraTilt() {
return this.image.cameraTilt;
},
cameraAngleOfView() {
return CAMERA_ANGLE_OF_VIEW;
},

View File

@@ -94,6 +94,10 @@ const COMPASS_POINTS = [
export default {
props: {
heading: {
type: Number,
required: true
},
sunHeading: {
type: Number,
default: undefined
@@ -132,8 +136,8 @@ export default {
},
visibleRange() {
return [
rotate(this.cameraPan, -this.cameraAngleOfView / 2),
rotate(this.cameraPan, this.cameraAngleOfView / 2)
rotate(this.heading, this.cameraPan, -this.cameraAngleOfView / 2),
rotate(this.heading, this.cameraPan, this.cameraAngleOfView / 2)
];
}
}

View File

@@ -27,7 +27,7 @@
>
<div
class="c-nsew"
:style="compassRoseStyle"
:style="rotateFrameStyle"
>
<svg
class="c-nsew__minor-ticks"
@@ -118,21 +118,21 @@
</div>
<div
v-if="hasHeading"
class="c-spacecraft-body"
:style="headingStyle"
>
</div>
<div
v-if="hasSunHeading"
v-if="showSunHeading"
class="c-sun"
:style="sunHeadingStyle"
></div>
<div
v-if="showCameraFOV"
class="c-cam-field"
:style="cameraPanStyle"
:style="cameraHeadingStyle"
>
<div class="cam-field-half cam-field-half-l">
<div
@@ -177,10 +177,16 @@ export default {
}
},
computed: {
north() {
return this.lockCompass ? rotate(-this.cameraPan) : 0;
cameraHeading() {
return rotate(this.heading, this.cameraPan);
},
compassRoseStyle() {
compassHeading() {
return this.lockCompass ? this.cameraHeading : 0;
},
north() {
return rotate(this.compassHeading, -this.cameraHeading);
},
rotateFrameStyle() {
return { transform: `rotate(${ this.north }deg)` };
},
northTextTransform() {
@@ -210,9 +216,6 @@ export default {
west: `translate(50,87) ${ rotation }`
};
},
hasHeading() {
return this.heading !== undefined;
},
headingStyle() {
const rotation = rotate(this.north, this.heading);
@@ -220,7 +223,14 @@ export default {
transform: `translateX(-50%) rotate(${ rotation }deg)`
};
},
hasSunHeading() {
cameraHeadingStyle() {
const rotation = rotate(this.north, this.cameraHeading);
return {
transform: `rotate(${ rotation }deg)`
};
},
showSunHeading() {
return this.sunHeading !== undefined;
},
sunHeadingStyle() {
@@ -230,22 +240,18 @@ export default {
transform: `rotate(${ rotation }deg)`
};
},
cameraPanStyle() {
const rotation = rotate(this.north, this.cameraPan);
return {
transform: `rotate(${ rotation }deg)`
};
showCameraFOV() {
return this.cameraPan !== undefined && this.cameraAngleOfView > 0;
},
// left half of camera field of view
// rotated counter-clockwise from camera pan angle
// rotated counter-clockwise from camera field of view heading
cameraFOVStyleLeftHalf() {
return {
transform: `translateX(50%) rotate(${ -this.cameraAngleOfView / 2 }deg)`
};
},
// right half of camera field of view
// rotated clockwise from camera pan angle
// rotated clockwise from camera field of view heading
cameraFOVStyleRightHalf() {
return {
transform: `translateX(-50%) rotate(${ this.cameraAngleOfView / 2 }deg)`

View File

@@ -1,28 +1,23 @@
/**
*
* sums an arbitrary number of absolute rotations
* (meaning rotations relative to one common direction 0)
* normalizes the rotation to the range [0, 360)
*
* @param {...number} rotations in degrees
* @returns {number} normalized sum of all rotations - [0, 360) degrees
*/
export function rotate(...rotations) {
export function rotate(direction, ...rotations) {
const rotation = rotations.reduce((a, b) => a + b, 0);
return normalizeCompassDirection(rotation);
return normalizeCompassDirection(direction + rotation);
}
export function normalizeCompassDirection(degrees) {
const base = degrees % 360;
return base >= 0 ? base : 360 + base;
}
export function inRange(degrees, [min, max]) {
const point = rotate(degrees);
return min > max
? (point >= min && point < 360) || (point <= max && point >= 0)
: point >= min && point <= max;
? (degrees >= min && degrees < 360) || (degrees <= max && degrees >= 0)
: degrees >= min && degrees <= max;
}
export function percentOfRange(degrees, [min, max]) {
let distance = rotate(degrees);
let distance = degrees;
let minRange = min;
let maxRange = max;
@@ -36,9 +31,3 @@ export function percentOfRange(degrees, [min, max]) {
return (distance - minRange) / (maxRange - minRange);
}
function normalizeCompassDirection(degrees) {
const base = degrees % 360;
return base >= 0 ? base : 360 + base;
}

View File

@@ -273,7 +273,7 @@ export default {
isFresh = true;
for (let key of this.spacecraftPositionKeys) {
if (this.relatedTelemetry[key] && latest[key] && focused[key]) {
isFresh = isFresh && Boolean(this.relatedTelemetry[key].comparisonFunction(latest[key], focused[key]));
isFresh = Boolean(this.relatedTelemetry[key].comparisonFunction(latest[key], focused[key]));
} else {
isFresh = false;
}
@@ -291,7 +291,7 @@ export default {
isFresh = true;
for (let key of this.spacecraftOrientationKeys) {
if (this.relatedTelemetry[key] && latest[key] && focused[key]) {
isFresh = isFresh && Boolean(this.relatedTelemetry[key].comparisonFunction(latest[key], focused[key]));
isFresh = Boolean(this.relatedTelemetry[key].comparisonFunction(latest[key], focused[key]));
} else {
isFresh = false;
}
@@ -312,7 +312,7 @@ export default {
if (this.isSpacecraftPositionFresh && this.isSpacecraftOrientationFresh) {
for (let key of this.cameraKeys) {
if (this.relatedTelemetry[key] && latest[key] && focused[key]) {
isFresh = isFresh && Boolean(this.relatedTelemetry[key].comparisonFunction(latest[key], focused[key]));
isFresh = Boolean(this.relatedTelemetry[key].comparisonFunction(latest[key], focused[key]));
} else {
isFresh = false;
}
@@ -348,7 +348,7 @@ export default {
// related telemetry keys
this.spacecraftPositionKeys = ['positionX', 'positionY', 'positionZ'];
this.spacecraftOrientationKeys = ['heading'];
this.spacecraftOrientationKeys = ['heading', 'roll', 'pitch'];
this.cameraKeys = ['cameraPan', 'cameraTilt'];
this.sunKeys = ['sunOrientation'];
@@ -468,12 +468,7 @@ export default {
// set data ON image telemetry as well as in focusedImageRelatedTelemetry
for (let key of this.relatedTelemetry.keys) {
if (
this.relatedTelemetry[key]
&& this.relatedTelemetry[key].historical
&& this.relatedTelemetry[key].requestLatestFor
) {
if (this.relatedTelemetry[key] && this.relatedTelemetry[key].historical) {
let valuesOnTelemetry = this.relatedTelemetry[key].hasTelemetryOnDatum;
let value = await this.getMostRecentRelatedTelemetry(key, this.focusedImage);

View File

@@ -73,7 +73,7 @@ export default class RelatedTelemetry {
await this._initializeHistorical(key);
}
if (this[key].realtime && this[key].realtime.telemetryObjectId && this[key].realtime.telemetryObjectId !== '') {
if (this[key].realtime && this[key].realtime.telemetryObjectId) {
await this._intializeRealtime(key);
}
}
@@ -82,9 +82,7 @@ export default class RelatedTelemetry {
}
async _initializeHistorical(key) {
if (!this[key].historical.telemetryObjectId) {
this[key].historical.hasTelemetryOnDatum = true;
} else if (this[key].historical.telemetryObjectId !== '') {
if (this[key].historical.telemetryObjectId) {
this[key].historicalDomainObject = await this._openmct.objects.get(this[key].historical.telemetryObjectId);
this[key].requestLatestFor = async (datum) => {
@@ -98,6 +96,8 @@ export default class RelatedTelemetry {
return results[results.length - 1];
};
} else {
this[key].historical.hasTelemetryOnDatum = true;
}
}

View File

@@ -69,7 +69,7 @@ export default {
methods: {
deletePage(id) {
const selectedSection = this.sections.find(s => s.isSelected);
const page = this.pages.find(p => p.id === id);
const page = this.pages.find(p => p.id !== id);
deleteNotebookEntries(this.openmct, this.domainObject, selectedSection, page);
const selectedPage = this.pages.find(p => p.isSelected);

View File

@@ -413,21 +413,6 @@ define([
return;
}
const isPinchToZoom = event.ctrlKey === true;
let isZoomIn = event.wheelDelta < 0;
let isZoomOut = event.wheelDelta >= 0;
//Flip the zoom direction if this is pinch to zoom
if (isPinchToZoom) {
if (isZoomIn === true) {
isZoomOut = true;
isZoomIn = false;
} else if (isZoomOut === true) {
isZoomIn = true;
isZoomOut = false;
}
}
let xDisplayRange = this.$scope.xAxis.get('displayRange');
let yDisplayRange = this.$scope.yAxis.get('displayRange');
@@ -460,7 +445,7 @@ define([
};
}
if (isZoomIn) {
if (event.wheelDelta < 0) {
this.$scope.xAxis.set('displayRange', {
min: xDisplayRange.min + ((xAxisDist * ZOOM_AMT) * xAxisMinDist),
@@ -471,7 +456,7 @@ define([
min: yDisplayRange.min + ((yAxisDist * ZOOM_AMT) * yAxisMinDist),
max: yDisplayRange.max - ((yAxisDist * ZOOM_AMT) * yAxisMaxDist)
});
} else if (isZoomOut) {
} else if (event.wheelDelta >= 0) {
this.$scope.xAxis.set('displayRange', {
min: xDisplayRange.min - ((xAxisDist * ZOOM_AMT) * xAxisMinDist),

View File

@@ -67,10 +67,6 @@
&.is-in-month {
background: $colorMenuElementHilite;
}
&.selected {
background: #1ac6ff; // this should be a variable... CHARLESSSSSS
}
}
&__day {

View File

@@ -159,7 +159,7 @@ export default {
return this.views.filter(v => v.key === this.viewKey)[0] || {};
},
views() {
if (this.domainObject && (this.openmct.router.started !== true)) {
if (this.openmct.router.started !== true) {
return [];
}