open-insight/LSL2/OIEVENT/CREATE/WO_MAINT_SCHED..json
2024-03-25 15:12:53 -07:00

11 lines
4.5 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare function msg, send_event, admin_user, center_window, memberof, fieldcount, mast_sched_today_date\r\ndeclare subroutine end_dialog\r\n$insert msg_equates\r\n$insert lsl_users_equ\r\n$insert prod_spec_equ\r\n$insert quote_spec_equ\r\n$insert wo_log_equ\r\n$INSERT WO_STEP_EQU\r\n\r\nif index( CreateParam, 'CENTER', 1 ) then\r\n void = center_window( @window )\r\nend else\r\n Void = set_property( @window, 'VISIBLE', 1 )\r\nend\r\nopen 'CONFIG' to ConfigTable else\r\n Void = msg( '', 'Unable to open CONFIG table' )\r\n end_dialog( @window, '' )\r\n return 0\r\nend\r\n\r\ngosub DoRead\r\n\r\nCurDate = mast_sched_today_date( '' )\r\nCurLabels = .sched_info->label\r\nlocate CurDate in CurLabels using @fm setting Fpos then\r\n .sched_info->selpos = FPos:@fm:20\r\nend else\r\n .sched_info->selpos = 1:@fm:20\r\nend\r\nRETURN 0\r\n*===========================================================================*\r\nDoRead:\r\nVoid = utility( 'CURSOR', 'H' )\r\nread MastSched from ConfigTable, 'WO_MAST_SCHED' then\r\n if MastSched then\r\n Days = MastSched<1>\r\n convert @vm to @fm in Days\r\n .sched_info->label = Days\r\n .month->text = MastSched<2>\r\n ReactCnt = MastSched<3>\r\n .reactor_cnt->text = ReactCnt\r\n SchedInfo = field( MastSched, @fm, 4, 99999 )\r\n SCnt = fieldcount( SchedInfo, @fm )\r\n for i = 1 to SCnt\r\n SchedInfo<i> = field( SchedInfo<i>, @vm, 1, ReactCnt )\r\n\t for j = 1 to ReactCnt\r\n\t if SchedInfo<i,j> = '' then\r\n\t SchedInfo<i,j> = 'Open'\r\n\t end else\r\n\t * NOW TAKE THE LAST WORK ORDER FOR EACH DAY \r\n\t * READ THE PSN PARSE AND LOAD THE INFO INTO EACH CELL\r\n\t if SchedInfo<i,j> <> '|' then\r\n\t\t WOCell = SchedInfo<i,j>\r\n\t\t \r\n\t\t WONo\t= ICONV( WOCell, '[WO_VALID,1]' )\t\t;* Changed to WO Step 7/28/2005 JCH\r\n\t\t LastWONo\t= WONo[-1,'B;']\r\n\t\t \r\n\t\t IF INDEX(LastWONo,'.',1) THEN\r\n\t\t \t\tWOStepNo = LastWONo\r\n\t\t \t\tWOStepKey = WOStepNo\r\n\t\t \t\tCONVERT '.' TO '*' IN WOStepKey\r\n\t\t \t\tWONo = WOStepNo\r\n\t\t \tEND ELSE\r\n\t\t \t\tWONo = LastWONo\r\n\t\t \t\tWOStepKey = WONo:'.1'\r\n\t\t \t\tCONVERT '.' TO '*' IN WOStepKey\r\n\t\t \tEND\r\n\t\t \r\n\t\t PSNID = xlate( 'WO_STEP', WOStepKey, wo_step_prod_spec_id$, 'X' )\r\n\t\t \r\n\t\t PSNRec = xlate( 'PROD_SPEC', PSNID, '', 'X' )\r\n\t\t SpecEpi = PSNRec<prod_spec_spec_epi$>\r\n\t\t convert char(247) to @fm in SpecEpi\r\n\t\t convert char(248) to @fm in SpecEpi\r\n\t\t * JUST PULL OFF THE FIRST LAYER INFO\r\n\t\t Dopant = SpecEpi<1,QSEpiDopant$>\r\n\t RecipeNo = SpecEpi<1,QSEpiRecipe$>\r\n\t RecipeName = SpecEpi<1,QSEpiRecipeName$>\r\n\t TubePressure = PSNRec<prod_spec_tube_pressure_type$>\r\n*\t\t PinnedSusceptor = PSNRec<prod_spec_pinned_susceptor$>\r\n*\t\t PinnedSusceptor = oconv( PinnedSusceptor, 'BPS=Yes,PS=No' )\r\n\t\t\t\t\t PinnedSusceptor = PSNRec<Prod_Spec_Susceptor_Type$>\r\n\t\t WandRestrictor = PSNRec<prod_spec_wand_restricter$>\r\n\t\t WandRestrictor = oconv( WandRestrictor, 'BWR=Yes,WR=No' )\r\n\t\t WoCell = '(WO=':WONo:') '\r\n\t\t WoCell:= '(PSN=':PSNID:') '\r\n\t\t WoCell:= '(':RecipeNo:' ':Recipename:') ':'(':Dopant:') '\r\n\t\t WoCell:= '(':TubePressure:') ':'(':WandRestrictor:') '\r\n\t\t WoCell:= '(':PinnedSusceptor:')'\r\n\t\t swap '(WO=) (PSN=) ( ) () () () ()' with 'Open' in WOCell\r\n\t\t SchedInfo<i,j> = WOCell\r\n\t\t end\r\n\t end\r\n\t next j\r\n next i\r\n\t .sched_info->array = SchedInfo\r\n Void = set_property( @window, '@OrigSched', SchedInfo )\t \r\n\t .sched_info->toppos = 1:@fm:20\t \t \r\n\t \r\n end\r\nend\r\n\r\nVoid = utility( 'CURSOR', 'A' )\r\nreturn\r\n*===========================================================================*"
}
}
}