Fixed some error throwing in LOT_SERVICES
This commit is contained in:
@ -1,10 +1,56 @@
|
|||||||
Compile function Lot_Services(@Service, @Params)
|
Compile function Lot_Services(@Service, @Params)
|
||||||
#pragma precomp SRP_PreCompiler
|
/***********************************************************************************************************************
|
||||||
|
|
||||||
$insert APP_INSERTS
|
Name : Lot_Services
|
||||||
|
|
||||||
|
Description : Handler program for all LOT services.
|
||||||
|
|
||||||
|
Notes : Application errors should be logged using the Error Services module. There are a few methodological
|
||||||
|
assumptions built into way errors are managed which are important to understand in order to properly
|
||||||
|
work with Error Services:
|
||||||
|
|
||||||
|
- The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to
|
||||||
|
the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger
|
||||||
|
this will appear backwards since the originating procedure always appears at the bottom of the
|
||||||
|
list and the current routine appears at the top of the list. We are using this orientation because
|
||||||
|
it is common to refer to the process of calling other procedures as 'drilling down'.
|
||||||
|
|
||||||
|
- The reason for defining the orientation of the call stack is because Error_Services allows for
|
||||||
|
multiple error conditions to be appended to an original error. In most cases this will happen when
|
||||||
|
a procedure at the bottom of the stack generates an error condition and then returns to its
|
||||||
|
calling procedure. This higher level procedure can optionally add more information relevant to
|
||||||
|
itself. This continues as the call stack 'bubbles' its way back to the top to where the
|
||||||
|
originating procedure is waiting.
|
||||||
|
|
||||||
|
- Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus)
|
||||||
|
preserve their error state until explicitly cleared. This can hinder the normal execution of code
|
||||||
|
since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists.
|
||||||
|
Our philosophy is that error conditions should automatically be cleared before a new procedure
|
||||||
|
is executed to avoid this problem. However, the nature of Basic+ does not make this easy to
|
||||||
|
automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our
|
||||||
|
philosophy then it should include a call into the 'Clear' service request at the top of the
|
||||||
|
program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.)
|
||||||
|
|
||||||
|
- Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any
|
||||||
|
error conditions that were set before.
|
||||||
|
|
||||||
|
Parameters :
|
||||||
|
Service [in] -- Name of the service being requested
|
||||||
|
Param1-10 [in/out] -- Additional request parameter holders
|
||||||
|
Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure
|
||||||
|
|
||||||
|
Metadata :
|
||||||
|
|
||||||
|
History : (Date, Initials, Notes)
|
||||||
|
07/01/25 djs Corrected error throwing.
|
||||||
|
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
#pragma precomp SRP_PreCompiler
|
||||||
|
$Insert SERVICE_SETUP
|
||||||
|
$Insert APP_INSERTS
|
||||||
$Insert LOT_EQUATES
|
$Insert LOT_EQUATES
|
||||||
$Insert TEST_WAFER_PROD_EQUATES
|
$Insert TEST_WAFER_PROD_EQUATES
|
||||||
$Insert Lot_Operation_Equates
|
$Insert LOT_OPERATION_EQUATES
|
||||||
$Insert PRODUCT_OPERATION_EQUATES
|
$Insert PRODUCT_OPERATION_EQUATES
|
||||||
$Insert LOT_EVENT_EQUATES
|
$Insert LOT_EVENT_EQUATES
|
||||||
$Insert NOTIFICATION_EQUATES
|
$Insert NOTIFICATION_EQUATES
|
||||||
@ -58,9 +104,9 @@ GoToService
|
|||||||
|
|
||||||
Return Response or ""
|
Return Response or ""
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
// SERVICES
|
// Services
|
||||||
//-----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Service GenerateNewLotId(LotType)
|
Service GenerateNewLotId(LotType)
|
||||||
|
|
||||||
@ -115,11 +161,11 @@ Service GenerateNewLotId(LotType)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
Repeat
|
Repeat
|
||||||
Case OTHERWISE$
|
Case Otherwise$
|
||||||
//null
|
Null
|
||||||
End Case
|
End Case
|
||||||
If GeneratedLotID NE '' AND ValidLotNum then
|
If GeneratedLotID NE '' AND ValidLotNum then
|
||||||
//Write the new lot id now so it's reserved
|
// Write the new lot id now so it's reserved
|
||||||
Database_Services('WriteDataRow', 'LOT', GeneratedLotID, '')
|
Database_Services('WriteDataRow', 'LOT', GeneratedLotID, '')
|
||||||
If RowExists('LOT', GeneratedLotID) then
|
If RowExists('LOT', GeneratedLotID) then
|
||||||
NewLotID = GeneratedLotID
|
NewLotID = GeneratedLotID
|
||||||
@ -135,9 +181,8 @@ Service GetLotIdByLegacyLotIdAndType(LegacyLotId, LegacyLotType)
|
|||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'GetLotIdByLegacyLotIdAndType'
|
MetricName = 'GetLotIdByLegacyLotIdAndType'
|
||||||
|
ErrorMsg = ''
|
||||||
Open 'DICT.LOT' to DictLot then
|
Open 'DICT.LOT' to DictLot then
|
||||||
|
|
||||||
SearchString = ''
|
SearchString = ''
|
||||||
SearchString := 'LEGACY_LOT_ID':@VM:LegacyLotId:@FM
|
SearchString := 'LEGACY_LOT_ID':@VM:LegacyLotId:@FM
|
||||||
SearchString := 'TYPE':@VM:LegacyLotType:@FM
|
SearchString := 'TYPE':@VM:LegacyLotType:@FM
|
||||||
@ -149,7 +194,6 @@ Service GetLotIdByLegacyLotIdAndType(LegacyLotId, LegacyLotType)
|
|||||||
end else
|
end else
|
||||||
Response = LotIdKeys<1,1>
|
Response = LotIdKeys<1,1>
|
||||||
end
|
end
|
||||||
|
|
||||||
end else
|
end else
|
||||||
ErrorMsg = 'Error in ':Service:' service. Error opening LOT dictionary.'
|
ErrorMsg = 'Error in ':Service:' service. Error opening LOT dictionary.'
|
||||||
end
|
end
|
||||||
@ -157,6 +201,8 @@ Service GetLotIdByLegacyLotIdAndType(LegacyLotId, LegacyLotType)
|
|||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -169,7 +215,7 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo
|
|||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
Begin Case
|
Begin Case
|
||||||
Case LotType EQ 'RDS' OR LotType EQ 'WM_IN' OR LotType EQ 'WM_OUT' OR LotType EQ 'WO_MAT'
|
Case LotType EQ 'RDS' OR LotType EQ 'WM_IN' OR LotType EQ 'WM_OUT' OR LotType EQ 'WO_MAT'
|
||||||
//Case statement for legacy lot entity types
|
// Case statement for legacy lot entity types
|
||||||
NewLotId = Lot_Services('GenerateNewLotId', LotType)
|
NewLotId = Lot_Services('GenerateNewLotId', LotType)
|
||||||
If NewLotId NE '' then
|
If NewLotId NE '' then
|
||||||
If RowExists('LOT', NewLotId) NE False$ then
|
If RowExists('LOT', NewLotId) NE False$ then
|
||||||
@ -203,7 +249,7 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo
|
|||||||
If NewLotId NE '' then
|
If NewLotId NE '' then
|
||||||
If RowExists('LOT', NewLotId) then
|
If RowExists('LOT', NewLotId) then
|
||||||
LotRec = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
LotRec = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
||||||
//Ensure the lot record is empty
|
// Ensure the lot record is empty
|
||||||
If LotRec<LOT_TYPE$> EQ '' AND LotRec<LOT_PROD_ID$> EQ '' AND LotRec<LOT_ORIG_WAFER_QTY$> EQ '' AND LotRec<LOT_WAFER_QTY$> EQ '' then
|
If LotRec<LOT_TYPE$> EQ '' AND LotRec<LOT_PROD_ID$> EQ '' AND LotRec<LOT_ORIG_WAFER_QTY$> EQ '' AND LotRec<LOT_WAFER_QTY$> EQ '' then
|
||||||
LotRec<LOT_TYPE$> = LotType
|
LotRec<LOT_TYPE$> = LotType
|
||||||
LotRec<LOT_PROD_ID$> = TWProdID
|
LotRec<LOT_PROD_ID$> = TWProdID
|
||||||
@ -213,26 +259,26 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo
|
|||||||
LotRec<LOT_VENDOR_LOT_NO$> = VendorLotNo
|
LotRec<LOT_VENDOR_LOT_NO$> = VendorLotNo
|
||||||
LotRec<LOT_VENDOR_CODE$> = VendorCode
|
LotRec<LOT_VENDOR_CODE$> = VendorCode
|
||||||
Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec)
|
Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec)
|
||||||
//Now Ensure that the written lot matches what was just written
|
// Now Ensure that the written lot matches what was just written
|
||||||
LotRecCheck = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
LotRecCheck = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
||||||
If LotRecCheck EQ LotRec then
|
If LotRecCheck EQ LotRec then
|
||||||
//Lot Created successfully
|
// Lot Created successfully
|
||||||
CreatedLotNumber = NewLotId
|
CreatedLotNumber = NewLotId
|
||||||
If RowExists('LOT', CreatedLotNumber) then
|
If RowExists('LOT', CreatedLotNumber) then
|
||||||
Lot_Services('CreateInitialLotOperationRecords', CreatedLotNumber)
|
Lot_Services('CreateInitialLotOperationRecords', CreatedLotNumber)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
//Check in at first operation
|
// Check in at first operation
|
||||||
//Get Curr Operation(Should be first one in sequence)
|
// Get Curr Operation(Should be first one in sequence)
|
||||||
ThisLotCurrOpId = Lot_Services('GetLotCurrOperationId', CreatedLotNumber)
|
ThisLotCurrOpId = Lot_Services('GetLotCurrOperationId', CreatedLotNumber)
|
||||||
If ThisLotCurrOpId NE '' then
|
If ThisLotCurrOpId NE '' then
|
||||||
//Set lot to open
|
// Set lot to open
|
||||||
Lot_Services('OpenLot', CreatedLotNumber)
|
Lot_Services('OpenLot', CreatedLotNumber)
|
||||||
if Error_Services('NoError') then
|
if Error_Services('NoError') then
|
||||||
//Move lot in
|
// Move lot in
|
||||||
Lot_Services('MoveInLot', CreatedLotNumber, Username)
|
Lot_Services('MoveInLot', CreatedLotNumber, Username)
|
||||||
if Error_Services('NoError') then
|
if Error_Services('NoError') then
|
||||||
If PrinterID NE 'WEB' 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.
|
// 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)
|
Labeling_Services('PrintTestWaferLotLabel', CreatedLotNumber, Username, PrinterID)
|
||||||
If Error_Services('HasError') then
|
If Error_Services('HasError') then
|
||||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : CreatedLotNumber : ' , ' : Error_Services('GetMessage')
|
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : CreatedLotNumber : ' , ' : Error_Services('GetMessage')
|
||||||
@ -251,18 +297,18 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo
|
|||||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
//Close LOT record as there was an error
|
// Close LOT record as there was an error
|
||||||
Lot_Services('CloseLot', NewLotId)
|
Lot_Services('CloseLot', NewLotId)
|
||||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
//Close LOT record as there was an error
|
// Close LOT record as there was an error
|
||||||
Lot_Services('CloseLot', NewLotId)
|
Lot_Services('CloseLot', NewLotId)
|
||||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, error getting current operation for lot: ' : NewLotId
|
ErrorMessage = 'Error in Create New Test Wafer Lot Process, error getting current operation for lot: ' : NewLotId
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
//Close LOT record as there was an error
|
// Close LOT record as there was an error
|
||||||
//Database_Services('DeleteDataRow', 'LOT', NewLotId, True$, False$)
|
// Database_Services('DeleteDataRow', 'LOT', NewLotId, True$, False$)
|
||||||
Lot_Services('CloseLot', NewLotId)
|
Lot_Services('CloseLot', NewLotId)
|
||||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||||
end
|
end
|
||||||
@ -292,6 +338,9 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo
|
|||||||
ErrorMessage = 'Error in ':Service:' service. Lot Type "':LotType:'" is not currently supported.'
|
ErrorMessage = 'Error in ':Service:' service. Lot Type "':LotType:'" is not currently supported.'
|
||||||
End Case
|
End Case
|
||||||
|
|
||||||
|
EndTick = GetTickCount()
|
||||||
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
If ErrorMessage EQ '' then
|
If ErrorMessage EQ '' then
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
@ -310,9 +359,6 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo
|
|||||||
end
|
end
|
||||||
Response = CreatedLotNumber
|
Response = CreatedLotNumber
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
|
||||||
|
|
||||||
End Service
|
End Service
|
||||||
|
|
||||||
|
|
||||||
@ -329,7 +375,7 @@ Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLot
|
|||||||
If NewLotId NE '' then
|
If NewLotId NE '' then
|
||||||
If RowExists('LOT', NewLotId) then
|
If RowExists('LOT', NewLotId) then
|
||||||
LotRec = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
LotRec = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
||||||
//Ensure the lot record is empty
|
// Ensure the lot record is empty
|
||||||
If LotRec<LOT_TYPE$> EQ '' AND LotRec<LOT_PROD_ID$> EQ '' AND LotRec<LOT_ORIG_WAFER_QTY$> EQ '' AND LotRec<LOT_WAFER_QTY$> EQ '' then
|
If LotRec<LOT_TYPE$> EQ '' AND LotRec<LOT_PROD_ID$> EQ '' AND LotRec<LOT_ORIG_WAFER_QTY$> EQ '' AND LotRec<LOT_WAFER_QTY$> EQ '' then
|
||||||
LotRec<LOT_TYPE$> = LotType
|
LotRec<LOT_TYPE$> = LotType
|
||||||
LotRec<LOT_PROD_ID$> = TWProdID
|
LotRec<LOT_PROD_ID$> = TWProdID
|
||||||
@ -339,25 +385,25 @@ Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLot
|
|||||||
LotRec<LOT_VENDOR_LOT_NO$> = VendorLotNo
|
LotRec<LOT_VENDOR_LOT_NO$> = VendorLotNo
|
||||||
LotRec<LOT_VENDOR_CODE$> = VendorCode
|
LotRec<LOT_VENDOR_CODE$> = VendorCode
|
||||||
Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec)
|
Database_Services('WriteDataRow', 'LOT', NewLotId, LotRec)
|
||||||
//Now Ensure that the written lot matches what was just written
|
// Now Ensure that the written lot matches what was just written
|
||||||
LotRecCheck = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
LotRecCheck = Database_Services('ReadDataRow', 'LOT', NewLotId)
|
||||||
If LotRecCheck EQ LotRec then
|
If LotRecCheck EQ LotRec then
|
||||||
//Lot Created successfully
|
// Lot Created successfully
|
||||||
CreatedLotNumber = NewLotId
|
CreatedLotNumber = NewLotId
|
||||||
If RowExists('LOT', CreatedLotNumber) then
|
If RowExists('LOT', CreatedLotNumber) then
|
||||||
Lot_Services('CreateInitialLotOperationRecords', CreatedLotNumber)
|
Lot_Services('CreateInitialLotOperationRecords', CreatedLotNumber)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
//Check in at first operation
|
// Check in at first operation
|
||||||
//Get Curr Operation(Should be first one in sequence)
|
// Get Curr Operation(Should be first one in sequence)
|
||||||
ThisLotCurrOpId = Lot_Services('GetLotCurrOperationId', CreatedLotNumber)
|
ThisLotCurrOpId = Lot_Services('GetLotCurrOperationId', CreatedLotNumber)
|
||||||
If ThisLotCurrOpId NE '' then
|
If ThisLotCurrOpId NE '' then
|
||||||
Lot_Services('MoveInLot', NewLotId, Username)
|
Lot_Services('MoveInLot', NewLotId, Username)
|
||||||
if Error_Services('NoError') then
|
if Error_Services('NoError') then
|
||||||
//Set lot to open
|
// Set lot to open
|
||||||
Lot_Services('OpenLot', CreatedLotNumber)
|
Lot_Services('OpenLot', CreatedLotNumber)
|
||||||
if Error_Services('NoError') then
|
if Error_Services('NoError') then
|
||||||
If PrinterID NE 'WEB' 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.
|
// 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)
|
Labeling_Services('PrintTestWaferLotLabel', CreatedLotNumber, Username, PrinterID)
|
||||||
If Error_Services('HasError') then
|
If Error_Services('HasError') then
|
||||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : CreatedLotNumber : ' , ' : Error_Services('GetMessage')
|
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : CreatedLotNumber : ' , ' : Error_Services('GetMessage')
|
||||||
@ -417,13 +463,13 @@ Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLot
|
|||||||
LogData<4> = 'Successfully created lot id ' : CreatedLotNumber : ' of product type ' : ProdName '.'
|
LogData<4> = 'Successfully created lot id ' : CreatedLotNumber : ' of product type ' : ProdName '.'
|
||||||
Logging_Services('AppendLog', objTWCreationLog, LogData, @RM, @FM, False$)
|
Logging_Services('AppendLog', objTWCreationLog, LogData, @RM, @FM, False$)
|
||||||
end else
|
end else
|
||||||
Error_Services('Add', ErrorMessage)
|
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
LogData<2> = ProdName
|
LogData<2> = ProdName
|
||||||
LogData<3> = Username
|
LogData<3> = Username
|
||||||
LogData<4> = ErrorMessage
|
LogData<4> = ErrorMessage
|
||||||
Logging_Services('AppendLog', objTWCreationLog, LogData, @RM, @FM, False$)
|
Logging_Services('AppendLog', objTWCreationLog, LogData, @RM, @FM, False$)
|
||||||
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
Response = CreatedLotNumber
|
Response = CreatedLotNumber
|
||||||
|
|
||||||
@ -438,7 +484,7 @@ Service GenerateInitialLotOperationRecords(LotId)
|
|||||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||||
ProdID = LotRec<LOT_PROD_ID$>
|
ProdID = LotRec<LOT_PROD_ID$>
|
||||||
If ProdID NE '' then
|
If ProdID NE '' then
|
||||||
//Get product operations
|
// Get product operations
|
||||||
ThisLotOperations = Lot_Services('GetPrescribedOperationsByProdId', ProdId)
|
ThisLotOperations = Lot_Services('GetPrescribedOperationsByProdId', ProdId)
|
||||||
If ThisLotOperations NE '' then
|
If ThisLotOperations NE '' then
|
||||||
for each ProdOperationKey in ThisLotOperations using @FM
|
for each ProdOperationKey in ThisLotOperations using @FM
|
||||||
@ -450,24 +496,22 @@ Service GenerateInitialLotOperationRecords(LotId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Prod ID not specified'
|
ErrorMessage = 'Prod ID not specified'
|
||||||
end
|
end
|
||||||
//ID will be LotNum + OperationID
|
// ID will be LotNum + OperationID
|
||||||
//Get product operations
|
// Get product operations
|
||||||
|
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Lot ID does not exist.'
|
ErrorMessage = 'Lot ID does not exist.'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Lot ID was null'
|
ErrorMessage = 'Lot ID was null'
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then
|
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
|
||||||
Error_Services('Add', ErrorMessage)
|
|
||||||
end
|
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
Service GetPrescribedOperationsByProdId(ProdId, ProdType)
|
Service GetPrescribedOperationsByProdId(ProdId, ProdType)
|
||||||
|
|
||||||
|
ErrorMsg = ''
|
||||||
ProdOperationKeys = ''
|
ProdOperationKeys = ''
|
||||||
If ProdId NE '' then
|
If ProdId NE '' then
|
||||||
Begin Case
|
Begin Case
|
||||||
@ -475,12 +519,17 @@ Service GetPrescribedOperationsByProdId(ProdId, ProdType)
|
|||||||
ProdRec = Database_Services('ReadDataRow', 'TEST_WAFER_PROD', ProdId)
|
ProdRec = Database_Services('ReadDataRow', 'TEST_WAFER_PROD', ProdId)
|
||||||
ProdOperationKeys = ProdRec<TEST_WAFER_PROD_PRODUCT_OPERATIONS$>
|
ProdOperationKeys = ProdRec<TEST_WAFER_PROD_PRODUCT_OPERATIONS$>
|
||||||
Case Otherwise$
|
Case Otherwise$
|
||||||
//error, no matching prod type.
|
ErrorMsg = 'Error in ':Service:' service. No matching prod type.'
|
||||||
End Case
|
End Case
|
||||||
end else
|
end else
|
||||||
//Error: ProdID was null
|
ErrorMsg = 'Error in ':Service:' service. Null ProdId passed into service.'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
If ErrorMsg EQ '' then
|
||||||
Response = ProdOperationKeys
|
Response = ProdOperationKeys
|
||||||
|
end else
|
||||||
|
Error_Services('Add', ErrorMsg)
|
||||||
|
end
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
@ -495,11 +544,9 @@ Service CreateInitialLotOperationRecords(LotId)
|
|||||||
ThisInitialProdOperations = Lot_Services('GetPrescribedOperationsByProdId', ProdId, LotType)
|
ThisInitialProdOperations = Lot_Services('GetPrescribedOperationsByProdId', ProdId, LotType)
|
||||||
If Error_Services('NoError') AND ThisInitialProdOperations NE '' then
|
If Error_Services('NoError') AND ThisInitialProdOperations NE '' then
|
||||||
For each ProdOperation in ThisInitialProdOperations using @VM
|
For each ProdOperation in ThisInitialProdOperations using @VM
|
||||||
|
|
||||||
ProdOperationRec = Database_Services('ReadDataRow', 'PRODUCT_OPERATION', ProdOperation)
|
ProdOperationRec = Database_Services('ReadDataRow', 'PRODUCT_OPERATION', ProdOperation)
|
||||||
OperationID = ProdOperationRec<PRODUCT_OPERATION_OPERATION_ID$>
|
OperationID = ProdOperationRec<PRODUCT_OPERATION_OPERATION_ID$>
|
||||||
OperationSequence = ProdOperationRec<PRODUCT_OPERATION_OPERATION_SEQUENCE$>
|
OperationSequence = ProdOperationRec<PRODUCT_OPERATION_OPERATION_SEQUENCE$>
|
||||||
|
|
||||||
LotOperationRecID = Rti_Createguid()
|
LotOperationRecID = Rti_Createguid()
|
||||||
If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then
|
If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then
|
||||||
LotOperationRec = ''
|
LotOperationRec = ''
|
||||||
@ -510,46 +557,47 @@ Service CreateInitialLotOperationRecords(LotId)
|
|||||||
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
||||||
TestRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
TestRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Lot Operation already existed, cannot overwrite'
|
ErrorMessage = 'Error in ':Service:' service. Lot Operation already existed, cannot overwrite.'
|
||||||
end
|
end
|
||||||
|
|
||||||
Next Operation
|
Next Operation
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error getting prescribed operations for lot# ' : LotId
|
ErrorMessage = 'Error in ':Service:' service. Error getting prescribed operations for lot# ' : LotId
|
||||||
end
|
end
|
||||||
|
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Lot ID was null'
|
ErrorMessage = 'Error in ':Service:' service. Null LotID passed into service.'
|
||||||
end
|
|
||||||
If ErrorMessage NE '' then
|
|
||||||
Error_Services('Add', ErrorMessage)
|
|
||||||
end
|
end
|
||||||
|
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
//Returns a @FM delimited list of operations in sequence
|
// Returns a @FM delimited list of operations in sequence
|
||||||
Service GetLotOperationSequence(LotId)
|
Service GetLotOperationSequence(LotId)
|
||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'GetLotOperationSequence'
|
MetricName = 'GetLotOperationSequence'
|
||||||
|
ErrorMsg = ''
|
||||||
LotOperationsInSequence = ''
|
LotOperationsInSequence = ''
|
||||||
If LotID NE '' then
|
If LotID NE '' then
|
||||||
//Get Operations
|
// Get Operations
|
||||||
LotOperations = Xlate('LOT', LotId, LOT_LOT_OPERATIONS$, 'X')
|
LotOperations = Xlate('LOT', LotId, LOT_LOT_OPERATIONS$, 'X')
|
||||||
for each LotOperation in LotOperations using @VM
|
for each LotOperation in LotOperations using @VM
|
||||||
ThisLotOperationSequence = Xlate('LOT_OPERATION', LotOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X')
|
ThisLotOperationSequence = Xlate('LOT_OPERATION', LotOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X')
|
||||||
LotOperationsInSequence<ThisLotOperationSequence> = LotOperation
|
LotOperationsInSequence<ThisLotOperationSequence> = LotOperation
|
||||||
Next LotOperation
|
Next LotOperation
|
||||||
end else
|
end else
|
||||||
//error: lot id was null
|
ErrorMsg = 'Error in ':Service:' service. Null LotID passed into service.'
|
||||||
end
|
end
|
||||||
Response = LotOperationsInSequence
|
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMsg EQ '' then
|
||||||
|
Response = LotOperationsInSequence
|
||||||
|
end else
|
||||||
|
Error_Services('Add', ErrorMsg)
|
||||||
|
end
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -560,7 +608,7 @@ Service GetLotCurrOperationId(LotId)
|
|||||||
|
|
||||||
CurrOperation = ''
|
CurrOperation = ''
|
||||||
If LotID NE '' then
|
If LotID NE '' then
|
||||||
//Get them in sequence first
|
// Get them in sequence first
|
||||||
LotOperationsInSequence = Lot_Services('GetLotOperationSequence', LotId)
|
LotOperationsInSequence = Lot_Services('GetLotOperationSequence', LotId)
|
||||||
for each LotOperation in LotOperationsInSequence using @FM
|
for each LotOperation in LotOperationsInSequence using @FM
|
||||||
ThisLotOperationStartDTM = Xlate('LOT_OPERATION', LotOperation, LOT_OPERATION_DATETIME_IN$, 'X')
|
ThisLotOperationStartDTM = Xlate('LOT_OPERATION', LotOperation, LOT_OPERATION_DATETIME_IN$, 'X')
|
||||||
@ -571,13 +619,15 @@ Service GetLotCurrOperationId(LotId)
|
|||||||
until CurrOperation
|
until CurrOperation
|
||||||
Next LotOperation
|
Next LotOperation
|
||||||
end else
|
end else
|
||||||
//error: lot id was null
|
ErrorMsg = 'Error in ':Service:' service. Null LotID passed into service'
|
||||||
end
|
end
|
||||||
Response = CurrOperation
|
Response = CurrOperation
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -585,11 +635,11 @@ Service GetLotCurrOperationName(LotId)
|
|||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'GetLotCurrOperationName'
|
MetricName = 'GetLotCurrOperationName'
|
||||||
|
ErrorMsg = ''
|
||||||
CurrOperationId = ''
|
CurrOperationId = ''
|
||||||
CurrOperationName = ''
|
CurrOperationName = ''
|
||||||
If LotID NE '' then
|
If LotID NE '' then
|
||||||
//Get them in sequence first
|
// Get them in sequence first
|
||||||
LotOperationsInSequence = Lot_Services('GetLotOperationSequence', LotId)
|
LotOperationsInSequence = Lot_Services('GetLotOperationSequence', LotId)
|
||||||
for each LotOperation in LotOperationsInSequence using @FM
|
for each LotOperation in LotOperationsInSequence using @FM
|
||||||
ThisLotOperationStartDTM = Xlate('LOT_OPERATION', LotOperation, LOT_OPERATION_DATETIME_IN$, 'X')
|
ThisLotOperationStartDTM = Xlate('LOT_OPERATION', LotOperation, LOT_OPERATION_DATETIME_IN$, 'X')
|
||||||
@ -601,13 +651,18 @@ Service GetLotCurrOperationName(LotId)
|
|||||||
until CurrOperationName
|
until CurrOperationName
|
||||||
Next LotOperation
|
Next LotOperation
|
||||||
end else
|
end else
|
||||||
//error: lot id was null
|
ErrorMsg = 'Error in ':Service:' service. Null LotID passed into service.'
|
||||||
end
|
end
|
||||||
Response = CurrOperationName
|
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMsg EQ '' then
|
||||||
|
Response = CurrOperationName
|
||||||
|
end else
|
||||||
|
Error_Services('Add', ErrorMsg)
|
||||||
|
end
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -616,11 +671,11 @@ Service AddLotOperationIntoSequence(LotId, NewOperationId, NewSequence, Rework)
|
|||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
If LotId NE '' then
|
If LotId NE '' then
|
||||||
If NewSequence NE '' AND Num(NewSequence) then
|
If NewSequence NE '' AND Num(NewSequence) then
|
||||||
//Get Current Operations in sequence
|
// Get Current Operations in sequence
|
||||||
LotCurrOperation = Lot_Services('GetLotCurrOperationId', LotId)
|
LotCurrOperation = Lot_Services('GetLotCurrOperationId', LotId)
|
||||||
CurrOperationSequence = Xlate('LOT_OPERATION', LotCurrOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X')
|
CurrOperationSequence = Xlate('LOT_OPERATION', LotCurrOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X')
|
||||||
If CurrOperationSequence LE NewSequence then
|
If CurrOperationSequence LE NewSequence then
|
||||||
//Get Curr Operation Sequence
|
// Get Curr Operation Sequence
|
||||||
Done = False$
|
Done = False$
|
||||||
LotCurrOperationSequence = Lot_Services('GetLotOperationSequence', LotId)
|
LotCurrOperationSequence = Lot_Services('GetLotOperationSequence', LotId)
|
||||||
for each Operation in LotCurrOperationSequence using @Fm setting OpPos
|
for each Operation in LotCurrOperationSequence using @Fm setting OpPos
|
||||||
@ -647,21 +702,19 @@ Service AddLotOperationIntoSequence(LotId, NewOperationId, NewSequence, Rework)
|
|||||||
LotOperationRec<LOT_OPERATION_REWORK$> = Rework
|
LotOperationRec<LOT_OPERATION_REWORK$> = Rework
|
||||||
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
||||||
end else
|
end else
|
||||||
//Error: Lot Operation already existed, cannot overwrite
|
ErrorMessage = 'Error in ':Service:' service. Lot Operation already existed, cannot overwrite'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
//Error: Not allowed to add new operations prior to current operation
|
ErrorMessage = 'Error in ':Service:' service. Not allowed to add new operations prior to current operation'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
//Error: null or invalid sequence passed to routine
|
ErrorMessage = 'Error in ':Service:' service. Null or invalid sequence passed to routine'
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
//Error: Lot id was null
|
ErrorMessage = 'Error in ':Service:' service. Null LotID passed into service.'
|
||||||
end
|
|
||||||
If ErrorMessage NE '' then
|
|
||||||
Error_Services('Add', ErrorMessage)
|
|
||||||
end
|
end
|
||||||
|
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
@ -675,11 +728,7 @@ Service IsLotMovedIn(LotId)
|
|||||||
If RowExists('LOT', LotId) then
|
If RowExists('LOT', LotId) then
|
||||||
CurrOperId = Lot_Services('GetLotCurrOperationId', LotId)
|
CurrOperId = Lot_Services('GetLotCurrOperationId', LotId)
|
||||||
CurrOperDtmIn = Database_Services('ReadDataColumn', 'LOT_OPERATION', CurrOperId, LOT_OPERATION_DATETIME_IN$, True$, 0, False$)
|
CurrOperDtmIn = Database_Services('ReadDataColumn', 'LOT_OPERATION', CurrOperId, LOT_OPERATION_DATETIME_IN$, True$, 0, False$)
|
||||||
If CurrOperDtmIn LE Datetime() AND CurrOperDtmIn NE '' then
|
Response = ( (CurrOperDtmIn LE Datetime()) AND (CurrOperDtmIn NE '') )
|
||||||
Response = True$
|
|
||||||
end else
|
|
||||||
Response = False$
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
@ -699,9 +748,9 @@ Service IsOperationCompleted(LotOperationId)
|
|||||||
ErrorMessage = 'Invalid lot operation id passed to routine.'
|
ErrorMessage = 'Invalid lot operation id passed to routine.'
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then
|
If ErrorMessage NE '' then
|
||||||
Error_Services('Add', 'Error in ' : service : ' with Lot OperationId ' : LotOperationId : ' : ' : ErrorMessage)
|
Error_Services('Add', 'Error in ' : Service : ' with Lot OperationId ' : LotOperationId : ' : ' : ErrorMessage)
|
||||||
end
|
end
|
||||||
response = OperationCompleted
|
Response = OperationCompleted
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
@ -725,17 +774,26 @@ Service StartLot(LotId, Operator)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error in ':Service:' process. Lot id was not passed to routine.'
|
ErrorMessage = 'Error in ':Service:' process. Lot id was not passed to routine.'
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then
|
|
||||||
|
EndTick = GetTickCount()
|
||||||
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, Service, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMessage EQ '' then
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
LogData<2> = LotID
|
LogData<2> = LotID
|
||||||
LogData<3> = Operator
|
LogData<3> = Operator
|
||||||
LogData<4> = 'Successfully started lot.'
|
LogData<4> = 'Successfully started lot.'
|
||||||
Logging_Services('AppendLog', objLotStartLog, LogData, @RM, @FM, False$)
|
Logging_Services('AppendLog', objLotStartLog, LogData, @RM, @FM, False$)
|
||||||
|
end else
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM
|
||||||
|
LogData<2> = LotID
|
||||||
|
LogData<3> = Operator
|
||||||
|
LogData<4> = 'Error starting lot.'
|
||||||
|
Logging_Services('AppendLog', objLotStartLog, LogData, @RM, @FM, False$)
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
EndTick = GetTickCount()
|
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, Service, StartTick, EndTick)
|
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
@ -754,7 +812,11 @@ Service BeginRun(LotId, Operator, ToolId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error in ':Service:' process. Lot id, Operator, or ToolId was not passed to routine.'
|
ErrorMessage = 'Error in ':Service:' process. Lot id, Operator, or ToolId was not passed to routine.'
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then
|
|
||||||
|
EndTick = GetTickCount()
|
||||||
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, Service, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMessage EQ '' then
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
LogData<2> = LotID
|
LogData<2> = LotID
|
||||||
@ -762,10 +824,16 @@ Service BeginRun(LotId, Operator, ToolId)
|
|||||||
LogData<4> = ToolId
|
LogData<4> = ToolId
|
||||||
LogData<4> = 'Successfully began run.'
|
LogData<4> = 'Successfully began run.'
|
||||||
Logging_Services('AppendLog', objLotRunLog, LogData, @RM, @FM, False$)
|
Logging_Services('AppendLog', objLotRunLog, LogData, @RM, @FM, False$)
|
||||||
|
end else
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM
|
||||||
|
LogData<2> = LotID
|
||||||
|
LogData<3> = Operator
|
||||||
|
LogData<4> = ToolId
|
||||||
|
LogData<4> = 'Error beginning run.'
|
||||||
|
Logging_Services('AppendLog', objLotRunLog, LogData, @RM, @FM, False$)
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
EndTick = GetTickCount()
|
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, Service, StartTick, EndTick)
|
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
@ -784,18 +852,28 @@ Service EndRun(LotId, Operator, ToolId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error in ':Service:' process. Lot id, Operator, or ToolId was not passed to routine.'
|
ErrorMessage = 'Error in ':Service:' process. Lot id, Operator, or ToolId was not passed to routine.'
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then
|
|
||||||
|
EndTick = GetTickCount()
|
||||||
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, Service, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMessage EQ '' then
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
LogData<2> = LotID
|
LogData<2> = LotID
|
||||||
LogData<3> = Operator
|
LogData<3> = Operator
|
||||||
LogData<4> = ToolId
|
LogData<4> = ToolId
|
||||||
LogData<4> = 'Successfully edned run.'
|
LogData<4> = 'Successfully ended run.'
|
||||||
|
Logging_Services('AppendLog', objLotRunLog, LogData, @RM, @FM, False$)
|
||||||
|
end else
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM
|
||||||
|
LogData<2> = LotID
|
||||||
|
LogData<3> = Operator
|
||||||
|
LogData<4> = ToolId
|
||||||
|
LogData<4> = 'Error ending run.'
|
||||||
Logging_Services('AppendLog', objLotRunLog, LogData, @RM, @FM, False$)
|
Logging_Services('AppendLog', objLotRunLog, LogData, @RM, @FM, False$)
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
EndTick = GetTickCount()
|
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, Service, StartTick, EndTick)
|
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
@ -804,7 +882,6 @@ Service MoveInLot(LotID, Operator)
|
|||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'MoveInLot'
|
MetricName = 'MoveInLot'
|
||||||
|
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
ThisLotCurrOperationID = ''
|
ThisLotCurrOperationID = ''
|
||||||
If LotId NE '' then
|
If LotId NE '' then
|
||||||
@ -849,19 +926,27 @@ Service MoveInLot(LotID, Operator)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error in Move In process. Lot id was not passed to routine.'
|
ErrorMessage = 'Error in Move In process. Lot id was not passed to routine.'
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then
|
|
||||||
|
EndTick = GetTickCount()
|
||||||
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMessage EQ '' then
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
LogData<2> = LotID
|
LogData<2> = LotID
|
||||||
LogData<3> = Operator
|
LogData<3> = Operator
|
||||||
LogData<4> = 'Successfully Moved Lot into operation ' : ThisLotCurrOperationID : '.'
|
LogData<4> = 'Successfully Moved Lot into operation ' : ThisLotCurrOperationID : '.'
|
||||||
Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$)
|
Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$)
|
||||||
|
end else
|
||||||
|
LogData = ''
|
||||||
|
LogData<1> = LoggingDTM
|
||||||
|
LogData<2> = LotID
|
||||||
|
LogData<3> = Operator
|
||||||
|
LogData<4> = 'Error moving Lot into operation ' : ThisLotCurrOperationID : '.'
|
||||||
|
Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$)
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -869,7 +954,6 @@ Service MoveOutLot(LotID, Operator)
|
|||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'MoveOutLot'
|
MetricName = 'MoveOutLot'
|
||||||
|
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
ThisLotCurrOperationID = ''
|
ThisLotCurrOperationID = ''
|
||||||
If LotId NE '' then
|
If LotId NE '' then
|
||||||
@ -912,14 +996,17 @@ Service MoveOutLot(LotID, Operator)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error in Move Out process. Lot id was not passed to routine.'
|
ErrorMessage = 'Error in Move Out process. Lot id was not passed to routine.'
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then
|
|
||||||
|
EndTick = GetTickCount()
|
||||||
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMessage EQ '' then
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
LogData<2> = LotID
|
LogData<2> = LotID
|
||||||
LogData<3> = Operator
|
LogData<3> = Operator
|
||||||
LogData<4> = 'Successfully Moved Lot out of operation ' : ThisLotCurrOperationID : '.'
|
LogData<4> = 'Successfully Moved Lot out of operation ' : ThisLotCurrOperationID : '.'
|
||||||
Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$)
|
Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$)
|
||||||
Error_Services('Add', ErrorMessage)
|
|
||||||
end else
|
end else
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = LoggingDTM
|
LogData<1> = LoggingDTM
|
||||||
@ -930,9 +1017,6 @@ Service MoveOutLot(LotID, Operator)
|
|||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -940,16 +1024,13 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
|||||||
|
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
JsonString = ''
|
JsonString = ''
|
||||||
If FullObject EQ '' then
|
If FullObject EQ '' then FullObject = True$
|
||||||
FullObject = True$
|
|
||||||
end
|
|
||||||
If RowExists('LOT', LotId) then
|
If RowExists('LOT', LotId) then
|
||||||
objJSON = ''
|
objJSON = ''
|
||||||
If SRP_JSON(objJSON, 'New', 'Object') then
|
If SRP_JSON(objJSON, 'New', 'Object') then
|
||||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
If SRP_JSON(objLot, 'New', 'Object') then
|
If SRP_JSON(objLot, 'New', 'Object') then
|
||||||
|
|
||||||
SRP_JSON(objLot, 'SetValue', 'LotId', LotId)
|
SRP_JSON(objLot, 'SetValue', 'LotId', LotId)
|
||||||
SRP_JSON(objLot, 'SetValue', 'Type', LotRec<LOT_TYPE$>)
|
SRP_JSON(objLot, 'SetValue', 'Type', LotRec<LOT_TYPE$>)
|
||||||
SRP_JSON(objLot, 'SetValue', 'ProdId', LotRec<LOT_PROD_ID$>)
|
SRP_JSON(objLot, 'SetValue', 'ProdId', LotRec<LOT_PROD_ID$>)
|
||||||
@ -973,7 +1054,7 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
|||||||
MostRecentEventDtmOConv = OConv(MostRecentEventDtmIConv, 'DT')
|
MostRecentEventDtmOConv = OConv(MostRecentEventDtmIConv, 'DT')
|
||||||
SRP_JSON(objLot, 'SetValue', 'MostRecentEventDateTime', MostRecentEventDtmOConv)
|
SRP_JSON(objLot, 'SetValue', 'MostRecentEventDateTime', MostRecentEventDtmOConv)
|
||||||
If FullObject then
|
If FullObject then
|
||||||
//Events Array
|
// Events Array
|
||||||
EventsArrayJson = ''
|
EventsArrayJson = ''
|
||||||
If SRP_Json(EventsArrayJson, 'New', 'Array') then
|
If SRP_Json(EventsArrayJson, 'New', 'Array') then
|
||||||
LotEventKeys = Lot_Event_Services('GetLotEventsInSequence', LotId)
|
LotEventKeys = Lot_Event_Services('GetLotEventsInSequence', LotId)
|
||||||
@ -1003,7 +1084,7 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error Creating Events JSON Array'
|
ErrorMessage = 'Error Creating Events JSON Array'
|
||||||
end
|
end
|
||||||
//Operations Array
|
// Operations Array
|
||||||
OperationsArrayJson = ''
|
OperationsArrayJson = ''
|
||||||
If SRP_Json(OperationsArrayJson, 'New', 'Array') then
|
If SRP_Json(OperationsArrayJson, 'New', 'Array') then
|
||||||
LotOperationKeys = Lot_Services('GetLotOperationSequence', LotId)
|
LotOperationKeys = Lot_Services('GetLotOperationSequence', LotId)
|
||||||
@ -1053,10 +1134,12 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Invalid or null lot number passed to routine.'
|
ErrorMessage = 'Invalid or null lot number passed to routine.'
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then
|
|
||||||
|
If ErrorMessage EQ '' then
|
||||||
|
Response = JsonString
|
||||||
|
end else
|
||||||
Error_Services('Add', ErrorMessage)
|
Error_Services('Add', ErrorMessage)
|
||||||
end
|
end
|
||||||
Response = JsonString
|
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
@ -1079,13 +1162,12 @@ Service OpenLot(LotId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Unable to Open Lot ' : LotId : '. Lot ID was not found in LOT table.'
|
ErrorMessage = 'Unable to Open Lot ' : LotId : '. Lot ID was not found in LOT table.'
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then
|
|
||||||
Error_Services('Add', ErrorMessage)
|
|
||||||
end
|
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -1093,7 +1175,6 @@ Service CloseLot(LotId)
|
|||||||
|
|
||||||
StartTick = GetTickCount()
|
StartTick = GetTickCount()
|
||||||
MetricName = 'CloseLot'
|
MetricName = 'CloseLot'
|
||||||
|
|
||||||
ErrorMessage = ''
|
ErrorMessage = ''
|
||||||
If RowExists('LOT', LotId) then
|
If RowExists('LOT', LotId) then
|
||||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
|
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
|
||||||
@ -1107,13 +1188,12 @@ Service CloseLot(LotId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Unable to Close Lot ' : LotId : '. Lot ID was not found in LOT table.'
|
ErrorMessage = 'Unable to Close Lot ' : LotId : '. Lot ID was not found in LOT table.'
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then
|
|
||||||
Error_Services('Add', ErrorMessage)
|
|
||||||
end
|
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -1171,7 +1251,7 @@ Service AutoCloseTestWaferLot(LotId, CloseUserId)
|
|||||||
ErrorMessage = CloseUserId : ' does not have permission to close this lot.'
|
ErrorMessage = CloseUserId : ' does not have permission to close this lot.'
|
||||||
end
|
end
|
||||||
If ErrorMessage EQ '' then
|
If ErrorMessage EQ '' then
|
||||||
//Close Lot as there were no validation failures.
|
// Close Lot as there were no validation failures.
|
||||||
Lot_Services('CloseLot', LotId)
|
Lot_Services('CloseLot', LotId)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
LogData = ''
|
LogData = ''
|
||||||
@ -1188,7 +1268,7 @@ Service AutoCloseTestWaferLot(LotId, CloseUserId)
|
|||||||
LogData<3> = CloseUserId
|
LogData<3> = CloseUserId
|
||||||
LogData<4> = 'Error marking lot as closed.' : ErrorMessage
|
LogData<4> = 'Error marking lot as closed.' : ErrorMessage
|
||||||
Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$)
|
Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$)
|
||||||
//Send a message to FI
|
// Send a message to FI
|
||||||
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X')
|
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X')
|
||||||
SentFrom = 'SYSTEM'
|
SentFrom = 'SYSTEM'
|
||||||
Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE'
|
Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE'
|
||||||
@ -1204,7 +1284,7 @@ Service AutoCloseTestWaferLot(LotId, CloseUserId)
|
|||||||
LogData<3> = CloseUserId
|
LogData<3> = CloseUserId
|
||||||
LogData<4> = 'Error marking lot as closed.' : ErrorMessage
|
LogData<4> = 'Error marking lot as closed.' : ErrorMessage
|
||||||
Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$)
|
Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$)
|
||||||
//Send a message to FI
|
// Send a message to FI
|
||||||
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X')
|
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X')
|
||||||
SentFrom = 'SYSTEM'
|
SentFrom = 'SYSTEM'
|
||||||
Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE'
|
Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE'
|
||||||
@ -1255,7 +1335,7 @@ Service ReduceLotWaferCount(LotId, ReductionQty, OperatorId)
|
|||||||
LotRec<LOT_WAFER_QTY$> = LotNewWfrQty
|
LotRec<LOT_WAFER_QTY$> = LotNewWfrQty
|
||||||
Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$)
|
Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
//Write Lot Event
|
// Write Lot Event
|
||||||
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'REDUCE_WAFER_QTY', 'Reduced wafer count by ' : ReductionQty, '', OperatorId, False$, '')
|
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'REDUCE_WAFER_QTY', 'Reduced wafer count by ' : ReductionQty, '', OperatorId, False$, '')
|
||||||
if LotNewWfrQty EQ 0 AND LotType EQ 'TW' then
|
if LotNewWfrQty EQ 0 AND LotType EQ 'TW' then
|
||||||
ServiceParms = 'AutoCloseTestWaferLot' : @VM : LotId : @VM : 'SYSTEM'
|
ServiceParms = 'AutoCloseTestWaferLot' : @VM : LotId : @VM : 'SYSTEM'
|
||||||
@ -1285,13 +1365,12 @@ Service ReduceLotWaferCount(LotId, ReductionQty, OperatorId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error in Reduce Lot Wafer Count service, Lot Id ' : LotId : ' not found in lot table.'
|
ErrorMessage = 'Error in Reduce Lot Wafer Count service, Lot Id ' : LotId : ' not found in lot table.'
|
||||||
end
|
end
|
||||||
if ErrorMessage NE '' then
|
|
||||||
Error_Services('Add', ErrorMessage)
|
|
||||||
end
|
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -1314,7 +1393,7 @@ Service IncreaseLotWaferCount(LotId, IncreaseQty, OperatorId)
|
|||||||
LotRec<LOT_WAFER_QTY$> = LotNewWfrQty
|
LotRec<LOT_WAFER_QTY$> = LotNewWfrQty
|
||||||
Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$)
|
Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$)
|
||||||
If Error_Services('NoError') then
|
If Error_Services('NoError') then
|
||||||
//Write Lot Event
|
// Write Lot Event
|
||||||
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'INCREASE_WAFER_QTY', 'Increased wafer count by ' : IncreaseQty, '', OperatorId, False$, '')
|
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'INCREASE_WAFER_QTY', 'Increased wafer count by ' : IncreaseQty, '', OperatorId, False$, '')
|
||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error in Increase Lot Wafer Count service, Error writing Lot Id ' : LotId : ' with new quantity.'
|
ErrorMessage = 'Error in Increase Lot Wafer Count service, Error writing Lot Id ' : LotId : ' with new quantity.'
|
||||||
@ -1337,13 +1416,12 @@ Service IncreaseLotWaferCount(LotId, IncreaseQty, OperatorId)
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Error in Increase Lot Wafer Count service, Lot Id ' : LotId : ' not found in lot table.'
|
ErrorMessage = 'Error in Increase Lot Wafer Count service, Lot Id ' : LotId : ' not found in lot table.'
|
||||||
end
|
end
|
||||||
if ErrorMessage NE '' then
|
|
||||||
Error_Services('Add', ErrorMessage)
|
|
||||||
end
|
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
@ -1427,12 +1505,15 @@ Service CreateNewVoidedLotRecord(LotId, LegacyLotId, LotType=LOT_TYPES, Username
|
|||||||
end else
|
end else
|
||||||
ErrorMessage = 'Username ' : Username : ' passed to CreateVoidedLotRecord routine does not exist.'
|
ErrorMessage = 'Username ' : Username : ' passed to CreateVoidedLotRecord routine does not exist.'
|
||||||
end
|
end
|
||||||
If ErrorMessage NE '' then
|
|
||||||
//Todo Log Error Message
|
|
||||||
end
|
|
||||||
|
|
||||||
EndTick = GetTickCount()
|
EndTick = GetTickCount()
|
||||||
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
|
||||||
|
|
||||||
|
If ErrorMessage NE '' then Error_Services('Add', ErrorMessage)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
// Internal GoSubs
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user