TabPlotUI.js
3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/**
* Project : AMDA-NG
* Name : TabPlotUI.js
* @class amdaUI.TabPlotUI
* @extends Ext.
* @brief Plot Formular Module UI definition (View)
* @author
* @version $Id: TabPlotUI.js 2622 2014-11-07 14:50:09Z elena $
********************************************************************************
* FT Id : Date : Name - Description
*******************************************************************************
*
*/
Ext.define('amdaUI.TabPlotUI', {
extend: 'Ext.container.Container',
alias: 'widget.tabPlot',
requires: [
'amdaUI.PlotUI',
'amdaModel.PlotParam',
'amdaModel.PlotPanel'
],
constructor: function(config) {
this.init(config);
this.callParent(arguments);
},
getTabPlot: function() {
return 0;
},
addTT : function(newTTName,newTTid){
this.tabPanel.getActiveTab().addTT(newTTName,newTTid);
},
addTTs : function(TTarray) {
// set TTTab
this.tabPanel.getActiveTab().addTTs(TTarray);
},
/**
* Set Start-Stop from parameter info (Local & MyData)
*/
setTimeFromData : function(obj)
{
var dateStart = new Date(obj.start.replace(/[T|Z]/g,' ').replace(/\-/g,'\/'));
var dateStop = new Date(obj.stop.replace(/[T|Z]/g,' ').replace(/\-/g,'\/'));
this.tabPanel.getActiveTab().down('form').getForm().setValues({ startDate : dateStart, stopDate : dateStop });
this.tabPanel.getActiveTab().timeSelector.intervalSel.updateDuration();
},
setObject: function(obj){
this.tabPanel.getActiveTab().object = obj;
this.tabPanel.getActiveTab().loadObject();
},
updateConstruct : function(oldval,newval)
{
Ext.Array.each(this.tabPanel.items.items, function(item){
item.updateConstruct(oldval, newval);
}, this);
},
init : function(config)
{
this.tabPanel = Ext.create('Ext.tab.Panel',{
region: 'center',
layout: { type :'vbox' },
activeTab: 0,
items : [
Ext.create(amdaUI.PlotUI,{title: 'Plot 1', id : 'plot1'}),
Ext.create(amdaUI.PlotUI,{title: 'Plot 2', id : 'plot2'}),
Ext.create(amdaUI.PlotUI,{title: 'Plot 3', id : 'plot3'}),
Ext.create(amdaUI.PlotUI,{title: 'Plot 4', id : 'plot4'}),
Ext.create(amdaUI.PlotUI,{title: 'Plot 5', id : 'plot5'})
]
});
var myConf = {
layout: 'border',
defaults: { layout: 'fit', border: false },
items: [
this.tabPanel,
{
xtype: 'panel', region: 'south',
title: 'Information',
bodyStyle: 'padding:5px',
collapsible: true,
height: 100,
autoHide: false,
iconCls: 'icon-information',
loader: {
autoLoad: true,
url: helpDir+'plotHOWTO'
}
}
]
};
Ext.apply (this , Ext.apply (arguments, myConf));
}
});