open-insight/LSL2/OIEVENT/WRITE/SCHEDULE_SRL..json
Infineon\StieberD 7762b129af pre cutover push
2024-09-04 20:33:41 -07:00

11 lines
16 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare function rowexists, msg, fieldcount, next_key\r\ndeclare subroutine forward_event, create_note\r\n$insert logical\r\n$insert quote_srl_equ\r\n$insert quote_spec_equ\r\n$insert msg_equates\r\n$insert recipe_equ\r\n$insert rds_equ\r\n$insert rds_layer_info_equ\r\n$insert recipe_layer_info_equ\r\n\r\nVoid = utility( 'CURSOR', 'H' )\r\nequ RunOrdNo$ to 1\r\nequ RDSNo$ to 2\r\nequ WafersSched$ to 3\r\n\r\nLockMessage = ''\r\nif rowexists( 'SCHEDULE_SRL', .schedule_no->text ) else\r\n .entry_id->text = @user4\r\nend\r\n\r\nSepLayCnt = .sep_layer_cnt->text\r\nif num( SepLayCnt ) else\r\n SepLayCnt = 1\r\nend\r\nNoSave = false$\r\nORDSDetail = get_property( @window, '@OrigRDSDetail' )\r\nRDSDetail = .rds_detail->array\r\nRDSNos = RDSDetail<RDSNo$>\r\nOrigRDSNos = RDSNos\r\n* Pull off Fields that will be used to update the RDS\r\nTorderLine = .order_detail_line->array\r\nQuoteNo = .quote_no->text\r\nScheduleNo = .schedule_no->text\r\nOrderNo = .order_no->text\r\nPO = .po->text\r\nCustNo = .cust_no->text\r\nPartNum = '' ;* srl does not use part and lot num\r\nLotNum = ''\r\nWo = .wo->text\r\n*\r\n*if ( OrderDetail <> OOrderDetail ) or ( .po->text <> OrigPo ) or ( .cust_no->text <> OrigCustNo ) then\r\nQuoteRec = xlate( 'QUOTE_SRL', QuoteNo, '', 'X' )\r\nSpecSubstrate = QuoteRec<quote_srl_spec_substrate$>\r\nSpecEpi = QuoteRec<quote_srl_spec_epi$>\r\nEpiLayers = field( SpecEpi, char(245), 1 )\r\nEpiOther = field( SpecEpi, char(245), 2 ) \r\nconvert char(247) to @fm in EpiLayers ;* each seperate layer \r\nForceUpdate = .force_update->check\r\nRow = 1\r\nRcnt = fieldcount( RDSDetail<1>, @vm )\r\nfor Row = 1 to Rcnt step SepLayCnt\r\n for i = 1 to SepLayCnt\r\n Trow = Row+i-1\r\n\t ThisRDSLine = RDSDetail<RunOrdNo$,TRow>:@vm:@vm:RDSDetail<WafersSched$,TRow>\r\n\t ThisORDSLine= ORDSDetail<RunOrdNo$,TRow>:@vm:@vm:ORDSDetail<WafersSched$,TRow>:@vm\r\n\t if ( ForceUpdate ) or ( ThisRDSLine <> ThisORDSLine ) or (( ThisRDSLine <> @vm ) and ( ThisRDSLine<1,RDSNo$> = '' ) ) then\r\n\t * this row has been changed/added\r\n\t CurRunOrdNo = ThisRDSLine<1,RunOrdNo$>\r\n\t CurWafersSched = ThisRDSLine<1,WafersSched$>\r\n\t if CurRunOrdNo and CurWafersSched then\r\n * now each epi layer; oh fuck i don't want to code this mess\r\n\t\t\t\tThisSepLayer = EpiLayers<i>\r\n\t\t\t\tgosub UpdateRDS\r\n end else\r\n if CurRunOrdNo = '' and CurWafersSched = '' else\r\n\t\t NoSave = true$\r\n\t\t MsgInfo = ''\r\n\t\t MsgInfo<micon$> = '!'\r\n\t\t MsgInfo<mtext$> = 'RDS Detail line ':TRow:' must have a Run Order Number and Wafers Scheduled. No Run Data Sheet created/updated for this line.'\r\n\t\t Void = msg( '', MsgInfo )\r\n\t\t end\r\n\t end\r\n\t end \r\n\tnext i\r\nnext Row\r\nif RDSNos <> OrigRDSNos then\r\n RDSDetail = .rds_detail->array\r\n RDSDetail<RDSNo$> = RDSNos\r\n .rds_detail->array = RDSDetail\r\nend\r\nVoid = utility( 'CURSOR', 'A' )\r\nif NoSave else\r\n forward_event( CtrlEntId, CtrlClassId )\r\nend\r\nif LockMessage then\r\n LockMessage[-2,2] = ''\r\n MsgInfo = ''\r\n MsgInfo<mtext$> = LockMessage\r\n MsgInfo<micon$> = '!'\r\n Void = msg( '', MsgInfo )\r\nend\r\nif RdsNos <> OrigRdsNos then\r\n TRds = RdsNos\r\n swap @vm:@vm with '' in TRds\r\n if TRds[-1,1] = @vm then TRds[-1,1] = ''\r\n swap @vm with ', ' in TRds\r\n TRds := '.'\r\n MsgInfo = ''\r\n MsgInfo<micon$> = '!'\r\n MsgInfo<mtext$> = 'The following Run Data Sheets were created ':TRds\r\n Void = msg( '', MsgInfo )\r\nend\r\n\r\nreturn 0\r\n*===========================================================================*\r\nUpdateRDS:\r\n RDSRec = ''\r\n open 'RDS' to RDSTable else\r\n\t Void = msg( '', 'Unable to open RDS...' )\r\n\t\treturn 0\r\n end\r\n KeyToUse = RDSNos<1,TRow>\r\n Update = true$\r\n if KeyToUse then\r\n Exists = true$\r\n lock RDSTable, KeyToUse then\r\n RDSRec = xlate( 'RDS', KeyToUse, '', 'X' )\r\n end else\r\n if LockMessage else\r\n LockMessage = 'Unable to lock RDS no(s). Try at a later point. '\r\n end\r\n LockMessage := KeyToUse :', '\r\n Update = false$\r\n end \r\n end else\r\n if i = 1 then ;* first seperate layer get next key\r\n KeyToUse = next_key( 'RDS', RDSTable, 'NEXT', '' )\r\n\t end else\r\n\t for j = Trow-1 to 1 step -1\r\n\t KeyToUse = field( RDSNos<1,Trow-1>, '.', 1 )\r\n\t if KeyToUse then \r\n\t KeyToUse := '.':i\r\n\t end\r\n\t until KeyToUse\r\n\t next j\r\n\t lock RDSTable, KeyToUse else\r\n\t if LockMessage else\r\n\t LockMessage = 'Unable to lock RDS no(s). Try at a later point. '\r\n\t LockMessage := KeyToUse :', '\r\n\t Update = false$\r\n\t end\r\n end\r\n end\r\n\t Exists = false$\r\n RDSRec = ''\r\n RDSRec<rds_entry_id$> = @user4\r\n RDSRec<rds_entry_date$> = date() \r\n\t RDSRec<rds_status$> = 'O'\r\n\t RDSRec<rds_lsl_co$> = 'SRL'\r\n end\r\n if Update then\r\n ConMinThick = ThisSepLayer<1,QSEpiConcMinThick$> ;* could have @svm\r\n ConMaxThick = ThisSepLayer<1,QSEpiConcMaxThick$> ;* could have @svm\r\n TcCnt = fieldcount( ConMinThick, @svm )\r\n for zz = 1 to TcCnt\r\n ConMinThick<1,1,zz> = iconv( ConMinThick<1,1,zz>, 'MS' )\r\n next zz\r\n TcCnt = fieldcount( ConMaxThick, @svm )\r\n for zz = 1 to TcCnt\r\n ConMaxThick<1,1,zz> = iconv( ConMaxThick<1,1,zz>, 'MS' )\r\n next zz\r\n convert @svm to @vm in ConMaxThick\r\n convert @svm to @vm in ConMinThick\r\n ConUnits = ThisSepLayer<1,QSEpiConcUnits$> \r\n\t ResMinThick = ThisSepLayer<1,QSEpiResMinThick$> \r\n\t ResMaxThick = ThisSepLayer<1,QSEpiResMaxThick$> \r\n\t ResUnits = ThisSepLayer<1,QSEpiResUnits$> \r\n\t MinThick = ThisSepLayer<1,QSEpiMinThick$> \r\n\t MaxThick = ThisSepLayer<1,QSEpiMaxThick$> \r\n\t ThickUnits = ThisSepLayer<1,QSEpiThickUnits$> \r\n\t LDopant = ThisSepLayer<1,QSEpiDopant$> \r\n\t Recipe = ThisSepLayer<1,QSEpiRecipe$>\r\n\t RecipeRec = xlate( 'RECIPE', Recipe, '', 'X' )\r\n\t * first load the main layer into the run data sheet\r\n\t RDSRec<rds_quote_no$> = QuoteNo\r\n\t RDSRec<rds_schedule_no$> = ScheduleNo\t \r\n\t RDSRec<rds_wo$> = WO\t \r\n\t RDSRec<rds_order_no$> = OrderNo\t \r\n\t RDSRec<rds_po$> = PO\t \r\n\t RDSRec<rds_cust_no$> = CustNo\r\n\t RDSRec<rds_part_num$> = PartNum\r\n\t RDSRec<rds_lot_num$> = LotNum\r\n\t RDSRec<rds_recipe_no$> = Recipe\r\n\t RDSRec<rds_epi_dopant$> = RecipeRec<recipe_epi_dopant$>\r\n\t RDSRec<rds_epi_temp$> = RecipeRec<recipe_epi_temp$>\r\n\t RDSRec<rds_epi_h2_flow$> = RecipeRec<recipe_epi_h2_flow$>\r\n\t RDSRec<rds_epi_diluent$> = RecipeRec<recipe_epi_diluent$>\r\n\t RDSRec<rds_epi_dopant$> = RecipeRec<recipe_epi_dopant$>\r\n\t RDSRec<rds_epi_gases$> = RecipeRec<recipe_epi_gases$>\r\n\t RDSRec<rds_epi_gas_rate$> = RecipeRec<recipe_epi_gas_rate$>\r\n\t RDSRec<rds_epi_gases_unit$> = RecipeRec<recipe_epi_gases_unit$>\r\n\t RDSRec<rds_bake_time$> = RecipeRec<recipe_bake_time$>\r\n\t RDSRec<rds_bake_temp$> = RecipeRec<recipe_bake_temp$>\r\n \t RDSRec<rds_bake_h2$> = RecipeRec<recipe_bake_h2$>\r\n \t RDSRec<rds_bake_susc_rot$> = RecipeRec<recipe_bake_susc_rot$> \t \r\n \t RDSRec<rds_etch_time$> = RecipeRec<recipe_etch_time$>\r\n \t RDSRec<rds_etch_temp$> = RecipeRec<recipe_etch_temp$> \t \t \r\n \t RDSRec<rds_etch_h2$> = RecipeRec<recipe_etch_h2$> \t \t \t \r\n \t RDSRec<rds_etch_hcl$> = RecipeRec<recipe_etch_hcl$> \t \t \t \r\n\t RDSRec<rds_special_inst$> = SpecSubstrate<1,QSSubInstructions$>\r\n\t * concentration\r\n \t ConMinThick = field( ConMinThick, @vm, 1, 2 )\r\n\t ConMaxThick = field( ConMaxThick, @vm, 1, 2 )\r\n RDSRec<rds_con_min$> = ConMinThick \r\n RDSRec<rds_con_max$> = ConMaxThick\r\n if ConMinThick and ConMaxThick then\r\n if ConMinThick = ConMaxThick then\r\n RDSRec<rds_con_target$> = ConMinThick\r\n end else\r\n * is it ok to do int \r\n *Mid = ConMinThick +++ ((ConMaxThick---ConMinThick)///2)\r\n MinLessMax = (ConMaxThick---ConMinThick)\r\n Mcnt = fieldcount(ConMinThick, @vm )\r\n DivVar = str( 2:@vm, Mcnt )\r\n DivVar[-1,1] = ''\r\n Tans = MinLessMax///DivVar\r\n Ans = MinLessMax+++Tans\r\n *RDSRec<rds_con_target$> = Mid\r\n RDSRec<rds_con_target$> = Ans\r\n end\r\n end \r\n RDSRec<rds_con_units$> = ConUnits \r\n * resistivity\r\n RDSRec<rds_res_min$> = ResMinThick \r\n RDSRec<rds_res_max$> = ResMaxThick\r\n\t if ResMinThick and ResMaxThick then\r\n\t if ResMinThick = ResMaxThick then\r\n\t RDSRec<rds_res_target$> = ResMinThick\r\n\t end else\r\n Mid = ResMinThick + ((ResMaxThick-ResMinThick)/2)\r\n RDSRec<rds_res_target$> = Mid\r\n end\t \r\n\t end \r\n\t RDSRec<rds_res_units$> = ResUnits\r\n\t * thickness\r\n\t RDSRec<rds_thick_min$> = MinThick \r\n\t RDSRec<rds_thick_max$> = MaxThick\r\n\t if MinThick and MaxThick then\r\n\t if MinThick = MaxThick then\r\n\t RDSRec<rds_thick_target$> = MinThick\r\n\t end else\r\n\t Mid = MinThick + ((MaxThick-MinThick)/2)\r\n\t RDSRec<rds_thick_target$> = Mid\r\n\t end\r\n\t end \r\n RDSRec<rds_thick_units$> = ThickUnits \r\n * now fill in all same reactor layers\r\n convert char(248) to @fm in ThisSepLayer\r\n RestOfLayers = field( ThisSepLayer, @fm, 2, 9999 )\r\n RolCnt = fieldcount( RestOfLayers, @fm )\r\n RecipeLayerInfo = RecipeRec<recipe_layer_info$>\r\n convert char(248) to @fm in RecipeLayerInfo\r\n RDSLayerInfo = ''\r\n for j = 1 to RolCnt\r\n ThisSameLayer = RestOfLayers<j>\r\n ThisSameRecipeLayer = RecipeLayerInfo<j> \r\n ConMinThick = ThisSameLayer<1,QSEpiConcMinThick$> ;* could have @svm\r\n ConMaxThick = ThisSameLayer<1,QSEpiConcMaxThick$> ;* could have @svm\r\n TcCnt = fieldcount( ConMinThick, @svm )\r\n for zz = 1 to TcCnt\r\n ConMinThick<1,1,zz> = iconv( ConMinThick<1,1,zz>, 'MS' )\r\n next zz\r\n TcCnt = fieldcount( ConMaxThick, @svm )\r\n for zz = 1 to TcCnt\r\n ConMaxThick<1,1,zz> = iconv( ConMaxThick<1,1,zz>, 'MS' )\r\n next zz\r\n ConUnits = ThisSameLayer<1,QSEpiConcUnits$> \r\n\t ResMinThick = ThisSameLayer<1,QSEpiResMinThick$> \r\n\t ResMaxThick = ThisSameLayer<1,QSEpiResMaxThick$> \r\n\t ResUnits = ThisSameLayer<1,QSEpiResUnits$> \r\n\t MinThick = ThisSameLayer<1,QSEpiMinThick$> \r\n\t MaxThick = ThisSameLayer<1,QSEpiMaxThick$> \r\n\t ThickUnits = ThisSameLayer<1,QSEpiThickUnits$> \r\n TLayer = ''\r\n * concentration\r\n \t ConMinThick = field( ConMinThick, @svm, 1, 2 )\r\n\t ConMaxThick = field( ConMaxThick, @svm, 1, 2 )\r\n TLayer<1,RLConMin$> = ConMinThick\r\n TLayer<1,RLConMax$> = ConMaxThick\r\n if ConMinThick and ConMaxThick then\r\n if ConMinThick = ConMaxThick then\r\n TLayer<1,RLConTarget$> = ConMinThick\r\n end else\r\n * is it ok to do int \r\n *Mid = ConMinThick +++ ((ConMaxThick---ConMinThick)///2)\r\n MinLessMax = (ConMaxThick---ConMinThick)\r\n Mcnt = fieldcount(ConMinThick, @svm )\r\n DivVar = str( 2:@svm, Mcnt )\r\n DivVar[-1,1] = ''\r\n Tans = MinLessMax///DivVar\r\n Ans = MinLessMax+++Tans\r\n TLayer<1,RLConTarget$> = Ans \r\n *TLayer<1,RLConTarget$> = Mid\r\n end\r\n end \r\n TLayer<1,RLConUnits$> = ConUnits \r\n * recipe information\r\n TLayer<1,RLRecipeNo$> = Recipe\r\n TLayer<1,RLEpiDopant$> = ThisSameRecipeLayer<1,RecLEpiDopant$>\r\n TLayer<1,RLEpiTemp$> = ThisSameRecipeLayer<1,RecLEpiTemp$>\r\n TLayer<1,RLEpiH2Flow$> = ThisSameRecipeLayer<1,RecLEpiH2Flow$>\r\n TLayer<1,RLEpiDiluent$> = ThisSameRecipeLayer<1,RecLEpiDiluent$>\r\n TLayer<1,RLEpiGases$> = ThisSameRecipeLayer<1,RecLEpiGases$>\r\n TLayer<1,RLEpiGasRate$> = ThisSameRecipeLayer<1,RecLEpiGasRate$>\r\n TLayer<1,RLEpiGasUnit$> = ThisSameRecipeLayer<1,RecLEpiGasesUnit$>\r\n TLayer<1,RLBakeTime$> = ThisSameRecipeLayer<1,RecLBakeTime$>\r\n TLayer<1,RLBakeTemp$> = ThisSameRecipeLayer<1,RecLBakeTemp$>\r\n TLayer<1,RLBakeH2$> = ThisSameRecipeLayer<1,RecLBakeH2$>\r\n TLayer<1,RLBakeSuscRot$> = ThisSameRecipelayer<1,RecLBakeSuscRot$>\r\n TLayer<1,RLEtchTime$> = ThisSameRecipeLayer<1,RecLEtchTime$>\r\n TLayer<1,RLEtchTemp$> = ThisSameRecipeLayer<1,RecLEtchTemp$>\r\n TLayer<1,RLEtchH2$> = ThisSameRecipeLayer<1,RecLEtchH2$>\r\n TLayer<1,RLEtchHcl$> = ThisSameRecipeLayer<1,RecLEtchHcl$>\r\n * Thickness\r\n \t TLayer<1,RLThickMin$> = MinThick \r\n\t TLayer<1,RLThickMax$> = MaxThick\r\n\t if MinThick and MaxThick then\r\n\t if MinThick = MaxThick then\r\n\t TLayer<1,RLThickTarget$> = MinThick\r\n\t end else\r\n\t Mid = MinThick + ((MaxThick-MinThick)/2)\r\n\t TLayer<1,RLThickTarget$> = Mid\r\n\t end\r\n\t end \r\n TLayer<1,RLThickUnits$> = ThickUnits \r\n * resistivity\r\n TLayer<1,RLResMin$> = ResMinThick \r\n TLayer<1,RLResMax$> = ResMaxThick\r\n \t if ResMinThick and ResMaxThick then\r\n\t if ResMinThick = ResMaxThick then\r\n\t TLayer<1,RLResTarget$> = ResMinThick\r\n\t end else\r\n Mid = ResMinThick + ((ResMaxThick-ResMinThick)/2)\r\n TLayer<1,RLResTarget$> = Mid\r\n end\t \r\n\t end \r\n\t TLayer<1,RLResUnits$> = ResUnits\r\n *\r\n RDSLayerInfo := TLayer:char(248)\r\n next j\r\n RDSLayerInfo[-1,1] = ''\r\n RDSRec<rds_layer_info$> = RDSLayerInfo\r\n * now write the record\r\n\t write RDSRec on RDSTable, KeyToUse else\r\n\t Void = msg( '', 'Unable to write ':KeyToUse:' on RDS...' )\r\n\t\t return 0\r\n\t end\r\n\t unlock RDSTable, KeyToUse else\r\n\t Void = msg( '', 'Unable to unlock RDS ':KeyToUse:'...' )\r\n\t return 0\r\n\t end\r\n\t if Exists = false$ and not( index( KeyToUse, '.', 1 ) ) then\r\n\t Void = next_key( 'RDS', RDSTable, 'UPDATE', KeyToUse )\r\n\t end\r\n\tend\r\n\tRDSNos<1,TRow> = KeyToUse\r\nreturn\r\n\r\n*===========================================================================*\r\n"
}
}
}