|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- module CHoistingProblems
- use SimulationVariables
- implicit none
- public
- contains
- subroutine HoistingProblemsFromJson(parent)
- type(json_value),pointer :: parent
- type(json_core) :: json
- type(json_value),pointer :: p
-
- call json%get(parent,'HoistingProblems',p)
- call ProblemFromJson(p,"MotorFail",data%problems%HoistingProblems%MotorFail)
- call ProblemFromJson(p,"ClutchEngage",data%problems%HoistingProblems%ClutchEngage)
- call ProblemFromJson(p,"ClutchDisengage",data%problems%HoistingProblems%ClutchDisengage)
- end subroutine
-
- subroutine HoistingProblemsToJson(parent)
-
- type(json_value),pointer :: parent
- type(json_core) :: json
- type(json_value),pointer :: p
-
- ! 1. create new node
- call json%create_object(p,'HoistingProblems')
-
- ! 2. add member of data type to new node
- call ProblemToJson(p,"MotorFail",data%problems%HoistingProblems%MotorFail)
- call ProblemToJson(p,"ClutchEngage",data%problems%HoistingProblems%ClutchEngage)
- call ProblemToJson(p,"ClutchDisengage",data%problems%HoistingProblems%ClutchDisengage)
-
- ! 3. add new node to parent
- call json%add(parent,p)
- end subroutine
-
- subroutine ProcessHoistingProblemsDueTime(time)
- implicit none
- integer :: time
- if(data%problems%HoistingProblems%MotorFail%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%HoistingProblems%MotorFail, ChangeMotorFail, time)
- if(data%problems%HoistingProblems%ClutchEngage%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%HoistingProblems%ClutchEngage, ChangeClutchEngage, time)
- if(data%problems%HoistingProblems%ClutchDisengage%ProblemType == Time_ProblemType) call ProcessDueTime(data%problems%HoistingProblems%ClutchDisengage, ChangeClutchDisengage, time)
- end subroutine
-
- subroutine ProcessHoistingProblemsDuePumpStrokes(strokes)
- implicit none
- integer :: strokes
- if(data%problems%HoistingProblems%MotorFail%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%HoistingProblems%MotorFail, ChangeMotorFail, strokes)
- if(data%problems%HoistingProblems%ClutchEngage%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%HoistingProblems%ClutchEngage, ChangeClutchEngage, strokes)
- if(data%problems%HoistingProblems%ClutchDisengage%ProblemType == PumpStrokes_ProblemType) call ProcessDuePumpStrokes(data%problems%HoistingProblems%ClutchDisengage, ChangeClutchDisengage, strokes)
- end subroutine
-
- subroutine ProcessHoistingProblemsDueVolumePumped(volume)
- implicit none
- real(8) :: volume
- if(data%problems%HoistingProblems%MotorFail%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%HoistingProblems%MotorFail, ChangeMotorFail, volume)
- if(data%problems%HoistingProblems%ClutchEngage%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%HoistingProblems%ClutchEngage, ChangeClutchEngage, volume)
- if(data%problems%HoistingProblems%ClutchDisengage%ProblemType == VolumePumped_ProblemType) call ProcessDueVolumePumped(data%problems%HoistingProblems%ClutchDisengage, ChangeClutchDisengage, volume)
- end subroutine
-
- subroutine ProcessHoistingProblemsDueDistanceDrilled(distance)
- implicit none
- real(8) :: distance
- if(data%problems%HoistingProblems%MotorFail%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%HoistingProblems%MotorFail, ChangeMotorFail, distance)
- if(data%problems%HoistingProblems%ClutchEngage%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%HoistingProblems%ClutchEngage, ChangeClutchEngage, distance)
- if(data%problems%HoistingProblems%ClutchDisengage%ProblemType == DistanceDrilled_ProblemType) call ProcessDueDistanceDrilled(data%problems%HoistingProblems%ClutchDisengage, ChangeClutchDisengage, distance)
- end subroutine
-
-
-
-
-
-
- subroutine ChangeMotorFail(status)
- use SimulationVariables !@
- implicit none
- integer, intent (in) :: status
- ! if(associated(MotorFailPtr)) call MotorFailPtr(status)
- if(status == Clear_StatusType) data%State%Drawworks%MotorFaileMalf=0
- if(status == Executed_StatusType) data%State%Drawworks%MotorFaileMalf=1
- endsubroutine
-
- subroutine ChangeClutchEngage(status)
- use SimulationVariables !@
- implicit none
- integer, intent (in) :: status
- ! if(associated(ClutchEngagePtr)) call ClutchEngagePtr(status)
- if(status == Clear_StatusType) data%State%Drawworks%ClutchEngageMalf=0
- if(status == Executed_StatusType) data%State%Drawworks%ClutchEngageMalf=1
- endsubroutine
-
- subroutine ChangeClutchDisengage(status)
- use SimulationVariables !@
- implicit none
- integer, intent (in) :: status
- ! if(associated(ClutchDisengagePtr)) call ClutchDisengagePtr(status)
- if(status == Clear_StatusType) data%State%Drawworks%ClutchDisengageMalf=0
- if(status == Executed_StatusType) data%State%Drawworks%ClutchDisengageMalf=1
- endsubroutine
-
- end module CHoistingProblems
|