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.

CDrillingConsole.f90 30 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  1. module CDrillingConsole
  2. use CDrillingConsoleVariables
  3. use ConfigurationVariables
  4. use ConfigurationVariables
  5. ! use CSimulationVariables
  6. use CLog4
  7. use CLog3
  8. implicit none
  9. public
  10. contains
  11. ! Input routines
  12. subroutine SetAssignmentSwitch(v)
  13. !DEC$ ATTRIBUTES DLLEXPORT :: SetAssignmentSwitch
  14. !DEC$ ATTRIBUTES ALIAS: 'SetAssignmentSwitch' :: SetAssignmentSwitch
  15. implicit none
  16. integer, intent(in) :: v
  17. data%EquipmentControl%DrillingConsole%AssignmentSwitch = v
  18. #ifdef deb
  19. call Log_4( 'AssignmentSwitch=', data%EquipmentControl%DrillingConsole%AssignmentSwitch)
  20. #endif
  21. end subroutine
  22. subroutine SetEmergencySwitch(v)
  23. !DEC$ ATTRIBUTES DLLEXPORT :: SetEmergencySwitch
  24. !DEC$ ATTRIBUTES ALIAS: 'SetEmergencySwitch' :: SetEmergencySwitch
  25. implicit none
  26. logical, intent(in) :: v
  27. data%EquipmentControl%DrillingConsole%EmergencySwitch = v
  28. #ifdef deb
  29. print*, 'EmergencySwitch=', data%EquipmentControl%DrillingConsole%EmergencySwitch
  30. #endif
  31. end subroutine
  32. subroutine SetRTTorqueLimitKnob(v)
  33. !DEC$ ATTRIBUTES DLLEXPORT :: SetRTTorqueLimitKnob
  34. !DEC$ ATTRIBUTES ALIAS: 'SetRTTorqueLimitKnob' :: SetRTTorqueLimitKnob
  35. implicit none
  36. real*8, intent(in) :: v
  37. data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob = v
  38. #ifdef deb
  39. print*, 'RTTorqueLimitKnob=', data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob
  40. #endif
  41. end subroutine
  42. subroutine SetMP1CPSwitch(v)
  43. !DEC$ ATTRIBUTES DLLEXPORT :: SetMP1CPSwitch
  44. !DEC$ ATTRIBUTES ALIAS: 'SetMP1CPSwitch' :: SetMP1CPSwitch
  45. implicit none
  46. integer, intent(in) :: v
  47. if(data%EquipmentControl%DrillingConsole%MP1CPSwitch == v) return
  48. if(SimulationState == SimulationState_Started) then
  49. data%EquipmentControl%DrillingConsole%MP1CPSwitchI = data%EquipmentControl%DrillingConsole%MP1CPSwitchI + 1
  50. if(data%EquipmentControl%DrillingConsole%MP1CPSwitchI >= 1) data%EquipmentControl%DrillingConsole%MP1CPSwitch = v
  51. if(data%EquipmentControl%DrillingConsole%MP1CPSwitchI >= 100) data%EquipmentControl%DrillingConsole%MP1CPSwitchI = 1
  52. !call Log_3( "MP1CPSwitchI=", MP1CPSwitchI)
  53. !call Log_3( "MP1CPSwitch=", MP1CPSwitch)
  54. !MP1CPSwitch = v
  55. endif
  56. ! if(SimulationState == SimulationState_Started) then
  57. ! !call Log_3( 'MP1CPSwitc(s)h=', MP1CPSwitch)
  58. ! if(MP1CPSwitchT /= v) then
  59. ! MP1CPSwitchT = v
  60. ! MP1CPSwitch = v
  61. !#ifdef deb
  62. ! !print*, 'MP1CPSwitch=', MP1CPSwitch
  63. ! !call Log_3( 'MP1CPSwitch=', MP1CPSwitch)
  64. !#endif
  65. ! endif
  66. ! else
  67. ! MP1CPSwitchT = v
  68. ! endif
  69. end subroutine
  70. subroutine SetMP1Throttle(v)
  71. !DEC$ ATTRIBUTES DLLEXPORT :: SetMP1Throttle
  72. !DEC$ ATTRIBUTES ALIAS: 'SetMP1Throttle' :: SetMP1Throttle
  73. implicit none
  74. real*8, intent(in) :: v
  75. if(data%EquipmentControl%DrillingConsole%MP1Throttle == v) return
  76. if(SimulationState == SimulationState_Started) then
  77. if( abs(v - data%EquipmentControl%DrillingConsole%MP1Throttle) > 0.1) data%EquipmentControl%DrillingConsole%MP1ThrottleUpdate = .true.
  78. if(data%EquipmentControl%DrillingConsole%MP1ThrottleUpdate) data%EquipmentControl%DrillingConsole%MP1Throttle = v
  79. !call Log_3( 'v-mp1=', v)
  80. !call Log_3( 'MP1Throttle=', MP1Throttle)
  81. !call Log_3( 'MP1ThrottleUpdate=', MP1ThrottleUpdate)
  82. !MP1Throttle = v
  83. endif
  84. #ifdef deb
  85. print*, 'MP1Throttle=', data%EquipmentControl%DrillingConsole%MP1Throttle
  86. #endif
  87. end subroutine
  88. subroutine SetMP2Switch(v)
  89. !DEC$ ATTRIBUTES DLLEXPORT :: SetMP2Switch
  90. !DEC$ ATTRIBUTES ALIAS: 'SetMP2Switch' :: SetMP2Switch
  91. implicit none
  92. logical, intent(in) :: v
  93. !call Log_3( 'v=', MP2SwitchT)
  94. if(data%EquipmentControl%DrillingConsole%MP2Switch == v) return
  95. if(SimulationState == SimulationState_Started) then
  96. data%EquipmentControl%DrillingConsole%MP2SwitchI = data%EquipmentControl%DrillingConsole%MP2SwitchI + 1
  97. if(data%EquipmentControl%DrillingConsole%MP2SwitchI >= 1) data%EquipmentControl%DrillingConsole%MP2Switch = v
  98. if(data%EquipmentControl%DrillingConsole%MP2SwitchI >= 100) data%EquipmentControl%DrillingConsole%MP2SwitchI = 1
  99. !call Log_3( "MP1CPSwitchI=", MP1CPSwitchI)
  100. !call Log_3( "MP2Switch=", MP2Switch)
  101. !MP2Switch = v
  102. endif
  103. ! if(SimulationState == SimulationState_Started) then
  104. ! !call Log_3( 'MP2Switch(s)=', MP2Switch)
  105. ! if(MP2SwitchT /= v) then
  106. ! MP2SwitchT = v
  107. ! MP2Switch = v
  108. !#ifdef deb
  109. ! !print*, 'MP2Switch=', MP2Switch
  110. ! !call Log_3( 'MP2Switch=', MP2Switch)
  111. !#endif
  112. ! endif
  113. ! else
  114. ! MP2SwitchT = v
  115. ! !call Log_3( 'MP2SwitchTMP2SwitchTMP2SwitchT=', MP2SwitchT)
  116. ! endif
  117. end subroutine
  118. subroutine SetMP2Throttle(v)
  119. !DEC$ ATTRIBUTES DLLEXPORT :: SetMP2Throttle
  120. !DEC$ ATTRIBUTES ALIAS: 'SetMP2Throttle' :: SetMP2Throttle
  121. implicit none
  122. real*8, intent(in) :: v
  123. if(data%EquipmentControl%DrillingConsole%MP2Throttle == v) return
  124. if(SimulationState == SimulationState_Started) then
  125. if( abs(v - data%EquipmentControl%DrillingConsole%MP2Throttle) > 0.1) data%EquipmentControl%DrillingConsole%MP2ThrottleUpdate = .true.
  126. if(data%EquipmentControl%DrillingConsole%MP2ThrottleUpdate) data%EquipmentControl%DrillingConsole%MP2Throttle = v
  127. !call Log_3( 'v-mp2=', v)
  128. !call Log_3( 'MP2Throttle=', MP2Throttle)
  129. !call Log_3( 'MP2ThrottleUpdate=', MP2ThrottleUpdate)
  130. !MP2Throttle = v
  131. endif
  132. #ifdef deb
  133. print*, 'MP2Throttle=', data%EquipmentControl%DrillingConsole%MP2Throttle
  134. #endif
  135. end subroutine
  136. subroutine SetDWSwitch(v)
  137. !DEC$ ATTRIBUTES DLLEXPORT :: SetDWSwitch
  138. !DEC$ ATTRIBUTES ALIAS: 'SetDWSwitch' :: SetDWSwitch
  139. implicit none
  140. integer, intent(in) :: v
  141. data%EquipmentControl%DrillingConsole%DWSwitch = v
  142. #ifdef deb
  143. print*, 'DWSwitch=', data%EquipmentControl%DrillingConsole%DWSwitch
  144. #endif
  145. end subroutine
  146. subroutine SetDWThrottle(v)
  147. !DEC$ ATTRIBUTES DLLEXPORT :: SetDWThrottle
  148. !DEC$ ATTRIBUTES ALIAS: 'SetDWThrottle' :: SetDWThrottle
  149. implicit none
  150. real*8, intent(in) :: v
  151. data%EquipmentControl%DrillingConsole%DWThrottle = v
  152. #ifdef deb
  153. print*, 'DWThrottle=', data%EquipmentControl%DrillingConsole%DWThrottle
  154. #endif
  155. end subroutine
  156. subroutine SetRTSwitch(v)
  157. !DEC$ ATTRIBUTES DLLEXPORT :: SetRTSwitch
  158. !DEC$ ATTRIBUTES ALIAS: 'SetRTSwitch' :: SetRTSwitch
  159. implicit none
  160. integer, intent(in) :: v
  161. data%EquipmentControl%DrillingConsole%RTSwitch = v
  162. #ifdef deb
  163. print*, 'RTSwitch=', data%EquipmentControl%DrillingConsole%RTSwitch
  164. #endif
  165. end subroutine
  166. subroutine SetRTThrottle(v)
  167. !DEC$ ATTRIBUTES DLLEXPORT :: SetRTThrottle
  168. !DEC$ ATTRIBUTES ALIAS: 'SetRTThrottle' :: SetRTThrottle
  169. implicit none
  170. real*8, intent(in) :: v
  171. data%EquipmentControl%DrillingConsole%RTThrottle = v
  172. #ifdef deb
  173. print*, 'RTThrottle=', data%EquipmentControl%DrillingConsole%RTThrottle
  174. #endif
  175. end subroutine
  176. subroutine SetDWBreak(v)
  177. !DEC$ ATTRIBUTES DLLEXPORT :: SetDWBreak
  178. !DEC$ ATTRIBUTES ALIAS: 'SetDWBreak' :: SetDWBreak
  179. implicit none
  180. real*8, intent(in) :: v
  181. !if(ForceBreak) return
  182. data%EquipmentControl%DrillingConsole%PreviousDWBreak = data%EquipmentControl%DrillingConsole%DWBreak
  183. data%EquipmentControl%DrillingConsole%DWBreak = v
  184. #ifdef deb
  185. print*, 'DWBreak=', data%EquipmentControl%DrillingConsole%DWBreak
  186. #endif
  187. end subroutine
  188. subroutine SetDWAcceleretor(v)
  189. !DEC$ ATTRIBUTES DLLEXPORT :: SetDWAcceleretor
  190. !DEC$ ATTRIBUTES ALIAS: 'SetDWAcceleretor' :: SetDWAcceleretor
  191. implicit none
  192. real*8, intent(in) :: v
  193. data%EquipmentControl%DrillingConsole%DWAcceleretor = v
  194. #ifdef deb
  195. print*, 'DWAcceleretor=', data%EquipmentControl%DrillingConsole%DWAcceleretor
  196. #endif
  197. end subroutine
  198. subroutine SetDWTransmisionLever(v)
  199. !DEC$ ATTRIBUTES DLLEXPORT :: SetDWTransmisionLever
  200. !DEC$ ATTRIBUTES ALIAS: 'SetDWTransmisionLever' :: SetDWTransmisionLever
  201. implicit none
  202. real*8, intent(in) :: v
  203. data%EquipmentControl%DrillingConsole%DWTransmisionLever = v
  204. #ifdef deb
  205. print*, 'DWTransmisionLever=', data%EquipmentControl%DrillingConsole%DWTransmisionLever
  206. #endif
  207. end subroutine
  208. subroutine SetDWPowerLever(v)
  209. !DEC$ ATTRIBUTES DLLEXPORT :: SetDWPowerLever
  210. !DEC$ ATTRIBUTES ALIAS: 'SetDWPowerLever' :: SetDWPowerLever
  211. implicit none
  212. real*8, intent(in) :: v
  213. data%EquipmentControl%DrillingConsole%DWPowerLever = v
  214. #ifdef deb
  215. print*, 'DWPowerLever=', data%EquipmentControl%DrillingConsole%DWPowerLever
  216. #endif
  217. end subroutine
  218. subroutine SetTongLever(v)
  219. !DEC$ ATTRIBUTES DLLEXPORT :: SetTongLever
  220. !DEC$ ATTRIBUTES ALIAS: 'SetTongLever' :: SetTongLever
  221. implicit none
  222. real*8, intent(in) :: v
  223. if (data%EquipmentControl%DrillingConsole%TongLever == v) return
  224. data%EquipmentControl%DrillingConsole%TongLever = v
  225. ! if(dint(TongLever) == 1.0) then
  226. ! call OnBreakoutLeverPress%RunAll()
  227. ! #ifdef deb
  228. ! print*, 'OnBreakoutLeverPress=', size(OnBreakoutLeverPress%Delegates)
  229. ! #endif
  230. ! endif
  231. ! if(dint(TongLever) == -1.0) then
  232. ! call OnMakeupLeverPress%RunAll()
  233. ! #ifdef deb
  234. ! print*, 'OnMakeupPress=', size(OnMakeupLeverPress%Delegates)
  235. ! #endif
  236. ! endif
  237. ! if(dint(TongLever) == 0.0) then
  238. ! call OnTongNeutralPress%RunAll()
  239. ! #ifdef deb
  240. ! print*, 'OnTongNeutralPress=', size(OnTongNeutralPress%Delegates)
  241. ! #endif
  242. ! endif
  243. #ifdef deb
  244. print*, 'TongLever=', data%EquipmentControl%DrillingConsole%TongLever
  245. #endif
  246. end subroutine
  247. subroutine SetRTTransmissionLever(v)
  248. !DEC$ ATTRIBUTES DLLEXPORT :: SetRTTransmissionLever
  249. !DEC$ ATTRIBUTES ALIAS: 'SetRTTransmissionLever' :: SetRTTransmissionLever
  250. implicit none
  251. real*8, intent(in) :: v
  252. data%EquipmentControl%DrillingConsole%RTTransmissionLever = v
  253. #ifdef deb
  254. print*, 'RTTransmissionLever=', data%EquipmentControl%DrillingConsole%RTTransmissionLever
  255. #endif
  256. end subroutine
  257. subroutine SetDWClutchLever(v)
  258. !DEC$ ATTRIBUTES DLLEXPORT :: SetDWClutchLever
  259. !DEC$ ATTRIBUTES ALIAS: 'SetDWClutchLever' :: SetDWClutchLever
  260. implicit none
  261. real*8, intent(in) :: v
  262. data%EquipmentControl%DrillingConsole%DWClutchLever = v
  263. #ifdef deb
  264. print*, 'DWClutchLever=', data%EquipmentControl%DrillingConsole%DWClutchLever
  265. #endif
  266. end subroutine
  267. subroutine SetEddyBreakLever(v)
  268. !DEC$ ATTRIBUTES DLLEXPORT :: SetEddyBreakLever
  269. !DEC$ ATTRIBUTES ALIAS: 'SetEddyBreakLever' :: SetEddyBreakLever
  270. implicit none
  271. real*8, intent(in) :: v
  272. data%EquipmentControl%DrillingConsole%EddyBreakLever = v
  273. #ifdef deb
  274. print*, 'EddyBreakLever=', data%EquipmentControl%DrillingConsole%EddyBreakLever
  275. #endif
  276. end subroutine
  277. subroutine SetAutoDW(v)
  278. !DEC$ ATTRIBUTES DLLEXPORT :: SetAutoDW
  279. !DEC$ ATTRIBUTES ALIAS: 'SetAutoDW' :: SetAutoDW
  280. implicit none
  281. logical, intent(in) :: v
  282. data%EquipmentControl%DrillingConsole%AutoDW = v
  283. #ifdef deb
  284. print*, 'AutoDW=', data%EquipmentControl%DrillingConsole%AutoDW
  285. #endif
  286. end subroutine
  287. subroutine SetGEN1(v)
  288. !DEC$ ATTRIBUTES DLLEXPORT :: SetGEN1
  289. !DEC$ ATTRIBUTES ALIAS: 'SetGEN1' :: SetGEN1
  290. implicit none
  291. logical, intent(in) :: v
  292. data%EquipmentControl%DrillingConsole%GEN1 = v
  293. #ifdef deb
  294. print*, 'GEN1=', data%EquipmentControl%DrillingConsole%GEN1
  295. #endif
  296. end subroutine
  297. subroutine SetGEN2(v)
  298. !DEC$ ATTRIBUTES DLLEXPORT :: SetGEN2
  299. !DEC$ ATTRIBUTES ALIAS: 'SetGEN2' :: SetGEN2
  300. implicit none
  301. logical, intent(in) :: v
  302. data%EquipmentControl%DrillingConsole%GEN2 = v
  303. #ifdef deb
  304. print*, 'GEN2=', data%EquipmentControl%DrillingConsole%GEN2
  305. #endif
  306. end subroutine
  307. subroutine SetGEN3(v)
  308. !DEC$ ATTRIBUTES DLLEXPORT :: SetGEN3
  309. !DEC$ ATTRIBUTES ALIAS: 'SetGEN3' :: SetGEN3
  310. implicit none
  311. logical, intent(in) :: v
  312. data%EquipmentControl%DrillingConsole%GEN3 = v
  313. #ifdef deb
  314. print*, 'GEN3=', data%EquipmentControl%DrillingConsole%GEN3
  315. #endif
  316. end subroutine
  317. subroutine SetGEN4(v)
  318. !DEC$ ATTRIBUTES DLLEXPORT :: SetGEN4
  319. !DEC$ ATTRIBUTES ALIAS: 'SetGEN4' :: SetGEN4
  320. implicit none
  321. logical, intent(in) :: v
  322. data%EquipmentControl%DrillingConsole%GEN4 = v
  323. #ifdef deb
  324. print*, 'GEN4=', data%EquipmentControl%DrillingConsole%GEN4
  325. #endif
  326. end subroutine
  327. ! subroutine SetInstallSafetyValve(v)
  328. ! !DEC$ ATTRIBUTES DLLEXPORT :: SetInstallSafetyValve
  329. ! !DEC$ ATTRIBUTES ALIAS: 'SetInstallSafetyValve' :: SetInstallSafetyValve
  330. ! implicit none
  331. ! logical, intent(in) :: v
  332. ! InstallSafetyValve = v
  333. !#ifdef deb
  334. ! print*, 'InstallSafetyValve=', InstallSafetyValve
  335. !#endif
  336. ! end subroutine
  337. !
  338. ! subroutine SetOpenSafetyValve(v)
  339. ! !DEC$ ATTRIBUTES DLLEXPORT :: SetOpenSafetyValve
  340. ! !DEC$ ATTRIBUTES ALIAS: 'SetOpenSafetyValve' :: SetOpenSafetyValve
  341. ! implicit none
  342. ! logical, intent(in) :: v
  343. ! OpenSafetyValve = v
  344. !#ifdef deb
  345. ! print*, 'OpenSafetyValve=', OpenSafetyValve
  346. !#endif
  347. ! end subroutine
  348. !
  349. ! subroutine SetRemoveSafetyValve(v)
  350. ! !DEC$ ATTRIBUTES DLLEXPORT :: SetRemoveSafetyValve
  351. ! !DEC$ ATTRIBUTES ALIAS: 'SetRemoveSafetyValve' :: SetRemoveSafetyValve
  352. ! implicit none
  353. ! logical, intent(in) :: v
  354. ! RemoveSafetyValve = v
  355. !#ifdef deb
  356. ! print*, 'RemoveSafetyValve=', RemoveSafetyValve
  357. !#endif
  358. ! end subroutine
  359. !
  360. ! subroutine SetCloseSafetyValve(v)
  361. ! !DEC$ ATTRIBUTES DLLEXPORT :: SetCloseSafetyValve
  362. ! !DEC$ ATTRIBUTES ALIAS: 'SetCloseSafetyValve' :: SetCloseSafetyValve
  363. ! implicit none
  364. ! logical, intent(in) :: v
  365. ! CloseSafetyValve = v
  366. !#ifdef deb
  367. ! print*, 'CloseSafetyValve=', CloseSafetyValve
  368. !#endif
  369. ! end subroutine
  370. !
  371. ! subroutine SetMakeJoint(v)
  372. ! !DEC$ ATTRIBUTES DLLEXPORT :: SetMakeJoint
  373. ! !DEC$ ATTRIBUTES ALIAS: 'SetMakeJoint' :: SetMakeJoint
  374. ! implicit none
  375. ! logical, intent(in) :: v
  376. ! MakeJoint = v
  377. !#ifdef deb
  378. ! print*, 'MakeJoint=', MakeJoint
  379. !#endif
  380. ! end subroutine
  381. !
  382. ! subroutine SetBreakJoint(v)
  383. ! !DEC$ ATTRIBUTES DLLEXPORT :: SetBreakJoint
  384. ! !DEC$ ATTRIBUTES ALIAS: 'SetBreakJoint' :: SetBreakJoint
  385. ! implicit none
  386. ! logical, intent(in) :: v
  387. ! BreakJoint = v
  388. !#ifdef deb
  389. ! print*, 'BreakJoint=', BreakJoint
  390. !#endif
  391. ! end subroutine
  392. subroutine SetOpenKellyCock(v)
  393. !DEC$ ATTRIBUTES DLLEXPORT :: SetOpenKellyCock
  394. !DEC$ ATTRIBUTES ALIAS: 'SetOpenKellyCock' :: SetOpenKellyCock
  395. use CManifolds, OpenKellyCockSub => OpenKellyCock
  396. implicit none
  397. logical, intent(in) :: v
  398. if (data%EquipmentControl%DrillingConsole%OpenKellyCock == v) return
  399. data%EquipmentControl%DrillingConsole%OpenKellyCock = v
  400. ! if (v) call OnOpenKellyCockPress%RunAll()
  401. if(v .and. data%EquipmentControl%DrillingConsole%Permission_OpenKellyCock) call OpenKellyCockSub()
  402. #ifdef deb
  403. print*, 'OpenKellyCock=', data%EquipmentControl%DrillingConsole%OpenKellyCock
  404. #endif
  405. end subroutine
  406. subroutine SetCloseKellyCock(v)
  407. !DEC$ ATTRIBUTES DLLEXPORT :: SetCloseKellyCock
  408. !DEC$ ATTRIBUTES ALIAS: 'SetCloseKellyCock' :: SetCloseKellyCock
  409. use CManifolds, CloseKellyCockSub => CloseKellyCock
  410. implicit none
  411. logical, intent(in) :: v
  412. if (data%EquipmentControl%DrillingConsole%CloseKellyCock == v) return
  413. data%EquipmentControl%DrillingConsole%CloseKellyCock = v
  414. ! if (v) call OnCloseKellyCockPress%RunAll()
  415. if(v .and. data%EquipmentControl%DrillingConsole%Permission_CloseKellyCock) call CloseKellyCockSub()
  416. #ifdef deb
  417. print*, 'CloseKellyCock=', data%EquipmentControl%DrillingConsole%CloseKellyCock
  418. #endif
  419. end subroutine
  420. subroutine SetOpenSafetyValve(v)
  421. !DEC$ ATTRIBUTES DLLEXPORT :: SetOpenSafetyValve
  422. !DEC$ ATTRIBUTES ALIAS: 'SetOpenSafetyValve' :: SetOpenSafetyValve
  423. !use CManifolds, OpenSafetyValveSub => OpenSafetyValve
  424. implicit none
  425. logical, intent(in) :: v
  426. if (data%EquipmentControl%DrillingConsole%OpenSafetyValve == v) return
  427. data%EquipmentControl%DrillingConsole%OpenSafetyValve = v
  428. ! if (v) call OnOpenSafetyValvePress%RunAll()
  429. !if(v .and. Permission_OpenSafetyValve) call OpenSafetyValveSub()
  430. #ifdef deb
  431. print*, 'OpenSafetyValve=', data%EquipmentControl%DrillingConsole%OpenSafetyValve
  432. #endif
  433. end subroutine
  434. subroutine SetCloseSafetyValve(v)
  435. !DEC$ ATTRIBUTES DLLEXPORT :: SetCloseSafetyValve
  436. !DEC$ ATTRIBUTES ALIAS: 'SetCloseSafetyValve' :: SetCloseSafetyValve
  437. !use CManifolds, CloseSafetyValveSub => CloseSafetyValve
  438. implicit none
  439. logical, intent(in) :: v
  440. if (data%EquipmentControl%DrillingConsole%CloseSafetyValve == v) return
  441. data%EquipmentControl%DrillingConsole%CloseSafetyValve = v
  442. ! if (v) call OnCloseSafetyValvePress%RunAll()
  443. !if(v .and. Permission_CloseSafetyValve) call CloseSafetyValveSub()
  444. #ifdef deb
  445. print*, 'CloseSafetyValve=', data%EquipmentControl%DrillingConsole%CloseSafetyValve
  446. #endif
  447. end subroutine
  448. subroutine SetIRSafetyValve(v)
  449. !DEC$ ATTRIBUTES DLLEXPORT :: SetIRSafetyValve
  450. !DEC$ ATTRIBUTES ALIAS: 'SetIRSafetyValve' :: SetIRSafetyValve
  451. use CManifolds
  452. implicit none
  453. logical, intent(in) :: v
  454. logical :: prev
  455. if (data%EquipmentControl%DrillingConsole%IRSafetyValve == v) return
  456. prev = data%EquipmentControl%DrillingConsole%IRSafetyValve
  457. data%EquipmentControl%DrillingConsole%IRSafetyValve = v
  458. ! if (v) call OnIRSafetyValvePress%RunAll()
  459. !if(prev /= IRSafetyValve .and. v .and. Permission_IRSafetyValve) call ToggleSafetyValve()
  460. !if(prev /= IRSafetyValve .and. v) call ToggleSafetyValve()
  461. #ifdef deb
  462. print*, 'IRSafetyValve=', data%EquipmentControl%DrillingConsole%IRSafetyValve
  463. #endif
  464. end subroutine
  465. subroutine SetIRIBop(v)
  466. !DEC$ ATTRIBUTES DLLEXPORT :: SetIRIBop
  467. !DEC$ ATTRIBUTES ALIAS: 'SetIRIBop' :: SetIRIBop
  468. use CManifolds
  469. implicit none
  470. logical, intent(in) :: v
  471. logical :: prev
  472. if (data%EquipmentControl%DrillingConsole%IRIBop == v) return
  473. prev = data%EquipmentControl%DrillingConsole%IRIBop
  474. data%EquipmentControl%DrillingConsole%IRIBop = v
  475. ! if (v) call OnIRIBopPress%RunAll()
  476. !if(prev /= IRIBop .and. v .and. Permission_IRIBop) call ToggleIBop()
  477. !if(prev /= IRIBop .and. v) call ToggleIBop()
  478. #ifdef deb
  479. print*, 'IRIBop=', data%EquipmentControl%DrillingConsole%IRIBop
  480. #endif
  481. end subroutine
  482. subroutine SetLatchPipe(v)
  483. !DEC$ ATTRIBUTES DLLEXPORT :: SetLatchPipe
  484. !DEC$ ATTRIBUTES ALIAS: 'SetLatchPipe' :: SetLatchPipe
  485. implicit none
  486. logical, intent(in) :: v
  487. if (data%EquipmentControl%DrillingConsole%LatchPipe .eqv. v) return
  488. data%EquipmentControl%DrillingConsole%LatchPipe = v
  489. ! if (v) call OnLatchPipePress%RunAll()
  490. #ifdef deb
  491. print*, 'LatchPipe=', data%EquipmentControl%DrillingConsole%LatchPipe
  492. #endif
  493. end subroutine
  494. subroutine SetUnlatchPipe(v)
  495. !DEC$ ATTRIBUTES DLLEXPORT :: SetUnlatchPipe
  496. !DEC$ ATTRIBUTES ALIAS: 'SetUnlatchPipe' :: SetUnlatchPipe
  497. implicit none
  498. logical, intent(in) :: v
  499. if (data%EquipmentControl%DrillingConsole%UnlatchPipe .eqv. v) return
  500. data%EquipmentControl%DrillingConsole%UnlatchPipe = v
  501. ! if (v) call OnUnlatchPipePress%RunAll()
  502. #ifdef deb
  503. print*, 'UnlatchPipe=', data%EquipmentControl%DrillingConsole%UnlatchPipe
  504. #endif
  505. end subroutine
  506. subroutine SetSwing(v)
  507. !DEC$ ATTRIBUTES DLLEXPORT :: SetSwing
  508. !DEC$ ATTRIBUTES ALIAS: 'SetSwing' :: SetSwing
  509. implicit none
  510. logical, intent(in) :: v
  511. if (data%EquipmentControl%DrillingConsole%Swing .eqv. v) return
  512. data%EquipmentControl%DrillingConsole%Swing = v
  513. ! if (v) call OnSwingPress%RunAll()
  514. #ifdef deb
  515. print*, 'Swing=', data%EquipmentControl%DrillingConsole%Swing
  516. #endif
  517. end subroutine
  518. subroutine SetFillMouseHole(v)
  519. !DEC$ ATTRIBUTES DLLEXPORT :: SetFillMouseHole
  520. !DEC$ ATTRIBUTES ALIAS: 'SetFillMouseHole' :: SetFillMouseHole
  521. implicit none
  522. logical, intent(in) :: v
  523. if (data%EquipmentControl%DrillingConsole%FillMouseHole .eqv. v) return
  524. data%EquipmentControl%DrillingConsole%FillMouseHole = v
  525. ! if (v) call OnFillMouseHolePress%RunAll()
  526. #ifdef deb
  527. print*, 'FillMouseHole=', data%EquipmentControl%DrillingConsole%FillMouseHole
  528. #endif
  529. end subroutine
  530. subroutine SetSlips(v)
  531. !DEC$ ATTRIBUTES DLLEXPORT :: SetSlips
  532. !DEC$ ATTRIBUTES ALIAS: 'SetSlips' :: SetSlips
  533. implicit none
  534. logical, intent(in) :: v
  535. if (data%EquipmentControl%DrillingConsole%Slips .eqv. v) return
  536. data%EquipmentControl%DrillingConsole%Slips = v
  537. #ifdef deb
  538. print*, 'Slips=', data%EquipmentControl%DrillingConsole%Slips
  539. #endif
  540. ! if (v) call OnSlipsPress%RunAll()
  541. end subroutine
  542. subroutine SetBrakeLeverCoefficient(v)
  543. !DEC$ ATTRIBUTES DLLEXPORT :: SetBrakeLeverCoefficient
  544. !DEC$ ATTRIBUTES ALIAS: 'SetBrakeLeverCoefficient' :: SetBrakeLeverCoefficient
  545. implicit none
  546. real, intent(in) :: v
  547. data%EquipmentControl%DrillingConsole%BrakeLeverCoefficient = v
  548. #ifdef deb
  549. print*, 'BrakeLeverCoefficient=', data%EquipmentControl%DrillingConsole%BrakeLeverCoefficient
  550. #endif
  551. end subroutine
  552. subroutine SetHideDrillingBrake(v)
  553. !DEC$ ATTRIBUTES DLLEXPORT :: SetHideDrillingBrake
  554. !DEC$ ATTRIBUTES ALIAS: 'SetHideDrillingBrake' :: SetHideDrillingBrake
  555. implicit none
  556. logical, intent(in) :: v
  557. data%EquipmentControl%DrillingConsole%HideDrillingBrake = v
  558. #ifdef deb
  559. print*, 'HideDrillingBrake=', data%EquipmentControl%DrillingConsole%HideDrillingBrake
  560. #endif
  561. end subroutine
  562. subroutine SetParkingBrake(v)
  563. !DEC$ ATTRIBUTES DLLEXPORT :: SetParkingBrake
  564. !DEC$ ATTRIBUTES ALIAS: 'SetParkingBrake' :: SetParkingBrake
  565. implicit none
  566. logical, intent(in) :: v
  567. data%EquipmentControl%DrillingConsole%ParkingBrakeBtn = v
  568. #ifdef deb
  569. print*, 'ParkingBrakeBtn=', data%EquipmentControl%DrillingConsole%ParkingBrakeBtn
  570. #endif
  571. end subroutine
  572. ! Output routines
  573. logical function GetParkingBrakeLed()
  574. !DEC$ ATTRIBUTES DLLEXPORT :: GetParkingBrakeLed
  575. !DEC$ ATTRIBUTES ALIAS: 'GetParkingBrakeLed' :: GetParkingBrakeLed
  576. implicit none
  577. GetParkingBrakeLed = data%EquipmentControl%DrillingConsole%ParkingBrakeLed
  578. !GetParkingBrakeLed = .true.
  579. end function
  580. integer function GetGEN1LED()
  581. !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN1LED
  582. !DEC$ ATTRIBUTES ALIAS: 'GetGEN1LED' :: GetGEN1LED
  583. implicit none
  584. GetGEN1LED = 1
  585. !GetGEN1LED = GEN1LED
  586. end function
  587. integer function GetGEN2LED()
  588. !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN2LED
  589. !DEC$ ATTRIBUTES ALIAS: 'GetGEN2LED' :: GetGEN2LED
  590. implicit none
  591. GetGEN2LED = 1
  592. !GetGEN2LED = GEN2LED
  593. end function
  594. integer function GetGEN3LED()
  595. !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN3LED
  596. !DEC$ ATTRIBUTES ALIAS: 'GetGEN3LED' :: GetGEN3LED
  597. implicit none
  598. GetGEN3LED = 1
  599. !GetGEN3LED = GEN3LED
  600. end function
  601. integer function GetGEN4LED()
  602. !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN4LED
  603. !DEC$ ATTRIBUTES ALIAS: 'GetGEN4LED' :: GetGEN4LED
  604. implicit none
  605. GetGEN4LED = 1
  606. !GetGEN4LED = GEN4LED
  607. end function
  608. integer function GetSCR1LED()
  609. !DEC$ ATTRIBUTES DLLEXPORT :: GetSCR1LED
  610. !DEC$ ATTRIBUTES ALIAS: 'GetSCR1LED' :: GetSCR1LED
  611. implicit none
  612. GetSCR1LED = data%EquipmentControl%DrillingConsole%SCR1LED
  613. end function
  614. integer function GetSCR2LED()
  615. !DEC$ ATTRIBUTES DLLEXPORT :: GetSCR2LED
  616. !DEC$ ATTRIBUTES ALIAS: 'GetSCR2LED' :: GetSCR2LED
  617. implicit none
  618. GetSCR2LED = data%EquipmentControl%DrillingConsole%SCR2LED
  619. end function
  620. integer function GetSCR3LED()
  621. !DEC$ ATTRIBUTES DLLEXPORT :: GetSCR3LED
  622. !DEC$ ATTRIBUTES ALIAS: 'GetSCR3LED' :: GetSCR3LED
  623. implicit none
  624. GetSCR3LED = data%EquipmentControl%DrillingConsole%SCR3LED
  625. end function
  626. integer function GetSCR4LED()
  627. !DEC$ ATTRIBUTES DLLEXPORT :: GetSCR4LED
  628. !DEC$ ATTRIBUTES ALIAS: 'GetSCR4LED' :: GetSCR4LED
  629. implicit none
  630. GetSCR4LED = data%EquipmentControl%DrillingConsole%SCR4LED
  631. end function
  632. integer function GetMP1BLWR()
  633. !DEC$ ATTRIBUTES DLLEXPORT :: GetMP1BLWR
  634. !DEC$ ATTRIBUTES ALIAS: 'GetMP1BLWR' :: GetMP1BLWR
  635. implicit none
  636. GetMP1BLWR = data%EquipmentControl%DrillingConsole%MP1BLWR
  637. end function
  638. integer function GetMP2BLWR()
  639. !DEC$ ATTRIBUTES DLLEXPORT :: GetMP2BLWR
  640. !DEC$ ATTRIBUTES ALIAS: 'GetMP2BLWR' :: GetMP2BLWR
  641. implicit none
  642. GetMP2BLWR = data%EquipmentControl%DrillingConsole%MP2BLWR
  643. end function
  644. integer function GetDWBLWR()
  645. !DEC$ ATTRIBUTES DLLEXPORT :: GetDWBLWR
  646. !DEC$ ATTRIBUTES ALIAS: 'GetDWBLWR' :: GetDWBLWR
  647. implicit none
  648. GetDWBLWR = data%EquipmentControl%DrillingConsole%DWBLWR
  649. end function
  650. integer function GetRTBLWR()
  651. !DEC$ ATTRIBUTES DLLEXPORT :: GetRTBLWR
  652. !DEC$ ATTRIBUTES ALIAS: 'GetRTBLWR' :: GetRTBLWR
  653. implicit none
  654. GetRTBLWR = data%EquipmentControl%DrillingConsole%RTBLWR
  655. end function
  656. integer function GetPWRLIM()
  657. !DEC$ ATTRIBUTES DLLEXPORT :: GetPWRLIM
  658. !DEC$ ATTRIBUTES ALIAS: 'GetPWRLIM' :: GetPWRLIM
  659. implicit none
  660. GetPWRLIM = data%EquipmentControl%DrillingConsole%PWRLIM
  661. end function
  662. real(8) function GetPWRLIMMTR()
  663. !DEC$ ATTRIBUTES DLLEXPORT :: GetPWRLIMMTR
  664. !DEC$ ATTRIBUTES ALIAS: 'GetPWRLIMMTR' :: GetPWRLIMMTR
  665. implicit none
  666. GetPWRLIMMTR = data%EquipmentControl%DrillingConsole%PWRLIMMTR
  667. end function
  668. real(8) function GetRTTorqueLimitGauge()
  669. !DEC$ ATTRIBUTES DLLEXPORT :: GetRTTorqueLimitGauge
  670. !DEC$ ATTRIBUTES ALIAS: 'GetRTTorqueLimitGauge' :: GetRTTorqueLimitGauge
  671. implicit none
  672. GetRTTorqueLimitGauge = data%EquipmentControl%DrillingConsole%RTTorqueLimitGauge
  673. end function
  674. integer function GetAutoDWLED()
  675. !DEC$ ATTRIBUTES DLLEXPORT :: GetAutoDWLED
  676. !DEC$ ATTRIBUTES ALIAS: 'GetAutoDWLED' :: GetAutoDWLED
  677. implicit none
  678. GetAutoDWLED = data%EquipmentControl%DrillingConsole%AutoDWLED
  679. end function
  680. integer function GetGEN1BTNLED()
  681. !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN1BTNLED
  682. !DEC$ ATTRIBUTES ALIAS: 'GetGEN1BTNLED' :: GetGEN1BTNLED
  683. implicit none
  684. GetGEN1BTNLED = data%EquipmentControl%DrillingConsole%GEN1BTNLED
  685. end function
  686. integer function GetGEN2BTNLED()
  687. !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN2BTNLED
  688. !DEC$ ATTRIBUTES ALIAS: 'GetGEN2BTNLED' :: GetGEN2BTNLED
  689. implicit none
  690. GetGEN2BTNLED = data%EquipmentControl%DrillingConsole%GEN2BTNLED
  691. end function
  692. integer function GetGEN3BTNLED()
  693. !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN3BTNLED
  694. !DEC$ ATTRIBUTES ALIAS: 'GetGEN3BTNLED' :: GetGEN3BTNLED
  695. implicit none
  696. GetGEN3BTNLED = data%EquipmentControl%DrillingConsole%GEN3BTNLED
  697. end function
  698. integer function GetGEN4BTNLED()
  699. !DEC$ ATTRIBUTES DLLEXPORT :: GetGEN4BTNLED
  700. !DEC$ ATTRIBUTES ALIAS: 'GetGEN4BTNLED' :: GetGEN4BTNLED
  701. implicit none
  702. GetGEN4BTNLED = data%EquipmentControl%DrillingConsole%GEN4BTNLED
  703. end function
  704. integer function GetOpenKellyCockLed()
  705. !DEC$ ATTRIBUTES DLLEXPORT :: GetOpenKellyCockLed
  706. !DEC$ ATTRIBUTES ALIAS: 'GetOpenKellyCockLed' :: GetOpenKellyCockLed
  707. implicit none
  708. GetOpenKellyCockLed = data%EquipmentControl%DrillingConsole%OpenKellyCockLed
  709. end function
  710. integer function GetCloseKellyCockLed()
  711. !DEC$ ATTRIBUTES DLLEXPORT :: GetCloseKellyCockLed
  712. !DEC$ ATTRIBUTES ALIAS: 'GetCloseKellyCockLed' :: GetCloseKellyCockLed
  713. implicit none
  714. GetCloseKellyCockLed = data%EquipmentControl%DrillingConsole%CloseKellyCockLed
  715. end function
  716. integer function GetOpenSafetyValveLed()
  717. !DEC$ ATTRIBUTES DLLEXPORT :: GetOpenSafetyValveLed
  718. !DEC$ ATTRIBUTES ALIAS: 'GetOpenSafetyValveLed' :: GetOpenSafetyValveLed
  719. implicit none
  720. GetOpenSafetyValveLed = data%EquipmentControl%DrillingConsole%OpenSafetyValveLed
  721. end function
  722. integer function GetCloseSafetyValveLed()
  723. !DEC$ ATTRIBUTES DLLEXPORT :: GetCloseSafetyValveLed
  724. !DEC$ ATTRIBUTES ALIAS: 'GetCloseSafetyValveLed' :: GetCloseSafetyValveLed
  725. implicit none
  726. GetCloseSafetyValveLed = data%EquipmentControl%DrillingConsole%CloseSafetyValveLed
  727. end function
  728. integer function GetIRSafetyValveLed()
  729. !DEC$ ATTRIBUTES DLLEXPORT :: GetIRSafetyValveLed
  730. !DEC$ ATTRIBUTES ALIAS: 'GetIRSafetyValveLed' :: GetIRSafetyValveLed
  731. implicit none
  732. GetIRSafetyValveLed = data%EquipmentControl%DrillingConsole%IRSafetyValveLed
  733. end function
  734. integer function GetIRIBopLed()
  735. !DEC$ ATTRIBUTES DLLEXPORT :: GetIRIBopLed
  736. !DEC$ ATTRIBUTES ALIAS: 'GetIRIBopLed' :: GetIRIBopLed
  737. implicit none
  738. GetIRIBopLed = data%EquipmentControl%DrillingConsole%IRIBopLed
  739. end function
  740. integer function GetLatchPipeLED()
  741. !DEC$ ATTRIBUTES DLLEXPORT :: GetLatchPipeLED
  742. !DEC$ ATTRIBUTES ALIAS: 'GetLatchPipeLED' :: GetLatchPipeLED
  743. implicit none
  744. GetLatchPipeLED = data%EquipmentControl%DrillingConsole%LatchPipeLED
  745. end function
  746. integer function GetUnlatchPipeLED()
  747. !DEC$ ATTRIBUTES DLLEXPORT :: GetUnlatchPipeLED
  748. !DEC$ ATTRIBUTES ALIAS: 'GetUnlatchPipeLED' :: GetUnlatchPipeLED
  749. implicit none
  750. GetUnlatchPipeLED = data%EquipmentControl%DrillingConsole%UnlatchPipeLED
  751. end function
  752. integer function GetSwingLed()
  753. !DEC$ ATTRIBUTES DLLEXPORT :: GetSwingLed
  754. !DEC$ ATTRIBUTES ALIAS: 'GetSwingLed' :: GetSwingLed
  755. implicit none
  756. GetSwingLed = data%EquipmentControl%DrillingConsole%SwingLed
  757. end function
  758. integer function GetFillMouseHoleLed()
  759. !DEC$ ATTRIBUTES DLLEXPORT :: GetFillMouseHoleLed
  760. !DEC$ ATTRIBUTES ALIAS: 'GetFillMouseHoleLed' :: GetFillMouseHoleLed
  761. implicit none
  762. GetFillMouseHoleLed = data%EquipmentControl%DrillingConsole%FillMouseHoleLed
  763. end function
  764. end module CDrillingConsole