Merged PR 15667: process-data-standard-format prep without making any changes

process-data-standard-format prep without making any changes
This commit is contained in:
Mike Phares 2025-05-20 21:27:19 +02:00 committed by Ouellette Jonathan (CSC FI SPS MESLEO)
parent ec70fcc80b
commit f4c1a42812

View File

@ -99,6 +99,7 @@ Declare function Work_Order_Services, SRP_JSON, Logging_Services, Environment
Declare function QA_Services, SRP_Join_Arrays, Get_Status, Obj_Clean_Insp, Datetime, SRP_Datetime Declare function QA_Services, SRP_Join_Arrays, Get_Status, Obj_Clean_Insp, Datetime, SRP_Datetime
Declare function Httpclient_Services, PM_Services, Signature_Services, SRP_Array, Math_Services Declare function Httpclient_Services, PM_Services, Signature_Services, SRP_Array, Math_Services
Declare function Tool_Class_Services, obj_wo_mat Declare function Tool_Class_Services, obj_wo_mat
Declare function SRP_String
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Metrology' LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Metrology'
LogDate = Oconv(Date(), 'D4/') LogDate = Oconv(Date(), 'D4/')
@ -181,6 +182,206 @@ Service LaunchMetrologyViewer
end service end service
Service GetJsonFromProcessDataStandardFormat(Text)
json = '';
HeaderId = -1;
SubgroupId = -1;
FoundEndOfFile = False$;
SWAP '|' WITH @VM IN Text;
SWAP CRLF$ WITH @FM IN Text;
LineCount = DCOUNT(Text, @FM);
FOR LineLoopIndex = 1 TO LineCount
Line = Text<LineLoopIndex>;
IF FoundEndOfFile EQ True$ THEN
json = json:Line;
END
IF Line EQ 'EOF' THEN
FoundEndOfFile = True$;
Line = Text<LineLoopIndex - 1>;
Convert Tab$ to @FM IN Line
SWAP '=' WITH @VM IN Line;
SWAP ';' WITH @FM IN Line;
IF Line<2, 1> EQ 'B_HeaderId' THEN
HeaderId = Line<2, 2>
END
IF Line<3, 1> EQ 'B_SubgroupId' THEN
SubgroupId = Line<3, 2>
END
END
NEXT LineLoopIndex
Response = json;
end service
Service GetStratus(Handle)
Result = ''; // Service ImportStratusData(
Offset = 1
FieldPosition = 13
FieldPositionIncrement = 2
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
FOR RecordIndex = 1 TO Result<1, 1>
IF RecordIndex EQ 1 THEN
Result<2> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DateTime'); // Timestamp
Result<3> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].MesEntity'); // Tool
Result<4> = 'FQA Thickness'; // DataType
Result<5> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Employee'); // Operator
Result<6> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Recipe'); // Recipe
Result<7> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Reactor'); // Reactor
Result<8> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RDS'); // RDSNo
Result<9> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].PSN'); // PSN
Result<10> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Batch'); // BatchID
Result<11> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Cassette'); // Cassette
Result<12> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].GradeMean'); // ThickAvg
END
ForOffset = (RecordIndex - 1) * FieldPositionIncrement;
Result<FieldPosition + ForOffset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Slot'); // Position
Result<FieldPosition + ForOffset + Offset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Mean'); // DataPoint
NEXT RecordIndex
Response = Result;
end service
Service GetBioRad(Handle)
Result = ''; // Service ImportBioRadData(
Offset = 1
FieldPosition = 13
FieldPositionIncrement = 2
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
FOR RecordIndex = 1 TO Result<1, 1>
IF RecordIndex EQ 1 THEN
Result<2> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DateTime'); // TimeStamp
Result<4> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Recipe'); // ScanRecipe
Result<5> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Reactor'); // ReactorID
Result<5> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Reactor'); // ToolID
Result<6> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RDS'); // RDSKeyID
Result<7> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].PSN'); // PSN
Result<8> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Layer'); // RunDataLayer
Result<9> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Zone'); // RunDataZone
Result<11> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Wafer'); // DataSlotId
END
ForOffset = (RecordIndex - 1) * FieldPositionIncrement;
Result<FieldPosition + ForOffset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Position'); // Position
Result<FieldPosition + ForOffset + Offset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Thickness'); // DataPoint
NEXT RecordIndex
Response = Result;
end service
Service GetCDE(Handle)
Result = ''; // Service ImportCDEData(
Offset = 3
FieldPosition = 23
FieldPositionIncrement = 5
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
FOR RecordIndex = 1 TO Result<1, 1>
IF RecordIndex EQ 1 THEN
Result<3> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Date'); // Timestamp
Result<5> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RecipeName'); // ScanRecip
Result<6> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Reactor'); // ReactorID
Result<7> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RDS'); // RDSKeyID
Result<8> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].PSN'); // PSN
Result<9> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Layer'); // RunDataLayer
Result<10> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Zone'); // RunDataZo
END
ForOffset = (RecordIndex - 1) * FieldPositionIncrement;
Result<FieldPosition + ForOffset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].InferredPoint'); // Position
Result<FieldPosition + ForOffset + Offset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Data'); // DataPoint
Result<FieldPosition + ForOffset + FieldPositionIncrement - 1> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].MeritGOF'); // N/A
NEXT RecordIndex
Response = Result;
end service
Service GetHgCV(Handle)
Result = ''; // Service ImportHgCVData(
Offset = 5
PhaseOffset = 7
FieldPosition = 53
FieldPositionIncrement = 9
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
FOR RecordIndex = 1 TO Result<1, 1>
IF RecordIndex EQ 1 THEN
Result<2> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].MesEntity'); // ToolID
Result<3> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Reactor'); // ReactorID
Result<4> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RDS'); // RDSKeyID
Result<5> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].PSN'); // PSN
Result<8> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Wafer'); // LayerZonePair
Result<11> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Date'); // Timestamp
END
ForOffset = (RecordIndex - 1) * FieldPositionIncrement;
Result<FieldPosition + ForOffset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Site'); // Position
Result<FieldPosition + ForOffset + Offset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RhoAvg'); // HgCVDataPoint
Result<FieldPosition + ForOffset + PhaseOffset> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Phase'); // PhaseDataPoint
Result<FieldPosition + ForOffset + FieldPositionIncrement - 1> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Grade'); // N/A
NEXT RecordIndex
Response = Result;
end service
Service GetTencor(Handle)
Result = ''; // Service ImportTencorData(
Result<1, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<1, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<1, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<1, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
FOR RecordIndex = 1 TO Result<1, 1>
IF RecordIndex EQ 1 THEN
Result<9> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Date'); // Timestamp
Result<10> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].HazeAverageAvg'); // HazeAvg
Result<28> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RDS'); // RDSKeyID
Result<30> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].WaferRecipe'); // ScanRecipe
Result<39> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].SumOfDefectsAvg'); // SoDAvg
Result<40> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].SumOfDefectsMax'); // SoDMax
Result<41> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].SumOfDefectsMin'); // SoDMin
Result<43> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].MesEntity'); // ScanTool
END
NEXT RecordIndex
Response = Result;
end service
Service GetSP1(Handle)
Result = ''; // Service ImportSP1Data(
Result<5, 1> = SRP_JSON(Handle, 'GETVALUE', 'Count');
Result<5, 2> = SRP_JSON(Handle, 'GETVALUE', 'Sequence');
Result<5, 3> = SRP_JSON(Handle, 'GETVALUE', 'HeaderId');
Result<5, 4> = SRP_JSON(Handle, 'GETVALUE', 'SubgroupId');
FOR RecordIndex = 1 TO Result<5, 1>
IF RecordIndex EQ 1 THEN
Result<9> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Date'); // Timestamp
Result<10> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnHazeAvgMean'); // HazeAvg
Result<28> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].RDS'); // RDSKeyID
Result<30> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].Session'); // ScanRecipe
IsMisfit = IndexC(Result<30>, 'MISFIT', 1)
IF IsMisfit THEN
Result<3> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMean'); // SoDAvg
Result<2> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMax'); // SoDMax
Result<1> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMin'); // SoDMin
END ELSE
Result<39> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMean'); // SoDAvg
Result<40> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMax'); // SoDMax
Result<41> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAllMin'); // SoDMin
END
Result<43> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].MesEntity'); // ScanTool
Result<44> = SRP_JSON(Handle, 'GETVALUE', 'Records[':RecordIndex:'].DcnAreaMean'); // DCNMM2
END
NEXT RecordIndex
Response = Result;
end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
// ImportMetrologyFiles // ImportMetrologyFiles
// //
@ -197,28 +398,37 @@ Service ImportMetrologyFiles(Machine)
Begin Case Begin Case
Case Machine _EQC 'Tencor' Case Machine _EQC 'Tencor'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08DDUPSFS6420\Source\MET08DDUPSFS6420\' DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08DDUPSFS6420\Source\MET08DDUPSFS6420\'
Case Machine _EQC 'HgCV' Case Machine _EQC 'HgCV'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08RESIHGCV\Source\MET08RESIHGCV\' DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08RESIHGCV\Source\MET08RESIHGCV\'
Case Machine _EQC 'CDE' Case Machine _EQC 'CDE'
SearchPattern = '*.pdsf';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08RESIMAPCDE\Source\MET08RESIMAPCDE\' DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08RESIMAPCDE\Source\MET08RESIMAPCDE\'
Case Machine _EQC 'Biorad' Case Machine _EQC 'Biorad'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08THFTIRQS408M\Source\MET08THFTIRQS408M\' DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08THFTIRQS408M\Source\MET08THFTIRQS408M\'
Case Machine _EQC 'Stratus' Case Machine _EQC 'Stratus'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08THFTIRSTRATUS\Source\MET08THFTIRSTRATUS\' DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08THFTIRSTRATUS\Source\MET08THFTIRSTRATUS\'
Case Machine _EQC 'SP1' Case Machine _EQC 'SP1'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08DDUPSP1TBI\Source\MET08DDUPSP1TBI\' DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08DDUPSP1TBI\Source\MET08DDUPSP1TBI\'
Case Machine _EQC 'SPV' Case Machine _EQC 'SPV'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08RESISRP2100\Source\MET08RESISRP2100\' DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08RESISRP2100\Source\MET08RESISRP2100\'
Case Machine _EQC 'SRP' Case Machine _EQC 'SRP'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08ANLYSDIFAAST230\Source\MET08ANLYSDIFAAST230\' DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08ANLYSDIFAAST230\Source\MET08ANLYSDIFAAST230\'
Case Otherwise$ Case Otherwise$
SearchPattern = '*.txt';
Error_Services('Add', 'Error in ':Service:' service. Unsupported Machine "':Machine:'" passed into service') Error_Services('Add', 'Error in ':Service:' service. Unsupported Machine "':Machine:'" passed into service')
End Case End Case
If Error_Services('NoError') then If Error_Services('NoError') then
InitDir DataPath:'*.txt' InitDir DataPath:SearchPattern
FileList = DirList() FileList = DirList()
FileNames = '' FileNames = ''
LOOP LOOP
@ -272,90 +482,100 @@ Service ImportMetrologyFiles(Machine)
ImportStartTime = Time() ImportStartTime = Time()
OSREAD RunData FROM DataPath:FileName THEN Metrology_Services('LogResults', '', Machine, 'UID000', 'Read : ' : FileName : ', Size : ' : FileSize)
Metrology_Services('LogResults', '', Machine, 'UID000', 'Read : ' : FileName : ', Size : ' : FileSize)
// Copy Run Data files to repository for troubleshooting purposes // Copy Run Data files to repository for troubleshooting purposes
Begin Case Begin Case
Case Machine _EQC 'Tencor' Case Machine _EQC 'Tencor'
RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08DDUPSFS6420\Source\MET08DDUPSFS6420\' RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08DDUPSFS6420\Source\MET08DDUPSFS6420\'
Case Machine _EQC 'HgCV' Case Machine _EQC 'HgCV'
RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08RESIHGCV\Source\MET08RESIHGCV\' RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08RESIHGCV\Source\MET08RESIHGCV\'
Case Machine _EQC 'CDE' Case Machine _EQC 'CDE'
RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08RESIMAPCDE\Source\MET08RESIMAPCDE\' RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08RESIMAPCDE\Source\MET08RESIMAPCDE\'
Case Machine _EQC 'Biorad' Case Machine _EQC 'Biorad'
RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08THFTIRQS408M\Source\MET08THFTIRQS408M\' RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08THFTIRQS408M\Source\MET08THFTIRQS408M\'
Case Machine _EQC 'Stratus' Case Machine _EQC 'Stratus'
RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08THFTIRSTRATUS\Source\MET08THFTIRSTRATUS\' RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08THFTIRSTRATUS\Source\MET08THFTIRSTRATUS\'
Case Machine _EQC 'SP1' Case Machine _EQC 'SP1'
RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08DDUPSP1TBI\Source\MET08DDUPSP1TBI\' RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08DDUPSP1TBI\Source\MET08DDUPSP1TBI\'
Case Machine _EQC 'SPV' Case Machine _EQC 'SPV'
RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08RESISRP2100\Source\MET08RESISRP2100\' RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08RESISRP2100\Source\MET08RESISRP2100\'
Case Machine _EQC 'SRP' Case Machine _EQC 'SRP'
RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08ANLYSDIFAAST230\Source\MET08ANLYSDIFAAST230\' RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08ANLYSDIFAAST230\Source\MET08ANLYSDIFAAST230\'
End Case End Case
Set_Status(0) IF SearchPattern = '*.pdsf' THEN
OSWrite RunData to RepoPath:FileName OSREAD Text FROM DataPath:FileName THEN
status_code = '' json = Metrology_Services('GetJsonFromProcessDataStandardFormat', Text);
If Get_Status(status_code) then END ELSE
ErrorMessage = 'Error writing run data file to repository: status_code = ' : status_code json = '';
Metrology_Services('LogResults', '', Machine, 'UID001', Service : ' : ' : ErrorMessage) END
Set_Status(0) IF LEN(json) GT 0 THEN
end RunData = Metrology_Services('GetRunData', Machine, json);
END ELSE
Metrology_Services('LogResults', PSN, Machine, 'UID002', Service : ' : ' : 'Failed to get PDSF json');
END
END ELSE
SWAP '|' WITH @VM IN RunData OSREAD RunData FROM DataPath:FileName THEN
SWAP CRLF$ WITH @FM IN RunData SWAP '|' WITH @VM IN RunData
SWAP CRLF$ WITH @FM IN RunData
LOOP LOOP
LastChar = RunData[-1,1] LastChar = RunData[-1,1]
UNTIL LastChar NE @FM UNTIL LastChar NE @FM
RunData[-1,1] = '' RunData[-1,1] = ''
REPEAT REPEAT
Convert Tab$ to @FM in RunData
*************************
* Import metrology data *
*************************
Metrology_Services('ImportMetrologyRunData', RunData, FileName, Machine)
If Error_Services('NoError') then
Continue = True$
end else
ErrorMessage = Error_Services('GetMessage')
FQAError = IndexC(ErrorMessage, 'FQA has already been signed', 1)
If ( Index(ErrorMessage, 'UID002', 1) and (ImportAttempts LE RETRY_ATTEMPTS$) and Not(FQAError) ) then
Continue = False$
end else
Continue = True$
end
end
******************************
* Delete metrology data file *
******************************
If (Continue) then
Status() = 0
OSDELETE DataPath:FileName ;* Deletes local copy of data file
ImportFileList = Delete(ImportFileList, FilePos, 0, 0)
ImportAttemptCounts = Delete(ImportAttemptCounts, FilePos, 0, 0)
ImportAttemptDTMs = Delete(ImportAttemptDTMs, FilePos, 0, 0)
ErrCode = Status()
If ErrCode EQ 0 then
Metrology_Services('LogResults', '', Machine, 'UID000', 'Delete : ' : FileName : ', Size : ' : FileSize)
end else
Metrology_Services('LogResults', '', Machine, 'UID001', 'Delete : ' : FileName : ', Size : ' : FileSize : ', Error : ' : ErrCode)
end
END else END else
Metrology_Services('LogResults', '', Machine, 'UID001', 'Read : ' : FileName : ', Size : ' : FileSize)
ErrorMessage = Error_Services('GetMessage')
MetrologyLog = Database_Services('ReadDataRow', 'SYSLISTS', UCase(Machine):'_METROLOGY_LOG')
MetrologyLog := ErrorMessage : @FM
Database_Services('WriteDataRow', 'SYSLISTS', UCase(Machine):'_METROLOGY_LOG', MetrologyLog, True$)
end end
END
*************************
* Import metrology data *
*************************
IF RunData NE '' then
Metrology_Services('ImportMetrologyRunData', Machine, DataPath, FileName, RunData)
END ELSE
Error_Services('Add', 'RunData argument was missing')
Metrology_Services('LogResults', '', '', 'UID001', Service : ' : ' : Error_Services('GetMessage'))
END
If Error_Services('NoError') then
Continue = True$
end else
ErrorMessage = Error_Services('GetMessage')
FQAError = IndexC(ErrorMessage, 'FQA has already been signed', 1)
If ( Index(ErrorMessage, 'UID002', 1) and (ImportAttempts LE RETRY_ATTEMPTS$) and Not(FQAError) ) then
Continue = False$
end else
Continue = True$
end
end
******************************
* Delete metrology data file *
******************************
If (Continue) then
Status() = 0
OSDELETE DataPath:FileName ;* Deletes local copy of data file
ImportFileList = Delete(ImportFileList, FilePos, 0, 0)
ImportAttemptCounts = Delete(ImportAttemptCounts, FilePos, 0, 0)
ImportAttemptDTMs = Delete(ImportAttemptDTMs, FilePos, 0, 0)
ErrCode = Status()
If ErrCode EQ 0 then
Metrology_Services('LogResults', '', Machine, 'UID000', 'Delete : ' : FileName : ', Size : ' : FileSize)
end else
Metrology_Services('LogResults', '', Machine, 'UID001', 'Delete : ' : FileName : ', Size : ' : FileSize : ', Error : ' : ErrCode)
end
END else END else
Metrology_Services('LogResults', '', Machine, 'UID001', 'Read : ' : FileName : ', Size : ' : FileSize)
ErrorMessage = Error_Services('GetMessage')
MetrologyLog = Database_Services('ReadDataRow', 'SYSLISTS', UCase(Machine):'_METROLOGY_LOG')
MetrologyLog := ErrorMessage : @FM
Database_Services('WriteDataRow', 'SYSLISTS', UCase(Machine):'_METROLOGY_LOG', MetrologyLog, True$)
end end
Database_Services('WriteDataRow', 'APP_INFO', UCase(Machine):'_FILE_LIST', ImportFileList) Database_Services('WriteDataRow', 'APP_INFO', UCase(Machine):'_FILE_LIST', ImportFileList)
@ -378,6 +598,43 @@ Service ImportMetrologyFiles(Machine)
end service end service
Service GetRunData(Machine, json)
Result = '';
Handle = '';
If Assigned(Handle) else Handle = 0
If Handle LE 0 then
ParseError = SRP_JSON(Handle, 'PARSE', json);
IF ParseError EQ '' THEN
Begin Case
Case Machine _EQC 'Stratus'
Result = Metrology_Services('GetStratus', Handle);
Case Machine _EQC 'Biorad'
Result = Metrology_Services('GetBiorad', Handle);
Case Machine _EQC 'CDE'
Result = Metrology_Services('GetCDE', Handle);
Case Machine _EQC 'HgCV'
Result = Metrology_Services('GetHgCV', Handle);
Case Machine _EQC 'SP1'
Result = Metrology_Services('GetSP1', Handle);
Case Machine _EQC 'Tencor'
Result = Metrology_Services('GetTencor', Handle);
End Case
SRP_JSON(Handle, 'RELEASE');
END ELSE
Metrology_Services('LogResults', PSN, Machine, 'UID002', Service : ' : ' : 'Failed to parse PDSF json');
END
END
Response = Result;
end service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
// ImportMetrologyRunData // ImportMetrologyRunData
// //
@ -386,35 +643,32 @@ end service
// Imports the metrology run data into the RDS_TEST database table. Returns True$ if successful and False$ if // Imports the metrology run data into the RDS_TEST database table. Returns True$ if successful and False$ if
// unsuccessful. // unsuccessful.
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service ImportMetrologyRunData(RunData, FileName, Machine) Service ImportMetrologyRunData(Machine, DataPath, FileName, RunData)
If RunData NE '' then
Convert Tab$ to @FM in RunData
// Scan the run data for machine specific information. Then call the relevant update service for the specific // Scan the run data for machine specific information. Then call the relevant update service for the specific
// machine. // machine.
Begin Case Begin Case
Case IndexC(RunData, 'Stratus', 1) Case Machine _EQC 'Stratus'
Metrology_Services('ImportStratusData', RunData) Metrology_Services('ImportStratusData', RunData)
MachineType@ = 'Stratus' MachineType@ = 'Stratus'
Case IndexC(RunData, 'Bio-Rad', 1) Case Machine _EQC 'Biorad'
Metrology_Services('ImportBioRadData', RunData, FileName) Metrology_Services('ImportBioRadData', RunData, FileName)
MachineType@ = 'Bio-Rad' MachineType@ = 'Bio-Rad'
Case IndexC(RunData, 'ResMap', 1) OR IndexC(RunData, 'CDE', 1) Case Machine _EQC 'CDE'
Metrology_Services('ImportCDEData', RunData, FileName) Metrology_Services('ImportCDEData', RunData, FileName)
MachineType@ = 'CDE' MachineType@ = 'CDE'
Case IndexC(RunData, 'PROBE', 1) OR IndexC(RunData, 'HgProbe', 1) OR IndexC(RunData, 'HGCV', 1) Case Machine _EQC 'HgCV'
Metrology_Services('ImportHgCVData', RunData, FileName) Metrology_Services('ImportHgCVData', RunData, FileName)
MachineType@ = 'HgProbe' MachineType@ = 'HgProbe'
Case IndexC(RunData, 'SP1', 1) Case Machine _EQC 'SP1'
Metrology_Services('ImportSP1Data', RunData) Metrology_Services('ImportSP1Data', RunData)
MachineType@ = 'SP1' MachineType@ = 'SP1'
Case IndexC(RunData, 'TENCOR', 1) OR IndexC(RunData, 'ROTR', 1) Case Machine _EQC 'Tencor'
Metrology_Services('ImportTencorData', RunData) Metrology_Services('ImportTencorData', RunData)
MachineType@ = 'TENCOR' MachineType@ = 'TENCOR'
@ -433,12 +687,7 @@ Service ImportMetrologyRunData(RunData, FileName, Machine)
Metrology_Services('LogResults', '', '', 'UID001', Service : ' : ' : Error_Services('GetMessage')) Metrology_Services('LogResults', '', '', 'UID001', Service : ' : ' : Error_Services('GetMessage'))
MachineType@ = 'Unrecognized' MachineType@ = 'Unrecognized'
End Case End Case
end else
Error_Services('Add', 'RunData argument was missing')
Metrology_Services('LogResults', '', '', 'UID001', Service : ' : ' : Error_Services('GetMessage'))
end
end service end service
@ -2247,7 +2496,7 @@ The service does the following actions:
5. Determines the spec slot by reading the WO_MAT_QA record -> SLOT field 5. Determines the spec slot by reading the WO_MAT_QA record -> SLOT field
6. If the detected RunDataSlot matches the spec slot, writes the datapoint to the WO_MAT_QA record - > RESULT field in the same @VM that the iterator is currently set to. 6. If the detected RunDataSlot matches the spec slot, writes the datapoint to the WO_MAT_QA record - > RESULT field in the same @VM that the iterator is currently set to.
*/ */
Service ImportBioRadEPPFQAData(RunData) Service ImportBioRadEPPFQAData(RunData, FileName)
Timestamp = RunData<2> Timestamp = RunData<2>
WMOKeyID = RunData<6> WMOKeyID = RunData<6>