@@ -57,26 +57,26 @@ | |||
"name": "stdout", | |||
"output_type": "stream", | |||
"text": [ | |||
"call json%add(p,\"TopDriveTdsPowerState\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveTdsPowerState)\n", | |||
"call json%add(p,\"TopDriveTorqueWrench\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveTorqueWrench)\n", | |||
"call json%add(p,\"TopDriveDrillTorqueState\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveDrillTorqueState)\n", | |||
"call json%add(p,\"TopDriveLinkTiltState\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveLinkTiltState)\n", | |||
"call json%add(p,\"TopDriveIbop\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveIbop)\n", | |||
"call json%add(p,\"TopDriveTorqueLimitKnob\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveTorqueLimitKnob)\n", | |||
"call json%add(p,\"RpmKnob\",data%EquipmentControl%ControlPanel%CTopDrive%RpmKnob)\n", | |||
"call json%add(p,\"TopDriveOperationFaultLed\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveOperationFaultLed)\n", | |||
"call json%add(p,\"TopDriveTdsPowerLed\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveTdsPowerLed)\n", | |||
"call json%add(p,\"TopDriveTorqueWrenchLed\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveTorqueWrenchLed)\n", | |||
"call json%add(p,\"TopDriveLinkTiltLed\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveLinkTiltLed)\n", | |||
"call json%add(p,\"TopDriveIbopLed\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveIbopLed)\n", | |||
"call json%add(p,\"TopDriveTorqueLimitGauge\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveTorqueLimitGauge)\n", | |||
"call json%add(p,\"TopDriveTorqueGauge\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveTorqueGauge)\n", | |||
"call json%add(p,\"TopDriveRpmGauge\",data%EquipmentControl%ControlPanel%CTopDrive%TopDriveRpmGauge)\n" | |||
"call json%add(p,\"TopDriveTdsPowerState\",data%Equipments%ControlPanel%CTopDrive%TopDriveTdsPowerState)\n", | |||
"call json%add(p,\"TopDriveTorqueWrench\",data%Equipments%ControlPanel%CTopDrive%TopDriveTorqueWrench)\n", | |||
"call json%add(p,\"TopDriveDrillTorqueState\",data%Equipments%ControlPanel%CTopDrive%TopDriveDrillTorqueState)\n", | |||
"call json%add(p,\"TopDriveLinkTiltState\",data%Equipments%ControlPanel%CTopDrive%TopDriveLinkTiltState)\n", | |||
"call json%add(p,\"TopDriveIbop\",data%Equipments%ControlPanel%CTopDrive%TopDriveIbop)\n", | |||
"call json%add(p,\"TopDriveTorqueLimitKnob\",data%Equipments%ControlPanel%CTopDrive%TopDriveTorqueLimitKnob)\n", | |||
"call json%add(p,\"RpmKnob\",data%Equipments%ControlPanel%CTopDrive%RpmKnob)\n", | |||
"call json%add(p,\"TopDriveOperationFaultLed\",data%Equipments%ControlPanel%CTopDrive%TopDriveOperationFaultLed)\n", | |||
"call json%add(p,\"TopDriveTdsPowerLed\",data%Equipments%ControlPanel%CTopDrive%TopDriveTdsPowerLed)\n", | |||
"call json%add(p,\"TopDriveTorqueWrenchLed\",data%Equipments%ControlPanel%CTopDrive%TopDriveTorqueWrenchLed)\n", | |||
"call json%add(p,\"TopDriveLinkTiltLed\",data%Equipments%ControlPanel%CTopDrive%TopDriveLinkTiltLed)\n", | |||
"call json%add(p,\"TopDriveIbopLed\",data%Equipments%ControlPanel%CTopDrive%TopDriveIbopLed)\n", | |||
"call json%add(p,\"TopDriveTorqueLimitGauge\",data%Equipments%ControlPanel%CTopDrive%TopDriveTorqueLimitGauge)\n", | |||
"call json%add(p,\"TopDriveTorqueGauge\",data%Equipments%ControlPanel%CTopDrive%TopDriveTorqueGauge)\n", | |||
"call json%add(p,\"TopDriveRpmGauge\",data%Equipments%ControlPanel%CTopDrive%TopDriveRpmGauge)\n" | |||
] | |||
} | |||
], | |||
"source": [ | |||
"precode = \"\"\"call json%add(pform,\"\",data%EquipmentControl%ControlPanel%CTopDrive%\"\"\"\n", | |||
"precode = \"\"\"call json%add(pform,\"\",data%Equipments%ControlPanel%CTopDrive%\"\"\"\n", | |||
"input = open(\"Text1.txt\")\n", | |||
"lines = input.readlines()\n", | |||
"for line in lines:\n", | |||
@@ -0,0 +1,30 @@ | |||
{ | |||
"version": "0.2.0", | |||
"configurations": [ | |||
{ | |||
"name": "Debug SimulationCore2", | |||
"type": "cppdbg", | |||
"request": "launch", | |||
"program": "${workspaceRoot}/SimulationCore2_DEBUG", | |||
"args": ["Config-debug.json"], | |||
"stopAtEntry": false, | |||
"cwd": "${workspaceRoot}", | |||
"externalConsole": false, | |||
"MIMode": "gdb", | |||
// "preLaunchTask": "make debug", | |||
}, | |||
{ | |||
"name": "Debug write_vars", | |||
"type": "cppdbg", | |||
"request": "launch", | |||
"program": "${workspaceRoot}/write_vars", | |||
"args": ["Config-debug.json"], | |||
"stopAtEntry": false, | |||
"cwd": "${workspaceRoot}", | |||
"externalConsole": false, | |||
"MIMode": "gdb", | |||
// "preLaunchTask": "make debug", | |||
} | |||
] | |||
} |
@@ -0,0 +1,25 @@ | |||
{ | |||
"version": "2.0.0", | |||
"tasks": [ | |||
{ | |||
"label": "make", | |||
"type": "shell", | |||
"command": "make", | |||
"options": { | |||
"cwd": "${workspaceRoot}" | |||
} | |||
}, | |||
{ | |||
"label": "make debug", | |||
"type": "shell", | |||
"command": "make", | |||
"args": [ | |||
"debug" | |||
], | |||
"options": { | |||
"cwd": "${workspaceRoot}" | |||
} | |||
}, | |||
] | |||
} |
@@ -76,14 +76,15 @@ module CStringConfiguration | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: pitems,pitem,pbit,p | |||
integer:: i | |||
integer:: i,n | |||
! 1. create new node | |||
call json%create_object(p,'StringConfiguration') | |||
call json%create_array(pitems,'StringConfigurationItems') | |||
! 2. add member of data type to new node | |||
do i=1,data%Configuration%StringConfiguration%StringConfigurationCount | |||
call json%create_object(pitem,'StringConfigurationItem') | |||
n = data%Configuration%StringConfiguration%StringConfigurationCount | |||
do i=1,n | |||
call json%create_object(pitem,'') | |||
call json%add(pitem,"ComponentLength",data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentLength) | |||
call json%add(pitem,"ComponentType",data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentType) | |||
call json%add(pitem,"Grade",data%Configuration%StringConfiguration%StringConfigurations(i)%Grade) | |||
@@ -95,6 +96,7 @@ module CStringConfiguration | |||
call json%add(pitem,"WeightPerLength",data%Configuration%StringConfiguration%StringConfigurations(i)%WeightPerLength) | |||
call json%add(pitems,pitem) | |||
end do | |||
call json%create_object(pbit,"BitDefenition") | |||
call json%add(pbit,"BitCodeHundreds",data%Configuration%StringConfiguration%BitDefinition%BitCodeHundreds) | |||
call json%add(pbit,"BitCodeOnes",data%Configuration%StringConfiguration%BitDefinition%BitCodeOnes) | |||
@@ -113,5 +115,4 @@ module CStringConfiguration | |||
call json%add(p,pbit) | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CStringConfiguration |
@@ -0,0 +1,119 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/Bha/CStringConfiguration.f90" | |||
module CStringConfiguration | |||
use CStringConfigurationVariables | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine StringConfigurationFromJson(parent) | |||
use json_module,IK =>json_ik | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pitems,pitem,pval,pbit | |||
logical::is_found | |||
type(CStringItem) :: item | |||
integer::i,n_children | |||
CHARACTER(KIND=JSON_CK, LEN=:), ALLOCATABLE :: val | |||
call json%get(parent,'StringConfiguration',p) | |||
call json%get(p,'StringConfigurationItems',pitems) | |||
call json%info(pitems, n_children=n_children) | |||
if (.not. allocated(data%Configuration%StringConfiguration%StringConfigurations) .or. size(data%Configuration%StringConfiguration%StringConfigurations)/=n_children) then | |||
ALLOCATE(data%Configuration%StringConfiguration%StringConfigurations(n_children)) | |||
endif | |||
do i=1,n_children | |||
call json%get_child(pitems, i, pitem, found=is_found) | |||
call json%get(pitem,"ComponentType",pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentType) | |||
call json%get(pitem,"NumberOfJoint",pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%NumberOfJoint) | |||
call json%get(pitem,"LengthPerJoint",pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%LengthPerJoint) | |||
call json%get(pitem,"NominalOd",pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%NominalOd) | |||
call json%get(pitem,"NominalId",pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%NominalId) | |||
call json%get(pitem,"WeightPerLength",pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%WeightPerLength) | |||
call json%get(pitem,"ComponentLength",pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentLength) | |||
call json%get(pitem,"NominalToolJointOd",pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%NominalToolJointOd) | |||
call json%get(pitem,"Grade",pval) | |||
call json%get(pval,val) | |||
data%Configuration%StringConfiguration%StringConfigurations(i)%Grade = val | |||
end do | |||
call json%get(p,'BitDefenition',pbit) | |||
call json%get(pbit,'BitType',pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%BitDefinition%BitType) | |||
call json%get(pbit,'BitSize',pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%BitDefinition%BitSize) | |||
call json%get(pbit,'BitCodeHundreds',pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%BitDefinition%BitCodeHundreds) | |||
call json%get(pbit,'BitCodeTens',pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%BitDefinition%BitCodeTens) | |||
call json%get(pbit,'BitCodeOnes',pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%BitDefinition%BitCodeOnes) | |||
call json%get(pbit,'BitNozzleSize',pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%BitDefinition%BitNozzleSize) | |||
call json%get(pbit,'BitLength',pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%BitDefinition%BitLength) | |||
call json%get(pbit,'BitWeightPerLength',pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%BitDefinition%BitWeightPerLength) | |||
call json%get(pbit,'BitNozzleNo',pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%BitDefinition%BitNozzleNo) | |||
call json%get(pbit,'FloatValve',pval) | |||
call json%get(pval,data%Configuration%StringConfiguration%BitDefinition%FloatValve) | |||
end subroutine | |||
subroutine StringConfigurationToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: pitems,pitem,pbit,p | |||
integer:: i,n | |||
! 1. create new node | |||
call json%create_object(p,'StringConfiguration') | |||
call json%create_array(pitems,'StringConfigurationItems') | |||
! 2. add member of data type to new node | |||
n = data%Configuration%StringConfiguration%StringConfigurationCount | |||
do i=1,n | |||
call json%create_object(pitem,'') | |||
call json%add(pitem,"ComponentLength",data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentLength) | |||
call json%add(pitem,"ComponentType",data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentType) | |||
call json%add(pitem,"Grade",data%Configuration%StringConfiguration%StringConfigurations(i)%Grade) | |||
call json%add(pitem,"LengthPerJoint",data%Configuration%StringConfiguration%StringConfigurations(i)%LengthPerJoint) | |||
call json%add(pitem,"NominalId",data%Configuration%StringConfiguration%StringConfigurations(i)%NominalId) | |||
call json%add(pitem,"NominalOd",data%Configuration%StringConfiguration%StringConfigurations(i)%NominalOd) | |||
call json%add(pitem,"NominalToolJointOd",data%Configuration%StringConfiguration%StringConfigurations(i)%NominalToolJointOd) | |||
call json%add(pitem,"NumberOfJoint",data%Configuration%StringConfiguration%StringConfigurations(i)%NumberOfJoint) | |||
call json%add(pitem,"WeightPerLength",data%Configuration%StringConfiguration%StringConfigurations(i)%WeightPerLength) | |||
call json%add(pitems,pitem) | |||
end do | |||
call json%create_object(pbit,"BitDefenition") | |||
call json%add(pbit,"BitCodeHundreds",data%Configuration%StringConfiguration%BitDefinition%BitCodeHundreds) | |||
call json%add(pbit,"BitCodeOnes",data%Configuration%StringConfiguration%BitDefinition%BitCodeOnes) | |||
call json%add(pbit,"BitCodeTens",data%Configuration%StringConfiguration%BitDefinition%BitCodeTens) | |||
call json%add(pbit,"BitLength",data%Configuration%StringConfiguration%BitDefinition%BitLength) | |||
call json%add(pbit,"BitNozzleNo",data%Configuration%StringConfiguration%BitDefinition%BitNozzleNo) | |||
call json%add(pbit,"BitNozzleSize",data%Configuration%StringConfiguration%BitDefinition%BitNozzleSize) | |||
call json%add(pbit,"BitSize",data%Configuration%StringConfiguration%BitDefinition%BitSize) | |||
call json%add(pbit,"BitType",data%Configuration%StringConfiguration%BitDefinition%BitType) | |||
call json%add(pbit,"BitWeightPerLength",data%Configuration%StringConfiguration%BitDefinition%BitWeightPerLength) | |||
call json%add(pbit,"FloatValve",data%Configuration%StringConfiguration%BitDefinition%FloatValve) | |||
! call json%add(p,"StringConfigurationCount",dat%Configuration%StringConfiguration%StringConfigurationCount) | |||
! 3. add new node to parent | |||
call json%add(p,pitems) | |||
call json%add(p,pbit) | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CStringConfiguration |
@@ -38,7 +38,7 @@ module CStringConfigurationVariables | |||
end type CBitInfo | |||
Type :: StringConfigurationType | |||
integer :: StringConfigurationCount = 0 | |||
integer :: StringConfigurationCount | |||
type(CStringItem), allocatable :: StringConfigurations(:) | |||
type(CBitInfo) :: BitDefinition | |||
End type StringConfigurationType | |||
@@ -0,0 +1,47 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/Bha/CStringConfigurationVariables.f90" | |||
module CStringConfigurationVariables | |||
implicit none | |||
public | |||
!constants | |||
integer :: Bit_ComponentType = 0 | |||
integer :: Stabilizer_ComponentType = 1 | |||
integer :: Collar_ComponentType = 2 | |||
integer :: DrillPipe_ComponentType = 3 | |||
integer :: Heavyweight_ComponentType = 4 | |||
integer :: Cone_BitType = 0 | |||
integer :: PDC_BitType = 1 | |||
integer :: Rock_BitType = 2 | |||
type, bind(c), public :: CStringItem | |||
integer :: ComponentType | |||
real(8) :: NumberOfJoint | |||
real(8) :: LengthPerJoint | |||
real(8) :: NominalOd | |||
real(8) :: NominalId | |||
real(8) :: WeightPerLength | |||
real(8) :: ComponentLength | |||
real(8) :: NominalToolJointOd | |||
character(1) :: Grade | |||
end type CStringItem | |||
type, bind(c), public :: CBitInfo | |||
integer :: BitType | |||
real(8) :: BitSize | |||
integer :: BitCodeHundreds | |||
integer :: BitCodeTens | |||
integer :: BitCodeOnes | |||
real(8) :: BitNozzleSize | |||
real(8) :: BitLength | |||
real(8) :: BitWeightPerLength | |||
integer :: BitNozzleNo | |||
logical :: FloatValve | |||
end type CBitInfo | |||
Type :: StringConfigurationType | |||
integer :: StringConfigurationCount | |||
type(CStringItem), allocatable :: StringConfigurations(:) | |||
type(CBitInfo) :: BitDefinition | |||
End type StringConfigurationType | |||
contains | |||
end module CStringConfigurationVariables |
@@ -0,0 +1,83 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/CMudPropertiesVariables.f90" | |||
module CMudPropertiesVariables | |||
use CIActionReference | |||
!**use CDoubleEventHandlerCollection | |||
implicit none | |||
public | |||
!constants | |||
integer, parameter :: WaterBase_MudType = 0 | |||
integer, parameter :: OilBase_MudType = 1 | |||
integer, parameter :: PowerLaw_RheologyModel = 0 | |||
integer, parameter :: Bingham_RheologyModel = 1 | |||
integer, parameter :: Newtonian_RheologyModel = 2 | |||
INTEGER, PARAMETER :: Herschel_Bulkley_RheologyModel = 3 | |||
! variables | |||
Type::MudPropertiesType | |||
integer :: ActiveMudType | |||
integer :: ActiveRheologyModel | |||
real(8) :: ActiveMudVolume | |||
real(8) :: ActiveMudVolumeGal | |||
real(8) :: ActiveDensity | |||
real(8) :: ActivePlasticViscosity | |||
real(8) :: ActiveYieldPoint | |||
real(8) :: ActiveThetaThreeHundred | |||
real(8) :: ActiveThetaSixHundred | |||
integer :: ReserveMudType | |||
real(8) :: ReserveMudVolume | |||
real(8) :: ReserveMudVolumeGal | |||
real(8) :: ReserveDensity | |||
real(8) :: ReservePlasticViscosity | |||
real(8) :: ReserveYieldPoint | |||
real(8) :: ReserveThetaThreeHundred | |||
real(8) :: ReserveThetaSixHundred | |||
real(8) :: ActiveTotalTankCapacity | |||
real(8) :: ActiveTotalTankCapacityGal | |||
real(8) :: ActiveSettledContents | |||
real(8) :: ActiveSettledContentsGal | |||
real(8) :: ActiveTotalContents | |||
real(8) :: ActiveTotalContentsGal | |||
logical :: ActiveAutoDensity | |||
real(8) :: InitialTripTankMudVolume | |||
real(8) :: InitialTripTankMudVolumeGal | |||
real(8) :: PedalFlowMeter | |||
End type MudPropertiesType | |||
! Type(MudPropertiesType)::MudProperties | |||
! subroutine SubscribeActiveMudVolume(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeActiveMudVolume | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeActiveMudVolume' :: SubscribeActiveMudVolume | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ActiveMudVolumePtr => a | |||
! end subroutine | |||
! subroutine SubscribeActiveDensity(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeActiveDensity | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeActiveDensity' :: SubscribeActiveDensity | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ActiveDensityPtr => a | |||
! end subroutine | |||
! subroutine SubscribeReserveMudVolume(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeReserveMudVolume | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeReserveMudVolume' :: SubscribeReserveMudVolume | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ReserveMudVolumePtr => a | |||
! end subroutine | |||
! subroutine SubscribeReserveDensity(a) | |||
! !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeReserveDensity | |||
! !DEC$ ATTRIBUTES ALIAS: 'SubscribeReserveDensity' :: SubscribeReserveDensity | |||
! implicit none | |||
! procedure (ActionDouble) :: a | |||
! ReserveDensityPtr => a | |||
! end subroutine | |||
end module CMudPropertiesVariables |
@@ -46,12 +46,12 @@ module CFormation | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pform | |||
integer :: i | |||
integer :: i,n | |||
! 1. create new node | |||
call json%create_array(p,'Formations') | |||
do i=1,data%Configuration%Formation%Count | |||
n= data%Configuration%Formation%Count | |||
do i=1,n | |||
call json%create_object(pform,'') | |||
call json%add(pform,"Abrasiveness",data%Configuration%Formation%Formations(i)%Abrasiveness) | |||
call json%add(pform,"Drillablity",data%Configuration%Formation%Formations(i)%Drillablity) | |||
@@ -0,0 +1,69 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/Geology/CFormation.f90" | |||
module CFormation | |||
use CFormationVariables | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
contains | |||
subroutine FormationFromJson(parent) | |||
use json_module,IK =>json_ik | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pitem,pval | |||
logical::is_found | |||
integer::i,n_children | |||
CHARACTER(KIND=JSON_CK, LEN=:), ALLOCATABLE :: val | |||
call json%get(parent,'Formation',p) | |||
call json%info(p, n_children=n_children) | |||
data%Configuration%Formation%Count = n_children | |||
if (.not. allocated(data%Configuration%Formation%Formations) .or. size(data%Configuration%Formation%Formations)/=n_children) then | |||
ALLOCATE(data%Configuration%Formation%Formations(n_children)) | |||
endif | |||
do i=1,n_children | |||
call json%get_child(p, i, pitem, found=is_found) | |||
call json%get(pitem,'Top',pval) | |||
call json%get(pval,data%Configuration%Formation%Formations(i)%Top) | |||
call json%get(pitem,'Thickness',pval) | |||
call json%get(pval,data%Configuration%Formation%Formations(i)%Thickness) | |||
call json%get(pitem,'Drillablity',pval) | |||
call json%get(pval,data%Configuration%Formation%Formations(i)%Drillablity) | |||
call json%get(pitem,'Abrasiveness',pval) | |||
call json%get(pval,data%Configuration%Formation%Formations(i)%Abrasiveness) | |||
call json%get(pitem,'ThresholdWeight',pval) | |||
call json%get(pval,data%Configuration%Formation%Formations(i)%ThresholdWeight) | |||
call json%get(pitem,'PorePressureGradient',pval) | |||
call json%get(pval,data%Configuration%Formation%Formations(i)%PorePressureGradient) | |||
end do | |||
end subroutine | |||
subroutine FormationToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pform | |||
integer :: i,n | |||
! 1. create new node | |||
call json%create_array(p,'Formations') | |||
n= data%Configuration%Formation%Count | |||
do i=1,n | |||
call json%create_object(pform,'') | |||
call json%add(pform,"Abrasiveness",data%Configuration%Formation%Formations(i)%Abrasiveness) | |||
call json%add(pform,"Drillablity",data%Configuration%Formation%Formations(i)%Drillablity) | |||
call json%add(pform,"PorePressureGradient",data%Configuration%Formation%Formations(i)%PorePressureGradient) | |||
call json%add(pform,"Thickness",data%Configuration%Formation%Formations(i)%Thickness) | |||
call json%add(pform,"ThresholdWeight",data%Configuration%Formation%Formations(i)%ThresholdWeight) | |||
call json%add(pform,"Top",data%Configuration%Formation%Formations(i)%Top) | |||
call json%add(p,pform) | |||
end do | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CFormation |
@@ -0,0 +1,22 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/Geology/CFormationVariables.f90" | |||
module CFormationVariables | |||
! !@use ConfigurationVariables, only: Configuration | |||
implicit none | |||
public | |||
! types | |||
! Pipe Items in String Array | |||
type, bind(c), public :: CFormationItem | |||
real(8) :: Top | |||
real(8) :: Thickness | |||
real(8) :: Drillablity | |||
real(8) :: Abrasiveness | |||
real(8) :: ThresholdWeight | |||
real(8) :: PorePressureGradient | |||
end type CFormationItem | |||
Type::FormationType | |||
integer :: Count = 0 | |||
type(CFormationItem), allocatable :: Formations(:) | |||
End type FormationType | |||
end module CFormationVariables |
@@ -6,13 +6,9 @@ module CReservoir | |||
contains | |||
subroutine ReservoirFromJson(parent) | |||
use json_module,IK =>json_ik | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pitem,pval | |||
logical::is_found | |||
integer::i,n_children | |||
CHARACTER(KIND=JSON_CK, LEN=:), ALLOCATABLE :: val | |||
type(json_value),pointer :: p,pval | |||
call json%get(parent,'Reservoir',p) | |||
@@ -0,0 +1,71 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/Geology/CReservoir.f90" | |||
module CReservoir | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
contains | |||
subroutine ReservoirFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
call json%get(parent,'Reservoir',p) | |||
call json%get(p,'FormationNo',pval) | |||
call json%get(pval,data%Configuration%Reservoir%FormationNo) | |||
call json%get(p,'FormationTop',pval) | |||
call json%get(pval,data%Configuration%Reservoir%FormationTop) | |||
call json%get(p,'PressureGradient',pval) | |||
call json%get(pval,data%Configuration%Reservoir%PressureGradient) | |||
call json%get(p,'FormationPermeability',pval) | |||
call json%get(pval,data%Configuration%Reservoir%FormationPermeability) | |||
call json%get(p,'GeothermalGradient',pval) | |||
call json%get(pval,data%Configuration%Reservoir%GeothermalGradient) | |||
call json%get(p,'FluidType',pval) | |||
call json%get(pval,data%Configuration%Reservoir%FluidType) | |||
call json%get(p,'FluidGradient',pval) | |||
call json%get(pval,data%Configuration%Reservoir%FluidGradient) | |||
call json%get(p,'FluidViscosity',pval) | |||
call json%get(pval,data%Configuration%Reservoir%FluidViscosity) | |||
call json%get(p,'InactiveInflux',pval) | |||
call json%get(pval,data%Configuration%Reservoir%InactiveInflux) | |||
call json%get(p,'IsAutoMigrationRateSelected',pval) | |||
call json%get(pval,data%Configuration%Reservoir%IsAutoMigrationRateSelected) | |||
call json%get(p,'AutoMigrationRate',pval) | |||
call json%get(pval,data%Configuration%Reservoir%AutoMigrationRate) | |||
call json%get(p,'MakeKickSinglePacket',pval) | |||
call json%get(pval,data%Configuration%Reservoir%MakeKickSinglePacket) | |||
end subroutine | |||
subroutine ReservoirToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Reservoir') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"AutoMigrationRate",data%Configuration%Reservoir%AutoMigrationRate) | |||
call json%add(p,"FluidGradient",data%Configuration%Reservoir%FluidGradient) | |||
call json%add(p,"FluidType",data%Configuration%Reservoir%FluidType) | |||
call json%add(p,"FluidViscosity",data%Configuration%Reservoir%FluidViscosity) | |||
call json%add(p,"FormationNo",data%Configuration%Reservoir%FormationNo) | |||
call json%add(p,"FormationPermeability",data%Configuration%Reservoir%FormationPermeability) | |||
call json%add(p,"FormationTop",data%Configuration%Reservoir%FormationTop) | |||
call json%add(p,"GeothermalGradient",data%Configuration%Reservoir%GeothermalGradient) | |||
call json%add(p,"InactiveInflux",data%Configuration%Reservoir%InactiveInflux) | |||
call json%add(p,"IsAutoMigrationRateSelected",data%Configuration%Reservoir%IsAutoMigrationRateSelected) | |||
call json%add(p,"MakeKickSinglePacket",data%Configuration%Reservoir%MakeKickSinglePacket) | |||
call json%add(p,"PressureGradient",data%Configuration%Reservoir%PressureGradient) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CReservoir |
@@ -0,0 +1,57 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/Geology/CShoe.f90" | |||
module CShoe | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine ShoeFromJson(parent) | |||
use json_module,IK =>json_ik | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pitem,pval | |||
logical::is_found | |||
integer::i,n_children | |||
CHARACTER(KIND=JSON_CK, LEN=:), ALLOCATABLE :: val | |||
call json%get(parent,'Shoe',p) | |||
call json%get(p,'FormationNo',pval) | |||
call json%get(pval,data%Configuration%Shoe%FormationNo) | |||
call json%get(p,'ShoeDepth',pval) | |||
call json%get(pval,data%Configuration%Shoe%ShoeDepth) | |||
call json%get(p,'LeakOff',pval) | |||
call json%get(pval,data%Configuration%Shoe%LeakOff) | |||
call json%get(p,'Breakdown',pval) | |||
call json%get(pval,data%Configuration%Shoe%Breakdown) | |||
call json%get(p,'FracturePropagation',pval) | |||
call json%get(pval,data%Configuration%Shoe%FracturePropagation) | |||
call json%get(p,'InactiveFracture',pval) | |||
call json%get(pval,data%Configuration%Shoe%InactiveFracture) | |||
end subroutine | |||
subroutine ShoeToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Shoe') | |||
! 2. add member of data type to new node | |||
call json%add(p,"Breakdown",data%Configuration%Shoe%Breakdown) | |||
call json%add(p,"FormationNo",data%Configuration%Shoe%FormationNo) | |||
call json%add(p,"FracturePropagation",data%Configuration%Shoe%FracturePropagation) | |||
call json%add(p,"InactiveFracture",data%Configuration%Shoe%InactiveFracture) | |||
call json%add(p,"LeakOff",data%Configuration%Shoe%LeakOff) | |||
call json%add(p,"ShoeDepth",data%Configuration%Shoe%ShoeDepth) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CShoe |
@@ -10,5 +10,5 @@ module CShoeVariables | |||
real(8) :: FracturePropagation | |||
logical :: InactiveFracture | |||
End type ShoeType | |||
Type(ShoeType)::Shoe | |||
! Type(ShoeType)::Shoe | |||
end module CShoeVariables |
@@ -0,0 +1,15 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/Geology/CShoeVariables.f90" | |||
module CShoeVariables | |||
implicit none | |||
public | |||
! variables | |||
Type::ShoeType | |||
integer :: FormationNo | |||
real(8) :: ShoeDepth | |||
real(8) :: LeakOff | |||
real(8) :: Breakdown | |||
real(8) :: FracturePropagation | |||
logical :: InactiveFracture | |||
End type ShoeType | |||
! Type(ShoeType)::Shoe | |||
end module CShoeVariables |
@@ -0,0 +1,156 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/MudProperties.f90" | |||
module MudPropertiesModule | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
contains | |||
subroutine MudPropertiesToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Mud') | |||
! 2. add member of data type to new node | |||
call json%add(p,"ActiveMudType",data%Configuration%Mud%ActiveMudType) | |||
call json%add(p,"ActiveRheologyModel",data%Configuration%Mud%ActiveRheologyModel) | |||
call json%add(p,"ActiveMudVolume",data%Configuration%Mud%ActiveMudVolume) | |||
call json%add(p,"ActiveMudVolumeGal",data%Configuration%Mud%ActiveMudVolumeGal) | |||
call json%add(p,"ActiveDensity",data%Configuration%Mud%ActiveDensity) | |||
call json%add(p,"ActivePlasticViscosity",data%Configuration%Mud%ActivePlasticViscosity) | |||
call json%add(p,"ActiveYieldPoint",data%Configuration%Mud%ActiveYieldPoint) | |||
call json%add(p,"ActiveThetaThreeHundred",data%Configuration%Mud%ActiveThetaThreeHundred) | |||
call json%add(p,"ActiveThetaSixHundred",data%Configuration%Mud%ActiveThetaSixHundred) | |||
call json%add(p,"ReserveMudType",data%Configuration%Mud%ReserveMudType) | |||
call json%add(p,"ReserveMudVolume",data%Configuration%Mud%ReserveMudVolume) | |||
call json%add(p,"ReserveMudVolumeGal",data%Configuration%Mud%ReserveMudVolumeGal) | |||
call json%add(p,"ReserveDensity",data%Configuration%Mud%ReserveDensity) | |||
call json%add(p,"ReservePlasticViscosity",data%Configuration%Mud%ReservePlasticViscosity) | |||
call json%add(p,"ReserveYieldPoint",data%Configuration%Mud%ReserveYieldPoint) | |||
call json%add(p,"ReserveThetaThreeHundred",data%Configuration%Mud%ReserveThetaThreeHundred) | |||
call json%add(p,"ReserveThetaSixHundred",data%Configuration%Mud%ReserveThetaSixHundred) | |||
call json%add(p,"ActiveTotalTankCapacity",data%Configuration%Mud%ActiveTotalTankCapacity) | |||
call json%add(p,"ActiveTotalTankCapacityGal",data%Configuration%Mud%ActiveTotalTankCapacityGal) | |||
call json%add(p,"ActiveSettledContents",data%Configuration%Mud%ActiveSettledContents) | |||
call json%add(p,"ActiveSettledContentsGal",data%Configuration%Mud%ActiveSettledContentsGal) | |||
call json%add(p,"ActiveTotalContents",data%Configuration%Mud%ActiveTotalContents) | |||
call json%add(p,"ActiveTotalContentsGal",data%Configuration%Mud%ActiveTotalContentsGal) | |||
call json%add(p,"ActiveAutoDensity",data%Configuration%Mud%ActiveAutoDensity) | |||
call json%add(p,"InitialTripTankMudVolume",data%Configuration%Mud%InitialTripTankMudVolume) | |||
call json%add(p,"InitialTripTankMudVolumeGal",data%Configuration%Mud%InitialTripTankMudVolumeGal) | |||
call json%add(p,"PedalFlowMeter",data%Configuration%Mud%PedalFlowMeter) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine MudPropertiesFromJson(parent) | |||
use json_module,IK =>json_ik | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pitems,pitem,pval,pbit | |||
call json%get(parent,'Mud',p) | |||
call json%get(p,"ActiveMudType",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveMudType) | |||
call json%get(p,"ActiveRheologyModel",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveRheologyModel) | |||
call json%get(p,"ActiveMudVolume",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveMudVolume) | |||
call json%get(p,"ActiveMudVolumeGal",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveMudVolumeGal) | |||
call json%get(p,"ActiveDensity",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveDensity) | |||
call json%get(p,"ActivePlasticViscosity",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActivePlasticViscosity) | |||
call json%get(p,"ActiveYieldPoint",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveYieldPoint) | |||
call json%get(p,"ActiveThetaThreeHundred",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveThetaThreeHundred) | |||
call json%get(p,"ActiveThetaSixHundred",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveThetaSixHundred) | |||
call json%get(p,"ReserveMudType",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ReserveMudType) | |||
call json%get(p,"ReserveMudVolume",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ReserveMudVolume) | |||
call json%get(p,"ReserveMudVolumeGal",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ReserveMudVolumeGal) | |||
call json%get(p,"ReserveDensity",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ReserveDensity) | |||
call json%get(p,"ReservePlasticViscosity",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ReservePlasticViscosity) | |||
call json%get(p,"ReserveYieldPoint",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ReserveYieldPoint) | |||
call json%get(p,"ReserveThetaThreeHundred",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ReserveThetaThreeHundred) | |||
call json%get(p,"ReserveThetaSixHundred",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ReserveThetaSixHundred) | |||
call json%get(p,"ActiveTotalTankCapacity",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveTotalTankCapacity) | |||
call json%get(p,"ActiveTotalTankCapacityGal",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveTotalTankCapacityGal) | |||
call json%get(p,"ActiveSettledContents",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveSettledContents) | |||
call json%get(p,"ActiveSettledContentsGal",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveSettledContentsGal) | |||
call json%get(p,"ActiveTotalContents",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveTotalContents) | |||
call json%get(p,"ActiveTotalContentsGal",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveTotalContentsGal) | |||
call json%get(p,"ActiveAutoDensity",pitem) | |||
call json%get(pitem,data%Configuration%Mud%ActiveAutoDensity) | |||
call json%get(p,"InitialTripTankMudVolume",pitem) | |||
call json%get(pitem,data%Configuration%Mud%InitialTripTankMudVolume) | |||
call json%get(p,"InitialTripTankMudVolumeGal",pitem) | |||
call json%get(pitem,data%Configuration%Mud%InitialTripTankMudVolumeGal) | |||
call json%get(p,"PedalFlowMeter",pitem) | |||
call json%get(pitem,data%Configuration%Mud%PedalFlowMeter) | |||
end subroutine | |||
subroutine Set_ActiveMudVolume_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ActiveMudVolume == v) return | |||
#endif | |||
data%Configuration%Mud%ActiveMudVolume = v | |||
! if(associated(ActiveMudVolumePtr)) call ActiveMudVolumePtr(data%Configuration%Mud%ActiveMudVolume) | |||
end subroutine | |||
subroutine Set_ActiveDensity_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ActiveDensity == v) return | |||
#endif | |||
data%Configuration%Mud%ActiveDensity = v | |||
! if(associated(ActiveDensityPtr)) call ActiveDensityPtr(data%Configuration%Mud%ActiveDensity) | |||
end subroutine | |||
subroutine Set_ReserveMudVolume_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ReserveMudVolume == v) return | |||
#endif | |||
data%Configuration%Mud%ReserveMudVolume = v | |||
! if(associated(ReserveMudVolumePtr)) call ReserveMudVolumePtr(data%Configuration%Mud%ReserveMudVolume) | |||
end subroutine | |||
subroutine Set_ReserveDensity_StudentStation(v) | |||
implicit none | |||
real*8, intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Configuration%Mud%ReserveDensity == v) return | |||
#endif | |||
data%Configuration%Mud%ReserveDensity = v | |||
! if(associated(ReserveDensityPtr)) call ReserveDensityPtr(data%Configuration%Mud%ReserveDensity) | |||
end subroutine | |||
end module MudPropertiesModule |
@@ -0,0 +1,69 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/RigSpecifications/CAccumulator.f90" | |||
module CAccumulator | |||
use SimulationVariables | |||
! use CAccumulatorVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine AccumulatorFromJson(parent) | |||
use json_module,IK =>json_ik | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pitem,pval | |||
logical::is_found | |||
integer::i,n_children | |||
CHARACTER(KIND=JSON_CK, LEN=:), ALLOCATABLE :: val | |||
call json%get(parent,'Accumulator',p) | |||
call json%get(p,'NumberOfBottels',pval) | |||
call json%get(pval,data%Configuration%Accumulator%NumberOfBottels) | |||
call json%get(p,'AccumulatorSystemSize',pval) | |||
call json%get(pval,data%Configuration%Accumulator%AccumulatorSystemSize) | |||
call json%get(p,'OilTankVolume',pval) | |||
call json%get(pval,data%Configuration%Accumulator%OilTankVolume) | |||
call json%get(p,'PrechargePressure',pval) | |||
call json%get(pval,data%Configuration%Accumulator%PrechargePressure) | |||
call json%get(p,'AccumulatorMinimumOperatingPressure',pval) | |||
call json%get(pval,data%Configuration%Accumulator%AccumulatorMinimumOperatingPressure) | |||
call json%get(p,'ElectricPumpOutput',pval) | |||
call json%get(pval,data%Configuration%Accumulator%ElectricPumpOutput) | |||
call json%get(p,'StartPressure',pval) | |||
call json%get(pval,data%Configuration%Accumulator%StartPressure) | |||
call json%get(p,'StopPressure',pval) | |||
call json%get(pval,data%Configuration%Accumulator%StopPressure) | |||
call json%get(p,'AirPlungerPumpOutput',pval) | |||
call json%get(pval,data%Configuration%Accumulator%AirPlungerPumpOutput) | |||
call json%get(p,'StartPressure2',pval) | |||
call json%get(pval,data%Configuration%Accumulator%StartPressure2) | |||
call json%get(p,'StopPressure2',pval) | |||
call json%get(pval,data%Configuration%Accumulator%StopPressure2) | |||
end subroutine | |||
subroutine AccumulatorToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
call json%create_object(p,'Accumulator') | |||
call json%add(p,'AccumulatorMinimumOperatingPressure',data%Configuration%Accumulator%AccumulatorMinimumOperatingPressure) | |||
call json%add(p,'AccumulatorSystemSize',data%Configuration%Accumulator%AccumulatorSystemSize) | |||
call json%add(p,'AirPlungerPumpOutput',data%Configuration%Accumulator%AirPlungerPumpOutput) | |||
call json%add(p,'ElectricPumpOutput',data%Configuration%Accumulator%ElectricPumpOutput) | |||
call json%add(p,'NumberOfBottels',data%Configuration%Accumulator%NumberOfBottels) | |||
call json%add(p,'OilTankVolume',data%Configuration%Accumulator%OilTankVolume) | |||
call json%add(p,'PrechargePressure',data%Configuration%Accumulator%PrechargePressure) | |||
call json%add(p,'StartPressure',data%Configuration%Accumulator%StartPressure) | |||
call json%add(p,'StartPressure2',data%Configuration%Accumulator%StartPressure2) | |||
call json%add(p,'StopPressure',data%Configuration%Accumulator%StopPressure) | |||
call json%add(p,'StopPressure2',data%Configuration%Accumulator%StopPressure2) | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CAccumulator |
@@ -0,0 +1,107 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/RigSpecifications/CBopStack.f90" | |||
module CBopStack | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine BopStackFromJson(parent) | |||
use json_module,IK =>json_ik | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pitem,pval | |||
logical::is_found | |||
integer::i,n_children | |||
CHARACTER(KIND=JSON_CK, LEN=:), ALLOCATABLE :: val | |||
call json%get(parent,'BopStack',p) | |||
call json%get(p,'AboveAnnularHeight',pval) | |||
call json%get(pval,data%Configuration%BopStack%AboveAnnularHeight) | |||
call json%get(p,'AnnularPreventerHeight',pval) | |||
call json%get(pval,data%Configuration%BopStack%AnnularPreventerHeight) | |||
call json%get(p,'UpperRamHeight',pval) | |||
call json%get(pval,data%Configuration%BopStack%UpperRamHeight) | |||
call json%get(p,'LowerRamHeight',pval) | |||
call json%get(pval,data%Configuration%BopStack%LowerRamHeight) | |||
call json%get(p,'BlindRamHeight',pval) | |||
call json%get(pval,data%Configuration%BopStack%BlindRamHeight) | |||
call json%get(p,'KillHeight',pval) | |||
call json%get(pval,data%Configuration%BopStack%KillHeight) | |||
call json%get(p,'KillOpen',pval) | |||
call json%get(pval,data%Configuration%BopStack%KillOpen) | |||
call json%get(p,'KillClose',pval) | |||
call json%get(pval,data%Configuration%BopStack%KillClose) | |||
call json%get(p,'GroundLevel',pval) | |||
call json%get(pval,data%Configuration%BopStack%GroundLevel) | |||
call json%get(p,'LowerRamOpen',pval) | |||
call json%get(pval,data%Configuration%BopStack%LowerRamOpen) | |||
call json%get(p,'LowerRamClose',pval) | |||
call json%get(pval,data%Configuration%BopStack%LowerRamClose) | |||
call json%get(p,'ChokeOpen',pval) | |||
call json%get(pval,data%Configuration%BopStack%ChokeOpen) | |||
call json%get(p,'ChokeClose',pval) | |||
call json%get(pval,data%Configuration%BopStack%ChokeClose) | |||
call json%get(p,'BlindRamOpen',pval) | |||
call json%get(pval,data%Configuration%BopStack%BlindRamOpen) | |||
call json%get(p,'BlindRamClose',pval) | |||
call json%get(pval,data%Configuration%BopStack%BlindRamClose) | |||
call json%get(p,'UpperRamOpen',pval) | |||
call json%get(pval,data%Configuration%BopStack%UpperRamOpen) | |||
call json%get(p,'UpperRamClose',pval) | |||
call json%get(pval,data%Configuration%BopStack%UpperRamClose) | |||
call json%get(p,'AnnularPreventerOpen',pval) | |||
call json%get(pval,data%Configuration%BopStack%AnnularPreventerOpen) | |||
call json%get(p,'AnnularPreventerClose',pval) | |||
call json%get(pval,data%Configuration%BopStack%AnnularPreventerClose) | |||
call json%get(p,'RamStringDrag',pval) | |||
call json%get(pval,data%Configuration%BopStack%RamStringDrag) | |||
call json%get(p,'AnnularStringDrag',pval) | |||
call json%get(pval,data%Configuration%BopStack%AnnularStringDrag) | |||
call json%get(p,'ChokeLineLength',pval) | |||
call json%get(pval,data%Configuration%BopStack%ChokeLineLength) | |||
call json%get(p,'ChokeLineId',pval) | |||
call json%get(pval,data%Configuration%BopStack%ChokeLineId) | |||
end subroutine | |||
subroutine BopStackToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'BopStack') | |||
! 2. add member of data type to new node | |||
call json%add(p,"AboveAnnularHeight",data%Configuration%BopStack%AboveAnnularHeight) | |||
call json%add(p,"AnnularPreventerClose",data%Configuration%BopStack%AnnularPreventerClose) | |||
call json%add(p,"AnnularPreventerHeight",data%Configuration%BopStack%AnnularPreventerHeight) | |||
call json%add(p,"AnnularPreventerOpen",data%Configuration%BopStack%AnnularPreventerOpen) | |||
call json%add(p,"AnnularStringDrag",data%Configuration%BopStack%AnnularStringDrag) | |||
call json%add(p,"BlindRamClose",data%Configuration%BopStack%BlindRamClose) | |||
call json%add(p,"BlindRamHeight",data%Configuration%BopStack%BlindRamHeight) | |||
call json%add(p,"BlindRamOpen",data%Configuration%BopStack%BlindRamOpen) | |||
call json%add(p,"ChokeClose",data%Configuration%BopStack%ChokeClose) | |||
call json%add(p,"ChokeLineId",data%Configuration%BopStack%ChokeLineId) | |||
call json%add(p,"ChokeLineLength",data%Configuration%BopStack%ChokeLineLength) | |||
call json%add(p,"ChokeOpen",data%Configuration%BopStack%ChokeOpen) | |||
call json%add(p,"GroundLevel",data%Configuration%BopStack%GroundLevel) | |||
call json%add(p,"KillClose",data%Configuration%BopStack%KillClose) | |||
call json%add(p,"KillHeight",data%Configuration%BopStack%KillHeight) | |||
call json%add(p,"KillOpen",data%Configuration%BopStack%KillOpen) | |||
call json%add(p,"LowerRamClose",data%Configuration%BopStack%LowerRamClose) | |||
call json%add(p,"LowerRamHeight",data%Configuration%BopStack%LowerRamHeight) | |||
call json%add(p,"LowerRamOpen",data%Configuration%BopStack%LowerRamOpen) | |||
call json%add(p,"RamStringDrag",data%Configuration%BopStack%RamStringDrag) | |||
call json%add(p,"UpperRamClose",data%Configuration%BopStack%UpperRamClose) | |||
call json%add(p,"UpperRamHeight",data%Configuration%BopStack%UpperRamHeight) | |||
call json%add(p,"UpperRamOpen",data%Configuration%BopStack%UpperRamOpen) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CBopStack |
@@ -0,0 +1,31 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/RigSpecifications/CBopStackVariables.f90" | |||
module CBopStackVariables | |||
implicit none | |||
public | |||
Type::BopStackSpecificationType | |||
real(8) :: AboveAnnularHeight = 10.0d0 | |||
real(8) :: AnnularPreventerHeight = 10.2d0 | |||
real(8) :: UpperRamHeight = 14.632d0 | |||
real(8) :: LowerRamHeight = 21.35d0 | |||
real(8) :: BlindRamHeight = 16.24d0 | |||
real(8) :: KillHeight = 18.8d0 | |||
real(8) :: KillOpen = 1.5d0 | |||
real(8) :: KillClose = 1.5d0 | |||
real(8) :: GroundLevel = 30.0d0 | |||
real(8) :: LowerRamOpen | |||
real(8) :: LowerRamClose | |||
real(8) :: ChokeOpen | |||
real(8) :: ChokeClose | |||
real(8) :: BlindRamOpen | |||
real(8) :: BlindRamClose | |||
real(8) :: UpperRamOpen | |||
real(8) :: UpperRamClose | |||
real(8) :: AnnularPreventerOpen | |||
real(8) :: AnnularPreventerClose | |||
real(8) :: RamStringDrag | |||
real(8) :: AnnularStringDrag | |||
real(8) :: ChokeLineLength | |||
real(8) :: ChokeLineId | |||
End Type BopStackSpecificationType | |||
end module CBopStackVariables |
@@ -41,12 +41,12 @@ module CHoisting | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"DrillingLineBreakingLoadAbrasiveness",data%Configuration%Hoisting%DrillingLineBreakingLoad) | |||
call json%add(p,"DriveTypeAbrasiveness",data%Configuration%Hoisting%DriveType) | |||
call json%add(p,"KellyWeightAbrasiveness",data%Configuration%Hoisting%KellyWeight) | |||
call json%add(p,"NumberOfLineAbrasiveness",data%Configuration%Hoisting%NumberOfLine) | |||
call json%add(p,"TopDriveWeightAbrasiveness",data%Configuration%Hoisting%TopDriveWeight) | |||
call json%add(p,"TravelingBlockWeightAbrasiveness",data%Configuration%Hoisting%TravelingBlockWeight) | |||
call json%add(p,"DrillingLineBreakingLoad",data%Configuration%Hoisting%DrillingLineBreakingLoad) | |||
call json%add(p,"DriveType",data%Configuration%Hoisting%DriveType) | |||
call json%add(p,"KellyWeight",data%Configuration%Hoisting%KellyWeight) | |||
call json%add(p,"NumberOfLine",data%Configuration%Hoisting%NumberOfLine) | |||
call json%add(p,"TopDriveWeight",data%Configuration%Hoisting%TopDriveWeight) | |||
call json%add(p,"TravelingBlockWeight",data%Configuration%Hoisting%TravelingBlockWeight) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
@@ -0,0 +1,277 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/RigSpecifications/CPumps.f90" | |||
module CPumps | |||
use SimulationVariables | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine PumpsToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Pumps') | |||
! 2. add member of data type to new node | |||
! call StringConfigurationToJson(p) | |||
! call FormationToJson(p) | |||
call json%add(p,"MudPump1LinerDiameter",data%Configuration%Pumps%MudPump1LinerDiameter) | |||
call json%add(p,"MudPump1Stroke",data%Configuration%Pumps%MudPump1Stroke) | |||
call json%add(p,"MudPump1MechanicalEfficiency",data%Configuration%Pumps%MudPump1MechanicalEfficiency) | |||
call json%add(p,"MudPump1VolumetricEfficiency",data%Configuration%Pumps%MudPump1VolumetricEfficiency) | |||
call json%add(p,"MudPump1Output",data%Configuration%Pumps%MudPump1Output) | |||
call json%add(p,"MudPump1OutputBblStroke",data%Configuration%Pumps%MudPump1OutputBblStroke) | |||
call json%add(p,"MudPump1Maximum",data%Configuration%Pumps%MudPump1Maximum) | |||
call json%add(p,"MudPump1ReliefValvePressure",data%Configuration%Pumps%MudPump1ReliefValvePressure) | |||
call json%add(p,"MudPump2LinerDiameter",data%Configuration%Pumps%MudPump2LinerDiameter) | |||
call json%add(p,"MudPump2Stroke",data%Configuration%Pumps%MudPump2Stroke) | |||
call json%add(p,"MudPump2MechanicalEfficiency",data%Configuration%Pumps%MudPump2MechanicalEfficiency) | |||
call json%add(p,"MudPump2VolumetricEfficiency",data%Configuration%Pumps%MudPump2VolumetricEfficiency) | |||
call json%add(p,"MudPump2Output",data%Configuration%Pumps%MudPump2Output) | |||
call json%add(p,"MudPump2OutputBblStroke",data%Configuration%Pumps%MudPump2OutputBblStroke) | |||
call json%add(p,"MudPump2Maximum",data%Configuration%Pumps%MudPump2Maximum) | |||
call json%add(p,"MudPump2ReliefValvePressure",data%Configuration%Pumps%MudPump2ReliefValvePressure) | |||
call json%add(p,"CementPumpLinerDiameter",data%Configuration%Pumps%CementPumpLinerDiameter) | |||
call json%add(p,"CementPumpStroke",data%Configuration%Pumps%CementPumpStroke) | |||
call json%add(p,"CementPumpMechanicalEfficiency",data%Configuration%Pumps%CementPumpMechanicalEfficiency) | |||
call json%add(p,"CementPumpVolumetricEfficiency",data%Configuration%Pumps%CementPumpVolumetricEfficiency) | |||
call json%add(p,"CementPumpOutput",data%Configuration%Pumps%CementPumpOutput) | |||
call json%add(p,"CementPumpOutputBblStroke",data%Configuration%Pumps%CementPumpOutputBblStroke) | |||
call json%add(p,"CementPumpMaximum",data%Configuration%Pumps%CementPumpMaximum) | |||
call json%add(p,"CementPumpReliefValvePressure ",data%Configuration%Pumps%CementPumpReliefValvePressure ) | |||
call json%add(p,"MudPump1ReliefValveIsSet",data%Configuration%Pumps%MudPump1ReliefValveIsSet) | |||
call json%add(p,"MudPump2ReliefValveIsSet",data%Configuration%Pumps%MudPump2ReliefValveIsSet) | |||
call json%add(p,"CementPumpReliefValveIsSet",data%Configuration%Pumps%CementPumpReliefValveIsSet) | |||
call json%add(p,"ManualPumpPower",data%Configuration%Pumps%ManualPumpPower) | |||
call json%add(p,"Valve1",data%Configuration%Pumps%Valve1) | |||
call json%add(p,"Valve2",data%Configuration%Pumps%Valve2) | |||
call json%add(p,"Valve3",data%Configuration%Pumps%Valve3) | |||
call json%add(p,"Valve4",data%Configuration%Pumps%Valve4) | |||
call json%add(p,"Valve5",data%Configuration%Pumps%Valve5) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine PumpsFromJson(parent) | |||
use json_module,IK =>json_ik | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pitems,pitem,pval,pbit | |||
call json%get(parent,'Pumps',p) | |||
call json%get(p,"MudPump1LinerDiameter",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump1LinerDiameter) | |||
call json%get(p,"MudPump1Stroke",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump1Stroke) | |||
call json%get(p,"MudPump1MechanicalEfficiency",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump1MechanicalEfficiency) | |||
call json%get(p,"MudPump1VolumetricEfficiency",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump1VolumetricEfficiency) | |||
call json%get(p,"MudPump1Output",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump1Output) | |||
call json%get(p,"MudPump1OutputBblStroke",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump1OutputBblStroke) | |||
call json%get(p,"MudPump1Maximum",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump1Maximum) | |||
call json%get(p,"MudPump1ReliefValvePressure",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump1ReliefValvePressure) | |||
call json%get(p,"MudPump2LinerDiameter",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump2LinerDiameter) | |||
call json%get(p,"MudPump2Stroke",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump2Stroke) | |||
call json%get(p,"MudPump2MechanicalEfficiency",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump2MechanicalEfficiency) | |||
call json%get(p,"MudPump2VolumetricEfficiency",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump2VolumetricEfficiency) | |||
call json%get(p,"MudPump2Output",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump2Output) | |||
call json%get(p,"MudPump2OutputBblStroke",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump2OutputBblStroke) | |||
call json%get(p,"MudPump2Maximum",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump2Maximum) | |||
call json%get(p,"MudPump2ReliefValvePressure",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump2ReliefValvePressure) | |||
call json%get(p,"CementPumpLinerDiameter",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%CementPumpLinerDiameter) | |||
call json%get(p,"CementPumpStroke",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%CementPumpStroke) | |||
call json%get(p,"CementPumpMechanicalEfficiency",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%CementPumpMechanicalEfficiency) | |||
call json%get(p,"CementPumpVolumetricEfficiency",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%CementPumpVolumetricEfficiency) | |||
call json%get(p,"CementPumpOutput",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%CementPumpOutput) | |||
call json%get(p,"CementPumpOutputBblStroke",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%CementPumpOutputBblStroke) | |||
call json%get(p,"CementPumpMaximum",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%CementPumpMaximum) | |||
call json%get(p,"CementPumpReliefValvePressure",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%CementPumpReliefValvePressure) | |||
call json%get(p,"MudPump1ReliefValveIsSet",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump1ReliefValveIsSet) | |||
call json%get(p,"MudPump2ReliefValveIsSet",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%MudPump2ReliefValveIsSet) | |||
call json%get(p,"CementPumpReliefValveIsSet",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%CementPumpReliefValveIsSet) | |||
call json%get(p,"ManualPumpPower",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%ManualPumpPower) | |||
call json%get(p,"Valve1",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%Valve1) | |||
call json%get(p,"Valve2",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%Valve2) | |||
call json%get(p,"Valve3",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%Valve3) | |||
call json%get(p,"Valve4",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%Valve4) | |||
call json%get(p,"Valve5",pitem) | |||
call json%get(pitem,data%Configuration%Pumps%Valve5) | |||
end subroutine | |||
subroutine OpenPump1() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(16, .true.) | |||
end subroutine | |||
subroutine ClosePump1() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(16, .false.) | |||
end subroutine | |||
subroutine OpenPump2() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(17, .true.) | |||
end subroutine | |||
subroutine ClosePump2() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(17, .false.) | |||
end subroutine | |||
subroutine OpenCementPump() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(18, .true.) | |||
end subroutine | |||
subroutine CloseCementPump() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(18, .false.) | |||
end subroutine | |||
! subroutine SetMudPump1LinerDiameterN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump1LinerDiameterPtr)) call MudPump1LinerDiameterPtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump2LinerDiameterN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump2LinerDiameterPtr)) call MudPump2LinerDiameterPtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump3LinerDiameterN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump3LinerDiameterPtr)) call MudPump3LinerDiameterPtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump1OutputBblStrokeN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump1OutputBblStrokePtr)) call MudPump1OutputBblStrokePtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump2OutputBblStrokeN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump2OutputBblStrokePtr)) call MudPump2OutputBblStrokePtr(a) | |||
! end subroutine | |||
! subroutine SetMudPump3OutputBblStrokeN(a) | |||
! implicit none | |||
! real(8) :: a | |||
! if(associated(MudPump3OutputBblStrokePtr)) call MudPump3OutputBblStrokePtr(a) | |||
! end subroutine | |||
! subroutine CalcMudPump1LinerDiameter() | |||
! use, intrinsic :: IEEE_ARITHMETIC | |||
! implicit none | |||
! real(8) :: a | |||
! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0 | |||
! a = dsqrt(data%Configuration%Pumps%MudPump1OutputBblStroke / a) | |||
! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then | |||
! data%Configuration%Pumps%MudPump1LinerDiameter = 0.0 | |||
! else | |||
! data%Configuration%Pumps%MudPump1LinerDiameter = a | |||
! endif | |||
! call SetMudPump1LinerDiameterN(data%Configuration%Pumps%MudPump1LinerDiameter) | |||
! end subroutine | |||
! subroutine CalcMudPump2LinerDiameter() | |||
! use, intrinsic :: IEEE_ARITHMETIC | |||
! implicit none | |||
! real(8) :: a | |||
! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0 | |||
! a = dsqrt(data%Configuration%Pumps%MudPump2OutputBblStroke / a) | |||
! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then | |||
! data%Configuration%Pumps%MudPump2LinerDiameter = 0.0 | |||
! else | |||
! data%Configuration%Pumps%MudPump2LinerDiameter = a | |||
! endif | |||
! call SetMudPump2LinerDiameterN(data%Configuration%Pumps%MudPump2LinerDiameter) | |||
! end subroutine | |||
! subroutine CalcMudPump3LinerDiameter() | |||
! use, intrinsic :: IEEE_ARITHMETIC | |||
! implicit none | |||
! real(8) :: a | |||
! a = (MathPI / 4.d0) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0 | |||
! a = dsqrt(data%Configuration%Pumps%CementPumpOutputBblStroke / a) | |||
! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then | |||
! data%Configuration%Pumps%CementPumpLinerDiameter = 0.0 | |||
! else | |||
! data%Configuration%Pumps%CementPumpLinerDiameter = a | |||
! endif | |||
! call SetMudPump3LinerDiameterN(data%Configuration%Pumps%CementPumpLinerDiameter) | |||
! end subroutine | |||
! subroutine CalcPump1OutputBblStroke() | |||
! implicit none | |||
! data%Configuration%Pumps%MudPump1OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump1LinerDiameter**2) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0 | |||
! call SetMudPump1OutputBblStrokeN(data%Configuration%Pumps%MudPump1OutputBblStroke) | |||
! end subroutine | |||
! subroutine CalcPump2OutputBblStroke() | |||
! implicit none | |||
! data%Configuration%Pumps%MudPump2OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump2LinerDiameter**2) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0 | |||
! call SetMudPump2OutputBblStrokeN(data%Configuration%Pumps%MudPump2OutputBblStroke) | |||
! end subroutine | |||
! subroutine CalcPump3OutputBblStroke() | |||
! implicit none | |||
! data%Configuration%Pumps%CementPumpOutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%CementPumpLinerDiameter**2) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0 | |||
! call SetMudPump3OutputBblStrokeN(data%Configuration%Pumps%CementPumpOutputBblStroke) | |||
! end subroutine | |||
end module CPumps |
@@ -0,0 +1,61 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/RigSpecifications/CPumpsVariables.f90" | |||
module CPumpsVariables | |||
use CIActionReference | |||
implicit none | |||
public | |||
! Pumps Specifications | |||
Type::PumpSpecificationType | |||
real(8) :: MudPump1LinerDiameter | |||
real(8) :: MudPump1Stroke | |||
real(8) :: MudPump1MechanicalEfficiency | |||
real(8) :: MudPump1VolumetricEfficiency | |||
real(8) :: MudPump1Output | |||
real(8) :: MudPump1OutputBblStroke | |||
real(8) :: MudPump1Maximum | |||
real(8) :: MudPump1ReliefValvePressure | |||
real(8) :: MudPump2LinerDiameter | |||
real(8) :: MudPump2Stroke | |||
real(8) :: MudPump2MechanicalEfficiency | |||
real(8) :: MudPump2VolumetricEfficiency | |||
real(8) :: MudPump2Output | |||
real(8) :: MudPump2OutputBblStroke | |||
real(8) :: MudPump2Maximum | |||
real(8) :: MudPump2ReliefValvePressure | |||
real(8) :: CementPumpLinerDiameter | |||
real(8) :: CementPumpStroke | |||
real(8) :: CementPumpMechanicalEfficiency | |||
real(8) :: CementPumpVolumetricEfficiency | |||
real(8) :: CementPumpOutput | |||
real(8) :: CementPumpOutputBblStroke | |||
real(8) :: CementPumpMaximum | |||
real(8) :: CementPumpReliefValvePressure | |||
logical :: MudPump1ReliefValveIsSet | |||
logical :: MudPump2ReliefValveIsSet | |||
logical :: CementPumpReliefValveIsSet | |||
logical :: ManualPumpPower | |||
logical :: Valve1 | |||
logical :: Valve2 | |||
logical :: Valve3 | |||
logical :: Valve4 | |||
logical :: Valve5 | |||
End type PumpSpecificationType | |||
! Type(PumpSpecificationType)::PumpsSpecification | |||
! procedure (ActionDouble), pointer :: MudPump1LinerDiameterPtr | |||
! procedure (ActionDouble), pointer :: MudPump2LinerDiameterPtr | |||
! procedure (ActionDouble), pointer :: MudPump3LinerDiameterPtr | |||
! procedure (ActionDouble), pointer :: MudPump1OutputBblStrokePtr | |||
! procedure (ActionDouble), pointer :: MudPump2OutputBblStrokePtr | |||
! procedure (ActionDouble), pointer :: MudPump3OutputBblStrokePtr | |||
real(8) :: MathPI = 3.14159265358979d0 | |||
contains | |||
end module CPumpsVariables |
@@ -0,0 +1,27 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/WellProfile/CCasingLinerChokeVariables.f90" | |||
module CCasingLinerChokeVariables | |||
implicit none | |||
public | |||
! variables | |||
Type::CasingLinerChokeType | |||
real(8) :: CasingDepth | |||
real(8) :: CasingId | |||
real(8) :: CasingOd | |||
real(8) :: CasingWeight | |||
real(8) :: CasingCollapsePressure | |||
real(8) :: CasingTensileStrength | |||
real(8) :: LinerTopDepth | |||
real(8) :: LinerLength | |||
real(8) :: LinerId | |||
real(8) :: LinerOd | |||
real(8) :: LinerWeight | |||
real(8) :: LinerCollapsePressure | |||
real(8) :: LinerTensileStrength | |||
real(8) :: OpenHoleId | |||
real(8) :: OpenHoleLength | |||
End Type CasingLinerChokeType | |||
! Type(CasingLinerChokeType)::CasingLinerChoke | |||
contains | |||
end module CCasingLinerChokeVariables |
@@ -10,13 +10,14 @@ module CPathGeneration | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: ppath,pitems,pdp,p | |||
integer::i | |||
integer::i,n | |||
! 1. create new node | |||
call json%create_object(ppath,'Path') | |||
call json%create_array(pitems,'Items') | |||
do i=1,data%Configuration%Path%ItemCount | |||
n = data%Configuration%Path%ItemCount | |||
do i=1,n | |||
call json%create_object(p,'') | |||
call json%add(p,"HoleType",data%Configuration%Path%items(i)%HoleType) | |||
call json%add(p,"Angle",data%Configuration%Path%items(i)%Angle) | |||
@@ -28,17 +29,17 @@ module CPathGeneration | |||
call json%add(pitems,p) | |||
end do | |||
call json%create_array(pdp,'DataPoints') | |||
do i=1,data%Configuration%Path%DataPointsCount | |||
call json%create_object(p,'') | |||
call json%add(p,"X",data%Configuration%Path%DataPoints(i)%X) | |||
call json%add(p,"Y",data%Configuration%Path%DataPoints(i)%Y) | |||
call json%add(pdp,p) | |||
end do | |||
! call json%create_array(pdp,'DataPoints') | |||
! do i=1,data%Configuration%Path%DataPointsCount | |||
! call json%create_object(p,'') | |||
! call json%add(p,"X",data%Configuration%Path%DataPoints(i)%X) | |||
! call json%add(p,"Y",data%Configuration%Path%DataPoints(i)%Y) | |||
! call json%add(pdp,p) | |||
! end do | |||
! 3. add new node to parent | |||
call json%add(ppath,pitems) | |||
call json%add(ppath,pdp) | |||
! call json%add(ppath,pdp) | |||
call json%add(parent,ppath) | |||
end subroutine | |||
@@ -77,19 +78,19 @@ module CPathGeneration | |||
call json%get(pval,data%Configuration%Path%Items(i)%TotalVerticalDepth) | |||
end do | |||
call json%get(p,'DataPoints',dpoints) | |||
call json%info(dpoints, n_children=n_children) | |||
! call json%get(p,'DataPoints',dpoints) | |||
! call json%info(dpoints, n_children=n_children) | |||
if (.not. allocated(data%Configuration%Path%DataPoints) .or. size(data%Configuration%Path%DataPoints)/=n_children) then | |||
ALLOCATE(data%Configuration%Path%DataPoints(n_children)) | |||
endif | |||
do i=1,n_children | |||
call json%get_child(dpoints, i, dpoint, found=is_found) | |||
call json%get(dpoint,"X",pval) | |||
call json%get(pval,data%Configuration%Path%DataPoints(i)%X) | |||
call json%get(dpoint,"Y",pval) | |||
call json%get(pval,data%Configuration%Path%DataPoints(i)%Y) | |||
end do | |||
! if (.not. allocated(data%Configuration%Path%DataPoints) .or. size(data%Configuration%Path%DataPoints)/=n_children) then | |||
! ALLOCATE(data%Configuration%Path%DataPoints(n_children)) | |||
! endif | |||
! do i=1,n_children | |||
! call json%get_child(dpoints, i, dpoint, found=is_found) | |||
! call json%get(dpoint,"X",pval) | |||
! call json%get(pval,data%Configuration%Path%DataPoints(i)%X) | |||
! call json%get(dpoint,"Y",pval) | |||
! call json%get(pval,data%Configuration%Path%DataPoints(i)%Y) | |||
! end do | |||
end subroutine |
@@ -0,0 +1,98 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/WellProfile/CPathGeneration.f90" | |||
module CPathGeneration | |||
use SimulationVariables !@ | |||
use json_module | |||
implicit none | |||
public | |||
contains | |||
subroutine PathGenerationToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: ppath,pitems,pdp,p | |||
integer::i,n | |||
! 1. create new node | |||
call json%create_object(ppath,'Path') | |||
call json%create_array(pitems,'Items') | |||
n = data%Configuration%Path%ItemCount | |||
do i=1,n | |||
call json%create_object(p,'') | |||
call json%add(p,"HoleType",data%Configuration%Path%items(i)%HoleType) | |||
call json%add(p,"Angle",data%Configuration%Path%items(i)%Angle) | |||
call json%add(p,"Length",data%Configuration%Path%items(i)%Length) | |||
call json%add(p,"FinalAngle",data%Configuration%Path%items(i)%FinalAngle) | |||
call json%add(p,"TotalLength",data%Configuration%Path%items(i)%TotalLength) | |||
call json%add(p,"MeasuredDepth",data%Configuration%Path%items(i)%MeasuredDepth) | |||
call json%add(p,"TotalVerticalDepth",data%Configuration%Path%items(i)%TotalVerticalDepth) | |||
call json%add(pitems,p) | |||
end do | |||
! call json%create_array(pdp,'DataPoints') | |||
! do i=1,data%Configuration%Path%DataPointsCount | |||
! call json%create_object(p,'') | |||
! call json%add(p,"X",data%Configuration%Path%DataPoints(i)%X) | |||
! call json%add(p,"Y",data%Configuration%Path%DataPoints(i)%Y) | |||
! call json%add(pdp,p) | |||
! end do | |||
! 3. add new node to parent | |||
call json%add(ppath,pitems) | |||
! call json%add(ppath,pdp) | |||
call json%add(parent,ppath) | |||
end subroutine | |||
subroutine PathGenerationFromJson(parent) | |||
use json_module,IK =>json_ik | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pitems,pitem,pval,pbit,dpoints,dpoint | |||
logical::is_found | |||
type(CStringItem) :: item | |||
integer::i,n_children | |||
CHARACTER(KIND=JSON_CK, LEN=:), ALLOCATABLE :: val | |||
call json%get(parent,'Path',p) | |||
call json%get(p,'Items',pitems) | |||
call json%info(pitems, n_children=n_children) | |||
if (.not. allocated(data%Configuration%Path%Items) .or. size(data%Configuration%Path%Items)/=n_children) then | |||
ALLOCATE(data%Configuration%Path%Items(n_children)) | |||
endif | |||
do i=1,n_children | |||
call json%get_child(pitems, i, pitem, found=is_found) | |||
call json%get(pitem,"HoleType",pval) | |||
call json%get(pval,data%Configuration%Path%Items(i)%HoleType) | |||
call json%get(pitem,"Angle",pval) | |||
call json%get(pval,data%Configuration%Path%Items(i)%Angle) | |||
call json%get(pitem,"Length",pval) | |||
call json%get(pval,data%Configuration%Path%Items(i)%Length) | |||
call json%get(pitem,"FinalAngle",pval) | |||
call json%get(pval,data%Configuration%Path%Items(i)%FinalAngle) | |||
call json%get(pitem,"TotalLength",pval) | |||
call json%get(pval,data%Configuration%Path%Items(i)%TotalLength) | |||
call json%get(pitem,"MeasuredDepth",pval) | |||
call json%get(pval,data%Configuration%Path%Items(i)%MeasuredDepth) | |||
call json%get(pitem,"TotalVerticalDepth",pval) | |||
call json%get(pval,data%Configuration%Path%Items(i)%TotalVerticalDepth) | |||
end do | |||
! call json%get(p,'DataPoints',dpoints) | |||
! call json%info(dpoints, n_children=n_children) | |||
! if (.not. allocated(data%Configuration%Path%DataPoints) .or. size(data%Configuration%Path%DataPoints)/=n_children) then | |||
! ALLOCATE(data%Configuration%Path%DataPoints(n_children)) | |||
! endif | |||
! do i=1,n_children | |||
! call json%get_child(dpoints, i, dpoint, found=is_found) | |||
! call json%get(dpoint,"X",pval) | |||
! call json%get(pval,data%Configuration%Path%DataPoints(i)%X) | |||
! call json%get(dpoint,"Y",pval) | |||
! call json%get(pval,data%Configuration%Path%DataPoints(i)%Y) | |||
! end do | |||
end subroutine | |||
end module CPathGeneration |
@@ -21,8 +21,8 @@ module CPathGenerationVariables | |||
Type :: PathGenerationType | |||
integer :: ItemCount = 0 | |||
type(CPathGenerationItem), allocatable :: Items(:) | |||
integer :: DataPointsCount = 0 | |||
type(CDataPointItem), allocatable :: DataPoints(:) | |||
! integer :: DataPointsCount = 0 | |||
! type(CDataPointItem), allocatable :: DataPoints(:) | |||
End type PathGenerationType | |||
! Type(PathGenerationType)::PathGeneration | |||
@@ -0,0 +1,31 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/BasicInputs/WellProfile/CPathGenerationVariables.f90" | |||
module CPathGenerationVariables | |||
implicit none | |||
public | |||
! types | |||
type, bind(c), public :: CPathGenerationItem | |||
integer :: HoleType | |||
real(8) :: Angle | |||
real(8) :: Length | |||
real(8) :: FinalAngle | |||
real(8) :: TotalLength | |||
real(8) :: MeasuredDepth | |||
real(8) :: TotalVerticalDepth | |||
end type CPathGenerationItem | |||
type, bind(c), public :: CDataPointItem | |||
real(8) :: X | |||
real(8) :: Y | |||
end type CDataPointItem | |||
Type :: PathGenerationType | |||
integer :: ItemCount = 0 | |||
type(CPathGenerationItem), allocatable :: Items(:) | |||
! integer :: DataPointsCount = 0 | |||
! type(CDataPointItem), allocatable :: DataPoints(:) | |||
End type PathGenerationType | |||
! Type(PathGenerationType)::PathGeneration | |||
end module CPathGenerationVariables |
@@ -0,0 +1,53 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/DownHole/CDownHoleTypes.f90" | |||
module CDownHoleTypes | |||
implicit none | |||
public | |||
!enums | |||
enum, bind(c) | |||
enumerator STRING_BIT !0 | |||
enumerator STRING_STABILIZER !1 | |||
enumerator STRING_COLLAR !2 | |||
enumerator STRING_DRILLPIPE !3 | |||
enumerator STRING_HEAVYWEIGHT !4 | |||
end enum | |||
enum, bind(c) | |||
enumerator FLUID_NORMAL_MUD !0 | |||
enumerator FLUID_GAS_KICK !1 | |||
enumerator FLUID_WATER_KICK !2 | |||
enumerator FLUID_OIL_KICK !3 | |||
enumerator FLUID_NO_MUD !4 | |||
end enum | |||
! new types | |||
type, bind(c), public :: CFluid | |||
real(8) :: StartMd | |||
real(8) :: EndMd | |||
real(8) :: Density | |||
integer :: MudType | |||
end type CFluid | |||
type, bind(c), public :: CStringComponents | |||
real(8) :: Length | |||
real(8) :: TopDepth | |||
real(8) :: DownDepth | |||
real(8) :: Od | |||
real(8) :: Id | |||
integer :: ComponentType | |||
end type CStringComponents | |||
type, bind(c), public :: CStringComponent | |||
real(8) :: StartMd | |||
real(8) :: EndMd | |||
integer :: ComponentType | |||
end type CStringComponent | |||
type, bind(c), public :: CBopElement | |||
integer :: ElementType | |||
real :: ElementStart | |||
real :: ElementEnd | |||
end type CBopElement | |||
contains | |||
end module CDownHoleTypes |
@@ -9,19 +9,18 @@ module CDownHoleVariables | |||
! Outputs to user interface | |||
!!!!!!!!!!!!!!!!!!!!! | |||
type :: DownHoleType | |||
! Input | |||
logical :: AnnDrillMud | |||
logical :: AnnCirculateMud | |||
! Output | |||
integer :: AnnalusFluidsCount = 0 | |||
integer :: StringFluidsCount = 0 | |||
type(CFluid), allocatable :: AnnalusFluids(:) !, target | |||
type(CFluid), allocatable :: StringFluids(:) | |||
integer :: StringCount = 0 | |||
type(CStringComponent), allocatable :: String(:) | |||
type(CBopElement), allocatable :: BopElements(:) | |||
real(8) :: DrillPipePressure | |||
real(8) :: CasingPressure | |||
real(8) :: ShoePressure | |||
@@ -32,12 +31,12 @@ module CDownHoleVariables | |||
real :: SecondKickVolume | |||
real :: PermeabilityExposedHeight | |||
real(8) :: Density | |||
real(8) :: Pressure | |||
real(8) :: Temperature | |||
real(8) :: Height | |||
real(8) :: Volume | |||
! Not used (only density printed) | |||
! real(8) :: Density | |||
! real(8) :: Pressure | |||
! real(8) :: Temperature | |||
! real(8) :: Height | |||
! real(8) :: Volume | |||
end type DownHoleType | |||
type(DownHoleType):: DownHole | |||
contains | |||
end module CDownHoleVariables |
@@ -0,0 +1,43 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/DownHole/CDownHoleVariables.f90" | |||
module CDownHoleVariables | |||
use CDownHoleTypes | |||
! use CStringConfigurationVariables | |||
! use CDownHoleActions | |||
use CLog4 | |||
implicit none | |||
public | |||
!!!!!!!!!!!!!!!!!!!!! | |||
! Outputs to user interface | |||
!!!!!!!!!!!!!!!!!!!!! | |||
type :: DownHoleType | |||
! Input | |||
logical :: AnnDrillMud | |||
logical :: AnnCirculateMud | |||
! Output | |||
integer :: AnnalusFluidsCount = 0 | |||
integer :: StringFluidsCount = 0 | |||
type(CFluid), allocatable :: AnnalusFluids(:) !, target | |||
type(CFluid), allocatable :: StringFluids(:) | |||
integer :: StringCount = 0 | |||
type(CStringComponent), allocatable :: String(:) | |||
type(CBopElement), allocatable :: BopElements(:) | |||
real(8) :: DrillPipePressure | |||
real(8) :: CasingPressure | |||
real(8) :: ShoePressure | |||
real(8) :: BottomHolePressure | |||
real(8) :: FormationPressure | |||
real :: InfluxRate | |||
real :: KickVolume | |||
real :: SecondKickVolume | |||
real :: PermeabilityExposedHeight | |||
! Not used (only density printed) | |||
! real(8) :: Density | |||
! real(8) :: Pressure | |||
! real(8) :: Temperature | |||
! real(8) :: Height | |||
! real(8) :: Volume | |||
end type DownHoleType | |||
contains | |||
end module CDownHoleVariables |
@@ -1,46 +1,90 @@ | |||
module DownHoleModule | |||
use SimulationVariables | |||
contains | |||
subroutine MudPropertiesToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'DownHole') | |||
! 2. add member of data type to new node | |||
! call json%add(p,"AnnalusFluidsCount",data%Equipments%DownHole%AnnalusFluidsCount) | |||
! call json%add(p,"StringFluidsCount",data%Equipments%DownHole%StringFluidsCount) | |||
! call json%add(p,"AnnalusFluids(:)",data%Equipments%DownHole%AnnalusFluids(:)) | |||
! call json%add(p,"StringFluids(:)",data%Equipments%DownHole%StringFluids(:)) | |||
! call json%add(p,"StringCount",data%Equipments%DownHole%StringCount) | |||
! call json%add(p,"String(:)",data%Equipments%DownHole%String(:)) | |||
! call json%add(p,"BopElements(:)",data%Equipments%DownHole%BopElements(:)) | |||
call json%add(p,"DrillPipePressure",data%Equipments%DownHole%DrillPipePressure) | |||
call json%add(p,"CasingPressure",data%Equipments%DownHole%CasingPressure) | |||
call json%add(p,"ShoePressure",data%Equipments%DownHole%ShoePressure) | |||
call json%add(p,"BottomHolePressure",data%Equipments%DownHole%BottomHolePressure) | |||
call json%add(p,"FormationPressure",data%Equipments%DownHole%FormationPressure) | |||
call json%add(p,"InfluxRate",data%Equipments%DownHole%InfluxRate) | |||
call json%add(p,"KickVolume",data%Equipments%DownHole%KickVolume) | |||
call json%add(p,"SecondKickVolume",data%Equipments%DownHole%SecondKickVolume) | |||
call json%add(p,"PermeabilityExposedHeight",data%Equipments%DownHole%PermeabilityExposedHeight) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine DownHoleFromJson(parent) | |||
use json_module,IK =>json_ik | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pitems,pitem,pval,pbit | |||
call json%get(parent,'DownHole',p) | |||
call json%get(p,'AnnDrillMud',pval) | |||
call json%get(pval,data%Equipments%DownHole%AnnDrillMud) | |||
call json%get(p,'AnnCirculateMud',pval) | |||
call json%get(pval,data%Equipments%DownHole%AnnCirculateMud) | |||
end subroutine | |||
subroutine SetAnnalusFluids(count, array) | |||
implicit none | |||
integer, intent(in) :: count | |||
integer :: i, offset | |||
type(CFluid), intent(inout), target :: array(count) | |||
type(CFluid), pointer :: item | |||
DownHole%AnnalusFluidsCount = count | |||
data%Equipments%DownHole%AnnalusFluidsCount = count | |||
print*, 'AnnalusFluidsCount = ', count | |||
if(size(DownHole%AnnalusFluids) > 0) then | |||
deallocate(DownHole%AnnalusFluids) | |||
if(size(data%Equipments%DownHole%AnnalusFluids) > 0) then | |||
deallocate(data%Equipments%DownHole%AnnalusFluids) | |||
end if | |||
if(count > 0) then | |||
offset = 0; | |||
item => array(1) | |||
if(item%StartMd > 0) then | |||
DownHole%AnnalusFluidsCount = DownHole%AnnalusFluidsCount + 1 | |||
data%Equipments%DownHole%AnnalusFluidsCount = data%Equipments%DownHole%AnnalusFluidsCount + 1 | |||
offset = 1; | |||
allocate(DownHole%AnnalusFluids(DownHole%AnnalusFluidsCount)) | |||
DownHole%AnnalusFluids(1)%StartMd = 0 | |||
DownHole%AnnalusFluids(1)%EndMd = item%StartMd | |||
DownHole%AnnalusFluids(1)%Density = 0 | |||
DownHole%AnnalusFluids(1)%MudType = FLUID_NO_MUD | |||
allocate(data%Equipments%DownHole%AnnalusFluids(data%Equipments%DownHole%AnnalusFluidsCount)) | |||
data%Equipments%DownHole%AnnalusFluids(1)%StartMd = 0 | |||
data%Equipments%DownHole%AnnalusFluids(1)%EndMd = item%StartMd | |||
data%Equipments%DownHole%AnnalusFluids(1)%Density = 0 | |||
data%Equipments%DownHole%AnnalusFluids(1)%MudType = FLUID_NO_MUD | |||
endif | |||
!if(associated(AnnalusMudCountPtr)) then | |||
! call AnnalusMudCountPtr(AnnalusFluidsCount) | |||
!end if | |||
if(.not.allocated(DownHole%AnnalusFluids))allocate(DownHole%AnnalusFluids(DownHole%AnnalusFluidsCount)) | |||
if(.not.allocated(data%Equipments%DownHole%AnnalusFluids))allocate(data%Equipments%DownHole%AnnalusFluids(data%Equipments%DownHole%AnnalusFluidsCount)) | |||
!print*, '============START-AN============' | |||
if(item%StartMd < 0) DownHole%AnnalusFluids(1)%StartMd = 0 | |||
if(item%StartMd < 0) data%Equipments%DownHole%AnnalusFluids(1)%StartMd = 0 | |||
do i = 1, count | |||
item => array(i) | |||
DownHole%AnnalusFluids(i + offset)%StartMd = item%StartMd | |||
if(i==1) DownHole%AnnalusFluids(i)%StartMd = 0 | |||
data%Equipments%DownHole%AnnalusFluids(i + offset)%StartMd = item%StartMd | |||
if(i==1) data%Equipments%DownHole%AnnalusFluids(i)%StartMd = 0 | |||
!print*, 'AnnalusFluids(',i,')%StartMd=', AnnalusFluids(i)%StartMd | |||
DownHole%AnnalusFluids(i + offset)%EndMd = item%EndMd | |||
data%Equipments%DownHole%AnnalusFluids(i + offset)%EndMd = item%EndMd | |||
!print*, 'AnnalusFluids(',i,')%EndMd=', AnnalusFluids(i)%EndMd | |||
DownHole%AnnalusFluids(i + offset)%Density = item%Density | |||
data%Equipments%DownHole%AnnalusFluids(i + offset)%Density = item%Density | |||
!print*, 'AnnalusFluids(',i,')%Density=', AnnalusFluids(i)%Density | |||
DownHole%AnnalusFluids(i + offset)%MudType = item%MudType | |||
data%Equipments%DownHole%AnnalusFluids(i + offset)%MudType = item%MudType | |||
!print*, 'AnnalusFluids(',i,')%MudType=', AnnalusFluids(i)%MudType | |||
!print*, '----------------------------' | |||
end do | |||
@@ -58,10 +102,10 @@ module DownHoleModule | |||
integer :: i, offset !, startArr | |||
type(CFluid), intent(inout), target :: array(count) | |||
type(CFluid), pointer :: item | |||
DownHole%StringFluidsCount = count | |||
data%Equipments%DownHole%StringFluidsCount = count | |||
print*, 'StringFluidsCount = ', count | |||
if(size(DownHole%StringFluids) > 0) then | |||
deallocate(DownHole%StringFluids) | |||
if(size(data%Equipments%DownHole%StringFluids) > 0) then | |||
deallocate(data%Equipments%DownHole%StringFluids) | |||
end if | |||
!startArr = 1 | |||
@@ -80,30 +124,30 @@ module DownHoleModule | |||
!if(count <= 0) return | |||
if(item%StartMd > 0) then | |||
DownHole%StringFluidsCount = DownHole%StringFluidsCount + 1 | |||
data%Equipments%DownHole%StringFluidsCount = data%Equipments%DownHole%StringFluidsCount + 1 | |||
offset = offset + 1 | |||
allocate(DownHole%StringFluids(DownHole%StringFluidsCount)) | |||
DownHole%StringFluids(1)%StartMd = 0 | |||
DownHole%StringFluids(1)%EndMd = item%StartMd | |||
DownHole%StringFluids(1)%Density = 0 | |||
DownHole%StringFluids(1)%MudType = FLUID_NO_MUD | |||
allocate(data%Equipments%DownHole%StringFluids(data%Equipments%DownHole%StringFluidsCount)) | |||
data%Equipments%DownHole%StringFluids(1)%StartMd = 0 | |||
data%Equipments%DownHole%StringFluids(1)%EndMd = item%StartMd | |||
data%Equipments%DownHole%StringFluids(1)%Density = 0 | |||
data%Equipments%DownHole%StringFluids(1)%MudType = FLUID_NO_MUD | |||
endif | |||
!if(associated(StringMudCountPtr)) then | |||
! call StringMudCountPtr(count) | |||
!end if | |||
if(.not.allocated(DownHole%StringFluids))allocate(DownHole%StringFluids(DownHole%StringFluidsCount)) | |||
if(.not.allocated(data%Equipments%DownHole%StringFluids))allocate(data%Equipments%DownHole%StringFluids(data%Equipments%DownHole%StringFluidsCount)) | |||
!print*, '============START-ST============' | |||
!print*, 'count=', count | |||
do i = 1, count | |||
item => array(i) | |||
DownHole%StringFluids(i + offset)%StartMd = item%StartMd | |||
if(i==1) DownHole%StringFluids(i)%StartMd = 0 | |||
data%Equipments%DownHole%StringFluids(i + offset)%StartMd = item%StartMd | |||
if(i==1) data%Equipments%DownHole%StringFluids(i)%StartMd = 0 | |||
!print*, 'StringFluids(i)%StartMd=', StringFluids(i)%StartMd | |||
DownHole%StringFluids(i + offset)%EndMd = item%EndMd | |||
data%Equipments%DownHole%StringFluids(i + offset)%EndMd = item%EndMd | |||
!print*, 'StringFluids(i)%EndMd=', StringFluids(i)%EndMd | |||
DownHole%StringFluids(i + offset)%Density = item%Density | |||
DownHole%StringFluids(i + offset)%MudType = item%MudType | |||
data%Equipments%DownHole%StringFluids(i + offset)%Density = item%Density | |||
data%Equipments%DownHole%StringFluids(i + offset)%MudType = item%MudType | |||
!print*, '----------------------------' | |||
end do | |||
!!if(item%StartMd < 0) StringFluids(1)%StartMd = 0 | |||
@@ -121,15 +165,15 @@ module DownHoleModule | |||
integer :: i !, j | |||
type(CStringComponents), intent(inout), target :: array(count) | |||
type(CStringComponents), pointer :: item | |||
DownHole%StringCount = count | |||
if(size(DownHole%String) > 0) then | |||
deallocate(DownHole%String) | |||
data%Equipments%DownHole%StringCount = count | |||
if(size(data%Equipments%DownHole%String) > 0) then | |||
deallocate(data%Equipments%DownHole%String) | |||
end if | |||
if(count > 0) then | |||
!if(associated(StringComponentCountPtr)) then | |||
! call StringComponentCountPtr(count) | |||
!end if | |||
allocate(DownHole%String(count)) | |||
allocate(data%Equipments%DownHole%String(count)) | |||
!j = 0 | |||
!print*, '============CMP-ST============' | |||
!call Log_3( '============CMP-ST============') | |||
@@ -141,20 +185,20 @@ module DownHoleModule | |||
!String(i)%DownDepth = item%DownDepth | |||
!String(i)%Od = item%Od | |||
!String(i)%Id = item%Id | |||
DownHole%String(i)%ComponentType= item%ComponentType | |||
data%Equipments%DownHole%String(i)%ComponentType= item%ComponentType | |||
!j = j + 1 | |||
DownHole%String(i)%StartMd = item%TopDepth | |||
DownHole%String(i)%EndMd = item%DownDepth | |||
data%Equipments%DownHole%String(i)%StartMd = item%TopDepth | |||
data%Equipments%DownHole%String(i)%EndMd = item%DownDepth | |||
DownHole%String(i)%ComponentType=0 | |||
data%Equipments%DownHole%String(i)%ComponentType=0 | |||
!if(item%ComponentType > 4 ) then | |||
! String(i)%ComponentType=0 | |||
! String(i)%StartMd = 0 | |||
!endif | |||
if(item%ComponentType == 3) DownHole%String(i)%ComponentType=0 | |||
if(item%ComponentType == 4) DownHole%String(i)%ComponentType=1 | |||
if(item%ComponentType == 2) DownHole%String(i)%ComponentType=2 | |||
if(item%ComponentType == 1) DownHole%String(i)%ComponentType=3 | |||
if(item%ComponentType == 3) data%Equipments%DownHole%String(i)%ComponentType=0 | |||
if(item%ComponentType == 4) data%Equipments%DownHole%String(i)%ComponentType=1 | |||
if(item%ComponentType == 2) data%Equipments%DownHole%String(i)%ComponentType=2 | |||
if(item%ComponentType == 1) data%Equipments%DownHole%String(i)%ComponentType=3 | |||
!print*, 'item%ComponentType=', item%ComponentType | |||
!print*, 'String(i)%ComponentType=', String(i)%ComponentType | |||
!print*, 'String(i)%StartMd=', String(i)%StartMd | |||
@@ -183,8 +227,8 @@ module DownHoleModule | |||
integer :: i = 1 !, j | |||
type(CBopElement), intent(inout), target :: array(count) | |||
type(CBopElement), pointer :: item | |||
if(size(DownHole%BopElements) > 0) deallocate(DownHole%BopElements) | |||
allocate(DownHole%BopElements(count)) | |||
if(size(data%Equipments%DownHole%BopElements) > 0) deallocate(data%Equipments%DownHole%BopElements) | |||
allocate(data%Equipments%DownHole%BopElements(count)) | |||
do i = 1, count | |||
item => array(i) | |||
@@ -193,9 +237,9 @@ module DownHoleModule | |||
!call Log_4('item%ElementType', item%ElementType) | |||
!call Log_4('=====================================================') | |||
DownHole%BopElements(i)%ElementStart = item%ElementStart | |||
DownHole%BopElements(i)%ElementEnd = item%ElementEnd | |||
DownHole%BopElements(i)%ElementType = item%ElementType | |||
data%Equipments%DownHole%BopElements(i)%ElementStart = item%ElementStart | |||
data%Equipments%DownHole%BopElements(i)%ElementEnd = item%ElementEnd | |||
data%Equipments%DownHole%BopElements(i)%ElementType = item%ElementType | |||
end do | |||
!if(associated(BopElementsPtr)) call BopElementsPtr(BopElements) | |||
@@ -0,0 +1,249 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/DownHole/DownHole.f90" | |||
module DownHoleModule | |||
use SimulationVariables | |||
contains | |||
subroutine MudPropertiesToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'DownHole') | |||
! 2. add member of data type to new node | |||
! call json%add(p,"AnnalusFluidsCount",data%Equipments%DownHole%AnnalusFluidsCount) | |||
! call json%add(p,"StringFluidsCount",data%Equipments%DownHole%StringFluidsCount) | |||
! call json%add(p,"AnnalusFluids(:)",data%Equipments%DownHole%AnnalusFluids(:)) | |||
! call json%add(p,"StringFluids(:)",data%Equipments%DownHole%StringFluids(:)) | |||
! call json%add(p,"StringCount",data%Equipments%DownHole%StringCount) | |||
! call json%add(p,"String(:)",data%Equipments%DownHole%String(:)) | |||
! call json%add(p,"BopElements(:)",data%Equipments%DownHole%BopElements(:)) | |||
call json%add(p,"DrillPipePressure",data%Equipments%DownHole%DrillPipePressure) | |||
call json%add(p,"CasingPressure",data%Equipments%DownHole%CasingPressure) | |||
call json%add(p,"ShoePressure",data%Equipments%DownHole%ShoePressure) | |||
call json%add(p,"BottomHolePressure",data%Equipments%DownHole%BottomHolePressure) | |||
call json%add(p,"FormationPressure",data%Equipments%DownHole%FormationPressure) | |||
call json%add(p,"InfluxRate",data%Equipments%DownHole%InfluxRate) | |||
call json%add(p,"KickVolume",data%Equipments%DownHole%KickVolume) | |||
call json%add(p,"SecondKickVolume",data%Equipments%DownHole%SecondKickVolume) | |||
call json%add(p,"PermeabilityExposedHeight",data%Equipments%DownHole%PermeabilityExposedHeight) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine DownHoleFromJson(parent) | |||
use json_module,IK =>json_ik | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pitems,pitem,pval,pbit | |||
call json%get(parent,'DownHole',p) | |||
call json%get(p,'AnnDrillMud',pval) | |||
call json%get(pval,data%Equipments%DownHole%AnnDrillMud) | |||
call json%get(p,'AnnCirculateMud',pval) | |||
call json%get(pval,data%Equipments%DownHole%AnnCirculateMud) | |||
end subroutine | |||
subroutine SetAnnalusFluids(count, array) | |||
implicit none | |||
integer, intent(in) :: count | |||
integer :: i, offset | |||
type(CFluid), intent(inout), target :: array(count) | |||
type(CFluid), pointer :: item | |||
data%Equipments%DownHole%AnnalusFluidsCount = count | |||
print*, 'AnnalusFluidsCount = ', count | |||
if(size(data%Equipments%DownHole%AnnalusFluids) > 0) then | |||
deallocate(data%Equipments%DownHole%AnnalusFluids) | |||
end if | |||
if(count > 0) then | |||
offset = 0; | |||
item => array(1) | |||
if(item%StartMd > 0) then | |||
data%Equipments%DownHole%AnnalusFluidsCount = data%Equipments%DownHole%AnnalusFluidsCount + 1 | |||
offset = 1; | |||
allocate(data%Equipments%DownHole%AnnalusFluids(data%Equipments%DownHole%AnnalusFluidsCount)) | |||
data%Equipments%DownHole%AnnalusFluids(1)%StartMd = 0 | |||
data%Equipments%DownHole%AnnalusFluids(1)%EndMd = item%StartMd | |||
data%Equipments%DownHole%AnnalusFluids(1)%Density = 0 | |||
data%Equipments%DownHole%AnnalusFluids(1)%MudType = FLUID_NO_MUD | |||
endif | |||
!if(associated(AnnalusMudCountPtr)) then | |||
! call AnnalusMudCountPtr(AnnalusFluidsCount) | |||
!end if | |||
if(.not.allocated(data%Equipments%DownHole%AnnalusFluids))allocate(data%Equipments%DownHole%AnnalusFluids(data%Equipments%DownHole%AnnalusFluidsCount)) | |||
!print*, '============START-AN============' | |||
if(item%StartMd < 0) data%Equipments%DownHole%AnnalusFluids(1)%StartMd = 0 | |||
do i = 1, count | |||
item => array(i) | |||
data%Equipments%DownHole%AnnalusFluids(i + offset)%StartMd = item%StartMd | |||
if(i==1) data%Equipments%DownHole%AnnalusFluids(i)%StartMd = 0 | |||
!print*, 'AnnalusFluids(',i,')%StartMd=', AnnalusFluids(i)%StartMd | |||
data%Equipments%DownHole%AnnalusFluids(i + offset)%EndMd = item%EndMd | |||
!print*, 'AnnalusFluids(',i,')%EndMd=', AnnalusFluids(i)%EndMd | |||
data%Equipments%DownHole%AnnalusFluids(i + offset)%Density = item%Density | |||
!print*, 'AnnalusFluids(',i,')%Density=', AnnalusFluids(i)%Density | |||
data%Equipments%DownHole%AnnalusFluids(i + offset)%MudType = item%MudType | |||
!print*, 'AnnalusFluids(',i,')%MudType=', AnnalusFluids(i)%MudType | |||
!print*, '----------------------------' | |||
end do | |||
!print*, '============END-AN============' | |||
!if(associated(AnnalusMudArrayPtr)) then | |||
! !AnnalusFluidsPtr => AnnalusFluids | |||
! call AnnalusMudArrayPtr(AnnalusFluids) | |||
!end if | |||
end if | |||
end subroutine SetAnnalusFluids | |||
subroutine SetStringFluids(count, array) | |||
implicit none | |||
integer, intent(in) :: count | |||
integer :: i, offset !, startArr | |||
type(CFluid), intent(inout), target :: array(count) | |||
type(CFluid), pointer :: item | |||
data%Equipments%DownHole%StringFluidsCount = count | |||
print*, 'StringFluidsCount = ', count | |||
if(size(data%Equipments%DownHole%StringFluids) > 0) then | |||
deallocate(data%Equipments%DownHole%StringFluids) | |||
end if | |||
!startArr = 1 | |||
if(count > 0) then | |||
offset = 0; | |||
item => array(1) | |||
! | |||
!if(item%StartMd <= 0 .and. item%EndMd <= 0) then | |||
! StringFluidsCount = StringFluidsCount - 1 | |||
! count = count - 1 | |||
! offset = offset + 1 | |||
! startArr = startArr + 1 | |||
!endif | |||
! | |||
!if(count <= 0) return | |||
if(item%StartMd > 0) then | |||
data%Equipments%DownHole%StringFluidsCount = data%Equipments%DownHole%StringFluidsCount + 1 | |||
offset = offset + 1 | |||
allocate(data%Equipments%DownHole%StringFluids(data%Equipments%DownHole%StringFluidsCount)) | |||
data%Equipments%DownHole%StringFluids(1)%StartMd = 0 | |||
data%Equipments%DownHole%StringFluids(1)%EndMd = item%StartMd | |||
data%Equipments%DownHole%StringFluids(1)%Density = 0 | |||
data%Equipments%DownHole%StringFluids(1)%MudType = FLUID_NO_MUD | |||
endif | |||
!if(associated(StringMudCountPtr)) then | |||
! call StringMudCountPtr(count) | |||
!end if | |||
if(.not.allocated(data%Equipments%DownHole%StringFluids))allocate(data%Equipments%DownHole%StringFluids(data%Equipments%DownHole%StringFluidsCount)) | |||
!print*, '============START-ST============' | |||
!print*, 'count=', count | |||
do i = 1, count | |||
item => array(i) | |||
data%Equipments%DownHole%StringFluids(i + offset)%StartMd = item%StartMd | |||
if(i==1) data%Equipments%DownHole%StringFluids(i)%StartMd = 0 | |||
!print*, 'StringFluids(i)%StartMd=', StringFluids(i)%StartMd | |||
data%Equipments%DownHole%StringFluids(i + offset)%EndMd = item%EndMd | |||
!print*, 'StringFluids(i)%EndMd=', StringFluids(i)%EndMd | |||
data%Equipments%DownHole%StringFluids(i + offset)%Density = item%Density | |||
data%Equipments%DownHole%StringFluids(i + offset)%MudType = item%MudType | |||
!print*, '----------------------------' | |||
end do | |||
!!if(item%StartMd < 0) StringFluids(1)%StartMd = 0 | |||
!!print*, '============END-ST============' | |||
!if(associated(StringMudArrayPtr)) then | |||
! call StringMudArrayPtr(StringFluids) | |||
!end if | |||
end if | |||
end subroutine SetStringFluids | |||
subroutine SetString(count, array) | |||
use CLog3 | |||
implicit none | |||
integer, intent(in) :: count | |||
integer :: i !, j | |||
type(CStringComponents), intent(inout), target :: array(count) | |||
type(CStringComponents), pointer :: item | |||
data%Equipments%DownHole%StringCount = count | |||
if(size(data%Equipments%DownHole%String) > 0) then | |||
deallocate(data%Equipments%DownHole%String) | |||
end if | |||
if(count > 0) then | |||
!if(associated(StringComponentCountPtr)) then | |||
! call StringComponentCountPtr(count) | |||
!end if | |||
allocate(data%Equipments%DownHole%String(count)) | |||
!j = 0 | |||
!print*, '============CMP-ST============' | |||
!call Log_3( '============CMP-ST============') | |||
!do i = count, 1, -1 | |||
do i = 1, count | |||
item => array(i) | |||
!String(i)%Length = item%Length | |||
!String(i)%TopDepth = item%TopDepth | |||
!String(i)%DownDepth = item%DownDepth | |||
!String(i)%Od = item%Od | |||
!String(i)%Id = item%Id | |||
data%Equipments%DownHole%String(i)%ComponentType= item%ComponentType | |||
!j = j + 1 | |||
data%Equipments%DownHole%String(i)%StartMd = item%TopDepth | |||
data%Equipments%DownHole%String(i)%EndMd = item%DownDepth | |||
data%Equipments%DownHole%String(i)%ComponentType=0 | |||
!if(item%ComponentType > 4 ) then | |||
! String(i)%ComponentType=0 | |||
! String(i)%StartMd = 0 | |||
!endif | |||
if(item%ComponentType == 3) data%Equipments%DownHole%String(i)%ComponentType=0 | |||
if(item%ComponentType == 4) data%Equipments%DownHole%String(i)%ComponentType=1 | |||
if(item%ComponentType == 2) data%Equipments%DownHole%String(i)%ComponentType=2 | |||
if(item%ComponentType == 1) data%Equipments%DownHole%String(i)%ComponentType=3 | |||
!print*, 'item%ComponentType=', item%ComponentType | |||
!print*, 'String(i)%ComponentType=', String(i)%ComponentType | |||
!print*, 'String(i)%StartMd=', String(i)%StartMd | |||
!print*, 'String(i)%EndMd=', String(i)%EndMd | |||
!print*, '----------------------------' | |||
!call Log_3( 'item%ComponentType=', item%ComponentType) | |||
!call Log_3( 'String(i)%ComponentType=', String(i)%ComponentType) | |||
!call Log_3( 'String(i)%StartMd=', String(i)%StartMd) | |||
!call Log_3( 'String(i)%EndMd=', String(i)%EndMd) | |||
!call Log_3( '----------------------------') | |||
end do | |||
!!print*, '============CMP-ST============' | |||
!!call Log_3( '============CMP-ST============') | |||
!if(associated(StringComponentArrayPtr)) then | |||
! call StringComponentArrayPtr(String) | |||
!end if | |||
end if | |||
end subroutine SetString | |||
subroutine SetBopElements(array) | |||
use CLog4 | |||
implicit none | |||
integer, parameter :: count = 4 | |||
integer :: i = 1 !, j | |||
type(CBopElement), intent(inout), target :: array(count) | |||
type(CBopElement), pointer :: item | |||
if(size(data%Equipments%DownHole%BopElements) > 0) deallocate(data%Equipments%DownHole%BopElements) | |||
allocate(data%Equipments%DownHole%BopElements(count)) | |||
do i = 1, count | |||
item => array(i) | |||
!call Log_4('item%ElementStart', item%ElementStart) | |||
!call Log_4('item%ElementEnd', item%ElementEnd) | |||
!call Log_4('item%ElementType', item%ElementType) | |||
!call Log_4('=====================================================') | |||
data%Equipments%DownHole%BopElements(i)%ElementStart = item%ElementStart | |||
data%Equipments%DownHole%BopElements(i)%ElementEnd = item%ElementEnd | |||
data%Equipments%DownHole%BopElements(i)%ElementType = item%ElementType | |||
end do | |||
!if(associated(BopElementsPtr)) call BopElementsPtr(BopElements) | |||
end subroutine SetBopElements | |||
end module DownHoleModule |
@@ -5,6 +5,75 @@ module CBopControlPanel | |||
public | |||
contains | |||
subroutine BopControlPanelFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
call json%get(parent,'BopControl',p) | |||
call json%get(p,'AnnularRegulatorSetControl',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%AnnularRegulatorSetControl) | |||
call json%get(p,'AirMasterValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%AirMasterValve) | |||
call json%get(p,'ByePassValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%ByePassValve) | |||
call json%get(p,'AnnularValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%AnnularValve) | |||
call json%get(p,'UpperRamsValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%UpperRamsValve) | |||
call json%get(p,'MiddleRamsValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsValve) | |||
call json%get(p,'KillLineValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%KillLineValve) | |||
call json%get(p,'ChokeLineValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%ChokeLineValve) | |||
call json%get(p,'LowerRamsValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%LowerRamsValve) | |||
! call json%get(p,'ManifoldPressureGauge',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%ManifoldPressureGauge) | |||
! call json%get(p,'AirSupplyPressureGauge',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AirSupplyPressureGauge) | |||
! call json%get(p,'AccumulatorPressureGauge',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AccumulatorPressureGauge) | |||
! call json%get(p,'AnnularPressureGauge',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AnnularPressureGauge) | |||
! call json%get(p,'AnnularOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AnnularOpenLED) | |||
! call json%get(p,'AnnularCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AnnularCloseLED) | |||
! call json%get(p,'UpperRamsOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsOpenLED) | |||
! call json%get(p,'UpperRamsCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsCloseLED) | |||
! call json%get(p,'MiddleRamsOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsOpenLED) | |||
! call json%get(p,'MiddleRamsCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsCloseLED) | |||
! call json%get(p,'KillLineOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%KillLineOpenLED) | |||
! call json%get(p,'KillLineCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%KillLineCloseLED) | |||
! call json%get(p,'ChokeLineOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%ChokeLineOpenLED) | |||
! call json%get(p,'ChokeLineCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%ChokeLineCloseLED) | |||
! call json%get(p,'LowerRamsOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsOpenLED) | |||
! call json%get(p,'LowerRamsCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsCloseLED) | |||
! call json%get(p,'AnnularStatus',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AnnularStatus) | |||
! call json%get(p,'UpperRamsStatus',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsStatus) | |||
! call json%get(p,'MiddleRamsStatus',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsStatus) | |||
! call json%get(p,'LowerRamsStatus',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsStatus) | |||
! 2. get member of data type from node | |||
end subroutine | |||
subroutine BopControlPanelToJson(parent) | |||
type(json_value),pointer :: parent | |||
@@ -14,36 +83,35 @@ module CBopControlPanel | |||
! 1. create new node | |||
call json%create_object(p,'BopControl') | |||
call json%add(p,"AnnularRegulatorSetControl",data%EquipmentControl%BopControlPanel%AnnularRegulatorSetControl) | |||
call json%add(p,"AirMasterValve",data%EquipmentControl%BopControlPanel%AirMasterValve) | |||
call json%add(p,"ByePassValve",data%EquipmentControl%BopControlPanel%ByePassValve) | |||
call json%add(p,"AnnularValve",data%EquipmentControl%BopControlPanel%AnnularValve) | |||
call json%add(p,"UpperRamsValve",data%EquipmentControl%BopControlPanel%UpperRamsValve) | |||
call json%add(p,"MiddleRamsValve",data%EquipmentControl%BopControlPanel%MiddleRamsValve) | |||
call json%add(p,"KillLineValve",data%EquipmentControl%BopControlPanel%KillLineValve) | |||
call json%add(p,"ChokeLineValve",data%EquipmentControl%BopControlPanel%ChokeLineValve) | |||
call json%add(p,"LowerRamsValve",data%EquipmentControl%BopControlPanel%LowerRamsValve) | |||
call json%add(p,"ManifoldPressureGauge",data%EquipmentControl%BopControlPanel%ManifoldPressureGauge) | |||
call json%add(p,"AirSupplyPressureGauge",data%EquipmentControl%BopControlPanel%AirSupplyPressureGauge) | |||
call json%add(p,"AccumulatorPressureGauge",data%EquipmentControl%BopControlPanel%AccumulatorPressureGauge) | |||
call json%add(p,"AnnularPressureGauge",data%EquipmentControl%BopControlPanel%AnnularPressureGauge) | |||
call json%add(p,"AnnularOpenLED",data%EquipmentControl%BopControlPanel%AnnularOpenLED) | |||
call json%add(p,"AnnularCloseLED",data%EquipmentControl%BopControlPanel%AnnularCloseLED) | |||
call json%add(p,"UpperRamsOpenLED",data%EquipmentControl%BopControlPanel%UpperRamsOpenLED) | |||
call json%add(p,"UpperRamsCloseLED",data%EquipmentControl%BopControlPanel%UpperRamsCloseLED) | |||
call json%add(p,"MiddleRamsOpenLED",data%EquipmentControl%BopControlPanel%MiddleRamsOpenLED) | |||
call json%add(p,"MiddleRamsCloseLED",data%EquipmentControl%BopControlPanel%MiddleRamsCloseLED) | |||
call json%add(p,"KillLineOpenLED",data%EquipmentControl%BopControlPanel%KillLineOpenLED) | |||
call json%add(p,"KillLineCloseLED",data%EquipmentControl%BopControlPanel%KillLineCloseLED) | |||
call json%add(p,"ChokeLineOpenLED",data%EquipmentControl%BopControlPanel%ChokeLineOpenLED) | |||
call json%add(p,"ChokeLineCloseLED",data%EquipmentControl%BopControlPanel%ChokeLineCloseLED) | |||
call json%add(p,"LowerRamsOpenLED",data%EquipmentControl%BopControlPanel%LowerRamsOpenLED) | |||
call json%add(p,"LowerRamsCloseLED",data%EquipmentControl%BopControlPanel%LowerRamsCloseLED) | |||
call json%add(p,"AnnularStatus",data%EquipmentControl%BopControlPanel%AnnularStatus) | |||
call json%add(p,"UpperRamsStatus",data%EquipmentControl%BopControlPanel%UpperRamsStatus) | |||
call json%add(p,"MiddleRamsStatus",data%EquipmentControl%BopControlPanel%MiddleRamsStatus) | |||
call json%add(p,"LowerRamsStatus",data%EquipmentControl%BopControlPanel%LowerRamsStatus) | |||
! call json%add(p,"AnnularRegulatorSetControl",data%Equipments%BopControlPanel%AnnularRegulatorSetControl) | |||
! call json%add(p,"AirMasterValve",data%Equipments%BopControlPanel%AirMasterValve) | |||
! call json%add(p,"ByePassValve",data%Equipments%BopControlPanel%ByePassValve) | |||
! call json%add(p,"AnnularValve",data%Equipments%BopControlPanel%AnnularValve) | |||
! call json%add(p,"UpperRamsValve",data%Equipments%BopControlPanel%UpperRamsValve) | |||
! call json%add(p,"MiddleRamsValve",data%Equipments%BopControlPanel%MiddleRamsValve) | |||
! call json%add(p,"KillLineValve",data%Equipments%BopControlPanel%KillLineValve) | |||
! call json%add(p,"ChokeLineValve",data%Equipments%BopControlPanel%ChokeLineValve) | |||
! call json%add(p,"LowerRamsValve",data%Equipments%BopControlPanel%LowerRamsValve) | |||
call json%add(p,"ManifoldPressureGauge",data%Equipments%BopControlPanel%ManifoldPressureGauge) | |||
call json%add(p,"AirSupplyPressureGauge",data%Equipments%BopControlPanel%AirSupplyPressureGauge) | |||
call json%add(p,"AccumulatorPressureGauge",data%Equipments%BopControlPanel%AccumulatorPressureGauge) | |||
call json%add(p,"AnnularPressureGauge",data%Equipments%BopControlPanel%AnnularPressureGauge) | |||
call json%add(p,"AnnularOpenLED",data%Equipments%BopControlPanel%AnnularOpenLED) | |||
call json%add(p,"AnnularCloseLED",data%Equipments%BopControlPanel%AnnularCloseLED) | |||
call json%add(p,"UpperRamsOpenLED",data%Equipments%BopControlPanel%UpperRamsOpenLED) | |||
call json%add(p,"UpperRamsCloseLED",data%Equipments%BopControlPanel%UpperRamsCloseLED) | |||
call json%add(p,"MiddleRamsOpenLED",data%Equipments%BopControlPanel%MiddleRamsOpenLED) | |||
call json%add(p,"MiddleRamsCloseLED",data%Equipments%BopControlPanel%MiddleRamsCloseLED) | |||
call json%add(p,"KillLineOpenLED",data%Equipments%BopControlPanel%KillLineOpenLED) | |||
call json%add(p,"KillLineCloseLED",data%Equipments%BopControlPanel%KillLineCloseLED) | |||
call json%add(p,"ChokeLineOpenLED",data%Equipments%BopControlPanel%ChokeLineOpenLED) | |||
call json%add(p,"ChokeLineCloseLED",data%Equipments%BopControlPanel%ChokeLineCloseLED) | |||
call json%add(p,"LowerRamsOpenLED",data%Equipments%BopControlPanel%LowerRamsOpenLED) | |||
call json%add(p,"LowerRamsCloseLED",data%Equipments%BopControlPanel%LowerRamsCloseLED) | |||
call json%add(p,"AnnularStatus",data%Equipments%BopControlPanel%AnnularStatus) | |||
call json%add(p,"UpperRamsStatus",data%Equipments%BopControlPanel%UpperRamsStatus) | |||
call json%add(p,"MiddleRamsStatus",data%Equipments%BopControlPanel%MiddleRamsStatus) | |||
call json%add(p,"LowerRamsStatus",data%Equipments%BopControlPanel%LowerRamsStatus) | |||
call json%add(parent,p) | |||
end subroutine | |||
@@ -0,0 +1,198 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CBopControlPanel.f90" | |||
module CBopControlPanel | |||
! use CBopControlPanel | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
subroutine BopControlPanelFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
call json%get(parent,'BopControl',p) | |||
call json%get(p,'AnnularRegulatorSetControl',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%AnnularRegulatorSetControl) | |||
call json%get(p,'AirMasterValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%AirMasterValve) | |||
call json%get(p,'ByePassValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%ByePassValve) | |||
call json%get(p,'AnnularValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%AnnularValve) | |||
call json%get(p,'UpperRamsValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%UpperRamsValve) | |||
call json%get(p,'MiddleRamsValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsValve) | |||
call json%get(p,'KillLineValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%KillLineValve) | |||
call json%get(p,'ChokeLineValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%ChokeLineValve) | |||
call json%get(p,'LowerRamsValve',pval) | |||
call json%get(pval,data%Equipments%BopControlPanel%LowerRamsValve) | |||
! call json%get(p,'ManifoldPressureGauge',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%ManifoldPressureGauge) | |||
! call json%get(p,'AirSupplyPressureGauge',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AirSupplyPressureGauge) | |||
! call json%get(p,'AccumulatorPressureGauge',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AccumulatorPressureGauge) | |||
! call json%get(p,'AnnularPressureGauge',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AnnularPressureGauge) | |||
! call json%get(p,'AnnularOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AnnularOpenLED) | |||
! call json%get(p,'AnnularCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AnnularCloseLED) | |||
! call json%get(p,'UpperRamsOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsOpenLED) | |||
! call json%get(p,'UpperRamsCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsCloseLED) | |||
! call json%get(p,'MiddleRamsOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsOpenLED) | |||
! call json%get(p,'MiddleRamsCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsCloseLED) | |||
! call json%get(p,'KillLineOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%KillLineOpenLED) | |||
! call json%get(p,'KillLineCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%KillLineCloseLED) | |||
! call json%get(p,'ChokeLineOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%ChokeLineOpenLED) | |||
! call json%get(p,'ChokeLineCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%ChokeLineCloseLED) | |||
! call json%get(p,'LowerRamsOpenLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsOpenLED) | |||
! call json%get(p,'LowerRamsCloseLED',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsCloseLED) | |||
! call json%get(p,'AnnularStatus',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%AnnularStatus) | |||
! call json%get(p,'UpperRamsStatus',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%UpperRamsStatus) | |||
! call json%get(p,'MiddleRamsStatus',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsStatus) | |||
! call json%get(p,'LowerRamsStatus',pval) | |||
! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsStatus) | |||
! 2. get member of data type from node | |||
end subroutine | |||
subroutine BopControlPanelToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'BopControl') | |||
! call json%add(p,"AnnularRegulatorSetControl",data%Equipments%BopControlPanel%AnnularRegulatorSetControl) | |||
! call json%add(p,"AirMasterValve",data%Equipments%BopControlPanel%AirMasterValve) | |||
! call json%add(p,"ByePassValve",data%Equipments%BopControlPanel%ByePassValve) | |||
! call json%add(p,"AnnularValve",data%Equipments%BopControlPanel%AnnularValve) | |||
! call json%add(p,"UpperRamsValve",data%Equipments%BopControlPanel%UpperRamsValve) | |||
! call json%add(p,"MiddleRamsValve",data%Equipments%BopControlPanel%MiddleRamsValve) | |||
! call json%add(p,"KillLineValve",data%Equipments%BopControlPanel%KillLineValve) | |||
! call json%add(p,"ChokeLineValve",data%Equipments%BopControlPanel%ChokeLineValve) | |||
! call json%add(p,"LowerRamsValve",data%Equipments%BopControlPanel%LowerRamsValve) | |||
call json%add(p,"ManifoldPressureGauge",data%Equipments%BopControlPanel%ManifoldPressureGauge) | |||
call json%add(p,"AirSupplyPressureGauge",data%Equipments%BopControlPanel%AirSupplyPressureGauge) | |||
call json%add(p,"AccumulatorPressureGauge",data%Equipments%BopControlPanel%AccumulatorPressureGauge) | |||
call json%add(p,"AnnularPressureGauge",data%Equipments%BopControlPanel%AnnularPressureGauge) | |||
call json%add(p,"AnnularOpenLED",data%Equipments%BopControlPanel%AnnularOpenLED) | |||
call json%add(p,"AnnularCloseLED",data%Equipments%BopControlPanel%AnnularCloseLED) | |||
call json%add(p,"UpperRamsOpenLED",data%Equipments%BopControlPanel%UpperRamsOpenLED) | |||
call json%add(p,"UpperRamsCloseLED",data%Equipments%BopControlPanel%UpperRamsCloseLED) | |||
call json%add(p,"MiddleRamsOpenLED",data%Equipments%BopControlPanel%MiddleRamsOpenLED) | |||
call json%add(p,"MiddleRamsCloseLED",data%Equipments%BopControlPanel%MiddleRamsCloseLED) | |||
call json%add(p,"KillLineOpenLED",data%Equipments%BopControlPanel%KillLineOpenLED) | |||
call json%add(p,"KillLineCloseLED",data%Equipments%BopControlPanel%KillLineCloseLED) | |||
call json%add(p,"ChokeLineOpenLED",data%Equipments%BopControlPanel%ChokeLineOpenLED) | |||
call json%add(p,"ChokeLineCloseLED",data%Equipments%BopControlPanel%ChokeLineCloseLED) | |||
call json%add(p,"LowerRamsOpenLED",data%Equipments%BopControlPanel%LowerRamsOpenLED) | |||
call json%add(p,"LowerRamsCloseLED",data%Equipments%BopControlPanel%LowerRamsCloseLED) | |||
call json%add(p,"AnnularStatus",data%Equipments%BopControlPanel%AnnularStatus) | |||
call json%add(p,"UpperRamsStatus",data%Equipments%BopControlPanel%UpperRamsStatus) | |||
call json%add(p,"MiddleRamsStatus",data%Equipments%BopControlPanel%MiddleRamsStatus) | |||
call json%add(p,"LowerRamsStatus",data%Equipments%BopControlPanel%LowerRamsStatus) | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine OpenAnnular() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(52, .true.) | |||
end subroutine | |||
subroutine CloseAnnular() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(52, .false.) | |||
end subroutine | |||
subroutine OpenUpperRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(51, .true.) | |||
end subroutine | |||
subroutine CloseUpperRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(51, .false.) | |||
end subroutine | |||
subroutine OpenMiddleRams() | |||
use CManifolds | |||
implicit none | |||
call ToggleMiddleRams(.true.) | |||
end subroutine | |||
subroutine CloseMiddleRams() | |||
use CManifolds | |||
implicit none | |||
call ToggleMiddleRams(.false.) | |||
end subroutine | |||
subroutine OpenKillLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(46, .true.) | |||
end subroutine | |||
subroutine CloseKillLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(46, .false.) | |||
end subroutine | |||
subroutine OpenChokeLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(47, .true.) | |||
!WRITE (*,*) ' valve 47 true ' | |||
end subroutine | |||
subroutine CloseChokeLine() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(47, .false.) | |||
!WRITE (*,*) ' valve 47 false ' | |||
end subroutine | |||
subroutine OpenLowerRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(49, .true.) | |||
!WRITE (*,*) ' valve 49 true ' | |||
end subroutine | |||
subroutine CloseLowerRams() | |||
use CManifolds | |||
implicit none | |||
call ChangeValve(49, .false.) | |||
!WRITE (*,*) ' valve 49 false ' | |||
end subroutine | |||
end module CBopControlPanel |
@@ -0,0 +1,41 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CBopControlPanelVariables.f90" | |||
module CBopControlPanelVariables | |||
implicit none | |||
public | |||
Type, Public:: BopControlPanelType | |||
! Input vars | |||
real(8) :: AnnularRegulatorSetControl | |||
real(8) :: AirMasterValve | |||
real(8) :: ByePassValve | |||
real(8) :: AnnularValve | |||
real(8) :: UpperRamsValve | |||
real(8) :: MiddleRamsValve | |||
real(8) :: KillLineValve | |||
real(8) :: ChokeLineValve | |||
real(8) :: LowerRamsValve | |||
! Output vars | |||
real(8) :: ManifoldPressureGauge | |||
real(8) :: AirSupplyPressureGauge | |||
real(8) :: AccumulatorPressureGauge | |||
real(8) :: AnnularPressureGauge | |||
integer :: AnnularOpenLED | |||
integer :: AnnularCloseLED | |||
integer :: UpperRamsOpenLED | |||
integer :: UpperRamsCloseLED | |||
integer :: MiddleRamsOpenLED | |||
integer :: MiddleRamsCloseLED | |||
integer :: KillLineOpenLED | |||
integer :: KillLineCloseLED | |||
integer :: ChokeLineOpenLED | |||
integer :: ChokeLineCloseLED | |||
integer :: LowerRamsOpenLED | |||
integer :: LowerRamsCloseLED | |||
real(8) :: AnnularStatus | |||
real(8) :: UpperRamsStatus | |||
real(8) :: MiddleRamsStatus | |||
real(8) :: LowerRamsStatus | |||
end type | |||
contains | |||
end module CBopControlPanelVariables |
@@ -3,7 +3,45 @@ module CChokeControlPanel | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
contains | |||
subroutine ChokeControlPanelFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
call json%get(parent,'ChokeControl',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'ChokePanelPumpSelectorSwitch',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch) | |||
call json%get(p,'ChokePanelStrokeResetSwitch',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch) | |||
call json%get(p,'ChokeSelectorSwitch',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokeSelectorSwitch) | |||
call json%get(p,'ChokeRateControlKnob',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokeRateControlKnob) | |||
call json%get(p,'ChokeControlLever',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokeControlLever) | |||
call json%get(p,'ChokePanelRigAirSwitch',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch) | |||
! call json%get(p,'EnableAutoChoke',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%EnableAutoChoke) | |||
! call json%get(p,'StandPipePressure',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%StandPipePressure) | |||
! call json%get(p,'CasingPressure',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%CasingPressure) | |||
! call json%get(p,'ChokePosition',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePosition) | |||
! call json%get(p,'ChokePanelSPMCounter',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelSPMCounter) | |||
! call json%get(p,'ChokePanelTotalStrokeCounter',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelTotalStrokeCounter) | |||
! call json%get(p,'Choke1LED',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%Choke1LED) | |||
! call json%get(p,'Choke2LED',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%Choke2LED) | |||
end subroutine | |||
subroutine ChokeControlPanelToJson(parent) | |||
@@ -13,20 +51,20 @@ module CChokeControlPanel | |||
! 1. create new node | |||
call json%create_object(p,'ChokeControl') | |||
call json%add(p,"ChokePanelPumpSelectorSwitch",data%EquipmentControl%ChokeControlPanel%ChokePanelPumpSelectorSwitch) | |||
call json%add(p,"ChokePanelStrokeResetSwitch",data%EquipmentControl%ChokeControlPanel%ChokePanelStrokeResetSwitch) | |||
call json%add(p,"ChokeSelectorSwitch",data%EquipmentControl%ChokeControlPanel%ChokeSelectorSwitch) | |||
call json%add(p,"ChokeRateControlKnob",data%EquipmentControl%ChokeControlPanel%ChokeRateControlKnob) | |||
call json%add(p,"ChokeControlLever",data%EquipmentControl%ChokeControlPanel%ChokeControlLever) | |||
call json%add(p,"ChokePanelRigAirSwitch",data%EquipmentControl%ChokeControlPanel%ChokePanelRigAirSwitch) | |||
call json%add(p,"EnableAutoChoke",data%EquipmentControl%ChokeControlPanel%EnableAutoChoke) | |||
call json%add(p,"StandPipePressure",data%EquipmentControl%ChokeControlPanel%StandPipePressure) | |||
call json%add(p,"CasingPressure",data%EquipmentControl%ChokeControlPanel%CasingPressure) | |||
call json%add(p,"ChokePosition",data%EquipmentControl%ChokeControlPanel%ChokePosition) | |||
call json%add(p,"ChokePanelSPMCounter",data%EquipmentControl%ChokeControlPanel%ChokePanelSPMCounter) | |||
call json%add(p,"ChokePanelTotalStrokeCounter",data%EquipmentControl%ChokeControlPanel%ChokePanelTotalStrokeCounter) | |||
call json%add(p,"Choke1LED",data%EquipmentControl%ChokeControlPanel%Choke1LED) | |||
call json%add(p,"Choke2LED",data%EquipmentControl%ChokeControlPanel%Choke2LED) | |||
! call json%add(p,"ChokePanelPumpSelectorSwitch",data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch) | |||
! call json%add(p,"ChokePanelStrokeResetSwitch",data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch) | |||
! call json%add(p,"ChokeSelectorSwitch",data%Equipments%ChokeControlPanel%ChokeSelectorSwitch) | |||
! call json%add(p,"ChokeRateControlKnob",data%Equipments%ChokeControlPanel%ChokeRateControlKnob) | |||
! call json%add(p,"ChokeControlLever",data%Equipments%ChokeControlPanel%ChokeControlLever) | |||
! call json%add(p,"ChokePanelRigAirSwitch",data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch) | |||
! call json%add(p,"EnableAutoChoke",data%Equipments%ChokeControlPanel%EnableAutoChoke) | |||
call json%add(p,"StandPipePressure",data%Equipments%ChokeControlPanel%StandPipePressure) | |||
call json%add(p,"CasingPressure",data%Equipments%ChokeControlPanel%CasingPressure) | |||
call json%add(p,"ChokePosition",data%Equipments%ChokeControlPanel%ChokePosition) | |||
call json%add(p,"ChokePanelSPMCounter",data%Equipments%ChokeControlPanel%ChokePanelSPMCounter) | |||
call json%add(p,"ChokePanelTotalStrokeCounter",data%Equipments%ChokeControlPanel%ChokePanelTotalStrokeCounter) | |||
call json%add(p,"Choke1LED",data%Equipments%ChokeControlPanel%Choke1LED) | |||
call json%add(p,"Choke2LED",data%Equipments%ChokeControlPanel%Choke2LED) | |||
call json%add(parent,p) | |||
@@ -0,0 +1,74 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CChokeControlPanel.f90" | |||
module CChokeControlPanel | |||
use CChokeControlPanelVariables | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
subroutine ChokeControlPanelFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
call json%get(parent,'ChokeControl',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'ChokePanelPumpSelectorSwitch',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch) | |||
call json%get(p,'ChokePanelStrokeResetSwitch',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch) | |||
call json%get(p,'ChokeSelectorSwitch',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokeSelectorSwitch) | |||
call json%get(p,'ChokeRateControlKnob',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokeRateControlKnob) | |||
call json%get(p,'ChokeControlLever',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokeControlLever) | |||
call json%get(p,'ChokePanelRigAirSwitch',pval) | |||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch) | |||
! call json%get(p,'EnableAutoChoke',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%EnableAutoChoke) | |||
! call json%get(p,'StandPipePressure',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%StandPipePressure) | |||
! call json%get(p,'CasingPressure',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%CasingPressure) | |||
! call json%get(p,'ChokePosition',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePosition) | |||
! call json%get(p,'ChokePanelSPMCounter',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelSPMCounter) | |||
! call json%get(p,'ChokePanelTotalStrokeCounter',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelTotalStrokeCounter) | |||
! call json%get(p,'Choke1LED',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%Choke1LED) | |||
! call json%get(p,'Choke2LED',pval) | |||
! call json%get(pval,data%Equipments%ChokeControlPanel%Choke2LED) | |||
end subroutine | |||
subroutine ChokeControlPanelToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'ChokeControl') | |||
! call json%add(p,"ChokePanelPumpSelectorSwitch",data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch) | |||
! call json%add(p,"ChokePanelStrokeResetSwitch",data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch) | |||
! call json%add(p,"ChokeSelectorSwitch",data%Equipments%ChokeControlPanel%ChokeSelectorSwitch) | |||
! call json%add(p,"ChokeRateControlKnob",data%Equipments%ChokeControlPanel%ChokeRateControlKnob) | |||
! call json%add(p,"ChokeControlLever",data%Equipments%ChokeControlPanel%ChokeControlLever) | |||
! call json%add(p,"ChokePanelRigAirSwitch",data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch) | |||
! call json%add(p,"EnableAutoChoke",data%Equipments%ChokeControlPanel%EnableAutoChoke) | |||
call json%add(p,"StandPipePressure",data%Equipments%ChokeControlPanel%StandPipePressure) | |||
call json%add(p,"CasingPressure",data%Equipments%ChokeControlPanel%CasingPressure) | |||
call json%add(p,"ChokePosition",data%Equipments%ChokeControlPanel%ChokePosition) | |||
call json%add(p,"ChokePanelSPMCounter",data%Equipments%ChokeControlPanel%ChokePanelSPMCounter) | |||
call json%add(p,"ChokePanelTotalStrokeCounter",data%Equipments%ChokeControlPanel%ChokePanelTotalStrokeCounter) | |||
call json%add(p,"Choke1LED",data%Equipments%ChokeControlPanel%Choke1LED) | |||
call json%add(p,"Choke2LED",data%Equipments%ChokeControlPanel%Choke2LED) | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CChokeControlPanel |
@@ -9,7 +9,7 @@ module CChokeControlPanelVariables | |||
real(8) :: ChokeControlLever | |||
logical :: ChokePanelRigAirSwitch | |||
logical :: EnableAutoChoke | |||
! logical :: EnableAutoChoke | |||
! Output vars | |||
real(8) :: StandPipePressure | |||
@@ -0,0 +1,24 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CChokeControlPanelVariables.f90" | |||
module CChokeControlPanelVariables | |||
implicit none | |||
type, public :: ChokeControlPanelType | |||
! Input vars | |||
integer :: ChokePanelPumpSelectorSwitch | |||
logical :: ChokePanelStrokeResetSwitch | |||
logical :: ChokeSelectorSwitch | |||
real(8) :: ChokeRateControlKnob | |||
real(8) :: ChokeControlLever | |||
logical :: ChokePanelRigAirSwitch | |||
! logical :: EnableAutoChoke | |||
! Output vars | |||
real(8) :: StandPipePressure | |||
real(8) :: CasingPressure | |||
real(8) :: ChokePosition | |||
real(8) :: ChokePanelSPMCounter | |||
real(8) :: ChokePanelTotalStrokeCounter | |||
integer :: Choke1LED | |||
integer :: Choke2LED | |||
End Type ChokeControlPanelType | |||
end module CChokeControlPanelVariables |
@@ -7,6 +7,55 @@ module CChokeManifold | |||
public | |||
contains | |||
subroutine ChokeManifoldFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
call json%get(parent,'ChokeManifold',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'ChokeManifoldValve1',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve1) | |||
call json%get(p,'ChokeManifoldValve2',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve2) | |||
call json%get(p,'LeftManualChoke',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%LeftManualChoke) | |||
call json%get(p,'ChokeManifoldValve4',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve4) | |||
call json%get(p,'ChokeManifoldValve5',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve5) | |||
call json%get(p,'RightManualChoke',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%RightManualChoke) | |||
call json%get(p,'ChokeManifoldValve7',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve7) | |||
call json%get(p,'ChokeManifoldValve8',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve8) | |||
call json%get(p,'ChokeManifoldValve9',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve9) | |||
call json%get(p,'ChokeManifoldValve10',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve10) | |||
call json%get(p,'ChokeManifoldValve11',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve11) | |||
call json%get(p,'ChokeManifoldValve12',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve12) | |||
call json%get(p,'ChokeManifoldValve13',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve13) | |||
! call json%get(p,'HydraulicChock1',pval) | |||
! call json%get(pval,data%Equipments%ChokeManifold%HydraulicChock1) | |||
! call json%get(p,'HydraulicChock2',pval) | |||
! call json%get(pval,data%Equipments%ChokeManifold%HydraulicChock2) | |||
call json%get(p,'HyChock1OnProblem',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%HyChock1OnProblem) | |||
call json%get(p,'HyChock2OnProblem',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%HyChock2OnProblem) | |||
call json%get(p,'LeftManChokeOnProblem',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%LeftManChokeOnProblem) | |||
call json%get(p,'RightManChokeOnProblem',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%RightManChokeOnProblem) | |||
end subroutine | |||
subroutine ChokeManifoldToJson(parent) | |||
type(json_value),pointer :: parent | |||
@@ -15,25 +64,26 @@ module CChokeManifold | |||
! 1. create new node | |||
call json%create_object(p,'ChokeManifold') | |||
call json%add(p,"ChokeManifoldValve1",data%EquipmentControl%ChokeManifold%ChokeManifoldValve1) | |||
call json%add(p,"ChokeManifoldValve2",data%EquipmentControl%ChokeManifold%ChokeManifoldValve2) | |||
call json%add(p,"LeftManualChoke",data%EquipmentControl%ChokeManifold%LeftManualChoke) | |||
call json%add(p,"ChokeManifoldValve4",data%EquipmentControl%ChokeManifold%ChokeManifoldValve4) | |||
call json%add(p,"ChokeManifoldValve5",data%EquipmentControl%ChokeManifold%ChokeManifoldValve5) | |||
call json%add(p,"RightManualChoke",data%EquipmentControl%ChokeManifold%RightManualChoke) | |||
call json%add(p,"ChokeManifoldValve7",data%EquipmentControl%ChokeManifold%ChokeManifoldValve7) | |||
call json%add(p,"ChokeManifoldValve8",data%EquipmentControl%ChokeManifold%ChokeManifoldValve8) | |||
call json%add(p,"ChokeManifoldValve9",data%EquipmentControl%ChokeManifold%ChokeManifoldValve9) | |||
call json%add(p,"ChokeManifoldValve10",data%EquipmentControl%ChokeManifold%ChokeManifoldValve10) | |||
call json%add(p,"ChokeManifoldValve11",data%EquipmentControl%ChokeManifold%ChokeManifoldValve11) | |||
call json%add(p,"ChokeManifoldValve12",data%EquipmentControl%ChokeManifold%ChokeManifoldValve12) | |||
call json%add(p,"ChokeManifoldValve13",data%EquipmentControl%ChokeManifold%ChokeManifoldValve13) | |||
call json%add(p,"HydraulicChock1",data%EquipmentControl%ChokeManifold%HydraulicChock1) | |||
call json%add(p,"HydraulicChock2",data%EquipmentControl%ChokeManifold%HydraulicChock2) | |||
call json%add(p,"HyChock1OnProblem",data%EquipmentControl%ChokeManifold%HyChock1OnProblem) | |||
call json%add(p,"HyChock2OnProblem",data%EquipmentControl%ChokeManifold%HyChock2OnProblem) | |||
call json%add(p,"LeftManChokeOnProblem",data%EquipmentControl%ChokeManifold%LeftManChokeOnProblem) | |||
call json%add(p,"RightManChokeOnProblem",data%EquipmentControl%ChokeManifold%RightManChokeOnProblem) | |||
! call json%add(p,"ChokeManifoldValve1",data%Equipments%ChokeManifold%ChokeManifoldValve1) | |||
! call json%add(p,"ChokeManifoldValve2",data%Equipments%ChokeManifold%ChokeManifoldValve2) | |||
! call json%add(p,"LeftManualChoke",data%Equipments%ChokeManifold%LeftManualChoke) | |||
! call json%add(p,"ChokeManifoldValve4",data%Equipments%ChokeManifold%ChokeManifoldValve4) | |||
! call json%add(p,"ChokeManifoldValve5",data%Equipments%ChokeManifold%ChokeManifoldValve5) | |||
! call json%add(p,"RightManualChoke",data%Equipments%ChokeManifold%RightManualChoke) | |||
! call json%add(p,"ChokeManifoldValve7",data%Equipments%ChokeManifold%ChokeManifoldValve7) | |||
! call json%add(p,"ChokeManifoldValve8",data%Equipments%ChokeManifold%ChokeManifoldValve8) | |||
! call json%add(p,"ChokeManifoldValve9",data%Equipments%ChokeManifold%ChokeManifoldValve9) | |||
! call json%add(p,"ChokeManifoldValve10",data%Equipments%ChokeManifold%ChokeManifoldValve10) | |||
! call json%add(p,"ChokeManifoldValve11",data%Equipments%ChokeManifold%ChokeManifoldValve11) | |||
! call json%add(p,"ChokeManifoldValve12",data%Equipments%ChokeManifold%ChokeManifoldValve12) | |||
! call json%add(p,"ChokeManifoldValve13",data%Equipments%ChokeManifold%ChokeManifoldValve13) | |||
call json%add(p,"HydraulicChock1",data%Equipments%ChokeManifold%HydraulicChock1) | |||
call json%add(p,"HydraulicChock2",data%Equipments%ChokeManifold%HydraulicChock2) | |||
call json%add(p,"HyChock1OnProblem",data%Equipments%ChokeManifold%HyChock1OnProblem) | |||
call json%add(p,"HyChock2OnProblem",data%Equipments%ChokeManifold%HyChock2OnProblem) | |||
call json%add(p,"LeftManChokeOnProblem",data%Equipments%ChokeManifold%LeftManChokeOnProblem) | |||
call json%add(p,"RightManChokeOnProblem",data%Equipments%ChokeManifold%RightManChokeOnProblem) | |||
call json%add(parent,p) | |||
end subroutine | |||
@@ -41,8 +91,8 @@ module CChokeManifold | |||
subroutine SetHydraulicChock1(v) | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%ChokeManifold%HydraulicChock1 = v | |||
if(data%EquipmentControl%ChokeManifold%HyChock1OnProblem) then | |||
data%Equipments%ChokeManifold%HydraulicChock1 = v | |||
if(data%Equipments%ChokeManifold%HyChock1OnProblem) then | |||
call ChangeValve(33, .true.) | |||
else | |||
if(v == 100) then | |||
@@ -57,8 +107,8 @@ end subroutine | |||
subroutine SetHydraulicChock2(v) | |||
implicit none | |||
integer, intent(in) :: v | |||
data%EquipmentControl%ChokeManifold%HydraulicChock2 = v | |||
if(data%EquipmentControl%ChokeManifold%HyChock2OnProblem) then | |||
data%Equipments%ChokeManifold%HydraulicChock2 = v | |||
if(data%Equipments%ChokeManifold%HyChock2OnProblem) then | |||
call ChangeValve(34, .true.) | |||
else | |||
if(v==100) then | |||
@@ -0,0 +1,124 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CChokeManifold.f90" | |||
module CChokeManifold | |||
! use CChokeManifoldVariables | |||
use SimulationVariables | |||
use CManifolds | |||
use CLog2 | |||
implicit none | |||
public | |||
contains | |||
subroutine ChokeManifoldFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
call json%get(parent,'ChokeManifold',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'ChokeManifoldValve1',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve1) | |||
call json%get(p,'ChokeManifoldValve2',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve2) | |||
call json%get(p,'LeftManualChoke',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%LeftManualChoke) | |||
call json%get(p,'ChokeManifoldValve4',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve4) | |||
call json%get(p,'ChokeManifoldValve5',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve5) | |||
call json%get(p,'RightManualChoke',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%RightManualChoke) | |||
call json%get(p,'ChokeManifoldValve7',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve7) | |||
call json%get(p,'ChokeManifoldValve8',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve8) | |||
call json%get(p,'ChokeManifoldValve9',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve9) | |||
call json%get(p,'ChokeManifoldValve10',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve10) | |||
call json%get(p,'ChokeManifoldValve11',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve11) | |||
call json%get(p,'ChokeManifoldValve12',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve12) | |||
call json%get(p,'ChokeManifoldValve13',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%ChokeManifoldValve13) | |||
! call json%get(p,'HydraulicChock1',pval) | |||
! call json%get(pval,data%Equipments%ChokeManifold%HydraulicChock1) | |||
! call json%get(p,'HydraulicChock2',pval) | |||
! call json%get(pval,data%Equipments%ChokeManifold%HydraulicChock2) | |||
call json%get(p,'HyChock1OnProblem',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%HyChock1OnProblem) | |||
call json%get(p,'HyChock2OnProblem',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%HyChock2OnProblem) | |||
call json%get(p,'LeftManChokeOnProblem',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%LeftManChokeOnProblem) | |||
call json%get(p,'RightManChokeOnProblem',pval) | |||
call json%get(pval,data%Equipments%ChokeManifold%RightManChokeOnProblem) | |||
end subroutine | |||
subroutine ChokeManifoldToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'ChokeManifold') | |||
! call json%add(p,"ChokeManifoldValve1",data%Equipments%ChokeManifold%ChokeManifoldValve1) | |||
! call json%add(p,"ChokeManifoldValve2",data%Equipments%ChokeManifold%ChokeManifoldValve2) | |||
! call json%add(p,"LeftManualChoke",data%Equipments%ChokeManifold%LeftManualChoke) | |||
! call json%add(p,"ChokeManifoldValve4",data%Equipments%ChokeManifold%ChokeManifoldValve4) | |||
! call json%add(p,"ChokeManifoldValve5",data%Equipments%ChokeManifold%ChokeManifoldValve5) | |||
! call json%add(p,"RightManualChoke",data%Equipments%ChokeManifold%RightManualChoke) | |||
! call json%add(p,"ChokeManifoldValve7",data%Equipments%ChokeManifold%ChokeManifoldValve7) | |||
! call json%add(p,"ChokeManifoldValve8",data%Equipments%ChokeManifold%ChokeManifoldValve8) | |||
! call json%add(p,"ChokeManifoldValve9",data%Equipments%ChokeManifold%ChokeManifoldValve9) | |||
! call json%add(p,"ChokeManifoldValve10",data%Equipments%ChokeManifold%ChokeManifoldValve10) | |||
! call json%add(p,"ChokeManifoldValve11",data%Equipments%ChokeManifold%ChokeManifoldValve11) | |||
! call json%add(p,"ChokeManifoldValve12",data%Equipments%ChokeManifold%ChokeManifoldValve12) | |||
! call json%add(p,"ChokeManifoldValve13",data%Equipments%ChokeManifold%ChokeManifoldValve13) | |||
call json%add(p,"HydraulicChock1",data%Equipments%ChokeManifold%HydraulicChock1) | |||
call json%add(p,"HydraulicChock2",data%Equipments%ChokeManifold%HydraulicChock2) | |||
call json%add(p,"HyChock1OnProblem",data%Equipments%ChokeManifold%HyChock1OnProblem) | |||
call json%add(p,"HyChock2OnProblem",data%Equipments%ChokeManifold%HyChock2OnProblem) | |||
call json%add(p,"LeftManChokeOnProblem",data%Equipments%ChokeManifold%LeftManChokeOnProblem) | |||
call json%add(p,"RightManChokeOnProblem",data%Equipments%ChokeManifold%RightManChokeOnProblem) | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine SetHydraulicChock1(v) | |||
implicit none | |||
integer, intent(in) :: v | |||
data%Equipments%ChokeManifold%HydraulicChock1 = v | |||
if(data%Equipments%ChokeManifold%HyChock1OnProblem) then | |||
call ChangeValve(33, .true.) | |||
else | |||
if(v == 100) then | |||
if(Manifold%Valve(33)%Status) call ChangeValve(33, .false.) | |||
else | |||
if(.not.Manifold%Valve(33)%Status) call ChangeValve(33, .true.) | |||
endif | |||
endif | |||
!WRITE (*,*) ' valve 33 ', Valve(33)%Status, ' arg ', v | |||
end subroutine | |||
subroutine SetHydraulicChock2(v) | |||
implicit none | |||
integer, intent(in) :: v | |||
data%Equipments%ChokeManifold%HydraulicChock2 = v | |||
if(data%Equipments%ChokeManifold%HyChock2OnProblem) then | |||
call ChangeValve(34, .true.) | |||
else | |||
if(v==100) then | |||
if(Manifold%Valve(34)%Status) call ChangeValve(34, .false.) | |||
else | |||
if(.not.Manifold%Valve(34)%Status) call ChangeValve(34, .true.) | |||
endif | |||
endif | |||
!WRITE (*,*) ' valve 34 ', Valve(34)%Status, ' arg ', v | |||
end subroutine | |||
end module CChokeManifold |
@@ -0,0 +1,37 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CChokeManifoldVariables.f90" | |||
module CChokeManifoldVariables | |||
implicit none | |||
public | |||
Type :: ChokeManifoldType | |||
! Input vars | |||
logical :: ChokeManifoldValve1 | |||
logical :: ChokeManifoldValve2 | |||
real(8) :: LeftManualChoke | |||
logical :: ChokeManifoldValve4 | |||
logical :: ChokeManifoldValve5 | |||
real(8) :: RightManualChoke | |||
logical :: ChokeManifoldValve7 | |||
logical :: ChokeManifoldValve8 | |||
logical :: ChokeManifoldValve9 | |||
logical :: ChokeManifoldValve10 | |||
logical :: ChokeManifoldValve11 | |||
logical :: ChokeManifoldValve12 | |||
logical :: ChokeManifoldValve13 | |||
! Output vars | |||
integer :: HydraulicChock1 | |||
integer :: HydraulicChock2 | |||
! Control vars | |||
logical :: HyChock1OnProblem = .false. | |||
logical :: HyChock2OnProblem = .false. | |||
logical :: LeftManChokeOnProblem = .false. | |||
logical :: RightManChokeOnProblem = .false. | |||
End Type ChokeManifoldType | |||
contains | |||
endmodule CChokeManifoldVariables |
@@ -5,6 +5,179 @@ module CDataDisplayConsole | |||
public | |||
contains | |||
subroutine DataDisplayConsoleFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
call json%get(parent,'DataDisplay',p) | |||
! 2. get member of data type from node | |||
! call json%get(p,'TripAlarmLow',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TripAlarmLow) | |||
! call json%get(p,'TripAlarmHigh',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TripAlarmHigh) | |||
! call json%get(p,'RetFlowAlarmLow',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RetFlowAlarmLow) | |||
! call json%get(p,'RetFlowAlarmHigh',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RetFlowAlarmHigh) | |||
! call json%get(p,'PitAlarmLow',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PitAlarmLow) | |||
! call json%get(p,'PitAlarmHigh',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PitAlarmHigh) | |||
! call json%get(p,'PortWeightOnBit',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PortWeightOnBit) | |||
! call json%get(p,'PortHookLoad',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PortHookLoad) | |||
! call json%get(p,'PortCasingPressure',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PortCasingPressure) | |||
! call json%get(p,'PortPumpPressure',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PortPumpPressure) | |||
call json%get(p,'TripTankSetAlarmLow',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankSetAlarmLow) | |||
call json%get(p,'TripTankSetAlarmHigh',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankSetAlarmHigh) | |||
call json%get(p,'TripTankSetAlarmSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankSetAlarmSwitch) | |||
call json%get(p,'TripTankPowerSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankPowerSwitch) | |||
call json%get(p,'TripTankPumpSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankPumpSwitch) | |||
call json%get(p,'TripTankHornSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankHornSwitch) | |||
call json%get(p,'AcidGasDetectionHornSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%AcidGasDetectionHornSwitch) | |||
call json%get(p,'TotalStrokeCounterResetSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TotalStrokeCounterResetSwitch) | |||
call json%get(p,'DrillingTrippingSelectorSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%DrillingTrippingSelectorSwitch) | |||
call json%get(p,'MVTSetAlarmLowKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTSetAlarmLowKnob) | |||
call json%get(p,'MVTSetAlarmHighKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTSetAlarmHighKnob) | |||
call json%get(p,'MVTSetAlarmSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTSetAlarmSwitch) | |||
call json%get(p,'MudTank1Switch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MudTank1Switch) | |||
call json%get(p,'MudTank2Switch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MudTank2Switch) | |||
call json%get(p,'MudTank3Switch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MudTank3Switch) | |||
call json%get(p,'MudTank4Switch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MudTank4Switch) | |||
call json%get(p,'MVTFineKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTFineKnob) | |||
call json%get(p,'MVTCoarseKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTCoarseKnob) | |||
call json%get(p,'MVTHornSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTHornSwitch) | |||
call json%get(p,'MVTDeviationTripSelectionSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTDeviationTripSelectionSwitch) | |||
call json%get(p,'MVTPowerSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTPowerSwitch) | |||
call json%get(p,'MFFIResetTotalStrokes',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIResetTotalStrokes) | |||
call json%get(p,'MFFIResetFillCounter',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIResetFillCounter) | |||
call json%get(p,'MFFIPumpSelectorSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIPumpSelectorSwitch) | |||
call json%get(p,'MFFIFillSPMSelectorSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIFillSPMSelectorSwitch) | |||
call json%get(p,'MFFISetAlarmLowKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFISetAlarmLowKnob) | |||
call json%get(p,'MFFISetAlarmHighKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFISetAlarmHighKnob) | |||
call json%get(p,'MFFISetAlarmSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFISetAlarmSwitch) | |||
call json%get(p,'MFFIPowerSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIPowerSwitch) | |||
call json%get(p,'MFFIHornSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIHornSwitch) | |||
call json%get(p,'ResetWob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%ResetWob) | |||
call json%get(p,'Clutch',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%Clutch) | |||
! call json%get(p,'WOBPointer',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%WOBPointer) | |||
! call json%get(p,'HookLoadPointer',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%HookLoadPointer) | |||
! call json%get(p,'TripTankGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TripTankGauge) | |||
! call json%get(p,'TripTankAlarmLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TripTankAlarmLED) | |||
! call json%get(p,'TripTankPumpLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TripTankPumpLED) | |||
! call json%get(p,'StandPipePressureGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%StandPipePressureGauge) | |||
! call json%get(p,'CasingPressureGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%CasingPressureGauge) | |||
! call json%get(p,'MP1SPMGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MP1SPMGauge) | |||
! call json%get(p,'MP2SPMGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MP2SPMGauge) | |||
! call json%get(p,'ReturnLineTempGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%ReturnLineTempGauge) | |||
! call json%get(p,'RotaryTorqueGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RotaryTorqueGauge) | |||
! call json%get(p,'RotaryRPMGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RotaryRPMGauge) | |||
! call json%get(p,'AcidGasDetectionLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%AcidGasDetectionLED) | |||
! call json%get(p,'TotalStrokeCounter',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TotalStrokeCounter) | |||
! call json%get(p,'PitGainLossGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PitGainLossGauge) | |||
! call json%get(p,'MudTanksVolumeGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MudTanksVolumeGauge) | |||
! call json%get(p,'MVTAlarmLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MVTAlarmLED) | |||
! call json%get(p,'ReturnMudFlowGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%ReturnMudFlowGauge) | |||
! call json%get(p,'FillStrokeCounter',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%FillStrokeCounter) | |||
! call json%get(p,'MFFITotalStrokeCounter',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MFFITotalStrokeCounter) | |||
! call json%get(p,'MFFIAlarmLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MFFIAlarmLED) | |||
! call json%get(p,'MFFIPumpLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MFFIPumpLED) | |||
! call json%get(p,'TotalWellDepth',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TotalWellDepth) | |||
! call json%get(p,'BitDepth',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%BitDepth) | |||
! call json%get(p,'HookLoad',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%HookLoad) | |||
! call json%get(p,'StandPipePressure',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%StandPipePressure) | |||
! call json%get(p,'CasingPressure',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%CasingPressure) | |||
! call json%get(p,'MP1SPM',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MP1SPM) | |||
! call json%get(p,'MP2SPM',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MP2SPM) | |||
! call json%get(p,'RTTorque',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RTTorque) | |||
! call json%get(p,'RTRPM',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RTRPM) | |||
! call json%get(p,'WOP',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%WOP) | |||
! call json%get(p,'ROP',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%ROP) | |||
! call json%get(p,'MudWeightIn',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MudWeightIn) | |||
! call json%get(p,'MudWeightOut',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MudWeightOut) | |||
! call json%get(p,'Buzzer1',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%Buzzer1) | |||
! call json%get(p,'Buzzer2',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%Buzzer2) | |||
! call json%get(p,'Buzzer3',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%Buzzer3) | |||
! call json%get(p,'Buzzer4',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%Buzzer4) | |||
end subroutine | |||
subroutine DataDisplayConsoleToJson(parent) | |||
type(json_value),pointer :: parent | |||
@@ -13,87 +186,89 @@ module CDataDisplayConsole | |||
! 1. create new node | |||
call json%create_object(p,'DataDisplay') | |||
call json%add(p,"TripAlarmLow",data%EquipmentControl%DataDisplayConsole%TripAlarmLow) | |||
call json%add(p,"TripAlarmHigh",data%EquipmentControl%DataDisplayConsole%TripAlarmHigh) | |||
call json%add(p,"RetFlowAlarmLow",data%EquipmentControl%DataDisplayConsole%RetFlowAlarmLow) | |||
call json%add(p,"RetFlowAlarmHigh",data%EquipmentControl%DataDisplayConsole%RetFlowAlarmHigh) | |||
call json%add(p,"PitAlarmLow",data%EquipmentControl%DataDisplayConsole%PitAlarmLow) | |||
call json%add(p,"PitAlarmHigh",data%EquipmentControl%DataDisplayConsole%PitAlarmHigh) | |||
call json%add(p,"PortWeightOnBit",data%EquipmentControl%DataDisplayConsole%PortWeightOnBit) | |||
call json%add(p,"PortHookLoad",data%EquipmentControl%DataDisplayConsole%PortHookLoad) | |||
call json%add(p,"PortCasingPressure",data%EquipmentControl%DataDisplayConsole%PortCasingPressure) | |||
call json%add(p,"PortPumpPressure",data%EquipmentControl%DataDisplayConsole%PortPumpPressure) | |||
call json%add(p,"TripTankSetAlarmLow",data%EquipmentControl%DataDisplayConsole%TripTankSetAlarmLow) | |||
call json%add(p,"TripTankSetAlarmHigh",data%EquipmentControl%DataDisplayConsole%TripTankSetAlarmHigh) | |||
call json%add(p,"TripTankSetAlarmSwitch",data%EquipmentControl%DataDisplayConsole%TripTankSetAlarmSwitch) | |||
call json%add(p,"TripTankPowerSwitch",data%EquipmentControl%DataDisplayConsole%TripTankPowerSwitch) | |||
call json%add(p,"TripTankPumpSwitch",data%EquipmentControl%DataDisplayConsole%TripTankPumpSwitch) | |||
call json%add(p,"TripTankHornSwitch",data%EquipmentControl%DataDisplayConsole%TripTankHornSwitch) | |||
call json%add(p,"AcidGasDetectionHornSwitch",data%EquipmentControl%DataDisplayConsole%AcidGasDetectionHornSwitch) | |||
call json%add(p,"TotalStrokeCounterResetSwitch",data%EquipmentControl%DataDisplayConsole%TotalStrokeCounterResetSwitch) | |||
call json%add(p,"DrillingTrippingSelectorSwitch",data%EquipmentControl%DataDisplayConsole%DrillingTrippingSelectorSwitch) | |||
call json%add(p,"MVTSetAlarmLowKnob",data%EquipmentControl%DataDisplayConsole%MVTSetAlarmLowKnob) | |||
call json%add(p,"MVTSetAlarmHighKnob",data%EquipmentControl%DataDisplayConsole%MVTSetAlarmHighKnob) | |||
call json%add(p,"MVTSetAlarmSwitch",data%EquipmentControl%DataDisplayConsole%MVTSetAlarmSwitch) | |||
call json%add(p,"MudTank1Switch",data%EquipmentControl%DataDisplayConsole%MudTank1Switch) | |||
call json%add(p,"MudTank2Switch",data%EquipmentControl%DataDisplayConsole%MudTank2Switch) | |||
call json%add(p,"MudTank3Switch",data%EquipmentControl%DataDisplayConsole%MudTank3Switch) | |||
call json%add(p,"MudTank4Switch",data%EquipmentControl%DataDisplayConsole%MudTank4Switch) | |||
call json%add(p,"MVTFineKnob",data%EquipmentControl%DataDisplayConsole%MVTFineKnob) | |||
call json%add(p,"MVTCoarseKnob",data%EquipmentControl%DataDisplayConsole%MVTCoarseKnob) | |||
call json%add(p,"MVTHornSwitch",data%EquipmentControl%DataDisplayConsole%MVTHornSwitch) | |||
call json%add(p,"MVTDeviationTripSelectionSwitch",data%EquipmentControl%DataDisplayConsole%MVTDeviationTripSelectionSwitch) | |||
call json%add(p,"MVTPowerSwitch",data%EquipmentControl%DataDisplayConsole%MVTPowerSwitch) | |||
call json%add(p,"MFFIResetTotalStrokes",data%EquipmentControl%DataDisplayConsole%MFFIResetTotalStrokes) | |||
call json%add(p,"MFFIResetFillCounter",data%EquipmentControl%DataDisplayConsole%MFFIResetFillCounter) | |||
call json%add(p,"MFFIPumpSelectorSwitch",data%EquipmentControl%DataDisplayConsole%MFFIPumpSelectorSwitch) | |||
call json%add(p,"MFFIFillSPMSelectorSwitch",data%EquipmentControl%DataDisplayConsole%MFFIFillSPMSelectorSwitch) | |||
call json%add(p,"MFFISetAlarmLowKnob",data%EquipmentControl%DataDisplayConsole%MFFISetAlarmLowKnob) | |||
call json%add(p,"MFFISetAlarmHighKnob",data%EquipmentControl%DataDisplayConsole%MFFISetAlarmHighKnob) | |||
call json%add(p,"MFFISetAlarmSwitch",data%EquipmentControl%DataDisplayConsole%MFFISetAlarmSwitch) | |||
call json%add(p,"MFFIPowerSwitch",data%EquipmentControl%DataDisplayConsole%MFFIPowerSwitch) | |||
call json%add(p,"MFFIHornSwitch",data%EquipmentControl%DataDisplayConsole%MFFIHornSwitch) | |||
call json%add(p,"ResetWob",data%EquipmentControl%DataDisplayConsole%ResetWob) | |||
call json%add(p,"Clutch",data%EquipmentControl%DataDisplayConsole%Clutch) | |||
call json%add(p,"WOBPointer",data%EquipmentControl%DataDisplayConsole%WOBPointer) | |||
call json%add(p,"HookLoadPointer",data%EquipmentControl%DataDisplayConsole%HookLoadPointer) | |||
call json%add(p,"TripTankGauge",data%EquipmentControl%DataDisplayConsole%TripTankGauge) | |||
call json%add(p,"TripTankAlarmLED",data%EquipmentControl%DataDisplayConsole%TripTankAlarmLED) | |||
call json%add(p,"TripTankPumpLED",data%EquipmentControl%DataDisplayConsole%TripTankPumpLED) | |||
call json%add(p,"StandPipePressureGauge",data%EquipmentControl%DataDisplayConsole%StandPipePressureGauge) | |||
call json%add(p,"CasingPressureGauge",data%EquipmentControl%DataDisplayConsole%CasingPressureGauge) | |||
call json%add(p,"MP1SPMGauge",data%EquipmentControl%DataDisplayConsole%MP1SPMGauge) | |||
call json%add(p,"MP2SPMGauge",data%EquipmentControl%DataDisplayConsole%MP2SPMGauge) | |||
call json%add(p,"ReturnLineTempGauge",data%EquipmentControl%DataDisplayConsole%ReturnLineTempGauge) | |||
call json%add(p,"RotaryTorqueGauge",data%EquipmentControl%DataDisplayConsole%RotaryTorqueGauge) | |||
call json%add(p,"RotaryRPMGauge",data%EquipmentControl%DataDisplayConsole%RotaryRPMGauge) | |||
call json%add(p,"AcidGasDetectionLED",data%EquipmentControl%DataDisplayConsole%AcidGasDetectionLED) | |||
call json%add(p,"TotalStrokeCounter",data%EquipmentControl%DataDisplayConsole%TotalStrokeCounter) | |||
call json%add(p,"PitGainLossGauge",data%EquipmentControl%DataDisplayConsole%PitGainLossGauge) | |||
call json%add(p,"MudTanksVolumeGauge",data%EquipmentControl%DataDisplayConsole%MudTanksVolumeGauge) | |||
call json%add(p,"MVTAlarmLED",data%EquipmentControl%DataDisplayConsole%MVTAlarmLED) | |||
call json%add(p,"ReturnMudFlowGauge",data%EquipmentControl%DataDisplayConsole%ReturnMudFlowGauge) | |||
call json%add(p,"FillStrokeCounter",data%EquipmentControl%DataDisplayConsole%FillStrokeCounter) | |||
call json%add(p,"MFFITotalStrokeCounter",data%EquipmentControl%DataDisplayConsole%MFFITotalStrokeCounter) | |||
call json%add(p,"MFFIAlarmLED",data%EquipmentControl%DataDisplayConsole%MFFIAlarmLED) | |||
call json%add(p,"MFFIPumpLED",data%EquipmentControl%DataDisplayConsole%MFFIPumpLED) | |||
call json%add(p,"TotalWellDepth",data%EquipmentControl%DataDisplayConsole%TotalWellDepth) | |||
call json%add(p,"BitDepth",data%EquipmentControl%DataDisplayConsole%BitDepth) | |||
call json%add(p,"HookLoad",data%EquipmentControl%DataDisplayConsole%HookLoad) | |||
call json%add(p,"StandPipePressure",data%EquipmentControl%DataDisplayConsole%StandPipePressure) | |||
call json%add(p,"CasingPressure",data%EquipmentControl%DataDisplayConsole%CasingPressure) | |||
call json%add(p,"MP1SPM",data%EquipmentControl%DataDisplayConsole%MP1SPM) | |||
call json%add(p,"MP2SPM",data%EquipmentControl%DataDisplayConsole%MP2SPM) | |||
call json%add(p,"RTTorque",data%EquipmentControl%DataDisplayConsole%RTTorque) | |||
call json%add(p,"RTRPM",data%EquipmentControl%DataDisplayConsole%RTRPM) | |||
call json%add(p,"WOP",data%EquipmentControl%DataDisplayConsole%WOP) | |||
call json%add(p,"ROP",data%EquipmentControl%DataDisplayConsole%ROP) | |||
call json%add(p,"MudWeightIn",data%EquipmentControl%DataDisplayConsole%MudWeightIn) | |||
call json%add(p,"MudWeightOut",data%EquipmentControl%DataDisplayConsole%MudWeightOut) | |||
call json%add(p,"Buzzer1",data%EquipmentControl%DataDisplayConsole%Buzzer1) | |||
call json%add(p,"Buzzer2",data%EquipmentControl%DataDisplayConsole%Buzzer2) | |||
call json%add(p,"Buzzer3",data%EquipmentControl%DataDisplayConsole%Buzzer3) | |||
call json%add(p,"Buzzer4",data%EquipmentControl%DataDisplayConsole%Buzzer4) | |||
! call json%add(p,"TripAlarmLow",data%Equipments%DataDisplayConsole%TripAlarmLow) | |||
! call json%add(p,"TripAlarmHigh",data%Equipments%DataDisplayConsole%TripAlarmHigh) | |||
! call json%add(p,"RetFlowAlarmLow",data%Equipments%DataDisplayConsole%RetFlowAlarmLow) | |||
! call json%add(p,"RetFlowAlarmHigh",data%Equipments%DataDisplayConsole%RetFlowAlarmHigh) | |||
! call json%add(p,"PitAlarmLow",data%Equipments%DataDisplayConsole%PitAlarmLow) | |||
! call json%add(p,"PitAlarmHigh",data%Equipments%DataDisplayConsole%PitAlarmHigh) | |||
! call json%add(p,"PortWeightOnBit",data%Equipments%DataDisplayConsole%PortWeightOnBit) | |||
! call json%add(p,"PortHookLoad",data%Equipments%DataDisplayConsole%PortHookLoad) | |||
! call json%add(p,"PortCasingPressure",data%Equipments%DataDisplayConsole%PortCasingPressure) | |||
! call json%add(p,"PortPumpPressure",data%Equipments%DataDisplayConsole%PortPumpPressure) | |||
! call json%add(p,"TripTankSetAlarmLow",data%Equipments%DataDisplayConsole%TripTankSetAlarmLow) | |||
! call json%add(p,"TripTankSetAlarmHigh",data%Equipments%DataDisplayConsole%TripTankSetAlarmHigh) | |||
! call json%add(p,"TripTankSetAlarmSwitch",data%Equipments%DataDisplayConsole%TripTankSetAlarmSwitch) | |||
! call json%add(p,"TripTankPowerSwitch",data%Equipments%DataDisplayConsole%TripTankPowerSwitch) | |||
! call json%add(p,"TripTankPumpSwitch",data%Equipments%DataDisplayConsole%TripTankPumpSwitch) | |||
! call json%add(p,"TripTankHornSwitch",data%Equipments%DataDisplayConsole%TripTankHornSwitch) | |||
! call json%add(p,"AcidGasDetectionHornSwitch",data%Equipments%DataDisplayConsole%AcidGasDetectionHornSwitch) | |||
! call json%add(p,"TotalStrokeCounterResetSwitch",data%Equipments%DataDisplayConsole%TotalStrokeCounterResetSwitch) | |||
! call json%add(p,"DrillingTrippingSelectorSwitch",data%Equipments%DataDisplayConsole%DrillingTrippingSelectorSwitch) | |||
! call json%add(p,"MVTSetAlarmLowKnob",data%Equipments%DataDisplayConsole%MVTSetAlarmLowKnob) | |||
! call json%add(p,"MVTSetAlarmHighKnob",data%Equipments%DataDisplayConsole%MVTSetAlarmHighKnob) | |||
! call json%add(p,"MVTSetAlarmSwitch",data%Equipments%DataDisplayConsole%MVTSetAlarmSwitch) | |||
! call json%add(p,"MudTank1Switch",data%Equipments%DataDisplayConsole%MudTank1Switch) | |||
! call json%add(p,"MudTank2Switch",data%Equipments%DataDisplayConsole%MudTank2Switch) | |||
! call json%add(p,"MudTank3Switch",data%Equipments%DataDisplayConsole%MudTank3Switch) | |||
! call json%add(p,"MudTank4Switch",data%Equipments%DataDisplayConsole%MudTank4Switch) | |||
! call json%add(p,"MVTFineKnob",data%Equipments%DataDisplayConsole%MVTFineKnob) | |||
! call json%add(p,"MVTCoarseKnob",data%Equipments%DataDisplayConsole%MVTCoarseKnob) | |||
! call json%add(p,"MVTHornSwitch",data%Equipments%DataDisplayConsole%MVTHornSwitch) | |||
! call json%add(p,"MVTDeviationTripSelectionSwitch",data%Equipments%DataDisplayConsole%MVTDeviationTripSelectionSwitch) | |||
! call json%add(p,"MVTPowerSwitch",data%Equipments%DataDisplayConsole%MVTPowerSwitch) | |||
! call json%add(p,"MFFIResetTotalStrokes",data%Equipments%DataDisplayConsole%MFFIResetTotalStrokes) | |||
! call json%add(p,"MFFIResetFillCounter",data%Equipments%DataDisplayConsole%MFFIResetFillCounter) | |||
! call json%add(p,"MFFIPumpSelectorSwitch",data%Equipments%DataDisplayConsole%MFFIPumpSelectorSwitch) | |||
! call json%add(p,"MFFIFillSPMSelectorSwitch",data%Equipments%DataDisplayConsole%MFFIFillSPMSelectorSwitch) | |||
! call json%add(p,"MFFISetAlarmLowKnob",data%Equipments%DataDisplayConsole%MFFISetAlarmLowKnob) | |||
! call json%add(p,"MFFISetAlarmHighKnob",data%Equipments%DataDisplayConsole%MFFISetAlarmHighKnob) | |||
! call json%add(p,"MFFISetAlarmSwitch",data%Equipments%DataDisplayConsole%MFFISetAlarmSwitch) | |||
! call json%add(p,"MFFIPowerSwitch",data%Equipments%DataDisplayConsole%MFFIPowerSwitch) | |||
! call json%add(p,"MFFIHornSwitch",data%Equipments%DataDisplayConsole%MFFIHornSwitch) | |||
! call json%add(p,"ResetWob",data%Equipments%DataDisplayConsole%ResetWob) | |||
! call json%add(p,"Clutch",data%Equipments%DataDisplayConsole%Clutch) | |||
call json%add(p,"WOBPointer",data%Equipments%DataDisplayConsole%WOBPointer) | |||
call json%add(p,"HookLoadPointer",data%Equipments%DataDisplayConsole%HookLoadPointer) | |||
call json%add(p,"TripTankGauge",data%Equipments%DataDisplayConsole%TripTankGauge) | |||
call json%add(p,"TripTankAlarmLED",data%Equipments%DataDisplayConsole%TripTankAlarmLED) | |||
call json%add(p,"TripTankPumpLED",data%Equipments%DataDisplayConsole%TripTankPumpLED) | |||
call json%add(p,"StandPipePressureGauge",data%Equipments%DataDisplayConsole%StandPipePressureGauge) | |||
call json%add(p,"CasingPressureGauge",data%Equipments%DataDisplayConsole%CasingPressureGauge) | |||
call json%add(p,"MP1SPMGauge",data%Equipments%DataDisplayConsole%MP1SPMGauge) | |||
call json%add(p,"MP2SPMGauge",data%Equipments%DataDisplayConsole%MP2SPMGauge) | |||
call json%add(p,"ReturnLineTempGauge",data%Equipments%DataDisplayConsole%ReturnLineTempGauge) | |||
call json%add(p,"RotaryTorqueGauge",data%Equipments%DataDisplayConsole%RotaryTorqueGauge) | |||
call json%add(p,"RotaryRPMGauge",data%Equipments%DataDisplayConsole%RotaryRPMGauge) | |||
call json%add(p,"AcidGasDetectionLED",data%Equipments%DataDisplayConsole%AcidGasDetectionLED) | |||
call json%add(p,"TotalStrokeCounter",data%Equipments%DataDisplayConsole%TotalStrokeCounter) | |||
call json%add(p,"PitGainLossGauge",data%Equipments%DataDisplayConsole%PitGainLossGauge) | |||
call json%add(p,"MudTanksVolumeGauge",data%Equipments%DataDisplayConsole%MudTanksVolumeGauge) | |||
call json%add(p,"MVTAlarmLED",data%Equipments%DataDisplayConsole%MVTAlarmLED) | |||
call json%add(p,"ReturnMudFlowGauge",data%Equipments%DataDisplayConsole%ReturnMudFlowGauge) | |||
call json%add(p,"FillStrokeCounter",data%Equipments%DataDisplayConsole%FillStrokeCounter) | |||
call json%add(p,"MFFITotalStrokeCounter",data%Equipments%DataDisplayConsole%MFFITotalStrokeCounter) | |||
call json%add(p,"MFFIAlarmLED",data%Equipments%DataDisplayConsole%MFFIAlarmLED) | |||
call json%add(p,"MFFIPumpLED",data%Equipments%DataDisplayConsole%MFFIPumpLED) | |||
call json%add(p,"TotalWellDepth",data%Equipments%DataDisplayConsole%TotalWellDepth) | |||
call json%add(p,"BitDepth",data%Equipments%DataDisplayConsole%BitDepth) | |||
call json%add(p,"HookLoad",data%Equipments%DataDisplayConsole%HookLoad) | |||
call json%add(p,"StandPipePressure",data%Equipments%DataDisplayConsole%StandPipePressure) | |||
call json%add(p,"CasingPressure",data%Equipments%DataDisplayConsole%CasingPressure) | |||
call json%add(p,"MP1SPM",data%Equipments%DataDisplayConsole%MP1SPM) | |||
call json%add(p,"MP2SPM",data%Equipments%DataDisplayConsole%MP2SPM) | |||
call json%add(p,"RTTorque",data%Equipments%DataDisplayConsole%RTTorque) | |||
call json%add(p,"RTRPM",data%Equipments%DataDisplayConsole%RTRPM) | |||
call json%add(p,"WOP",data%Equipments%DataDisplayConsole%WOP) | |||
call json%add(p,"ROP",data%Equipments%DataDisplayConsole%ROP) | |||
call json%add(p,"MudWeightIn",data%Equipments%DataDisplayConsole%MudWeightIn) | |||
call json%add(p,"MudWeightOut",data%Equipments%DataDisplayConsole%MudWeightOut) | |||
call json%add(p,"Buzzer1",data%Equipments%DataDisplayConsole%Buzzer1) | |||
call json%add(p,"Buzzer2",data%Equipments%DataDisplayConsole%Buzzer2) | |||
call json%add(p,"Buzzer3",data%Equipments%DataDisplayConsole%Buzzer3) | |||
call json%add(p,"Buzzer4",data%Equipments%DataDisplayConsole%Buzzer4) | |||
call json%add(parent,p) | |||
@@ -101,87 +276,87 @@ module CDataDisplayConsole | |||
subroutine Set_TotalDepth(v) | |||
use SimulationVariables !@!!, only: data%EquipmentControl%DrillingWatch%Depth | |||
use SimulationVariables !@!!, only: data%Equipments%DrillingWatch%Depth | |||
! use CSimulationVariables, only: SetDistanceDrilled | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%TotalWellDepth = v | |||
data%EquipmentControl%DrillingWatch%Depth = v | |||
data%Equipments%DataDisplayConsole%TotalWellDepth = v | |||
data%Equipments%DrillingWatch%Depth = v | |||
! call SetDistanceDrilled(v) | |||
end subroutine | |||
subroutine Set_BitPosition(v) | |||
use SimulationVariables !@!!, only: data%EquipmentControl%DrillingWatch%BitPosition | |||
use SimulationVariables !@!!, only: data%Equipments%DrillingWatch%BitPosition | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%BitDepth = v | |||
data%EquipmentControl%DrillingWatch%BitPosition = v | |||
data%Equipments%DataDisplayConsole%BitDepth = v | |||
data%Equipments%DrillingWatch%BitPosition = v | |||
end subroutine | |||
subroutine Set_RotaryTorque(v) | |||
use SimulationVariables !@!!, only: data%EquipmentControl%DrillingWatch%Torque | |||
use SimulationVariables !@!!, only: data%Equipments%DrillingWatch%Torque | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%RotaryTorqueGauge = v | |||
data%EquipmentControl%DrillingWatch%Torque = v | |||
data%EquipmentControl%DataDisplayConsole%RTTorque = v | |||
data%Equipments%DataDisplayConsole%RotaryTorqueGauge = v | |||
data%Equipments%DrillingWatch%Torque = v | |||
data%Equipments%DataDisplayConsole%RTTorque = v | |||
end subroutine | |||
subroutine Set_MudWeightIn(v) | |||
use SimulationVariables !@!, only: MudWeightInDw => data%EquipmentControl%DataDisplayConsole%MudWeightIn | |||
use SimulationVariables !@!, only: MudWeightInDw => data%Equipments%DataDisplayConsole%MudWeightIn | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MudWeightIn = v | |||
data%EquipmentControl%DrillingWatch%MudWeightIn = v | |||
data%Equipments%DataDisplayConsole%MudWeightIn = v | |||
data%Equipments%DrillingWatch%MudWeightIn = v | |||
end subroutine | |||
subroutine Set_MudWeightOut(v) | |||
use SimulationVariables !@!, only: MudWeightOutDw => data%EquipmentControl%DataDisplayConsole%MudWeightOut | |||
use SimulationVariables !@!, only: MudWeightOutDw => data%Equipments%DataDisplayConsole%MudWeightOut | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MudWeightOut = v | |||
data%EquipmentControl%DrillingWatch%MudWeightOut = v | |||
data%Equipments%DataDisplayConsole%MudWeightOut = v | |||
data%Equipments%DrillingWatch%MudWeightOut = v | |||
end subroutine | |||
subroutine Set_TripTankVolume(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%TripTankVolume | |||
use SimulationVariables !@!, only: data%Equipments%DrillingWatch%TripTankVolume | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DrillingWatch%TripTankVolume = v | |||
data%Equipments%DrillingWatch%TripTankVolume = v | |||
end subroutine | |||
subroutine Set_FillVolume(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%FillVolume | |||
use SimulationVariables !@!, only: data%Equipments%DrillingWatch%FillVolume | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DrillingWatch%FillVolume = v | |||
data%Equipments%DrillingWatch%FillVolume = v | |||
end subroutine | |||
subroutine Set_HookLoad(v) | |||
use SimulationVariables !@!, only: HookLoadDw => data%EquipmentControl%DataDisplayConsole%HookLoad | |||
use SimulationVariables !@!, only: HookLoadDw => data%Equipments%DataDisplayConsole%HookLoad | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%HookLoadPointer = v | |||
data%EquipmentControl%DrillingWatch%HookLoad = v * 1000 | |||
data%EquipmentControl%DataDisplayConsole%HookLoad = v | |||
data%Equipments%DataDisplayConsole%HookLoadPointer = v | |||
data%Equipments%DrillingWatch%HookLoad = v * 1000 | |||
data%Equipments%DataDisplayConsole%HookLoad = v | |||
end subroutine | |||
subroutine Set_WeightOnBit(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%WeightOnBit | |||
use SimulationVariables !@!, only: data%Equipments%DrillingWatch%WeightOnBit | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%WOBPointer = v | |||
data%EquipmentControl%DrillingWatch%WeightOnBit = v | |||
data%EquipmentControl%DataDisplayConsole%WOP = v | |||
data%Equipments%DataDisplayConsole%WOBPointer = v | |||
data%Equipments%DrillingWatch%WeightOnBit = v | |||
data%Equipments%DataDisplayConsole%WOP = v | |||
end subroutine | |||
subroutine Set_ROP(v) | |||
use SimulationVariables !@!, only: ROPDw => data%EquipmentControl%DataDisplayConsole%ROP | |||
use SimulationVariables !@!, only: ROPDw => data%Equipments%DataDisplayConsole%ROP | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%ROP = v | |||
data%EquipmentControl%DrillingWatch%ROP = v | |||
data%Equipments%DataDisplayConsole%ROP = v | |||
data%Equipments%DrillingWatch%ROP = v | |||
end subroutine | |||
subroutine Set_CasingPressure(v) | |||
@@ -190,22 +365,22 @@ module CDataDisplayConsole | |||
use SimulationVariables!, only: CasingPressureChoke => CasingPressure | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%CasingPressureGauge = v | |||
data%EquipmentControl%DrillingWatch%CasingPressure = v | |||
data%EquipmentControl%ChokeControlPanel%CasingPressure = v | |||
data%EquipmentControl%DataDisplayConsole%CasingPressure = v | |||
data%Equipments%DataDisplayConsole%CasingPressureGauge = v | |||
data%Equipments%DrillingWatch%CasingPressure = v | |||
data%Equipments%ChokeControlPanel%CasingPressure = v | |||
data%Equipments%DataDisplayConsole%CasingPressure = v | |||
end subroutine | |||
subroutine Set_StandPipePressure(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%PumpPressure | |||
use SimulationVariables !@!, only: data%Equipments%DrillingWatch%PumpPressure | |||
use CChokeControlPanelVariables | |||
use SimulationVariables!, only: StandPipePressureChoke => data%EquipmentControl%DataDisplayConsole%StandPipePressure | |||
use SimulationVariables!, only: StandPipePressureChoke => data%Equipments%DataDisplayConsole%StandPipePressure | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%StandPipePressureGauge = v | |||
data%EquipmentControl%DrillingWatch%PumpPressure = v | |||
data%EquipmentControl%ChokeControlPanel%StandPipePressure = v | |||
data%EquipmentControl%DataDisplayConsole%StandPipePressure = v | |||
data%Equipments%DataDisplayConsole%StandPipePressureGauge = v | |||
data%Equipments%DrillingWatch%PumpPressure = v | |||
data%Equipments%ChokeControlPanel%StandPipePressure = v | |||
data%Equipments%DataDisplayConsole%StandPipePressure = v | |||
@@ -213,13 +388,13 @@ module CDataDisplayConsole | |||
subroutine Set_RotaryRPMGauge(v) | |||
use SimulationVariables !@!, only: data%EquipmentControl%DrillingWatch%RPM | |||
use SimulationVariables !@!, only: data%Equipments%DrillingWatch%RPM | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%RotaryRPMGauge = v | |||
data%EquipmentControl%DrillingWatch%RPM = v | |||
data%EquipmentControl%DataDisplayConsole%RTRPM = v | |||
! call data%EquipmentControl%DataDisplayConsole%OnRotaryRpmChange%RunAll(v) | |||
data%Equipments%DataDisplayConsole%RotaryRPMGauge = v | |||
data%Equipments%DrillingWatch%RPM = v | |||
data%Equipments%DataDisplayConsole%RTRPM = v | |||
! call data%Equipments%DataDisplayConsole%OnRotaryRpmChange%RunAll(v) | |||
end subroutine | |||
@@ -228,22 +403,22 @@ module CDataDisplayConsole | |||
subroutine Set_MP1SPMGauge(v) | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MP1SPMGauge = v | |||
data%EquipmentControl%DataDisplayConsole%MP1SPM = v | |||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%EquipmentControl%DataDisplayConsole%MP1SPMGauge, data%EquipmentControl%DataDisplayConsole%MP2SPMGauge) | |||
data%Equipments%DataDisplayConsole%MP1SPMGauge = v | |||
data%Equipments%DataDisplayConsole%MP1SPM = v | |||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%Equipments%DataDisplayConsole%MP1SPMGauge, data%Equipments%DataDisplayConsole%MP2SPMGauge) | |||
#ifdef deb | |||
print*, 'MP1SPMGauge=', data%EquipmentControl%DataDisplayConsole%MP1SPMGauge | |||
print*, 'MP1SPMGauge=', data%Equipments%DataDisplayConsole%MP1SPMGauge | |||
#endif | |||
end subroutine | |||
subroutine Set_MP2SPMGauge(v) | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%EquipmentControl%DataDisplayConsole%MP2SPMGauge = v | |||
data%EquipmentControl%DataDisplayConsole%MP2SPM = v | |||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%EquipmentControl%DataDisplayConsole%MP1SPMGauge, data%EquipmentControl%DataDisplayConsole%MP2SPMGauge) | |||
data%Equipments%DataDisplayConsole%MP2SPMGauge = v | |||
data%Equipments%DataDisplayConsole%MP2SPM = v | |||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%Equipments%DataDisplayConsole%MP1SPMGauge, data%Equipments%DataDisplayConsole%MP2SPMGauge) | |||
#ifdef deb | |||
print*, 'MP2SPMGauge=', data%EquipmentControl%DataDisplayConsole%MP2SPMGauge | |||
print*, 'MP2SPMGauge=', data%Equipments%DataDisplayConsole%MP2SPMGauge | |||
#endif | |||
end subroutine | |||
end module CDataDisplayConsole |
@@ -0,0 +1,423 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CDataDisplayConsole.f90" | |||
module CDataDisplayConsole | |||
! use CDataDisplayConsole | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
subroutine DataDisplayConsoleFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
call json%get(parent,'DataDisplay',p) | |||
! 2. get member of data type from node | |||
! call json%get(p,'TripAlarmLow',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TripAlarmLow) | |||
! call json%get(p,'TripAlarmHigh',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TripAlarmHigh) | |||
! call json%get(p,'RetFlowAlarmLow',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RetFlowAlarmLow) | |||
! call json%get(p,'RetFlowAlarmHigh',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RetFlowAlarmHigh) | |||
! call json%get(p,'PitAlarmLow',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PitAlarmLow) | |||
! call json%get(p,'PitAlarmHigh',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PitAlarmHigh) | |||
! call json%get(p,'PortWeightOnBit',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PortWeightOnBit) | |||
! call json%get(p,'PortHookLoad',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PortHookLoad) | |||
! call json%get(p,'PortCasingPressure',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PortCasingPressure) | |||
! call json%get(p,'PortPumpPressure',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PortPumpPressure) | |||
call json%get(p,'TripTankSetAlarmLow',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankSetAlarmLow) | |||
call json%get(p,'TripTankSetAlarmHigh',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankSetAlarmHigh) | |||
call json%get(p,'TripTankSetAlarmSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankSetAlarmSwitch) | |||
call json%get(p,'TripTankPowerSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankPowerSwitch) | |||
call json%get(p,'TripTankPumpSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankPumpSwitch) | |||
call json%get(p,'TripTankHornSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TripTankHornSwitch) | |||
call json%get(p,'AcidGasDetectionHornSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%AcidGasDetectionHornSwitch) | |||
call json%get(p,'TotalStrokeCounterResetSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%TotalStrokeCounterResetSwitch) | |||
call json%get(p,'DrillingTrippingSelectorSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%DrillingTrippingSelectorSwitch) | |||
call json%get(p,'MVTSetAlarmLowKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTSetAlarmLowKnob) | |||
call json%get(p,'MVTSetAlarmHighKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTSetAlarmHighKnob) | |||
call json%get(p,'MVTSetAlarmSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTSetAlarmSwitch) | |||
call json%get(p,'MudTank1Switch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MudTank1Switch) | |||
call json%get(p,'MudTank2Switch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MudTank2Switch) | |||
call json%get(p,'MudTank3Switch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MudTank3Switch) | |||
call json%get(p,'MudTank4Switch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MudTank4Switch) | |||
call json%get(p,'MVTFineKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTFineKnob) | |||
call json%get(p,'MVTCoarseKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTCoarseKnob) | |||
call json%get(p,'MVTHornSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTHornSwitch) | |||
call json%get(p,'MVTDeviationTripSelectionSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTDeviationTripSelectionSwitch) | |||
call json%get(p,'MVTPowerSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MVTPowerSwitch) | |||
call json%get(p,'MFFIResetTotalStrokes',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIResetTotalStrokes) | |||
call json%get(p,'MFFIResetFillCounter',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIResetFillCounter) | |||
call json%get(p,'MFFIPumpSelectorSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIPumpSelectorSwitch) | |||
call json%get(p,'MFFIFillSPMSelectorSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIFillSPMSelectorSwitch) | |||
call json%get(p,'MFFISetAlarmLowKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFISetAlarmLowKnob) | |||
call json%get(p,'MFFISetAlarmHighKnob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFISetAlarmHighKnob) | |||
call json%get(p,'MFFISetAlarmSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFISetAlarmSwitch) | |||
call json%get(p,'MFFIPowerSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIPowerSwitch) | |||
call json%get(p,'MFFIHornSwitch',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%MFFIHornSwitch) | |||
call json%get(p,'ResetWob',pval) | |||
call json%get(pval,data%Equipments%DataDisplayConsole%ResetWob) | |||
call json%get(p,'Clutch',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%Clutch) | |||
! call json%get(p,'WOBPointer',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%WOBPointer) | |||
! call json%get(p,'HookLoadPointer',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%HookLoadPointer) | |||
! call json%get(p,'TripTankGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TripTankGauge) | |||
! call json%get(p,'TripTankAlarmLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TripTankAlarmLED) | |||
! call json%get(p,'TripTankPumpLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TripTankPumpLED) | |||
! call json%get(p,'StandPipePressureGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%StandPipePressureGauge) | |||
! call json%get(p,'CasingPressureGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%CasingPressureGauge) | |||
! call json%get(p,'MP1SPMGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MP1SPMGauge) | |||
! call json%get(p,'MP2SPMGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MP2SPMGauge) | |||
! call json%get(p,'ReturnLineTempGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%ReturnLineTempGauge) | |||
! call json%get(p,'RotaryTorqueGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RotaryTorqueGauge) | |||
! call json%get(p,'RotaryRPMGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RotaryRPMGauge) | |||
! call json%get(p,'AcidGasDetectionLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%AcidGasDetectionLED) | |||
! call json%get(p,'TotalStrokeCounter',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TotalStrokeCounter) | |||
! call json%get(p,'PitGainLossGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%PitGainLossGauge) | |||
! call json%get(p,'MudTanksVolumeGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MudTanksVolumeGauge) | |||
! call json%get(p,'MVTAlarmLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MVTAlarmLED) | |||
! call json%get(p,'ReturnMudFlowGauge',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%ReturnMudFlowGauge) | |||
! call json%get(p,'FillStrokeCounter',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%FillStrokeCounter) | |||
! call json%get(p,'MFFITotalStrokeCounter',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MFFITotalStrokeCounter) | |||
! call json%get(p,'MFFIAlarmLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MFFIAlarmLED) | |||
! call json%get(p,'MFFIPumpLED',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MFFIPumpLED) | |||
! call json%get(p,'TotalWellDepth',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%TotalWellDepth) | |||
! call json%get(p,'BitDepth',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%BitDepth) | |||
! call json%get(p,'HookLoad',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%HookLoad) | |||
! call json%get(p,'StandPipePressure',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%StandPipePressure) | |||
! call json%get(p,'CasingPressure',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%CasingPressure) | |||
! call json%get(p,'MP1SPM',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MP1SPM) | |||
! call json%get(p,'MP2SPM',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MP2SPM) | |||
! call json%get(p,'RTTorque',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RTTorque) | |||
! call json%get(p,'RTRPM',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%RTRPM) | |||
! call json%get(p,'WOP',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%WOP) | |||
! call json%get(p,'ROP',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%ROP) | |||
! call json%get(p,'MudWeightIn',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MudWeightIn) | |||
! call json%get(p,'MudWeightOut',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%MudWeightOut) | |||
! call json%get(p,'Buzzer1',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%Buzzer1) | |||
! call json%get(p,'Buzzer2',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%Buzzer2) | |||
! call json%get(p,'Buzzer3',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%Buzzer3) | |||
! call json%get(p,'Buzzer4',pval) | |||
! call json%get(pval,data%Equipments%DataDisplayConsole%Buzzer4) | |||
end subroutine | |||
subroutine DataDisplayConsoleToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'DataDisplay') | |||
! call json%add(p,"TripAlarmLow",data%Equipments%DataDisplayConsole%TripAlarmLow) | |||
! call json%add(p,"TripAlarmHigh",data%Equipments%DataDisplayConsole%TripAlarmHigh) | |||
! call json%add(p,"RetFlowAlarmLow",data%Equipments%DataDisplayConsole%RetFlowAlarmLow) | |||
! call json%add(p,"RetFlowAlarmHigh",data%Equipments%DataDisplayConsole%RetFlowAlarmHigh) | |||
! call json%add(p,"PitAlarmLow",data%Equipments%DataDisplayConsole%PitAlarmLow) | |||
! call json%add(p,"PitAlarmHigh",data%Equipments%DataDisplayConsole%PitAlarmHigh) | |||
! call json%add(p,"PortWeightOnBit",data%Equipments%DataDisplayConsole%PortWeightOnBit) | |||
! call json%add(p,"PortHookLoad",data%Equipments%DataDisplayConsole%PortHookLoad) | |||
! call json%add(p,"PortCasingPressure",data%Equipments%DataDisplayConsole%PortCasingPressure) | |||
! call json%add(p,"PortPumpPressure",data%Equipments%DataDisplayConsole%PortPumpPressure) | |||
! call json%add(p,"TripTankSetAlarmLow",data%Equipments%DataDisplayConsole%TripTankSetAlarmLow) | |||
! call json%add(p,"TripTankSetAlarmHigh",data%Equipments%DataDisplayConsole%TripTankSetAlarmHigh) | |||
! call json%add(p,"TripTankSetAlarmSwitch",data%Equipments%DataDisplayConsole%TripTankSetAlarmSwitch) | |||
! call json%add(p,"TripTankPowerSwitch",data%Equipments%DataDisplayConsole%TripTankPowerSwitch) | |||
! call json%add(p,"TripTankPumpSwitch",data%Equipments%DataDisplayConsole%TripTankPumpSwitch) | |||
! call json%add(p,"TripTankHornSwitch",data%Equipments%DataDisplayConsole%TripTankHornSwitch) | |||
! call json%add(p,"AcidGasDetectionHornSwitch",data%Equipments%DataDisplayConsole%AcidGasDetectionHornSwitch) | |||
! call json%add(p,"TotalStrokeCounterResetSwitch",data%Equipments%DataDisplayConsole%TotalStrokeCounterResetSwitch) | |||
! call json%add(p,"DrillingTrippingSelectorSwitch",data%Equipments%DataDisplayConsole%DrillingTrippingSelectorSwitch) | |||
! call json%add(p,"MVTSetAlarmLowKnob",data%Equipments%DataDisplayConsole%MVTSetAlarmLowKnob) | |||
! call json%add(p,"MVTSetAlarmHighKnob",data%Equipments%DataDisplayConsole%MVTSetAlarmHighKnob) | |||
! call json%add(p,"MVTSetAlarmSwitch",data%Equipments%DataDisplayConsole%MVTSetAlarmSwitch) | |||
! call json%add(p,"MudTank1Switch",data%Equipments%DataDisplayConsole%MudTank1Switch) | |||
! call json%add(p,"MudTank2Switch",data%Equipments%DataDisplayConsole%MudTank2Switch) | |||
! call json%add(p,"MudTank3Switch",data%Equipments%DataDisplayConsole%MudTank3Switch) | |||
! call json%add(p,"MudTank4Switch",data%Equipments%DataDisplayConsole%MudTank4Switch) | |||
! call json%add(p,"MVTFineKnob",data%Equipments%DataDisplayConsole%MVTFineKnob) | |||
! call json%add(p,"MVTCoarseKnob",data%Equipments%DataDisplayConsole%MVTCoarseKnob) | |||
! call json%add(p,"MVTHornSwitch",data%Equipments%DataDisplayConsole%MVTHornSwitch) | |||
! call json%add(p,"MVTDeviationTripSelectionSwitch",data%Equipments%DataDisplayConsole%MVTDeviationTripSelectionSwitch) | |||
! call json%add(p,"MVTPowerSwitch",data%Equipments%DataDisplayConsole%MVTPowerSwitch) | |||
! call json%add(p,"MFFIResetTotalStrokes",data%Equipments%DataDisplayConsole%MFFIResetTotalStrokes) | |||
! call json%add(p,"MFFIResetFillCounter",data%Equipments%DataDisplayConsole%MFFIResetFillCounter) | |||
! call json%add(p,"MFFIPumpSelectorSwitch",data%Equipments%DataDisplayConsole%MFFIPumpSelectorSwitch) | |||
! call json%add(p,"MFFIFillSPMSelectorSwitch",data%Equipments%DataDisplayConsole%MFFIFillSPMSelectorSwitch) | |||
! call json%add(p,"MFFISetAlarmLowKnob",data%Equipments%DataDisplayConsole%MFFISetAlarmLowKnob) | |||
! call json%add(p,"MFFISetAlarmHighKnob",data%Equipments%DataDisplayConsole%MFFISetAlarmHighKnob) | |||
! call json%add(p,"MFFISetAlarmSwitch",data%Equipments%DataDisplayConsole%MFFISetAlarmSwitch) | |||
! call json%add(p,"MFFIPowerSwitch",data%Equipments%DataDisplayConsole%MFFIPowerSwitch) | |||
! call json%add(p,"MFFIHornSwitch",data%Equipments%DataDisplayConsole%MFFIHornSwitch) | |||
! call json%add(p,"ResetWob",data%Equipments%DataDisplayConsole%ResetWob) | |||
! call json%add(p,"Clutch",data%Equipments%DataDisplayConsole%Clutch) | |||
call json%add(p,"WOBPointer",data%Equipments%DataDisplayConsole%WOBPointer) | |||
call json%add(p,"HookLoadPointer",data%Equipments%DataDisplayConsole%HookLoadPointer) | |||
call json%add(p,"TripTankGauge",data%Equipments%DataDisplayConsole%TripTankGauge) | |||
call json%add(p,"TripTankAlarmLED",data%Equipments%DataDisplayConsole%TripTankAlarmLED) | |||
call json%add(p,"TripTankPumpLED",data%Equipments%DataDisplayConsole%TripTankPumpLED) | |||
call json%add(p,"StandPipePressureGauge",data%Equipments%DataDisplayConsole%StandPipePressureGauge) | |||
call json%add(p,"CasingPressureGauge",data%Equipments%DataDisplayConsole%CasingPressureGauge) | |||
call json%add(p,"MP1SPMGauge",data%Equipments%DataDisplayConsole%MP1SPMGauge) | |||
call json%add(p,"MP2SPMGauge",data%Equipments%DataDisplayConsole%MP2SPMGauge) | |||
call json%add(p,"ReturnLineTempGauge",data%Equipments%DataDisplayConsole%ReturnLineTempGauge) | |||
call json%add(p,"RotaryTorqueGauge",data%Equipments%DataDisplayConsole%RotaryTorqueGauge) | |||
call json%add(p,"RotaryRPMGauge",data%Equipments%DataDisplayConsole%RotaryRPMGauge) | |||
call json%add(p,"AcidGasDetectionLED",data%Equipments%DataDisplayConsole%AcidGasDetectionLED) | |||
call json%add(p,"TotalStrokeCounter",data%Equipments%DataDisplayConsole%TotalStrokeCounter) | |||
call json%add(p,"PitGainLossGauge",data%Equipments%DataDisplayConsole%PitGainLossGauge) | |||
call json%add(p,"MudTanksVolumeGauge",data%Equipments%DataDisplayConsole%MudTanksVolumeGauge) | |||
call json%add(p,"MVTAlarmLED",data%Equipments%DataDisplayConsole%MVTAlarmLED) | |||
call json%add(p,"ReturnMudFlowGauge",data%Equipments%DataDisplayConsole%ReturnMudFlowGauge) | |||
call json%add(p,"FillStrokeCounter",data%Equipments%DataDisplayConsole%FillStrokeCounter) | |||
call json%add(p,"MFFITotalStrokeCounter",data%Equipments%DataDisplayConsole%MFFITotalStrokeCounter) | |||
call json%add(p,"MFFIAlarmLED",data%Equipments%DataDisplayConsole%MFFIAlarmLED) | |||
call json%add(p,"MFFIPumpLED",data%Equipments%DataDisplayConsole%MFFIPumpLED) | |||
call json%add(p,"TotalWellDepth",data%Equipments%DataDisplayConsole%TotalWellDepth) | |||
call json%add(p,"BitDepth",data%Equipments%DataDisplayConsole%BitDepth) | |||
call json%add(p,"HookLoad",data%Equipments%DataDisplayConsole%HookLoad) | |||
call json%add(p,"StandPipePressure",data%Equipments%DataDisplayConsole%StandPipePressure) | |||
call json%add(p,"CasingPressure",data%Equipments%DataDisplayConsole%CasingPressure) | |||
call json%add(p,"MP1SPM",data%Equipments%DataDisplayConsole%MP1SPM) | |||
call json%add(p,"MP2SPM",data%Equipments%DataDisplayConsole%MP2SPM) | |||
call json%add(p,"RTTorque",data%Equipments%DataDisplayConsole%RTTorque) | |||
call json%add(p,"RTRPM",data%Equipments%DataDisplayConsole%RTRPM) | |||
call json%add(p,"WOP",data%Equipments%DataDisplayConsole%WOP) | |||
call json%add(p,"ROP",data%Equipments%DataDisplayConsole%ROP) | |||
call json%add(p,"MudWeightIn",data%Equipments%DataDisplayConsole%MudWeightIn) | |||
call json%add(p,"MudWeightOut",data%Equipments%DataDisplayConsole%MudWeightOut) | |||
call json%add(p,"Buzzer1",data%Equipments%DataDisplayConsole%Buzzer1) | |||
call json%add(p,"Buzzer2",data%Equipments%DataDisplayConsole%Buzzer2) | |||
call json%add(p,"Buzzer3",data%Equipments%DataDisplayConsole%Buzzer3) | |||
call json%add(p,"Buzzer4",data%Equipments%DataDisplayConsole%Buzzer4) | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine Set_TotalDepth(v) | |||
use SimulationVariables !@!!, only: data%Equipments%DrillingWatch%Depth | |||
! use CSimulationVariables, only: SetDistanceDrilled | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%TotalWellDepth = v | |||
data%Equipments%DrillingWatch%Depth = v | |||
! call SetDistanceDrilled(v) | |||
end subroutine | |||
subroutine Set_BitPosition(v) | |||
use SimulationVariables !@!!, only: data%Equipments%DrillingWatch%BitPosition | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%BitDepth = v | |||
data%Equipments%DrillingWatch%BitPosition = v | |||
end subroutine | |||
subroutine Set_RotaryTorque(v) | |||
use SimulationVariables !@!!, only: data%Equipments%DrillingWatch%Torque | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%RotaryTorqueGauge = v | |||
data%Equipments%DrillingWatch%Torque = v | |||
data%Equipments%DataDisplayConsole%RTTorque = v | |||
end subroutine | |||
subroutine Set_MudWeightIn(v) | |||
use SimulationVariables !@!, only: MudWeightInDw => data%Equipments%DataDisplayConsole%MudWeightIn | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%MudWeightIn = v | |||
data%Equipments%DrillingWatch%MudWeightIn = v | |||
end subroutine | |||
subroutine Set_MudWeightOut(v) | |||
use SimulationVariables !@!, only: MudWeightOutDw => data%Equipments%DataDisplayConsole%MudWeightOut | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%MudWeightOut = v | |||
data%Equipments%DrillingWatch%MudWeightOut = v | |||
end subroutine | |||
subroutine Set_TripTankVolume(v) | |||
use SimulationVariables !@!, only: data%Equipments%DrillingWatch%TripTankVolume | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DrillingWatch%TripTankVolume = v | |||
end subroutine | |||
subroutine Set_FillVolume(v) | |||
use SimulationVariables !@!, only: data%Equipments%DrillingWatch%FillVolume | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DrillingWatch%FillVolume = v | |||
end subroutine | |||
subroutine Set_HookLoad(v) | |||
use SimulationVariables !@!, only: HookLoadDw => data%Equipments%DataDisplayConsole%HookLoad | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%HookLoadPointer = v | |||
data%Equipments%DrillingWatch%HookLoad = v * 1000 | |||
data%Equipments%DataDisplayConsole%HookLoad = v | |||
end subroutine | |||
subroutine Set_WeightOnBit(v) | |||
use SimulationVariables !@!, only: data%Equipments%DrillingWatch%WeightOnBit | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%WOBPointer = v | |||
data%Equipments%DrillingWatch%WeightOnBit = v | |||
data%Equipments%DataDisplayConsole%WOP = v | |||
end subroutine | |||
subroutine Set_ROP(v) | |||
use SimulationVariables !@!, only: ROPDw => data%Equipments%DataDisplayConsole%ROP | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%ROP = v | |||
data%Equipments%DrillingWatch%ROP = v | |||
end subroutine | |||
subroutine Set_CasingPressure(v) | |||
use SimulationVariables !@!, only: CasingPressureDw => CasingPressure | |||
use CChokeControlPanelVariables | |||
use SimulationVariables!, only: CasingPressureChoke => CasingPressure | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%CasingPressureGauge = v | |||
data%Equipments%DrillingWatch%CasingPressure = v | |||
data%Equipments%ChokeControlPanel%CasingPressure = v | |||
data%Equipments%DataDisplayConsole%CasingPressure = v | |||
end subroutine | |||
subroutine Set_StandPipePressure(v) | |||
use SimulationVariables !@!, only: data%Equipments%DrillingWatch%PumpPressure | |||
use CChokeControlPanelVariables | |||
use SimulationVariables!, only: StandPipePressureChoke => data%Equipments%DataDisplayConsole%StandPipePressure | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%StandPipePressureGauge = v | |||
data%Equipments%DrillingWatch%PumpPressure = v | |||
data%Equipments%ChokeControlPanel%StandPipePressure = v | |||
data%Equipments%DataDisplayConsole%StandPipePressure = v | |||
end subroutine | |||
subroutine Set_RotaryRPMGauge(v) | |||
use SimulationVariables !@!, only: data%Equipments%DrillingWatch%RPM | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%RotaryRPMGauge = v | |||
data%Equipments%DrillingWatch%RPM = v | |||
data%Equipments%DataDisplayConsole%RTRPM = v | |||
! call data%Equipments%DataDisplayConsole%OnRotaryRpmChange%RunAll(v) | |||
end subroutine | |||
subroutine Set_MP1SPMGauge(v) | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%MP1SPMGauge = v | |||
data%Equipments%DataDisplayConsole%MP1SPM = v | |||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%Equipments%DataDisplayConsole%MP1SPMGauge, data%Equipments%DataDisplayConsole%MP2SPMGauge) | |||
# 411 | |||
end subroutine | |||
subroutine Set_MP2SPMGauge(v) | |||
implicit none | |||
real(8), intent(in) :: v | |||
data%Equipments%DataDisplayConsole%MP2SPMGauge = v | |||
data%Equipments%DataDisplayConsole%MP2SPM = v | |||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%Equipments%DataDisplayConsole%MP1SPMGauge, data%Equipments%DataDisplayConsole%MP2SPMGauge) | |||
# 422 | |||
end subroutine | |||
end module CDataDisplayConsole |
@@ -6,12 +6,12 @@ module CDataDisplayConsoleVariables | |||
Type :: DataDisplayConsoleType | |||
!portable | |||
real(8) :: TripAlarmLow | |||
real(8) :: TripAlarmHigh | |||
real(8) :: RetFlowAlarmLow | |||
real(8) :: RetFlowAlarmHigh | |||
real(8) :: PitAlarmLow | |||
real(8) :: PitAlarmHigh | |||
! real(8) :: TripAlarmLow | |||
! real(8) :: TripAlarmHigh | |||
! real(8) :: RetFlowAlarmLow | |||
! real(8) :: RetFlowAlarmHigh | |||
! real(8) :: PitAlarmLow | |||
! real(8) :: PitAlarmHigh | |||
real(8) :: PortWeightOnBit | |||
real(8) :: PortHookLoad | |||
@@ -97,10 +97,6 @@ module CDataDisplayConsoleVariables | |||
logical :: Buzzer4 | |||
End Type DataDisplayConsoleType | |||
! events | |||
! procedure (ActionDualDouble), pointer :: PumpsSpmChanges => null() | |||
contains | |||
end module CDataDisplayConsoleVariables |
@@ -0,0 +1,103 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CDataDisplayConsoleVariables.f90" | |||
module CDataDisplayConsoleVariables | |||
use CIActionReference | |||
! !**use CDoubleEventHandlerCollection | |||
implicit none | |||
public | |||
Type :: DataDisplayConsoleType | |||
!portable | |||
! real(8) :: TripAlarmLow | |||
! real(8) :: TripAlarmHigh | |||
! real(8) :: RetFlowAlarmLow | |||
! real(8) :: RetFlowAlarmHigh | |||
! real(8) :: PitAlarmLow | |||
! real(8) :: PitAlarmHigh | |||
real(8) :: PortWeightOnBit | |||
real(8) :: PortHookLoad | |||
real(8) :: PortCasingPressure | |||
real(8) :: PortPumpPressure | |||
! Input vars | |||
real(8) :: TripTankSetAlarmLow | |||
real(8) :: TripTankSetAlarmHigh | |||
integer :: TripTankSetAlarmSwitch | |||
logical :: TripTankPowerSwitch | |||
logical :: TripTankPumpSwitch | |||
logical :: TripTankHornSwitch | |||
logical :: AcidGasDetectionHornSwitch | |||
logical :: TotalStrokeCounterResetSwitch | |||
logical :: DrillingTrippingSelectorSwitch | |||
real(8) :: MVTSetAlarmLowKnob | |||
real(8) :: MVTSetAlarmHighKnob | |||
integer :: MVTSetAlarmSwitch | |||
logical :: MudTank1Switch | |||
logical :: MudTank2Switch | |||
logical :: MudTank3Switch | |||
logical :: MudTank4Switch | |||
real(8) :: MVTFineKnob | |||
real(8) :: MVTCoarseKnob | |||
logical :: MVTHornSwitch | |||
logical :: MVTDeviationTripSelectionSwitch | |||
logical :: MVTPowerSwitch | |||
logical :: MFFIResetTotalStrokes | |||
logical :: MFFIResetFillCounter | |||
integer :: MFFIPumpSelectorSwitch | |||
logical :: MFFIFillSPMSelectorSwitch | |||
real(8) :: MFFISetAlarmLowKnob | |||
real(8) :: MFFISetAlarmHighKnob | |||
integer :: MFFISetAlarmSwitch | |||
logical :: MFFIPowerSwitch | |||
logical :: MFFIHornSwitch | |||
logical :: ResetWob | |||
logical :: Clutch | |||
! Output vars | |||
real(8) :: WOBPointer | |||
real(8) :: HookLoadPointer | |||
real(8) :: TripTankGauge | |||
integer :: TripTankAlarmLED | |||
integer :: TripTankPumpLED | |||
real(8) :: StandPipePressureGauge | |||
real(8) :: CasingPressureGauge | |||
real(8) :: MP1SPMGauge | |||
real(8) :: MP2SPMGauge | |||
real(8) :: ReturnLineTempGauge | |||
real(8) :: RotaryTorqueGauge | |||
real(8) :: RotaryRPMGauge | |||
! !**type(DoubleEventHandlerCollection) :: OnRotaryRpmChange | |||
integer :: AcidGasDetectionLED | |||
real(8) :: TotalStrokeCounter | |||
!real(8) :: TotalStrokeCounter_temp | |||
real(8) :: PitGainLossGauge | |||
real(8) :: MudTanksVolumeGauge | |||
integer :: MVTAlarmLED | |||
real(8) :: ReturnMudFlowGauge | |||
real(8) :: FillStrokeCounter | |||
real(8) :: MFFITotalStrokeCounter | |||
integer :: MFFIAlarmLED | |||
integer :: MFFIPumpLED | |||
real(8) :: TotalWellDepth | |||
real(8) :: BitDepth | |||
real(8) :: HookLoad | |||
real(8) :: StandPipePressure | |||
real(8) :: CasingPressure | |||
real(8) :: MP1SPM | |||
real(8) :: MP2SPM | |||
real(8) :: RTTorque | |||
real(8) :: RTRPM | |||
real(8) :: WOP | |||
real(8) :: ROP | |||
real(8) :: MudWeightIn | |||
real(8) :: MudWeightOut | |||
logical :: Buzzer1 | |||
logical :: Buzzer2 | |||
logical :: Buzzer3 | |||
logical :: Buzzer4 | |||
End Type DataDisplayConsoleType | |||
contains | |||
end module CDataDisplayConsoleVariables |
@@ -10,6 +10,184 @@ module CDrillingConsole | |||
contains | |||
subroutine DrillingConsoleFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
call json%get(parent,'Drilling',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'AssignmentSwitch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%AssignmentSwitch) | |||
call json%get(p,'EmergencySwitch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%EmergencySwitch) | |||
call json%get(p,'RTTorqueLimitKnob',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%RTTorqueLimitKnob) | |||
call json%get(p,'MP1CPSwitchI',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP1CPSwitchI) | |||
call json%get(p,'MP1CPSwitchT',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP1CPSwitchT) | |||
call json%get(p,'MP1CPSwitch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP1CPSwitch) | |||
call json%get(p,'MP1ThrottleUpdate',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP1ThrottleUpdate) | |||
call json%get(p,'MP1Throttle',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP1Throttle) | |||
call json%get(p,'MP2SwitchI',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP2SwitchI) | |||
call json%get(p,'MP2SwitchT',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP2SwitchT) | |||
call json%get(p,'MP2Switch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP2Switch) | |||
call json%get(p,'MP2ThrottleUpdate',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP2ThrottleUpdate) | |||
call json%get(p,'MP2Throttle',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP2Throttle) | |||
call json%get(p,'DWSwitch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWSwitch) | |||
call json%get(p,'DWThrottle',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWThrottle) | |||
call json%get(p,'RTSwitch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%RTSwitch) | |||
call json%get(p,'RTThrottle',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%RTThrottle) | |||
call json%get(p,'DWBreak',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWBreak) | |||
call json%get(p,'PreviousDWBreak',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%PreviousDWBreak) | |||
call json%get(p,'ForceBreak',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%ForceBreak) | |||
call json%get(p,'DWAcceleretor',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWAcceleretor) | |||
call json%get(p,'DWTransmisionLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWTransmisionLever) | |||
call json%get(p,'DWPowerLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWPowerLever) | |||
call json%get(p,'TongLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%TongLever) | |||
call json%get(p,'RTTransmissionLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%RTTransmissionLever) | |||
call json%get(p,'DWClutchLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWClutchLever) | |||
call json%get(p,'EddyBreakLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%EddyBreakLever) | |||
call json%get(p,'AutoDW',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%AutoDW) | |||
call json%get(p,'GEN1',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%GEN1) | |||
call json%get(p,'GEN2',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%GEN2) | |||
call json%get(p,'GEN3',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%GEN3) | |||
call json%get(p,'GEN4',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%GEN4) | |||
call json%get(p,'Permission_OpenKellyCock',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_OpenKellyCock) | |||
call json%get(p,'OpenKellyCock',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%OpenKellyCock) | |||
call json%get(p,'Permission_CloseKellyCock',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_CloseKellyCock) | |||
call json%get(p,'CloseKellyCock',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%CloseKellyCock) | |||
call json%get(p,'Permission_OpenSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_OpenSafetyValve) | |||
call json%get(p,'OpenSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%OpenSafetyValve) | |||
call json%get(p,'Permission_CloseSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_CloseSafetyValve) | |||
call json%get(p,'CloseSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%CloseSafetyValve) | |||
call json%get(p,'Permission_IRSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_IRSafetyValve) | |||
call json%get(p,'IRSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%IRSafetyValve) | |||
call json%get(p,'Permission_IRIBop',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_IRIBop) | |||
call json%get(p,'IRIBop',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%IRIBop) | |||
call json%get(p,'LatchPipe',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%LatchPipe) | |||
call json%get(p,'UnlatchPipe',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%UnlatchPipe) | |||
call json%get(p,'Swing',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Swing) | |||
call json%get(p,'FillMouseHole',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%FillMouseHole) | |||
call json%get(p,'Slips',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Slips) | |||
call json%get(p,'BrakeLeverCoefficient',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%BrakeLeverCoefficient) | |||
call json%get(p,'HideDrillingBrake',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%HideDrillingBrake) | |||
call json%get(p,'ParkingBrakeBtn',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%ParkingBrakeBtn) | |||
! call json%get(p,'ParkingBrakeLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%ParkingBrakeLed) | |||
! call json%get(p,'GEN1LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN1LED) | |||
! call json%get(p,'GEN2LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN2LED) | |||
! call json%get(p,'GEN3LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN3LED) | |||
! call json%get(p,'GEN4LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN4LED) | |||
! call json%get(p,'SCR1LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%SCR1LED) | |||
! call json%get(p,'SCR2LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%SCR2LED) | |||
! call json%get(p,'SCR3LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%SCR3LED) | |||
! call json%get(p,'SCR4LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%SCR4LED) | |||
! call json%get(p,'MP1BLWR',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%MP1BLWR) | |||
! call json%get(p,'MP2BLWR',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%MP2BLWR) | |||
! call json%get(p,'DWBLWR',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%DWBLWR) | |||
! call json%get(p,'RTBLWR',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%RTBLWR) | |||
! call json%get(p,'PWRLIM',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%PWRLIM) | |||
! call json%get(p,'PWRLIMMTR',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%PWRLIMMTR) | |||
! call json%get(p,'RTTorqueLimitGauge',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%RTTorqueLimitGauge) | |||
! call json%get(p,'AutoDWLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%AutoDWLED) | |||
! call json%get(p,'GEN1BTNLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN1BTNLED) | |||
! call json%get(p,'GEN2BTNLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN2BTNLED) | |||
! call json%get(p,'GEN3BTNLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN3BTNLED) | |||
! call json%get(p,'GEN4BTNLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN4BTNLED) | |||
! call json%get(p,'OpenKellyCockLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%OpenKellyCockLed) | |||
! call json%get(p,'CloseKellyCockLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%CloseKellyCockLed) | |||
! call json%get(p,'OpenSafetyValveLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%OpenSafetyValveLed) | |||
! call json%get(p,'CloseSafetyValveLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%CloseSafetyValveLed) | |||
! call json%get(p,'IRSafetyValveLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%IRSafetyValveLed) | |||
! call json%get(p,'IRIBopLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%IRIBopLed) | |||
! call json%get(p,'LatchPipeLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%LatchPipeLED) | |||
! call json%get(p,'UnlatchPipeLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%UnlatchPipeLED) | |||
! call json%get(p,'SwingLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%SwingLed) | |||
! call json%get(p,'FillMouseHoleLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%FillMouseHoleLed) | |||
end subroutine | |||
subroutine DrillingConsoleToJson(parent) | |||
type(json_value),pointer :: parent | |||
@@ -18,89 +196,92 @@ module CDrillingConsole | |||
! 1. create new node | |||
call json%create_object(p,'Drilling') | |||
call json%add(p,"AssignmentSwitch",data%EquipmentControl%DrillingConsole%AssignmentSwitch) | |||
call json%add(p,"EmergencySwitch",data%EquipmentControl%DrillingConsole%EmergencySwitch) | |||
call json%add(p,"RTTorqueLimitKnob",data%EquipmentControl%DrillingConsole%RTTorqueLimitKnob) | |||
call json%add(p,"MP1CPSwitchI",data%EquipmentControl%DrillingConsole%MP1CPSwitchI) | |||
call json%add(p,"MP1CPSwitchT",data%EquipmentControl%DrillingConsole%MP1CPSwitchT) | |||
call json%add(p,"MP1CPSwitch",data%EquipmentControl%DrillingConsole%MP1CPSwitch) | |||
call json%add(p,"MP1ThrottleUpdate",data%EquipmentControl%DrillingConsole%MP1ThrottleUpdate) | |||
call json%add(p,"MP1Throttle",data%EquipmentControl%DrillingConsole%MP1Throttle) | |||
call json%add(p,"MP2SwitchI",data%EquipmentControl%DrillingConsole%MP2SwitchI) | |||
call json%add(p,"MP2SwitchT",data%EquipmentControl%DrillingConsole%MP2SwitchT) | |||
call json%add(p,"MP2Switch",data%EquipmentControl%DrillingConsole%MP2Switch) | |||
call json%add(p,"MP2ThrottleUpdate",data%EquipmentControl%DrillingConsole%MP2ThrottleUpdate) | |||
call json%add(p,"MP2Throttle",data%EquipmentControl%DrillingConsole%MP2Throttle) | |||
call json%add(p,"DWSwitch",data%EquipmentControl%DrillingConsole%DWSwitch) | |||
call json%add(p,"DWThrottle",data%EquipmentControl%DrillingConsole%DWThrottle) | |||
call json%add(p,"RTSwitch",data%EquipmentControl%DrillingConsole%RTSwitch) | |||
call json%add(p,"RTThrottle",data%EquipmentControl%DrillingConsole%RTThrottle) | |||
call json%add(p,"DWBreak",data%EquipmentControl%DrillingConsole%DWBreak) | |||
call json%add(p,"PreviousDWBreak",data%EquipmentControl%DrillingConsole%PreviousDWBreak) | |||
call json%add(p,"ForceBreak",data%EquipmentControl%DrillingConsole%ForceBreak) | |||
call json%add(p,"DWAcceleretor",data%EquipmentControl%DrillingConsole%DWAcceleretor) | |||
call json%add(p,"DWTransmisionLever",data%EquipmentControl%DrillingConsole%DWTransmisionLever) | |||
call json%add(p,"DWPowerLever",data%EquipmentControl%DrillingConsole%DWPowerLever) | |||
call json%add(p,"TongLever",data%EquipmentControl%DrillingConsole%TongLever) | |||
call json%add(p,"RTTransmissionLever",data%EquipmentControl%DrillingConsole%RTTransmissionLever) | |||
call json%add(p,"DWClutchLever",data%EquipmentControl%DrillingConsole%DWClutchLever) | |||
call json%add(p,"EddyBreakLever",data%EquipmentControl%DrillingConsole%EddyBreakLever) | |||
call json%add(p,"AutoDW",data%EquipmentControl%DrillingConsole%AutoDW) | |||
call json%add(p,"GEN1",data%EquipmentControl%DrillingConsole%GEN1) | |||
call json%add(p,"GEN2",data%EquipmentControl%DrillingConsole%GEN2) | |||
call json%add(p,"GEN3",data%EquipmentControl%DrillingConsole%GEN3) | |||
call json%add(p,"GEN4",data%EquipmentControl%DrillingConsole%GEN4) | |||
call json%add(p,"Permission_OpenKellyCock",data%EquipmentControl%DrillingConsole%Permission_OpenKellyCock) | |||
call json%add(p,"OpenKellyCock",data%EquipmentControl%DrillingConsole%OpenKellyCock) | |||
call json%add(p,"Permission_CloseKellyCock",data%EquipmentControl%DrillingConsole%Permission_CloseKellyCock) | |||
call json%add(p,"CloseKellyCock",data%EquipmentControl%DrillingConsole%CloseKellyCock) | |||
call json%add(p,"Permission_OpenSafetyValve",data%EquipmentControl%DrillingConsole%Permission_OpenSafetyValve) | |||
call json%add(p,"OpenSafetyValve",data%EquipmentControl%DrillingConsole%OpenSafetyValve) | |||
call json%add(p,"Permission_CloseSafetyValve",data%EquipmentControl%DrillingConsole%Permission_CloseSafetyValve) | |||
call json%add(p,"CloseSafetyValve",data%EquipmentControl%DrillingConsole%CloseSafetyValve) | |||
call json%add(p,"Permission_IRSafetyValve",data%EquipmentControl%DrillingConsole%Permission_IRSafetyValve) | |||
call json%add(p,"IRSafetyValve",data%EquipmentControl%DrillingConsole%IRSafetyValve) | |||
call json%add(p,"Permission_IRIBop",data%EquipmentControl%DrillingConsole%Permission_IRIBop) | |||
call json%add(p,"IRIBop",data%EquipmentControl%DrillingConsole%IRIBop) | |||
call json%add(p,"LatchPipe",data%EquipmentControl%DrillingConsole%LatchPipe) | |||
call json%add(p,"UnlatchPipe",data%EquipmentControl%DrillingConsole%UnlatchPipe) | |||
call json%add(p,"Swing",data%EquipmentControl%DrillingConsole%Swing) | |||
call json%add(p,"FillMouseHole",data%EquipmentControl%DrillingConsole%FillMouseHole) | |||
call json%add(p,"Slips",data%EquipmentControl%DrillingConsole%Slips) | |||
call json%add(p,"BrakeLeverCoefficient",data%EquipmentControl%DrillingConsole%BrakeLeverCoefficient) | |||
call json%add(p,"HideDrillingBrake",data%EquipmentControl%DrillingConsole%HideDrillingBrake) | |||
call json%add(p,"ParkingBrakeBtn",data%EquipmentControl%DrillingConsole%ParkingBrakeBtn) | |||
call json%add(p,"ParkingBrakeLed",data%EquipmentControl%DrillingConsole%ParkingBrakeLed) | |||
call json%add(p,"GEN1LED",data%EquipmentControl%DrillingConsole%GEN1LED) | |||
call json%add(p,"GEN2LED",data%EquipmentControl%DrillingConsole%GEN2LED) | |||
call json%add(p,"GEN3LED",data%EquipmentControl%DrillingConsole%GEN3LED) | |||
call json%add(p,"GEN4LED",data%EquipmentControl%DrillingConsole%GEN4LED) | |||
call json%add(p,"SCR1LED",data%EquipmentControl%DrillingConsole%SCR1LED) | |||
call json%add(p,"SCR2LED",data%EquipmentControl%DrillingConsole%SCR2LED) | |||
call json%add(p,"SCR3LED",data%EquipmentControl%DrillingConsole%SCR3LED) | |||
call json%add(p,"SCR4LED",data%EquipmentControl%DrillingConsole%SCR4LED) | |||
call json%add(p,"MP1BLWR",data%EquipmentControl%DrillingConsole%MP1BLWR) | |||
call json%add(p,"MP2BLWR",data%EquipmentControl%DrillingConsole%MP2BLWR) | |||
call json%add(p,"DWBLWR",data%EquipmentControl%DrillingConsole%DWBLWR) | |||
call json%add(p,"RTBLWR",data%EquipmentControl%DrillingConsole%RTBLWR) | |||
call json%add(p,"PWRLIM",data%EquipmentControl%DrillingConsole%PWRLIM) | |||
call json%add(p,"PWRLIMMTR",data%EquipmentControl%DrillingConsole%PWRLIMMTR) | |||
call json%add(p,"RTTorqueLimitGauge",data%EquipmentControl%DrillingConsole%RTTorqueLimitGauge) | |||
call json%add(p,"AutoDWLED",data%EquipmentControl%DrillingConsole%AutoDWLED) | |||
call json%add(p,"GEN1BTNLED",data%EquipmentControl%DrillingConsole%GEN1BTNLED) | |||
call json%add(p,"GEN2BTNLED",data%EquipmentControl%DrillingConsole%GEN2BTNLED) | |||
call json%add(p,"GEN3BTNLED",data%EquipmentControl%DrillingConsole%GEN3BTNLED) | |||
call json%add(p,"GEN4BTNLED",data%EquipmentControl%DrillingConsole%GEN4BTNLED) | |||
call json%add(p,"OpenKellyCockLed",data%EquipmentControl%DrillingConsole%OpenKellyCockLed) | |||
call json%add(p,"CloseKellyCockLed",data%EquipmentControl%DrillingConsole%CloseKellyCockLed) | |||
call json%add(p,"OpenSafetyValveLed",data%EquipmentControl%DrillingConsole%OpenSafetyValveLed) | |||
call json%add(p,"CloseSafetyValveLed",data%EquipmentControl%DrillingConsole%CloseSafetyValveLed) | |||
call json%add(p,"IRSafetyValveLed",data%EquipmentControl%DrillingConsole%IRSafetyValveLed) | |||
call json%add(p,"IRIBopLed",data%EquipmentControl%DrillingConsole%IRIBopLed) | |||
call json%add(p,"LatchPipeLED",data%EquipmentControl%DrillingConsole%LatchPipeLED) | |||
call json%add(p,"UnlatchPipeLED",data%EquipmentControl%DrillingConsole%UnlatchPipeLED) | |||
call json%add(p,"SwingLed",data%EquipmentControl%DrillingConsole%SwingLed) | |||
call json%add(p,"FillMouseHoleLed",data%EquipmentControl%DrillingConsole%FillMouseHoleLed) | |||
! call json%add(p,"AssignmentSwitch",data%Equipments%DrillingConsole%AssignmentSwitch) | |||
! call json%add(p,"EmergencySwitch",data%Equipments%DrillingConsole%EmergencySwitch) | |||
! call json%add(p,"RTTorqueLimitKnob",data%Equipments%DrillingConsole%RTTorqueLimitKnob) | |||
! call json%add(p,"MP1CPSwitchI",data%Equipments%DrillingConsole%MP1CPSwitchI) | |||
! call json%add(p,"MP1CPSwitchT",data%Equipments%DrillingConsole%MP1CPSwitchT) | |||
! call json%add(p,"MP1CPSwitch",data%Equipments%DrillingConsole%MP1CPSwitch) | |||
! call json%add(p,"MP1ThrottleUpdate",data%Equipments%DrillingConsole%MP1ThrottleUpdate) | |||
! call json%add(p,"MP1Throttle",data%Equipments%DrillingConsole%MP1Throttle) | |||
! call json%add(p,"MP2SwitchI",data%Equipments%DrillingConsole%MP2SwitchI) | |||
! call json%add(p,"MP2SwitchT",data%Equipments%DrillingConsole%MP2SwitchT) | |||
! call json%add(p,"MP2Switch",data%Equipments%DrillingConsole%MP2Switch) | |||
! call json%add(p,"MP2ThrottleUpdate",data%Equipments%DrillingConsole%MP2ThrottleUpdate) | |||
! call json%add(p,"MP2Throttle",data%Equipments%DrillingConsole%MP2Throttle) | |||
! call json%add(p,"DWSwitch",data%Equipments%DrillingConsole%DWSwitch) | |||
! call json%add(p,"DWThrottle",data%Equipments%DrillingConsole%DWThrottle) | |||
! call json%add(p,"RTSwitch",data%Equipments%DrillingConsole%RTSwitch) | |||
! call json%add(p,"RTThrottle",data%Equipments%DrillingConsole%RTThrottle) | |||
! call json%add(p,"DWBreak",data%Equipments%DrillingConsole%DWBreak) | |||
! call json%add(p,"PreviousDWBreak",data%Equipments%DrillingConsole%PreviousDWBreak) | |||
! call json%add(p,"ForceBreak",data%Equipments%DrillingConsole%ForceBreak) | |||
! call json%add(p,"DWAcceleretor",data%Equipments%DrillingConsole%DWAcceleretor) | |||
! call json%add(p,"DWTransmisionLever",data%Equipments%DrillingConsole%DWTransmisionLever) | |||
! call json%add(p,"DWPowerLever",data%Equipments%DrillingConsole%DWPowerLever) | |||
! call json%add(p,"TongLever",data%Equipments%DrillingConsole%TongLever) | |||
! call json%add(p,"RTTransmissionLever",data%Equipments%DrillingConsole%RTTransmissionLever) | |||
! call json%add(p,"DWClutchLever",data%Equipments%DrillingConsole%DWClutchLever) | |||
! call json%add(p,"EddyBreakLever",data%Equipments%DrillingConsole%EddyBreakLever) | |||
! call json%add(p,"AutoDW",data%Equipments%DrillingConsole%AutoDW) | |||
! call json%add(p,"GEN1",data%Equipments%DrillingConsole%GEN1) | |||
! call json%add(p,"GEN2",data%Equipments%DrillingConsole%GEN2) | |||
! call json%add(p,"GEN3",data%Equipments%DrillingConsole%GEN3) | |||
! call json%add(p,"GEN4",data%Equipments%DrillingConsole%GEN4) | |||
! call json%add(p,"Permission_OpenKellyCock",data%Equipments%DrillingConsole%Permission_OpenKellyCock) | |||
! call json%add(p,"OpenKellyCock",data%Equipments%DrillingConsole%OpenKellyCock) | |||
! call json%add(p,"Permission_CloseKellyCock",data%Equipments%DrillingConsole%Permission_CloseKellyCock) | |||
! call json%add(p,"CloseKellyCock",data%Equipments%DrillingConsole%CloseKellyCock) | |||
! call json%add(p,"Permission_OpenSafetyValve",data%Equipments%DrillingConsole%Permission_OpenSafetyValve) | |||
! call json%add(p,"OpenSafetyValve",data%Equipments%DrillingConsole%OpenSafetyValve) | |||
! call json%add(p,"Permission_CloseSafetyValve",data%Equipments%DrillingConsole%Permission_CloseSafetyValve) | |||
! call json%add(p,"CloseSafetyValve",data%Equipments%DrillingConsole%CloseSafetyValve) | |||
! call json%add(p,"Permission_IRSafetyValve",data%Equipments%DrillingConsole%Permission_IRSafetyValve) | |||
! call json%add(p,"IRSafetyValve",data%Equipments%DrillingConsole%IRSafetyValve) | |||
! call json%add(p,"Permission_IRIBop",data%Equipments%DrillingConsole%Permission_IRIBop) | |||
! call json%add(p,"IRIBop",data%Equipments%DrillingConsole%IRIBop) | |||
! call json%add(p,"LatchPipe",data%Equipments%DrillingConsole%LatchPipe) | |||
! call json%add(p,"UnlatchPipe",data%Equipments%DrillingConsole%UnlatchPipe) | |||
! call json%add(p,"Swing",data%Equipments%DrillingConsole%Swing) | |||
! call json%add(p,"FillMouseHole",data%Equipments%DrillingConsole%FillMouseHole) | |||
! call json%add(p,"Slips",data%Equipments%DrillingConsole%Slips) | |||
! call json%add(p,"BrakeLeverCoefficient",data%Equipments%DrillingConsole%BrakeLeverCoefficient) | |||
! call json%add(p,"HideDrillingBrake",data%Equipments%DrillingConsole%HideDrillingBrake) | |||
! call json%add(p,"ParkingBrakeBtn",data%Equipments%DrillingConsole%ParkingBrakeBtn) | |||
call json%add(p,"ParkingBrakeLed",data%Equipments%DrillingConsole%ParkingBrakeLed) | |||
call json%add(p,"GEN1LED",data%Equipments%DrillingConsole%GEN1LED) | |||
call json%add(p,"GEN2LED",data%Equipments%DrillingConsole%GEN2LED) | |||
call json%add(p,"GEN3LED",data%Equipments%DrillingConsole%GEN3LED) | |||
call json%add(p,"GEN4LED",data%Equipments%DrillingConsole%GEN4LED) | |||
call json%add(p,"SCR1LED",data%Equipments%DrillingConsole%SCR1LED) | |||
call json%add(p,"SCR2LED",data%Equipments%DrillingConsole%SCR2LED) | |||
call json%add(p,"SCR3LED",data%Equipments%DrillingConsole%SCR3LED) | |||
call json%add(p,"SCR4LED",data%Equipments%DrillingConsole%SCR4LED) | |||
call json%add(p,"MP1BLWR",data%Equipments%DrillingConsole%MP1BLWR) | |||
call json%add(p,"MP2BLWR",data%Equipments%DrillingConsole%MP2BLWR) | |||
call json%add(p,"DWBLWR",data%Equipments%DrillingConsole%DWBLWR) | |||
call json%add(p,"RTBLWR",data%Equipments%DrillingConsole%RTBLWR) | |||
call json%add(p,"PWRLIM",data%Equipments%DrillingConsole%PWRLIM) | |||
call json%add(p,"PWRLIMMTR",data%Equipments%DrillingConsole%PWRLIMMTR) | |||
call json%add(p,"RTTorqueLimitGauge",data%Equipments%DrillingConsole%RTTorqueLimitGauge) | |||
call json%add(p,"AutoDWLED",data%Equipments%DrillingConsole%AutoDWLED) | |||
call json%add(p,"GEN1BTNLED",data%Equipments%DrillingConsole%GEN1BTNLED) | |||
call json%add(p,"GEN2BTNLED",data%Equipments%DrillingConsole%GEN2BTNLED) | |||
call json%add(p,"GEN3BTNLED",data%Equipments%DrillingConsole%GEN3BTNLED) | |||
call json%add(p,"GEN4BTNLED",data%Equipments%DrillingConsole%GEN4BTNLED) | |||
call json%add(p,"OpenKellyCockLed",data%Equipments%DrillingConsole%OpenKellyCockLed) | |||
call json%add(p,"CloseKellyCockLed",data%Equipments%DrillingConsole%CloseKellyCockLed) | |||
call json%add(p,"OpenSafetyValveLed",data%Equipments%DrillingConsole%OpenSafetyValveLed) | |||
call json%add(p,"CloseSafetyValveLed",data%Equipments%DrillingConsole%CloseSafetyValveLed) | |||
call json%add(p,"IRSafetyValveLed",data%Equipments%DrillingConsole%IRSafetyValveLed) | |||
call json%add(p,"IRIBopLed",data%Equipments%DrillingConsole%IRIBopLed) | |||
call json%add(p,"LatchPipeLED",data%Equipments%DrillingConsole%LatchPipeLED) | |||
call json%add(p,"UnlatchPipeLED",data%Equipments%DrillingConsole%UnlatchPipeLED) | |||
call json%add(p,"SwingLed",data%Equipments%DrillingConsole%SwingLed) | |||
call json%add(p,"FillMouseHoleLed",data%Equipments%DrillingConsole%FillMouseHoleLed) | |||
call json%add(parent,p) | |||
end subroutine | |||
@@ -0,0 +1,290 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CDrillingConsole.f90" | |||
module CDrillingConsole | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables | |||
! use CSimulationVariables | |||
use CLog4 | |||
use CLog3 | |||
implicit none | |||
public | |||
contains | |||
subroutine DrillingConsoleFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
call json%get(parent,'Drilling',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'AssignmentSwitch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%AssignmentSwitch) | |||
call json%get(p,'EmergencySwitch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%EmergencySwitch) | |||
call json%get(p,'RTTorqueLimitKnob',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%RTTorqueLimitKnob) | |||
call json%get(p,'MP1CPSwitchI',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP1CPSwitchI) | |||
call json%get(p,'MP1CPSwitchT',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP1CPSwitchT) | |||
call json%get(p,'MP1CPSwitch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP1CPSwitch) | |||
call json%get(p,'MP1ThrottleUpdate',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP1ThrottleUpdate) | |||
call json%get(p,'MP1Throttle',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP1Throttle) | |||
call json%get(p,'MP2SwitchI',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP2SwitchI) | |||
call json%get(p,'MP2SwitchT',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP2SwitchT) | |||
call json%get(p,'MP2Switch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP2Switch) | |||
call json%get(p,'MP2ThrottleUpdate',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP2ThrottleUpdate) | |||
call json%get(p,'MP2Throttle',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%MP2Throttle) | |||
call json%get(p,'DWSwitch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWSwitch) | |||
call json%get(p,'DWThrottle',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWThrottle) | |||
call json%get(p,'RTSwitch',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%RTSwitch) | |||
call json%get(p,'RTThrottle',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%RTThrottle) | |||
call json%get(p,'DWBreak',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWBreak) | |||
call json%get(p,'PreviousDWBreak',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%PreviousDWBreak) | |||
call json%get(p,'ForceBreak',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%ForceBreak) | |||
call json%get(p,'DWAcceleretor',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWAcceleretor) | |||
call json%get(p,'DWTransmisionLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWTransmisionLever) | |||
call json%get(p,'DWPowerLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWPowerLever) | |||
call json%get(p,'TongLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%TongLever) | |||
call json%get(p,'RTTransmissionLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%RTTransmissionLever) | |||
call json%get(p,'DWClutchLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%DWClutchLever) | |||
call json%get(p,'EddyBreakLever',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%EddyBreakLever) | |||
call json%get(p,'AutoDW',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%AutoDW) | |||
call json%get(p,'GEN1',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%GEN1) | |||
call json%get(p,'GEN2',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%GEN2) | |||
call json%get(p,'GEN3',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%GEN3) | |||
call json%get(p,'GEN4',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%GEN4) | |||
call json%get(p,'Permission_OpenKellyCock',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_OpenKellyCock) | |||
call json%get(p,'OpenKellyCock',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%OpenKellyCock) | |||
call json%get(p,'Permission_CloseKellyCock',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_CloseKellyCock) | |||
call json%get(p,'CloseKellyCock',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%CloseKellyCock) | |||
call json%get(p,'Permission_OpenSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_OpenSafetyValve) | |||
call json%get(p,'OpenSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%OpenSafetyValve) | |||
call json%get(p,'Permission_CloseSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_CloseSafetyValve) | |||
call json%get(p,'CloseSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%CloseSafetyValve) | |||
call json%get(p,'Permission_IRSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_IRSafetyValve) | |||
call json%get(p,'IRSafetyValve',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%IRSafetyValve) | |||
call json%get(p,'Permission_IRIBop',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Permission_IRIBop) | |||
call json%get(p,'IRIBop',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%IRIBop) | |||
call json%get(p,'LatchPipe',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%LatchPipe) | |||
call json%get(p,'UnlatchPipe',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%UnlatchPipe) | |||
call json%get(p,'Swing',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Swing) | |||
call json%get(p,'FillMouseHole',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%FillMouseHole) | |||
call json%get(p,'Slips',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%Slips) | |||
call json%get(p,'BrakeLeverCoefficient',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%BrakeLeverCoefficient) | |||
call json%get(p,'HideDrillingBrake',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%HideDrillingBrake) | |||
call json%get(p,'ParkingBrakeBtn',pval) | |||
call json%get(pval,data%Equipments%DrillingConsole%ParkingBrakeBtn) | |||
! call json%get(p,'ParkingBrakeLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%ParkingBrakeLed) | |||
! call json%get(p,'GEN1LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN1LED) | |||
! call json%get(p,'GEN2LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN2LED) | |||
! call json%get(p,'GEN3LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN3LED) | |||
! call json%get(p,'GEN4LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN4LED) | |||
! call json%get(p,'SCR1LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%SCR1LED) | |||
! call json%get(p,'SCR2LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%SCR2LED) | |||
! call json%get(p,'SCR3LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%SCR3LED) | |||
! call json%get(p,'SCR4LED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%SCR4LED) | |||
! call json%get(p,'MP1BLWR',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%MP1BLWR) | |||
! call json%get(p,'MP2BLWR',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%MP2BLWR) | |||
! call json%get(p,'DWBLWR',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%DWBLWR) | |||
! call json%get(p,'RTBLWR',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%RTBLWR) | |||
! call json%get(p,'PWRLIM',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%PWRLIM) | |||
! call json%get(p,'PWRLIMMTR',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%PWRLIMMTR) | |||
! call json%get(p,'RTTorqueLimitGauge',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%RTTorqueLimitGauge) | |||
! call json%get(p,'AutoDWLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%AutoDWLED) | |||
! call json%get(p,'GEN1BTNLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN1BTNLED) | |||
! call json%get(p,'GEN2BTNLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN2BTNLED) | |||
! call json%get(p,'GEN3BTNLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN3BTNLED) | |||
! call json%get(p,'GEN4BTNLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%GEN4BTNLED) | |||
! call json%get(p,'OpenKellyCockLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%OpenKellyCockLed) | |||
! call json%get(p,'CloseKellyCockLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%CloseKellyCockLed) | |||
! call json%get(p,'OpenSafetyValveLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%OpenSafetyValveLed) | |||
! call json%get(p,'CloseSafetyValveLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%CloseSafetyValveLed) | |||
! call json%get(p,'IRSafetyValveLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%IRSafetyValveLed) | |||
! call json%get(p,'IRIBopLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%IRIBopLed) | |||
! call json%get(p,'LatchPipeLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%LatchPipeLED) | |||
! call json%get(p,'UnlatchPipeLED',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%UnlatchPipeLED) | |||
! call json%get(p,'SwingLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%SwingLed) | |||
! call json%get(p,'FillMouseHoleLed',pval) | |||
! call json%get(pval,data%Equipments%DrillingConsole%FillMouseHoleLed) | |||
end subroutine | |||
subroutine DrillingConsoleToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Drilling') | |||
! call json%add(p,"AssignmentSwitch",data%Equipments%DrillingConsole%AssignmentSwitch) | |||
! call json%add(p,"EmergencySwitch",data%Equipments%DrillingConsole%EmergencySwitch) | |||
! call json%add(p,"RTTorqueLimitKnob",data%Equipments%DrillingConsole%RTTorqueLimitKnob) | |||
! call json%add(p,"MP1CPSwitchI",data%Equipments%DrillingConsole%MP1CPSwitchI) | |||
! call json%add(p,"MP1CPSwitchT",data%Equipments%DrillingConsole%MP1CPSwitchT) | |||
! call json%add(p,"MP1CPSwitch",data%Equipments%DrillingConsole%MP1CPSwitch) | |||
! call json%add(p,"MP1ThrottleUpdate",data%Equipments%DrillingConsole%MP1ThrottleUpdate) | |||
! call json%add(p,"MP1Throttle",data%Equipments%DrillingConsole%MP1Throttle) | |||
! call json%add(p,"MP2SwitchI",data%Equipments%DrillingConsole%MP2SwitchI) | |||
! call json%add(p,"MP2SwitchT",data%Equipments%DrillingConsole%MP2SwitchT) | |||
! call json%add(p,"MP2Switch",data%Equipments%DrillingConsole%MP2Switch) | |||
! call json%add(p,"MP2ThrottleUpdate",data%Equipments%DrillingConsole%MP2ThrottleUpdate) | |||
! call json%add(p,"MP2Throttle",data%Equipments%DrillingConsole%MP2Throttle) | |||
! call json%add(p,"DWSwitch",data%Equipments%DrillingConsole%DWSwitch) | |||
! call json%add(p,"DWThrottle",data%Equipments%DrillingConsole%DWThrottle) | |||
! call json%add(p,"RTSwitch",data%Equipments%DrillingConsole%RTSwitch) | |||
! call json%add(p,"RTThrottle",data%Equipments%DrillingConsole%RTThrottle) | |||
! call json%add(p,"DWBreak",data%Equipments%DrillingConsole%DWBreak) | |||
! call json%add(p,"PreviousDWBreak",data%Equipments%DrillingConsole%PreviousDWBreak) | |||
! call json%add(p,"ForceBreak",data%Equipments%DrillingConsole%ForceBreak) | |||
! call json%add(p,"DWAcceleretor",data%Equipments%DrillingConsole%DWAcceleretor) | |||
! call json%add(p,"DWTransmisionLever",data%Equipments%DrillingConsole%DWTransmisionLever) | |||
! call json%add(p,"DWPowerLever",data%Equipments%DrillingConsole%DWPowerLever) | |||
! call json%add(p,"TongLever",data%Equipments%DrillingConsole%TongLever) | |||
! call json%add(p,"RTTransmissionLever",data%Equipments%DrillingConsole%RTTransmissionLever) | |||
! call json%add(p,"DWClutchLever",data%Equipments%DrillingConsole%DWClutchLever) | |||
! call json%add(p,"EddyBreakLever",data%Equipments%DrillingConsole%EddyBreakLever) | |||
! call json%add(p,"AutoDW",data%Equipments%DrillingConsole%AutoDW) | |||
! call json%add(p,"GEN1",data%Equipments%DrillingConsole%GEN1) | |||
! call json%add(p,"GEN2",data%Equipments%DrillingConsole%GEN2) | |||
! call json%add(p,"GEN3",data%Equipments%DrillingConsole%GEN3) | |||
! call json%add(p,"GEN4",data%Equipments%DrillingConsole%GEN4) | |||
! call json%add(p,"Permission_OpenKellyCock",data%Equipments%DrillingConsole%Permission_OpenKellyCock) | |||
! call json%add(p,"OpenKellyCock",data%Equipments%DrillingConsole%OpenKellyCock) | |||
! call json%add(p,"Permission_CloseKellyCock",data%Equipments%DrillingConsole%Permission_CloseKellyCock) | |||
! call json%add(p,"CloseKellyCock",data%Equipments%DrillingConsole%CloseKellyCock) | |||
! call json%add(p,"Permission_OpenSafetyValve",data%Equipments%DrillingConsole%Permission_OpenSafetyValve) | |||
! call json%add(p,"OpenSafetyValve",data%Equipments%DrillingConsole%OpenSafetyValve) | |||
! call json%add(p,"Permission_CloseSafetyValve",data%Equipments%DrillingConsole%Permission_CloseSafetyValve) | |||
! call json%add(p,"CloseSafetyValve",data%Equipments%DrillingConsole%CloseSafetyValve) | |||
! call json%add(p,"Permission_IRSafetyValve",data%Equipments%DrillingConsole%Permission_IRSafetyValve) | |||
! call json%add(p,"IRSafetyValve",data%Equipments%DrillingConsole%IRSafetyValve) | |||
! call json%add(p,"Permission_IRIBop",data%Equipments%DrillingConsole%Permission_IRIBop) | |||
! call json%add(p,"IRIBop",data%Equipments%DrillingConsole%IRIBop) | |||
! call json%add(p,"LatchPipe",data%Equipments%DrillingConsole%LatchPipe) | |||
! call json%add(p,"UnlatchPipe",data%Equipments%DrillingConsole%UnlatchPipe) | |||
! call json%add(p,"Swing",data%Equipments%DrillingConsole%Swing) | |||
! call json%add(p,"FillMouseHole",data%Equipments%DrillingConsole%FillMouseHole) | |||
! call json%add(p,"Slips",data%Equipments%DrillingConsole%Slips) | |||
! call json%add(p,"BrakeLeverCoefficient",data%Equipments%DrillingConsole%BrakeLeverCoefficient) | |||
! call json%add(p,"HideDrillingBrake",data%Equipments%DrillingConsole%HideDrillingBrake) | |||
! call json%add(p,"ParkingBrakeBtn",data%Equipments%DrillingConsole%ParkingBrakeBtn) | |||
call json%add(p,"ParkingBrakeLed",data%Equipments%DrillingConsole%ParkingBrakeLed) | |||
call json%add(p,"GEN1LED",data%Equipments%DrillingConsole%GEN1LED) | |||
call json%add(p,"GEN2LED",data%Equipments%DrillingConsole%GEN2LED) | |||
call json%add(p,"GEN3LED",data%Equipments%DrillingConsole%GEN3LED) | |||
call json%add(p,"GEN4LED",data%Equipments%DrillingConsole%GEN4LED) | |||
call json%add(p,"SCR1LED",data%Equipments%DrillingConsole%SCR1LED) | |||
call json%add(p,"SCR2LED",data%Equipments%DrillingConsole%SCR2LED) | |||
call json%add(p,"SCR3LED",data%Equipments%DrillingConsole%SCR3LED) | |||
call json%add(p,"SCR4LED",data%Equipments%DrillingConsole%SCR4LED) | |||
call json%add(p,"MP1BLWR",data%Equipments%DrillingConsole%MP1BLWR) | |||
call json%add(p,"MP2BLWR",data%Equipments%DrillingConsole%MP2BLWR) | |||
call json%add(p,"DWBLWR",data%Equipments%DrillingConsole%DWBLWR) | |||
call json%add(p,"RTBLWR",data%Equipments%DrillingConsole%RTBLWR) | |||
call json%add(p,"PWRLIM",data%Equipments%DrillingConsole%PWRLIM) | |||
call json%add(p,"PWRLIMMTR",data%Equipments%DrillingConsole%PWRLIMMTR) | |||
call json%add(p,"RTTorqueLimitGauge",data%Equipments%DrillingConsole%RTTorqueLimitGauge) | |||
call json%add(p,"AutoDWLED",data%Equipments%DrillingConsole%AutoDWLED) | |||
call json%add(p,"GEN1BTNLED",data%Equipments%DrillingConsole%GEN1BTNLED) | |||
call json%add(p,"GEN2BTNLED",data%Equipments%DrillingConsole%GEN2BTNLED) | |||
call json%add(p,"GEN3BTNLED",data%Equipments%DrillingConsole%GEN3BTNLED) | |||
call json%add(p,"GEN4BTNLED",data%Equipments%DrillingConsole%GEN4BTNLED) | |||
call json%add(p,"OpenKellyCockLed",data%Equipments%DrillingConsole%OpenKellyCockLed) | |||
call json%add(p,"CloseKellyCockLed",data%Equipments%DrillingConsole%CloseKellyCockLed) | |||
call json%add(p,"OpenSafetyValveLed",data%Equipments%DrillingConsole%OpenSafetyValveLed) | |||
call json%add(p,"CloseSafetyValveLed",data%Equipments%DrillingConsole%CloseSafetyValveLed) | |||
call json%add(p,"IRSafetyValveLed",data%Equipments%DrillingConsole%IRSafetyValveLed) | |||
call json%add(p,"IRIBopLed",data%Equipments%DrillingConsole%IRIBopLed) | |||
call json%add(p,"LatchPipeLED",data%Equipments%DrillingConsole%LatchPipeLED) | |||
call json%add(p,"UnlatchPipeLED",data%Equipments%DrillingConsole%UnlatchPipeLED) | |||
call json%add(p,"SwingLed",data%Equipments%DrillingConsole%SwingLed) | |||
call json%add(p,"FillMouseHoleLed",data%Equipments%DrillingConsole%FillMouseHoleLed) | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CDrillingConsole |
@@ -23,20 +23,13 @@ module CDrillingConsoleVariables | |||
real(8) :: DWThrottle | |||
integer :: RTSwitch | |||
real(8) :: RTThrottle | |||
real(8) :: DWBreak | |||
real(8) :: PreviousDWBreak | |||
logical :: ForceBreak = .false. | |||
real(8) :: DWAcceleretor | |||
real(8) :: DWTransmisionLever | |||
real(8) :: DWPowerLever | |||
real(8) :: TongLever | |||
! ! type(VoidEventHandlerCollection) :: OnBreakoutLeverPress | |||
! ! type(VoidEventHandlerCollection) :: OnMakeupLeverPress | |||
! ! type(VoidEventHandlerCollection) :: OnTongNeutralPress | |||
real(8) :: RTTransmissionLever | |||
real(8) :: DWClutchLever | |||
real(8) :: EddyBreakLever | |||
@@ -47,52 +40,23 @@ module CDrillingConsoleVariables | |||
logical :: GEN4 | |||
logical :: Permission_OpenKellyCock = .false. | |||
logical :: OpenKellyCock | |||
! ! type(VoidEventHandlerCollection) :: OnOpenKellyCockPress | |||
logical :: Permission_CloseKellyCock = .false. | |||
logical :: CloseKellyCock | |||
! ! type(VoidEventHandlerCollection) :: OnCloseKellyCockPress | |||
logical :: Permission_OpenSafetyValve = .false. | |||
logical :: OpenSafetyValve | |||
! typeVoidEventHandlerCollection) :: OnOpenSafetyValvePress | |||
logical :: Permission_CloseSafetyValve = .false. | |||
logical :: CloseSafetyValve | |||
! typeVoidEventHandlerCollection) :: OnCloseSafetyValvePress | |||
logical :: Permission_IRSafetyValve = .false. | |||
logical :: IRSafetyValve | |||
! typeVoidEventHandlerCollection) :: OnIRSafetyValvePress | |||
logical :: Permission_IRIBop = .false. | |||
logical :: IRIBop | |||
! typeVoidEventHandlerCollection) :: OnIRIBopPress | |||
logical :: LatchPipe | |||
! typeVoidEventHandlerCollection) :: OnLatchPipePress | |||
logical :: UnlatchPipe | |||
! typeVoidEventHandlerCollection) :: OnUnlatchPipePress | |||
logical :: Swing | |||
! typeVoidEventHandlerCollection) :: OnSwingPress | |||
logical :: FillMouseHole | |||
! typeVoidEventHandlerCollection) :: OnFillMouseHolePress | |||
logical :: Slips | |||
! typeVoidEventHandlerCollection) :: OnSlipsPress | |||
!logical :: TopDriveIBop | |||
! | |||
!logical :: TopDriveDrillTorque | |||
!integer :: TopDriveRevOffFwd | |||
!integer :: TopDriveDrillOffTilt | |||
real :: BrakeLeverCoefficient | |||
logical :: HideDrillingBrake | |||
logical :: ParkingBrakeBtn | |||
! Output vars | |||
@@ -0,0 +1,98 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CDrillingConsoleVariables.f90" | |||
module CDrillingConsoleVariables | |||
! use CVoidEventHandlerCollection | |||
implicit none | |||
public | |||
TYPE, PUBLIC :: DrillingConsoleType | |||
! Input vars | |||
integer :: AssignmentSwitch | |||
logical :: EmergencySwitch | |||
real(8) :: RTTorqueLimitKnob | |||
integer :: MP1CPSwitchI = 0 !for not turning on pump1 on simulation start | |||
integer :: MP1CPSwitchT !for not turning on pump1 on simulation start | |||
integer :: MP1CPSwitch | |||
logical :: MP1ThrottleUpdate = .false. | |||
real(8) :: MP1Throttle = -1.0 | |||
integer :: MP2SwitchI = 0 !for not turning on pump2 on simulation start | |||
logical :: MP2SwitchT !for not turning on pump2 on simulation start | |||
logical :: MP2Switch | |||
logical :: MP2ThrottleUpdate = .false. | |||
real(8) :: MP2Throttle = -1.0 | |||
integer :: DWSwitch | |||
real(8) :: DWThrottle | |||
integer :: RTSwitch | |||
real(8) :: RTThrottle | |||
real(8) :: DWBreak | |||
real(8) :: PreviousDWBreak | |||
logical :: ForceBreak = .false. | |||
real(8) :: DWAcceleretor | |||
real(8) :: DWTransmisionLever | |||
real(8) :: DWPowerLever | |||
real(8) :: TongLever | |||
real(8) :: RTTransmissionLever | |||
real(8) :: DWClutchLever | |||
real(8) :: EddyBreakLever | |||
logical :: AutoDW | |||
logical :: GEN1 | |||
logical :: GEN2 | |||
logical :: GEN3 | |||
logical :: GEN4 | |||
logical :: Permission_OpenKellyCock = .false. | |||
logical :: OpenKellyCock | |||
logical :: Permission_CloseKellyCock = .false. | |||
logical :: CloseKellyCock | |||
logical :: Permission_OpenSafetyValve = .false. | |||
logical :: OpenSafetyValve | |||
logical :: Permission_CloseSafetyValve = .false. | |||
logical :: CloseSafetyValve | |||
logical :: Permission_IRSafetyValve = .false. | |||
logical :: IRSafetyValve | |||
logical :: Permission_IRIBop = .false. | |||
logical :: IRIBop | |||
logical :: LatchPipe | |||
logical :: UnlatchPipe | |||
logical :: Swing | |||
logical :: FillMouseHole | |||
logical :: Slips | |||
real :: BrakeLeverCoefficient | |||
logical :: HideDrillingBrake | |||
logical :: ParkingBrakeBtn | |||
! Output vars | |||
logical :: ParkingBrakeLed | |||
integer :: GEN1LED | |||
integer :: GEN2LED | |||
integer :: GEN3LED | |||
integer :: GEN4LED | |||
integer :: SCR1LED | |||
integer :: SCR2LED | |||
integer :: SCR3LED | |||
integer :: SCR4LED | |||
integer :: MP1BLWR | |||
integer :: MP2BLWR | |||
integer :: DWBLWR | |||
integer :: RTBLWR | |||
integer :: PWRLIM | |||
real(8) :: PWRLIMMTR | |||
real(8) :: RTTorqueLimitGauge | |||
integer :: AutoDWLED | |||
integer :: GEN1BTNLED | |||
integer :: GEN2BTNLED | |||
integer :: GEN3BTNLED | |||
integer :: GEN4BTNLED | |||
integer :: OpenKellyCockLed | |||
integer :: CloseKellyCockLed | |||
integer :: OpenSafetyValveLed | |||
integer :: CloseSafetyValveLed | |||
integer :: IRSafetyValveLed | |||
integer :: IRIBopLed | |||
integer :: LatchPipeLED | |||
integer :: UnlatchPipeLED | |||
integer :: SwingLed | |||
integer :: FillMouseHoleLed | |||
END TYPE DrillingConsoleType | |||
end module CDrillingConsoleVariables |
@@ -5,6 +5,21 @@ module CHook | |||
public | |||
contains | |||
subroutine HookFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
! call json%get(parent,'Hook',p) | |||
! ! 2. get member of data type from node | |||
! call json%get(p,'HookHeight_S',pval) | |||
! call json%get(pval,data%Equipments%Hook%HookHeight_S) | |||
! call json%get(p,'HookHeight',pval) | |||
! call json%get(pval,data%Equipments%Hook%HookHeight) | |||
end subroutine | |||
subroutine HookToJson(parent) | |||
type(json_value),pointer :: parent | |||
@@ -13,33 +28,32 @@ module CHook | |||
! 1. create new node | |||
call json%create_object(p,'Hook') | |||
call json%add(p,"HookHeight_S",data%EquipmentControl%Hook%HookHeight_S) | |||
call json%add(p,"HookHeight",data%EquipmentControl%Hook%HookHeight) | |||
call json%add(p,"HookHeight_S",data%Equipments%Hook%HookHeight_S) | |||
call json%add(p,"HookHeight",data%Equipments%Hook%HookHeight) | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine Set_HookHeight(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables | |||
use SimulationVariables | |||
implicit none | |||
real , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%EquipmentControl%Hook%HookHeight == v) return | |||
#endif | |||
data%EquipmentControl%Hook%HookHeight = v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Equipments%Hook%HookHeight == v) return | |||
#endif | |||
data%Equipments%Hook%HookHeight = v | |||
! if(associated(HookHeightPtr)) then | |||
! call HookHeightPtr(data%EquipmentControl%Hook%HookHeight) | |||
! call HookHeightPtr(data%Equipments%Hook%HookHeight) | |||
! end if | |||
#ifdef deb | |||
print*, 'HookHeight=', data%EquipmentControl%Hook%HookHeight | |||
#endif | |||
#ifdef deb | |||
print*, 'HookHeight=', data%Equipments%Hook%HookHeight | |||
#endif | |||
!**call data%EquipmentControl%Hook%OnHookHeightChange%RunAll(data%EquipmentControl%Hook%HookHeight) | |||
!**call data%Equipments%Hook%OnHookHeightChange%RunAll(data%Equipments%Hook%HookHeight) | |||
end subroutine | |||
@@ -47,12 +61,12 @@ module CHook | |||
implicit none | |||
real , intent(in) :: v | |||
if(v == data%EquipmentControl%Hook%HookHeight) then | |||
if(v == data%Equipments%Hook%HookHeight) then | |||
return | |||
elseif (v > data%EquipmentControl%Hook%HookHeight) then | |||
elseif (v > data%Equipments%Hook%HookHeight) then | |||
loop1: do | |||
call Set_HookHeight(data%EquipmentControl%Hook%HookHeight + 0.2) | |||
if(abs(v - data%EquipmentControl%Hook%HookHeight) <= 0.1) then | |||
call Set_HookHeight(data%Equipments%Hook%HookHeight + 0.2) | |||
if(abs(v - data%Equipments%Hook%HookHeight) <= 0.1) then | |||
call Set_HookHeight(v) | |||
exit loop1 | |||
endif | |||
@@ -60,8 +74,8 @@ module CHook | |||
enddo loop1 | |||
else ! v < HookHeight | |||
loop2: do | |||
call Set_HookHeight(data%EquipmentControl%Hook%HookHeight - 0.2) | |||
if(abs(data%EquipmentControl%Hook%HookHeight - v) <= 0.1) then | |||
call Set_HookHeight(data%Equipments%Hook%HookHeight - 0.2) | |||
if(abs(data%Equipments%Hook%HookHeight - v) <= 0.1) then | |||
call Set_HookHeight(v) | |||
exit loop2 | |||
endif | |||
@@ -73,6 +87,6 @@ module CHook | |||
subroutine Update_HookHeight_From_Snapshot() | |||
implicit none | |||
call Set_HookHeight_S(data%EquipmentControl%Hook%HookHeight_S) | |||
call Set_HookHeight_S(data%Equipments%Hook%HookHeight_S) | |||
end subroutine | |||
end module CHook |
@@ -0,0 +1,93 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CHook.f90" | |||
module CHook | |||
use CHookVariables | |||
use SimulationVariables | |||
implicit none | |||
public | |||
contains | |||
subroutine HookFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
! 1. get related root | |||
! call json%get(parent,'Hook',p) | |||
! ! 2. get member of data type from node | |||
! call json%get(p,'HookHeight_S',pval) | |||
! call json%get(pval,data%Equipments%Hook%HookHeight_S) | |||
! call json%get(p,'HookHeight',pval) | |||
! call json%get(pval,data%Equipments%Hook%HookHeight) | |||
end subroutine | |||
subroutine HookToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'Hook') | |||
call json%add(p,"HookHeight_S",data%Equipments%Hook%HookHeight_S) | |||
call json%add(p,"HookHeight",data%Equipments%Hook%HookHeight) | |||
call json%add(parent,p) | |||
end subroutine | |||
subroutine Set_HookHeight(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
implicit none | |||
real , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%Equipments%Hook%HookHeight == v) return | |||
#endif | |||
data%Equipments%Hook%HookHeight = v | |||
! if(associated(HookHeightPtr)) then | |||
! call HookHeightPtr(data%Equipments%Hook%HookHeight) | |||
! end if | |||
#ifdef deb | |||
print*, 'HookHeight=', data%Equipments%Hook%HookHeight | |||
#endif | |||
!**call data%Equipments%Hook%OnHookHeightChange%RunAll(data%Equipments%Hook%HookHeight) | |||
end subroutine | |||
subroutine Set_HookHeight_S(v) | |||
implicit none | |||
real , intent(in) :: v | |||
if(v == data%Equipments%Hook%HookHeight) then | |||
return | |||
elseif (v > data%Equipments%Hook%HookHeight) then | |||
loop1: do | |||
call Set_HookHeight(data%Equipments%Hook%HookHeight + 0.2) | |||
if(abs(v - data%Equipments%Hook%HookHeight) <= 0.1) then | |||
call Set_HookHeight(v) | |||
exit loop1 | |||
endif | |||
call sleepqq(100) | |||
enddo loop1 | |||
else ! v < HookHeight | |||
loop2: do | |||
call Set_HookHeight(data%Equipments%Hook%HookHeight - 0.2) | |||
if(abs(data%Equipments%Hook%HookHeight - v) <= 0.1) then | |||
call Set_HookHeight(v) | |||
exit loop2 | |||
endif | |||
call sleepqq(100) | |||
enddo loop2 | |||
endif | |||
end subroutine | |||
subroutine Update_HookHeight_From_Snapshot() | |||
implicit none | |||
call Set_HookHeight_S(data%Equipments%Hook%HookHeight_S) | |||
end subroutine | |||
end module CHook |
@@ -5,7 +5,6 @@ module CHookVariables | |||
Type :: HookType | |||
real :: HookHeight_S = 0.0 | |||
real :: HookHeight | |||
!**type(RealEventHandlerCollection) :: OnHookHeightChange | |||
end type HookType | |||
@@ -0,0 +1,16 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CHookVariables.f90" | |||
module CHookVariables | |||
!**use CRealEventHandlerCollection | |||
! use CHookActions | |||
implicit none | |||
Type :: HookType | |||
real :: HookHeight_S = 0.0 | |||
real :: HookHeight | |||
end type HookType | |||
contains | |||
end module CHookVariables |
@@ -7,6 +7,52 @@ module CStandPipeManifold | |||
contains | |||
subroutine StandPipeManifoldFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
logical::is_found | |||
! 1. get related root | |||
call json%get(parent,'StandPipeManifold',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'StandPipeManifoldValve1',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve1) | |||
call json%get(p,'StandPipeManifoldValve2',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve2) | |||
call json%get(p,'StandPipeManifoldValve3',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve3) | |||
call json%get(p,'StandPipeManifoldValve4',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve4) | |||
call json%get(p,'StandPipeManifoldValve5',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve5) | |||
call json%get(p,'StandPipeManifoldValve6',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve6) | |||
call json%get(p,'StandPipeManifoldValve7',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve7) | |||
call json%get(p,'StandPipeManifoldValve8',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve8) | |||
call json%get(p,'StandPipeManifoldValve9',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve9) | |||
call json%get(p,'StandPipeManifoldValve10',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve10) | |||
call json%get(p,'StandPipeManifoldValve11',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve11) | |||
call json%get(p,'StandPipeManifoldValve12',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve12) | |||
call json%get(p,'StandPipeManifoldValve13',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve13) | |||
call json%get(p,'StandPipeManifoldValve14',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve14) | |||
call json%get(p,'StandPipeManifoldValve15',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve15) | |||
! call json%get(p,'StandPipeGauge1',pval) | |||
! call json%get(pval,data%Equipments%StandPipeManifold%StandPipeGauge1) | |||
! call json%get(p,'StandPipeGauge2',pval) | |||
! call json%get(pval,data%Equipments%StandPipeManifold%StandPipeGauge2) | |||
end subroutine | |||
subroutine StandPipeManifoldToJson(parent) | |||
type(json_value),pointer :: parent | |||
@@ -16,23 +62,24 @@ module CStandPipeManifold | |||
! 1. create new node | |||
call json%create_object(p,'StandPipeManifold') | |||
call json%add(p,"StandPipeManifoldValve1",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve1) | |||
call json%add(p,"StandPipeManifoldValve2",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve2) | |||
call json%add(p,"StandPipeManifoldValve3",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve3) | |||
call json%add(p,"StandPipeManifoldValve4",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve4) | |||
call json%add(p,"StandPipeManifoldValve5",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve5) | |||
call json%add(p,"StandPipeManifoldValve6",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve6) | |||
call json%add(p,"StandPipeManifoldValve7",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve7) | |||
call json%add(p,"StandPipeManifoldValve8",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve8) | |||
call json%add(p,"StandPipeManifoldValve9",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve9) | |||
call json%add(p,"StandPipeManifoldValve10",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve10) | |||
call json%add(p,"StandPipeManifoldValve11",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve11) | |||
call json%add(p,"StandPipeManifoldValve12",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve12) | |||
call json%add(p,"StandPipeManifoldValve13",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve13) | |||
call json%add(p,"StandPipeManifoldValve14",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve14) | |||
call json%add(p,"StandPipeManifoldValve15",data%EquipmentControl%StandPipeManifold%StandPipeManifoldValve15) | |||
call json%add(p,"StandPipeGauge1",data%EquipmentControl%StandPipeManifold%StandPipeGauge1) | |||
call json%add(p,"StandPipeGauge2",data%EquipmentControl%StandPipeManifold%StandPipeGauge2) | |||
! call json%add(p,"StandPipeManifoldValve1",data%Equipments%StandPipeManifold%StandPipeManifoldValve1) | |||
! call json%add(p,"StandPipeManifoldValve2",data%Equipments%StandPipeManifold%StandPipeManifoldValve2) | |||
! call json%add(p,"StandPipeManifoldValve3",data%Equipments%StandPipeManifold%StandPipeManifoldValve3) | |||
! call json%add(p,"StandPipeManifoldValve4",data%Equipments%StandPipeManifold%StandPipeManifoldValve4) | |||
! call json%add(p,"StandPipeManifoldValve5",data%Equipments%StandPipeManifold%StandPipeManifoldValve5) | |||
! call json%add(p,"StandPipeManifoldValve6",data%Equipments%StandPipeManifold%StandPipeManifoldValve6) | |||
! call json%add(p,"StandPipeManifoldValve7",data%Equipments%StandPipeManifold%StandPipeManifoldValve7) | |||
! call json%add(p,"StandPipeManifoldValve8",data%Equipments%StandPipeManifold%StandPipeManifoldValve8) | |||
! call json%add(p,"StandPipeManifoldValve9",data%Equipments%StandPipeManifold%StandPipeManifoldValve9) | |||
! call json%add(p,"StandPipeManifoldValve10",data%Equipments%StandPipeManifold%StandPipeManifoldValve10) | |||
! call json%add(p,"StandPipeManifoldValve11",data%Equipments%StandPipeManifold%StandPipeManifoldValve11) | |||
! call json%add(p,"StandPipeManifoldValve12",data%Equipments%StandPipeManifold%StandPipeManifoldValve12) | |||
! call json%add(p,"StandPipeManifoldValve13",data%Equipments%StandPipeManifold%StandPipeManifoldValve13) | |||
! call json%add(p,"StandPipeManifoldValve14",data%Equipments%StandPipeManifold%StandPipeManifoldValve14) | |||
! call json%add(p,"StandPipeManifoldValve15",data%Equipments%StandPipeManifold%StandPipeManifoldValve15) | |||
call json%add(p,"StandPipeGauge1",data%Equipments%StandPipeManifold%StandPipeGauge1) | |||
call json%add(p,"StandPipeGauge2",data%Equipments%StandPipeManifold%StandPipeGauge2) | |||
call json%add(parent,p) | |||
end subroutine | |||
@@ -0,0 +1,88 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CStandPipeManifold.f90" | |||
module CStandPipeManifold | |||
use CStandPipeManifoldVariables | |||
use SimulationVariables | |||
use CManifolds | |||
implicit none | |||
public | |||
contains | |||
subroutine StandPipeManifoldFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
logical::is_found | |||
! 1. get related root | |||
call json%get(parent,'StandPipeManifold',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'StandPipeManifoldValve1',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve1) | |||
call json%get(p,'StandPipeManifoldValve2',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve2) | |||
call json%get(p,'StandPipeManifoldValve3',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve3) | |||
call json%get(p,'StandPipeManifoldValve4',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve4) | |||
call json%get(p,'StandPipeManifoldValve5',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve5) | |||
call json%get(p,'StandPipeManifoldValve6',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve6) | |||
call json%get(p,'StandPipeManifoldValve7',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve7) | |||
call json%get(p,'StandPipeManifoldValve8',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve8) | |||
call json%get(p,'StandPipeManifoldValve9',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve9) | |||
call json%get(p,'StandPipeManifoldValve10',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve10) | |||
call json%get(p,'StandPipeManifoldValve11',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve11) | |||
call json%get(p,'StandPipeManifoldValve12',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve12) | |||
call json%get(p,'StandPipeManifoldValve13',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve13) | |||
call json%get(p,'StandPipeManifoldValve14',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve14) | |||
call json%get(p,'StandPipeManifoldValve15',pval) | |||
call json%get(pval,data%Equipments%StandPipeManifold%StandPipeManifoldValve15) | |||
! call json%get(p,'StandPipeGauge1',pval) | |||
! call json%get(pval,data%Equipments%StandPipeManifold%StandPipeGauge1) | |||
! call json%get(p,'StandPipeGauge2',pval) | |||
! call json%get(pval,data%Equipments%StandPipeManifold%StandPipeGauge2) | |||
end subroutine | |||
subroutine StandPipeManifoldToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'StandPipeManifold') | |||
! call json%add(p,"StandPipeManifoldValve1",data%Equipments%StandPipeManifold%StandPipeManifoldValve1) | |||
! call json%add(p,"StandPipeManifoldValve2",data%Equipments%StandPipeManifold%StandPipeManifoldValve2) | |||
! call json%add(p,"StandPipeManifoldValve3",data%Equipments%StandPipeManifold%StandPipeManifoldValve3) | |||
! call json%add(p,"StandPipeManifoldValve4",data%Equipments%StandPipeManifold%StandPipeManifoldValve4) | |||
! call json%add(p,"StandPipeManifoldValve5",data%Equipments%StandPipeManifold%StandPipeManifoldValve5) | |||
! call json%add(p,"StandPipeManifoldValve6",data%Equipments%StandPipeManifold%StandPipeManifoldValve6) | |||
! call json%add(p,"StandPipeManifoldValve7",data%Equipments%StandPipeManifold%StandPipeManifoldValve7) | |||
! call json%add(p,"StandPipeManifoldValve8",data%Equipments%StandPipeManifold%StandPipeManifoldValve8) | |||
! call json%add(p,"StandPipeManifoldValve9",data%Equipments%StandPipeManifold%StandPipeManifoldValve9) | |||
! call json%add(p,"StandPipeManifoldValve10",data%Equipments%StandPipeManifold%StandPipeManifoldValve10) | |||
! call json%add(p,"StandPipeManifoldValve11",data%Equipments%StandPipeManifold%StandPipeManifoldValve11) | |||
! call json%add(p,"StandPipeManifoldValve12",data%Equipments%StandPipeManifold%StandPipeManifoldValve12) | |||
! call json%add(p,"StandPipeManifoldValve13",data%Equipments%StandPipeManifold%StandPipeManifoldValve13) | |||
! call json%add(p,"StandPipeManifoldValve14",data%Equipments%StandPipeManifold%StandPipeManifoldValve14) | |||
! call json%add(p,"StandPipeManifoldValve15",data%Equipments%StandPipeManifold%StandPipeManifoldValve15) | |||
call json%add(p,"StandPipeGauge1",data%Equipments%StandPipeManifold%StandPipeGauge1) | |||
call json%add(p,"StandPipeGauge2",data%Equipments%StandPipeManifold%StandPipeGauge2) | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CStandPipeManifold |
@@ -0,0 +1,29 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CStandPipeManifoldVariables.f90" | |||
module CStandPipeManifoldVariables | |||
implicit none | |||
public | |||
Type::StandPipeManifoldType | |||
! Input vars | |||
logical :: StandPipeManifoldValve1 | |||
logical :: StandPipeManifoldValve2 | |||
logical :: StandPipeManifoldValve3 | |||
logical :: StandPipeManifoldValve4 | |||
logical :: StandPipeManifoldValve5 | |||
logical :: StandPipeManifoldValve6 | |||
logical :: StandPipeManifoldValve7 | |||
logical :: StandPipeManifoldValve8 | |||
logical :: StandPipeManifoldValve9 | |||
logical :: StandPipeManifoldValve10 | |||
logical :: StandPipeManifoldValve11 | |||
logical :: StandPipeManifoldValve12 | |||
logical :: StandPipeManifoldValve13 | |||
logical :: StandPipeManifoldValve14 | |||
logical :: StandPipeManifoldValve15 | |||
! Output vars | |||
real(8) :: StandPipeGauge1 | |||
real(8) :: StandPipeGauge2 | |||
End type StandPipeManifoldType | |||
end module CStandPipeManifoldVariables |
@@ -6,32 +6,74 @@ module CTopDrivePanel | |||
public | |||
contains | |||
subroutine TopDrivePanelFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
logical::is_found | |||
! 1. get related root | |||
call json%get(parent,'TopDrivePanel',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'TopDriveTdsPowerState',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTdsPowerState) | |||
call json%get(p,'TopDriveTorqueWrench',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueWrench) | |||
call json%get(p,'TopDriveDrillTorqueState',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveDrillTorqueState) | |||
call json%get(p,'TopDriveLinkTiltState',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveLinkTiltState) | |||
call json%get(p,'TopDriveIbop',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveIbop) | |||
call json%get(p,'TopDriveTorqueLimitKnob',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueLimitKnob) | |||
call json%get(p,'RpmKnob',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%RpmKnob) | |||
! call json%get(p,'TopDriveOperationFaultLed',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveOperationFaultLed) | |||
! call json%get(p,'TopDriveTdsPowerLed',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTdsPowerLed) | |||
! call json%get(p,'TopDriveTorqueWrenchLed',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed) | |||
! call json%get(p,'TopDriveLinkTiltLed',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveLinkTiltLed) | |||
! call json%get(p,'TopDriveIbopLed',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveIbopLed) | |||
! call json%get(p,'TopDriveTorqueLimitGauge',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueLimitGauge) | |||
! call json%get(p,'TopDriveTorqueGauge',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueGauge) | |||
! call json%get(p,'TopDriveRpmGauge',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveRpmGauge) | |||
end subroutine | |||
subroutine TopDrivePanelToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pform | |||
integer :: i | |||
! 1. create new node | |||
call json%create_object(p,'TopDrivePanel') | |||
call json%add(pform,"TopDriveTdsPowerState",data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState) | |||
call json%add(pform,"TopDriveTorqueWrench",data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrench) | |||
call json%add(pform,"TopDriveDrillTorqueState",data%EquipmentControl%TopDrivePanel%TopDriveDrillTorqueState) | |||
call json%add(pform,"TopDriveLinkTiltState",data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState) | |||
call json%add(pform,"TopDriveIbop",data%EquipmentControl%TopDrivePanel%TopDriveIbop) | |||
call json%add(pform,"TopDriveTorqueLimitKnob",data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitKnob) | |||
call json%add(pform,"RpmKnob",data%EquipmentControl%TopDrivePanel%RpmKnob) | |||
call json%add(pform,"TopDriveOperationFaultLed",data%EquipmentControl%TopDrivePanel%TopDriveOperationFaultLed) | |||
call json%add(pform,"TopDriveTdsPowerLed",data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed) | |||
call json%add(pform,"TopDriveTorqueWrenchLed",data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrenchLed) | |||
call json%add(pform,"TopDriveLinkTiltLed",data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed) | |||
call json%add(pform,"TopDriveIbopLed",data%EquipmentControl%TopDrivePanel%TopDriveIbopLed) | |||
call json%add(pform,"TopDriveTorqueLimitGauge",data%EquipmentControl%TopDrivePanel%TopDriveTorqueLimitGauge) | |||
call json%add(pform,"TopDriveTorqueGauge",data%EquipmentControl%TopDrivePanel%TopDriveTorqueGauge) | |||
call json%add(pform,"TopDriveRpmGauge",data%EquipmentControl%TopDrivePanel%TopDriveRpmGauge) | |||
! call json%add(pform,"TopDriveTdsPowerState",data%Equipments%TopDrivePanel%TopDriveTdsPowerState) | |||
! call json%add(pform,"TopDriveTorqueWrench",data%Equipments%TopDrivePanel%TopDriveTorqueWrench) | |||
! call json%add(pform,"TopDriveDrillTorqueState",data%Equipments%TopDrivePanel%TopDriveDrillTorqueState) | |||
! call json%add(pform,"TopDriveLinkTiltState",data%Equipments%TopDrivePanel%TopDriveLinkTiltState) | |||
! call json%add(pform,"TopDriveIbop",data%Equipments%TopDrivePanel%TopDriveIbop) | |||
! call json%add(pform,"TopDriveTorqueLimitKnob",data%Equipments%TopDrivePanel%TopDriveTorqueLimitKnob) | |||
! call json%add(pform,"RpmKnob",data%Equipments%TopDrivePanel%RpmKnob) | |||
call json%add(pform,"TopDriveOperationFaultLed",data%Equipments%TopDrivePanel%TopDriveOperationFaultLed) | |||
call json%add(pform,"TopDriveTdsPowerLed",data%Equipments%TopDrivePanel%TopDriveTdsPowerLed) | |||
call json%add(pform,"TopDriveTorqueWrenchLed",data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed) | |||
call json%add(pform,"TopDriveLinkTiltLed",data%Equipments%TopDrivePanel%TopDriveLinkTiltLed) | |||
call json%add(pform,"TopDriveIbopLed",data%Equipments%TopDrivePanel%TopDriveIbopLed) | |||
call json%add(pform,"TopDriveTorqueLimitGauge",data%Equipments%TopDrivePanel%TopDriveTorqueLimitGauge) | |||
call json%add(pform,"TopDriveTorqueGauge",data%Equipments%TopDrivePanel%TopDriveTorqueGauge) | |||
call json%add(pform,"TopDriveRpmGauge",data%Equipments%TopDrivePanel%TopDriveRpmGauge) | |||
call json%add(parent,p) | |||
@@ -0,0 +1,83 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90" | |||
module CTopDrivePanel | |||
use CTopDrivePanelVariables | |||
use SimulationVariables | |||
use CLog3 | |||
implicit none | |||
public | |||
contains | |||
subroutine TopDrivePanelFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
logical::is_found | |||
! 1. get related root | |||
call json%get(parent,'TopDrivePanel',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'TopDriveTdsPowerState',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTdsPowerState) | |||
call json%get(p,'TopDriveTorqueWrench',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueWrench) | |||
call json%get(p,'TopDriveDrillTorqueState',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveDrillTorqueState) | |||
call json%get(p,'TopDriveLinkTiltState',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveLinkTiltState) | |||
call json%get(p,'TopDriveIbop',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveIbop) | |||
call json%get(p,'TopDriveTorqueLimitKnob',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueLimitKnob) | |||
call json%get(p,'RpmKnob',pval) | |||
call json%get(pval,data%Equipments%TopDrivePanel%RpmKnob) | |||
! call json%get(p,'TopDriveOperationFaultLed',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveOperationFaultLed) | |||
! call json%get(p,'TopDriveTdsPowerLed',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTdsPowerLed) | |||
! call json%get(p,'TopDriveTorqueWrenchLed',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed) | |||
! call json%get(p,'TopDriveLinkTiltLed',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveLinkTiltLed) | |||
! call json%get(p,'TopDriveIbopLed',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveIbopLed) | |||
! call json%get(p,'TopDriveTorqueLimitGauge',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueLimitGauge) | |||
! call json%get(p,'TopDriveTorqueGauge',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveTorqueGauge) | |||
! call json%get(p,'TopDriveRpmGauge',pval) | |||
! call json%get(pval,data%Equipments%TopDrivePanel%TopDriveRpmGauge) | |||
end subroutine | |||
subroutine TopDrivePanelToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pform | |||
! 1. create new node | |||
call json%create_object(p,'TopDrivePanel') | |||
! call json%add(pform,"TopDriveTdsPowerState",data%Equipments%TopDrivePanel%TopDriveTdsPowerState) | |||
! call json%add(pform,"TopDriveTorqueWrench",data%Equipments%TopDrivePanel%TopDriveTorqueWrench) | |||
! call json%add(pform,"TopDriveDrillTorqueState",data%Equipments%TopDrivePanel%TopDriveDrillTorqueState) | |||
! call json%add(pform,"TopDriveLinkTiltState",data%Equipments%TopDrivePanel%TopDriveLinkTiltState) | |||
! call json%add(pform,"TopDriveIbop",data%Equipments%TopDrivePanel%TopDriveIbop) | |||
! call json%add(pform,"TopDriveTorqueLimitKnob",data%Equipments%TopDrivePanel%TopDriveTorqueLimitKnob) | |||
! call json%add(pform,"RpmKnob",data%Equipments%TopDrivePanel%RpmKnob) | |||
call json%add(pform,"TopDriveOperationFaultLed",data%Equipments%TopDrivePanel%TopDriveOperationFaultLed) | |||
call json%add(pform,"TopDriveTdsPowerLed",data%Equipments%TopDrivePanel%TopDriveTdsPowerLed) | |||
call json%add(pform,"TopDriveTorqueWrenchLed",data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed) | |||
call json%add(pform,"TopDriveLinkTiltLed",data%Equipments%TopDrivePanel%TopDriveLinkTiltLed) | |||
call json%add(pform,"TopDriveIbopLed",data%Equipments%TopDrivePanel%TopDriveIbopLed) | |||
call json%add(pform,"TopDriveTorqueLimitGauge",data%Equipments%TopDrivePanel%TopDriveTorqueLimitGauge) | |||
call json%add(pform,"TopDriveTorqueGauge",data%Equipments%TopDrivePanel%TopDriveTorqueGauge) | |||
call json%add(pform,"TopDriveRpmGauge",data%Equipments%TopDrivePanel%TopDriveRpmGauge) | |||
call json%add(parent,p) | |||
end subroutine | |||
end module CTopDrivePanel |
@@ -21,6 +21,7 @@ module CTopDrivePanelVariables | |||
! Input vars | |||
Type::TopDrivePanelType | |||
! Input vars @mahmood | |||
integer :: TopDriveTdsPowerState | |||
logical :: TopDriveTorqueWrench | |||
integer :: TopDriveDrillTorqueState | |||
@@ -28,6 +29,7 @@ module CTopDrivePanelVariables | |||
logical :: TopDriveIbop | |||
real :: TopDriveTorqueLimitKnob | |||
real :: RpmKnob | |||
! Output vars | |||
integer :: TopDriveOperationFaultLed | |||
integer :: TopDriveTdsPowerLed | |||
@@ -0,0 +1,45 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90" | |||
module CTopDrivePanelVariables | |||
implicit none | |||
public | |||
! const | |||
integer :: TdsPower_REV = 1 | |||
integer :: TdsPower_OFF = 0 | |||
integer :: TdsPower_FWD = -1 | |||
integer :: TdsMu_TORQ = 1 | |||
integer :: TdsMu_SPINE = 0 | |||
integer :: TdsMu_DRILL = -1 | |||
integer :: TdsLinkTilt_TILT = 1 | |||
integer :: TdsLinkTilt_OFF = 0 | |||
integer :: TdsLinkTilt_DRILL = -1 | |||
integer :: LED_OFF = 0 | |||
integer :: LED_ON = 1 | |||
integer :: LED_BLINK = 2 | |||
! Input vars | |||
Type::TopDrivePanelType | |||
! Input vars @mahmood | |||
integer :: TopDriveTdsPowerState | |||
logical :: TopDriveTorqueWrench | |||
integer :: TopDriveDrillTorqueState | |||
integer :: TopDriveLinkTiltState | |||
logical :: TopDriveIbop | |||
real :: TopDriveTorqueLimitKnob | |||
real :: RpmKnob | |||
! Output vars | |||
integer :: TopDriveOperationFaultLed | |||
integer :: TopDriveTdsPowerLed | |||
integer :: TopDriveTorqueWrenchLed | |||
integer :: TopDriveLinkTiltLed | |||
integer :: TopDriveIbopLed | |||
real :: TopDriveTorqueLimitGauge | |||
real :: TopDriveTorqueGauge | |||
real :: TopDriveRpmGauge | |||
end type TopDrivePanelType | |||
contains | |||
end module CTopDrivePanelVariables |
@@ -0,0 +1,35 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/DrillWatch/CDrillWatchVariables.f90" | |||
module CDrillWatchVariables | |||
implicit none | |||
public | |||
! Input vars | |||
Type, Public::DrillingWatchType | |||
! Output vars | |||
real(8) :: Depth | |||
real(8) :: BitPosition | |||
real(8) :: HookLoad | |||
real(8) :: WeightOnBit | |||
real(8) :: RPM | |||
real(8) :: ROP | |||
real(8) :: Torque | |||
real(8) :: PumpPressure | |||
real(8) :: SPM1 | |||
real(8) :: SPM2 | |||
!real(8) :: SPM3 | |||
real(8) :: CasingPressure | |||
real(8) :: PercentFlow | |||
real(8) :: PitGainLose | |||
real(8) :: PitVolume | |||
real(8) :: KillMudVolume | |||
real(8) :: TripTankVolume | |||
real(8) :: MudWeightIn | |||
real(8) :: FillVolume | |||
real(8) :: MudWeightOut | |||
End Type DrillingWatchType | |||
end module CDrillWatchVariables |
@@ -2,34 +2,83 @@ module DrillingWatchModule | |||
use SimulationVariables | |||
contains | |||
! subroutine DrillingWatchFromJson(parent) | |||
! type(json_value),pointer :: parent | |||
! type(json_core) :: json | |||
! type(json_value),pointer :: p,pval | |||
! logical::is_found | |||
! ! 1. get related root | |||
! call json%get(parent,'DrillingWatch',p) | |||
! ! 2. get member of data type from node | |||
! call json%get(p,'Depth',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%Depth) | |||
! call json%get(p,'BitPosition',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%BitPosition) | |||
! call json%get(p,'HookLoad',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%HookLoad) | |||
! call json%get(p,'WeightOnBit',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%WeightOnBit) | |||
! call json%get(p,'RPM',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%RPM) | |||
! call json%get(p,'ROP',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%ROP) | |||
! call json%get(p,'Torque',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%Torque) | |||
! call json%get(p,'PumpPressure',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%PumpPressure) | |||
! call json%get(p,'SPM1',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%SPM1) | |||
! call json%get(p,'SPM2',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%SPM2) | |||
! call json%get(p,'CasingPressure',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%CasingPressure) | |||
! call json%get(p,'PercentFlow',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%PercentFlow) | |||
! call json%get(p,'PitGainLose',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%PitGainLose) | |||
! call json%get(p,'PitVolume',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%PitVolume) | |||
! call json%get(p,'KillMudVolume',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%KillMudVolume) | |||
! call json%get(p,'TripTankVolume',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%TripTankVolume) | |||
! call json%get(p,'MudWeightIn',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%MudWeightIn) | |||
! call json%get(p,'FillVolume',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%FillVolume) | |||
! call json%get(p,'MudWeightOut',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%MudWeightOut) | |||
! end subroutine | |||
subroutine DrillingWatchToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
integer :: i | |||
! 1. create new node | |||
call json%create_object(p,'DrillingWatch') | |||
call json%add(p,"Depth",data%EquipmentControl%DrillingWatch%Depth) | |||
call json%add(p,"BitPosition",data%EquipmentControl%DrillingWatch%BitPosition) | |||
call json%add(p,"HookLoad",data%EquipmentControl%DrillingWatch%HookLoad) | |||
call json%add(p,"WeightOnBit",data%EquipmentControl%DrillingWatch%WeightOnBit) | |||
call json%add(p,"RPM",data%EquipmentControl%DrillingWatch%RPM) | |||
call json%add(p,"ROP",data%EquipmentControl%DrillingWatch%ROP) | |||
call json%add(p,"Torque",data%EquipmentControl%DrillingWatch%Torque) | |||
call json%add(p,"PumpPressure",data%EquipmentControl%DrillingWatch%PumpPressure) | |||
call json%add(p,"SPM1",data%EquipmentControl%DrillingWatch%SPM1) | |||
call json%add(p,"SPM2",data%EquipmentControl%DrillingWatch%SPM2) | |||
call json%add(p,"CasingPressure",data%EquipmentControl%DrillingWatch%CasingPressure) | |||
call json%add(p,"PercentFlow",data%EquipmentControl%DrillingWatch%PercentFlow) | |||
call json%add(p,"PitGainLose",data%EquipmentControl%DrillingWatch%PitGainLose) | |||
call json%add(p,"PitVolume",data%EquipmentControl%DrillingWatch%PitVolume) | |||
call json%add(p,"KillMudVolume",data%EquipmentControl%DrillingWatch%KillMudVolume) | |||
call json%add(p,"TripTankVolume",data%EquipmentControl%DrillingWatch%TripTankVolume) | |||
call json%add(p,"MudWeightIn",data%EquipmentControl%DrillingWatch%MudWeightIn) | |||
call json%add(p,"FillVolume",data%EquipmentControl%DrillingWatch%FillVolume) | |||
call json%add(p,"MudWeightOut",data%EquipmentControl%DrillingWatch%MudWeightOut) | |||
call json%add(p,"Depth",data%Equipments%DrillingWatch%Depth) | |||
call json%add(p,"BitPosition",data%Equipments%DrillingWatch%BitPosition) | |||
call json%add(p,"HookLoad",data%Equipments%DrillingWatch%HookLoad) | |||
call json%add(p,"WeightOnBit",data%Equipments%DrillingWatch%WeightOnBit) | |||
call json%add(p,"RPM",data%Equipments%DrillingWatch%RPM) | |||
call json%add(p,"ROP",data%Equipments%DrillingWatch%ROP) | |||
call json%add(p,"Torque",data%Equipments%DrillingWatch%Torque) | |||
call json%add(p,"PumpPressure",data%Equipments%DrillingWatch%PumpPressure) | |||
call json%add(p,"SPM1",data%Equipments%DrillingWatch%SPM1) | |||
call json%add(p,"SPM2",data%Equipments%DrillingWatch%SPM2) | |||
call json%add(p,"CasingPressure",data%Equipments%DrillingWatch%CasingPressure) | |||
call json%add(p,"PercentFlow",data%Equipments%DrillingWatch%PercentFlow) | |||
call json%add(p,"PitGainLose",data%Equipments%DrillingWatch%PitGainLose) | |||
call json%add(p,"PitVolume",data%Equipments%DrillingWatch%PitVolume) | |||
call json%add(p,"KillMudVolume",data%Equipments%DrillingWatch%KillMudVolume) | |||
call json%add(p,"TripTankVolume",data%Equipments%DrillingWatch%TripTankVolume) | |||
call json%add(p,"MudWeightIn",data%Equipments%DrillingWatch%MudWeightIn) | |||
call json%add(p,"FillVolume",data%Equipments%DrillingWatch%FillVolume) | |||
call json%add(p,"MudWeightOut",data%Equipments%DrillingWatch%MudWeightOut) | |||
call json%add(parent,p) | |||
end subroutine | |||
@@ -0,0 +1,87 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/DrillWatch/DrillWatch.f90" | |||
module DrillingWatchModule | |||
use SimulationVariables | |||
contains | |||
! subroutine DrillingWatchFromJson(parent) | |||
! type(json_value),pointer :: parent | |||
! type(json_core) :: json | |||
! type(json_value),pointer :: p,pval | |||
! logical::is_found | |||
! ! 1. get related root | |||
! call json%get(parent,'DrillingWatch',p) | |||
! ! 2. get member of data type from node | |||
! call json%get(p,'Depth',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%Depth) | |||
! call json%get(p,'BitPosition',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%BitPosition) | |||
! call json%get(p,'HookLoad',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%HookLoad) | |||
! call json%get(p,'WeightOnBit',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%WeightOnBit) | |||
! call json%get(p,'RPM',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%RPM) | |||
! call json%get(p,'ROP',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%ROP) | |||
! call json%get(p,'Torque',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%Torque) | |||
! call json%get(p,'PumpPressure',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%PumpPressure) | |||
! call json%get(p,'SPM1',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%SPM1) | |||
! call json%get(p,'SPM2',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%SPM2) | |||
! call json%get(p,'CasingPressure',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%CasingPressure) | |||
! call json%get(p,'PercentFlow',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%PercentFlow) | |||
! call json%get(p,'PitGainLose',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%PitGainLose) | |||
! call json%get(p,'PitVolume',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%PitVolume) | |||
! call json%get(p,'KillMudVolume',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%KillMudVolume) | |||
! call json%get(p,'TripTankVolume',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%TripTankVolume) | |||
! call json%get(p,'MudWeightIn',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%MudWeightIn) | |||
! call json%get(p,'FillVolume',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%FillVolume) | |||
! call json%get(p,'MudWeightOut',pval) | |||
! call json%get(pval,data%Equipments%DrillingWatch%MudWeightOut) | |||
! end subroutine | |||
subroutine DrillingWatchToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'DrillingWatch') | |||
call json%add(p,"Depth",data%Equipments%DrillingWatch%Depth) | |||
call json%add(p,"BitPosition",data%Equipments%DrillingWatch%BitPosition) | |||
call json%add(p,"HookLoad",data%Equipments%DrillingWatch%HookLoad) | |||
call json%add(p,"WeightOnBit",data%Equipments%DrillingWatch%WeightOnBit) | |||
call json%add(p,"RPM",data%Equipments%DrillingWatch%RPM) | |||
call json%add(p,"ROP",data%Equipments%DrillingWatch%ROP) | |||
call json%add(p,"Torque",data%Equipments%DrillingWatch%Torque) | |||
call json%add(p,"PumpPressure",data%Equipments%DrillingWatch%PumpPressure) | |||
call json%add(p,"SPM1",data%Equipments%DrillingWatch%SPM1) | |||
call json%add(p,"SPM2",data%Equipments%DrillingWatch%SPM2) | |||
call json%add(p,"CasingPressure",data%Equipments%DrillingWatch%CasingPressure) | |||
call json%add(p,"PercentFlow",data%Equipments%DrillingWatch%PercentFlow) | |||
call json%add(p,"PitGainLose",data%Equipments%DrillingWatch%PitGainLose) | |||
call json%add(p,"PitVolume",data%Equipments%DrillingWatch%PitVolume) | |||
call json%add(p,"KillMudVolume",data%Equipments%DrillingWatch%KillMudVolume) | |||
call json%add(p,"TripTankVolume",data%Equipments%DrillingWatch%TripTankVolume) | |||
call json%add(p,"MudWeightIn",data%Equipments%DrillingWatch%MudWeightIn) | |||
call json%add(p,"FillVolume",data%Equipments%DrillingWatch%FillVolume) | |||
call json%add(p,"MudWeightOut",data%Equipments%DrillingWatch%MudWeightOut) | |||
call json%add(parent,p) | |||
end subroutine | |||
end module DrillingWatchModule |
@@ -770,7 +770,7 @@ end subroutine PathFinding_Step | |||
print*, 'InstallSafetyValve_KellyMode()' | |||
#endif | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 1 | |||
data%Equipments%DrillingConsole%IRSafetyValveLed = 1 | |||
call OpenSafetyValve_KellyMode() | |||
end subroutine | |||
@@ -787,10 +787,10 @@ end subroutine PathFinding_Step | |||
call Manifold%Valve(127)%AdjacentTo(128) | |||
call Manifold%Valve(128)%AdjacentTo(127) | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%IRSafetyValveLed = 0 | |||
call CloseSafetyValve_KellyMode() | |||
data%EquipmentControl%DrillingConsole%OpenSafetyValveLed = 0 | |||
data%EquipmentControl%DrillingConsole%CloseSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%OpenSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%CloseSafetyValveLed = 0 | |||
#ifdef deb | |||
print*, 'RemoveSafetyValve_KellyMode()' | |||
@@ -801,8 +801,8 @@ end subroutine PathFinding_Step | |||
subroutine OpenSafetyValve_KellyMode() | |||
implicit none | |||
if(.not.Manifold%IsSafetyValveInstalled_KellyMode) return | |||
data%EquipmentControl%DrillingConsole%OpenSafetyValveLed = 1 | |||
data%EquipmentControl%DrillingConsole%CloseSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%OpenSafetyValveLed = 1 | |||
data%Equipments%DrillingConsole%CloseSafetyValveLed = 0 | |||
Manifold%SafetyValve = .true. | |||
call ChangeValve(56, Manifold%SafetyValve) | |||
@@ -815,8 +815,8 @@ end subroutine PathFinding_Step | |||
subroutine CloseSafetyValve_KellyMode() | |||
implicit none | |||
if(.not.Manifold%IsSafetyValveInstalled_KellyMode) return | |||
data%EquipmentControl%DrillingConsole%CloseSafetyValveLed = 1 | |||
data%EquipmentControl%DrillingConsole%OpenSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%CloseSafetyValveLed = 1 | |||
data%Equipments%DrillingConsole%OpenSafetyValveLed = 0 | |||
Manifold%SafetyValve = .false. | |||
call ChangeValve(56, Manifold%SafetyValve) | |||
@@ -858,7 +858,7 @@ end subroutine PathFinding_Step | |||
call Manifold%Valve(54)%AdjacentTo(69) | |||
call Manifold%Valve(69)%AdjacentTo(54) | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 1 | |||
data%Equipments%DrillingConsole%IRSafetyValveLed = 1 | |||
call OpenSafetyValve_TripMode() | |||
#ifdef deb | |||
@@ -880,10 +880,10 @@ end subroutine PathFinding_Step | |||
call Manifold%Valve(124)%AdjacentTo(69) | |||
call Manifold%Valve(69)%AdjacentTo(124) | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%IRSafetyValveLed = 0 | |||
call CloseSafetyValve_TripMode() | |||
data%EquipmentControl%DrillingConsole%OpenSafetyValveLed = 0 | |||
data%EquipmentControl%DrillingConsole%CloseSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%OpenSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%CloseSafetyValveLed = 0 | |||
#ifdef deb | |||
print*, 'RemoveSafetyValve_TripMode()' | |||
@@ -894,8 +894,8 @@ end subroutine PathFinding_Step | |||
subroutine OpenSafetyValve_TripMode() | |||
implicit none | |||
if(.not.Manifold%IsSafetyValveInstalled_TripMode) return | |||
data%EquipmentControl%DrillingConsole%OpenSafetyValveLed = 1 | |||
data%EquipmentControl%DrillingConsole%CloseSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%OpenSafetyValveLed = 1 | |||
data%Equipments%DrillingConsole%CloseSafetyValveLed = 0 | |||
Manifold%SafetyValve = .true. | |||
call ChangeValve(54, Manifold%SafetyValve) | |||
@@ -908,8 +908,8 @@ end subroutine PathFinding_Step | |||
subroutine CloseSafetyValve_TripMode() | |||
implicit none | |||
if(.not.Manifold%IsSafetyValveInstalled_TripMode) return | |||
data%EquipmentControl%DrillingConsole%CloseSafetyValveLed = 1 | |||
data%EquipmentControl%DrillingConsole%OpenSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%CloseSafetyValveLed = 1 | |||
data%Equipments%DrillingConsole%OpenSafetyValveLed = 0 | |||
Manifold%SafetyValve = .false. | |||
call ChangeValve(54, Manifold%SafetyValve) | |||
@@ -945,7 +945,7 @@ end subroutine PathFinding_Step | |||
call Manifold%Valve(54)%AdjacentTo(69) | |||
call Manifold%Valve(69)%AdjacentTo(54) | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 1 | |||
data%Equipments%DrillingConsole%IRSafetyValveLed = 1 | |||
call OpenSafetyValve_TopDrive() | |||
#ifdef deb | |||
@@ -967,10 +967,10 @@ end subroutine PathFinding_Step | |||
call Manifold%Valve(124)%AdjacentTo(69) | |||
call Manifold%Valve(69)%AdjacentTo(124) | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%IRSafetyValveLed = 0 | |||
call CloseSafetyValve_TopDrive() | |||
data%EquipmentControl%DrillingConsole%OpenSafetyValveLed = 0 | |||
data%EquipmentControl%DrillingConsole%CloseSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%OpenSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%CloseSafetyValveLed = 0 | |||
#ifdef deb | |||
print*, 'RemoveSafetyValve_TopDrive()' | |||
@@ -981,8 +981,8 @@ end subroutine PathFinding_Step | |||
subroutine OpenSafetyValve_TopDrive() | |||
implicit none | |||
if(.not.Manifold%IsSafetyValveInstalled_TopDrive) return | |||
data%EquipmentControl%DrillingConsole%OpenSafetyValveLed = 1 | |||
data%EquipmentControl%DrillingConsole%CloseSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%OpenSafetyValveLed = 1 | |||
data%Equipments%DrillingConsole%CloseSafetyValveLed = 0 | |||
Manifold%SafetyValve = .true. | |||
#ifdef deb | |||
@@ -995,8 +995,8 @@ end subroutine PathFinding_Step | |||
subroutine CloseSafetyValve_TopDrive() | |||
implicit none | |||
if(.not.Manifold%IsSafetyValveInstalled_TopDrive) return | |||
data%EquipmentControl%DrillingConsole%CloseSafetyValveLed = 1 | |||
data%EquipmentControl%DrillingConsole%OpenSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%CloseSafetyValveLed = 1 | |||
data%Equipments%DrillingConsole%OpenSafetyValveLed = 0 | |||
Manifold%SafetyValve = .false. | |||
#ifdef deb | |||
@@ -1031,7 +1031,7 @@ end subroutine PathFinding_Step | |||
print*, 'InstallIBop()' | |||
#endif | |||
data%EquipmentControl%DrillingConsole%IRIBopLed = 1 | |||
data%Equipments%DrillingConsole%IRIBopLed = 1 | |||
call OpenIBop() | |||
end subroutine | |||
@@ -1052,7 +1052,7 @@ end subroutine PathFinding_Step | |||
print*, 'RemoveIBop()' | |||
#endif | |||
data%EquipmentControl%DrillingConsole%IRIBopLed = 0 | |||
data%Equipments%DrillingConsole%IRIBopLed = 0 | |||
Manifold%IBop = .false. | |||
call ChangeValve(55, Manifold%IBop) | |||
end subroutine | |||
@@ -1122,8 +1122,8 @@ end subroutine PathFinding_Step | |||
Manifold%KellyCock = .false. | |||
call ChangeValve(68, Manifold%KellyCock) | |||
data%EquipmentControl%DrillingConsole%CloseKellyCockLed = 0 | |||
data%EquipmentControl%DrillingConsole%OpenKellyCockLed = 0 | |||
data%Equipments%DrillingConsole%CloseKellyCockLed = 0 | |||
data%Equipments%DrillingConsole%OpenKellyCockLed = 0 | |||
#ifdef deb | |||
print*, 'RemoveKellyCock()' | |||
@@ -1134,8 +1134,8 @@ end subroutine PathFinding_Step | |||
subroutine OpenKellyCock() | |||
implicit none | |||
if(.not.Manifold%IsKellyCockInstalled) return | |||
data%EquipmentControl%DrillingConsole%OpenKellyCockLed = 1 | |||
data%EquipmentControl%DrillingConsole%CloseKellyCockLed = 0 | |||
data%Equipments%DrillingConsole%OpenKellyCockLed = 1 | |||
data%Equipments%DrillingConsole%CloseKellyCockLed = 0 | |||
Manifold%KellyCock = .true. | |||
#ifdef deb | |||
@@ -1148,8 +1148,8 @@ end subroutine PathFinding_Step | |||
subroutine CloseKellyCock() | |||
implicit none | |||
if(.not.Manifold%IsKellyCockInstalled) return | |||
data%EquipmentControl%DrillingConsole%CloseKellyCockLed = 1 | |||
data%EquipmentControl%DrillingConsole%OpenKellyCockLed = 0 | |||
data%Equipments%DrillingConsole%CloseKellyCockLed = 1 | |||
data%Equipments%DrillingConsole%OpenKellyCockLed = 0 | |||
Manifold%KellyCock = .false. | |||
#ifdef deb | |||
@@ -7,46 +7,92 @@ | |||
contains | |||
subroutine TankToJson(parent) | |||
subroutine TankFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pform | |||
integer :: i | |||
call json%create_array(p,'Tank') | |||
call json%create_object(pform,'') | |||
call json%add(pform,"WaterRate",data%EquipmentControl%Tank%WaterRate) | |||
call json%add(pform,"CementTankVolume",data%EquipmentControl%Tank%CementTankVolume) | |||
call json%add(pform,"CementTankDensity",data%EquipmentControl%Tank%CementTankDensity) | |||
call json%add(pform,"TripTankVolume",data%EquipmentControl%Tank%TripTankVolume) | |||
call json%add(pform,"TripTankDensity",data%EquipmentControl%Tank%TripTankDensity) | |||
call json%add(pform,"ManualPumpPower",data%EquipmentControl%Tank%ManualPumpPower) | |||
call json%add(pform,"Valve1",data%EquipmentControl%Tank%Valve1) | |||
call json%add(pform,"Valve2",data%EquipmentControl%Tank%Valve2) | |||
call json%add(pform,"Valve3",data%EquipmentControl%Tank%Valve3) | |||
call json%add(pform,"Valve4",data%EquipmentControl%Tank%Valve4) | |||
call json%add(pform,"Valve5",data%EquipmentControl%Tank%Valve5) | |||
call json%add(pform,"Valve6",data%EquipmentControl%Tank%Valve6) | |||
call json%add(pform,"Valve7",data%EquipmentControl%Tank%Valve7) | |||
call json%add(pform,"Valve8",data%EquipmentControl%Tank%Valve8) | |||
call json%add(pform,"Valve9",data%EquipmentControl%Tank%Valve9) | |||
call json%add(pform,"Valve10",data%EquipmentControl%Tank%Valve10) | |||
call json%add(pform,"Valve11",data%EquipmentControl%Tank%Valve11) | |||
call json%add(parent,p) | |||
type(json_value),pointer :: p,pval | |||
logical::is_found | |||
! 1. get related root | |||
call json%get(parent,'Tank',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'WaterRate',pval) | |||
call json%get(pval,data%Equipments%Tank%WaterRate) | |||
call json%get(p,'CementTankVolume',pval) | |||
call json%get(pval,data%Equipments%Tank%CementTankVolume) | |||
call json%get(p,'CementTankDensity',pval) | |||
call json%get(pval,data%Equipments%Tank%CementTankDensity) | |||
call json%get(p,'TripTankVolume',pval) | |||
call json%get(pval,data%Equipments%Tank%TripTankVolume) | |||
call json%get(p,'TripTankDensity',pval) | |||
call json%get(pval,data%Equipments%Tank%TripTankDensity) | |||
call json%get(p,'ManualPumpPower',pval) | |||
call json%get(pval,data%Equipments%Tank%ManualPumpPower) | |||
call json%get(p,'Valve1',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve1) | |||
call json%get(p,'Valve2',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve2) | |||
call json%get(p,'Valve3',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve3) | |||
call json%get(p,'Valve4',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve4) | |||
call json%get(p,'Valve5',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve5) | |||
call json%get(p,'Valve6',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve6) | |||
call json%get(p,'Valve7',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve7) | |||
call json%get(p,'Valve8',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve8) | |||
call json%get(p,'Valve9',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve9) | |||
call json%get(p,'Valve10',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve10) | |||
call json%get(p,'Valve11',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve11) | |||
end subroutine | |||
! subroutine TankToJson(parent) | |||
! type(json_value),pointer :: parent | |||
! type(json_core) :: json | |||
! type(json_value),pointer :: p,pform | |||
! integer :: i | |||
! call json%create_array(p,'Tank') | |||
! call json%create_object(pform,'') | |||
! call json%add(pform,"WaterRate",data%Equipments%Tank%WaterRate) | |||
! call json%add(pform,"CementTankVolume",data%Equipments%Tank%CementTankVolume) | |||
! call json%add(pform,"CementTankDensity",data%Equipments%Tank%CementTankDensity) | |||
! call json%add(pform,"TripTankVolume",data%Equipments%Tank%TripTankVolume) | |||
! call json%add(pform,"TripTankDensity",data%Equipments%Tank%TripTankDensity) | |||
! call json%add(pform,"ManualPumpPower",data%Equipments%Tank%ManualPumpPower) | |||
! call json%add(pform,"Valve1",data%Equipments%Tank%Valve1) | |||
! call json%add(pform,"Valve2",data%Equipments%Tank%Valve2) | |||
! call json%add(pform,"Valve3",data%Equipments%Tank%Valve3) | |||
! call json%add(pform,"Valve4",data%Equipments%Tank%Valve4) | |||
! call json%add(pform,"Valve5",data%Equipments%Tank%Valve5) | |||
! call json%add(pform,"Valve6",data%Equipments%Tank%Valve6) | |||
! call json%add(pform,"Valve7",data%Equipments%Tank%Valve7) | |||
! call json%add(pform,"Valve8",data%Equipments%Tank%Valve8) | |||
! call json%add(pform,"Valve9",data%Equipments%Tank%Valve9) | |||
! call json%add(pform,"Valve10",data%Equipments%Tank%Valve10) | |||
! call json%add(pform,"Valve11",data%Equipments%Tank%Valve11) | |||
! call json%add(parent,p) | |||
! end subroutine | |||
subroutine Set_ManualPumpPower(v) | |||
use CManifolds, only:ChangeValve | |||
implicit none | |||
logical, intent(in) :: v | |||
data%EquipmentControl%Tank%ManualPumpPower = v | |||
data%Equipments%Tank%ManualPumpPower = v | |||
call ChangeValve(43, v) | |||
#ifdef deb | |||
print*, 'ManualPumpPower=', data%EquipmentControl%Tank%ManualPumpPower | |||
print*, 'ManualPumpPower=', data%Equipments%Tank%ManualPumpPower | |||
#endif | |||
end subroutine | |||
@@ -0,0 +1,101 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/Tanks/CTanks.f90" | |||
module CTanks | |||
use SimulationVariables | |||
use CManifolds | |||
implicit none | |||
public | |||
contains | |||
subroutine TankFromJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p,pval | |||
logical::is_found | |||
! 1. get related root | |||
call json%get(parent,'Tank',p) | |||
! 2. get member of data type from node | |||
call json%get(p,'WaterRate',pval) | |||
call json%get(pval,data%Equipments%Tank%WaterRate) | |||
call json%get(p,'CementTankVolume',pval) | |||
call json%get(pval,data%Equipments%Tank%CementTankVolume) | |||
call json%get(p,'CementTankDensity',pval) | |||
call json%get(pval,data%Equipments%Tank%CementTankDensity) | |||
call json%get(p,'TripTankVolume',pval) | |||
call json%get(pval,data%Equipments%Tank%TripTankVolume) | |||
call json%get(p,'TripTankDensity',pval) | |||
call json%get(pval,data%Equipments%Tank%TripTankDensity) | |||
call json%get(p,'ManualPumpPower',pval) | |||
call json%get(pval,data%Equipments%Tank%ManualPumpPower) | |||
call json%get(p,'Valve1',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve1) | |||
call json%get(p,'Valve2',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve2) | |||
call json%get(p,'Valve3',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve3) | |||
call json%get(p,'Valve4',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve4) | |||
call json%get(p,'Valve5',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve5) | |||
call json%get(p,'Valve6',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve6) | |||
call json%get(p,'Valve7',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve7) | |||
call json%get(p,'Valve8',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve8) | |||
call json%get(p,'Valve9',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve9) | |||
call json%get(p,'Valve10',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve10) | |||
call json%get(p,'Valve11',pval) | |||
call json%get(pval,data%Equipments%Tank%Valve11) | |||
end subroutine | |||
! subroutine TankToJson(parent) | |||
! type(json_value),pointer :: parent | |||
! type(json_core) :: json | |||
! type(json_value),pointer :: p,pform | |||
! integer :: i | |||
! call json%create_array(p,'Tank') | |||
! call json%create_object(pform,'') | |||
! call json%add(pform,"WaterRate",data%Equipments%Tank%WaterRate) | |||
! call json%add(pform,"CementTankVolume",data%Equipments%Tank%CementTankVolume) | |||
! call json%add(pform,"CementTankDensity",data%Equipments%Tank%CementTankDensity) | |||
! call json%add(pform,"TripTankVolume",data%Equipments%Tank%TripTankVolume) | |||
! call json%add(pform,"TripTankDensity",data%Equipments%Tank%TripTankDensity) | |||
! call json%add(pform,"ManualPumpPower",data%Equipments%Tank%ManualPumpPower) | |||
! call json%add(pform,"Valve1",data%Equipments%Tank%Valve1) | |||
! call json%add(pform,"Valve2",data%Equipments%Tank%Valve2) | |||
! call json%add(pform,"Valve3",data%Equipments%Tank%Valve3) | |||
! call json%add(pform,"Valve4",data%Equipments%Tank%Valve4) | |||
! call json%add(pform,"Valve5",data%Equipments%Tank%Valve5) | |||
! call json%add(pform,"Valve6",data%Equipments%Tank%Valve6) | |||
! call json%add(pform,"Valve7",data%Equipments%Tank%Valve7) | |||
! call json%add(pform,"Valve8",data%Equipments%Tank%Valve8) | |||
! call json%add(pform,"Valve9",data%Equipments%Tank%Valve9) | |||
! call json%add(pform,"Valve10",data%Equipments%Tank%Valve10) | |||
! call json%add(pform,"Valve11",data%Equipments%Tank%Valve11) | |||
! call json%add(parent,p) | |||
! end subroutine | |||
subroutine Set_ManualPumpPower(v) | |||
use CManifolds, only:ChangeValve | |||
implicit none | |||
logical, intent(in) :: v | |||
data%Equipments%Tank%ManualPumpPower = v | |||
call ChangeValve(43, v) | |||
#ifdef deb | |||
print*, 'ManualPumpPower=', data%Equipments%Tank%ManualPumpPower | |||
#endif | |||
end subroutine | |||
end module CTanks |
@@ -23,7 +23,7 @@ module CTanksVariables | |||
logical :: Valve11 | |||
End Type TankType | |||
contains | |||
contains | |||
end module CTanksVariables |
@@ -0,0 +1,30 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/Tanks/CTanksVariables.f90" | |||
module CTanksVariables | |||
implicit none | |||
public | |||
Type :: TankType | |||
! Input vars | |||
real(8) :: WaterRate | |||
real(8) :: CementTankVolume | |||
real(8) :: CementTankDensity | |||
real(8) :: TripTankVolume | |||
real(8) :: TripTankDensity | |||
logical :: ManualPumpPower | |||
logical :: Valve1 | |||
logical :: Valve2 | |||
logical :: Valve3 | |||
logical :: Valve4 | |||
logical :: Valve5 | |||
logical :: Valve6 | |||
logical :: Valve7 | |||
logical :: Valve8 | |||
logical :: Valve9 | |||
logical :: Valve10 | |||
logical :: Valve11 | |||
End Type TankType | |||
contains | |||
end module CTanksVariables |
@@ -0,0 +1,463 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Common/COperationScenariosMain.f90" | |||
module COperationScenariosMain | |||
use CIActionReference | |||
implicit none | |||
public | |||
! procedure (ActionVoid), pointer :: UpdateUnityPtr | |||
contains | |||
subroutine OperationScenarios_Step | |||
! use CSimulationVariables | |||
use OperationScenariosModule | |||
use CElevatorConnectionEnum | |||
use CCloseKellyCockLedNotification | |||
use CCloseSafetyValveLedNotification | |||
use CFillMouseHoleLedNotification | |||
use CIrIBopLedNotification | |||
use CIrSafetyValveLedNotification | |||
use CLatchLedNotification | |||
use COpenKellyCockLedNotification | |||
use COpenSafetyValveLedNotification | |||
use CSlipsNotification | |||
use CSwingLedNotification | |||
use CTongNotification | |||
use CUnlatchLedNotification | |||
use CInstallFillupHeadPermission | |||
use CInstallMudBucketPermission | |||
use CIrIbopPermission | |||
use CIrSafetyValvePermission | |||
use CRemoveFillupHeadPermission | |||
use CRemoveMudBucketPermission | |||
use SoftwareInputsVariables | |||
! use CHookHeight | |||
! use CIbopHeight | |||
! use CNearFloorConnection | |||
! use CSafetyValveHeight | |||
! use CSlackOff | |||
! use CStandRack | |||
! use CStringPressure | |||
! use CZeroStringSpeed | |||
use CUnityInputs, only: & | |||
Get_ElevatorConnectionPossible, & | |||
Get_JointConnectionPossible, & | |||
Get_ElevatorPickup, & | |||
Get_NearFloorPosition, & | |||
Get_SingleSetInMouseHole | |||
! use CBucketEnum | |||
! use UnitySignalsModule | |||
use CElevatorEnum | |||
! use CHeadEnum | |||
use CIbopEnum | |||
use CKellyEnum | |||
use CMouseHoleEnum | |||
use UnitySignalsModule | |||
use CSafetyValveEnum | |||
use CSlipsEnum | |||
use CSwingEnum | |||
use CTongEnum | |||
! use CStringUpdate | |||
use CFlowPipeDisconnectEnum | |||
use CFlowKellyDisconnectEnum | |||
use CFillupHeadPermission | |||
use CSwingDrillPermission | |||
use CSwingOffPermission | |||
use CSwingTiltPermission | |||
! use CTdsStemJointHeight | |||
! use UnitySignalsModule !for CTdsConnectionModesEnum | |||
use CTdsElevatorModesEnum | |||
use CTdsSpineEnum | |||
use CTdsSwingEnum | |||
use CTdsTongEnum | |||
use CTdsBackupClamp | |||
use CTdsIbopLedNotification | |||
use CTdsPowerLedNotification | |||
use CTdsTorqueWrenchLedNotification | |||
implicit none | |||
call Evaluate_KellyConnection() | |||
call Evaluate_ElevatorConnection() | |||
call Evaluate_CloseKellyCockLed() | |||
call Evaluate_CloseSafetyValveLed() | |||
call Evaluate_FillMouseHoleLed() | |||
call Evaluate_IrIBopLed() | |||
call Evaluate_IrSafetyValveLed() | |||
call Evaluate_LatchLed() | |||
call Evaluate_OpenKellyCockLed() | |||
call Evaluate_OpenSafetyValveLed() | |||
call Evaluate_SlipsNotification() | |||
call Evaluate_SwingLed() | |||
call Evaluate_TongNotification() | |||
call Evaluate_UnlatchLed() | |||
call Evaluate_InstallFillupHeadPermission() | |||
call Evaluate_InstallMudBucketPermission() | |||
call Evaluate_IrIbopPermission() | |||
call Evaluate_IrSafetyValvePermission() | |||
call Evaluate_RemoveFillupHeadPermission() | |||
call Evaluate_RemoveMudBucketPermission() | |||
call Evaluate_MudBucket() | |||
call Evaluate_Elevator() | |||
call Evaluate_FillupHead() | |||
call Evaluate_Ibop() | |||
call Evaluate_Kelly() | |||
call Evaluate_MouseHole() | |||
call Evaluate_MouseHole() | |||
call Evaluate_OperationCondition() | |||
call Evaluate_SafetyValve() | |||
call Evaluate_Slips() | |||
call Evaluate_Swing() | |||
call Evaluate_Tong() | |||
! call Evaluate_StringUpdate() | |||
call Evaluate_FlowKellyDisconnect() | |||
call Evaluate_FlowPipeDisconnect() | |||
!if(Get_FillMouseHoleLed()) then | |||
! call Set_MouseHole(MOUSE_HOLE_FILL) | |||
!else | |||
! if((Get_KellyConnection() == KELLY_CONNECTION_SINGLE .or.& | |||
! Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE) .and.& | |||
! Get_HookHeight() >= 95.0 ) then | |||
! call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
! else | |||
! call Set_MouseHole(MOUSE_HOLE_EMPTY) | |||
! endif | |||
!endif | |||
!topdrive | |||
call Evaluate_TdsElevatorModes() | |||
call Evaluate_TdsConnectionModes() | |||
call Evaluate_SwingTiltPermission() | |||
call Evaluate_SwingOffPermission() | |||
call Evaluate_SwingDrillPermission() | |||
call Evaluate_FillupHeadPermission() | |||
call Evaluate_TdsTong() | |||
call Evaluate_TdsBackupClamp() | |||
call Evaluate_TdsSwing() | |||
call Evaluate_TdsSpine() | |||
call Evaluate_PowerLed() | |||
call Evaluate_IbopLed() | |||
call Evaluate_TorqueWrenchLed() | |||
end subroutine OperationScenarios_Step | |||
! subroutine UpdateUnity() | |||
! implicit none | |||
! if(associated(UpdateUnityPtr)) call UpdateUnityPtr() | |||
! end subroutine | |||
subroutine Kelly_ConnectionNothing | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
!TODO: possibly goto a position to activate swing | |||
! goto preferred swing position | |||
if(data%State%unitySignals%Swing_S == SWING_MOUSE_HOLE_END) then | |||
call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop2: do | |||
if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2 | |||
call sleepqq(100) | |||
enddo loop2 | |||
elseif (data%State%unitySignals%Swing_S == SWING_RAT_HOLE_END) then | |||
call Set_Swing(SWING_RAT_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop3: do | |||
if(Get_Swing() == SWING_RAT_HOLE_END) exit loop3 | |||
call sleepqq(100) | |||
enddo loop3 | |||
!elseif (Swing_S == SWING_WELL_END) then | |||
! call Set_Swing(SWING_WELL_BEGIN) | |||
! !@call UpdateUnity() | |||
! loop4: do | |||
! if(Get_Swing() == SWING_WELL_END) exit loop4 | |||
! call sleepqq(100) | |||
! enddo loop4 | |||
endif | |||
call sleep(3) | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
end subroutine Kelly_ConnectionNothing | |||
subroutine Kelly_ConnectionString | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
! use CTongEnumVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
! goto connection to string position | |||
call Set_HookHeight_S(66.7) | |||
call sleep(1) | |||
! start tong makeup | |||
call Set_Tong(TONG_MAKEUP_BEGIN) | |||
!@call UpdateUnity() | |||
loop2: do | |||
if(Get_Tong() == TONG_MAKEUP_END) exit loop2 | |||
call sleepqq(100) | |||
enddo loop2 | |||
call sleepqq(100) | |||
! release slips | |||
call Set_Slips(SLIPS_UNSET_BEGIN) | |||
!@call UpdateUnity() | |||
loop3: do | |||
if(Get_Slips() == SLIPS_UNSET_END) exit loop3 | |||
call sleepqq(100) | |||
enddo loop3 | |||
call sleepqq(100) | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
! put slips to saved position | |||
if(data%State%unitySignals%Slips_S == SLIPS_SET_END) then | |||
call Set_Slips(SLIPS_SET_BEGIN) | |||
!@call UpdateUnity() | |||
loop4: do | |||
if(Get_Slips() == SLIPS_SET_END) exit loop4 | |||
call sleepqq(100) | |||
enddo loop4 | |||
call sleep(1) | |||
endif | |||
end subroutine Kelly_ConnectionString | |||
subroutine Kelly_ConnectionSingle | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
! use CTongEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
! goto swing mouse hole position | |||
call Set_HookHeight_S(70.0) | |||
call sleep(1) | |||
! swing mouse hole | |||
call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop2: do | |||
if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2 | |||
call sleepqq(100) | |||
enddo loop2 | |||
call sleepqq(100) | |||
! goto makeup pipe location | |||
call Set_HookHeight_S(65.0) | |||
call sleep(1) | |||
! start tong makeup | |||
call Set_Tong(TONG_MAKEUP_BEGIN) | |||
!@call UpdateUnity() | |||
loop3: do | |||
if(Get_Tong() == TONG_MAKEUP_END) exit loop3 | |||
call sleepqq(100) | |||
enddo loop3 | |||
call sleepqq(100) | |||
if (data%State%unitySignals%Swing_S == SWING_WELL_END) then ! already in mouse hole | |||
! goto swing location | |||
call Set_HookHeight_S(98.0) | |||
call sleep(1) | |||
! goto preferred swing position | |||
call Set_Swing(SWING_WELL_BEGIN) | |||
!@call UpdateUnity() | |||
loop4: do | |||
if(Get_Swing() == SWING_WELL_END) exit loop4 | |||
call sleepqq(100) | |||
enddo loop4 | |||
call sleep(2) | |||
endif | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
end subroutine Kelly_ConnectionSingle | |||
subroutine Elevator_ConnectionNothing | |||
! use CSwingEnumVariables | |||
! use CSlipsEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use CHook | |||
use SimulationVariables | |||
! use CKellyEnumVariables | |||
implicit none | |||
call Set_HookHeight(75.0) | |||
call sleep(1) | |||
! first wait for unity to get to starting point | |||
loop1: do | |||
if(Get_Swing() == SWING_WELL_END .and. Get_Slips() == SLIPS_SET_END) exit loop1 | |||
call sleepqq(100) | |||
enddo loop1 | |||
call sleep(1) | |||
!TODO: possibly goto a position to activate swing | |||
!! first goto mouse hole | |||
!call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!!@call UpdateUnity() | |||
!loop2: do | |||
! if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop2 | |||
! call sleepqq(100) | |||
!enddo loop2 | |||
!call sleep(1) | |||
! | |||
!! then goto rat hole | |||
!call Set_Swing(SWING_RAT_HOLE_BEGIN) | |||
!!@call UpdateUnity() | |||
!loop3: do | |||
! if(Get_Swing() == SWING_RAT_HOLE_END) exit loop3 | |||
! call sleepqq(100) | |||
!enddo loop3 | |||
!call sleep(1) | |||
! kelly back | |||
call Set_Kelly(KELLY_REMOVE) | |||
call sleepqq(100) | |||
! goto preferred swing position | |||
if(data%State%unitySignals%Swing_S == SWING_MOUSE_HOLE_END) then | |||
call Set_Swing(SWING_MOUSE_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop4: do | |||
if(Get_Swing() == SWING_MOUSE_HOLE_END) exit loop4 | |||
call sleepqq(100) | |||
enddo loop4 | |||
elseif (data%State%unitySignals%Swing_S == SWING_RAT_HOLE_END) then | |||
call Set_Swing(SWING_RAT_HOLE_BEGIN) | |||
!@call UpdateUnity() | |||
loop5: do | |||
if(Get_Swing() == SWING_RAT_HOLE_END) exit loop5 | |||
call sleepqq(100) | |||
enddo loop5 | |||
elseif (data%State%unitySignals%Swing_S == SWING_WELL_END) then | |||
call Set_Swing(SWING_WELL_BEGIN) | |||
!@call UpdateUnity() | |||
loop6: do | |||
if(Get_Swing() == SWING_WELL_END) exit loop6 | |||
call sleepqq(100) | |||
enddo loop6 | |||
endif | |||
call sleepqq(100) | |||
! move to final hook height | |||
call Update_HookHeight_From_Snapshot() | |||
call sleep(3) | |||
end subroutine Elevator_ConnectionNothing | |||
subroutine Elevator_ConnectionString | |||
implicit none | |||
end subroutine Elevator_ConnectionString | |||
subroutine Elevator_ConnectionStand | |||
implicit none | |||
end subroutine Elevator_ConnectionStand | |||
subroutine Elevator_ConnectionSingle | |||
implicit none | |||
end subroutine Elevator_ConnectionSingle | |||
end module COperationScenariosMain |
@@ -0,0 +1,260 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Common/OperationScenarios.f90" | |||
module OperationScenariosModule | |||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |||
!! Paseted From ....Variables.f90 | |||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |||
! use OperationScenariosModule ! | |||
! use OperationScenariosModule !!CElevator... | |||
! use COperationScenariosVariables | |||
use SimulationVariables | |||
use PermissionsModule | |||
! use SoftwareInputsVariables | |||
use CUnityInputs | |||
use CUnityOutputs, only: GetRotaryRpm | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
use PermissionsModule | |||
! use CTdsElevatorModesEnumVariables ! | |||
use CHoistingVariables | |||
use CTopDrivePanelVariables | |||
use NotificationModule | |||
use SoftwareInputsModule | |||
contains | |||
subroutine OperationScenariosToJson(parent) | |||
type(json_value),pointer :: parent | |||
type(json_core) :: json | |||
type(json_value),pointer :: p | |||
! 1. create new node | |||
call json%create_object(p,'OperationScenarios') | |||
! 2. add member of data type to new node | |||
call json%add(p,"ElevatorConnection",data%State%OperationScenario%ElevatorConnection) | |||
call json%add(p,"StringUpdate",data%State%OperationScenario%StringUpdate) | |||
call json%add(p,"KellyConnection",data%State%OperationScenario%KellyConnection) | |||
! 3. add new node to parent | |||
call json%add(parent,p) | |||
end subroutine | |||
! moved from kellyConnectionEnum | |||
subroutine Set_KellyConnection(v) | |||
use CManifolds, Only: KellyConnected, KellyDisconnected | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%OperationScenario%KellyConnection == v) return | |||
#endif | |||
data%State%OperationScenario%KellyConnection = v | |||
if(data%State%OperationScenario%KellyConnection /= KELLY_CONNECTION_STRING) then | |||
call KellyDisconnected() | |||
else | |||
call KellyConnected() | |||
endif | |||
#ifdef deb | |||
print*, 'data%State%OperationScenario%KellyConnection=', data%State%OperationScenario%KellyConnection | |||
#endif | |||
!**call data%State%OperationScenario%OnKellyConnectionChange%RunAll() | |||
end subroutine | |||
integer function Get_KellyConnection() | |||
implicit none | |||
Get_KellyConnection = data%State%OperationScenario%KellyConnection | |||
end function | |||
subroutine Evaluate_KellyConnection() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 75 | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
# 80 | |||
!!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() <= (data%State%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 | |||
! use ConfigurationVariables | |||
! use ConfigurationVariables | |||
! implicit none | |||
! call OnBreakoutLeverPress%Add(ButtonPress_Breakout) | |||
! call OnMakeupLeverPress%Add(ButtonPress_Makeup) | |||
! end subroutine | |||
subroutine ButtonPress_Breakout() | |||
implicit none | |||
# 201 | |||
end subroutine | |||
subroutine ButtonPress_Makeup() | |||
implicit none | |||
# 208 | |||
end subroutine | |||
subroutine Set_StringUpdate(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%OperationScenario%StringUpdate == v) return | |||
#endif | |||
data%State%OperationScenario%StringUpdate = v | |||
!**call data%State%OperationScenario%OnStringUpdateChange%RunAll(v) | |||
end subroutine | |||
integer function Get_StringUpdate() | |||
implicit none | |||
Get_StringUpdate = data%State%OperationScenario%StringUpdate | |||
end function | |||
real(8) function TJH() | |||
use TD_DrillStemComponents | |||
implicit none | |||
TJH = data%State%TD_String%TopJointHeight | |||
end function | |||
real function TL() | |||
implicit none | |||
TL = 26.97 | |||
end function | |||
real function NFC() | |||
implicit none | |||
NFC = Get_NearFloorConnection() | |||
end function | |||
subroutine Set_ElevatorConnection(v) | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%OperationScenario%ElevatorConnection == v) return | |||
#endif | |||
data%State%OperationScenario%ElevatorConnection = v | |||
#ifdef deb | |||
print*, 'data%State%OperationScenario%ElevatorConnection=', data%State%OperationScenario%ElevatorConnection | |||
#endif | |||
!**call data%State%OperationScenario%OnElevatorConnectionChange%RunAll() | |||
end subroutine | |||
integer function Get_ElevatorConnection() | |||
implicit none | |||
Get_ElevatorConnection = data%State%OperationScenario%ElevatorConnection | |||
end function | |||
end module OperationScenariosModule |
@@ -0,0 +1,617 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Enums/CElevatorConnectionEnum.f90" | |||
module CElevatorConnectionEnum | |||
use OperationScenariosModule | |||
use CLog3 | |||
use CLog4 | |||
implicit none | |||
contains | |||
subroutine Evaluate_ElevatorConnection() | |||
use CHoistingVariables | |||
use SimulationVariables | |||
use CCommon, only: SetStandRack | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 18 | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
# 32 | |||
!!OPERATION-CODE=83 | |||
!if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
! Get_ElevatorConnection() == ELEVATOR_LATCH_STRING .and.& | |||
! Get_ElevatorPickup() .and.& | |||
! Get_Slips() == SLIPS_SET_END) then | |||
! !call Log_4('OPERATION-CODE=83') | |||
! call Set_ElevatorConnection(ELEVATOR_CONNECTION_STRING) | |||
! return | |||
!end if | |||
!OPERATION-CODE=78 | |||
if (Get_ElevatorPickup() == .false. .and.& | |||
Get_Tong() == TONG_BREAKOUT_END .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%PL) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) then | |||
call Set_ElevatorConnection(ELEVATOR_LATCH_SINGLE) | |||
return | |||
end if | |||
!OPERATION-CODE=79 | |||
if (Get_ElevatorPickup() == .false. .and.& | |||
Get_Tong() == TONG_BREAKOUT_END .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%SL - data%State%OperationScenario%LG) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) then | |||
call Set_ElevatorConnection(ELEVATOR_LATCH_STAND) | |||
return | |||
end if | |||
!OPERATION-CODE=83 | |||
if (Get_ElevatorPickup().and.& | |||
Get_ElevatorConnection() == ELEVATOR_LATCH_SINGLE) then | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_SINGLE) | |||
return | |||
end if | |||
!OPERATION-CODE=84 | |||
if (Get_ElevatorPickup().and.& | |||
Get_ElevatorConnection() == ELEVATOR_LATCH_STAND) then | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_STAND) | |||
return | |||
end if | |||
!OPERATION-CODE=7 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
!GetRotaryRpm() == 0.0d0 .and.& | |||
!Get_StandRack() > 0 .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
!Get_Swing() == SWING_WELL_END .and.& | |||
!Get_Slips() == SLIPS_SET_END .and.& | |||
!Get_LatchLed() .and. | |||
Get_Elevator() == ELEVATOR_LATCH_STAND_END) then | |||
!call Log_4('OPERATION-CODE=7') | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_STAND) | |||
!call Set_UnlatchLed(.true.) | |||
!call Set_LatchLed(.false.) | |||
call SetStandRack(Get_StandRack() - 1) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
return | |||
end if | |||
!OPERATION-CODE=8 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
!Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL - RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG) .and.& | |||
!GetRotaryRpm() == 0.0d0 .and.& | |||
!Get_StandRack() < 80 .and.& | |||
!Get_ElevatorConnectionPossible() .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND .and.& | |||
!Get_Swing() == SWING_WELL_END .and.& | |||
!Get_Slips() == SLIPS_SET_END .and.& | |||
!Get_UnlatchLed() .and.& | |||
Get_Elevator() == ELEVATOR_UNLATCH_STAND_END) then | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING) | |||
!call Set_UnlatchLed(.false.) | |||
!call Set_LatchLed(.true.) | |||
call SetStandRack(Get_StandRack() + 1) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
!call Set_Elevator(ELEVATOR_UNLATCH_STAND_BEGIN) | |||
call Log_3('OPERATION-CODE=8') | |||
return | |||
end if | |||
!OPERATION-CODE=9 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
!Get_HookHeight() >= 18.0 .and. Get_HookHeight() <= 22.0 .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
!Get_Swing() == SWING_WELL_END .and.& | |||
!Get_Slips() == SLIPS_SET_END .and.& | |||
!Get_LatchLed() .and.& | |||
!Get_ElevatorPickup() .and.& | |||
Get_Elevator() == ELEVATOR_LATCH_STRING_END) then | |||
!call Log_4('OPERATION-CODE=9') | |||
call Set_ElevatorConnection(ELEVATOR_LATCH_STRING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
!call Set_UnlatchLed(.true.) | |||
!call Set_LatchLed(.false.) | |||
!call Set_UnlatchLed(.false.) | |||
!call Set_Elevator(ELEVATOR_LATCH_STRING_BEGIN) | |||
return | |||
end if | |||
!OPERATION-CODE=60 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
!Get_HookHeight() <= (HL + Get_NearFloorConnection() - ECG) .and.& | |||
Get_ElevatorPickup() == .false. .and.& | |||
Get_Slips() == SLIPS_SET_END .and.& | |||
!Get_Tong() /= TONG_MAKEUP_END .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING) then | |||
call Set_ElevatorConnection(ELEVATOR_LATCH_STRING) | |||
!call Set_Elevator(ELEVATOR_NEUTRAL) | |||
return | |||
end if | |||
!OPERATION-CODE=49 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_ElevatorPickup() .and.& | |||
Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) then | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_STRING) | |||
return | |||
end if | |||
!OPERATION-CODE=10 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
!GetRotaryRpm() == 0.0d0 .and.& | |||
(Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.& | |||
!Get_Swing() == SWING_WELL_END .and.& | |||
!Get_Slips() == SLIPS_SET_END .and.& | |||
!Get_UnlatchLed() .and.& | |||
Get_Elevator() == ELEVATOR_UNLATCH_STRING_END) then | |||
!call Log_4('OPERATION-CODE=10') | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
!call Set_UnlatchLed(.false.) | |||
!call Set_LatchLed(.true.) | |||
!call Set_Elevator(ELEVATOR_UNLATCH_STRING_BEGIN) | |||
return | |||
end if | |||
!OPERATION-CODE=11 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
!Get_ElevatorConnectionPossible() .and.& | |||
Get_ElevatorPickup().and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
!Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
!Get_LatchLed() .and.& | |||
!Get_FillMouseHoleLed() .and.& | |||
Get_Elevator() == ELEVATOR_LATCH_SINGLE_END) then | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_SINGLE) | |||
!call Set_UnlatchLed(.true.) | |||
call Set_FillMouseHoleLed(.false.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
!call Set_Elevator(ELEVATOR_LATCH_SINGLE_BEGIN) | |||
return | |||
end if | |||
!OPERATION-CODE=12 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.& | |||
!Get_Swing() == SWING_MOUSE_HOLE_END .and.& | |||
!Get_UnlatchLed() .and.& | |||
!Get_FillMouseHoleLed() == .false. .and.& | |||
Get_Elevator() == ELEVATOR_UNLATCH_SINGLE_END) then | |||
!call Log_4('OPERATION-CODE=12') | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING) | |||
!call Set_UnlatchLed(.false.) | |||
!call Set_LatchLed(.true.) | |||
call Set_FillMouseHoleLed(.true.) | |||
call Set_MouseHole(MOUSE_HOLE_NEUTRAL) | |||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||
!call Set_Elevator(ELEVATOR_UNLATCH_SINGLE_BEGIN) | |||
return | |||
end if | |||
!OPERATION-CODE=13 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%PL) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and.& | |||
!Get_Swing() == SWING_WELL_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_ElevatorPickup().and.& | |||
Get_Tong() == TONG_BREAKOUT_END) then | |||
!call Log_4('OPERATION-CODE=13') | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_SINGLE) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_SINGLE) | |||
!call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE) | |||
call Set_Tong(TONG_NEUTRAL) | |||
return | |||
end if | |||
!OPERATION-CODE=14 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%PL) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.& | |||
!Get_Swing() == SWING_WELL_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_ElevatorPickup().and.& | |||
Get_Tong() == TONG_MAKEUP_END) then | |||
!call Log_4('OPERATION-CODE=14') | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_STRING) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_SINGLE) | |||
return | |||
end if | |||
!OPERATION-CODE=15 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%SL - data%State%OperationScenario%LG) .and.& | |||
!Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL - RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and.& | |||
!Get_Swing() == SWING_WELL_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_ElevatorPickup().and.& | |||
Get_Tong() == TONG_BREAKOUT_END) then | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_STAND) | |||
call Set_StringUpdate(STRING_UPDATE_REMOVE_STAND) | |||
return | |||
end if | |||
!OPERATION-CODE=16 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
!Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL - RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG) .and.& | |||
!Get_JointConnectionPossible() .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND .and.& | |||
!Get_Swing() == SWING_WELL_END .and.& | |||
!Get_TongNotification() .and.& | |||
Get_ElevatorPickup().and.& | |||
Get_Tong() == TONG_MAKEUP_END) then | |||
!call Log_4('OPERATION-CODE=16') | |||
call Set_Tong(TONG_NEUTRAL) | |||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_STRING) | |||
call Set_StringUpdate(STRING_UPDATE_ADD_STAND) | |||
return | |||
end if | |||
!OPERATION-CODE=75 | |||
if (Get_ElevatorPickup() == .false. .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE) then | |||
call Set_ElevatorConnection(ELEVATOR_LATCH_SINGLE) | |||
return | |||
end if | |||
!OPERATION-CODE=76 | |||
if (Get_ElevatorPickup() == .false. .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND) then | |||
call Set_ElevatorConnection(ELEVATOR_LATCH_STAND) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_ElevatorConnection() | |||
! use CDrillingConsoleVariables | |||
! use ConfigurationVariables | |||
! use ConfigurationVariables | |||
! implicit none | |||
! call OnLatchPipePress%Add(ButtonPress_Latch_ElevatorConnection) | |||
! call OnUnlatchPipePress%Add(ButtonPress_Unlatch_ElevatorConnection) | |||
! call OnBreakoutLeverPress%Add(ButtonPress_Breakout_ElevatorConnection) | |||
! call OnMakeupLeverPress%Add(ButtonPress_Makeup_ElevatorConnection) | |||
! end subroutine | |||
subroutine ButtonPress_Latch_ElevatorConnection() | |||
use CCommon, only: SetStandRack | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 348 | |||
!TOPDRIVE-CODE=73 | |||
if ((Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC()) .and. Get_HookHeight() <= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() + data%State%OperationScenario%TG)) .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_LatchLed()) then | |||
call Set_Elevator(ELEVATOR_LATCH_STAND_BEGIN) | |||
call Set_LatchLed(.false.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=74 | |||
if (Get_HookHeight() <= (TL() + NFC() - data%State%OperationScenario%ECG) .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_ElevatorConnectionPossible() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_LatchLed()) then | |||
call Set_Elevator(ELEVATOR_LATCH_STRING_BEGIN) | |||
call Set_LatchLed(.false.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=75 | |||
if (Get_ElevatorConnectionPossible() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_LatchLed() .and.& | |||
Get_FillMouseHoleLed()) then | |||
call Set_Elevator(ELEVATOR_LATCH_SINGLE_BEGIN) | |||
call Set_LatchLed(.false.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
# 420 | |||
!OPERATION-CODE=86 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() - data%State%OperationScenario%ECG) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_LatchLed() .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_ElevatorConnectionPossible() .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection())) then | |||
!call Log_4("OPERATION-CODE=ELEVATOR_LATCH_STRING_BEGIN") | |||
call Set_Elevator(ELEVATOR_LATCH_STRING_BEGIN) | |||
call Set_LatchLed(.false.) | |||
return | |||
endif | |||
!OPERATION-CODE=85 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection()) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection() + data%State%OperationScenario%LG) .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_LatchLed() .and.& | |||
Get_Swing() == SWING_WELL_END) then | |||
!Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL + RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG) | |||
call Set_Elevator(ELEVATOR_LATCH_STAND_BEGIN) | |||
call Set_LatchLed(.false.) | |||
return | |||
endif | |||
!OPERATION-CODE=87 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_LatchLed() .and.& | |||
Get_FillMouseHoleLed() .and.& | |||
Get_ElevatorConnectionPossible() .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END) then | |||
call Set_Elevator(ELEVATOR_LATCH_SINGLE_BEGIN) | |||
call Set_LatchLed(.false.) | |||
return | |||
endif | |||
endif | |||
end subroutine | |||
subroutine ButtonPress_Unlatch_ElevatorConnection() | |||
use CCommon, only: SetStandRack | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 491 | |||
!TOPDRIVE-CODE=76 | |||
if ((Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC()) .and. Get_HookHeight() <= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() + data%State%OperationScenario%TG)) .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_UnlatchLed()) then | |||
call Set_Elevator(ELEVATOR_UNLATCH_STAND_BEGIN) | |||
call Set_UnlatchLed(.false.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=77 | |||
if (Get_HookHeight() <= (TL() + NFC() - data%State%OperationScenario%ECG) .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | |||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STRING .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING) .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_UnlatchLed()) then | |||
call Set_Elevator(ELEVATOR_UNLATCH_STRING_BEGIN) | |||
call Set_UnlatchLed(.false.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=78 | |||
if ((Get_HookHeight() > TL() .and. Get_HookHeight() < (TL() + NFC() + data%State%OperationScenario%SG)) .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_UnlatchLed() .and.& | |||
Get_FillMouseHoleLed() == .false.) then | |||
call Set_Elevator(ELEVATOR_UNLATCH_SINGLE_BEGIN) | |||
call Set_UnlatchLed(.false.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
# 559 | |||
!OPERATION-CODE=89 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() - data%State%OperationScenario%ECG) .and.& | |||
(Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_ElevatorConnection() == ELEVATOR_LATCH_STRING) .and.& | |||
Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection()) .and.& | |||
Get_UnlatchLed() .and.& | |||
GetRotaryRpm() == 0.0d0 .and.& | |||
Get_Swing() == SWING_WELL_END .and.& | |||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0) then | |||
!Get_HookHeight() >= (HL + Get_NearFloorConnection() - 4.0) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() - 2.0)) then | |||
call Set_Elevator(ELEVATOR_UNLATCH_STRING_BEGIN) | |||
call Set_UnlatchLed(.false.) | |||
return | |||
endif | |||
!OPERATION-CODE=88 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection()) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + Get_NearFloorConnection() + data%State%OperationScenario%LG) .and.& | |||
!Get_HookHeight() >= (HL + Get_NearFloorConnection() + SL + RE) .and. Get_HookHeight() <= (HL + Get_NearFloorConnection() + SL + LG) | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STAND .and.& | |||
Get_UnlatchLed() .and.& | |||
Get_Swing() == SWING_WELL_END) then | |||
call Set_Elevator(ELEVATOR_UNLATCH_STAND_BEGIN) | |||
call Set_UnlatchLed(.false.) | |||
return | |||
endif | |||
!OPERATION-CODE=90 | |||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_SINGLE .and.& | |||
Get_UnlatchLed() .and.& | |||
Get_HookHeight() >= data%State%OperationScenario%HL .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%SG) .and.& | |||
!Get_JointConnectionPossible() .and.& | |||
Get_Swing() == SWING_MOUSE_HOLE_END) then | |||
call Set_Elevator(ELEVATOR_UNLATCH_SINGLE_BEGIN) | |||
call Set_UnlatchLed(.false.) | |||
return | |||
endif | |||
endif | |||
end subroutine | |||
subroutine ButtonPress_Breakout_ElevatorConnection() | |||
implicit none | |||
end subroutine | |||
subroutine ButtonPress_Makeup_ElevatorConnection() | |||
implicit none | |||
end subroutine | |||
end module CElevatorConnectionEnum |
@@ -0,0 +1,75 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Notifications/CCloseKellyCockLedNotification.f90" | |||
module CCloseKellyCockLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_CloseKellyCockLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_CloseKellyCockLed=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_CloseKellyCockLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_CloseKellyCockLed() | |||
! use CDrillingConsoleVariables | |||
! use ConfigurationVariables | |||
! use ConfigurationVariables | |||
! implicit none | |||
! call OnCloseKellyCockPress%Add(ButtonPress_CloseKellyCock) | |||
! end subroutine | |||
subroutine ButtonPress_CloseKellyCock() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 49 | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
# 55 | |||
!OPERATION-CODE=66 | |||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||
Get_CloseKellyCockLed() == .false. .and.& | |||
Get_OpenKellyCockLed()) then | |||
call Set_OpenKellyCockLed(.false.) | |||
call Set_CloseKellyCockLed(.true.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
end module CCloseKellyCockLedNotification |
@@ -70,7 +70,7 @@ module CIrIBopLedNotification | |||
!TOPDRIVE-CODE=60 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed() == .true. .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then | |||
call Set_IrIBopLed(.false.) | |||
return | |||
@@ -0,0 +1,119 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Notifications/CIrIBopLedNotification.f90" | |||
module CIrIBopLedNotification | |||
use OperationScenariosModule | |||
! use CTopDrivePanelVariables | |||
use SimulationVariables | |||
implicit none | |||
contains | |||
subroutine Evaluate_IrIBopLed() | |||
implicit none | |||
! if (DriveType == TopDrive_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_IrIBopLed=TopDrive' | |||
!#endif | |||
! endif | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_IrIBopLed=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_IrIBopLed() | |||
! use CDrillingConsoleVariables | |||
!@ use ConfigurationVariables | |||
!@ use ConfigurationVariables | |||
! implicit none | |||
! call OnIRIBopPress%Add(ButtonPress_IrIBop) | |||
! end subroutine | |||
subroutine ButtonPress_IrIBop() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 55 | |||
!TOPDRIVE-CODE=59 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed() == .false.) then | |||
call Set_IrIBopLed(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=60 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed() == .true. .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then | |||
call Set_IrIBopLed(.false.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
# 93 | |||
!OPERATION-CODE=63 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed() == .false.) then | |||
call Set_IrIBopLed(.true.) | |||
return | |||
end if | |||
!OPERATION-CODE=64 | |||
if (Get_IrIbopPermission() .and.& | |||
Get_IrIBopLed()) then | |||
call Set_IrIBopLed(.false.) | |||
return | |||
end if | |||
endif | |||
end subroutine | |||
end module CIrIBopLedNotification |
@@ -18,11 +18,11 @@ module CTdsIbopLedNotification | |||
!TOPDRIVE-CODE=61 | |||
if (Get_IbopLed() == .false. .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbop == .false.) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& | |||
data%Equipments%TopDrivePanel%TopDriveIbop == .false.) then | |||
call Set_IbopLed(.true.) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_OFF | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_OFF | |||
return | |||
end if | |||
@@ -31,11 +31,11 @@ module CTdsIbopLedNotification | |||
!TOPDRIVE-CODE=62 | |||
if (Get_IbopLed() .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbop) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& | |||
data%Equipments%TopDrivePanel%TopDriveIbop) then | |||
call Set_IbopLed(.false.) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
return | |||
end if | |||
@@ -0,0 +1,72 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Notifications/CTdsIbopLedNotification.f90" | |||
module CTdsIbopLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_IbopLed() | |||
use CCommon | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 14 | |||
!TOPDRIVE-CODE=61 | |||
if (Get_IbopLed() == .false. .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& | |||
data%Equipments%TopDrivePanel%TopDriveIbop == .false.) then | |||
call Set_IbopLed(.true.) | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_OFF | |||
return | |||
end if | |||
!TOPDRIVE-CODE=62 | |||
if (Get_IbopLed() .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF .and.& | |||
data%Equipments%TopDrivePanel%TopDriveIbop) then | |||
call Set_IbopLed(.false.) | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
return | |||
end if | |||
endif | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_IbopLed=Kelly' | |||
!#endif | |||
! | |||
! endif | |||
end subroutine | |||
! subroutine Subscribe_IbopLed() | |||
! implicit none | |||
! end subroutine | |||
end module CTdsIbopLedNotification |
@@ -15,7 +15,7 @@ module CTdsPowerLedNotification | |||
#endif | |||
!TOPDRIVE-CODE=63 | |||
if (data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then | |||
if (data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then | |||
call Set_PowerLed(.true.) | |||
return | |||
end if | |||
@@ -0,0 +1,48 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotification.f90" | |||
module CTdsPowerLedNotification | |||
use OperationScenariosModule | |||
use SimulationVariables | |||
implicit none | |||
contains | |||
subroutine Evaluate_PowerLed() | |||
use CCommon | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 15 | |||
!TOPDRIVE-CODE=63 | |||
if (data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_OFF) then | |||
call Set_PowerLed(.true.) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
# 35 | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_PowerLed() | |||
! implicit none | |||
! end subroutine | |||
end module CTdsPowerLedNotification |
@@ -14,14 +14,14 @@ module CTdsTorqueWrenchLedNotification | |||
!TOPDRIVE-CODE=81 | |||
if((Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_BEGIN .or.& | |||
Get_TdsBackupClamp() == BACKUP_CLAMP_FW_BEGIN) .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_TorqueWrenchLed(LED_BLINK) | |||
return | |||
endif | |||
!TOPDRIVE-CODE=81 | |||
if(Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_TorqueWrenchLed(LED_ON) | |||
return | |||
endif | |||
@@ -0,0 +1,58 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Notifications/CTdsTorqueWrenchLedNotification.f90" | |||
module CTdsTorqueWrenchLedNotification | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_TorqueWrenchLed() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 12 | |||
!TOPDRIVE-CODE=81 | |||
if((Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_BEGIN .or.& | |||
Get_TdsBackupClamp() == BACKUP_CLAMP_FW_BEGIN) .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_TorqueWrenchLed(LED_BLINK) | |||
return | |||
endif | |||
!TOPDRIVE-CODE=81 | |||
if(Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_TorqueWrenchLed(LED_ON) | |||
return | |||
endif | |||
call Set_TorqueWrenchLed(LED_OFF) | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
# 45 | |||
endif | |||
end subroutine | |||
! subroutine Subscribe_TorqueWrenchLed() | |||
! implicit none | |||
! end subroutine | |||
end module CTdsTorqueWrenchLedNotification |
@@ -14,10 +14,10 @@ contains | |||
data%State%notifications%UnlatchLed = v | |||
if(data%State%notifications%UnlatchLed) then | |||
data%EquipmentControl%DrillingConsole%UnlatchPipeLED = 1 | |||
data%Equipments%DrillingConsole%UnlatchPipeLED = 1 | |||
!call Set_LatchLed(.false.) | |||
else | |||
data%EquipmentControl%DrillingConsole%UnlatchPipeLED = 0 | |||
data%Equipments%DrillingConsole%UnlatchPipeLED = 0 | |||
endif | |||
!**call data%State%notifications%OnUnlatchLedChange%RunAll() | |||
@@ -49,7 +49,7 @@ contains | |||
subroutine Set_TorqueWrenchLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrenchLed | |||
use SimulationVariables!, only: data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed | |||
implicit none | |||
integer , intent(in) :: v | |||
@@ -57,7 +57,7 @@ contains | |||
if(data%State%notifications%TorqueWrenchLed == v) return | |||
#endif | |||
data%State%notifications%TorqueWrenchLed = v | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrenchLed = v | |||
data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed = v | |||
!**call data%State%notifications%OnTorqueWrenchLedChange%RunAll() | |||
end subroutine | |||
@@ -68,7 +68,7 @@ contains | |||
subroutine Set_PowerLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed | |||
use SimulationVariables!, only: data%Equipments%TopDrivePanel%TopDriveTdsPowerLed | |||
!use CLatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
@@ -78,10 +78,10 @@ contains | |||
data%State%notifications%PowerLed = v | |||
if(data%State%notifications%PowerLed) then | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed = 1 | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerLed = 1 | |||
!call Set_LatchLed(.false.) | |||
else | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerLed = 0 | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerLed = 0 | |||
endif | |||
!**call data%State%notifications%OnPowerLedChange%RunAll() | |||
@@ -94,7 +94,7 @@ contains | |||
subroutine Set_IbopLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%EquipmentControl%TopDrivePanel%TopDriveIbopLed | |||
use SimulationVariables!, only: data%Equipments%TopDrivePanel%TopDriveIbopLed | |||
use CManifolds, Only: OpenTopDriveIBop, CloseTopDriveIBop | |||
!use CLatchLedNotification | |||
implicit none | |||
@@ -105,10 +105,10 @@ contains | |||
data%State%notifications%IbopLed = v | |||
if(data%State%notifications%IbopLed) then | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbopLed = 1 | |||
data%Equipments%TopDrivePanel%TopDriveIbopLed = 1 | |||
call CloseTopDriveIBop() | |||
else | |||
data%EquipmentControl%TopDrivePanel%TopDriveIbopLed = 0 | |||
data%Equipments%TopDrivePanel%TopDriveIbopLed = 0 | |||
call OpenTopDriveIBop() | |||
endif | |||
@@ -132,9 +132,9 @@ contains | |||
#endif | |||
data%State%notifications%SwingLed = v | |||
if(data%State%notifications%SwingLed) then | |||
data%EquipmentControl%DrillingConsole%SwingLed = 1 | |||
data%Equipments%DrillingConsole%SwingLed = 1 | |||
else | |||
data%EquipmentControl%DrillingConsole%SwingLed = 0 | |||
data%Equipments%DrillingConsole%SwingLed = 0 | |||
endif | |||
!**call data%State%notifications%OnSwingLedChange%RunAll() | |||
end subroutine | |||
@@ -227,7 +227,7 @@ contains | |||
subroutine Set_LatchLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%EquipmentControl%DrillingConsole%LatchPipeLED | |||
use SimulationVariables!, only: data%Equipments%DrillingConsole%LatchPipeLED | |||
!use CUnlatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
@@ -236,10 +236,10 @@ contains | |||
#endif | |||
data%State%notifications%LatchLed = v | |||
if(data%State%notifications%LatchLed) then | |||
data%EquipmentControl%DrillingConsole%LatchPipeLED = 1 | |||
data%Equipments%DrillingConsole%LatchPipeLED = 1 | |||
!call Set_UnlatchLed(.false.) | |||
else | |||
data%EquipmentControl%DrillingConsole%LatchPipeLED = 0 | |||
data%Equipments%DrillingConsole%LatchPipeLED = 0 | |||
endif | |||
!**call data%State%notifications%OnLatchLedChange%RunAll() | |||
end subroutine | |||
@@ -252,7 +252,7 @@ contains | |||
subroutine Set_IrSafetyValveLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%EquipmentControl%DrillingConsole%CloseKellyCockLed => IRSafetyValveLed | |||
use SimulationVariables!, only: data%Equipments%DrillingConsole%CloseKellyCockLed => IRSafetyValveLed | |||
use CManifolds, only: & | |||
InstallSafetyValve_TopDrive, & | |||
InstallSafetyValve_KellyMode, & | |||
@@ -272,7 +272,7 @@ contains | |||
data%State%notifications%IrSafetyValveLed = v | |||
if(data%State%notifications%IrSafetyValveLed) then | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 1 | |||
data%Equipments%DrillingConsole%IRSafetyValveLed = 1 | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call InstallSafetyValve_TopDrive() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call InstallSafetyValve_KellyMode() | |||
@@ -280,7 +280,7 @@ contains | |||
call Set_SafetyValve_Install() | |||
else | |||
data%EquipmentControl%DrillingConsole%IRSafetyValveLed = 0 | |||
data%Equipments%DrillingConsole%IRSafetyValveLed = 0 | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call RemoveSafetyValve_TopDrive() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call RemoveSafetyValve_KellyMode() | |||
@@ -311,11 +311,11 @@ contains | |||
#endif | |||
data%State%notifications%IrIBopLed = v | |||
if(data%State%notifications%IrIBopLed) then | |||
data%EquipmentControl%DrillingConsole%IRIBopLed = 1 | |||
data%Equipments%DrillingConsole%IRIBopLed = 1 | |||
call InstallIBop() | |||
call Set_Ibop_Install() | |||
else | |||
data%EquipmentControl%DrillingConsole%IRIBopLed = 0 | |||
data%Equipments%DrillingConsole%IRIBopLed = 0 | |||
call RemoveIBop() | |||
call Set_Ibop_Remove() | |||
endif | |||
@@ -341,10 +341,10 @@ contains | |||
#endif | |||
data%State%notifications%FillMouseHoleLed = v | |||
if(data%State%notifications%FillMouseHoleLed) then | |||
data%EquipmentControl%DrillingConsole%FillMouseHoleLed = 1 | |||
data%Equipments%DrillingConsole%FillMouseHoleLed = 1 | |||
!call Set_MouseHole(MOUSE_HOLE_FILL) | |||
else | |||
data%EquipmentControl%DrillingConsole%FillMouseHoleLed = 0 | |||
data%Equipments%DrillingConsole%FillMouseHoleLed = 0 | |||
!call Set_MouseHole(MOUSE_HOLE_EMPTY) | |||
endif | |||
!**call data%State%notifications%OnFillMouseHoleLedChange%RunAll() | |||
@@ -0,0 +1,409 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Notifications/Notifications.f90" | |||
module NotificationModule | |||
use SimulationVariables | |||
implicit none | |||
contains | |||
subroutine Set_UnlatchLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
!use CLatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%UnlatchLed == v) return | |||
#endif | |||
data%State%notifications%UnlatchLed = v | |||
if(data%State%notifications%UnlatchLed) then | |||
data%Equipments%DrillingConsole%UnlatchPipeLED = 1 | |||
!call Set_LatchLed(.false.) | |||
else | |||
data%Equipments%DrillingConsole%UnlatchPipeLED = 0 | |||
endif | |||
!**call data%State%notifications%OnUnlatchLedChange%RunAll() | |||
end subroutine | |||
logical function Get_UnlatchLed() | |||
implicit none | |||
Get_UnlatchLed = data%State%notifications%UnlatchLed | |||
end function | |||
subroutine Set_TongNotification(v) | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%TongNotification == v) return | |||
#endif | |||
data%State%notifications%TongNotification = v | |||
! if(associated(data%State%notifications%TongNotificationPtr)) !**call data%State%notifications%TongNotificationPtr(data%State%notifications%TongNotification) | |||
#ifdef deb | |||
print*, 'data%State%notifications%TongNotification=', data%State%notifications%TongNotification | |||
#endif | |||
!**call data%State%notifications%OnTongNotificationChange%RunAll() | |||
end subroutine | |||
logical function Get_TongNotification() | |||
implicit none | |||
Get_TongNotification = data%State%notifications%TongNotification | |||
end function | |||
subroutine Set_TorqueWrenchLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed | |||
implicit none | |||
integer , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%TorqueWrenchLed == v) return | |||
#endif | |||
data%State%notifications%TorqueWrenchLed = v | |||
data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed = v | |||
!**call data%State%notifications%OnTorqueWrenchLedChange%RunAll() | |||
end subroutine | |||
logical function Get_TorqueWrenchLed() | |||
implicit none | |||
Get_TorqueWrenchLed = data%State%notifications%TorqueWrenchLed | |||
end function | |||
subroutine Set_PowerLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%Equipments%TopDrivePanel%TopDriveTdsPowerLed | |||
!use CLatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%PowerLed == v) return | |||
#endif | |||
data%State%notifications%PowerLed = v | |||
if(data%State%notifications%PowerLed) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerLed = 1 | |||
!call Set_LatchLed(.false.) | |||
else | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerLed = 0 | |||
endif | |||
!**call data%State%notifications%OnPowerLedChange%RunAll() | |||
end subroutine | |||
logical function Get_PowerLed() | |||
implicit none | |||
Get_PowerLed = data%State%notifications%PowerLed | |||
end function | |||
subroutine Set_IbopLed(v) | |||
use CTopDrivePanelVariables | |||
use SimulationVariables!, only: data%Equipments%TopDrivePanel%TopDriveIbopLed | |||
use CManifolds, Only: OpenTopDriveIBop, CloseTopDriveIBop | |||
!use CLatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%IbopLed == v) return | |||
#endif | |||
data%State%notifications%IbopLed = v | |||
if(data%State%notifications%IbopLed) then | |||
data%Equipments%TopDrivePanel%TopDriveIbopLed = 1 | |||
call CloseTopDriveIBop() | |||
else | |||
data%Equipments%TopDrivePanel%TopDriveIbopLed = 0 | |||
call OpenTopDriveIBop() | |||
endif | |||
!**call data%State%notifications%OnIbopLedChange%RunAll() | |||
end subroutine | |||
logical function Get_IbopLed() | |||
implicit none | |||
Get_IbopLed = data%State%notifications%IbopLed | |||
end function | |||
subroutine Set_SwingLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: SwingLedHw => SwingLed | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%SwingLed == v) return | |||
#endif | |||
data%State%notifications%SwingLed = v | |||
if(data%State%notifications%SwingLed) then | |||
data%Equipments%DrillingConsole%SwingLed = 1 | |||
else | |||
data%Equipments%DrillingConsole%SwingLed = 0 | |||
endif | |||
!**call data%State%notifications%OnSwingLedChange%RunAll() | |||
end subroutine | |||
logical function Get_SwingLed() | |||
implicit none | |||
Get_SwingLed = data%State%notifications%SwingLed | |||
end function | |||
subroutine Set_SlipsNotification(v) | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%SlipsNotification == v) return | |||
#endif | |||
data%State%notifications%SlipsNotification = v | |||
! if(associated(data%State%notifications%SlipsNotificationPtr)) !**call data%State%notifications%SlipsNotificationPtr(data%State%notifications%SlipsNotification) | |||
#ifdef deb | |||
print*, 'data%State%notifications%SlipsNotification=', data%State%notifications%SlipsNotification | |||
#endif | |||
!**call data%State%notifications%OnSlipsNotificationChange%RunAll() | |||
end subroutine | |||
logical function Get_SlipsNotification() | |||
implicit none | |||
Get_SlipsNotification = data%State%notifications%SlipsNotification | |||
end function | |||
subroutine Set_OpenSafetyValveLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: OpenSafetyValveLedHw => OpenSafetyValveLed | |||
use CManifolds, only: OpenSafetyValve_TopDrive, OpenSafetyValve_KellyMode, OpenSafetyValve_TripMode | |||
use CHoistingVariables | |||
use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%OpenSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%OpenSafetyValveLed = v | |||
if(data%State%notifications%OpenSafetyValveLed) then | |||
!!call OpenSafetyValve() | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call OpenSafetyValve_TopDrive() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_OpenSafetyValveLed == 0) call OpenSafetyValve_KellyMode() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_OpenSafetyValveLed == 1) call OpenSafetyValve_TripMode() | |||
endif | |||
!**call data%State%notifications%OnOpenSafetyValveLedChange%RunAll() | |||
end subroutine | |||
logical function Get_OpenSafetyValveLed() | |||
implicit none | |||
Get_OpenSafetyValveLed = data%State%notifications%OpenSafetyValveLed | |||
end function | |||
subroutine Set_OpenKellyCockLed(v) | |||
! use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: OpenKellyCockLedHw => OpenKellyCockLed | |||
use CManifolds, only: OpenKellyCock | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%OpenKellyCockLed == v) return | |||
#endif | |||
data%State%notifications%OpenKellyCockLed = v | |||
if(data%State%notifications%OpenKellyCockLed) then | |||
call OpenKellyCock() | |||
endif | |||
! HAS BEEN IMPLEMENTED IN CMANIFOLD | |||
!if(OpenKellyCockLed) then | |||
! OpenKellyCockLedHw = 1 | |||
!else | |||
! OpenKellyCockLedHw = 0 | |||
!endif | |||
!**call data%State%notifications%OnOpenKellyCockLedChange%RunAll() | |||
end subroutine | |||
logical function Get_OpenKellyCockLed() | |||
implicit none | |||
Get_OpenKellyCockLed = data%State%notifications%OpenKellyCockLed | |||
end function | |||
subroutine Set_LatchLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%Equipments%DrillingConsole%LatchPipeLED | |||
!use CUnlatchLedNotification | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%LatchLed == v) return | |||
#endif | |||
data%State%notifications%LatchLed = v | |||
if(data%State%notifications%LatchLed) then | |||
data%Equipments%DrillingConsole%LatchPipeLED = 1 | |||
!call Set_UnlatchLed(.false.) | |||
else | |||
data%Equipments%DrillingConsole%LatchPipeLED = 0 | |||
endif | |||
!**call data%State%notifications%OnLatchLedChange%RunAll() | |||
end subroutine | |||
logical function Get_LatchLed() | |||
implicit none | |||
Get_LatchLed = data%State%notifications%LatchLed | |||
end function | |||
subroutine Set_IrSafetyValveLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: data%Equipments%DrillingConsole%CloseKellyCockLed => IRSafetyValveLed | |||
use CManifolds, only: & | |||
InstallSafetyValve_TopDrive, & | |||
InstallSafetyValve_KellyMode, & | |||
InstallSafetyValve_TripMode, & | |||
RemoveSafetyValve_TopDrive, & | |||
RemoveSafetyValve_KellyMode, & | |||
RemoveSafetyValve_TripMode | |||
use UnitySignalVariables | |||
use UnitySignalsModule, only: Set_SafetyValve_Install, Set_SafetyValve_Remove | |||
use CHoistingVariables | |||
use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%IrSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%IrSafetyValveLed = v | |||
if(data%State%notifications%IrSafetyValveLed) then | |||
data%Equipments%DrillingConsole%IRSafetyValveLed = 1 | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call InstallSafetyValve_TopDrive() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call InstallSafetyValve_KellyMode() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call InstallSafetyValve_TripMode() | |||
call Set_SafetyValve_Install() | |||
else | |||
data%Equipments%DrillingConsole%IRSafetyValveLed = 0 | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call RemoveSafetyValve_TopDrive() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call RemoveSafetyValve_KellyMode() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call RemoveSafetyValve_TripMode() | |||
call Set_SafetyValve_Remove() | |||
endif | |||
!**call data%State%notifications%OnIrSafetyValveLedChange%RunAll() | |||
end subroutine | |||
logical function Get_IrSafetyValveLed() | |||
implicit none | |||
Get_IrSafetyValveLed = data%State%notifications%IrSafetyValveLed | |||
end function | |||
subroutine Set_IrIBopLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: IRIBopLedHw => IRIBopLed | |||
use CManifolds, only: InstallIBop, RemoveIBop | |||
use UnitySignalVariables | |||
use UnitySignalsModule, only: Set_Ibop_Install, Set_Ibop_Remove | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%IrIBopLed == v) return | |||
#endif | |||
data%State%notifications%IrIBopLed = v | |||
if(data%State%notifications%IrIBopLed) then | |||
data%Equipments%DrillingConsole%IRIBopLed = 1 | |||
call InstallIBop() | |||
call Set_Ibop_Install() | |||
else | |||
data%Equipments%DrillingConsole%IRIBopLed = 0 | |||
call RemoveIBop() | |||
call Set_Ibop_Remove() | |||
endif | |||
!**call data%State%notifications%OnIrIBopLedChange%RunAll() | |||
end subroutine | |||
logical function Get_IrIBopLed() | |||
implicit none | |||
Get_IrIBopLed = data%State%notifications%IrIBopLed | |||
end function | |||
subroutine Set_FillMouseHoleLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: FillMouseHoleLedHw => FillMouseHoleLed | |||
! use CMouseHoleEnumVariables | |||
use UnitySignalVariables | |||
use UnitySignalsModule | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%FillMouseHoleLed == v) return | |||
#endif | |||
data%State%notifications%FillMouseHoleLed = v | |||
if(data%State%notifications%FillMouseHoleLed) then | |||
data%Equipments%DrillingConsole%FillMouseHoleLed = 1 | |||
!call Set_MouseHole(MOUSE_HOLE_FILL) | |||
else | |||
data%Equipments%DrillingConsole%FillMouseHoleLed = 0 | |||
!call Set_MouseHole(MOUSE_HOLE_EMPTY) | |||
endif | |||
!**call data%State%notifications%OnFillMouseHoleLedChange%RunAll() | |||
end subroutine | |||
logical function Get_FillMouseHoleLed() | |||
implicit none | |||
Get_FillMouseHoleLed = data%State%notifications%FillMouseHoleLed | |||
end function | |||
subroutine Set_CloseKellyCockLed(v) | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables!, only: CloseKellyCockLedHw => CloseKellyCockLed | |||
use CManifolds, only: CloseKellyCock | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%CloseKellyCockLed == v) return | |||
#endif | |||
data%State%notifications%CloseKellyCockLed = v | |||
if(data%State%notifications%CloseKellyCockLed) then | |||
call CloseKellyCock() | |||
endif | |||
!**call data%State%notifications%OnCloseKellyCockLedChange%RunAll() | |||
end subroutine | |||
logical function Get_CloseKellyCockLed() | |||
implicit none | |||
Get_CloseKellyCockLed = data%State%notifications%CloseKellyCockLed | |||
end function | |||
subroutine Set_CloseSafetyValveLed(v) | |||
! use CDrillingConsoleVariables | |||
use SimulationVariables | |||
!@use ConfigurationVariables, only: CloseSafetyValveLedHw => CloseSafetyValveLed | |||
use CManifolds, only: CloseSafetyValve_TopDrive, CloseSafetyValve_KellyMode, CloseSafetyValve_TripMode | |||
use CHoistingVariables | |||
use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | |||
implicit none | |||
logical , intent(in) :: v | |||
#ifdef ExcludeExtraChanges | |||
if(data%State%notifications%CloseSafetyValveLed == v) return | |||
#endif | |||
data%State%notifications%CloseSafetyValveLed = v | |||
if(data%State%notifications%CloseSafetyValveLed) then | |||
!!call CloseSafetyValve() | |||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call CloseSafetyValve_TopDrive() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_CloseSafetyValveLed == 0) call CloseSafetyValve_KellyMode() | |||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_CloseSafetyValveLed == 1) call CloseSafetyValve_TripMode() | |||
endif | |||
!**call data%State%notifications%OnCloseSafetyValveLedChange%RunAll() | |||
end subroutine | |||
logical function Get_CloseSafetyValveLed() | |||
implicit none | |||
Get_CloseSafetyValveLed = data%State%notifications%CloseSafetyValveLed | |||
end function | |||
end module NotificationModule | |||
@@ -18,7 +18,7 @@ module CSwingDrillPermission | |||
!TOPDRIVE-CODE=33 | |||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_SwingDrillPermission(.true.) | |||
return | |||
@@ -0,0 +1,61 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Permissions/CSwingDrillPermission.f90" | |||
module CSwingDrillPermission | |||
use OperationScenariosModule | |||
use CTopDrivePanelVariables | |||
use SimulationVariables | |||
implicit none | |||
contains | |||
subroutine Evaluate_SwingDrillPermission() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 16 | |||
!TOPDRIVE-CODE=33 | |||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_SwingDrillPermission(.true.) | |||
return | |||
end if | |||
call Set_SwingDrillPermission(.false.) | |||
endif | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_SwingDrillPermission=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
subroutine Subscribe_SwingDrillPermission() | |||
implicit none | |||
end subroutine | |||
end module CSwingDrillPermission |
@@ -20,7 +20,7 @@ module CSwingOffPermission | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_Slips() == SLIPS_SET_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_SwingOffPermission(.true.) | |||
return | |||
@@ -33,7 +33,7 @@ module CSwingOffPermission | |||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_DRILL_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_SwingOffPermission(.true.) | |||
return | |||
@@ -0,0 +1,67 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Permissions/CSwingOffPermission.f90" | |||
module CSwingOffPermission | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_SwingOffPermission() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 14 | |||
!TOPDRIVE-CODE=35 | |||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
Get_Slips() == SLIPS_SET_END .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_SwingOffPermission(.true.) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=36 | |||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_DRILL_END .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_SwingOffPermission(.true.) | |||
return | |||
end if | |||
call Set_SwingOffPermission(.false.) | |||
endif | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_SwingOffPermission=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
subroutine Subscribe_SwingOffPermission() | |||
implicit none | |||
end subroutine | |||
end module CSwingOffPermission |
@@ -20,7 +20,7 @@ module CSwingTiltPermission | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_SwingTiltPermission(.true.) | |||
return | |||
@@ -0,0 +1,54 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Permissions/CSwingTiltPermission.f90" | |||
module CSwingTiltPermission | |||
use UnitySignalsModule | |||
use OperationScenariosModule | |||
use SimulationVariables | |||
implicit none | |||
contains | |||
subroutine Evaluate_SwingTiltPermission() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 15 | |||
!TOPDRIVE-CODE=34 | |||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_Slips() == SLIPS_SET_END .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||
call Set_SwingTiltPermission(.true.) | |||
return | |||
end if | |||
call Set_SwingTiltPermission(.false.) | |||
endif | |||
! if (DriveType == Kelly_DriveType) then | |||
!#ifdef OST | |||
! print*, 'Evaluate_SwingTiltPermission=Kelly' | |||
!#endif | |||
! endif | |||
end subroutine | |||
subroutine Subscribe_SwingTiltPermission() | |||
implicit none | |||
end subroutine | |||
end module CSwingTiltPermission |
@@ -23,7 +23,7 @@ module CUnityOutputs | |||
! use ConfigurationVariables | |||
! implicit none | |||
! ! PumpsSpmChanges => Calc_KellyHoseVibrationRate | |||
! ! call data%EquipmentControl%DataDisplayConsole%OnRotaryRpmChange%Add(Set_RotaryRpm) | |||
! ! call data%Equipments%DataDisplayConsole%OnRotaryRpmChange%Add(Set_RotaryRpm) | |||
! end subroutine | |||
@@ -0,0 +1,215 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Unity/CUnityOutputs.f90" | |||
module CUnityOutputs | |||
implicit none | |||
type :: UnityOutputsType | |||
real(8) :: KellyHoseVibrationRate | |||
real(8) :: BlowoutFromStringPercent | |||
real(8) :: Pedal | |||
real(8) :: FlowRate | |||
real(8) :: RotaryRpm | |||
logical :: BlowoutFromString | |||
logical :: BlowoutFromAnnular | |||
logical :: FlowFromReturnLine | |||
real :: FlowFromKelly | |||
real :: FlowFromFillupHead | |||
logical :: FlowKellyDisconnect | |||
logical :: FlowPipeDisconnect | |||
end type UnityOutputsType | |||
type(UnityOutputsType):: UnityOutputs | |||
contains | |||
! subroutine Setup() | |||
! use CDataDisplayConsole | |||
! use ConfigurationVariables | |||
! implicit none | |||
! ! PumpsSpmChanges => Calc_KellyHoseVibrationRate | |||
! ! call data%Equipments%DataDisplayConsole%OnRotaryRpmChange%Add(Set_RotaryRpm) | |||
! end subroutine | |||
subroutine Set_BlowoutFromString(v) | |||
implicit none | |||
logical, intent (in) :: v | |||
UnityOutputs%BlowoutFromString = v | |||
# 44 | |||
end subroutine | |||
logical function Get_BlowoutFromString() | |||
implicit none | |||
Get_BlowoutFromString = UnityOutputs%BlowoutFromString | |||
end function | |||
subroutine Set_BlowoutFromAnnular(v) | |||
implicit none | |||
logical, intent (in) :: v | |||
UnityOutputs%BlowoutFromAnnular = v | |||
# 58 | |||
end subroutine | |||
logical function Get_BlowoutFromAnnular() | |||
implicit none | |||
Get_BlowoutFromAnnular = UnityOutputs%BlowoutFromAnnular | |||
end function | |||
subroutine Set_FlowFromReturnLine(v) | |||
implicit none | |||
logical, intent (in) :: v | |||
UnityOutputs%FlowFromReturnLine = v | |||
# 76 | |||
end subroutine | |||
logical function Get_FlowFromReturnLine() | |||
implicit none | |||
Get_FlowFromReturnLine = UnityOutputs%FlowFromReturnLine | |||
end function | |||
subroutine Set_FlowFromKelly(v) | |||
implicit none | |||
real, intent (in) :: v | |||
UnityOutputs%FlowFromKelly = v | |||
# 92 | |||
end subroutine | |||
real function Get_FlowFromKelly() | |||
implicit none | |||
Get_FlowFromKelly = UnityOutputs%FlowFromKelly | |||
end function | |||
subroutine Set_FlowFromFillupHead(v) | |||
implicit none | |||
real, intent (in) :: v | |||
UnityOutputs%FlowFromFillupHead = v | |||
# 110 | |||
end subroutine | |||
real function Get_FlowFromFillupHead() | |||
implicit none | |||
Get_FlowFromFillupHead = UnityOutputs%FlowFromFillupHead | |||
end function | |||
subroutine Set_FlowKellyDisconnect(v) | |||
implicit none | |||
logical, intent (in) :: v | |||
UnityOutputs%FlowKellyDisconnect = v | |||
# 129 | |||
end subroutine | |||
logical function Get_FlowKellyDisconnect() | |||
implicit none | |||
Get_FlowKellyDisconnect = UnityOutputs%FlowKellyDisconnect | |||
end function | |||
subroutine Set_FlowPipeDisconnect(v) | |||
implicit none | |||
logical, intent (in) :: v | |||
UnityOutputs%FlowPipeDisconnect = v | |||
# 146 | |||
end subroutine | |||
logical function Get_FlowPipeDisconnect() | |||
implicit none | |||
Get_FlowPipeDisconnect = UnityOutputs%FlowPipeDisconnect | |||
end function | |||
subroutine Set_BlowoutFromStringPercent(v) | |||
implicit none | |||
real(8), intent (in) :: v | |||
UnityOutputs%BlowoutFromStringPercent = v | |||
# 160 | |||
end subroutine | |||
real(8) function GetBlowoutFromStringPercent() | |||
implicit none | |||
GetBlowoutFromStringPercent = UnityOutputs%BlowoutFromStringPercent | |||
end function | |||
subroutine Calc_KellyHoseVibrationRate(spm1, spm2) | |||
use CScaleRange | |||
implicit none | |||
real(8), intent (in) :: spm1, spm2 | |||
real :: total | |||
total = (spm1 + spm2)/2 | |||
UnityOutputs%KellyHoseVibrationRate = ScaleRange(total, 0.0, 10.0, 0.0, 120.0) | |||
# 177 | |||
end subroutine | |||
real(8) function GetKellyHoseVibrationRate() | |||
implicit none | |||
GetKellyHoseVibrationRate = UnityOutputs%KellyHoseVibrationRate | |||
end function | |||
subroutine Set_Pedal(v) | |||
implicit none | |||
real(8), intent (in) :: v | |||
UnityOutputs%Pedal = v | |||
# 191 | |||
end subroutine | |||
real(8) function GetPedal() | |||
implicit none | |||
GetPedal = UnityOutputs%Pedal | |||
end function | |||
subroutine Set_FlowRate(v) | |||
implicit none | |||
real(8), intent (in) :: v | |||
UnityOutputs%FlowRate = v | |||
# 205 | |||
end subroutine | |||
real(8) function GetFlowRate() | |||
implicit none | |||
GetFlowRate = UnityOutputs%FlowRate | |||
end function | |||
subroutine Set_RotaryRpm(v) | |||
implicit none | |||
real(8), intent (in) :: v | |||
UnityOutputs%RotaryRpm = v | |||
# 219 | |||
end subroutine | |||
real(8) function GetRotaryRpm() | |||
implicit none | |||
GetRotaryRpm = UnityOutputs%RotaryRpm | |||
end function | |||
end module CUnityOutputs |
@@ -13,8 +13,8 @@ module CTdsBackupClamp | |||
!TOPDRIVE-CODE=79 | |||
if(Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrench) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench) then | |||
call Set_TdsBackupClamp(BACKUP_CLAMP_FW_BEGIN) | |||
@@ -23,8 +23,8 @@ module CTdsBackupClamp | |||
!TOPDRIVE-CODE=80 | |||
if(Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_END .and.& | |||
Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_BEGIN .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTorqueWrench == .false.) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench == .false.) then | |||
call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_BEGIN) | |||
@@ -0,0 +1,58 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/UnitySignals/CTdsBackupClamp.f90" | |||
module CTdsBackupClamp | |||
use OperationScenariosModule | |||
implicit none | |||
contains | |||
subroutine Evaluate_TdsBackupClamp() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 12 | |||
!TOPDRIVE-CODE=79 | |||
if(Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_END .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench) then | |||
call Set_TdsBackupClamp(BACKUP_CLAMP_FW_BEGIN) | |||
endif | |||
!TOPDRIVE-CODE=80 | |||
if(Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_END .and.& | |||
Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_BEGIN .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench == .false.) then | |||
call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_BEGIN) | |||
endif | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
# 47 | |||
endif | |||
end subroutine | |||
subroutine Subscribe_TdsBackupClamp() | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables | |||
implicit none | |||
end subroutine | |||
end module CTdsBackupClamp |
@@ -16,8 +16,8 @@ module CTdsSpineEnum | |||
if (Get_TdsStemIn() .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||
!Get_TdsConnectionPossible() .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_FWD .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_SPINE) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_FWD .and.& | |||
data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_SPINE) then | |||
call Set_TdsSpine(TDS_SPINE_CONNECT_BEGIN) | |||
return | |||
@@ -27,8 +27,8 @@ module CTdsSpineEnum | |||
if (Get_TdsStemIn() .and.& | |||
Get_TdsTong() == TDS_TONG_BREAKOUT_END .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_SPINE .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveTdsPowerState == TdsPower_REV .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_SPINE) then | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_REV .and.& | |||
data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_SPINE) then | |||
call Set_TdsSpine(TDS_SPINE_DISCONNECT_BEGIN) | |||
return | |||
@@ -0,0 +1,63 @@ | |||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/UnitySignals/CTdsSpineEnum.f90" | |||
module CTdsSpineEnum | |||
use OperationScenariosModule | |||
use UnitySignalsModule !for CTdsConnectionModesEnum, only:Get_TdsConnectionModes | |||
implicit none | |||
contains | |||
subroutine Evaluate_TdsSpine() | |||
implicit none | |||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||
# 13 | |||
!TOPDRIVE-CODE=83 | |||
if (Get_TdsStemIn() .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||
!Get_TdsConnectionPossible() .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_FWD .and.& | |||
data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_SPINE) then | |||
call Set_TdsSpine(TDS_SPINE_CONNECT_BEGIN) | |||
return | |||
end if | |||
!TOPDRIVE-CODE=84 | |||
if (Get_TdsStemIn() .and.& | |||
Get_TdsTong() == TDS_TONG_BREAKOUT_END .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_SPINE .and.& | |||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_REV .and.& | |||
data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_SPINE) then | |||
call Set_TdsSpine(TDS_SPINE_DISCONNECT_BEGIN) | |||
return | |||
end if | |||
endif | |||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||
# 52 | |||
endif | |||
end subroutine | |||
subroutine Subscribe_TdsSpine() | |||
use CDrillingConsoleVariables | |||
use SimulationVariables | |||
use SimulationVariables | |||
implicit none | |||
end subroutine | |||
end module CTdsSpineEnum |
@@ -18,10 +18,10 @@ module CTdsSwingEnum | |||
if (Get_SwingDrillPermission() .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
Get_FillMouseHoleLed() == .false. .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_DRILL) then | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_DRILL) then | |||
call Set_TdsSwing(TDS_SWING_DRILL_BEGIN) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
return | |||
end if | |||
@@ -30,10 +30,10 @@ module CTdsSwingEnum | |||
!TOPDRIVE-CODE=38 | |||
if (Get_SwingTiltPermission() .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then | |||
call Set_TdsSwing(TDS_SWING_TILT_BEGIN) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
return | |||
end if | |||
@@ -43,10 +43,10 @@ module CTdsSwingEnum | |||
if (Get_SwingOffPermission() .and.& | |||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then | |||
call Set_TdsSwing(TDS_SWING_OFF_BEGIN) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
return | |||
end if | |||
@@ -58,10 +58,10 @@ module CTdsSwingEnum | |||
if (Get_SwingTiltPermission() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then | |||
call Set_TdsSwing(TDS_SWING_TILT_BEGIN) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
return | |||
end if | |||
@@ -73,10 +73,10 @@ module CTdsSwingEnum | |||
if (Get_SwingOffPermission() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then | |||
call Set_TdsSwing(TDS_SWING_OFF_BEGIN) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
return | |||
end if | |||
@@ -89,10 +89,10 @@ module CTdsSwingEnum | |||
Get_SwingTiltPermission() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.& | |||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_TILT) then | |||
call Set_TdsSwing(TDS_SWING_TILT_BEGIN) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
return | |||
end if | |||
@@ -104,10 +104,10 @@ module CTdsSwingEnum | |||
Get_SwingOffPermission() .and.& | |||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE .and.& | |||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_OFF) then | |||
call Set_TdsSwing(TDS_SWING_OFF_BEGIN) | |||
data%EquipmentControl%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | |||
return | |||
end if | |||