Re-adding from old branch
This commit is contained in:
committed by
Ouellette Jonathan (CSC FI SPS MESLEO)
parent
ef1744c8b1
commit
3a2ff00722
@ -2,12 +2,15 @@ Compile function NDW_LOG_TEST_WAFER_USAGE_EVENTS(CtrlEntId, Event, @PARAMS)
|
||||
#pragma precomp SRP_PreCompiler
|
||||
#window NDW_LOG_TEST_WAFER_USAGE
|
||||
|
||||
Declare function Get_Property, Error_Services, Test_Run_Services, Reactor_Services, Tool_Services
|
||||
Declare subroutine Set_Property, Error_Services
|
||||
Declare function Get_Property, Error_Services, Test_Run_Services, Reactor_Services, Tool_Services, Database_Services, Lot_Services
|
||||
Declare subroutine Set_Property, Error_Services, Msg, End_Dialog, Lot_Services, PlaceDialog
|
||||
|
||||
$Insert LOGICAL
|
||||
$Insert APP_INSERTS
|
||||
$Insert TEST_RUN_EQUATES
|
||||
$Insert RDS_EQUATES
|
||||
$Insert LOT_EQUATES
|
||||
$Insert TEST_WAFER_PROD_EQUATES
|
||||
$Insert LOT_OPERATION_EQUATES
|
||||
|
||||
GoToEvent Event for CtrlEntId else
|
||||
// Event not implemented
|
||||
@ -20,8 +23,9 @@ Return EventFlow or 1
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Event WINDOW.CREATE(CreateParam)
|
||||
PlaceDialog(-2, -2)
|
||||
Set_Property(@Window, 'VISIBLE', 1)
|
||||
GoSub FillFormMasterData
|
||||
debug
|
||||
PresetRDSNo = ''
|
||||
PresetTestType = ''
|
||||
PresetEquipmentType = ''
|
||||
@ -69,6 +73,168 @@ Event WINDOW.CREATE(CreateParam)
|
||||
|
||||
End Event
|
||||
|
||||
Event Window.CLOSE(CancelFlag, CloseFlags)
|
||||
Result = ''
|
||||
Result<1> = False$
|
||||
End_Dialog(@Window, Result)
|
||||
end event
|
||||
|
||||
Event EDL_LOT_ID.LOSTFOCUS(Flag, FocusID)
|
||||
LotIdString = Get_Property(@Window : '.EDL_LOT_ID', 'TEXT')
|
||||
If LotIdString[1, 4] EQ '1TTW' then
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'TEXT', LotIdString[3, 999])
|
||||
end
|
||||
end event
|
||||
|
||||
Event PUB_ADD_LOT.CLICK()
|
||||
TWLotUseArray = Get_Property(@Window: '.EDT_TW_USAGE', 'LIST')
|
||||
LotId = Get_Property(@Window : '.EDL_LOT_ID', 'TEXT')
|
||||
If LotId NE '' then
|
||||
Found = False$
|
||||
for i = 1 to DCount(TWLotUseArray, @FM)
|
||||
if LotId EQ TWLotUseArray<i, 1> then
|
||||
Found = True$
|
||||
end
|
||||
until Found
|
||||
Next i
|
||||
If Not(Found) then
|
||||
If RowExists('LOT', LotId) then
|
||||
//Check if lot is a test wafer type
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
|
||||
if Error_Services('NoError') AND LotRec NE '' then
|
||||
LotType = LotRec<LOT_TYPE$>
|
||||
LotOpen = LotRec<LOT_OPEN$>
|
||||
LotOnHold = LotRec<LOT_HOLD$>
|
||||
If LotType EQ 'TW' then
|
||||
If LotOpen then
|
||||
If Not(LotOnHold) then
|
||||
LotCurrOperationId = Lot_Services('GetLotCurrOperationId', LotId)
|
||||
LotCurrOperation = XLATE('LOT_OPERATION', LotCurrOperationId, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
If LotCurrOperation EQ 'TW_CREATE' Or LotCurrOperation EQ 'TW_CLOSE' then
|
||||
Msg(@Window, 'Error: Lot ':LotId:' is currently at ' : LotCurrOperation : '. It cannot be used at this time.')
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'TEXT', '')
|
||||
end else
|
||||
TestWaferProdName = Database_Services('ReadDataColumn', 'TEST_WAFER_PROD', LotRec<LOT_PROD_ID$>, TEST_WAFER_PROD_PART_NAME$, True$, 0, False$)
|
||||
TWLotUseArray<-1> = LotId : @VM : TestWaferProdName : @VM : ''
|
||||
Set_Property(@Window : '.EDT_TW_USAGE', 'LIST', TWLotUseArray)
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'TEXT', '')
|
||||
end
|
||||
end else
|
||||
Msg(@Window, 'Error: Lot ':LotId:' is on hold and cannot be used.')
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'TEXT', '')
|
||||
end
|
||||
end else
|
||||
Msg(@Window, 'Error: Lot ':LotId:' is not in an open status.')
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'TEXT', '')
|
||||
end
|
||||
end else
|
||||
Msg(@Window, 'Error: Lot ':LotId:' is not a test wafer lot.')
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'TEXT', '')
|
||||
end
|
||||
end else
|
||||
Msg(@Window, 'Error: Error reading Lot ':LotId:' from LOT table.')
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'TEXT', '')
|
||||
end
|
||||
end else
|
||||
Msg(@Window, 'Error: Lot not found in LOT table.')
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'TEXT', '')
|
||||
end
|
||||
end else
|
||||
Msg(@Window, 'Error: Lot ':LotId:' already exists in the list.')
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'TEXT', '')
|
||||
end
|
||||
end
|
||||
end event
|
||||
|
||||
Event EDT_TW_USAGE.ROWSELCHANGED(SelRow, SelState)
|
||||
If SelRow NE '' then
|
||||
Set_Property(@Window: '.PUB_REMOVE_SELECTED', 'ENABLED', True$)
|
||||
end else
|
||||
Set_Property(@Window: '.PUB_REMOVE_SELECTED', 'ENABLED', False$)
|
||||
end
|
||||
end event
|
||||
|
||||
Event PUB_REMOVE_SELECTED.CLICK()
|
||||
SelectedRow = Get_Property(@Window : '.EDT_TW_USAGE', 'SELPOS')<2>
|
||||
TWLotUseArray = Get_Property(@Window: '.EDT_TW_USAGE', 'LIST')
|
||||
If SelectedRow LE DCount(TWLotUseArray, @FM) then
|
||||
TWLotUseArray = Delete(TWLotUseArray, SelectedRow , 0, 0)
|
||||
end
|
||||
Set_Property(@Window : '.EDT_TW_USAGE', 'LIST', TWLotUseArray)
|
||||
end event
|
||||
|
||||
Event PUB_CLEAR.CLICK()
|
||||
GoSub ClearFormData
|
||||
end event
|
||||
|
||||
Event PUB_SUBMIT.CLICK()
|
||||
debug
|
||||
NotReadyReason = ''
|
||||
//Gather all field information
|
||||
ReasonForTest = Get_Property(@Window : '.CMB_TEST_TYPE', 'TEXT')
|
||||
RelatedRDS = Get_Property(@Window : '.EDL_RDS', 'TEXT')
|
||||
RelatedPSN = Get_Property(@Window : '.EDL_PSN', 'TEXT')
|
||||
EquipmentType = Get_Property(@Window : '.CMB_EQUIP_TYPE', 'TEXT')
|
||||
EquipmentID = Get_Property(@Window : '.CMB_EQUIPMENT_ID', 'TEXT')
|
||||
//Translate selection to IDs. Get Run Type ID
|
||||
SelRunTypeID = '';*Test Run Obj variable
|
||||
RunTypeOpts = Get_Property(@Window, '@RUN_TYPE_OPTS')
|
||||
Locate ReasonForTest in RunTypeOpts<2> using @VM setting rPos then
|
||||
SelRunTypeID = RunTypeOpts<1, rPos>
|
||||
end else
|
||||
NotReadyReason := 'Must select a valid run type reason.' : CRLF$
|
||||
end
|
||||
//Translate Equipment Type. R for Reactor, T for non-reactor
|
||||
SelEquipType = '';*Test Run Obj variable
|
||||
Begin Case
|
||||
Case EquipmentType EQ 'Reactor'
|
||||
SelEquipType = 'R'
|
||||
Case EquipmentType EQ 'Non-Reactor'
|
||||
SelEquipType = 'T'
|
||||
End Case
|
||||
//Get Test wafer usage data from table
|
||||
TWUsageData = Get_Property(@Window: '.EDT_TW_USAGE', 'LIST')
|
||||
TWLots = ''
|
||||
TWLotQtys = ''
|
||||
for each TWRow in TWUsageData using @FM
|
||||
Quantity = TWRow<1,3>
|
||||
ProdName = TWRow<1,2>
|
||||
TWLot = TWRow<1,1>
|
||||
If Quantity NE '' AND TWLot NE '' then
|
||||
if Num(Quantity) then
|
||||
Begin Case
|
||||
Case Quantity GT 0 AND Quantity LT 25
|
||||
TWLots<1, -1> = TWRow<1,1>
|
||||
TWLotQtys<1, -1> = TWRow<1,3>
|
||||
Case Quantity GT 25
|
||||
NotReadyReason := 'Quantity value for test wafer lot ' : TWLot : ' must be less than 25.' : CRLF$
|
||||
Case Quantity LE 0
|
||||
NotReadyReason := 'Quantity value for test wafer lot ' : TWLot : ' must be greater than 0.' : CRLF$
|
||||
End Case
|
||||
end else
|
||||
NotReadyReason := 'Quantity value for test wafer lot ' : TWLot : ' must be a number' : CRLF$
|
||||
end
|
||||
end else
|
||||
NotReadyReason := 'A quantity of test wafers used is required for test wafer lot ' : TWLot : CRLF$
|
||||
end
|
||||
|
||||
Next TWRow
|
||||
If NotReadyReason EQ '' then
|
||||
TRWaferKey = Test_Run_Services('CreateTestRunRecord', SelRunTypeID, EquipmentType, EquipmentID, RelatedPSN, RelatedRDS, @User4, TWLots, TWLotQtys)
|
||||
If Error_Services('NoError') then
|
||||
Msg(@Window, 'Test Run Created Successfully!')
|
||||
Result = ''
|
||||
Result<1> = True$
|
||||
End_Dialog(@Window, Result)
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
Msg(@Window, 'Error! - ' : ErrorMessage)
|
||||
end
|
||||
end else
|
||||
Msg(@Window, NotReadyReason)
|
||||
end
|
||||
end event
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Internal GoSubs
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -87,7 +253,6 @@ FillFormMasterData:
|
||||
//Get Tool and Reactor Identifiers and buffer them in user defined window properties @REACTOR_OPTS and @NON_REACTOR_OPTS
|
||||
//Reactors
|
||||
ReactorOpts = Reactor_Services('GetReactorNumbers')
|
||||
//Set_Property(@Window : '.EDT_REACTORS', 'TEXT', ReactorOpts)
|
||||
Set_Property(@Window, '@REACTOR_OPTS', ReactorOpts)
|
||||
|
||||
//Non Reactors
|
||||
@ -102,3 +267,13 @@ FillFormMasterData:
|
||||
Set_Property(@Window, '@TW_PROD_OPTS', Prods)
|
||||
Return
|
||||
|
||||
ClearFormData:
|
||||
Set_Property(@Window : '.EDL_LOT_ID', 'TEXT', '')
|
||||
Set_Property(@Window : '.EDL_RDS', 'TEXT', '')
|
||||
Set_Property(@Window : '.EDL_PSN', 'TEXT', '')
|
||||
Set_Property(@Window : '.CMB_EQUIPMENT_ID', 'TEXT', '')
|
||||
Set_Property(@Window : 'CMB_TEST_TYPE', 'TEXT', '')
|
||||
Set_Property(@Window : '.EDT_TW_USAGE', 'LIST', '')
|
||||
return
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user