module CKellyConnectionEnum use COperationScenariosVariables use CLog4 implicit none contains subroutine Evaluate_KellyConnection() implicit none if (Hoisting%DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_KellyConnection=TopDrive' #endif endif if (Hoisting%DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_KellyConnection=Kelly' #endif !!OPERATION-CODE=4 !if (Get_OperationCondition() == OPERATION_DRILL .and.& ! Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& ! Get_Swing() == SWING_MOUSE_HOLE_END .and.& ! Get_TongNotification() .and.& ! Get_FillMouseHoleLed() == .false. .and.& ! Get_Tong() == TONG_BREAKOUT_END) then ! ! call Set_FillMouseHoleLed(.true.) ! return !end if !OPERATION-CODE=1 if (Get_OperationCondition() == OPERATION_DRILL .and.& !Get_JointConnectionPossible() .and.& Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& Get_Swing() == SWING_WELL_END .and.& !Get_TongNotification() .and.& Get_Tong() == TONG_MAKEUP_END) then !call Log_4('KELLY_CONNECTION_STRING') call Set_Tong(TONG_NEUTRAL) call Set_KellyConnection(KELLY_CONNECTION_STRING) return end if !OPERATION-CODE=2 if (Get_OperationCondition() == OPERATION_DRILL .and.& Get_StringPressure() == 0 .and.& Get_HookHeight() <= (OperationScenario%HKL + Get_NearFloorConnection()) .and.& Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& Get_Swing() == SWING_WELL_END .and.& !Get_TongNotification() .and.& Get_Tong() == TONG_BREAKOUT_END) then call Set_Tong(TONG_NEUTRAL) call Set_KellyConnection(KELLY_CONNECTION_NOTHING) call Set_SwingLed(.true.) return end if !OPERATION-CODE=3 if (Get_OperationCondition() == OPERATION_DRILL .and.& !Get_JointConnectionPossible() .and.& Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& Get_Swing() == SWING_MOUSE_HOLE_END .and.& !Get_TongNotification() .and.& Get_FillMouseHoleLed() .and.& Get_Tong() == TONG_MAKEUP_END) then call Set_Tong(TONG_NEUTRAL) call Set_KellyConnection(KELLY_CONNECTION_SINGLE) call Set_SwingLed(.false.) call Set_FillMouseHoleLed(.false.) call Set_MouseHole(MOUSE_HOLE_NEUTRAL) return end if !OPERATION-CODE=4 if (Get_OperationCondition() == OPERATION_DRILL .and.& Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& Get_Swing() == SWING_MOUSE_HOLE_END .and.& !Get_TongNotification() .and.& Get_FillMouseHoleLed() == .false. .and.& Get_Tong() == TONG_BREAKOUT_END) then call Set_Tong(TONG_NEUTRAL) call Set_KellyConnection(KELLY_CONNECTION_NOTHING) call Set_FillMouseHoleLed(.true.) call Set_MouseHole(MOUSE_HOLE_NEUTRAL) return end if !OPERATION-CODE=5 if (Get_OperationCondition() == OPERATION_DRILL .and.& !Get_JointConnectionPossible() .and.& Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& Get_Swing() == SWING_WELL_END .and.& !Get_TongNotification() .and.& Get_Tong() == TONG_MAKEUP_END) then call Set_Tong(TONG_NEUTRAL) call Set_KellyConnection(KELLY_CONNECTION_STRING) call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE) call Set_SwingLed(.false.) return end if !OPERATION-CODE=6 if (Get_OperationCondition() == OPERATION_DRILL .and.& Get_StringPressure() == 0 .and.& Get_HookHeight() > 70.0 .and.& Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& !Get_TongNotification() .and.& Get_Swing() == SWING_WELL_END .and.& Get_Tong() == TONG_BREAKOUT_END) then call Set_Tong(TONG_NEUTRAL) call Set_KellyConnection(KELLY_CONNECTION_SINGLE) call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE) return end if endif end subroutine ! subroutine Subscribe_KellyConnection() ! use CDrillingConsoleVariables ! implicit none ! call OnBreakoutLeverPress%Add(ButtonPress_Breakout) ! call OnMakeupLeverPress%Add(ButtonPress_Makeup) ! end subroutine subroutine ButtonPress_Breakout() implicit none #ifdef deb print*, 'ButtonPress_Breakout on ======> CKellyConnectionEnum' #endif end subroutine subroutine ButtonPress_Makeup() implicit none #ifdef deb print*, 'ButtonPress_Makeup on ======> CKellyConnectionEnum' #endif end subroutine end module CKellyConnectionEnum