EpnTapModule.js
2.37 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
/**
* Project : AMDA-NG
* Name : EpnTapModule.js
* @class amdaDesktop.EpnTapModule
* @extends amdaDesktop.AmdaModule
* @brief EpnTap Module controller definition
* @author Nathanael Jourdane
*/
function onWindowLoaded() {
}
function onSearchBtnClicked() {
var targetName = Ext.getCmp('targetNameCB').value;
var productType = Ext.getCmp('productTypeCB').value;
var startTime = Ext.getCmp('startTimeDF').rawValue;
var stopTime = Ext.getCmp('stopTimeDF').rawValue;
for(let service of Ext.getCmp('servicesPanel').getStore().getRange()) {
var filter = Array(service.data.table_name, service.data.access_url, targetName, productType, startTime, stopTime);
AmdaAction.epnTapMgr('getServiceNbResults', filter, function(epnTapServices) {
service.set('nb_responses', epnTapServices);
// console.log(epnTapServices[1]);
});
}
}
// var grid = Ext.getCmp('servicesPanel');
// var selection = grid.getSelectionModel();
// access_url = [];
// table_name = [];
// for(i=0 ; i<grid.store.getCount() ; i++) {
// if(selection.isSelected(i)) {
// table_name.push(grid.store.getAt(i).data.table_name);
// access_url.push(grid.store.getAt(i).data.access_url);
// }
//
// }
function onServiceSelected(service) {
var filter = Array(service['table_name'], service['access_url'], Ext.getCmp('targetNameCB').value,
Ext.getCmp('productTypeCB').value, Ext.getCmp('startTimeDF').rawValue, Ext.getCmp('stopTimeDF').rawValue);
AmdaAction.epnTapMgr('getGranules', filter, function(granules) {
console.log(granules);
});
}
function onGranuleSelected(granule) {
console.log('selected granule: ' + granule.target_name);
}
Ext.define('amdaDesktop.EpnTapModule', {
extend: 'amdaDesktop.AmdaModule',
requires: ['amdaUI.EpnTapUI'],
contentId : 'EpnTapUI',
/** The alias name of the module view. */
uiType: 'panelEpnTap',
/** The text displayed on the *help button* tooltip. */
helpTitle: 'Help on EPN-TAP Module',
/** The name of the documentation file related to the module. */
helpFile : 'epnTapHelp',
width : 600,
height: 550,
/** @class Module initialisation. */
init: function() {
this.launcher = {
text: this.title,
iconCls: this.icon,
handler: this.createWindow,
scope: this
};
this.onWindowLoaded = onWindowLoaded;
this.onSearchBtnClicked = onSearchBtnClicked;
this.onGranuleSelected = onGranuleSelected;
this.onServiceSelected = onServiceSelected;
}
});