Commit 293b4c145e717548e02d2b01aad15d1294691f8d

Authored by elena
2 parents 9d412dda 488b1401

Merge branch 'master' of https://gitlab.irap.omp.eu/CDPP/AMDA_IHM

js/app/controllers/PlotModule.js
... ... @@ -130,6 +130,14 @@ Ext.define('amdaDesktop.PlotModule', {
130 130 });
131 131 },
132 132  
  133 + getInteractiveMultiPlotState : function() {
  134 + var state = {};
  135 + this.plotResultWindowsManager.each(function (key, value, length) {
  136 + state[value.getPanelResult().tabId] = value.getPanelResult().getInteractiveMultiPlotState();
  137 + });
  138 + return state;
  139 + },
  140 +
133 141 getWindowResult: function(winResultId){
134 142 if (!this.plotResultWindowsManager.get(winResultId)) return null;
135 143 return this.plotResultWindowsManager.get(winResultId);
... ...
js/app/views/PlotTabResultUI.js
... ... @@ -30,6 +30,7 @@ Ext.define('amdaUI.PlotTabResultUI', {
30 30 navToolBar : null,
31 31 isTTNavBar : false,
32 32 crtTTFileIndex : 0,
  33 + disableSynchronize: false,
33 34  
34 35 hiddenForm: null,
35 36  
... ... @@ -57,6 +58,10 @@ Ext.define('amdaUI.PlotTabResultUI', {
57 58 return 'data/'+sessionID +'/RES/'+resultFolder+ '/' + plotFile;
58 59 },
59 60  
  61 + getInteractiveMultiPlotState: function() {
  62 + return this.multiPlotCheck.getValue();
  63 + },
  64 +
60 65 toPixelOnSourceImage : function(value) {
61 66 return value*100/this.sliderPage.getValue();
62 67 },
... ... @@ -350,7 +355,9 @@ Ext.define('amdaUI.PlotTabResultUI', {
350 355  
351 356 this.updateTimeTableInfo();
352 357  
  358 + this.disableSynchronize = true;
353 359 this.multiPlotCheck.setValue(configResult.multiplot);
  360 + this.disableSynchronize = false;
354 361  
355 362 this.panelImage.setSrc(this.getImageUrl(configResult.folder, configResult.plotFile));
356 363  
... ... @@ -380,7 +387,11 @@ Ext.define('amdaUI.PlotTabResultUI', {
380 387  
381 388 callInteractivePlot : function(obj) {
382 389 loadMask.show(true);
383   - AmdaAction.interactivePlot(obj, function (result, e) {
  390 +
  391 + var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id);
  392 + var multiPlotState = plotModule.getInteractiveMultiPlotState();
  393 +
  394 + AmdaAction.interactivePlot(obj, multiPlotState, function (result, e) {
384 395 loadMask.hide();
385 396 var t = e.getTransaction();
386 397 if (e.status)
... ... @@ -389,9 +400,7 @@ Ext.define('amdaUI.PlotTabResultUI', {
389 400 {
390 401 if (result.success)
391 402 {
392   - myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id, true, function (module) {
393   - module.updateInteractiveSession(result, false);
394   - });
  403 + plotModule.updateInteractiveSession(result, false);
395 404 }
396 405 else
397 406 myDesktopApp.errorMsg('Interactive action error - '+result.message);
... ... @@ -415,7 +424,10 @@ Ext.define('amdaUI.PlotTabResultUI', {
415 424 boxLabel : 'Linked to Multi Plot Mode',
416 425 scope: this,
417 426 handler: function(check, checked) {
418   - }
  427 + if (!this.disableSynchronize)
  428 + this.callInteractivePlot({'action' : 'synchronize', 'tabId' : this.tabId});
  429 + },
  430 + scope: this
419 431 });
420 432  
421 433 var commonItemsCfg = [
... ... @@ -658,7 +670,9 @@ Ext.define('amdaUI.PlotTabResultUI', {
658 670  
659 671 this.updateTimeTableInfo();
660 672  
  673 + this.disableSynchronize = true;
661 674 this.multiPlotCheck.setValue(configResult.multiplot);
  675 + this.disableSynchronize = false;
662 676  
663 677 var plotResultTabPanelConfig = {
664 678 preventHeader : true,
... ...
php/classes/AmdaAction.php
... ... @@ -1256,10 +1256,14 @@ class AmdaAction {
1256 1256 return array('success' => true);
1257 1257 }
1258 1258  
1259   - public function interactivePlot($obj)
  1259 + public function interactivePlot($obj, $multiPlotState)
1260 1260 {
1261 1261 require_once(INTEGRATION_SRC_DIR."RequestManager.php");
1262   - return $this->executeRequest($obj, FunctionTypeEnumClass::ACTION);
  1262 + $inputobj = (Object)array(
  1263 + 'action' => $obj,
  1264 + 'multiPlotState' => $multiPlotState
  1265 + );
  1266 + return $this->executeRequest($inputobj, FunctionTypeEnumClass::ACTION);
1263 1267 }
1264 1268 }
1265 1269 ?>
... ...
php/config.php
... ... @@ -379,7 +379,7 @@ $API = array(
379 379 'len'=>1
380 380 ),
381 381 'interactivePlot'=>array(
382   - 'len'=>1
  382 + 'len'=>2
383 383 )
384 384 )
385 385 )
... ...