From 7cc861619f9c2cef4a113171129155d813a93104 Mon Sep 17 00:00:00 2001 From: "Infineon\\StieberD" Date: Tue, 3 Dec 2024 14:07:00 -0700 Subject: [PATCH] refactored calibration reminders into a service --- LSL2/POPUP/DEPT.json | 24 ++-- LSL2/STPROC/CALIBRATION_SERVICES.txt | 159 ++++++++++++++++++++++++--- LSL2/STPROC/NDW_MAIN_EVENTS.txt | 7 +- 3 files changed, 155 insertions(+), 35 deletions(-) diff --git a/LSL2/POPUP/DEPT.json b/LSL2/POPUP/DEPT.json index 67b8e55..f0139cd 100644 --- a/LSL2/POPUP/DEPT.json +++ b/LSL2/POPUP/DEPT.json @@ -9,7 +9,7 @@ "<2>": "-2", "<3>": "-1", "<4>": "-1", - "<5>": "16777215", + "<5>": "-2", "<6>": { "<6,1>": { "<6,1,1>": "Tahoma", @@ -55,7 +55,7 @@ "<8,5>": { "<8,5,1>": "ENG", "<8,5,2>": "Engineering", - "<8,5,3>": "JFUENTE1,JUSTIN_H,JONATHON_S,MARROQUINBRA,TIFFANY_M,JEANNE_M,JONATHAN_O" + "<8,5,3>": "JFUENTE1,JUSTIN_H,JONATHON_S,MARROQUINBRA,TIFFANY_M,JEANNE_M,JONATHAN_O,DANIEL_ST" } }, "<9>": { @@ -82,14 +82,6 @@ "<9,3,4>": "C", "<9,3,5>": "", "<9,3,6>": "Notify User ID" - }, - "<9,4>": { - "<9,4,1>": "", - "<9,4,2>": "", - "<9,4,3>": "", - "<9,4,4>": "", - "<9,4,5>": "", - "<9,4,6>": "" } }, "<10>": "L", @@ -117,7 +109,17 @@ "<32>": "0", "<33>": "1", "<34>": "16777215", - "<35>": "16777215" + "<35>": "16777215", + "<36>": "", + "<37>": "", + "<38>": "", + "<39>": "", + "<40>": "-2", + "<41>": "1000", + "<42>": "", + "<43>": "", + "<44>": "", + "<45>": "" } } } \ No newline at end of file diff --git a/LSL2/STPROC/CALIBRATION_SERVICES.txt b/LSL2/STPROC/CALIBRATION_SERVICES.txt index eea7210..b66259e 100644 --- a/LSL2/STPROC/CALIBRATION_SERVICES.txt +++ b/LSL2/STPROC/CALIBRATION_SERVICES.txt @@ -1,9 +1,34 @@ Compile function Calibration_Services(@Service, @Params) +/*********************************************************************************************************************** + + This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written + permission from Infineon Technologies. + + Name : Calibration_Services + + Description : Handler program for all Scan services. + + Notes : + + Parameters : + Service [in] -- Name of the service being requested + Param1-10 [in/out] -- Additional request parameter holders + Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure + + Metadata : + + History : (Date, Initials, Notes) + 12/03/2024 djs Added SendReminders service + +***********************************************************************************************************************/ #pragma precomp SRP_PreCompiler -$Insert LOGICAL +$Insert APP_INSERTS $Insert SERVICE_SETUP $Insert CALIB_LIST_EQUATES +$Insert POPUP_EQUATES +$Insert RLIST_EQUATES +$Insert NOTIFICATION_EQUATES EQU COL$CL_NO TO 1 EQU COL$DEPT TO 2 @@ -23,6 +48,9 @@ EQU COL$NIST_INT_EXT TO 7 EQU COL$NIST_LAST_CAL TO 8 EQU COL$NIST_NEXT_CAL TO 9 +Declare subroutine obj_Notes +Declare function SRP_Array, Database_Services + GoToService Return Response or "" @@ -45,16 +73,10 @@ Service GetCalibListData(CalibType=CALIB_TYPES, SelectActive=BOOLEAN) Begin Case Case CalibType EQ 'Equipment' - OPEN 'CALIB_LIST' TO TableIn then + Open 'CALIB_LIST' TO TableIn then - If SelectActive EQ False$ then - SELECT TableIn -* end else -* Select 'CALIB_LIST' By "" Using Cursor else -* ErrorMsg = 'Error in ':Service:' service. Error selecting CALIB_LIST records.' -* end - end - + If SelectActive EQ False$ then Select TableIn + If ErrorMsg EQ '' then EquipList = '' @@ -114,14 +136,8 @@ Service GetCalibListData(CalibType=CALIB_TYPES, SelectActive=BOOLEAN) OPEN 'CALIB_LIST' TO TableIn then - If SelectActive EQ False$ then - SELECT TableIn -* end else -* Select 'CALIB_LIST' By "" Using Cursor else -* ErrorMsg = 'Error in ':Service:' service. Error selecting CALIB_LIST records.' -* end - end - + If SelectActive EQ False$ then Select TableIn + If ErrorMsg EQ '' then NISTList = '' @@ -185,3 +201,110 @@ Service GetCalibListData(CalibType=CALIB_TYPES, SelectActive=BOOLEAN) End Service +Service SendReminders() + + hSysLists = Database_Services('GetTableHandle', 'SYSLISTS') + Lock hSysLists, ServiceKeyID then + ErrorMsg = '' + OPEN 'CALIB_LIST' TO FileIn then + + CalDueRecipients = Xlate('NOTIFICATION', 'CALIB_DUE_NOTIFY', NOTIFICATION_USER_ID$, 'X') + + CheckDt = OConv(Date() + 15, 'D4/') + SelectSent = 'SELECT CALIB_LIST WITH NEXT_CAL_DT < ':QUOTE(CheckDt):' BY NEXT_CAL_DT' + RList(SelectSent,TARGET_ACTIVELIST$,'','','') + + NoteText = '' + Depts = '' + + Done = 0 + LOOP + READNEXT CLNo ELSE Done = 1 + UNTIL Done + READ CLRec FROM FileIn,CLNo THEN + + NextCalDt = OCONV(XLATE('CALIB_LIST',CLNo,'NEXT_CAL_DT','X'),'D4/') + + IF NextCalDt NE '' THEN + + NewLine = '' + CLType = CLRec + Dept = CLRec + IF Dept = '' THEN Dept = 'MET' + + IF CLType = 'E' THEN + Desc = CLRec + SN = CLRec + Loc = CLRec + SN = CLRec + Loc = CLRec + NewLine = 'The NIST Standard ':Desc:' (S/N: ':SN:') located in the ':Loc:' is due for calibration on ':NextCalDt:CRLF$ + END + + LOCATE Dept IN Depts USING @FM SETTING Pos ELSE + Depts = INSERT(Depts,Pos,0,0,Dept) + END + NoteText = NoteText:NewLine + + END ;* End of check for NextCalDt + END ;* End of CLRec read + REPEAT + + DeptUsers = '' + DeptDescs ='' + + PopupLiteral = XLATE('SYSREPOSPOPUPS',@APPID<1>:'**DEPT',PDISPLAY$,'X') + + CONVERT @VM:@SVM TO @FM:@VM IN PopupLiteral + + LiteralCnt = COUNT(PopupLiteral,@FM) + (PopupLiteral NE '') + + FOR I = 1 TO LiteralCnt + Dept = PopupLiteral + DeptDesc = PopupLiteral + UserNames = PopupLiteral + LOCATE Dept IN Depts USING @FM SETTING Pos THEN + CONVERT ' ' TO '' IN UserNames + CONVERT ',' TO @VM IN UserNames + DeptUsers = UserNames + DeptDescs = DeptDesc + END + NEXT I + + NoteSubject = "Equipment Calibration Reminder" + + DeptCnt = DCount(Depts,@FM) + + FOR I = 1 TO DeptCnt + + IF NoteText NE '' THEN + + Recipients = SRP_Array('Join', CalDueRecipients, DeptUsers, 'AND', @VM) + SentFrom = 'System' + Subject = DeptDescs:" Department - Equipment Calibration Reminder" + Message = NoteText + AttachWindow = 'MASTER_CALIB_LIST' + AttachKeys = '' + SendToGroup = '' + + Obj_Notes('Create',Recipients:@RM:'System':@RM:NoteSubject:@RM:NoteText:@RM:'MASTER_CALIB_LIST') + + END + + NEXT I + end else + ErrorMsg = 'Unable to open "CALIB_LIST" table.' + end + + If ErrorMsg NE '' then + Error_Services('Add', ErrorMsg) + end + Unlock hSysLists, ServiceKeyID else Null + end + +end service + diff --git a/LSL2/STPROC/NDW_MAIN_EVENTS.txt b/LSL2/STPROC/NDW_MAIN_EVENTS.txt index 0e031e5..57c5335 100644 --- a/LSL2/STPROC/NDW_MAIN_EVENTS.txt +++ b/LSL2/STPROC/NDW_MAIN_EVENTS.txt @@ -291,12 +291,6 @@ Event WINDOW.CREATE(CreateParam) Set_Property(@Window : '.MENU.ADMIN.MASS_TOOL_MODE_CHANGE', 'VISIBLE', 0) Set_Property(@Window : '.MENU.ADMIN.MASS_REACTOR_MODE_CHANGE', 'VISIBLE', 0) end - - CalDueRecipients = XLATE('NOTIFICATION','CALIB_DUE_NOTIFY',NOTIFICATION_USER_ID$,'X') - - LOCATE @USER4 IN CalDueRecipients USING @VM SETTING POS THEN - obj_Calib_List('SendReminders') ;* New system added 3/18/2010 JCH - END UseFQAMatScan = Database_Services('ReadDataRow', 'APP_INFO', 'USE_FQA_MAT_SCAN') If UseFQAMatScan EQ 1 OR MemberOf(@User4, 'OI_TEST') then @@ -854,3 +848,4 @@ return +