Enhanced Error Checking

This commit is contained in:
Infineon\Ouellette
2025-08-13 14:35:00 -07:00
committed by Ouellette Jonathan (CSC FI SPS MESLEO)
parent 09d2d13e63
commit a8dff61cfa
3 changed files with 69 additions and 47 deletions

View File

@ -3577,37 +3577,45 @@ end service
Service GetReactorsWithDownLLByDtm(DtmToCheck, ReactType)
ErrMsg = ''
AllReactors = Reactor_Services('GetReactorNumbers', ReactType)
SLLReactors = ''
If AllReactors NE '' then
for each ReactNo in AllReactors using @FM
PickPlaceFlag = XLATE('REACTOR', ReactNo, REACTOR_PICK_PLACE$, 'X')
If PickPlaceFlag then
Open 'DICT.REACT_LL' to DictReactLL then
SearchString = ''
SearchString := 'REACT_NO':@VM:ReactNo:@FM
ReactLLKeys = ''
Btree.Extract(SearchString, 'REACT_LL', DictReactLL, ReactLLKeys)
If DtmToCheck NE '' then
AllReactors = Reactor_Services('GetReactorNumbers', ReactType)
If AllReactors NE '' then
for each ReactNo in AllReactors using @FM
PickPlaceFlag = XLATE('REACTOR', ReactNo, REACTOR_PICK_PLACE$, 'X')
If PickPlaceFlag then
Open 'DICT.REACT_LL' to DictReactLL then
SearchString = ''
SearchString := 'REACT_NO':@VM:ReactNo:@FM
ReactLLKeys = ''
Btree.Extract(SearchString, 'REACT_LL', DictReactLL, ReactLLKeys)
For each ReactLLKey in ReactLLKeys using @VM
ReactLLRec = Database_Services('ReadDataRow', 'REACT_LL', ReactLLKey, True$, 0, False$)
ReactLLStartDTM = Field(ReactLLKey, '*', 2)
ReactLLEndDTM = ReactLLRec<REACT_LL_STOP_DTM$>
ReactLLApplicable = false$
If ReactLLStartDTM LE DtmToCheck AND (ReactLLEndDTM EQ '' OR ReactLLEndDtm GT DtmToCheck) then
Locate ReactNo in SLLReactors using @VM setting iPos else
SLLReactors<1, -1> = ReactNo
For each ReactLLKey in ReactLLKeys using @VM
ReactLLRec = Database_Services('ReadDataRow', 'REACT_LL', ReactLLKey, True$, 0, False$)
ReactLLStartDTM = Field(ReactLLKey, '*', 2)
ReactLLEndDTM = ReactLLRec<REACT_LL_STOP_DTM$>
ReactLLApplicable = false$
If ReactLLStartDTM LE DtmToCheck AND (ReactLLEndDTM EQ '' OR ReactLLEndDtm GT DtmToCheck) then
Locate ReactNo in SLLReactors using @VM setting iPos else
SLLReactors<1, -1> = ReactNo
end
end
end
Next ReactLLKey
end else
ErrMsg = 'Unable to open the REACT_LL dictionary.'
Next ReactLLKey
end else
ErrMsg = 'Unable to open the REACT_LL dictionary.'
end
end
end
Next ReactNo
Next ReactNo
end else
ErrMsg = 'No Reactor IDs found!'
end
end else
ErrMsg = 'No Reactor IDs found!'
ErrMsg = 'Datetime to check variable was null.'
end
If ErrMsg NE '' then
Error_Services('Add', ErrMsg)
end
Response = SLLReactors

View File

@ -141,7 +141,12 @@ CreateHALItem:
//Single Load Lock Report from Metrology Services
ReportStartDtm = Http_Services('GetQueryField', 'StartDate')
ReportEndDtm = Http_Services('GetQueryField', 'EndDate')
RepJson = Report_Services('GetSLLReportJson', ReportStartDtm, ReportEndDtm)
If ReportStartDtm NE '' AND ReportEndDtm NE '' then
RepJson = Report_Services('GetSLLReportJson', ReportStartDtm, ReportEndDtm)
end else
Error_Services('Add', 'Missing parameters for report.')
end
Case Otherwise$
Error_Services('Add', 'Unsupported report')
End Case

View File

@ -2379,26 +2379,35 @@ Service GetSLLReportJson(FromDt, ToDt)
ErrorMessage = ''
SLLReportJson = ''
objSLLReportJson = ''
If FromDt NE '' OR ToDt NE '' then
If SRP_Json(objSLLReportJson, 'New', 'Array') then
For StartDt = FromDt to ToDt
ThisDate = Date_Services('ConvertDateTimeToISO8601', StartDt)
ThisDtASMDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'ASM')
ThisDtASMPlusDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'ASM+')
ThisDtHTRDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'HTR')
ThisDtASMDownLLCount = DCount(ThisDtASMDownLL, @VM) + DCount(ThisDtASMPlusDownLL, @VM)
ThisDtHTRDownLLCount = DCount(ThisDtHTRDownLL, @VM)
objSLLDay = ''
If SRP_Json(objSLLDay, 'New', 'Object') then
SRP_Json(objSLLDay, 'SetValue', 'Date', ThisDate)
SRP_Json(objSLLDay, 'SetValue', 'ASM', ThisDtASMDownLLCount)
SRP_Json(objSLLDay, 'SetValue', 'HTR', ThisDtHTRDownLLCount)
SRP_Json(objSLLReportJson, 'Add', objSLLDay)
SRP_Json(objSLLDay, 'Release')
end
Next StartDt
SLLReportJson = SRP_Json(objSLLReportJson, 'Stringify', 'Fast')
SRP_Json(objSLLReportJson, 'Release')
end else
ErrorMessage = 'Error creating the root JSON for the report.'
end
end else
ErrorMessage = 'From Date or To Date was null.'
end
If SRP_Json(objSLLReportJson, 'New', 'Array') then
For StartDt = FromDt to ToDt
ThisDate = Date_Services('ConvertDateTimeToISO8601', StartDt)
ThisDtASMDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'ASM')
ThisDtASMPlusDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'ASM+')
ThisDtHTRDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'HTR')
ThisDtASMDownLLCount = DCount(ThisDtASMDownLL, @VM) + DCount(ThisDtASMPlusDownLL, @VM)
ThisDtHTRDownLLCount = DCount(ThisDtHTRDownLL, @VM)
objSLLDay = ''
If SRP_Json(objSLLDay, 'New', 'Object') then
SRP_Json(objSLLDay, 'SetValue', 'Date', ThisDate)
SRP_Json(objSLLDay, 'SetValue', 'ASM', ThisDtASMDownLLCount)
SRP_Json(objSLLDay, 'SetValue', 'HTR', ThisDtHTRDownLLCount)
SRP_Json(objSLLReportJson, 'Add', objSLLDay)
SRP_Json(objSLLDay, 'Release')
end
Next StartDt
SLLReportJson = SRP_Json(objSLLReportJson, 'Stringify', 'Fast')
SRP_Json(objSLLReportJson, 'Release')
If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage)
end
Response = SLLReportJson