mirror of
https://github.com/nasa/openmct.git
synced 2025-05-13 05:53:18 +00:00
[Plot] #638 Fleshing out form structures
This commit is contained in:
parent
8bb5a47b88
commit
e3a0cae5fd
@ -30,8 +30,8 @@
|
|||||||
<span ng-controller="TreeNodeController as treeNode">
|
<span ng-controller="TreeNodeController as treeNode">
|
||||||
<span class="tree-item menus-to-left">
|
<span class="tree-item menus-to-left">
|
||||||
<span
|
<span
|
||||||
class='ui-symbol view-control flex-elem'
|
class='ui-symbol view-control flex-elem has-children'
|
||||||
ng-class="{ 'has-children': model.composition !== undefined, expanded: toggle.isActive() }"
|
ng-class="{ expanded: toggle.isActive() }"
|
||||||
ng-click="toggle.toggle(); treeNode.trackExpansion()">
|
ng-click="toggle.toggle(); treeNode.trackExpansion()">
|
||||||
</span>
|
</span>
|
||||||
<mct-representation
|
<mct-representation
|
||||||
|
@ -31,6 +31,16 @@ define(
|
|||||||
function () {
|
function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notes on implementation of plot options
|
||||||
|
*
|
||||||
|
* Multiple y-axes will have to be handled with multiple forms as
|
||||||
|
* they will need to be stored on distinct model object
|
||||||
|
*
|
||||||
|
* Likewise plot series options per-child will need to be separate
|
||||||
|
* forms.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The LayoutController is responsible for supporting the
|
* The LayoutController is responsible for supporting the
|
||||||
* Layout view. It arranges frames according to saved configuration
|
* Layout view. It arranges frames according to saved configuration
|
||||||
@ -42,10 +52,69 @@ define(
|
|||||||
*/
|
*/
|
||||||
function PlotOptionsController($scope) {
|
function PlotOptionsController($scope) {
|
||||||
var self = this,
|
var self = this,
|
||||||
plotOptionsStructure = {
|
domainObject = $scope.domainObject,
|
||||||
'name':'Plot Options',
|
xAxisForm = {
|
||||||
|
'name':'x-axis',
|
||||||
|
'sections': [{
|
||||||
|
'name': 'x-axis',
|
||||||
|
'rows': [
|
||||||
|
{
|
||||||
|
'name': 'Domain',
|
||||||
|
'control': 'select',
|
||||||
|
'key': 'key',
|
||||||
|
//TODO fetch options from platform or object type configuration
|
||||||
|
'options': [
|
||||||
|
{'name':'scet', 'value': 'scet'},
|
||||||
|
{'name':'sclk', 'value': 'sclk'},
|
||||||
|
{'name':'lst', 'value': 'lst'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}]},
|
||||||
|
yAxisForm = {
|
||||||
|
'name':'y-axis',
|
||||||
'sections': [{
|
'sections': [{
|
||||||
'rows':[
|
// Will need to be repeated for each y-axis, with a
|
||||||
|
// distinct name each. Ideally the name of the axis itself.
|
||||||
|
'name': 'y-axis',
|
||||||
|
'rows': [
|
||||||
|
{
|
||||||
|
'name': 'Autoscale',
|
||||||
|
'control': 'checkbox',
|
||||||
|
'key': 'autoscale',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Min',
|
||||||
|
'control': 'textfield',
|
||||||
|
'key': 'min',
|
||||||
|
'pattern': '[0-9]'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Max',
|
||||||
|
'control': 'textfield',
|
||||||
|
'key': 'min',
|
||||||
|
'pattern': '[0-9]'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Range',
|
||||||
|
'control': 'select',
|
||||||
|
'key': 'key',
|
||||||
|
'options': [
|
||||||
|
{'name':'eu', 'value': 'eu'},
|
||||||
|
{'name':'dn', 'value': 'dn'},
|
||||||
|
{'name':'status', 'value': 'status'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
plotSeriesForm = {
|
||||||
|
// For correctness of the rendered markup, repeated forms
|
||||||
|
// will probably need to have unique names.
|
||||||
|
'name': 'plotSeries',
|
||||||
|
'sections': [{
|
||||||
|
'name': 'Plot Series',
|
||||||
|
'rows': [
|
||||||
{
|
{
|
||||||
'name': 'Markers',
|
'name': 'Markers',
|
||||||
'control': 'checkbox',
|
'control': 'checkbox',
|
||||||
@ -53,31 +122,63 @@ define(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'No Line',
|
'name': 'No Line',
|
||||||
'control': 'checkbox',
|
'control': 'radio',
|
||||||
'key': 'noLine'
|
'key': 'noLine'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'Step Line',
|
'name': 'Step Line',
|
||||||
'control': 'checkbox',
|
'control': 'radio',
|
||||||
'key': 'stepLine'
|
'key': 'stepLine'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'Linear Line',
|
'name': 'Linear Line',
|
||||||
'control': 'checkbox',
|
'control': 'radio',
|
||||||
'key': 'linearLine'
|
'key': 'linearLine'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}]},
|
}]
|
||||||
|
},
|
||||||
plotOptionsModel = {};
|
plotOptionsModel = {};
|
||||||
|
|
||||||
$scope.plotOptionsStructure = plotOptionsStructure;
|
/*domainObject.getModel().configuration.plot.xAxis= {
|
||||||
|
'key': 'scet'
|
||||||
|
};
|
||||||
|
|
||||||
|
domainObject.getModel().configuration.plot.yAxis = [{
|
||||||
|
'autoscale': true,
|
||||||
|
'min': 0,
|
||||||
|
'max': 15,
|
||||||
|
'key': 'eu'
|
||||||
|
}];
|
||||||
|
|
||||||
|
domainObject.getModel().configuration.plot.series = [
|
||||||
|
{
|
||||||
|
'id': '',
|
||||||
|
'lineStyle': '',
|
||||||
|
'color': '#aaddaa',
|
||||||
|
'interpolation': 'none'
|
||||||
|
},
|
||||||
|
//etc
|
||||||
|
];*/
|
||||||
|
|
||||||
|
$scope.plotOptionsStructure = plotSeriesForm;
|
||||||
$scope.plotOptionsModel = plotOptionsModel;
|
$scope.plotOptionsModel = plotOptionsModel;
|
||||||
|
|
||||||
$scope.domainObject.useCapability('composition').then(function(children){
|
function updateChildren() {
|
||||||
$scope.children = children;
|
domainObject.useCapability('composition').then(function(children){
|
||||||
|
$scope.children = children;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Listen for changes to the domain object and update the object's
|
||||||
|
children.
|
||||||
|
*/
|
||||||
|
domainObject.getCapability('mutation').listen(function(model) {
|
||||||
|
updateChildren();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateChildren();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user