module CIrSafetyValveLedNotificationVariables use CVoidEventHandlerCollection implicit none logical :: IrSafetyValveLed = .false. integer :: operation_IrSafetyValveLed = 0 public type(VoidEventHandlerCollection) :: OnIrSafetyValveLedChange private :: IrSafetyValveLed contains subroutine Set_IrSafetyValveLed(v) use CDrillingConsoleVariables!, only: DrillingConsole%CloseKellyCockLed => IRSafetyValveLed use CManifolds, only: & InstallSafetyValve_TopDrive, & InstallSafetyValve_KellyMode, & InstallSafetyValve_TripMode, & RemoveSafetyValve_TopDrive, & RemoveSafetyValve_KellyMode, & RemoveSafetyValve_TripMode use CSafetyValveEnumVariables, only: Set_SafetyValve_Install, Set_SafetyValve_Remove use CHoistingVariables!, only: Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType implicit none logical , intent(in) :: v #ifdef ExcludeExtraChanges if(IrSafetyValveLed == v) return #endif IrSafetyValveLed = v if(IrSafetyValveLed) then DrillingConsole%IRSafetyValveLed = 1 if(Hoisting%DriveType == TopDrive_DriveType) call InstallSafetyValve_TopDrive() if(Hoisting%DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 0) call InstallSafetyValve_KellyMode() if(Hoisting%DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 1) call InstallSafetyValve_TripMode() call Set_SafetyValve_Install() else DrillingConsole%IRSafetyValveLed = 0 if(Hoisting%DriveType == TopDrive_DriveType) call RemoveSafetyValve_TopDrive() if(Hoisting%DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 0) call RemoveSafetyValve_KellyMode() if(Hoisting%DriveType == Kelly_DriveType .and. operation_IrSafetyValveLed == 1) call RemoveSafetyValve_TripMode() call Set_SafetyValve_Remove() endif call OnIrSafetyValveLedChange%RunAll() end subroutine logical function Get_IrSafetyValveLed() implicit none Get_IrSafetyValveLed = IrSafetyValveLed end function subroutine Set_IrSafetyValveLed_WN(v) !DEC$ ATTRIBUTES DLLEXPORT :: Set_IrSafetyValveLed_WN !DEC$ ATTRIBUTES ALIAS: 'Set_IrSafetyValveLed_WN' :: Set_IrSafetyValveLed_WN implicit none logical , intent(in) :: v call Set_IrSafetyValveLed(v) end subroutine logical function Get_IrSafetyValveLed_WN() !DEC$ ATTRIBUTES DLLEXPORT :: Get_IrSafetyValveLed_WN !DEC$ ATTRIBUTES ALIAS: 'Get_IrSafetyValveLed_WN' :: Get_IrSafetyValveLed_WN implicit none Get_IrSafetyValveLed_WN = IrSafetyValveLed end function subroutine Set_IrSafetyValveLed_off() implicit none call Set_IrSafetyValveLed(.false.) end subroutine subroutine Set_IrSafetyValveLed_on() implicit none call Set_IrSafetyValveLed(.true.) end subroutine end module CIrSafetyValveLedNotificationVariables