Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

67 lines
2.3 KiB

  1. module CCloseSafetyValveLedNotificationVariables
  2. use CVoidEventHandlerCollection
  3. implicit none
  4. logical :: CloseSafetyValveLed = .false.
  5. integer :: operation_CloseSafetyValveLed = 0
  6. public
  7. type(VoidEventHandlerCollection) :: OnCloseSafetyValveLedChange
  8. private :: CloseSafetyValveLed
  9. contains
  10. subroutine Set_CloseSafetyValveLed(v)
  11. use CDrillingConsoleVariables, only: CloseSafetyValveLedHw => CloseSafetyValveLed
  12. use CManifolds, only: CloseSafetyValve_TopDrive, CloseSafetyValve_KellyMode, CloseSafetyValve_TripMode
  13. use CHoistingVariables, only: DriveType, TopDrive_DriveType, Kelly_DriveType
  14. implicit none
  15. logical , intent(in) :: v
  16. #ifdef ExcludeExtraChanges
  17. if(CloseSafetyValveLed == v) return
  18. #endif
  19. CloseSafetyValveLed = v
  20. if(CloseSafetyValveLed) then
  21. !!call CloseSafetyValve()
  22. if(DriveType == TopDrive_DriveType) call CloseSafetyValve_TopDrive()
  23. if(DriveType == Kelly_DriveType .and. operation_CloseSafetyValveLed == 0) call CloseSafetyValve_KellyMode()
  24. if(DriveType == Kelly_DriveType .and. operation_CloseSafetyValveLed == 1) call CloseSafetyValve_TripMode()
  25. endif
  26. !if(CloseSafetyValveLed) then
  27. ! CloseSafetyValveLedHw = 1
  28. !else
  29. ! CloseSafetyValveLedHw = 0
  30. !endif
  31. call OnCloseSafetyValveLedChange%RunAll()
  32. end subroutine
  33. logical function Get_CloseSafetyValveLed()
  34. implicit none
  35. Get_CloseSafetyValveLed = CloseSafetyValveLed
  36. end function
  37. subroutine Set_CloseSafetyValveLed_WN(v)
  38. !DEC$ ATTRIBUTES DLLEXPORT :: Set_CloseSafetyValveLed_WN
  39. !DEC$ ATTRIBUTES ALIAS: 'Set_CloseSafetyValveLed_WN' :: Set_CloseSafetyValveLed_WN
  40. implicit none
  41. logical , intent(in) :: v
  42. call Set_CloseSafetyValveLed(v)
  43. end subroutine
  44. logical function Get_CloseSafetyValveLed_WN()
  45. !DEC$ ATTRIBUTES DLLEXPORT :: Get_CloseSafetyValveLed_WN
  46. !DEC$ ATTRIBUTES ALIAS: 'Get_CloseSafetyValveLed_WN' :: Get_CloseSafetyValveLed_WN
  47. implicit none
  48. Get_CloseSafetyValveLed_WN = CloseSafetyValveLed
  49. end function
  50. end module CCloseSafetyValveLedNotificationVariables