Added in functionality for TW WIP Reporting

Refactored error logging and catching.
This commit is contained in:
Infineon\Ouellette 2024-10-31 08:13:46 -07:00 committed by Ouellette Jonathan (CSC FI SPS MESLEO)
parent 0ec0428f19
commit 508707f0f2
6 changed files with 478 additions and 104 deletions

View File

@ -2,15 +2,32 @@ Compile function Lot_Services(@Service, @Params)
#pragma precomp SRP_PreCompiler
Declare function TEST_WAFER_PROD_SERVICES, SRP_Datetime, Datetime, Database_Services, Lot_Services, Error_Services, RTI_CREATEGUID
Declare function SRP_Array, SRP_Json
Declare subroutine Database_Services, Btree.Extract, Lot_Services, Error_Services, Labeling_Services, SRP_Json
$insert LOGICAL
Declare function SRP_Array, SRP_Json, Environment_Services, Logging_Services
Declare subroutine Database_Services, Btree.Extract, Lot_Services, Error_Services, Labeling_Services, SRP_Json, Logging_Services
$insert APP_INSERTS
$Insert LOT_EQUATES
$Insert TEST_WAFER_PROD_EQUATES
$Insert Lot_Operation_Equates
$Insert PRODUCT_OPERATION_EQUATES
$Insert LOT_EVENT_EQUATES
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Lot'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' TestWaferLotCreation.csv'
Headers = 'Logging DTM' : @FM : 'Product Name' : @FM : 'Username' : @FM : 'Message'
objTWCreationLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' LotMove.csv'
Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Username' : @FM : 'Message'
objLotMoveLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' LotEvent.csv'
Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Event Type' : @FM : 'Operator' : @FM : 'Begin Wafer Qty' : @FM : 'End Wafer Qty' : @FM : 'Bonus Wafer Qty' : @FM : 'Reduce Wafer Qty' : @FM : 'Message'
objLotEventLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
Options EVENT_TYPES = 'MOVE_IN', 'MOVE_OUT', 'HOLD_ON', 'HOLD_OFF', 'REDUCE_WAFER_QTY', 'BONUS_WAFER_QTY', 'COMMENT', 'LOCATION'
Options LOT_TYPES = 'TW', 'RDS', 'WM_OUT', 'WM_IN'
@ -96,35 +113,56 @@ Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLot
ThisLotCurrOpId = Lot_Services('GetLotCurrOperation', CreatedLotNumber)
If ThisLotCurrOpId NE '' then
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
if Error_Services('NoError') then
//Set lot to open
Lot_Services('OpenLot', CreatedLotNumber)
if Error_Services('NoError') then
If PrinterID NE 'WEB' then
//If PrinterID is set to WEB this means the request comes from OI_Wizard and the client is going to handle printing.
Labeling_Services('PrintTestWaferLotLabel', CreatedLotNumber, Username, PrinterID)
If Error_Services('HasError') then
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : CreatedLotNumber : ' , ' : Error_Services('GetMessage')
end
end
Lot_Services('MoveOutLot', NewLotId, LotQty, Username)
If Error_Services('NoError') then
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
end else
//Error: Error getting current operation
If Error_Services('HasError') then
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
end
end else
//Error: Failed to initialize lot operations
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
end
end else
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
end
end else
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
end
end else
ErrorMessage = 'Error in Create New Test Wafer Lot Process, error getting current operation for lot: ' : NewLotId
end
end else
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
end
end
end else
//Lot attributes didn't write correctly.
ErrorMessage = 'Error in Create New Test Wafer Lot Process, Lot attributes did not write correctly for lot: ' : NewLotId
end
end else
//Error: Lot already had data
ErrorMessage = 'Error in Create New Test Wafer Lot Process, Lot already had data, lot: ' : NewLotId
end
end else
//Error creating new lot ID
ErrorMessage = 'Error in Create New Test Wafer Lot Process, Created lot: ' : NewLotId : ' not found in LOT table.'
end
end else
//Error getting new Lot ID
ErrorMessage = 'Error in Create New Test Wafer Lot Process, no lot id returned.'
end
end else
//Ambiguous Product name, multiple results.
ErrorMessage = 'Error in Create New Test Wafer Lot Process, ambiguous product passed to routine OR no matching products found.'
end
end else
//No Matching part no found
ErrorMessage = 'Error in Create New Test Wafer Lot Process, product(':ProdName:') passed to routine not found.'
end
end else
ErrorMessage = 'Null value passed in for ProdID'
@ -132,11 +170,27 @@ Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLot
end else
ErrorMessage = 'Lot type was not test wafer'
end
If ErrorMessage EQ '' then
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = ProdName
LogData<3> = Username
LogData<4> = 'Successfully created lot id ' : CreatedLotNumber : ' of product type ' : ProdName '.'
Logging_Services('AppendLog', objTWCreationLog, LogData, @RM, @FM, False$)
end else
Error_Services('Add', ErrorMessage)
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = ProdName
LogData<3> = Username
LogData<4> = ErrorMessage
Logging_Services('AppendLog', objTWCreationLog, LogData, @RM, @FM, False$)
end
Response = CreatedLotNumber
End Service
Service GenerateInitialLotOperationRecords(LotId)
ErrorMessage = ''
If LotID NE '' then
if RowExists('LOT', LotId) then
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
@ -151,19 +205,22 @@ Service GenerateInitialLotOperationRecords(LotId)
//NewOperationRecID =
Next operation
end else
//Error: No Operations returned
ErrorMessage = 'No Operations found for ' : ProdId
end
end else
//Error: Prod ID for lot is null
ErrorMessage = 'Prod ID not specified'
end
//ID will be LotNum + OperationID
//Get product operations
end else
//error: lot does not exist
ErrorMessage = 'Lot ID does not exist.'
end
end else
//error: null lot id
ErrorMessage = 'Lot ID was null'
end
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
end service
@ -184,11 +241,13 @@ Service GetPrescribedOperationsByProdId(ProdId, ProdType)
end service
Service CreateInitialLotOperationRecords(LotId)
ErrorMessage = ''
If LotId NE '' then
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
LotType = LotRec<LOT_TYPE$>
ProdId = LotRec<LOT_PROD_ID$>
ThisInitialProdOperations = Lot_Services('GetPrescribedOperationsByProdId', ProdId, LotType)
If Error_Services('NoError') AND ThisInitialProdOperations NE '' then
For each ProdOperation in ThisInitialProdOperations using @VM
ProdOperationRec = Database_Services('ReadDataRow', 'PRODUCT_OPERATION', ProdOperation)
@ -205,14 +264,20 @@ Service CreateInitialLotOperationRecords(LotId)
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
TestRec = Database_Services('ReadDataRow', 'LOT', LotId)
end else
//Error: Lot Operation already existed, cannot overwrite
ErrorMessage = 'Lot Operation already existed, cannot overwrite'
end
Next Operation
end else
//Error: Lot ID was null
ErrorMessage = 'Error getting prescribed operations for lot# ' : LotId
end
end else
ErrorMessage = 'Lot ID was null'
end
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
TestRec = Database_Services('ReadDataRow', 'LOT', LotId)
end service
//Returns a @FM delimited list of operations in sequence
@ -323,6 +388,8 @@ Service AddLotOperationIntoSequence(LotId, NewOperationId, NewSequence, Rework)
end service
Service MoveInLot(LotID, WaferQty, Operator)
ErrorMessage = ''
ThisLotCurrOperationID = ''
If LotId NE '' then
If WaferQty NE '' then
If RowExists('LOT', LotId) then
@ -340,26 +407,41 @@ Service MoveInLot(LotID, WaferQty, Operator)
LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X')
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'MOVE_IN', '', '', 0, 0, CurrOperation, Operator)
end
end
//Log to Lot Event Table
end else
//Error: Error reading record
end
end else
//Error Invalid Lot id entered
If Error_Services('HasError') then
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
end
end else
//Error: Wafer Qty was null
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Error writing to lot operation record. ' : Error_Services('GetMessage')
end
end else
//Error: Lot Id was null
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Error getting lots current operation.'
end
end else
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
end
end else
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Lot ID not found in LOT table.'
end
end else
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Lot Qty was not passed to routine.'
end
end else
ErrorMessage = 'Error in Move In process. Lot id was not passed to routine.'
end
If ErrorMessage NE '' then
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = LotID
LogData<3> = Operator
LogData<4> = 'Successfully Moved Lot into operation ' : ThisLotCurrOperationID : '.'
Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$)
Error_Services('Add', ErrorMessage)
end
end service
Service MoveOutLot(LotID, WaferQty, Operator)
ErrorMessage = ''
ThisLotCurrOperationID = ''
If LotId NE '' then
If WaferQty NE '' then
If RowExists('LOT', LotId) then
@ -376,7 +458,6 @@ Service MoveOutLot(LotID, WaferQty, Operator)
ReduceQty = CurrLotQty - WaferQty
End Case
end
//Possibly Add locking here
If Error_Services('NoError') then
ThisLotCurrOperationID = Lot_Services('GetLotCurrOperation', LotId)
If ThisLotCurrOperationID NE '' then
@ -387,28 +468,52 @@ Service MoveOutLot(LotID, WaferQty, Operator)
Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotCurrOperationID, ThisLotCurrOperationRec)
If Error_Services('NoError') then
LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X')
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'MOVE_OUT', '', '', ReduceQty, BonusQty, CurrOperation, Operator)
end
end
//Log to lot event table.
end else
//Error: Error reading record
end
end else
//Error Invalid Lot id entered
If Error_Services('HasError') then
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
end
end else
//Error: Wafer Qty was null
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Error writing to lot operation record. ' : Error_Services('GetMessage')
end
end else
//Error: Lot Id was null
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Error getting lots current operation.'
end
end else
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
end
end else
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Lot ID not found in LOT table.'
end
end else
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Lot Qty was not passed to routine.'
end
end else
ErrorMessage = 'Error in Move Out process. Lot id was not passed to routine.'
end
If ErrorMessage NE '' then
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = LotID
LogData<3> = Operator
LogData<4> = 'Successfully Moved Lot out of operation ' : ThisLotCurrOperationID : '.'
Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$)
Error_Services('Add', ErrorMessage)
end else
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = LotID
LogData<3> = Operator
LogData<4> = 'Error in Move Out process for Lot id ' : LotId : '. ' : ErrorMessage
Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$)
Error_Services('Add', ErrorMessage)
end
end service
Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_TYPES, EventNote, EventEquipmentId, ReduceWaferQty, BonusWaferQty, OperationId, OperatorId)
ErrorMessage = ''
BeginWaferQty = ''
EndWaferQty = ''
If LotId NE '' then
Begin Case
Case LotType EQ 'TW'
@ -428,6 +533,8 @@ Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_
OperationID = Lot_Services('GetLotCurrOperation', LotId)
OperationID = XLATE('LOT_OPERATION', OperationID, LOT_OPERATION_OPERATION_ID$, 'X')
end
//OperationId should be set by now, if not, it is an error. Raise the error and cancel any processing.
If OperationID NE '' then
If ReduceWaferQty NE '' then
If Num(ReduceWaferQty) then
EndWaferQty = BeginWaferQty - ReduceWaferQty
@ -454,23 +561,55 @@ Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_
NewEventSequence = Lot_Services('GetLotEventNextSequence', LotId)
NewEventRec<LOT_EVENT_SEQUENCE$> = NewEventSequence
Database_Services('WriteDataRow', 'LOT_EVENT', NewEventId, NewEventRec)
end else
//Error: Nonexistent Lot Id passed to routine
if Error_Services('HasError') then
ErrorMessage = 'Error in Create Lot Event routine, Error writing Lot Event record, ' : Error_Services('GetMessage')
end
end else
//Error Missing Parameter
ErrorMessage = 'Error in Create Lot Event routine, Current Operation for lot id ' : LotId : ' could not be determined.'
end
end else
ErrorMessage = 'Error in Create Lot Event routine, Lot Id passed to routine was not found in LOT table.'
end
end else
ErrorMessage = 'Error in Create Lot Event routine, Missing event type or Operator ID.'
end
Case LotType EQ 'RDS'
null
ErrorMessage = 'Error in Create Lot Event routine, Lot type RDS was passed to routine and this is currently not supported.'
Case LotType EQ 'WM_OUT'
null
ErrorMessage = 'Error in Create Lot Event routine, Lot type WM_OUT was passed to routine and this is currently not supported.'
Case LotType EQ 'WM_IN'
null
ErrorMessage = 'Error in Create Lot Event routine, Lot type WM_IN was passed to routine and this is currently not supported.'
Case Otherwise$
//Error: Invalid LotType Passed to routine
ErrorMessage = 'Error in Create Lot Event routine, An invalid lot type was passed to routine.'
End Case
end else
//Error: Lot ID was null
ErrorMessage = 'Error in Create Lot Event routine, A null value for Lot Id was passed to routine.'
end
If ErrorMessage EQ '' then
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = LotId
LogData<3> = EventType
LogData<4> = OperatorId
LogData<5> = BeginWaferQty
LogData<6> = EndWaferQty
LogData<7> = BonusWaferQty
LogData<8> = ReduceWaferQty
LogData<9> = 'Successfully logged event.'
Logging_Services('AppendLog', objLotEventLog, LogData, @RM, @FM, False$)
end else
LogData = ''
LogData<1> = LoggingDTM
LogData<2> = LotId
LogData<3> = EventType
LogData<4> = OperatorId
LogData<5> = BeginWaferQty
LogData<6> = EndWaferQty
LogData<7> = BonusWaferQty
LogData<8> = ReduceWaferQty
LogData<9> = ErrorMessage
Logging_Services('AppendLog', objLotEventLog, LogData, @RM, @FM, False$)
Error_Services('Add', ErrorMessage)
end
end service
@ -525,6 +664,10 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
SRP_JSON(objLot, 'SetValue', 'WaferQty', LotRec<LOT_WAFER_QTY$>)
SRP_JSON(objLot, 'SetValue', 'VendorPartNo', LotRec<LOT_VENDOR_PART_NO$>)
SRP_JSON(objLot, 'SetValue', 'VendorLotNo', LotRec<LOT_VENDOR_LOT_NO$>)
SRP_JSON(objLot, 'SetValue', 'Vendor', LotRec<LOT_VENDOR_CODE$>)
CurrOperation = Lot_Services('GetLotCurrOperation', LotId)
CurrOperation = Field(CurrOperation, '*', 2)
SRP_JSON(objLot, 'SetValue', 'CurrOperation', CurrOperation)
If FullObject then
//Events Array
EventsArrayJson = ''
@ -612,4 +755,47 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
Response = JsonString
end service
Service OpenLot(LotId)
ErrorMessage = ''
If RowExists('LOT', LotId) then
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
LotRec<LOT_OPEN$> = True$
Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$)
If Error_Services('HasError') then
ErrorMessage = 'Error setting lot ' : LotId : ' to open.' : Error_Services('GetMessage')
end
end else
ErrorMessage = 'Unable to Open Lot ' : LotId : '. Lot ID was not found in LOT table.'
end
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
end service
Service CloseLot(LotId)
ErrorMessage = ''
If RowExists('LOT', LotId) then
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
LotRec<LOT_OPEN$> = False$
Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$)
If Error_Services('HasError') then
ErrorMessage = 'Error setting lot ' : LotId : ' to closed.' : Error_Services('GetMessage')
end
end else
ErrorMessage = 'Unable to Close Lot ' : LotId : '. Lot ID was not found in LOT table.'
end
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
end service
Service HoldLot(LotId)
end service
Service UnholdLot(LotId)
end service

View File

@ -0,0 +1,107 @@
Compile function OPERATION_TW_CREATE(LotId, Action, Operator)
//Action: IN, OUT, PROCESS
Declare function Lot_Services, Error_Services, Datetime, Database_Services
Declare subroutine Database_Services, Lot_Services
#pragma precomp SRP_PreCompiler
$insert LOGICAL
$Insert APP_INSERTS
$Insert Lot_Operation_Equates
$Insert LOT_EQUATES
Success = False$
debug
If RowExists('LOT', LotId) then
If Operator NE '' and RowExists('LSL_USERS', Operator) then
Begin Case
Case Action = 'IN'
GoSub MoveIn
Case Action = 'OUT'
GoSub MoveOut
Case Action = 'PROCESS'
GoSub Process
Case Otherwise$
null
End Case
end else
Error_Services('Add', 'Operator ID was null')
end
end else
Error_Services('Add', 'Invalid lot passed to Operation routine.')
Success = False$
end
Return Success
MoveIn:
debug
//Get TW Create Operation ID
ThisOperationID = Lot_Services('GetLotCurrOperation', LotId)
If Field(ThisOperationId, '*', 1) EQ 'TW_CREATE' then
ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisOperationID)
ThisLotCurrOperationRec<LOT_OPERATION_DATETIME_IN$> = Datetime()
ThisLotCurrOperationRec<LOT_OPERATION_WAFER_IN_QTY$> = Xlate('LOT', LotId, LOT_WAFER_QTY$, 'X')
ThisLotCurrOperationRec<LOT_OPERATION_OPERATOR_IN_ID$> = Operator
Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotCurrOperationID, ThisOperationID)
If Error_Services('NoError') then
LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X')
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'MOVE_IN', '', '', 0, 0, CurrOperation, Operator)
end
end else
Error_Services('Add', 'Failed to move in lot. Lot is not currently at TW_CREATE. Detected Operation is ' : Field(ThisOperationId, '*', 1))
end
return
MoveOut:
ThisOperationID = Lot_Services('GetLotCurrOperation', LotId)
If Field(ThisOperationId, '*', 1) EQ 'TW_CREATE' then
ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotCurrOperationID)
LotMovedIn = ThisLotCurrOperationRec<LOT_OPERATION_DATETIME_IN$>
If LotMovedIn then
ThisOperationSteps = ThisLotCurrOperationRec<LOT_OPERATION_STEPS$>
AllStepsCompleted = False$
for each OperationStepId in ThisOperationSteps using @VM
ThisStepComplete = Xlate('LOT_OPERATION_STEP', OperationStepId, LOT_OPERATION_STEP_STEP_COMPLETED$, 'X')
If ThisStepComplete then
AllStepsComplete = True$
end else
AllStepsComplete = False$
end
until AllStepsCompleted = False$
Next OperationStep
If AllStepsCompleted then
ThisLotCurrOperationRec<LOT_OPERATION_DATETIME_OUT$> = Datetime()
ThisLotCurrOperationRec<LOT_OPERATION_WAFER_OUT_QTY$> = Xlate('LOT', LotId, LOT_WAFER_QTY$, 'X')
ThisLotCurrOperationRec<LOT_OPERATION_OPERATOR_OUT_ID$> = Operator
Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotCurrOperationID, ThisLotCurrOperationRec)
If Error_Services('NoError') then
LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X')
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'MOVE_OUT', '', '', ReduceQty, BonusQty, CurrOperation, Operator)
end
end else
Error_Services('Add', 'Failed to move out lot. Not all steps completed.')
end
end else
Error_Services('Add', 'Failed to move out lot. Lot was not moved in.')
end
end
return
Process:
//Get Current Step and proceed from that step onward
return
OpenLot:
return
PrintLabel:
return

View File

@ -42,7 +42,7 @@ $insert APP_INSERTS
$insert API_SETUP
$insert HTTP_INSERTS
Declare Function Report_Services, Oi_Wizard_Services, Logging_Services, Environment_Services
Declare Function Report_Services, Oi_Wizard_Services, Logging_Services, Environment_Services, Test_Run_Services
Declare subroutine Report_Services, Logging_Services
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\API\Reports'
@ -133,6 +133,8 @@ CreateHALItem:
ReportStartDtm = Http_Services('GetQueryField', 'StartDate')
ReportEndDtm = Http_Services('GetQueryField', 'EndDate')
RepJSON = Report_Services('GetDailyReactorUptimeDataJSON', ReportStartDtm, ReportEndDtm)
Case ReportID = 'TestWaferWIPReport'
RepJSON = Report_Services('GetOpenTestWaferLotWIPReportJson')
Case Otherwise$
Error_Services('Add', 'Unsupported report')
End Case
@ -223,5 +225,3 @@ API reports.GET
HTTP_Resource_Services('LoremIpsum')
end api

View File

@ -81,6 +81,7 @@ Declare function Set_Printer, Get_Printer, Msg, Get_Status, Printer_Select, ob
Declare function Schedule_Services, Error_Services, Location_Services, SRP_Array, Signature_Services, obj_RDS_Test
Declare function Epi_Part_Services, SRP_Math, Database_Services, SRP_JSON, Reactor_Services, SRP_Datetime
Declare function SRP_Array, Environment_Services, Logging_Services, Datetime, Select_Into, Wafer_Counter_Services
Declare function Lot_Services, Test_Run_Services
Equ TAB TO \09\
@ -1545,6 +1546,46 @@ Service CalcInProcessDailyPerformanceData()
end service
Service GetOpenTestWaferLotWIPReportJson()
ErrorMessage = ''
JSONCollection = ''
TestWaferLots = Test_Run_Services('GetTestWaferLots', True$)
hJSONCollection = ''
If SRP_JSON(hJSONCollection, 'New', 'Object') then
hTWLotArray = ''
If SRP_JSON(hTWLotArray, 'New', 'Array') then
Abort = False$
for each TestWaferLotId in TestWaferLots using @VM
ThisLotJson = Lot_Services('ConvertLotRecordToJson', TestWaferLotId, '', '', False$)
If Error_Services('NoError') then
hTWLot = ''
If (SRP_JSON(hTWLot, 'Parse', ThisLotJson) EQ '') then
SRP_JSON(hTWLotArray, 'Add', hTWLot)
SRP_JSON(hTWLot, 'Release')
end
end else
Abort = True$
end
Until Abort
Next TestWaferLotId
If Abort EQ False$ then
SRP_JSON(hJSONCollection, 'Set', 'Lots', hTWLotArray)
end
SRP_JSON(hTWLotArray, 'Release')
end else
ErrorMessage = 'Error creating test wafer Json array.'
end
JSONCollection = SRP_JSON(hJSONCollection, 'Stringify', 'Styled')
SRP_JSON(hJSONCollection, 'Release')
end else
ErrorMessage = 'Error creating test wafer Json Collection'
end
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
Response = JSONCollection
end service
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Internal GoSubs
@ -1845,3 +1886,4 @@ ClearCursors:
return

View File

@ -8,9 +8,9 @@ $Insert TEST_RUN_EQUATES
$Insert TEST_RUN_WAFER_EQUATES
$Insert TEST_RUN_OBJ_EQUATES
Declare function Nextkey, Error_Services, Environment_Services, OConv, Logging_Services, SRP_Hashtable
Declare function SRP_Datetime, Database_Services, Test_Run_Services, File_Services, Status, delete, Insert
Declare subroutine Database_Services, Btree.Extract, Error_Services, Logging_Services, Rlist, Test_Run_Services,
Declare function Nextkey, Error_Services, Environment_Services, OConv, Logging_Services, SRP_Hashtable, Lot_Services
Declare function SRP_Datetime, Database_Services, Test_Run_Services, File_Services, Status, delete, Insert, Datetime, SRP_Json
Declare subroutine Database_Services, Btree.Extract, Error_Services, Logging_Services, Rlist, Test_Run_Services, Lot_Services, SRP_Json
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\TEST_RUN_SERVICES\TestWaferProduct'
LogDate = Oconv(Date(), 'D4/')
@ -297,6 +297,24 @@ Service GetAllTestRunTypes()
Response = rtList
end service
Service GetTestWaferLots(ShowOnlyOpenLots)
ErrorMessage = ''
TestWaferLotKeys = ''
SearchString = 'TYPE':@VM:'TW':@FM
If ShowOnlyOpenLots then
SearchString := 'OPEN':@VM:True$:@FM
end
Open 'DICT.LOT' to @DICT then
Btree.Extract(SearchString, 'LOT', @DICT, TestWaferLotKeys, '', '')
end else
ErrorMessage = 'Error opening LOT dictionary.'
end
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
Response = TestWaferLotKeys
end service
Service CreateTestRunRecord(RunTypeID, EqpType, EqpID, PSNo, RDSNo, UserID)
Response = ''
ErrorMessage = ''
@ -326,7 +344,7 @@ Service CreateTestRunRecord(RunTypeID, EqpType, EqpID, PSNo, RDSNo, UserID)
If RunTypeID EQ '' then
ErrorMessage := 'Run Type ID Missing. '
end
If EqpTypeID EQ '' then
If EqpType EQ '' then
ErrorMessage := 'Equipment Type ID Missing. '
end
If EqpID EQ '' then
@ -346,7 +364,7 @@ Service CreateTestRunRecord(RunTypeID, EqpType, EqpID, PSNo, RDSNo, UserID)
end
end service
Service CreateTestRunWaferRecord(TestRunID, TWPartID, TWUsageTypeID, SourceLotID)
Service CreateTestRunWaferRecord(TestRunID, TWPartID, TWUsageTypeID, SourceLotID, Username)
ErrorMessage = ''
If TestRunID NE '' AND TWPartID NE '' then
If RowExists('TEST_RUN', TestRunID) then
@ -366,6 +384,9 @@ Service CreateTestRunWaferRecord(TestRunID, TWPartID, TWUsageTypeID, SourceLotID
Logging_Services('AppendLog', objLogTR, LogData, @FM, @VM)
//Increment Usage in TEST_WAFER_PROD Record
Test_Run_Services('IncrementTWProdUsage', TWPartID)
If SourceLotID NE '' then
Test_Run_Services('UseTWFromLot', SourceLotId, 1, Username)
end
Response = TRWaferKey
end else
ErrorMessage := 'Error writing TEST_RUN_WAFER record with key of ' : TRWaferKey '. '
@ -389,6 +410,19 @@ Service CreateTestRunWaferRecord(TestRunID, TWPartID, TWUsageTypeID, SourceLotID
Logging_Services('AppendLog', objLogTR, LogData, @FM, @VM)
end
end service
Service UseTWFromLot(LotId, UsageQty, Username)
ErrorMessage = ''
If RowExists('LOT', LotId) then
Lot_Services('CreateLotEvent', LotId, 'TW', Datetime(), 'REDUCE_WAFER_QTY', 'Consumed test wafer.', '', UsageQty, 0, '', Username)
end else
ErrorMessage = 'Error logging wafer consumption from Lot # ' : LotId : '. Lot does not exist in LOT table.'
end
If ErrorMessage EQ '' then
end else
//Log Error
end
end service
Service GetTestRunById(TestRunID)
If TestRunID NE '' then
@ -603,3 +637,4 @@ end service

View File

@ -1,7 +1,7 @@
compile insert LOT_EQUATES
/*----------------------------------------
Author : Table Create Insert Routine
Written : 11/10/2024
Written : 28/10/2024
Description : Insert for Table LOT
----------------------------------------*/
#ifndef __LOT_EQUATES__
@ -16,5 +16,9 @@ compile insert LOT_EQUATES
equ LOT_VENDOR_CODE$ to 7
equ LOT_LOT_EVENTS$ to 8
equ LOT_LOT_OPERATIONS$ to 9
equ LOT_TEST_RUN_WAFER_IDS$ to 10
equ LOT_OPEN$ to 11
equ LOT_HOLD$ to 12
equ LOT_HOT$ to 13
#endif