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.
 
 
 
 
 
 

65 lines
2.2 KiB

  1. module COpenSafetyValveLedNotificationVariables
  2. use CVoidEventHandlerCollection
  3. implicit none
  4. logical :: OpenSafetyValveLed = .false.
  5. integer :: operation_OpenSafetyValveLed = 0
  6. public
  7. type(VoidEventHandlerCollection) :: OnOpenSafetyValveLedChange
  8. private :: OpenSafetyValveLed
  9. contains
  10. subroutine Set_OpenSafetyValveLed(v)
  11. use CDrillingConsoleVariables, only: OpenSafetyValveLedHw => OpenSafetyValveLed
  12. use CManifolds, only: OpenSafetyValve_TopDrive, OpenSafetyValve_KellyMode, OpenSafetyValve_TripMode
  13. use CHoistingVariables, only: DriveType, TopDrive_DriveType, Kelly_DriveType
  14. implicit none
  15. logical , intent(in) :: v
  16. #ifdef ExcludeExtraChanges
  17. if(OpenSafetyValveLed == v) return
  18. #endif
  19. OpenSafetyValveLed = v
  20. if(OpenSafetyValveLed) then
  21. !!call OpenSafetyValve()
  22. if(DriveType == TopDrive_DriveType) call OpenSafetyValve_TopDrive()
  23. if(DriveType == Kelly_DriveType .and. operation_OpenSafetyValveLed == 0) call OpenSafetyValve_KellyMode()
  24. if(DriveType == Kelly_DriveType .and. operation_OpenSafetyValveLed == 1) call OpenSafetyValve_TripMode()
  25. endif
  26. !if(OpenSafetyValveLed) then
  27. ! OpenSafetyValveLedHw = 1
  28. !else
  29. ! OpenSafetyValveLedHw = 0
  30. !endif
  31. call OnOpenSafetyValveLedChange%RunAll()
  32. end subroutine
  33. logical function Get_OpenSafetyValveLed()
  34. implicit none
  35. Get_OpenSafetyValveLed = OpenSafetyValveLed
  36. end function
  37. subroutine Set_OpenSafetyValveLed_WN(v)
  38. !DEC$ ATTRIBUTES DLLEXPORT :: Set_OpenSafetyValveLed_WN
  39. !DEC$ ATTRIBUTES ALIAS: 'Set_OpenSafetyValveLed_WN' :: Set_OpenSafetyValveLed_WN
  40. implicit none
  41. logical , intent(in) :: v
  42. call Set_OpenSafetyValveLed(v)
  43. end subroutine
  44. logical function Get_OpenSafetyValveLed_WN()
  45. !DEC$ ATTRIBUTES DLLEXPORT :: Get_OpenSafetyValveLed_WN
  46. !DEC$ ATTRIBUTES ALIAS: 'Get_OpenSafetyValveLed_WN' :: Get_OpenSafetyValveLed_WN
  47. implicit none
  48. Get_OpenSafetyValveLed_WN = OpenSafetyValveLed
  49. end function
  50. end module COpenSafetyValveLedNotificationVariables