Simulation Core
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

401 行
16 KiB

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