open-insight/LSL2/STPROC/COMM_REACT_SERVS.txt
Infineon\StieberD 9d4ae3c5b3 added intrusive maintenance flow logic
updated headers for nica order request

Added reactor type support to nica checklists. Refactored flow logic to just use NICA_CHECKLISTS table.

added feature flag support

gated Feature Flags menu item to supervisors

removed debug

added auto comment for intr maint flows on reactor log, intr maint flow id to react servs form, and cancel order on unsign reactor log

added exceptions for lamp and tc services, added control to edit flow id on react servs form, added auto-reactor log comment, added cancel order on unsign event

removed debug

modified NicaOrdersServices to use env variables for group resource name

added logic to filter out service flow ids for servics with is_intrusive set to false, modified security group for feature flag menu, added ability to clear intr main flow id to react serv form

removed unused equates
2025-03-12 16:28:52 -07:00

279 lines
5.8 KiB
Plaintext

COMPILE FUNCTION Comm_React_Servs(EntID,Event,Parm1,Parm2,Parm3,Parm4,Parm5)
/*
TCommuter module for REACT_SERVS (Reactor Services) window
10/23/2013 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window, Post_Event
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow,
DECLARE SUBROUTINE obj_Notes, Security_Err_Msg, End_Window, Forward_Event, Start_Window, Create_Note
DECLARE SUBROUTINE React_Servs_Services, React_Servs_Events
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Center_Window, Popup, Collect.Ixvals
DECLARE FUNCTION Send_Message, Msg, Security_Check, RowExists, NextKey, End_Window, React_Servs_Services
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT LSL_USERS_EQU
$INSERT SECURITY_RIGHTS_EQU
$INSERT REACT_SERVS_EQUATES
$INSERT POPUP_EQUATES
$INSERT LOGICAL
EQU CRLF$ TO \0D0A\
EQU TAB$ TO \09\
ErrTitle = 'Error in Comm React Servs'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE EntID = @WINDOW
BEGIN CASE
CASE Event = 'CLEAR' ; GOSUB Clear
CASE Event = 'CREATE' ; GOSUB Create
CASE Event = 'CLOSE' ; GOSUB Close
CASE Event = 'WRITE' ; GOSUB Write
CASE Event = 'READ' ; GOSUB Read
CASE Event = 'DELETE' ; GOSUB Delete
CASE Event[1,3] = 'QBF' ; GOSUB Refresh
END CASE
CASE EntID = @WINDOW:'.CHB_IS_INTRUSIVE' AND Event = 'CLICK' ; GOSUB EnableFlowCode
CASE EntID = @WINDOW:'.LU_SYSTEM' AND Event = 'CLICK' ; GOSUB LUSystem
CASE EntID = @WINDOW:'.LU_REACT_ITEM' AND Event = 'CLICK' ; GOSUB LUReactItem
CASE EntID = @WINDOW:'.LU_ITEM_TYPE' AND Event = 'CLICK' ; GOSUB LUReactItemType
CASE 1
ErrorMsg = 'Unknown Parameters ':EntID:' - ':Event:' passed to commuter'
ErrMsg(ErrorMsg)
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrTitle:@SVM:ErrorMsg)
END
RETURN Result
* * * * * * *
Create:
* * * * * * *
IF NOT(Security_Check('React Servs',Read$)) THEN
Security_Err_Msg('React Servs',Read$)
void = End_Window( @WINDOW, '' )
RETURN
END
IF NOT(Security_Check('React Servs',Edit$)) THEN
Security_Err_Msg('React Servs',Edit$)
END
ReactMetrics = React_Servs_Services('GetReactMetrics')
Set_Property(@Window:'.ASSOC_METRICS', 'LIST', ReactMetrics)
obj_Appwindow('Create',@WINDOW)
GOSUB Refresh
RETURN
* * * * * * *
Clear:
* * * * * * *
Send_Event(@WINDOW,'PAGE',1)
IF Get_Property(@WINDOW,'@READONLY') THEN
obj_AppWindow('ReadOnly',@RM:1) ;* Reenables data bound controls
Set_Property(@WINDOW,'@READONLY',0) ;* Clear flag on window
END
* GOSUB EnableFlowCode
* React_Servs_Events(@Window, 'READ')
* * * * * * *
Refresh:
* * * * * * *
* 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<Line,1> 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 I
NEXT I
GOSUB EnableFlowCode
* React_Servs_Events(@Window, 'READ')
RETURN
* * * * * * *
Page:
* * * * * * *
obj_Appwindow('Page')
RETURN
* * * * * * *
LUSystem:
* * * * * * *
ReturnCtrl = Parm1
IF ReturnCtrl NE '' THEN
ReturnCtrl = @WINDOW:'.':ReturnCtrl
END ELSE
ReturnCtrl = ''
END
Set_Status(0)
ReactSystem = Popup(@WINDOW,'','REACT_SYSTEM')
IF ReactSystem = '' THEN RETURN
obj_Appwindow('LUValReturn',ReactSystem:@RM:ReturnCtrl)
RETURN
* * * * * * *
LUREactItem:
* * * * * * *
ReturnCtrl = Parm1
IF ReturnCtrl NE '' THEN
ReturnCtrl = @WINDOW:'.':ReturnCtrl
END ELSE
ReturnCtrl = ''
END
Set_Status(0)
ReactItem = Popup(@WINDOW,'','REACT_ITEMS')
IF ReactItem = '' THEN RETURN
obj_Appwindow('LUValReturn',ReactItem:@RM:ReturnCtrl)
RETURN
* * * * * * *
LUReactItemType:
* * * * * * *
ReturnCtrl = Parm1
IF ReturnCtrl NE '' THEN
ReturnCtrl = @WINDOW:'.':ReturnCtrl
END ELSE
ErrorMsg = 'ReturnCtrl not specified'
RETURN
END
RetVal = Popup(@WINDOW,'','REACT_ITEM_TYPE')
IF RetVal = '' THEN RETURN
obj_Appwindow('LUValReturn',RetVal:@RM:ReturnCtrl)
RETURN
* * * * * * *
Read:
* * * * * * *
GOSUB Refresh
RETURN
* * * * * * *
Write:
* * * * * * *
Result = 1
RETURN
* * * * * * *
Delete:
* * * * * * *
IF Security_Check('React Servs',Delete$ ) THEN
Result = 1 ;* Proceed with delete
END ELSE
Security_Err_Msg('React Servs',Delete$)
Result = 0 ;* Stop event chain (and delete)
END
RETURN
* * * * * * *
Close:
* * * * * * *
obj_Notes('Inbox',@USER4) ;* Checks for any new messages
obj_Appwindow('CardReturn',@WINDOW)
RETURN
EnableFlowCode:
ChkVal = Get_Property(@WINDOW:'.CHB_IS_INTRUSIVE', 'CHECK')
If ChkVal EQ '' then ChkVal = False$
Set_Property(@WINDOW:'.CBO_INTR_MAINT_FLOW', 'ENABLED', ChkVal)
return