Browse Source

CTopDrivePael is done but not sure about it

najafi
abolfazl 1 year ago
parent
commit
12c8e5ea51
5 changed files with 121 additions and 65 deletions
  1. +49
    -24
      .ipynb_checkpoints/helper-checkpoint.ipynb
  2. +39
    -2
      CSharp/Equipments/ControlPanels/CTopDrivePanel.f90
  3. +0
    -2
      CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90
  4. +15
    -17
      Text1.txt
  5. +18
    -20
      helper.ipynb

+ 49
- 24
.ipynb_checkpoints/helper-checkpoint.ipynb View File

@@ -2,19 +2,44 @@
"cells": [
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[' integer :: RigType\\n',\n",
" ' real(8) :: CrownHeight\\n',\n",
" ' real(8) :: MonkeyBoandHeight\\n',\n",
" ' real(8) :: RigFloorHeight\\n']"
"[' real(8) :: AnnularRegulatorSetControl\\n',\n",
" ' real(8) :: AirMasterValve\\n',\n",
" ' real(8) :: ByePassValve\\n',\n",
" ' real(8) :: AnnularValve\\n',\n",
" ' real(8) :: UpperRamsValve\\n',\n",
" ' real(8) :: MiddleRamsValve\\n',\n",
" ' real(8) :: KillLineValve\\n',\n",
" ' real(8) :: ChokeLineValve\\n',\n",
" ' real(8) :: LowerRamsValve\\n',\n",
" ' real(8) :: ManifoldPressureGauge\\n',\n",
" ' real(8) :: AirSupplyPressureGauge\\n',\n",
" ' real(8) :: AccumulatorPressureGauge\\n',\n",
" ' real(8) :: AnnularPressureGauge\\n',\n",
" ' integer :: AnnularOpenLED\\n',\n",
" ' integer :: AnnularCloseLED\\n',\n",
" ' integer :: UpperRamsOpenLED\\n',\n",
" ' integer :: UpperRamsCloseLED\\n',\n",
" ' integer :: MiddleRamsOpenLED\\n',\n",
" ' integer :: MiddleRamsCloseLED\\n',\n",
" ' integer :: KillLineOpenLED\\n',\n",
" ' integer :: KillLineCloseLED\\n',\n",
" ' integer :: ChokeLineOpenLED\\n',\n",
" ' integer :: ChokeLineCloseLED\\n',\n",
" ' integer :: LowerRamsOpenLED\\n',\n",
" ' integer :: LowerRamsCloseLED\\n',\n",
" ' real(8) :: AnnularStatus\\n',\n",
" ' real(8) :: UpperRamsStatus\\n',\n",
" ' real(8) :: MiddleRamsStatus\\n',\n",
" ' real(8) :: LowerRamsStatus']"
]
},
"execution_count": 19,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
@@ -25,33 +50,33 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"call json%add(p,\"CasingDepth\",data%Configuration%CasingLinerChoke%CasingDepth)\n",
"call json%add(p,\"CasingId\",data%Configuration%CasingLinerChoke%CasingId)\n",
"call json%add(p,\"CasingOd\",data%Configuration%CasingLinerChoke%CasingOd)\n",
"call json%add(p,\"CasingWeight\",data%Configuration%CasingLinerChoke%CasingWeight)\n",
"call json%add(p,\"CasingCollapsePressure\",data%Configuration%CasingLinerChoke%CasingCollapsePressure)\n",
"call json%add(p,\"CasingTensileStrength\",data%Configuration%CasingLinerChoke%CasingTensileStrength)\n",
"call json%add(p,\"LinerTopDepth\",data%Configuration%CasingLinerChoke%LinerTopDepth)\n",
"call json%add(p,\"LinerLength\",data%Configuration%CasingLinerChoke%LinerLength)\n",
"call json%add(p,\"LinerId\",data%Configuration%CasingLinerChoke%LinerId)\n",
"call json%add(p,\"LinerOd\",data%Configuration%CasingLinerChoke%LinerOd)\n",
"call json%add(p,\"LinerWeight\",data%Configuration%CasingLinerChoke%LinerWeight)\n",
"call json%add(p,\"LinerCollapsePressure\",data%Configuration%CasingLinerChoke%LinerCollapsePressure)\n",
"call json%add(p,\"LinerTensileStrength\",data%Configuration%CasingLinerChoke%LinerTensileStrength)\n",
"call json%add(p,\"OpenHoleId\",data%Configuration%CasingLinerChoke%OpenHoleId)\n",
"call json%add(p,\"OpenHoleLength\",data%Configuration%CasingLinerChoke%OpenHoleLength)\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(p,\"\",data%Configuration%CasingLinerChoke%\"\"\"\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",
@@ -65,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [
{


+ 39
- 2
CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 View File

@@ -10,16 +10,53 @@ module CTopDrivePanel

type(json_value),pointer :: parent
type(json_core) :: json
type(json_value),pointer :: p
type(json_value),pointer :: p,pform
integer :: i


! 1. create new node
call json%create_object(p,'CDrivePanel')

call json%add(p,"TdsPower_REV",data%Equipments%ControlPanel%CTopDrive%TdsPower_REV)
call json%add(p,"TdsPower_OFF",data%Equipments%ControlPanel%CTopDrive%TdsPower_OFF)
call json%add(p,"TdsPower_FWD",data%Equipments%ControlPanel%CTopDrive%TdsPower_FWD)
call json%add(p,"TdsMu_TORQ",data%Equipments%ControlPanel%CTopDrive%TdsMu_TORQ)
call json%add(p,"TdsMu_SPINE",data%Equipments%ControlPanel%CTopDrive%TdsMu_SPINE)
call json%add(p,"TdsMu_DRILL",data%Equipments%ControlPanel%CTopDrive%TdsMu_DRILL)
call json%add(p,"TdsLinkTilt_TILT",data%Equipments%ControlPanel%CTopDrive%TdsLinkTilt_TILT)
call json%add(p,"TdsLinkTilt_OFF",data%Equipments%ControlPanel%CTopDrive%TdsLinkTilt_OFF)
call json%add(p,"TdsLinkTilt_DRILL",data%Equipments%ControlPanel%CTopDrive%TdsLinkTilt_DRILL)
call json%add(p,"LED_OFF",data%Equipments%ControlPanel%CTopDrive%LED_OFF)
call json%add(p,"LED_ON",data%Equipments%ControlPanel%CTopDrive%LED_ON)
call json%add(p,"LED_BLINK",data%Equipments%ControlPanel%CTopDrive%LED_BLINK)


do i=1,data%Equipments%ControlPanel%CTopDrive%Count
call json%create_object(pform,'')
call json%add(pform,"TopDriveTdsPowerState",data%Equipments%ControlPanel%CTopDrive%TopDriveTdsPowerState)
call json%add(pform,"TopDriveTorqueWrench",data%Equipments%ControlPanel%CTopDrive%TopDriveTorqueWrench)
call json%add(pform,"TopDriveDrillTorqueState",data%Equipments%ControlPanel%CTopDrive%TopDriveDrillTorqueState)
call json%add(pform,"TopDriveLinkTiltState",data%Equipments%ControlPanel%CTopDrive%TopDriveLinkTiltState)
call json%add(pform,"TopDriveIbop",data%Equipments%ControlPanel%CTopDrive%TopDriveIbop)
call json%add(pform,"TopDriveTorqueLimitKnob",data%Equipments%ControlPanel%CTopDrive%TopDriveTorqueLimitKnob)
call json%add(pform,"RpmKnob",data%Equipments%ControlPanel%CTopDrive%RpmKnob)
call json%add(pform,"TopDriveOperationFaultLed",data%Equipments%ControlPanel%CTopDrive%TopDriveOperationFaultLed)
call json%add(pform,"TopDriveTdsPowerLed",data%Equipments%ControlPanel%CTopDrive%TopDriveTdsPowerLed)
call json%add(pform,"TopDriveTorqueWrenchLed",data%Equipments%ControlPanel%CTopDrive%TopDriveTorqueWrenchLed)
call json%add(pform,"TopDriveLinkTiltLed",data%Equipments%ControlPanel%CTopDrive%TopDriveLinkTiltLed)
call json%add(pform,"TopDriveIbopLed",data%Equipments%ControlPanel%CTopDrive%TopDriveIbopLed)
call json%add(pform,"TopDriveTorqueLimitGauge",data%Equipments%ControlPanel%CTopDrive%TopDriveTorqueLimitGauge)
call json%add(pform,"TopDriveTorqueGauge",data%Equipments%ControlPanel%CTopDrive%TopDriveTorqueGauge)
call json%add(pform,"TopDriveRpmGauge",data%Equipments%ControlPanel%CTopDrive%TopDriveRpmGauge)

call json%add(p,pform)
end do

call json%add(parent,p)
end subroutine
! Input routines
subroutine SetTopDriveTdsPowerState(v)
!DEC$ ATTRIBUTES DLLEXPORT :: SetTopDriveTdsPowerState


+ 0
- 2
CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90 View File

@@ -28,8 +28,6 @@ module CTopDrivePanelVariables
logical :: TopDriveIbop
real :: TopDriveTorqueLimitKnob
real :: RpmKnob

! Output vars
integer :: TopDriveOperationFaultLed
integer :: TopDriveTdsPowerLed


+ 15
- 17
Text1.txt View File

@@ -1,17 +1,15 @@
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
integer :: TopDriveTdsPowerState
logical :: TopDriveTorqueWrench
integer :: TopDriveDrillTorqueState
integer :: TopDriveLinkTiltState
logical :: TopDriveIbop
real :: TopDriveTorqueLimitKnob
real :: RpmKnob
integer :: TopDriveOperationFaultLed
integer :: TopDriveTdsPowerLed
integer :: TopDriveTorqueWrenchLed
integer :: TopDriveLinkTiltLed
integer :: TopDriveIbopLed
real :: TopDriveTorqueLimitGauge
real :: TopDriveTorqueGauge
real :: TopDriveRpmGauge

+ 18
- 20
helper.ipynb View File

@@ -50,35 +50,33 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"call json%add(p,\"WaterRate\",data%Equipments%Tanks%CTanks%WaterRate)\n",
"call json%add(p,\"CementTankVolume\",data%Equipments%Tanks%CTanks%CementTankVolume)\n",
"call json%add(p,\"CementTankDensity\",data%Equipments%Tanks%CTanks%CementTankDensity)\n",
"call json%add(p,\"TripTankVolume\",data%Equipments%Tanks%CTanks%TripTankVolume)\n",
"call json%add(p,\"TripTankDensity\",data%Equipments%Tanks%CTanks%TripTankDensity)\n",
"call json%add(p,\"ManualPumpPower\",data%Equipments%Tanks%CTanks%ManualPumpPower)\n",
"call json%add(p,\"Valve1\",data%Equipments%Tanks%CTanks%Valve1)\n",
"call json%add(p,\"Valve2\",data%Equipments%Tanks%CTanks%Valve2)\n",
"call json%add(p,\"Valve3\",data%Equipments%Tanks%CTanks%Valve3)\n",
"call json%add(p,\"Valve4\",data%Equipments%Tanks%CTanks%Valve4)\n",
"call json%add(p,\"Valve5\",data%Equipments%Tanks%CTanks%Valve5)\n",
"call json%add(p,\"Valve6\",data%Equipments%Tanks%CTanks%Valve6)\n",
"call json%add(p,\"Valve7\",data%Equipments%Tanks%CTanks%Valve7)\n",
"call json%add(p,\"Valve8\",data%Equipments%Tanks%CTanks%Valve8)\n",
"call json%add(p,\"Valve9\",data%Equipments%Tanks%CTanks%Valve9)\n",
"call json%add(p,\"Valve10\",data%Equipments%Tanks%CTanks%Valve10)\n",
"call json%add(p,\"Valve11\",data%Equipments%Tanks%CTanks%Valve11)\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(p,\"\",data%Equipments%Tanks%CTanks%\"\"\"\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",
@@ -92,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [
{


Loading…
Cancel
Save