Various bug fixes with scanner, form validation within the adjust lot qty form, and added scroll bars on the view lot form
This commit is contained in:
@ -11,7 +11,7 @@ $Insert LOT_EQUATES
|
||||
$Insert LOT_OPERATION_EQUATES
|
||||
|
||||
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 function SRP_Datetime, Database_Services, Test_Run_Services, File_Services, Status, delete, Insert, Datetime, SRP_Json, MemberOf
|
||||
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'
|
||||
@ -318,147 +318,166 @@ Service GetTestWaferLots(ShowOnlyOpenLots)
|
||||
end service
|
||||
|
||||
Service CreateTestRunRecord(RunTypeID, EqpType, EqpID, PSNo, RDSNo, UserID, TWLotIds, TWLotQtys)
|
||||
|
||||
TWRunKey = ''
|
||||
Response = ''
|
||||
ErrorMessage = ''
|
||||
If RunTypeID NE '' AND EqpType NE '' AND EqpID NE '' AND UserID NE '' then
|
||||
RunDTM = SRP_Datetime('Now')
|
||||
TWRunRec = ''
|
||||
TWRunRec<TEST_RUN_RUN_DTM$> = RunDTM
|
||||
TWRunRec<TEST_RUN_RUN_TYPE_ID$> = RunTypeID
|
||||
TWRunRec<TEST_RUN_EQUIPMENT_ID$> = EqpID
|
||||
TWRunRec<TEST_RUN_EQUIPMENT_TYPE$> = EqpType
|
||||
TWRunRec<TEST_RUN_PROD_SPEC_ID$> = PSNo
|
||||
TWRunRec<TEST_RUN_LSL_USER_ID$> = UserID
|
||||
TWRunRec<TEST_RUN_RDS_ID$> = RDSNo
|
||||
TWRunKey = nextkey('TEST_RUN')
|
||||
Database_Services('WriteDataRow', 'TEST_RUN', TWRunKey, TWRunRec)
|
||||
If Error_Services('NoError') then
|
||||
If RowExists('TEST_RUN', TWRunKey) then
|
||||
LogData = ''
|
||||
LogData<1, 1> = LoggingDTM
|
||||
LogData<1, 2> = UserID
|
||||
LogData<1, 3> = 'Successfully created new TEST_RUN record with ID of ' : TWRunKey
|
||||
Logging_Services('AppendLog', objLogTR, LogData, @FM, @VM)
|
||||
//Now create the test wafer usages
|
||||
Success = False$
|
||||
If TWLotIds NE '' then
|
||||
//Supports new logging methods.
|
||||
for each TWLotId in TWLotIds using @VM setting twlPos
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', TWLotId, True$, 0, False$)
|
||||
IsThisLotOnHold = LotRec<LOT_HOLD$>
|
||||
IsThisLotOpen = LotRec<LOT_OPEN$>
|
||||
IsThisLotATWLot = LotRec<LOT_TYPE$> EQ 'TW'
|
||||
ThisLotCurrQty = LotRec<LOT_WAFER_QTY$>
|
||||
ThisLotPartId = LotRec<LOT_PROD_ID$>
|
||||
|
||||
//
|
||||
ThisUsageQty = TWLotQtys<1, twlPos>
|
||||
|
||||
If IsThisLotOpen then
|
||||
If Not(IsThisLotOnHold) then
|
||||
If IsThisLotATWLot then
|
||||
InAtTWInUse = False$
|
||||
Loop
|
||||
LotMovedIn = Lot_Services('IsLotMovedIn', TWLotId)
|
||||
ThisLotCurrOperationId = Lot_Services('GetLotCurrOperationId', TWLotId)
|
||||
ThisLotCurrOperation = Database_Services('ReadDataColumn', 'LOT_OPERATION', ThisLotCurrOperationId, LOT_OPERATION_OPERATION_ID$, True$, 0, False$)
|
||||
Begin Case
|
||||
Case ThisLotCurrOperation EQ 'TW_IN_USE'
|
||||
|
||||
If Not(LotMovedIn) then
|
||||
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_IN', 'Move into TW_IN_USE', '', 0, 0, '', UserID)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
InAtTWInUse = True$
|
||||
end
|
||||
|
||||
Case ThisLotCurrOperation EQ 'TW_READY_TO_USE'
|
||||
|
||||
If Not(LotMovedIn) then
|
||||
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_IN', 'Move into TW_READY_TO_USE', '', 0, 0, '', UserID)
|
||||
end else
|
||||
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_OUT', 'Move out of TW_READY_TO_USE', '', 0, 0, '', UserID)
|
||||
end
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Case Otherwise$
|
||||
ErrorMessage = 'Error: Lot ':TWLotId:' is currently at ' : ThisLotCurrOperation : '. It cannot be used at this time.'
|
||||
End Case
|
||||
Until ErrorMessage NE '' Or InAtTWInUse
|
||||
Repeat
|
||||
If InAtTWInUse then
|
||||
if Num(ThisUsageQty) then
|
||||
If ThisUsageQty GT 0 then
|
||||
//Now check that the usage QTY can be consumed from the TW Lot
|
||||
ThisLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLotId, LOT_WAFER_QTY$, True$, 0, False$)
|
||||
If ThisUsageQty LE ThisLotCurrQty then
|
||||
Abort = false$
|
||||
for i = 1 to ThisUsageQty
|
||||
Test_Run_Services('CreateTestRunWaferRecord',TWRunKey, ThisLotPartId, RunTypeID, TWLotId, UserID)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
until ErrorMessage NE ''
|
||||
Next i
|
||||
If ErrorMessage EQ '' then
|
||||
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'REDUCE_WAFER_QTY', ThisUsageQty : ' wafers consumed from lot.', EqpID, ThisUsageQty, 0, '', UserID)
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Test Run Record routine, ' : TWLotId : ' does not have enough wafers.'
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Test Run Record routine, Invalid qty for lot ' : TWLotId : ' passed to routine.'
|
||||
end
|
||||
end
|
||||
|
||||
end else
|
||||
//Lot is not classified as a test wafer lot.
|
||||
end
|
||||
end else
|
||||
//Lot is on hold
|
||||
end
|
||||
end else
|
||||
//Lot is not open
|
||||
end
|
||||
until ErrorMessage NE ''
|
||||
Next TWLotId
|
||||
If ErrorMessage EQ '' then
|
||||
//commit everything
|
||||
end else
|
||||
//commit nothing, there was an error.
|
||||
end
|
||||
end else
|
||||
//Supports legacy TW logging
|
||||
Response = TWRunKey
|
||||
//Pre-Checks.
|
||||
If TWLotIds NE '' then
|
||||
for each TWLotId in TWLotIds using @VM setting twLotPos
|
||||
ThisTWLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLotId, LOT_WAFER_QTY$, True$, 0, False$)
|
||||
If ThisTWLotCurrQty then
|
||||
ThisTWLotUsageQty = TWLotQtys<1, twLotPos>
|
||||
If ThisTWLotCurrQty LT ThisTWLotUsageQty then
|
||||
ErrorMessage = 'Error in Create Test Run Record routine. Lot # ' : TWLotId : ' does not have enough wafers. Please choose ' : ThisTWLotCurrQty : ' wafers or less.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Test Run Record routine, Generated Test Run Key did not exist in TEST Run table.'
|
||||
ErrorMessage = 'Error in Create Test Run Record routine. Lot # ' : TWLotId : ' has a zero wafer quantity.'
|
||||
end
|
||||
|
||||
Response = TWRunKey
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Until ErrorMessage NE ''
|
||||
Next TWLotId
|
||||
end else
|
||||
If RunTypeID EQ '' then
|
||||
ErrorMessage := 'Run Type ID Missing. '
|
||||
end
|
||||
If EqpType EQ '' then
|
||||
ErrorMessage := 'Equipment Type ID Missing. '
|
||||
end
|
||||
If EqpID EQ '' then
|
||||
ErrorMessage := 'Equipment ID Missing. '
|
||||
end
|
||||
If UserID EQ '' then
|
||||
ErrorMessage := 'User ID Missing. '
|
||||
end
|
||||
ErrorMessage = 'Error in Create Test Run Record routine. No test wafer lots entered.'
|
||||
end
|
||||
If ErrorMessage EQ '' then
|
||||
If RunTypeID NE '' AND EqpType NE '' AND EqpID NE '' AND UserID NE '' then
|
||||
RunDTM = SRP_Datetime('Now')
|
||||
TWRunRec = ''
|
||||
TWRunRec<TEST_RUN_RUN_DTM$> = RunDTM
|
||||
TWRunRec<TEST_RUN_RUN_TYPE_ID$> = RunTypeID
|
||||
TWRunRec<TEST_RUN_EQUIPMENT_ID$> = EqpID
|
||||
TWRunRec<TEST_RUN_EQUIPMENT_TYPE$> = EqpType
|
||||
TWRunRec<TEST_RUN_PROD_SPEC_ID$> = PSNo
|
||||
TWRunRec<TEST_RUN_LSL_USER_ID$> = UserID
|
||||
TWRunRec<TEST_RUN_RDS_ID$> = RDSNo
|
||||
TWRunKey = nextkey('TEST_RUN')
|
||||
Database_Services('WriteDataRow', 'TEST_RUN', TWRunKey, TWRunRec)
|
||||
If Error_Services('NoError') then
|
||||
If RowExists('TEST_RUN', TWRunKey) then
|
||||
LogData = ''
|
||||
LogData<1, 1> = LoggingDTM
|
||||
LogData<1, 2> = UserID
|
||||
LogData<1, 3> = 'Successfully created new TEST_RUN record with ID of ' : TWRunKey
|
||||
Logging_Services('AppendLog', objLogTR, LogData, @FM, @VM)
|
||||
//Now create the test wafer usages
|
||||
Success = False$
|
||||
If TWLotIds NE '' then
|
||||
//Supports new logging methods.
|
||||
for each TWLotId in TWLotIds using @VM setting twlPos
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', TWLotId, True$, 0, False$)
|
||||
IsThisLotOnHold = LotRec<LOT_HOLD$>
|
||||
IsThisLotOpen = LotRec<LOT_OPEN$>
|
||||
IsThisLotATWLot = LotRec<LOT_TYPE$> EQ 'TW'
|
||||
ThisLotCurrQty = LotRec<LOT_WAFER_QTY$>
|
||||
ThisLotPartId = LotRec<LOT_PROD_ID$>
|
||||
|
||||
//
|
||||
ThisUsageQty = TWLotQtys<1, twlPos>
|
||||
|
||||
If IsThisLotOpen then
|
||||
If Not(IsThisLotOnHold) then
|
||||
If IsThisLotATWLot then
|
||||
InAtTWInUse = False$
|
||||
Loop
|
||||
LotMovedIn = Lot_Services('IsLotMovedIn', TWLotId)
|
||||
ThisLotCurrOperationId = Lot_Services('GetLotCurrOperationId', TWLotId)
|
||||
ThisLotCurrOperation = Database_Services('ReadDataColumn', 'LOT_OPERATION', ThisLotCurrOperationId, LOT_OPERATION_OPERATION_ID$, True$, 0, False$)
|
||||
Begin Case
|
||||
Case ThisLotCurrOperation EQ 'TW_IN_USE'
|
||||
|
||||
If Not(LotMovedIn) then
|
||||
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_IN', 'Move into TW_IN_USE', '', 0, 0, '', UserID)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
InAtTWInUse = True$
|
||||
end
|
||||
|
||||
Case ThisLotCurrOperation EQ 'TW_READY_TO_USE'
|
||||
|
||||
If Not(LotMovedIn) then
|
||||
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_IN', 'Move into TW_READY_TO_USE', '', 0, 0, '', UserID)
|
||||
end else
|
||||
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'MOVE_OUT', 'Move out of TW_READY_TO_USE', '', 0, 0, '', UserID)
|
||||
end
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Case Otherwise$
|
||||
ErrorMessage = 'Error: Lot ':TWLotId:' is currently at ' : ThisLotCurrOperation : '. It cannot be used at this time.'
|
||||
End Case
|
||||
Until ErrorMessage NE '' Or InAtTWInUse
|
||||
Repeat
|
||||
If InAtTWInUse then
|
||||
if Num(ThisUsageQty) then
|
||||
If ThisUsageQty GT 0 then
|
||||
//Now check that the usage QTY can be consumed from the TW Lot
|
||||
ThisLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLotId, LOT_WAFER_QTY$, True$, 0, False$)
|
||||
If ThisUsageQty LE ThisLotCurrQty then
|
||||
|
||||
Abort = false$
|
||||
for i = 1 to ThisUsageQty
|
||||
Test_Run_Services('CreateTestRunWaferRecord',TWRunKey, ThisLotPartId, RunTypeID, TWLotId, UserID)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
until ErrorMessage NE ''
|
||||
Next i
|
||||
If ErrorMessage EQ '' then
|
||||
Lot_Services('CreateLotEvent', TWLotId, 'TW', Datetime(), 'REDUCE_WAFER_QTY', ThisUsageQty : ' wafers consumed from lot.', EqpID, ThisUsageQty, 0, '', UserID)
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Test Run Record routine, ' : TWLotId : ' does not have enough wafers.'
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Test Run Record routine, Invalid qty for lot ' : TWLotId : ' passed to routine.'
|
||||
end
|
||||
end
|
||||
|
||||
end else
|
||||
//Lot is not classified as a test wafer lot.
|
||||
end
|
||||
end else
|
||||
//Lot is on hold
|
||||
end
|
||||
end else
|
||||
//Lot is not open
|
||||
end
|
||||
until ErrorMessage NE ''
|
||||
Next TWLotId
|
||||
If ErrorMessage EQ '' then
|
||||
//commit everything
|
||||
end else
|
||||
//commit nothing, there was an error.
|
||||
end
|
||||
end else
|
||||
//Supports legacy TW logging
|
||||
Response = TWRunKey
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Test Run Record routine, Generated Test Run Key did not exist in TEST Run table.'
|
||||
end
|
||||
|
||||
Response = TWRunKey
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
If RunTypeID EQ '' then
|
||||
ErrorMessage := 'Run Type ID Missing. '
|
||||
end
|
||||
If EqpType EQ '' then
|
||||
ErrorMessage := 'Equipment Type ID Missing. '
|
||||
end
|
||||
If EqpID EQ '' then
|
||||
ErrorMessage := 'Equipment ID Missing. '
|
||||
end
|
||||
If UserID EQ '' then
|
||||
ErrorMessage := 'User ID Missing. '
|
||||
end
|
||||
end
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
LogData = ''
|
||||
LogData<1, 1> = LoggingDTM
|
||||
@ -751,6 +770,22 @@ Service GenerateTWCSVReport(StartDTM, StopDTM, SavePath)
|
||||
|
||||
end service
|
||||
|
||||
Service IsNewTWSystemActive(UserId)
|
||||
IsTWSystemActive = False$
|
||||
If UserId EQ '' then
|
||||
UserId = @USER4
|
||||
end
|
||||
TWTrackingSystemActive = Database_Services('ReadDataColumn', 'APP_INFO', 'NEW_TW_SYSTEM_ACTIVE_SWITCH', 1, True$, 0, False$)
|
||||
If TWTrackingSystemActive EQ True$ then
|
||||
IsTWSystemActive = True$
|
||||
end else
|
||||
If MemberOf(UserId, 'TW_TRACKING_TEST') then
|
||||
IsTWSystemActive = True$
|
||||
end
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user