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.
 
 
 
 
 
 

385 lines
14 KiB

  1. # 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Notifications/Notifications.f90"
  2. module NotificationModule
  3. use SimulationVariables
  4. implicit none
  5. contains
  6. subroutine Set_UnlatchLed(v)
  7. use CDrillingConsoleVariables
  8. use SimulationVariables
  9. !use CLatchLedNotification
  10. implicit none
  11. logical , intent(in) :: v
  12. # 13
  13. data%State%notifications%UnlatchLed = v
  14. if(data%State%notifications%UnlatchLed) then
  15. data%Equipments%DrillingConsole%UnlatchPipeLED = 1
  16. !call Set_LatchLed(.false.)
  17. else
  18. data%Equipments%DrillingConsole%UnlatchPipeLED = 0
  19. endif
  20. !**call data%State%notifications%OnUnlatchLedChange%RunAll()
  21. end subroutine
  22. logical function Get_UnlatchLed()
  23. implicit none
  24. Get_UnlatchLed = data%State%notifications%UnlatchLed
  25. end function
  26. subroutine Set_TongNotification(v)
  27. implicit none
  28. logical , intent(in) :: v
  29. # 36
  30. data%State%notifications%TongNotification = v
  31. ! if(associated(data%State%notifications%TongNotificationPtr)) !**call data%State%notifications%TongNotificationPtr(data%State%notifications%TongNotification)
  32. # 41
  33. !**call data%State%notifications%OnTongNotificationChange%RunAll()
  34. end subroutine
  35. logical function Get_TongNotification()
  36. implicit none
  37. Get_TongNotification = data%State%notifications%TongNotification
  38. end function
  39. subroutine Set_TorqueWrenchLed(v)
  40. use CTopDrivePanelVariables
  41. use SimulationVariables!, only: data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed
  42. implicit none
  43. integer , intent(in) :: v
  44. # 58
  45. data%State%notifications%TorqueWrenchLed = v
  46. data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed = v
  47. !**call data%State%notifications%OnTorqueWrenchLedChange%RunAll()
  48. end subroutine
  49. logical function Get_TorqueWrenchLed()
  50. implicit none
  51. Get_TorqueWrenchLed = data%State%notifications%TorqueWrenchLed
  52. end function
  53. subroutine Set_PowerLed(v)
  54. use CTopDrivePanelVariables
  55. use SimulationVariables!, only: data%Equipments%TopDrivePanel%TopDriveTdsPowerLed
  56. !use CLatchLedNotification
  57. implicit none
  58. logical , intent(in) :: v
  59. # 77
  60. data%State%notifications%PowerLed = v
  61. if(data%State%notifications%PowerLed) then
  62. data%Equipments%TopDrivePanel%TopDriveTdsPowerLed = 1
  63. !call Set_LatchLed(.false.)
  64. else
  65. data%Equipments%TopDrivePanel%TopDriveTdsPowerLed = 0
  66. endif
  67. !**call data%State%notifications%OnPowerLedChange%RunAll()
  68. end subroutine
  69. logical function Get_PowerLed()
  70. implicit none
  71. Get_PowerLed = data%State%notifications%PowerLed
  72. end function
  73. subroutine Set_IbopLed(v)
  74. use CTopDrivePanelVariables
  75. use SimulationVariables!, only: data%Equipments%TopDrivePanel%TopDriveIbopLed
  76. use CManifolds, Only: OpenTopDriveIBop, CloseTopDriveIBop
  77. !use CLatchLedNotification
  78. implicit none
  79. logical , intent(in) :: v
  80. # 104
  81. data%State%notifications%IbopLed = v
  82. if(data%State%notifications%IbopLed) then
  83. data%Equipments%TopDrivePanel%TopDriveIbopLed = 1
  84. call CloseTopDriveIBop()
  85. else
  86. data%Equipments%TopDrivePanel%TopDriveIbopLed = 0
  87. call OpenTopDriveIBop()
  88. endif
  89. !**call data%State%notifications%OnIbopLedChange%RunAll()
  90. end subroutine
  91. logical function Get_IbopLed()
  92. implicit none
  93. Get_IbopLed = data%State%notifications%IbopLed
  94. end function
  95. subroutine Set_SwingLed(v)
  96. use CDrillingConsoleVariables
  97. use SimulationVariables
  98. use SimulationVariables!, only: SwingLedHw => SwingLed
  99. implicit none
  100. logical , intent(in) :: v
  101. # 132
  102. data%State%notifications%SwingLed = v
  103. if(data%State%notifications%SwingLed) then
  104. data%Equipments%DrillingConsole%SwingLed = 1
  105. else
  106. data%Equipments%DrillingConsole%SwingLed = 0
  107. endif
  108. !**call data%State%notifications%OnSwingLedChange%RunAll()
  109. end subroutine
  110. logical function Get_SwingLed()
  111. implicit none
  112. Get_SwingLed = data%State%notifications%SwingLed
  113. end function
  114. subroutine Set_SlipsNotification(v)
  115. implicit none
  116. logical , intent(in) :: v
  117. # 152
  118. data%State%notifications%SlipsNotification = v
  119. ! if(associated(data%State%notifications%SlipsNotificationPtr)) !**call data%State%notifications%SlipsNotificationPtr(data%State%notifications%SlipsNotification)
  120. # 157
  121. !**call data%State%notifications%OnSlipsNotificationChange%RunAll()
  122. end subroutine
  123. logical function Get_SlipsNotification()
  124. implicit none
  125. Get_SlipsNotification = data%State%notifications%SlipsNotification
  126. end function
  127. subroutine Set_OpenSafetyValveLed(v)
  128. use CDrillingConsoleVariables
  129. use SimulationVariables
  130. use SimulationVariables!, only: OpenSafetyValveLedHw => OpenSafetyValveLed
  131. use CManifolds, only: OpenSafetyValve_TopDrive, OpenSafetyValve_KellyMode, OpenSafetyValve_TripMode
  132. use CHoistingVariables
  133. use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType
  134. implicit none
  135. logical , intent(in) :: v
  136. # 177
  137. data%State%notifications%OpenSafetyValveLed = v
  138. if(data%State%notifications%OpenSafetyValveLed) then
  139. !!call OpenSafetyValve()
  140. if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call OpenSafetyValve_TopDrive()
  141. if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_OpenSafetyValveLed == 0) call OpenSafetyValve_KellyMode()
  142. if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_OpenSafetyValveLed == 1) call OpenSafetyValve_TripMode()
  143. endif
  144. !**call data%State%notifications%OnOpenSafetyValveLedChange%RunAll()
  145. end subroutine
  146. logical function Get_OpenSafetyValveLed()
  147. implicit none
  148. Get_OpenSafetyValveLed = data%State%notifications%OpenSafetyValveLed
  149. end function
  150. subroutine Set_OpenKellyCockLed(v)
  151. ! use CDrillingConsoleVariables
  152. use SimulationVariables
  153. use SimulationVariables!, only: OpenKellyCockLedHw => OpenKellyCockLed
  154. use CManifolds, only: OpenKellyCock
  155. implicit none
  156. logical , intent(in) :: v
  157. # 204
  158. data%State%notifications%OpenKellyCockLed = v
  159. if(data%State%notifications%OpenKellyCockLed) then
  160. call OpenKellyCock()
  161. endif
  162. ! HAS BEEN IMPLEMENTED IN CMANIFOLD
  163. !if(OpenKellyCockLed) then
  164. ! OpenKellyCockLedHw = 1
  165. !else
  166. ! OpenKellyCockLedHw = 0
  167. !endif
  168. !**call data%State%notifications%OnOpenKellyCockLedChange%RunAll()
  169. end subroutine
  170. logical function Get_OpenKellyCockLed()
  171. implicit none
  172. Get_OpenKellyCockLed = data%State%notifications%OpenKellyCockLed
  173. end function
  174. subroutine Set_LatchLed(v)
  175. use CDrillingConsoleVariables
  176. use SimulationVariables
  177. use SimulationVariables!, only: data%Equipments%DrillingConsole%LatchPipeLED
  178. !use CUnlatchLedNotification
  179. implicit none
  180. logical , intent(in) :: v
  181. # 236
  182. data%State%notifications%LatchLed = v
  183. if(data%State%notifications%LatchLed) then
  184. data%Equipments%DrillingConsole%LatchPipeLED = 1
  185. !call Set_UnlatchLed(.false.)
  186. else
  187. data%Equipments%DrillingConsole%LatchPipeLED = 0
  188. endif
  189. !**call data%State%notifications%OnLatchLedChange%RunAll()
  190. end subroutine
  191. logical function Get_LatchLed()
  192. implicit none
  193. Get_LatchLed = data%State%notifications%LatchLed
  194. end function
  195. subroutine Set_IrSafetyValveLed(v)
  196. use CDrillingConsoleVariables
  197. use SimulationVariables
  198. use UnitySignalsModule
  199. use CManifolds, only: &
  200. InstallSafetyValve_TopDrive, &
  201. InstallSafetyValve_KellyMode, &
  202. InstallSafetyValve_TripMode, &
  203. RemoveSafetyValve_TopDrive, &
  204. RemoveSafetyValve_KellyMode, &
  205. RemoveSafetyValve_TripMode
  206. use UnitySignalVariables
  207. use CHoistingVariables
  208. implicit none
  209. logical , intent(in) :: v
  210. # 269
  211. data%State%notifications%IrSafetyValveLed = v
  212. if(data%State%notifications%IrSafetyValveLed) then
  213. data%Equipments%DrillingConsole%IRSafetyValveLed = 1
  214. if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call InstallSafetyValve_TopDrive()
  215. if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call InstallSafetyValve_KellyMode()
  216. if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call InstallSafetyValve_TripMode()
  217. call Set_SafetyValve_Install()
  218. else
  219. data%Equipments%DrillingConsole%IRSafetyValveLed = 0
  220. if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call RemoveSafetyValve_TopDrive()
  221. if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call RemoveSafetyValve_KellyMode()
  222. if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call RemoveSafetyValve_TripMode()
  223. call Set_SafetyValve_Remove()
  224. endif
  225. !**call data%State%notifications%OnIrSafetyValveLedChange%RunAll()
  226. end subroutine
  227. logical function Get_IrSafetyValveLed()
  228. implicit none
  229. Get_IrSafetyValveLed = data%State%notifications%IrSafetyValveLed
  230. end function
  231. subroutine Set_IrIBopLed(v)
  232. use CDrillingConsoleVariables
  233. use SimulationVariables
  234. use SimulationVariables!, only: IRIBopLedHw => IRIBopLed
  235. use CManifolds, only: InstallIBop, RemoveIBop
  236. use UnitySignalVariables
  237. use UnitySignalsModule, only: Set_Ibop_Install, Set_Ibop_Remove
  238. implicit none
  239. logical , intent(in) :: v
  240. # 304
  241. data%State%notifications%IrIBopLed = v
  242. if(data%State%notifications%IrIBopLed) then
  243. data%Equipments%DrillingConsole%IRIBopLed = 1
  244. call InstallIBop()
  245. call Set_Ibop_Install()
  246. else
  247. data%Equipments%DrillingConsole%IRIBopLed = 0
  248. call RemoveIBop()
  249. call Set_Ibop_Remove()
  250. endif
  251. !**call data%State%notifications%OnIrIBopLedChange%RunAll()
  252. end subroutine
  253. logical function Get_IrIBopLed()
  254. implicit none
  255. Get_IrIBopLed = data%State%notifications%IrIBopLed
  256. end function
  257. subroutine Set_FillMouseHoleLed(v)
  258. use CDrillingConsoleVariables
  259. use SimulationVariables
  260. ! use CMouseHoleEnumVariables
  261. use UnitySignalVariables
  262. use UnitySignalsModule
  263. implicit none
  264. logical , intent(in) :: v
  265. # 333
  266. data%State%notifications%FillMouseHoleLed = v
  267. if(data%State%notifications%FillMouseHoleLed) then
  268. data%Equipments%DrillingConsole%FillMouseHoleLed = 1
  269. !call Set_MouseHole(MOUSE_HOLE_FILL)
  270. else
  271. data%Equipments%DrillingConsole%FillMouseHoleLed = 0
  272. !call Set_MouseHole(MOUSE_HOLE_EMPTY)
  273. endif
  274. !**call data%State%notifications%OnFillMouseHoleLedChange%RunAll()
  275. end subroutine
  276. logical function Get_FillMouseHoleLed()
  277. implicit none
  278. Get_FillMouseHoleLed = data%State%notifications%FillMouseHoleLed
  279. end function
  280. subroutine Set_CloseKellyCockLed(v)
  281. use CDrillingConsoleVariables
  282. use SimulationVariables
  283. use SimulationVariables!, only: CloseKellyCockLedHw => CloseKellyCockLed
  284. use CManifolds, only: CloseKellyCock
  285. implicit none
  286. logical , intent(in) :: v
  287. # 359
  288. data%State%notifications%CloseKellyCockLed = v
  289. if(data%State%notifications%CloseKellyCockLed) then
  290. call CloseKellyCock()
  291. endif
  292. !**call data%State%notifications%OnCloseKellyCockLedChange%RunAll()
  293. end subroutine
  294. logical function Get_CloseKellyCockLed()
  295. implicit none
  296. Get_CloseKellyCockLed = data%State%notifications%CloseKellyCockLed
  297. end function
  298. subroutine Set_CloseSafetyValveLed(v)
  299. ! use CDrillingConsoleVariables
  300. use SimulationVariables
  301. !@use ConfigurationVariables, only: CloseSafetyValveLedHw => CloseSafetyValveLed
  302. use CManifolds, only: CloseSafetyValve_TopDrive, CloseSafetyValve_KellyMode, CloseSafetyValve_TripMode
  303. use CHoistingVariables
  304. use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType
  305. implicit none
  306. logical , intent(in) :: v
  307. # 383
  308. data%State%notifications%CloseSafetyValveLed = v
  309. if(data%State%notifications%CloseSafetyValveLed) then
  310. !!call CloseSafetyValve()
  311. if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call CloseSafetyValve_TopDrive()
  312. if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_CloseSafetyValveLed == 0) call CloseSafetyValve_KellyMode()
  313. if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_CloseSafetyValveLed == 1) call CloseSafetyValve_TripMode()
  314. endif
  315. !**call data%State%notifications%OnCloseSafetyValveLedChange%RunAll()
  316. end subroutine
  317. logical function Get_CloseSafetyValveLed()
  318. implicit none
  319. Get_CloseSafetyValveLed = data%State%notifications%CloseSafetyValveLed
  320. end function
  321. end module NotificationModule