|
- module COpenSafetyValveLedNotificationVariables
- use CVoidEventHandlerCollection
- implicit none
- logical :: OpenSafetyValveLed = .false.
- integer :: operation_OpenSafetyValveLed = 0
-
- public
- type(VoidEventHandlerCollection) :: OnOpenSafetyValveLedChange
-
- private :: OpenSafetyValveLed
-
- contains
-
- subroutine Set_OpenSafetyValveLed(v)
- use CDrillingConsoleVariables, only: OpenSafetyValveLedHw => OpenSafetyValveLed
- use CManifolds, only: OpenSafetyValve_TopDrive, OpenSafetyValve_KellyMode, OpenSafetyValve_TripMode
- use CHoistingVariables, only: DriveType, TopDrive_DriveType, Kelly_DriveType
- implicit none
- logical , intent(in) :: v
- #ifdef ExcludeExtraChanges
- if(OpenSafetyValveLed == v) return
- #endif
- OpenSafetyValveLed = v
-
- if(OpenSafetyValveLed) then
- !!call OpenSafetyValve()
- if(DriveType == TopDrive_DriveType) call OpenSafetyValve_TopDrive()
- if(DriveType == Kelly_DriveType .and. operation_OpenSafetyValveLed == 0) call OpenSafetyValve_KellyMode()
- if(DriveType == Kelly_DriveType .and. operation_OpenSafetyValveLed == 1) call OpenSafetyValve_TripMode()
- endif
-
- !if(OpenSafetyValveLed) then
- ! OpenSafetyValveLedHw = 1
- !else
- ! OpenSafetyValveLedHw = 0
- !endif
-
- call OnOpenSafetyValveLedChange%RunAll()
- end subroutine
-
- logical function Get_OpenSafetyValveLed()
- implicit none
- Get_OpenSafetyValveLed = OpenSafetyValveLed
- end function
-
-
-
- subroutine Set_OpenSafetyValveLed_WN(v)
- !DEC$ ATTRIBUTES DLLEXPORT :: Set_OpenSafetyValveLed_WN
- !DEC$ ATTRIBUTES ALIAS: 'Set_OpenSafetyValveLed_WN' :: Set_OpenSafetyValveLed_WN
- implicit none
- logical , intent(in) :: v
- call Set_OpenSafetyValveLed(v)
- end subroutine
-
- logical function Get_OpenSafetyValveLed_WN()
- !DEC$ ATTRIBUTES DLLEXPORT :: Get_OpenSafetyValveLed_WN
- !DEC$ ATTRIBUTES ALIAS: 'Get_OpenSafetyValveLed_WN' :: Get_OpenSafetyValveLed_WN
- implicit none
- Get_OpenSafetyValveLed_WN = OpenSafetyValveLed
- end function
-
-
-
- end module COpenSafetyValveLedNotificationVariables
|