From 714a34365d578876b009aae78c3cce76870adea2 Mon Sep 17 00:00:00 2001
From: Nicola Vigano <nicola.vigano@esrf.fr>
Date: Fri, 6 Jul 2012 16:17:48 +0000
Subject: [PATCH] OAR: fixed global DB variable in gtForwardSimulate

Signed-off-by: Nicola Vigano <nicola.vigano@esrf.fr>

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@642 4c865b51-4357-4376-afb4-474e03ccb993
---
 5_reconstruction/gtForwardSimulate_v2.m | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/5_reconstruction/gtForwardSimulate_v2.m b/5_reconstruction/gtForwardSimulate_v2.m
index c69bad71..82d6cc6e 100644
--- a/5_reconstruction/gtForwardSimulate_v2.m
+++ b/5_reconstruction/gtForwardSimulate_v2.m
@@ -36,6 +36,11 @@ function out = gtForwardSimulate_v2(first, last, workingdirectory, phaseID, vara
 %     SUB-FUNCTIONS:
 %[sub]- sfGetRoi
 
+if isdeployed
+    global GT_DB
+    global GT_MATLAB_HOME
+    load('workspaceGlobal.mat');
+end
 
 cd(workingdirectory);
 gtDBConnect();
@@ -57,9 +62,6 @@ if ~exist('phaseID','var') || isempty(phaseID)
 end
 
 if isdeployed
-    global GT_DB
-    global GT_MATLAB_HOME
-    load('workspaceGlobal.mat');
     first   = str2double(first);
     last    = str2double(last);
     phaseID = str2double(phaseID);
-- 
GitLab