module CSwingLedNotification use COperationScenariosVariables implicit none contains subroutine Evaluate_SwingLed() implicit none if (DriveType == TopDrive_DriveType) then #ifdef OST print*, 'Evaluate_SwingLed=TopDrive' #endif endif if (DriveType == Kelly_DriveType) then #ifdef OST print*, 'Evaluate_SwingLed=Kelly' #endif !OPERATION-CODE=22 if (Get_OperationCondition() == OPERATION_TRIP .and.& Get_HookHeight() >= (HL + Get_NearFloorConnection()) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + LG) .and.& Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& Get_JointConnectionPossible() == .false. .and.& (Get_Swing() /= SWING_WELL_BEGIN .and.& Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& Get_Slips() == SLIPS_SET_END) then call Set_SwingLed(.true.) return end if !OPERATION-CODE=23 if (Get_OperationCondition() == OPERATION_TRIP .and.& Get_HookHeight() >= (HL + Get_NearFloorConnection() + PL) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + LG + PL) .and.& Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.& Get_JointConnectionPossible() == .false. .and.& (Get_Swing() /= SWING_WELL_BEGIN .and.& Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& Get_Slips() == SLIPS_SET_END) then call Set_SwingLed(.true.) return end if !OPERATION-CODE=24 if (Get_OperationCondition() == OPERATION_DRILL .and.& Get_HookHeight() >= (HKL + Get_NearFloorConnection()) .and. Get_HookHeight() <= (HKL + Get_NearFloorConnection() + LG) .and.& Get_JointConnectionPossible() == .false. .and.& Get_KellyConnection() == KELLY_CONNECTION_NOTHING .and.& (Get_Swing() /= SWING_WELL_BEGIN .and.& Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& Get_Slips() == SLIPS_SET_END) then call Set_SwingLed(.true.) return end if !OPERATION-CODE=25 if (Get_OperationCondition() == OPERATION_DRILL .and.& Get_HookHeight() >= (HKL + Get_NearFloorConnection() + PL) .and. Get_HookHeight() <= (HKL + Get_NearFloorConnection() + LG + PL) .and.& Get_KellyConnection() == KELLY_CONNECTION_SINGLE .and.& Get_JointConnectionPossible() == .false. .and.& (Get_Swing() /= SWING_WELL_BEGIN .and.& Get_Swing() /= SWING_MOUSE_HOLE_BEGIN .and.& Get_Swing() /= SWING_RAT_HOLE_BEGIN) .and.& Get_Slips() == SLIPS_SET_END) then call Set_SwingLed(.true.) return end if call Set_SwingLed(.false.) endif end subroutine ! subroutine Subscribe_SwingLed() ! implicit none ! call OnOperationConditionChange%Add(Evaluate_SwingLed) ! call OnHookHeightChange%Add(Evaluate_SwingLed) ! call OnElevatorConnectionChange%Add(Evaluate_SwingLed) ! call OnKellyConnectionChange%Add(Evaluate_SwingLed) ! call OnSwingChange%Add(Evaluate_SwingLed) ! call OnSlipsChange%Add(Evaluate_SwingLed) ! call OnFillMouseHoleLedChange%Add(Evaluate_SwingLed) ! end subroutine end module CSwingLedNotification