Compare commits

...

21 Commits

Author SHA1 Message Date
Deep Tailor
8f8208eea3 table fixes 2020-03-09 17:15:33 -07:00
Deep Tailor
3a54abd28e remove logs 2020-03-09 14:27:46 -07:00
Deep Tailor
8cf4552ec0 complete cherry-pick 2020-03-09 14:23:46 -07:00
Deep Tailor
8bad86b281 5 2020-03-09 14:13:41 -07:00
Nikhil
5e83eb1282 Merge pull request #2732 from nasa/minmax-fix-382020
Revert minMax to minmax
2020-03-09 14:11:55 -07:00
Deep Tailor
8f4e1db76b fix minmax typo 2020-03-09 14:10:12 -07:00
David Tsay
4be6cf97b6 4 2020-03-09 14:09:50 -07:00
Deep Tailor
5cb5ba5ec9 revert alternate control bar for telemetry table 2020-03-09 14:08:40 -07:00
charlesh88
0c1457b7d2 Fixes for table's alternateControlBar
- Fixed hide/show of controls for better UX;
- Unit tested click select/deselect toggling;
2020-03-09 14:08:23 -07:00
Deep Tailor
4c8c5ba85a remove row if user unmarks in showMarkedRowsOnly mode 2020-03-09 14:07:56 -07:00
Deep Tailor
8c73bc844b enable alternatte control bar in telemetry tables for charles 2020-03-09 14:07:34 -07:00
Deep Tailor
e400232da4 3 2020-03-09 14:07:02 -07:00
Deep Tailor
e7d9f0de0d emit event when rows are marked - useful for other components using telemetry tables 2020-03-09 14:04:42 -07:00
Deep Tailor
70fcb0307c second 2020-03-09 14:04:10 -07:00
Deep Tailor
716a736448 simplify check for equal filters 2020-01-05 21:08:27 -08:00
Deep Tailor
f409e92f77 only call fetch if filters are different on a series per series level 2020-01-05 20:16:58 -08:00
Deep Tailor
3f4fe5d447 fixes plots refetching when filters are initialized 2019-12-26 11:00:49 -08:00
David Tsay
92c628e389 by default add new frame to end of container (#2601) 2019-12-19 16:20:58 -08:00
Deep Tailor
1205e6977c enable import-export 2019-12-11 11:31:37 -08:00
Deep Tailor
cee8b5ce1f port minmax filter fix to vista-4.3.0 2019-12-11 10:49:20 -08:00
Deep Tailor
8d45d86d7a fix bugs caused by shouldUseMinMax reported by VISTA 2019-12-03 15:41:11 -08:00
12 changed files with 730 additions and 420 deletions

2
API.md
View File

@@ -237,7 +237,7 @@ attributes
of this object. This is used for specifying an icon to appear next to each
object of this type.
The [Open MCT Tutorials](https://github.com/openmct/openmct-tutorial) provide a
The [Open MCT Tutorials](https://github.com/nasa/openmct-tutorial) provide a
step-by-step examples of writing code for Open MCT that includes a [section on
defining a new object type](https://github.com/nasa/openmct-tutorial#step-3---providing-objects).

View File

@@ -72,6 +72,8 @@ define([
]
}
});
openmct.legacyRegistry.enable('platform/import-export');
};
};
});

View File

@@ -540,18 +540,16 @@ export default {
this.newFrameLocation = [containerIndex, insertFrameIndex];
},
addFrame(domainObject) {
if (this.newFrameLocation.length) {
let containerIndex = this.newFrameLocation[0],
frameIndex = this.newFrameLocation[1],
frame = new Frame(domainObject.identifier),
container = this.containers[containerIndex];
let containerIndex = this.newFrameLocation.length ? this.newFrameLocation[0] : 0;
let container = this.containers[containerIndex];
let frameIndex = this.newFrameLocation.length ? this.newFrameLocation[1] : container.frames.length;
let frame = new Frame(domainObject.identifier);
container.frames.splice(frameIndex + 1, 0, frame);
sizeItems(container.frames, frame);
container.frames.splice(frameIndex + 1, 0, frame);
sizeItems(container.frames, frame);
this.newFrameLocation = [];
this.persist(containerIndex);
}
this.newFrameLocation = [];
this.persist(containerIndex);
},
deleteFrame(frameId) {
let container = this.containers

View File

@@ -140,8 +140,14 @@ define([
* @returns {Promise}
*/
fetch: function (options) {
const strategy = options.shouldUseMinMax ? 'minMax' : undefined;
let strategy;
if (this.model.interpolate !== 'none') {
strategy = 'minmax';
}
options = _.extend({}, { size: 1000, strategy, filters: this.filters }, options || {});
if (!this.unsubscribe) {
this.unsubscribe = this.openmct
.telemetry
@@ -371,26 +377,17 @@ define([
* @public
*/
updateFiltersAndRefresh: function (updatedFilters) {
this.filters = updatedFilters;
this.reset();
if (this.unsubscribe) {
this.unsubscribe();
delete this.unsubscribe;
if (this.filters && !_.isEqual(this.filters, updatedFilters)) {
this.filters = updatedFilters;
this.reset();
if (this.unsubscribe) {
this.unsubscribe();
delete this.unsubscribe;
}
this.fetch();
} else {
this.filters = updatedFilters;
}
this.fetch();
},
/**
* Clears the plot series, unsubscribes and resubscribes
* @public
*/
refresh: function () {
this.reset();
if (this.unsubscribe) {
this.unsubscribe();
delete this.unsubscribe;
}
this.fetch();
}
});

View File

@@ -102,8 +102,7 @@ define([
this.startLoading();
var options = {
size: this.$element[0].offsetWidth,
domain: this.config.xAxis.get('key'),
shouldUseMinMax: this.shouldUseMinMax(series)
domain: this.config.xAxis.get('key')
};
series.load(options)
@@ -161,10 +160,6 @@ define([
return config;
};
PlotController.prototype.shouldUseMinMax = function (series) {
return series.model.interpolate !== 'none';
};
PlotController.prototype.onTimeSystemChange = function (timeSystem) {
this.config.xAxis.set('key', timeSystem.key);
};

View File

@@ -47,6 +47,7 @@ define([
this.subscriptions = {};
this.tableComposition = undefined;
this.telemetryObjects = [];
this.datumCache = [];
this.outstandingRequests = 0;
this.configuration = new TelemetryTableConfiguration(domainObject, openmct);
this.paused = false;
@@ -155,6 +156,7 @@ define([
processHistoricalData(telemetryData, columnMap, keyString, limitEvaluator) {
let telemetryRows = telemetryData.map(datum => new TelemetryTableRow(datum, columnMap, keyString, limitEvaluator));
this.boundedRows.add(telemetryRows);
this.emit('historical-rows-processed');
}
/**
@@ -227,12 +229,28 @@ define([
return;
}
if (!this.paused) {
if (this.paused) {
let realtimeDatum = {
datum,
columnMap,
keyString,
limitEvaluator
};
this.datumCache.push(realtimeDatum);
} else {
this.processRealtimeDatum(datum, columnMap, keyString, limitEvaluator);
}
}, subscribeOptions);
}
processDatumCache() {
this.datumCache.forEach(cachedDatum => {
this.processRealtimeDatum(cachedDatum.datum, cachedDatum.columnMap, cachedDatum.keyString, cachedDatum.limitEvaluator);
});
this.datumCache = [];
}
processRealtimeDatum(datum, columnMap, keyString, limitEvaluator) {
this.boundedRows.add(new TelemetryTableRow(datum, columnMap, keyString, limitEvaluator));
}
@@ -272,8 +290,8 @@ define([
unpause() {
this.paused = false;
this.processDatumCache();
this.boundedRows.subscribeToBounds();
this.refreshData();
}
destroy() {

View File

@@ -51,24 +51,33 @@ define([
view(domainObject, isEditing, objectPath) {
let table = new TelemetryTable(domainObject, openmct);
let component;
let markingProp = {
enable: true,
useAlternateControlBar: false,
rowName: '',
rowNamePlural: ''
};
return {
show: function (element, editMode) {
component = new Vue({
data() {
return {
isEditing: editMode
}
},
el: element,
components: {
TableComponent: TableComponent.default
},
data() {
return {
isEditing: editMode,
markingProp
};
},
provide: {
openmct,
table,
objectPath
},
el: element,
template: '<table-component :isEditing="isEditing" :enableMarking="true"></table-component>'
template: '<table-component :isEditing="isEditing" :marking="markingProp"/>'
});
},
onEditModeChange(editMode) {
@@ -86,7 +95,7 @@ define([
priority() {
return 1;
}
}
};
}
return TelemetryTableViewProvider;
});

File diff suppressed because it is too large Load Diff

View File

@@ -619,6 +619,7 @@ select {
.c-separator {
@include cToolbarSeparator();
height: 100%;
}
.c-toolbar {

View File

@@ -28,6 +28,16 @@
height: $controlBarH;
}
.c-control-bar {
display: flex;
align-items: center;
&__label {
display: inline-block;
white-space: nowrap;
}
}
.l-view-section {
@include abs();
overflow: auto;

View File

@@ -1,78 +1,114 @@
<template>
<label class="c-toggle-switch">
<input type="checkbox"
:id="id"
:checked="checked"
@change="onUserSelect($event)"/>
<div class="c-toggle-switch">
<label class="c-toggle-switch__control">
<input
:id="id"
type="checkbox"
:checked="checked"
@change="onUserSelect($event)"
>
<span class="c-toggle-switch__slider"></span>
</label>
<div
v-if="label && label.length"
class="c-toggle-switch__label"
>
{{ label }}
</div>
</div>
</template>
<style lang="scss">
@import "~styles/sass-base";
.c-toggle-switch {
$d: 12px;
$m: 2px;
$br: $d/1.5;
$d: 12px;
$m: 2px;
$br: $d/1.5;
display: inline-flex;
align-items: center;
vertical-align: middle;
&__control,
&__label {
flex: 0 0 auto;
}
&__control {
cursor: pointer;
overflow: hidden;
display: inline;
vertical-align: middle;
display: block;
}
&__slider {
background: $colorBtnBg; // TODO: make discrete theme constants for these colors
border-radius: $br;
//box-shadow: inset rgba($colorBtnFg, 0.4) 0 0 0 1px;
display: inline-block;
height: $d + ($m*2);
position: relative;
transform: translateY(2px); // TODO: get this to work without this kind of hack!
width: $d*2 + $m*2;
input {
opacity: 0;
width: 0;
height: 0;
&:before {
// Knob
background: $colorBtnFg; // TODO: make discrete theme constants for these colors
border-radius: floor($br * 0.8);
box-shadow: rgba(black, 0.4) 0 0 2px;
content: '';
display: block;
position: absolute;
height: $d; width: $d;
top: $m; left: $m; right: auto;
transition: transform 100ms ease-in-out;
}
}
input {
opacity: 0;
width: 0;
height: 0;
&:checked {
+ .c-toggle-switch__slider {
background: $colorKey; // TODO: make discrete theme constants for these colors
&:before {
transform: translateX(100%);
}
&:checked {
+ .c-toggle-switch__slider {
background: $colorKey; // TODO: make discrete theme constants for these colors
&:before {
transform: translateX(100%);
}
}
}
}
&__slider {
// Sits within __switch
background: $colorBtnBg; // TODO: make discrete theme constants for these colors
border-radius: $br;
display: inline-block;
height: $d + ($m*2);
position: relative;
transform: translateY(2px); // TODO: get this to work without this kind of hack!
width: $d*2 + $m*2;
&:before {
// Knob
background: $colorBtnFg; // TODO: make discrete theme constants for these colors
border-radius: floor($br * 0.8);
box-shadow: rgba(black, 0.4) 0 0 2px;
content: '';
display: block;
position: absolute;
height: $d; width: $d;
top: $m; left: $m; right: auto;
transition: transform 100ms ease-in-out;
}
}
&__label {
margin-left: $interiorMarginSm;
margin-right: $interiorMargin;
white-space: nowrap;
}
}
</style>
<script>
export default {
inject: ['openmct'],
props: {
id: String,
checked: Boolean
export default {
inject: ['openmct'],
props: {
id: {
type: String,
required: true
},
methods: {
onUserSelect(event) {
this.$emit('change', event.target.checked);
}
label: {
type: String,
required: false,
default: ''
},
checked: Boolean
},
methods: {
onUserSelect(event) {
this.$emit('change', event.target.checked);
}
}
</script>
}
</script>

View File

@@ -0,0 +1,64 @@
.c-toggle-switch {
$d: 12px;
$m: 2px;
$br: $d/1.5;
display: inline-flex;
align-items: center;
vertical-align: middle;
&__control,
&__label {
flex: 0 0 auto;
}
&__control {
cursor: pointer;
overflow: hidden;
display: block;
}
input {
opacity: 0;
width: 0;
height: 0;
&:checked {
+ .c-toggle-switch__slider {
background: $colorKey; // TODO: make discrete theme constants for these colors
&:before {
transform: translateX(100%);
}
}
}
}
&__slider {
// Sits within __switch
background: $colorBtnBg; // TODO: make discrete theme constants for these colors
border-radius: $br;
display: inline-block;
height: $d + ($m*2);
position: relative;
transform: translateY(2px); // TODO: get this to work without this kind of hack!
width: $d*2 + $m*2;
&:before {
// Knob
background: $colorBtnFg; // TODO: make discrete theme constants for these colors
border-radius: floor($br * 0.8);
box-shadow: rgba(black, 0.4) 0 0 2px;
content: '';
display: block;
position: absolute;
height: $d; width: $d;
top: $m; left: $m; right: auto;
transition: transform 100ms ease-in-out;
}
}
&__label {
margin-left: $interiorMarginSm;
margin-right: $interiorMargin;
white-space: nowrap;
}
}