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 Httpclient_Services, PM_Services, Signature_Services, SRP_Array, Math_Services
Declare function Tool_Class_Services, obj_wo_mat
Declare function SRP_String
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Metrology'
LogDate = Oconv(Date(), 'D4/')
@ -181,6 +182,206 @@ Service LaunchMetrologyViewer
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
//
@ -197,28 +398,37 @@ Service ImportMetrologyFiles(Machine)
Begin Case
Case Machine _EQC 'Tencor'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08DDUPSFS6420\Source\MET08DDUPSFS6420\'
Case Machine _EQC 'HgCV'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08RESIHGCV\Source\MET08RESIHGCV\'
Case Machine _EQC 'CDE'
SearchPattern = '*.pdsf';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08RESIMAPCDE\Source\MET08RESIMAPCDE\'
Case Machine _EQC 'Biorad'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08THFTIRQS408M\Source\MET08THFTIRQS408M\'
Case Machine _EQC 'Stratus'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08THFTIRSTRATUS\Source\MET08THFTIRSTRATUS\'
Case Machine _EQC 'SP1'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08DDUPSP1TBI\Source\MET08DDUPSP1TBI\'
Case Machine _EQC 'SPV'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08RESISRP2100\Source\MET08RESISRP2100\'
Case Machine _EQC 'SRP'
SearchPattern = '*.txt';
DataPath = Environment_Services('GetApplicationRootPath') : '\Metrology\MET08ANLYSDIFAAST230\Source\MET08ANLYSDIFAAST230\'
Case Otherwise$
SearchPattern = '*.txt';
Error_Services('Add', 'Error in ':Service:' service. Unsupported Machine "':Machine:'" passed into service')
End Case
If Error_Services('NoError') then
InitDir DataPath:'*.txt'
InitDir DataPath:SearchPattern
FileList = DirList()
FileNames = ''
LOOP
@ -272,7 +482,6 @@ Service ImportMetrologyFiles(Machine)
ImportStartTime = Time()
OSREAD RunData FROM DataPath:FileName THEN
Metrology_Services('LogResults', '', Machine, 'UID000', 'Read : ' : FileName : ', Size : ' : FileSize)
// Copy Run Data files to repository for troubleshooting purposes
@ -295,15 +504,20 @@ Service ImportMetrologyFiles(Machine)
RepoPath = Environment_Services('GetApplicationRootPath') : '\Metrology\Run Data Repository\MET08ANLYSDIFAAST230\Source\MET08ANLYSDIFAAST230\'
End Case
Set_Status(0)
OSWrite RunData to RepoPath:FileName
status_code = ''
If Get_Status(status_code) then
ErrorMessage = 'Error writing run data file to repository: status_code = ' : status_code
Metrology_Services('LogResults', '', Machine, 'UID001', Service : ' : ' : ErrorMessage)
Set_Status(0)
end
IF SearchPattern = '*.pdsf' THEN
OSREAD Text FROM DataPath:FileName THEN
json = Metrology_Services('GetJsonFromProcessDataStandardFormat', Text);
END ELSE
json = '';
END
IF LEN(json) GT 0 THEN
RunData = Metrology_Services('GetRunData', Machine, json);
END ELSE
Metrology_Services('LogResults', PSN, Machine, 'UID002', Service : ' : ' : 'Failed to get PDSF json');
END
END ELSE
OSREAD RunData FROM DataPath:FileName THEN
SWAP '|' WITH @VM IN RunData
SWAP CRLF$ WITH @FM IN RunData
@ -312,12 +526,22 @@ Service ImportMetrologyFiles(Machine)
UNTIL LastChar NE @FM
RunData[-1,1] = ''
REPEAT
Convert Tab$ to @FM in RunData
END else
Metrology_Services('LogResults', '', Machine, 'UID001', 'Read : ' : FileName : ', Size : ' : FileSize)
end
END
*************************
* Import metrology data *
*************************
Metrology_Services('ImportMetrologyRunData', RunData, FileName, Machine)
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$
@ -354,10 +578,6 @@ Service ImportMetrologyFiles(Machine)
Database_Services('WriteDataRow', 'SYSLISTS', UCase(Machine):'_METROLOGY_LOG', MetrologyLog, True$)
end
END else
Metrology_Services('LogResults', '', Machine, 'UID001', 'Read : ' : FileName : ', Size : ' : FileSize)
end
Database_Services('WriteDataRow', 'APP_INFO', UCase(Machine):'_FILE_LIST', ImportFileList)
Database_Services('WriteDataRow', 'APP_INFO', UCase(Machine):'_ATTEMPT_COUNTS', ImportAttemptCounts)
Database_Services('WriteDataRow', 'APP_INFO', UCase(Machine):'_ATTEMPT_DTMS', ImportAttemptDTMs)
@ -378,6 +598,43 @@ Service ImportMetrologyFiles(Machine)
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
//
@ -386,35 +643,32 @@ end service
// Imports the metrology run data into the RDS_TEST database table. Returns True$ if successful and False$ if
// 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
// machine.
Begin Case
Case IndexC(RunData, 'Stratus', 1)
Case Machine _EQC 'Stratus'
Metrology_Services('ImportStratusData', RunData)
MachineType@ = 'Stratus'
Case IndexC(RunData, 'Bio-Rad', 1)
Case Machine _EQC 'Biorad'
Metrology_Services('ImportBioRadData', RunData, FileName)
MachineType@ = 'Bio-Rad'
Case IndexC(RunData, 'ResMap', 1) OR IndexC(RunData, 'CDE', 1)
Case Machine _EQC 'CDE'
Metrology_Services('ImportCDEData', RunData, FileName)
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)
MachineType@ = 'HgProbe'
Case IndexC(RunData, 'SP1', 1)
Case Machine _EQC 'SP1'
Metrology_Services('ImportSP1Data', RunData)
MachineType@ = 'SP1'
Case IndexC(RunData, 'TENCOR', 1) OR IndexC(RunData, 'ROTR', 1)
Case Machine _EQC 'Tencor'
Metrology_Services('ImportTencorData', RunData)
MachineType@ = 'TENCOR'
@ -435,11 +689,6 @@ Service ImportMetrologyRunData(RunData, FileName, Machine)
End Case
end else
Error_Services('Add', 'RunData argument was missing')
Metrology_Services('LogResults', '', '', 'UID001', Service : ' : ' : Error_Services('GetMessage'))
end
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
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>
WMOKeyID = RunData<6>