@echo off
SETLOCAL

rem ======================================================================
rem System specific parameters

set ROOT_ANALYSIS_DIR=C:\DIA_Course\Data\DIA_data
set SKYLINE_RUNNER="C:\Program Files\Skyline-daily\SkylineCmd.exe"
set R_Script="C:\Program Files\R\R-3.5.0\bin\RScript.exe"
set PROCESS_COUNT=2

rem ======================================================================

set BAT_Script="%ROOT_ANALYSIS_DIR%\scripts\SkylineAnalysis.bat"
set LOG="%ROOT_ANALYSIS_DIR%\Import.log"
FOR /F %%A IN ('WMIC OS GET LocalDateTime ^| FINDSTR \.') DO @SET DT=%%A
set LOG_ROLLOVER="%ROOT_ANALYSIS_DIR%\Import_%DT:~0,8%_%DT:~8,6%.log"

if exist %LOG% move %LOG% %LOG_ROLLOVER%

rem Default parameters 10ppm and +/- 5 minutes
call %BAT_Script%  TTOF 6600_64w_ppm10_rt10 10 5 "TTOF_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  QE qep_19w_ppm10_rt10 10 5 "QE_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END

GOTO END

rem Extaction ppm test TTOF
call %BAT_Script%  TTOF 6600_64w_ppm03_rt10 3 5 "TTOF_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  TTOF 6600_64w_ppm05_rt10 5 5 "TTOF_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  TTOF 6600_64w_ppm20_rt10 20 5 "TTOF_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  TTOF 6600_64w_ppm40_rt10 40 5 "TTOF_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  TTOF 6600_64w_ppm100_rt10 100 5 "TTOF_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END

rem Extaction ppm test QE
call %BAT_Script%  QE qep_19w_ppm03_rt10 3 5 "QE_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  QE qep_19w_ppm05_rt10 5 5 "QE_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  QE qep_19w_ppm20_rt10 20 5 "QE_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  QE qep_19w_ppm40_rt10 40 5 "QE_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  QE qep_19w_ppm100_rt10 100 5 "QE_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END

rem Retention time test TTOF
call %BAT_Script%  TTOF 6600_64w_ppm10_rt02 10 1 "TTOF_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  TTOF 6600_64w_ppm10_rt04 10 2 "TTOF_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  TTOF 6600_64w_ppm10_rt20 10 10 "TTOF_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  TTOF 6600_64w_ppm10_rt30 10 15 "TTOF_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  TTOF 6600_64w_ppm10_rt40 10 20 "TTOF_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END

rem Retention time test QE
call %BAT_Script%  QE qep_19w_ppm10_rt02 10 1 "QE_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  QE qep_19w_ppm10_rt04 10 2 "QE_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  QE qep_19w_ppm10_rt20 10 10 "QE_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  QE qep_19w_ppm10_rt30 10 15 "QE_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END
call %BAT_Script%  QE qep_19w_ppm10_rt40 10 20 "QE_DIA_library.sky"
if %ERRORLEVEL% NEQ 0 GOTO END

:END

ENDLOCAL