Commit a0db79843cac9a82a584732d82cc2780f8815df7

Authored by Erdogan Furkan
1 parent 1962836b

#10663 - Done

js/app/controllers/PlotModule.js
... ... @@ -22,6 +22,7 @@ Ext.define('amdaDesktop.PlotModule', {
22 22  
23 23 contentId : 'plotUI',
24 24 linkedNode : null,
  25 + panelResultInstance:null,
25 26  
26 27 /**
27 28 * @cfg {String} data models
... ... @@ -53,11 +54,11 @@ Ext.define('amdaDesktop.PlotModule', {
53 54 computePreviewWindowSize : function(previewContent) {
54 55 var size = previewContent.getImageSize();
55 56 size.width += 30;
56   - size.height += 65;
  57 + size.height += 100;
57 58 return size;
58 59 },
59 60  
60   - updateInteractiveSession : function(session, newplot) {
  61 + updateInteractiveSession : function(session, newplot, panelId_, time_) {
61 62 var me = this;
62 63  
63 64  
... ... @@ -71,6 +72,8 @@ Ext.define('amdaDesktop.PlotModule', {
71 72 folder : session.folder,
72 73 plotFile : tabResult.plot,
73 74 context : tabResult.context,
  75 + time : time_,
  76 + panelId : panelId_,
74 77 interactiveId : tabResult.id
75 78 };
76 79 me.updatePreview(plotPreviewConfig);
... ... @@ -99,7 +102,7 @@ Ext.define('amdaDesktop.PlotModule', {
99 102 var y = 100 + tabResult.index * 20;
100 103 //create new result win
101 104 var panelResult = new amdaUI.PlotTabResultUI(plotTabConfig);
102   -
  105 + me.panelResultInstance =panelResult;
103 106 var size = me.computeResultWindowSize(panelResult);
104 107  
105 108 var win = myDesktopApp.getDesktop().createWindow({
... ... @@ -175,7 +178,8 @@ Ext.define('amdaDesktop.PlotModule', {
175 178 if (winPreview == null) {
176 179 //create new preview win
177 180 var previewContent = new amdaPlotComp.PlotPreviewUI(plotPreviewConfig);
178   -
  181 + previewContent.setPanelResultInstance(this.panelResultInstance);
  182 + //previewContent.setPanelId
179 183 var size = this.computePreviewWindowSize(previewContent);
180 184  
181 185 var win = myDesktopApp.getDesktop().createWindow({
... ...
js/app/views/PlotComponents/PlotPreviewUI.js
... ... @@ -19,7 +19,8 @@ Ext.define('amdaPlotComp.PlotPreviewUI', {
19 19  
20 20 requires: [
21 21 'amdaPlotComp.PlotContextManager',
22   - 'amdaPlotComp.PlotResultImage'
  22 + 'amdaPlotComp.PlotResultImage',
  23 + 'amdaUI.PlotTabResultUI'
23 24 ],
24 25  
25 26 panelImage : null,
... ... @@ -27,7 +28,12 @@ Ext.define('amdaPlotComp.PlotPreviewUI', {
27 28 sliderPage : null,
28 29 contextualMenu : null,
29 30 hiddenForm: null,
  31 + panelResultInstance:null,
30 32  
  33 + setPanelResultInstance: function(panelResultInstance_)
  34 + {
  35 + this.panelResultInstance = panelResultInstance_;
  36 + },
31 37 constructor: function(config) {
32 38 this.init(config);
33 39 this.callParent(arguments);
... ... @@ -149,6 +155,8 @@ Ext.define('amdaPlotComp.PlotPreviewUI', {
149 155  
150 156 this.crtContext = configResult.context;
151 157 this.interactiveId = configResult.interactiveId;
  158 + this.time = configResult.time;
  159 + this.panelId= configResult.panelId
152 160  
153 161 this.coordinatesField = new Ext.toolbar.TextItem({
154 162 width: 300,
... ... @@ -174,7 +182,38 @@ Ext.define('amdaPlotComp.PlotPreviewUI', {
174 182 }
175 183 }
176 184 });
177   -
  185 + var topToolbar={
  186 + xtype:'toolbar',
  187 + dock:'top',
  188 + items:[{
  189 + xtype: 'datefield',
  190 + allowBlank:true,
  191 + format: 'Y-m-d\\TH:i:s.u',
  192 + id: 'plotPreview-goto-Date' + this.interactiveId,
  193 + value:this.time,
  194 + width: 175,
  195 + renderer: function (value) {
  196 + if (value != null) {
  197 + if (Ext.isDate(value)) {
  198 + return Ext.Date.format(value, 'Y-m-d\\TH:i:s.u');
  199 + } else {
  200 + return Ext.Date.format(new Date(value), 'Y-m-d\\TH:i:s.u');
  201 + }
  202 + } else {
  203 + return value;
  204 + }
  205 + }
  206 +
  207 + },'-',{
  208 + text: 'Change cut time',
  209 + scope: this,
  210 + handler: function (bt) {
  211 + var newTime = Ext.getCmp('plotPreview-goto-Date' + me.interactiveId).getValue()
  212 + me.panelResultInstance.callInteractivePlot({ 'action': 'instant', 'interactiveId': me.panelResultInstance.interactiveId, 'panelId': me.panelId, 'time': newTime });
  213 + }
  214 + },
  215 + ]
  216 + }
178 217 var mouseToolbar = {
179 218 xtype: 'toolbar',
180 219 height: 25,
... ... @@ -223,11 +262,11 @@ Ext.define('amdaPlotComp.PlotPreviewUI', {
223 262  
224 263 var plotPreviewPanelConfig = {
225 264 preventHeader : true,
226   - autoScroll: true,
  265 + autoScroll: false,
227 266 items: [
228 267 this.createPlotImage(configResult.folder, configResult.plotFile)
229 268 ],
230   - dockedItems: [mouseToolbar]
  269 + dockedItems: [topToolbar,mouseToolbar]
231 270 };
232 271  
233 272 Ext.apply(this , plotPreviewPanelConfig);
... ...
js/app/views/PlotTabResultUI.js
... ... @@ -464,7 +464,7 @@ Ext.define('amdaUI.PlotTabResultUI', {
464 464 if (e.status) {
465 465 if (result) {
466 466 if (result.success) {
467   - plotModule.updateInteractiveSession(result, false);
  467 + plotModule.updateInteractiveSession(result, false, obj['panelId'], obj['time']);
468 468 }
469 469 else
470 470 myDesktopApp.errorMsg('Interactive action error - ' + result.message);
... ...