diff --git a/LSL2/STPROC/MATERIAL_SERVICES.txt b/LSL2/STPROC/MATERIAL_SERVICES.txt index e6396cd..d8a4f2a 100644 --- a/LSL2/STPROC/MATERIAL_SERVICES.txt +++ b/LSL2/STPROC/MATERIAL_SERVICES.txt @@ -619,133 +619,127 @@ end service Service GetAvailableMakeupWafers(WorkOrderNo, KeysOnly=BOOLEAN) AvailableMakeupWafers = '' - If WorkOrderNo NE '' then WorkOrderNo = WorkOrderNo[1, '*'] ; // This might be formatted as a WO_MAT Key ID, so strip off the Cassette No. WOLogRow = Database_Services('ReadDataRow', 'WO_LOG', WorkOrderNo) If Error_Services('NoError') then - WOStepKeys = WOLogRow - WOMatKeys = WOLogRow - FirstWOMatKey = WOMatKeys<0, 1> - WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', FirstWOMatKey) + WOStepKeys = WOLogRow + LastWOStepKey = WOStepKeys[-1, 'B' : @VM] + PartNo = WOLogRow + WOStepRow = Database_Services('ReadDataRow', 'WO_STEP', LastWOStepKey) If Error_Services('NoError') then - PartNo = WOMatRow - LastWOStepKey = WOStepKeys[-1, 'B' : @VM] - WOStepRow = Database_Services('ReadDataRow', 'WO_STEP', LastWOStepKey) + WOStepPSN = WOStepRow + WOStepRDSNos = WOStepRow + WOStepWMOutNos = WOStepRow + ProdSpecRow = Database_Services('ReadDataRow', 'PROD_SPEC', WOStepPSN) If Error_Services('NoError') then - WOStepPSN = WOStepRow - WOStepRDSNos = WOStepRow - WOStepWMOutNos = WOStepRow - ProdSpecRow = Database_Services('ReadDataRow', 'PROD_SPEC', WOStepPSN) + ReactorType = ProdSpecRow + SearchString = '' + SearchTable = 'MAKEUP_WAFERS' + If ReactorType EQ 'EPP' then + SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : 'EPP' : @FM + end else + SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : '#EPP' : @FM + end + + hDictSearchTable = Database_Services('GetTableHandle', 'DICT.' : SearchTable) If Error_Services('NoError') then - ReactorType = ProdSpecRow - SearchString = '' - SearchTable = 'MAKEUP_WAFERS' - If ReactorType EQ 'EPP' then - SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : 'EPP' : @FM + rv = Set_Status(0) + MakeupBoxes = '' + Flag = '' + StatusCode = '' + Btree.Extract(SearchString, SearchTable, hDictSearchTable, MakeupBoxes, '', Flag) + If Get_Status(StatusCode) then + Error_Services('Add', 'Error calling Btree.Extract in the ' : Service : ' service. StatusCode: ' : StatusCode) end else - SearchString := 'EPI_PART_NO' : @VM : PartNo : @FM : 'REACT_TYPE' : @VM : '#EPP' : @FM - end - - hDictSearchTable = Database_Services('GetTableHandle', 'DICT.' : SearchTable) - If Error_Services('NoError') then - rv = Set_Status(0) - MakeupBoxes = '' - Flag = '' - StatusCode = '' - Btree.Extract(SearchString, SearchTable, hDictSearchTable, MakeupBoxes, '', Flag) - If Get_Status(StatusCode) then - Error_Services('Add', 'Error calling Btree.Extract in the ' : Service : ' service. StatusCode: ' : StatusCode) - end else - If MakeupBoxes NE '' then - // One or more makeup was found that matches the customer's part and has the status of 'Ready to Use'. - // Now loop through to find out which ones have the RDS final signature or not. - NumMakeupBoxes = DCount(MakeupBoxes, @VM) - For Each MakeupBoxID in MakeupBoxes using @VM - WOMatKeyID = MakeupBoxID - CurrStatus = Xlate('MAKEUP_WAFERS', MakeupBoxID, 'CURR_STATUS_STATIC', 'X') - // DPC 7/21/20 added HOLD as excluded status type - Locate CurrStatus in 'MT,VOID,SHIP,REJ,HOLD' using ',' setting cPos else - If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then - CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID:@RM:'':@RM:True$) + If MakeupBoxes NE '' then + // One or more makeup was found that matches the customer's part and has the status of 'Ready to Use'. + // Now loop through to find out which ones have the RDS final signature or not. + NumMakeupBoxes = DCount(MakeupBoxes, @VM) + For Each MakeupBoxID in MakeupBoxes using @VM + WOMatKeyID = MakeupBoxID + CurrStatus = Xlate('MAKEUP_WAFERS', MakeupBoxID, 'CURR_STATUS_STATIC', 'X') + // DPC 7/21/20 added HOLD as excluded status type + Locate CurrStatus in 'MT,VOID,SHIP,REJ,HOLD' using ',' setting cPos else + If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then + CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID:@RM:'':@RM:True$) + end else + CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID) + end + If CurrWaferCount GT 0 then + WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', WOMatKeyID) + RDSKeyIDs = WOMatRow + SAPBatchNo = WOMatRow + FirstRDSKeyID = RDSKeyIDs[1, @VM] + RDSRow = Database_Services('ReadDataRow', 'RDS', FirstRDSKeyID) + WMOKey = WOMatRow + If WMOKey NE '' then + WMOFQASig = Xlate('WM_OUT', WMOKey, 'SUP_VER_SIG', 'X') end else - CurrWaferCount = obj_WO_Mat('CurrWaferCnt', WOMatKeyID) + WMOFQASig = '' end - If CurrWaferCount GT 0 then - WOMatRow = Database_Services('ReadDataRow', 'WO_MAT', WOMatKeyID) - RDSKeyIDs = WOMatRow - SAPBatchNo = WOMatRow - FirstRDSKeyID = RDSKeyIDs[1, @VM] - RDSRow = Database_Services('ReadDataRow', 'RDS', FirstRDSKeyID) - WMOKey = WOMatRow - If WMOKey NE '' then - WMOFQASig = Xlate('WM_OUT', WMOKey, 'SUP_VER_SIG', 'X') - end else - WMOFQASig = '' - end - ThisWorkOrderNo = WOMatKeyID[1, '*'] - ThisCassetteNo = WOMatKeyID[Col2() + 1, '*'] - ThisWOLogRow = Database_Services('ReadDataRow', 'WO_LOG', ThisWorkOrderNo) - ThisWOStepKeyID = ThisWOLogRow[-1, 'B' : @VM] - ThisWOStepRow = Database_Services('ReadDataRow', 'WO_STEP', ThisWOStepKeyID) - WOStepRDSNos = ThisWoStepRow - MakeupBoxDet = ThisWorkOrderNo : @SVM - MakeupBoxDet := ThisCassetteNo : @SVM - MakeupBoxDet := WOMatRow : @SVM - MakeupBoxDet := ThisWOStepRow : @SVM - MakeupBoxDet := PartNo : @SVM - MakeupBoxDet := CurrWaferCount : @SVM - MakeupBoxDet := FirstRDSKeyID - // JRO Added PROD_SPEC PARAMETERS 5/8/2020 - If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then - ProdSpecID = Xlate('RDS', WOStepRDSNos<1, 1>, RDS_PROD_SPEC_ID$, 'X') - end else - ProdSpecID = Xlate('RDS', RDSKeyIDs, RDS_PROD_SPEC_ID$, 'X') - end - ActiveStatus = XLATE('PROD_SPEC', ProdSpecID, PROD_SPEC_STATUS$, 'X') - LabelCheck = Count(WOMatRow, 'LBLCHK') - // JRO Added the extra condition for Active Status 5/8/2020 - If ActiveStatus EQ 'A' then - Begin Case + ThisWorkOrderNo = WOMatKeyID[1, '*'] + ThisCassetteNo = WOMatKeyID[Col2() + 1, '*'] + ThisWOLogRow = Database_Services('ReadDataRow', 'WO_LOG', ThisWorkOrderNo) + ThisWOStepKeyID = ThisWOLogRow[-1, 'B' : @VM] + ThisWOStepRow = Database_Services('ReadDataRow', 'WO_STEP', ThisWOStepKeyID) + WOStepRDSNos = ThisWoStepRow + MakeupBoxDet = ThisWorkOrderNo : @SVM + MakeupBoxDet := ThisCassetteNo : @SVM + MakeupBoxDet := WOMatRow : @SVM + MakeupBoxDet := ThisWOStepRow : @SVM + MakeupBoxDet := PartNo : @SVM + MakeupBoxDet := CurrWaferCount : @SVM + MakeupBoxDet := FirstRDSKeyID + // JRO Added PROD_SPEC PARAMETERS 5/8/2020 + If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then + ProdSpecID = Xlate('RDS', WOStepRDSNos<1, 1>, RDS_PROD_SPEC_ID$, 'X') + end else + ProdSpecID = Xlate('RDS', RDSKeyIDs, RDS_PROD_SPEC_ID$, 'X') + end + ActiveStatus = XLATE('PROD_SPEC', ProdSpecID, PROD_SPEC_STATUS$, 'X') + LabelCheck = Count(WOMatRow, 'LBLCHK') + // JRO Added the extra condition for Active Status 5/8/2020 + If ActiveStatus EQ 'A' then + Begin Case + + Case SAPBatchNo EQ '' + // Cassette has not received a batch number from SAP, so it is not yet eligible to be used. + FieldPos = 3 - Case SAPBatchNo EQ '' - // Cassette has not received a batch number from SAP, so it is not yet eligible to be used. - FieldPos = 3 - - Case ( (ReactorType NE 'EPP') and (RDSRow NE '') and (LabelCheck NE FALSE$) ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') and (LabelCheck NE FALSE$) ) - // Cassette has a final signature, so it is eligible to be used. - FieldPos = 1 - - Case ( (ReactorType NE 'EPP') and (RDSRow EQ '') ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig EQ '') ) - // Cassette does not yet have a final signature, so it is not yet eligible to be used. - FieldPos = 2 - - Case ( (ReactorType NE 'EPP') and (RDSRow NE '') and (LabelCheck EQ False$)) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') and (LabelCheck EQ False$)) - // Cassette does not yet have a packing label check, so it is not yet eligible to be used. - FieldPos = 4 - - Case Otherwise$ - // Log these cassettes as we should never end up here. - Null - - End Case - - If KeysOnly EQ True$ then - If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then - WMOFormat = Field(MakeupBoxID, '*', 1):'*1*':Field(MakeupBoxID, '*', 2) - AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WMOFormat) - end else - AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WOMatKeyID) - end + Case ( (ReactorType NE 'EPP') and (RDSRow NE '') and (LabelCheck NE FALSE$) ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') and (LabelCheck NE FALSE$) ) + // Cassette has a final signature, so it is eligible to be used. + FieldPos = 1 + + Case ( (ReactorType NE 'EPP') and (RDSRow EQ '') ) OR ( (ReactorType EQ 'EPP') and (WMOFQASig EQ '') ) + // Cassette does not yet have a final signature, so it is not yet eligible to be used. + FieldPos = 2 + + Case ( (ReactorType NE 'EPP') and (RDSRow NE '') and (LabelCheck EQ False$)) OR ( (ReactorType EQ 'EPP') and (WMOFQASig NE '') and (LabelCheck EQ False$)) + // Cassette does not yet have a packing label check, so it is not yet eligible to be used. + FieldPos = 4 + + Case Otherwise$ + // Log these cassettes as we should never end up here. + Null + + End Case + + If KeysOnly EQ True$ then + If (ReactorType EQ 'EPP') OR (ReactorType EQ 'P') then + WMOFormat = Field(MakeupBoxID, '*', 1):'*1*':Field(MakeupBoxID, '*', 2) + AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WMOFormat) end else - AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, MakeupBoxDet) + AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, WOMatKeyID) end - + end else + AvailableMakeupWafers = Insert(AvailableMakeupWafers, FieldPos, -1, 0, MakeupBoxDet) end + end end - Next MakeupBoxID - end + end + Next MakeupBoxID end end end @@ -1482,5 +1476,3 @@ ClearCursors: return - - diff --git a/LSL2/STPROC/NDW_MAKEUP_WAFERS_EVENTS.txt b/LSL2/STPROC/NDW_MAKEUP_WAFERS_EVENTS.txt index 2db2629..0c85308 100644 --- a/LSL2/STPROC/NDW_MAKEUP_WAFERS_EVENTS.txt +++ b/LSL2/STPROC/NDW_MAKEUP_WAFERS_EVENTS.txt @@ -29,7 +29,6 @@ Function NDW_Makeup_Wafers_Events(CtrlEntId, Event, @PARAMS) 04/13/18 dmb Created initial commuter module. ***********************************************************************************************************************/ - #pragma precomp SRP_PreCompiler #Window NDW_MAKEUP_WAFERS @@ -50,11 +49,11 @@ If Event EQ 'OLE' then Transfer Param1 to Event Transfer Param2 to Param1 Transfer Param3 to Param2 -* Transfer Param4 to Param3 -* Transfer Param5 to Param4 -* Transfer Param6 to Param5 -* Transfer Param7 to Param6 -* Transfer Param8 to Param7 + Transfer Param4 to Param3 + Transfer Param5 to Param4 + Transfer Param6 to Param5 + Transfer Param7 to Param6 + Transfer Param8 to Param7 end GoToEvent Event for CtrlEntID @@ -67,7 +66,7 @@ Return EventFlow else EVENT_CONTINUE$ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Event WINDOW.CREATE(CreateParam) - + ThisWOMatKey = CreateParam ThisWorkOrderNo = ThisWOMatKey[1, '*'] ThisCassetteNo = ThisWOMatKey[Col2() + 1, '*'] @@ -445,6 +444,3 @@ Setup_OLE_Controls: return - - -