diff --git a/LSL2/STPROC/NICA_ORDERS_SERVICES.txt b/LSL2/STPROC/NICA_ORDERS_SERVICES.txt index 0cc965c..8b95576 100644 --- a/LSL2/STPROC/NICA_ORDERS_SERVICES.txt +++ b/LSL2/STPROC/NICA_ORDERS_SERVICES.txt @@ -29,7 +29,7 @@ $Insert REACTOR_LOG_EQUATES $Insert NICA_ORDERS_EQUATES Declare function Environment_Services, Database_Services, Error_Services, Logging_Services, Nica_Orders_Services -Declare function Httpclient_Services, SRP_JSON +Declare function Httpclient_Services, SRP_JSON, Reactor_Services, Reactor_Log_Services Declare subroutine Error_Services, Btree.Extract, Database_Services, Logging_Services, Nica_Orders_Services, Delay Declare subroutine Httpclient_Services, SRP_JSON, Mona_Services, Service_Services @@ -104,11 +104,61 @@ Service GetOrderUpdates() Nica_Orders_Services('GetOrderStatusUpdate', OrderId) Next OrderId Unlock hSysLists, ServiceKeyID else Null + Nica_Orders_Services('UpdateNicaFlags') end end service +Service UpdateNicaFlags() + + rv = '' + ErrCode = '' + ReactNos = Reactor_Services('GetReactorNumbers') + Open 'REACTOR' to hReactor then + Open 'REACTOR_LOG' to hReactorLog then + For each ReactNo in ReactNos using @FM + ProveInActive = Reactor_Services('GetProveInActive', ReactNo) + HgCVChecklistActive = (Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'IQS_HGCV_ALARM') NE '') + Open 'REACTOR' to hReactor then + ReadV CacheProveInActive from hReactor, ReactNo, REACTOR_PROVE_IN_ACTIVE$ then + If CacheProveInActive NE ProveInActive then + Lock hReactor, ReactNo then + WriteV ProveInActive on hReactor, ReactNo, REACTOR_PROVE_IN_ACTIVE$ else Null + Unlock hReactor, ReactNo else Null + end + end + end + ReadV CacheHgCVChecklistActive from hReactor, ReactNo, REACTOR_HGCV_CHECKLIST_ACTIVE$ then + If CacheHgCVChecklistActive NE HgCVChecklistActive then + Lock hReactor, ReactNo then + WriteV HgCVChecklistActive on hReactor, ReactNo, REACTOR_HGCV_CHECKLIST_ACTIVE$ else Null + Unlock hReactor, ReactNo else Null + end + end + end + end + CurrModeKey = Xlate('REACTOR_CHILD_KEY_IDS_NG', ReactNo, 'REACT_MODE_KEY_IDS', 'X') + CurrModeKey = CurrModeKey[-1, 'B':@VM] + CurrRLKey = Xlate('REACT_MODE_NG', CurrModeKey, 'START_RL_ID', 'X') + RLChecklistActive = Reactor_Log_Services('GetRlChecklistActive', CurrRlKey) + Open 'REACTOR_LOG' to hReactorLog then + ReadV CacheRlChecklistActive from hReactorLog, CurrRlKey, REACTOR_LOG_CHECKLIST_ACTIVE$ then + If CacheRlChecklistActive NE RLChecklistActive then + Lock hReactorLog, CurrRlKey then + WriteV RlChecklistActive on hReactorLog, CurrRlKey, REACTOR_LOG_CHECKLIST_ACTIVE$ else Null + Unlock hReactorLog, CurrRlKey else Null + end + end + end + end + Next ReactNo + end + end + +end service + + Service GetActiveOrders(EntityType=ENTITY_TYPES, EntityId, OrderTypes=ORDER_TYPES) Response = Nica_Orders_Services('GetOrderIds', EntityType, EntityID, OrderTypes, '#cancelled', False$) @@ -570,3 +620,4 @@ end service + diff --git a/LSL2/STPROC/WO_DAILY_SCHED_ALL_COMM.txt b/LSL2/STPROC/WO_DAILY_SCHED_ALL_COMM.txt index 4b879a5..fd6bedc 100644 --- a/LSL2/STPROC/WO_DAILY_SCHED_ALL_COMM.txt +++ b/LSL2/STPROC/WO_DAILY_SCHED_ALL_COMM.txt @@ -164,6 +164,7 @@ FORM_CREATE: IQSData = Database_Services('ReadDataRow', 'CONFIG', 'IQS_VIOL_DATA') FOR I = StartReact TO EndReact STEP 2 + ReactRec = Xlate('REACTOR',I,'','X') LLDisabled = ReactRec ReactAssign = ReactRec @@ -248,7 +249,7 @@ FORM_CREATE: RPanelTitle := ' - PP' END - Status_ProveIn = Reactor_Services('GetProveInActive', I) + Status_ProveIn = Xlate('REACTOR', I, REACTOR_PROVE_IN_ACTIVE$, 'X') Status_0311 = XLATE('REACTOR', I, REACTOR_0311_ACTIVE$, 'X') @@ -265,10 +266,11 @@ FORM_CREATE: If Status_0311 EQ True$ then Set_Property(Window:'.OLE_PIC_':I, 'OLE.Image', '.\BMPS\Active_0311.png') end - + CurrModeKey = Xlate('REACTOR_CHILD_KEY_IDS_NG', I, 'REACT_MODE_KEY_IDS', 'X') + CurrModeKey = CurrModeKey[-1, 'B':@VM] CurrRLKey = Xlate('REACT_MODE_NG', CurrModeKey, 'START_RL_ID', 'X') - Status_ReactorPM = Reactor_Log_Services('GetRlChecklistActive', CurrRLKey) + Status_ReactorPM = Xlate('REACTOR_LOG', CurrRLKey, REACTOR_LOG_CHECKLIST_ACTIVE$, 'X') If Status_ReactorPM EQ '' then Status_ReactorPM = False$ @@ -276,7 +278,7 @@ FORM_CREATE: Set_Property(Window:'.OLE_PIC_':I, 'OLE.Image', '.\BMPS\ActiveReactorPM.png') end - Status_HgCV_Alarm = (Nica_Orders_Services('GetActiveOrders', 'REACTOR', I, 'IQS_HGCV_ALARM') NE '') + Status_HgCV_Alarm = Xlate('REACTOR', I, REACTOR_HGCV_CHECKLIST_ACTIVE$, 'X') If Status_HgCV_Alarm EQ True$ then Set_Property(Window:'.OLE_PIC_':I, 'OLE.Image', '.\BMPS\ActiveProveIn.png') @@ -333,3 +335,4 @@ return + diff --git a/LSL2/STPROCINS/REACTOR_EQUATES.txt b/LSL2/STPROCINS/REACTOR_EQUATES.txt index c622625..a3ab878 100644 --- a/LSL2/STPROCINS/REACTOR_EQUATES.txt +++ b/LSL2/STPROCINS/REACTOR_EQUATES.txt @@ -79,3 +79,4 @@ Equ REACTOR_PROVE_IN_ORDER_ID$ To 67 Equ REACTOR_IDLE_STARTUP_REQUIRED$ To 68 Equ REACTOR_IQS_ALARM_DTM$ To 69 Equ REACTOR_IQS_ALARM_TEST$ To 70 +Equ REACTOR_HGCV_CHECKLIST_ACTIVE$ To 71