COMPILE FUNCTION Comm_Tool(Instruction, Parm1,Parm2) /* Commuter module for Tool (Epi Tool) window 06/26/2006 - John C. Henry, J.C. Henry & Co., Inc. */ DECLARE SUBROUTINE Set_Property, Set_Status, ErrMsg, Set_Property, obj_AppWindow, Set_List_Box_Data DECLARE SUBROUTINE Btree.Extract, Send_Event, Security_Err_Msg, Forward_Event, End_Window, Start_Window, RList DECLARE SUBROUTINE Send_Message, obj_Tool_Esc DECLARE FUNCTION Get_Property, Get_Status, Popup, Send_Message, Msg, Security_Check, Dialog_Box, RowExists DECLARE FUNCTION Dialog_Box, MemberOf, obj_NCR, Send_Message, obj_Popup, obj_Tool, obj_Tool_Esc $INSERT POPUP_EQUATES $INSERT MSG_EQUATES $INSERT APPCOLORS $INSERT REACTOR_EQUATES $INSERT REACT_UTIL_EQU $INSERT LSL_USERS_EQU $INSERT SECURITY_RIGHTS_EQU $INSERT TOOL_EQUATES $INSERT WAREHOUSE_EQUATES EQU CRLF$ TO \0D0A\ EQU COL$MFC_CODE TO 1 EQU COL$MFC_FUNCTION TO 2 EQU COL$MFC_PART_NO TO 3 EQU COL$MFC_SERIAL_NO TO 4 EQU COL$MFC_ASM_PN TO 5 EQU COL$MFC_RANGE TO 6 EQU COL$MFC_FLOW TO 7 EQU COL$MFC_INLET TO 8 EQU COL$MFC_OUTLET TO 9 EQU TARGET_ACTIVELIST$ TO 5 ErrTitle = 'Error in Comm_Tool' ErrorMsg = '' Result = '' BEGIN CASE CASE Instruction = 'Create' ; GOSUB Create CASE Instruction = 'Refresh' ; GOSUB Refresh CASE Instruction = 'Read' ; GOSUB Read CASE Instruction = 'Write' ; GOSUB Write CASE Instruction = 'Clear' ; GOSUB Clear CASE Instruction = 'Delete' ; GOSUB Delete CASE Instruction = 'Close' ; GOSUB Close CASE Instruction = 'LUToolID' ; GOSUB LUToolID CASE Instruction = 'LUToolType' ; GOSUB LUToolType CASE Instruction = 'LUToolClass' ; GOSUB LUToolClass CASE Instruction = 'ToolTypeLF' ; GOSUB ToolTypeLF CASE Instruction = 'EscClick' ; GOSUB EscClick CASE Instruction = 'EscHistClick' ; GOSUB EscHistClick CASE Instruction = 'ModeHistory' ; GOSUB ModeHistory CASE Instruction = 'LUWh' ; GOSUB LUWh CASE Instruction = 'LULoc' ; GOSUB LULoc CASE Instruction = 'ToolLocGF' ; GOSUB ToolLocGF CASE 1 ErrorMsg = 'Unknown Instruction passed to routine' END CASE IF ErrorMsg NE '' THEN ErrMsg(ErrTitle:@SVM:ErrorMsg) END RETURN Result * * * * * * * Create: * * * * * * * obj_Appwindow('Create',@WINDOW) IF NOT(Security_Check('Tool',READ$)) THEN Security_Err_Msg('Tool',READ$) End_Window(@WINDOW) RETURN END GOSUB Refresh RETURN * * * * * * * Read: * * * * * * * GOSUB Refresh RETURN * * * * * * * Write: * * * * * * * RETURN * * * * * * * Clear: * * * * * * * GOSUB Refresh RETURN * * * * * * * Delete: * * * * * * * ErrMsg('Tools may not be deleted.') Result = 0 ;* NOT OK to proceed with the delete RETURN * * * * * * * Close: * * * * * * * obj_Appwindow('DetailReturn') RETURN * * * * * * * Refresh: * * * * * * * EscStartDTM = Get_Property(@WINDOW:'.ESC_START_DTM','TEXT') ActEscalation = Get_Property(@WINDOW:'.ACT_ESC','LIST') EscStartDTM = ActEscalation<1,1> IF EscStartDTM NE '' THEN Set_Property(@WINDOW:'.ESC_BUTTON','TEXT','De-Escalate') Set_Property(@WINDOW:'.ESC_LABEL','VISIBLE',1) END ELSE Set_Property(@WINDOW:'.ESC_BUTTON','TEXT','Escalate') Set_Property(@WINDOW:'.ESC_LABEL','VISIBLE',0) END * QBF buttons Ctrls = @WINDOW:'.QBF_FIRST_FIX':@RM ; Props = 'ENABLED':@RM Ctrls := @WINDOW:'.QBF_PREV_FIX':@RM ; Props := 'ENABLED':@RM Ctrls := @WINDOW:'.QBF_ABS_FIX':@RM ; Props := 'ENABLED':@RM Ctrls := @WINDOW:'.QBF_NEXT_FIX':@RM ; Props := 'ENABLED':@RM Ctrls := @WINDOW:'.QBF_LAST_FIX':@RM ; Props := 'ENABLED':@RM Ctrls := @WINDOW:'.QBF_STOP_FIX' ; Props := 'ENABLED' IF Get_Property(@WINDOW,'QBFLIST') = '' THEN Vals = 0:@RM:0:@RM:0:@RM:0:@RM:0:@RM:0 END ELSE Vals = 1:@RM:1:@RM:1:@RM:1:@RM:1:@RM:1 END Set_Property(Ctrls,Props,Vals) * Turn edit table symbolic column backgrounds to green ETSymbolics = Get_Property(@WINDOW,'@ET_SYMBOLICS') ;* Loaded during 'Create' in obj_Appwindow ETCtrls = ETSymbolics<1> ETCols = ETSymbolics<2> FOR I = 1 TO COUNT(ETCtrls,@VM) + (ETCtrls NE '') ETCtrl = ETCtrls<1,I> ETList = Get_Property(ETCtrl,'LIST') FOR Line = 1 TO COUNT(ETList,@FM) + (ETList NE '') IF ETList NE '' THEN FOR N = 1 TO COUNT(ETCols<1,I>,@SVM) + (ETCols<1,I> NE '') stat = Send_Message(ETCtrl,'COLOR_BY_POS',ETCols<1,I,N>,Line,GREEN$) NEXT N END NEXT Line NEXT I * QBF buttons Ctrls = @WINDOW:'.QBF_FIRST_FIX':@RM ; Props = 'ENABLED':@RM Ctrls := @WINDOW:'.QBF_PREV_FIX':@RM ; Props := 'ENABLED':@RM Ctrls := @WINDOW:'.QBF_ABS_FIX':@RM ; Props := 'ENABLED':@RM Ctrls := @WINDOW:'.QBF_NEXT_FIX':@RM ; Props := 'ENABLED':@RM Ctrls := @WINDOW:'.QBF_LAST_FIX':@RM ; Props := 'ENABLED':@RM Ctrls := @WINDOW:'.QBF_STOP_FIX' ; Props := 'ENABLED' IF Get_Property(@WINDOW,'QBFLIST') = '' THEN Vals = 0:@RM:0:@RM:0:@RM:0:@RM:0:@RM:0 END ELSE Vals = 1:@RM:1:@RM:1:@RM:1:@RM:1:@RM:1 END Set_Property(Ctrls,Props,Vals) RETURN * * * * * * * LUToolID: * * * * * * * IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1 IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2 Set_Status(0) ToolID = Popup(@WINDOW,'','TOOLS') IF ToolID = '' THEN RETURN obj_Appwindow('LoadFormKeys',@WINDOW:@RM:ToolID) RETURN * * * * * * * ToolTypeLF: * * * * * * * TypeIn = Get_Property(@WINDOW:'.TOOL_TYPE','DEFPROP') PopupData = XLATE('SYSREPOSPOPUP','LSL2**TOOL_TYPES',8,'X') DEBUG RETURN * * * * * * * LUToolType: * * * * * * * IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1 IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2 ToolType = Popup(@WINDOW,TypeOver,'TOOL_TYPE') IF ToolType NE '' THEN obj_Appwindow('LUValReturn',ToolType:@RM:FocusControl:@RM:FocusPos) END RETURN * * * * * * * LUToolClass: * * * * * * * IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1 IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2 ToolClass = Popup(@WINDOW,TypeOver,'TOOL_CLASS') IF ToolClass NE '' THEN obj_Appwindow('LUValReturn',ToolClass:@RM:FocusControl:@RM:FocusPos) END RETURN * * * * * * * EscClick: * * * * * * * Ctrls = @WINDOW:'.TOOL_ID':@RM:@WINDOW:'.ACTIVE_ESCALATION' Props = 'TEXT':@RM:'TEXT' Vals = Get_Property(Ctrls,Props) ToolID = Vals[1,@RM] ActEscString = Vals[COL2()+1,@RM] IF ToolID = '' THEN RETURN StartDTM = OCONV(FIELD(ActEscString<1,1>,'*',2),'DT4/^S') IF StartDTM = '' THEN Transition = 'ESC' ELSE Transition = 'D-ESC' EscData = Dialog_Box('DIALOG_HOLD',@WINDOW,Transition:@FM:'Tool') IF EscData = 'Cancel' THEN RETURN Send_Event(@WINDOW,'WRITE') UserID = EscData<1> Reason = EscData<2> CurrDate = OCONV(Date(),'D4/') CurrTime = OCONV(Time(),'MTH') CurrDTM = CurrDate:' ':CurrTime IF StartDTM = '' THEN * Place Tool into Escalation obj_Tool_Esc('Create',ToolID:@RM:CurrDTM:@RM:UserID:@RM:Reason) END ELSE * Take Tool out of Escalation obj_Tool_Esc('Close',ToolID:@RM:StartDTM:@RM:CurrDTM:@RM:UserID:@RM:Reason) END obj_AppWindow('LoadFormKeys',@WINDOW:@RM:ToolID) RETURN * * * * * * * EscHistClick: * * * * * * * IF @WINDOW = 'WO_DAILY_SCHED_SINGLE' THEN ToolID = Get_Property(@WINDOW,'@REACTOR') END ELSE ToolID = Get_Property(@WINDOW:'.TOOL_ID','DEFPROP') END IF ToolID NE '' THEN OPEN 'DICT.TOOL_ESC' TO DictVar THEN SearchString = 'TOOL_ID':@VM:ToolID:@FM Option = '' Flag = '' BTREE.EXTRACT(SearchString,'TOOL_ESC',DictVar,REKeys,Option,Flag) IF Get_Status(errCode) THEN ErrMsg(errCode) RETURN END IF REKeys = '' THEN ErrMsg('No Escalation History on file for this reactor.!') RETURN END TypeOver = '' TypeOver = REKeys TypeOver = 2 EscKeys = Popup(@WINDOW,TypeOVer,'TOOL_ESC_HISTORY') obj_AppWindow('ViewRelated','TOOL_ESC':@RM:EscKeys) END END RETURN * * * * * * * ModeHistory: * * * * * * * ToolID = Get_Property(@WINDOW:'.TOOL_ID','DEFPROP') ToolTitle = XLATE('TOOL',ToolID,TOOL_TOOL_DESC$,'X') TLKeys = obj_Tool('ModeHistory',ToolID) IF Get_Status(errCode) THEN ErrMsg(errCode) RETURN END IF TLKeys = '' THEN ErrMsg('No Log History on file for this tool.!') RETURN END TypeOver = '' TypeOver = TLKeys TypeOver = 'Tool Mode History: ':ToolID:' - ':ToolTitle ToolLogKeys = Popup(@WINDOW,TypeOVer,'TOOL_LOG_HISTORY') IF Get_Status(errCode) THEN ErrMsg(errCode) END IF ToolLogKeys = '' THEN RETURN obj_AppWindow('ViewRelated','TOOL_LOG':@RM:ToolLogKeys) RETURN * * * * * * * LUWh: * * * * * * * RetCtrl = Parm1 WHCd = Popup(@WINDOW,'','WAREHOUSE') IF WHCd NE '' AND WHCd NE CHAR(27) THEN obj_AppWindow('LUValReturn',WHCd:@RM:@WINDOW:'.':RetCtrl:'_WH') END RETURN * * * * * * * ToolLocGF: * * * * * * * RetCtrl = Parm1 WHCd = Get_Property(@WINDOW:'.':RetCtrl:'_WH','DEFPROP') LocCd = Get_Property(@WINDOW:'.':RetCtrl:'_LOC','DEFPROP') IF WHCd NE '' AND LocCd = '' ELSE RETURN * * * * * * * LULoc: * * * * * * * RetCtrl = Parm1 WHCd = Get_Property(@WINDOW:'.':RetCtrl:'_WH','DEFPROP') LocCds = XLATE('WAREHOUSE',WhCd,WAREHOUSE_LOC_KEY$,'X') IF LocCds NE '' THEN TypeOver = '' TypeOver = LocCds TypeOver = 'Locations in Warehouse ':WhCd LocCd = Popup(@WINDOW,TypeOver,'LOCATIONS') IF LocCd NE '' THEN obj_Appwindow('LUValReturn',LocCd:@RM:@WINDOW:'.':RetCtrl:'_LOC') END END RETURN