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 27 KiB

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