Commit fab2e175fff70d280cca9da0ac3c8d3cc8942a2a

Authored by Benjamin Renard
2 parents 6e20d5d4 2827a1fc

Merge branch 'FER_10663' into develop

js/app/views/PlotComponents/PlotContextManager.js
... ... @@ -144,6 +144,23 @@ Ext.define('amdaPlotComp.PlotContextManager', {
144 144 return isInterval;
145 145 },
146 146  
  147 + getInstantTimePrev :function(context)
  148 + {
  149 + if (!context.success)
  150 + return null;
  151 +
  152 + if(context.page.instantTimeNav)
  153 + return context.page.instantTimeNav.prevTime;
  154 + },
  155 +
  156 + getInstantTimeNext :function(context)
  157 + {
  158 + if (!context.success)
  159 + return null;
  160 +
  161 + if(context.page.instantTimeNav)
  162 + return context.page.instantTimeNav.nextTime;
  163 + },
147 164  
148 165 getPanelAxisById : function(panelContext, axisId)
149 166 {
... ...
js/app/views/PlotComponents/PlotPreviewUI.js
... ... @@ -182,7 +182,8 @@ Ext.define('amdaPlotComp.PlotPreviewUI', {
182 182 }
183 183 }
184 184 });
185   - var topToolbar={
  185 + var topToolbar=
  186 + {
186 187 xtype:'toolbar',
187 188 dock:'top',
188 189 items:[{
... ... @@ -204,14 +205,36 @@ Ext.define('amdaPlotComp.PlotPreviewUI', {
204 205 }
205 206 }
206 207  
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 });
  208 + },'-',
  209 + {
  210 + text: 'Change cut time',
  211 + scope: this,
  212 + handler: function (bt) {
  213 + var newTime = Ext.getCmp('plotPreview-goto-Date' + me.interactiveId).getValue();
  214 + me.panelResultInstance.callInteractivePlot({ 'action': 'instant', 'interactiveId': me.panelResultInstance.interactiveId, 'panelId': me.panelId, 'time': newTime });
  215 + }
  216 + },
  217 + '-',
  218 + {
  219 + xtype:'button',
  220 + text : 'Previous',
  221 + handler: function(){
  222 + var newTime = new Date(amdaPlotComp.PlotContextManager.getInstantTimePrev(me.crtContext)*1000);
  223 + newTime = Ext.Date.add(newTime, Ext.Date.MINUTE, newTime.getTimezoneOffset());
  224 + Ext.getCmp('plotPreview-goto-Date' + me.interactiveId).setValue(newTime);
  225 + me.panelResultInstance.callInteractivePlot({ 'action': 'instant', 'interactiveId': me.panelResultInstance.interactiveId, 'panelId': me.panelId, 'time': newTime });
  226 + }
  227 + },
  228 + {
  229 + xtype:'button',
  230 + text : 'Next',
  231 + handler: function(){
  232 + var newTime = new Date(amdaPlotComp.PlotContextManager.getInstantTimeNext(me.crtContext) *1000);
  233 + newTime = Ext.Date.add(newTime, Ext.Date.MINUTE, newTime.getTimezoneOffset());
  234 + me.panelResultInstance.callInteractivePlot({ 'action': 'instant', 'interactiveId': me.panelResultInstance.interactiveId, 'panelId': me.panelId, 'time': newTime });
  235 + Ext.getCmp('plotPreview-goto-Date' + me.interactiveId).setValue(newTime);
  236 + }
213 237 }
214   - },
215 238 ]
216 239 }
217 240 var mouseToolbar = {
... ...