diff --git a/js/app/controllers/PlotModule.js b/js/app/controllers/PlotModule.js index 2ca36b4..41f7783 100644 --- a/js/app/controllers/PlotModule.js +++ b/js/app/controllers/PlotModule.js @@ -130,6 +130,14 @@ Ext.define('amdaDesktop.PlotModule', { }); }, + getInteractiveMultiPlotState : function() { + var state = {}; + this.plotResultWindowsManager.each(function (key, value, length) { + state[value.getPanelResult().tabId] = value.getPanelResult().getInteractiveMultiPlotState(); + }); + return state; + }, + getWindowResult: function(winResultId){ if (!this.plotResultWindowsManager.get(winResultId)) return null; return this.plotResultWindowsManager.get(winResultId); diff --git a/js/app/views/PlotTabResultUI.js b/js/app/views/PlotTabResultUI.js index cf10a97..90374e3 100644 --- a/js/app/views/PlotTabResultUI.js +++ b/js/app/views/PlotTabResultUI.js @@ -30,6 +30,7 @@ Ext.define('amdaUI.PlotTabResultUI', { navToolBar : null, isTTNavBar : false, crtTTFileIndex : 0, + disableSynchronize: false, hiddenForm: null, @@ -57,6 +58,10 @@ Ext.define('amdaUI.PlotTabResultUI', { return 'data/'+sessionID +'/RES/'+resultFolder+ '/' + plotFile; }, + getInteractiveMultiPlotState: function() { + return this.multiPlotCheck.getValue(); + }, + toPixelOnSourceImage : function(value) { return value*100/this.sliderPage.getValue(); }, @@ -350,7 +355,9 @@ Ext.define('amdaUI.PlotTabResultUI', { this.updateTimeTableInfo(); + this.disableSynchronize = true; this.multiPlotCheck.setValue(configResult.multiplot); + this.disableSynchronize = false; this.panelImage.setSrc(this.getImageUrl(configResult.folder, configResult.plotFile)); @@ -380,7 +387,11 @@ Ext.define('amdaUI.PlotTabResultUI', { callInteractivePlot : function(obj) { loadMask.show(true); - AmdaAction.interactivePlot(obj, function (result, e) { + + var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id); + var multiPlotState = plotModule.getInteractiveMultiPlotState(); + + AmdaAction.interactivePlot(obj, multiPlotState, function (result, e) { loadMask.hide(); var t = e.getTransaction(); if (e.status) @@ -389,9 +400,7 @@ Ext.define('amdaUI.PlotTabResultUI', { { if (result.success) { - myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id, true, function (module) { - module.updateInteractiveSession(result, false); - }); + plotModule.updateInteractiveSession(result, false); } else myDesktopApp.errorMsg('Interactive action error - '+result.message); @@ -415,7 +424,10 @@ Ext.define('amdaUI.PlotTabResultUI', { boxLabel : 'Linked to Multi Plot Mode', scope: this, handler: function(check, checked) { - } + if (!this.disableSynchronize) + this.callInteractivePlot({'action' : 'synchronize', 'tabId' : this.tabId}); + }, + scope: this }); var commonItemsCfg = [ @@ -658,7 +670,9 @@ Ext.define('amdaUI.PlotTabResultUI', { this.updateTimeTableInfo(); + this.disableSynchronize = true; this.multiPlotCheck.setValue(configResult.multiplot); + this.disableSynchronize = false; var plotResultTabPanelConfig = { preventHeader : true, diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index 20b3271..859196f 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -1257,10 +1257,14 @@ class AmdaAction { return array('success' => true); } - public function interactivePlot($obj) + public function interactivePlot($obj, $multiPlotState) { require_once(INTEGRATION_SRC_DIR."RequestManager.php"); - return $this->executeRequest($obj, FunctionTypeEnumClass::ACTION); + $inputobj = (Object)array( + 'action' => $obj, + 'multiPlotState' => $multiPlotState + ); + return $this->executeRequest($inputobj, FunctionTypeEnumClass::ACTION); } } ?> diff --git a/php/config.php b/php/config.php index b285f47..42a813b 100644 --- a/php/config.php +++ b/php/config.php @@ -379,7 +379,7 @@ $API = array( 'len'=>1 ), 'interactivePlot'=>array( - 'len'=>1 + 'len'=>2 ) ) ) -- libgit2 0.21.2