module CChokeControlPanel
    use CChokeControlPanelVariables
    use SimulationVariables
    implicit none    
    public    
    contains    
    
    ! Input routines
    subroutine SetChokePanelPumpSelectorSwitch(v)
    !DEC$ ATTRIBUTES DLLEXPORT :: SetChokePanelPumpSelectorSwitch
    !DEC$ ATTRIBUTES ALIAS: 'SetChokePanelPumpSelectorSwitch' :: SetChokePanelPumpSelectorSwitch
	    implicit none
	    integer, intent(in) :: v
	    data%EquipmentControl%ChokeControlPanel%ChokePanelPumpSelectorSwitch = v
#ifdef deb
        print*, 'ChokePanelPumpSelectorSwitch=', data%EquipmentControl%ChokeControlPanel%ChokePanelPumpSelectorSwitch
#endif
    end subroutine

    subroutine SetChokePanelStrokeResetSwitch(v)
    !DEC$ ATTRIBUTES DLLEXPORT :: SetChokePanelStrokeResetSwitch
    !DEC$ ATTRIBUTES ALIAS: 'SetChokePanelStrokeResetSwitch' :: SetChokePanelStrokeResetSwitch
	    implicit none
	    logical, intent(in) :: v
	    data%EquipmentControl%ChokeControlPanel%ChokePanelStrokeResetSwitch = v
#ifdef deb
        print*, 'ChokePanelStrokeResetSwitch=', data%EquipmentControl%ChokeControlPanel%ChokePanelStrokeResetSwitch
#endif
    end subroutine

    subroutine SetChokeSelectorSwitch(v)
    !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeSelectorSwitch
    !DEC$ ATTRIBUTES ALIAS: 'SetChokeSelectorSwitch' :: SetChokeSelectorSwitch
	    implicit none
	    logical, intent(in) :: v
	    data%EquipmentControl%ChokeControlPanel%ChokeSelectorSwitch = v
#ifdef deb
        print*, 'ChokeSelectorSwitch=', data%EquipmentControl%ChokeControlPanel%ChokeSelectorSwitch
#endif
    end subroutine

    subroutine SetChokeRateControlKnob(v)
    !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeRateControlKnob
    !DEC$ ATTRIBUTES ALIAS: 'SetChokeRateControlKnob' :: SetChokeRateControlKnob
	    implicit none
	    real*8, intent(in) :: v
        
        !character(8)  :: date
        !character(10) :: time
        !character(5)  :: zone
        !integer,dimension(8) :: values
        
	    data%EquipmentControl%ChokeControlPanel%ChokeRateControlKnob = v
#ifdef deb
        !call date_and_time(date,time,zone,values)
        !!print '(a,2x,a,2x,a)', date, time, zone
        !print '(8i5)', values
        print*, 'ChokeRateControlKnob=', data%EquipmentControl%ChokeControlPanel%ChokeRateControlKnob
#endif
    end subroutine

    subroutine SetChokeControlLever(v)
    !DEC$ ATTRIBUTES DLLEXPORT :: SetChokeControlLever
    !DEC$ ATTRIBUTES ALIAS: 'SetChokeControlLever' :: SetChokeControlLever
	    implicit none
	    real*8, intent(in) :: v
	    data%EquipmentControl%ChokeControlPanel%ChokeControlLever = v
#ifdef deb
        print*, 'ChokeControlLever=', data%EquipmentControl%ChokeControlPanel%ChokeControlLever
#endif
    end subroutine

    subroutine SetChokePanelRigAirSwitch(v)
    !DEC$ ATTRIBUTES DLLEXPORT :: SetChokePanelRigAirSwitch
    !DEC$ ATTRIBUTES ALIAS: 'SetChokePanelRigAirSwitch' :: SetChokePanelRigAirSwitch
	    implicit none
	    logical, intent(in) :: v
	    data%EquipmentControl%ChokeControlPanel%ChokePanelRigAirSwitch = v
#ifdef deb
        print*, 'ChokePanelRigAirSwitch=', data%EquipmentControl%ChokeControlPanel%ChokePanelRigAirSwitch
#endif
    end subroutine


    subroutine SetEnableAutoChoke(v)
    !DEC$ ATTRIBUTES DLLEXPORT :: SetEnableAutoChoke
    !DEC$ ATTRIBUTES ALIAS: 'SetEnableAutoChoke' :: SetEnableAutoChoke
	    implicit none
	    logical, intent(in) :: v
	    data%EquipmentControl%ChokeControlPanel%EnableAutoChoke = v
#ifdef deb
    	print*, 'EnableAutoChoke=', data%EquipmentControl%ChokeControlPanel%EnableAutoChoke
#endif
    end subroutine
    
    
    
    
    
    
    
    
    
    
    
    
    ! Output routines
    real(8) function GetStandPipePressure()
    !DEC$ ATTRIBUTES DLLEXPORT :: GetStandPipePressure
    !DEC$ ATTRIBUTES ALIAS: 'GetStandPipePressure' :: GetStandPipePressure
	    implicit none
	    GetStandPipePressure = data%EquipmentControl%ChokeControlPanel%StandPipePressure
    end function

    real(8) function GetCasingPressure()
    !DEC$ ATTRIBUTES DLLEXPORT :: GetCasingPressure
    !DEC$ ATTRIBUTES ALIAS: 'GetCasingPressure' :: GetCasingPressure
	    implicit none
	    GetCasingPressure = data%EquipmentControl%ChokeControlPanel%CasingPressure
    end function

    real(8) function GetChokePosition()
    !DEC$ ATTRIBUTES DLLEXPORT :: GetChokePosition
    !DEC$ ATTRIBUTES ALIAS: 'GetChokePosition' :: GetChokePosition
	    implicit none
	    GetChokePosition = data%EquipmentControl%ChokeControlPanel%ChokePosition
    end function

    real(8) function GetChokePanelSPMCounter()
    !DEC$ ATTRIBUTES DLLEXPORT :: GetChokePanelSPMCounter
    !DEC$ ATTRIBUTES ALIAS: 'GetChokePanelSPMCounter' :: GetChokePanelSPMCounter
	    implicit none
	    !GetChokePanelSPMCounter = 0
	    GetChokePanelSPMCounter = data%EquipmentControl%ChokeControlPanel%ChokePanelSPMCounter
    end function

    real(8) function GetChokePanelTotalStrokeCounter()
    !DEC$ ATTRIBUTES DLLEXPORT :: GetChokePanelTotalStrokeCounter
    !DEC$ ATTRIBUTES ALIAS: 'GetChokePanelTotalStrokeCounter' :: GetChokePanelTotalStrokeCounter
	    implicit none
	    !GetChokePanelTotalStrokeCounter = 0
	    GetChokePanelTotalStrokeCounter = data%EquipmentControl%ChokeControlPanel%ChokePanelTotalStrokeCounter
    end function

    integer function GetChoke1LED()
    !DEC$ ATTRIBUTES DLLEXPORT :: GetChoke1LED
    !DEC$ ATTRIBUTES ALIAS: 'GetChoke1LED' :: GetChoke1LED
	    implicit none
	    GetChoke1LED = data%EquipmentControl%ChokeControlPanel%Choke1LED
    end function

    integer function GetChoke2LED()
    !DEC$ ATTRIBUTES DLLEXPORT :: GetChoke2LED
    !DEC$ ATTRIBUTES ALIAS: 'GetChoke2LED' :: GetChoke2LED
	    implicit none
	    GetChoke2LED = data%EquipmentControl%ChokeControlPanel%Choke2LED
    end function


    
    
end module CChokeControlPanel