Attribute VB_Name = "LOOPPROC1" '**************************************************************************************** ' ' File: LOOPPROC.BAS ' ' Author: Roberto Raso ' Date: 24th August 1994 ' '**************************************************************************************** ' ' Purpose: Brief description of module. ' '**************************************************************************************** '**************************************************************************************** ' ' Constant/Global declarations. ' '**************************************************************************************** Const MODULE_NAME = "LOOPPROC.BAS" '**************************************************************************************** ' ' Data type declarations. ' '**************************************************************************************** '*** '*** TIMEWIN *** '*** Type TIMEWIN fStart As Single fEnd As Single End Type '*** '*** RETTIMES '*** Type RETTIMES sSignal As TIMEWIN sBack1 As TIMEWIN sBack2 As TIMEWIN End Type '**************************************************************************************** ' ' Function declarations. ' '**************************************************************************************** Dim hMain As Long Dim lpDataFile As String Dim lpIniFile As String Dim lpSection As String Dim lpRect As RECT Dim lpSpecCombSect As String Dim lpParSetRetWinEntry As String Dim lpRetTimes As RETTIMES '**************************************************************************************** ' ' Process: RetTimesRead ' ' Author: Roberto Raso ' Date: 5th September 1994 ' ' Purpose: Reads the retention time window information ' from the INI file to lpRetTimes. ' ' Return: Void. ' '**************************************************************************************** Sub RetTimesRead(lpParSetSect As String, lpParSetRetTimeEntry As String, lpIniFile As String, lpRetTimes As RETTIMES) Dim awSepPos() As Integer Dim wSep As Integer Dim wNumSeps As Integer Dim lpIniStr As String lpIniStr = GetPrivateProfileStr(lpParSetSect, lpParSetRetTimeEntry, lpIniFile) wNumSeps = CountSeps(lpIniStr, ",", awSepPos()) If wNumSeps = 5 Then lpRetTimes.sSignal.fStart = Val(DirFromPath(lpIniStr, 1, awSepPos())) lpRetTimes.sSignal.fEnd = Val(DirFromPath(lpIniStr, 2, awSepPos())) lpRetTimes.sBack1.fStart = Val(DirFromPath(lpIniStr, 3, awSepPos())) lpRetTimes.sBack1.fEnd = Val(DirFromPath(lpIniStr, 4, awSepPos())) lpRetTimes.sBack2.fStart = Val(DirFromPath(lpIniStr, 5, awSepPos())) lpRetTimes.sBack2.fEnd = Val(DirFromPath(lpIniStr, 6, awSepPos())) End If End Sub '**************************************************************************************** ' ' Process: Main ' ' Author: Roberto Raso ' Date: 24th August 1994 ' ' Purpose: Main process control for SampList. ' Return: Void. ' '**************************************************************************************** Sub Main() Dim sRawFile As VGRAWFILE lpIniFile = App.Path + "\" + App.EXEName + ".INI" frmLoopProc.Caption = App.Title lpSection = "Main" hMain = CLng(frmLoopProc.hWnd) Call ReadWindowLayout(lpIniFile, lpSection, lpRect) If (lpRect.Top > 0) And (lpRect.Left > 0) And (lpRect.Right > 0) And (lpRect.Bottom > 0) Then Call SetWindowLayout(hMain, lpRect) End If If GetSampleListFileVB(sRawFile) <> False Then sRawFile.lpVGFile.dwSize = DmRawScansInFunction(sRawFile) frmLoopProc.lblDataFile = lpDataFile frmLoopProc.Show frmLoopProc.WindowState = 1 Call ProcessDataFile(sRawFile.lpVGFile) frmLoopProc.WindowState = 0 Call GetWindowLayout(hMain, lpRect) Call WriteWindowLayout(lpIniFile, lpSection, lpRect) End If End End Sub '**************************************************************************************** ' ' Process: ProcessDataFile ' ' Author: Roberto Raso ' Date: 24th August 1994 ' ' Purpose: Process a data file. ' Return: Void. ' '**************************************************************************************** Sub ProcessDataFile(sVGFile As VGFILE) Dim nGraphsIni As Integer Dim nGraphs As Integer Dim dwSigStart As Long Dim dwSigEnd As Long Dim dwBack1End As Long Dim dwBack1Start As Long Dim dwBack2Start As Long Dim dwBack2End As Long Dim lpRetTimes As RETTIMES Dim sVGRawFile As VGRAWFILE Dim sDmRawStats As DMRAWSTATS Dim wbPrintMode As Integer Dim strIniFile As String strIniFile = App.Path + "\" + App.EXEName + ".INI" wbPrintMode = GetPrivateProfileInteger("SpecPrint", "PrintMode", strIniFile) sVGRawFile.lpVGFile = sVGFile sVGRawFile.wFunc = 1 'Only function 1 sVGRawFile.wProc = 0 If sVGFile.dwSize > 1 Then 'Not an MCA type function. Call RetTimesRead("SpectrumCombine", "RetWins", lpIniFile, lpRetTimes) dwSigStart = DMVerifyRT(SZToVB(sVGFile.szName), 1, lpRetTimes.sSignal.fStart, sVGRawFile) dwSigEnd = DMVerifyRT(SZToVB(sVGFile.szName), 1, lpRetTimes.sSignal.fEnd, sVGRawFile) dwBack1Start = DMVerifyRT(SZToVB(sVGFile.szName), 1, lpRetTimes.sBack1.fStart, sVGRawFile) dwBack1End = DMVerifyRT(SZToVB(sVGFile.szName), 1, lpRetTimes.sBack1.fEnd, sVGRawFile) dwBack2Start = DMVerifyRT(SZToVB(sVGFile.szName), 1, lpRetTimes.sBack2.fStart, sVGRawFile) dwBack2End = DMVerifyRT(SZToVB(sVGFile.szName), 1, lpRetTimes.sBack2.fEnd, sVGRawFile) If VGRawFileOpen(sVGRawFile, CHRO_OPEN) = False Then Exit Sub End If Call ChroCombineScans(dwSigStart, dwSigEnd, dwBack1Start, dwBack1End, dwBack2Start, dwBack2End, 1, 1) ChroClose ElseIf VGRawFileOpen(sVGRawFile, SPEC_OPEN) = False Then Exit Sub End If Call SpecDisplayDefault(False, True, True) nGraphsIni = SpecGraphs() If DmRawReadScanStatsVB(sVGRawFile, 1, 1, sDmRawStats) <> False Then If sDmRawStats.bContinuum Then SpecSubtract SpecSmooth Call SpecCentroid(True) End If nGraphs = SpecGraphs() Do Until nGraphs = nGraphsIni And nGraphs >= 0 Call SpecRemove(1) nGraphs = SpecGraphs() Loop End If SpecSave Call SpecPrint(wbPrintMode) SpecClose DmRawClose End Sub