module CTopDrivePanel use CTopDrivePanelVariables use CLog3 implicit none public contains ! Input routines subroutine SetTopDriveTdsPowerState(v) !DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveTdsPowerState !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTdsPowerState' :: SetTopDriveTdsPowerState implicit none integer, intent(in) :: v TopDrivePanel%TopDriveTdsPowerState = v #ifdef deb call Log_3( 'TopDriveTdsPowerState=', TopDrivePanel%TopDriveTdsPowerState) #endif end subroutine subroutine SetTopDriveTorqueWrench(v) !DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveTorqueWrench !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTorqueWrench' :: SetTopDriveTorqueWrench implicit none logical, intent(in) :: v TopDrivePanel%TopDriveTorqueWrench = v #ifdef deb call Log_3( 'TopDriveTorqueWrench=', TopDrivePanel%TopDriveTorqueWrench) #endif end subroutine subroutine SetTopDriveDrillTorqueState(v) !DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveDrillTorqueState !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveDrillTorqueState' :: SetTopDriveDrillTorqueState implicit none integer, intent(in) :: v TopDrivePanel%TopDriveDrillTorqueState = v #ifdef deb call Log_3( 'TopDriveDrillTorqueState=', TopDrivePanel%TopDriveDrillTorqueState) #endif end subroutine subroutine SetTopDriveLinkTiltState(v) !DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveLinkTiltState !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveLinkTiltState' :: SetTopDriveLinkTiltState implicit none integer, intent(in) :: v TopDrivePanel%TopDriveLinkTiltState = v #ifdef deb call Log_3( 'TopDriveLinkTiltState=', TopDrivePanel%TopDriveLinkTiltState) #endif end subroutine subroutine SetTopDriveIbop(v) !DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveIbop !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveIbop' :: SetTopDriveIbop implicit none logical, intent(in) :: v TopDrivePanel%TopDriveIbop = v #ifdef deb call Log_3( 'TopDriveIbop=', TopDrivePanel%TopDriveIbop) #endif end subroutine subroutine SetTopDriveTorqueLimitKnob(v) !DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveTorqueLimitKnob !DEC$ ATTRIBUTES ALIAS: 'SetTopDriveTorqueLimitKnob' :: SetTopDriveTorqueLimitKnob ! use CSimulationVariables, only: IsPortable use CDrillingConsoleVariables!, only: DrillingConsole%RTSwitch, DrillingConsole%RTTorqueLimitKnob use CWarningsVariables, only: Activate_TopdriveRotaryTableConfilict use CScaleRange implicit none real, intent(in) :: v if (IsPortable) then if(TopDrivePanel%TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() if(TopDrivePanel%TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch == 0) then DrillingConsole%RTTorqueLimitKnob = 0 TopDrivePanel%TopDriveTorqueLimitKnob = v #ifdef deb call Log_3( 'RTTorqueLimitKnob=', DrillingConsole%RTTorqueLimitKnob ) call Log_3( 'TopDriveTorqueLimitKnob=', TopDrivePanel%TopDriveTorqueLimitKnob ) #endif endif if(TopDrivePanel%TopDriveTdsPowerState == 0 .and. DrillingConsole%RTSwitch /= 0) then TopDrivePanel%TopDriveTorqueLimitKnob = 0 DrillingConsole%RTTorqueLimitKnob = real(ScaleRange(v, 0.0, 10.0, 0.0, 6000.0), 8) #ifdef deb call Log_3( 'RTTorqueLimitKnob=', DrillingConsole%RTTorqueLimitKnob ) call Log_3( 'TopDriveTorqueLimitKnob=', TopDrivePanel%TopDriveTorqueLimitKnob ) #endif endif else TopDrivePanel%TopDriveTorqueLimitKnob = v #ifdef deb call Log_3( 'TopDriveTorqueLimitKnob=', TopDrivePanel%TopDriveTorqueLimitKnob) #endif endif end subroutine subroutine SetRpmKnob(v) !DEC$ ATTRIBUTES DLLEXPORT :: SetRpmKnob !DEC$ ATTRIBUTES ALIAS: 'SetRpmKnob' :: SetRpmKnob ! use CSimulationVariables, only: IsPortable use CDrillingConsoleVariables!, only: DrillingConsole%RTSwitch, DrillingConsole%RTThrottle use CWarningsVariables, only: Activate_TopdriveRotaryTableConfilict use CScaleRange implicit none real, intent(in) :: v if (IsPortable) then if(TopDrivePanel%TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch /= 0) call Activate_TopdriveRotaryTableConfilict() if(TopDrivePanel%TopDriveTdsPowerState /= 0 .and. DrillingConsole%RTSwitch == 0) then DrillingConsole%RTThrottle = 0 TopDrivePanel%RpmKnob = v #ifdef deb call Log_3( 'RTThrottle=', DrillingConsole%RTThrottle ) call Log_3( 'RpmKnob=', TopDrivePanel%RpmKnob ) #endif endif if(TopDrivePanel%TopDriveTdsPowerState == 0 .and. DrillingConsole%RTSwitch /= 0) then TopDrivePanel%RpmKnob = 0 DrillingConsole%RTThrottle = real(ScaleRange(v, 0.0, 965.0, 0.0, 250.0), 8) #ifdef deb call Log_3( 'RpmKnob=', TopDrivePanel%RpmKnob ) call Log_3( 'RTThrottle=', DrillingConsole%RTThrottle ) #endif endif else TopDrivePanel%RpmKnob = v endif if (IsPortable) then ! else TopDrivePanel%RpmKnob = v #ifdef deb call Log_3( 'RpmKnob=', TopDrivePanel%RpmKnob ) #endif endif end subroutine ! Output routines integer function GetTopDriveOperationFaultLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveOperationFaultLed !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveOperationFaultLed' :: GetTopDriveOperationFaultLed implicit none GetTopDriveOperationFaultLed = TopDrivePanel%TopDriveOperationFaultLed !GetTopDriveOperationFaultLed = 1 end function integer function GetTopDriveTdsPowerLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTdsPowerLed !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTdsPowerLed' :: GetTopDriveTdsPowerLed implicit none GetTopDriveTdsPowerLed = TopDrivePanel%TopDriveTdsPowerLed !GetTopDriveTdsPowerLed = 1 end function integer function GetTopDriveTorqueWrenchLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueWrenchLed !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueWrenchLed' :: GetTopDriveTorqueWrenchLed implicit none GetTopDriveTorqueWrenchLed = TopDrivePanel%TopDriveTorqueWrenchLed !GetTopDriveTorqueWrenchLed = 1 end function integer function GetTopDriveLinkTiltLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveLinkTiltLed !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveLinkTiltLed' :: GetTopDriveLinkTiltLed implicit none GetTopDriveLinkTiltLed = TopDrivePanel%TopDriveLinkTiltLed !GetTopDriveLinkTiltLed = 1 end function integer function GetTopDriveIbopLed() !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveIbopLed !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveIbopLed' :: GetTopDriveIbopLed implicit none GetTopDriveIbopLed = TopDrivePanel%TopDriveIbopLed !GetTopDriveIbopLed = 1 end function real function GetTopDriveTorqueGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueGauge !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueGauge' :: GetTopDriveTorqueGauge implicit none GetTopDriveTorqueGauge = TopDrivePanel%TopDriveTorqueGauge !GetTopDriveTorqueGauge = 340 end function real function GetTopDriveTorqueLimitGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveTorqueLimitGauge !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveTorqueLimitGauge' :: GetTopDriveTorqueLimitGauge implicit none GetTopDriveTorqueLimitGauge = TopDrivePanel%TopDriveTorqueLimitGauge !GetTopDriveTorqueLimitGauge = 442 end function real function GetTopDriveRpmGauge() !DEC$ ATTRIBUTES DLLEXPORT :: GetTopDriveRpmGauge !DEC$ ATTRIBUTES ALIAS: 'GetTopDriveRpmGauge' :: GetTopDriveRpmGauge implicit none GetTopDriveRpmGauge = TopDrivePanel%TopDriveRpmGauge !GetTopDriveRpmGauge = 67 end function end module CTopDrivePanel