summaryrefslogtreecommitdiff
path: root/macros/LaunchMultiRunSCI2C.sci
blob: 307e4f4261bd99c60ff0bba8a5499d38a37e3979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Before launching this script, please
// check all the paths below.
// User should change parameters only in (USER PARAMETERS) sections.
// cd C:\Nutricato\OpenProjects\FP6_hArtes\WP2_SCI2C\Software\Scilab2C; exec LaunchMultiRunSCI2C.sci

function LaunchMultiRunSCI2C()
// --- CLEAN WORKSPACE ---
//exec full_reset.sce;
//mode(-1);

// --- GENERAL SETTINGS (USER PARAMETERS) ---
RunsDirectory         = pwd(); // Path of the SCI2CRuns directory
SCI2CDirectory        = 'D:\Nutricato_GAPSVN\PROGETTI_APERTI\POLIBA\hArtes\WP2_SCI2C\Software\Version_alpha\Scilab2C'; // Path of the Scilab2C directory

// --- SPECIFIC SETTINGS (USER PARAMETERS) ---
FullListSCI2CInputPrmFiles = ...
   [...
      'D:\Nutricato_GAPSVN\PROGETTI_APERTI\POLIBA\hArtes\WP2_SCI2C\Software\Version_alpha\SCI2CTests\test999_WorkingDir\SCI2CInputParameters.sce';...
   ];
WorkingListSCI2CInputPrmFiles = ...
   [...
      'D:\Nutricato_GAPSVN\PROGETTI_APERTI\POLIBA\hArtes\WP2_SCI2C\Software\Version_alpha\SCI2CTests\test999_WorkingDir\SCI2CInputParameters.sce';...
   ];

// Select one of the two lists above.

ListSCI2CInputPrmFiles = WorkingListSCI2CInputPrmFiles;
//ListSCI2CInputPrmFiles = FullListSCI2CInputPrmFiles;

// ================================
// ================================
// ================================
// ================================

// --- LAUNCH MULTIRUNSCI2C ---
NTranslations = size(ListSCI2CInputPrmFiles,1);
for cnttransl = 1:NTranslations
   cd(SCI2CDirectory);

   SCI2CInputPrmFileName = ListSCI2CInputPrmFiles(cnttransl);

   // --- LAUNCH USER SCI CODE TO TEST IT BEFORE TRANSLATING IT!!! ---
   cd(SCI2CDirectory)
   getf("runscicode.sci");
   runscicode(SCI2CInputPrmFileName);

   // --- ASK USER FOR CONTINUATION. ---
   userchoice = input('Start translation [y/n]?','s');
   if (userchoice == 'y')

      // --- LAUNCH SCI2C ---
      cd(SCI2CDirectory)
      getf("runsci2c.sci");
      runsci2c(SCI2CInputPrmFileName);
      cd(SCI2CDirectory)
   else
   end
end

// ----------------------------------------
// --- Compile and Launch all the code. ---
// ----------------------------------------
// This option is available only for regression tests.
if (1==1)
   cd(fullfile(SCI2CDirectory,'ToolInitialization'));
   exec('INIT_SCI2CLoader.sce');

   PrintStepInfo('Generate Script for Regression Tests...Available only for Debug.','','both');
   C_GenerateLaunchScript('D:\Nutricato\OpenProjects\FP6_hArtes\WP2_SCI2C\Software\SCI2CTests\RegressionTests',ListSCI2CInputPrmFiles);
end

// ---------------------------------------
// --- Go back to the start directory. ---
// ---------------------------------------
cd (RunsDirectory);

// ------------------------
// --- Close all files. ---
// ------------------------
// --- This must be the last instruction. ---
mclose('all');
endfunction