diff --git a/.ipynb_checkpoints/helper-checkpoint.ipynb b/.ipynb_checkpoints/helper-checkpoint.ipynb new file mode 100644 index 0000000..94141e4 --- /dev/null +++ b/.ipynb_checkpoints/helper-checkpoint.ipynb @@ -0,0 +1,532 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[' integer :: RigType\\n',\n", + " ' real(8) :: CrownHeight\\n',\n", + " ' real(8) :: MonkeyBoandHeight\\n',\n", + " ' real(8) :: RigFloorHeight\\n']" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "lines" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "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" + ] + } + ], + "source": [ + "precode = \"\"\"call json%add(p,\"\",data%Configuration%CasingLinerChoke%\"\"\"\n", + "input = open(\"Text1.txt\")\n", + "lines = input.readlines()\n", + "for line in lines:\n", + " name = line.split(\"::\")[-1].strip()\n", + " icoute = precode.index(\"\\\"\")+1\n", + " # name = line.split(\"%\")[-1][:-1]\n", + " # print(name)\n", + " newline = precode[:icoute]+name+precode[icoute:]+name+\")\"\n", + " print(newline)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\tGeo/GeoMain.f90 \\\n", + "\n" + ] + } + ], + "source": [ + "##Replace space with _ in filenames and list them for put them in makefile\n", + "import os\n", + "dir = 'Geo'\n", + "files = os.listdir(dir)\n", + "fstring = ''\n", + "for f in files:\n", + " if f.endswith('90'):\n", + " newf = f.replace(' ','_')\n", + " os.rename(os.path.join(dir,f),os.path.join(dir,newf))\n", + " if newf.lower().endswith('variables.f90'):\n", + " fstring = '\\t'+os.path.join(dir,newf).replace('\\\\','/') +' \\\\\\n' + fstring\n", + " else:\n", + " fstring = fstring + '\\t'+os.path.join(dir,newf).replace('\\\\','/') +' \\\\\\n'\n", + "\n", + "print(fstring)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Extract variable names from definition lines" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "# %pwd\n", + "lines = input(\"Enter lines:\").split(\" \")\n", + "lines = [l.strip() for l in lines if len(l.strip())>0]\n", + "vars = []\n", + "for l in lines:\n", + " if '::' in l:\n", + " vars.append(l.split('::')[1].strip())" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import string\n", + "string.ascii_letters" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "var: AnnularRegulatorSetControl\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AirMasterValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: ByePassValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AnnularValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: UpperRamsValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: MiddleRamsValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: KillLineValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: ChokeLineValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: LowerRamsValve\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: ManifoldPressureGauge\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AirSupplyPressureGauge\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AccumulatorPressureGauge\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AnnularPressureGauge\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AnnularOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AnnularCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: UpperRamsOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: UpperRamsCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: MiddleRamsOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: MiddleRamsCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: KillLineOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: KillLineCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: ChokeLineOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: ChokeLineCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: LowerRamsOpenLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: LowerRamsCloseLED\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: AnnularStatus\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: UpperRamsStatus\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: MiddleRamsStatus\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n", + "var: LowerRamsStatus\n", + "file = .\\CSharp\\Equipments\\ControlPanels\\CBopControlPanelVariables.f90\n", + "Char before: \n", + "Char after: \n", + "\n" + ] + } + ], + "source": [ + "import os\n", + "import sys\n", + "import re\n", + "dir = '.'\n", + "varNameChars = string.ascii_letters + '_'\n", + "log = open(os.path.join(dir,'ReplaceVars.log',),'a')\n", + "end=False\n", + "for dir,subdirs,files in os.walk(dir):\n", + " for filename in files:\n", + " if filename.lower().endswith('.f90'):\n", + " # print(filename)\n", + " file = open(os.path.join(dir,filename))\n", + " code = file.read()\n", + " for var in vars:\n", + " if var not in code:\n", + " continue\n", + " occurs = [m.start() for m in re.finditer(var, code)]\n", + " for occurance in occurs:\n", + " if code[occurs[0]-1] in varNameChars or code[occurs[0]+len(var)] in varNameChars:\n", + " continue\n", + " print(f\"var: {var}\")\n", + " print(f\"file = {os.path.join(dir,filename)}\")\n", + " print(f\"Char before: {code[occurs[0]-1]}\")\n", + " print(f\"Char after: {code[occurs[0]+len(var)]}\")\n", + " end = True\n", + " if end:\n", + " break" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "State\n", + "Hoisting\n", + "OperationScenario\n", + "notifications\n", + "permissions\n", + "unitySignals\n", + "StudentStation\n", + "BopStackInput\n", + "BopStackAcc\n", + "RamLine\n", + "AnnularComputational\n", + "Annular\n", + "PipeRam1\n", + "ShearRam\n", + "PipeRam2\n", + "ChokeLine\n", + "KillLine\n", + "Pumps\n", + "RAM\n", + "RAMS\n", + "Choke\n", + "AirDrivenPump\n", + "AirPumpLine\n", + "CHOOKE\n", + "Drawworks\n", + "MudSystem\n", + "MUD\n", + "PUMP\n", + "RTable\n", + "TDS\n", + "GasType(3)\n", + "PressureDisplay\n", + "ObservationPoint(:)\n", + "FricPressDrop\n", + "ROP_Spec\n", + "ROP_Bit\n", + "TDGeo\n", + "F_String(:)\n", + "F_Counts\n", + "F_Interval(:)\n", + "OD_Annulus(4)\n", + "TD_DrillStem\n", + "TD_DrillStems\n", + "TD_String\n", + "TD_Count\n", + "G_StringElement\n", + "TD_Vol\n", + "TD_General\n", + "TD_BOP\n", + "TD_BOPElement(4)\n", + "TD_StConn\n", + "TD_Load\n", + "TD_WellEl\n", + "TD_Casing\n", + "data%State%TD_Liner\n", + "TD_OpenHole\n", + "TD_ROPHole\n", + "TD_WellGeneral\n", + "TD_WellGeo(:)\n", + "EquipmentControl\n", + "BopControlPanel\n", + "ChokeControlPanel\n", + "ChokeManifold\n", + "DataDisplayConsole\n", + "DrillingConsole\n", + "Hook\n", + "StandPipeManifold\n", + "TopDrivePanel\n", + "DrillingWatch\n", + "Tank\n", + "Configuration\n", + "StringConfiguration\n", + "Formation\n", + "Reservoir\n", + "Shoe\n", + "Accumulator\n", + "BopStackSpecification\n", + "Hoisting\n", + "Power\n", + "PumpsSpecification\n", + "RigSize\n", + "CasingLinerChoke\n", + "PathGeneration\n", + "WellSurveyData\n", + "MudProperties\n", + "problems\n", + "BitProblems\n", + "BopProblems\n", + "ChokeProblems\n", + "DrillStemProblems\n", + "GaugesProblems\n", + "HoistingProblems\n", + "KickProblems\n", + "LostProblems\n", + "MudTreatmentProblems\n", + "OtherProblems\n", + "PumpProblems\n", + "RotaryProblems\n" + ] + }, + { + "ename": "IndexError", + "evalue": "list index out of range", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Projects\\VSIM\\SimulationCore2\\helper.ipynb Cell 6\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 6\u001b[0m nsp\u001b[39m+\u001b[39m\u001b[39m=\u001b[39m\u001b[39m1\u001b[39m\n\u001b[0;32m 7\u001b[0m splits \u001b[39m=\u001b[39m line\u001b[39m.\u001b[39msplit(\u001b[39m\"\u001b[39m\u001b[39m::\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m----> 8\u001b[0m \u001b[39mprint\u001b[39m(splits[\u001b[39m1\u001b[39;49m]\u001b[39m.\u001b[39mstrip())\n", + "\u001b[1;31mIndexError\u001b[0m: list index out of range" + ] + } + ], + "source": [ + "f = open(\"hier.txt\")\n", + "lines = f.readlines()\n", + "for line in lines[1:]:\n", + " nsp=0\n", + " while line[nsp]==' ':\n", + " nsp+=1\n", + " splits = line.split(\"::\")\n", + " print(splits[1].strip())" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'type SimulationDataType type(SimulationStateType)::State Type(HoistingType)::Hoisting type(OperationScenarioType)::OperationScenario type(NotificationType)::notifications type(PermissionsType):: permissions type(UnitySignalsType):: unitySignals type(StudentStationType)::StudentStation type(BopStackInputType)::BopStackInput type(BopStackAccType)::BopStackAcc type(RamLineType)::RamLine type(AnnularComputationalType)::AnnularComputational type(AnnularType)::Annular type(PipeRams1Type)::PipeRam1 type(ShearRamType)::ShearRam type(PipeRam2Type)::PipeRam2 type(ChokeLineType)::ChokeLine type(KillLineType)::KillLine type(PumpsType)::Pumps TYPE(BOP_TypeVars), DIMENSION(1:6) :: RAM TYPE(BOP_TypeVars2D) :: RAMS type(ChokeType)::Choke type(AirDrivenPumpType)::AirDrivenPump type(AirPumpLineType)::AirPumpLine TYPE(CHOKE_TypeVars), DIMENSION(1:2) :: CHOOKE TYPE(Drawworks_Var) :: Drawworks type(MudSystemType)::MudSystem TYPE(MUD_TypeVars), DIMENSION(1:10) :: MUD TYPE(Pump_Var), DIMENSION(1:3) :: PUMP TYPE(RTable_Var) :: RTable TYPE(TDS_Var) :: TDS TYPE(GasData) :: GasType(3) ! 1 = methane , 2 = Hydrogen sulfide , 3 = Carbon dioxid TYPE(PressureDisplayVARIABLESTYPE) :: PressureDisplay TYPE(ObservationAndGaugePointsInformations) , ALLOCATABLE :: ObservationPoint(:) TYPE(FricPressDropVarsTYPE) :: FricPressDrop TYPE(ROPSpecificationInfo) :: ROP_Spec TYPE(ROPInfo) :: ROP_Bit TYPE(Geo_Data) :: TDGeo TYPE(F_StringData) , Allocatable :: F_String(:) TYPE(F_IntervalsCountsData):: F_Counts TYPE(F_IntervalData) , Allocatable :: F_Interval(:) TYPE(OD_AnnulusData) :: OD_Annulus(4) TYPE(TD_DrillStemInfo), ALLOCATABLE, DIMENSION(:) :: TD_DrillStem TYPE(TD_SeparatedDrillStemInfo), ALLOCATABLE, DIMENSION(:) :: TD_DrillStems TYPE(TD_StringInfo) :: TD_String TYPE(TD_AddRemoveInfo) :: TD_Count TYPE(CStringComponents), ALLOCATABLE, DIMENSION(:) :: G_StringElement TYPE(TD_RemovedVolumeInfo) :: TD_Vol TYPE(TD_GeneralInfo) :: TD_General TYPE(TD_BOPInfo) :: TD_BOP TYPE(CBopElement) :: TD_BOPElement(4) TYPE(TD_StringconnectionInfo) :: TD_StConn TYPE(TD_LoadInfo) :: TD_Load TYPE(TD_WellElementsInfo) :: TD_WellEl TYPE(TD_CasingInfo), ALLOCATABLE, DIMENSION(:) :: TD_Casing TYPE(TD_LinerInfo), ALLOCATABLE, DIMENSION(:) :: data%State%TD_Liner TYPE(TD_OpenHoleInfo), ALLOCATABLE, DIMENSION(:) :: TD_OpenHole TYPE(TD_ROPHoleInfo), ALLOCATABLE, DIMENSION(:) :: TD_ROPHole TYPE(TD_WellGeneralInfo) :: TD_WellGeneral TYPE(TD_WellGeometryData), Allocatable :: TD_WellGeo(:) type(EquipmentControlType)::EquipmentControl type(BopControlPanelType) :: BopControlPanel Type(ChokeControlPanelType)::ChokeControlPanel Type(ChokeManifoldType)::ChokeManifold Type(DataDisplayConsoleType) :: DataDisplayConsole TYPE(DrillingConsoleType) :: DrillingConsole Type(HookType)::Hook type(StandPipeManifoldType)::StandPipeManifold Type(TopDrivePanelType)::TopDrivePanel Type(DrillingWatchType)::DrillingWatch Type(TankType)::Tank type(ConfigurationType)::Configuration Type(StringConfigurationType)::StringConfiguration Type(FormationType) :: Formation Type(ReservoirType)::Reservoir Type(ShoeType)::Shoe Type(AccumulatorType)::Accumulator Type(BopStackSpecificationType)::BopStackSpecification Type(HoistingType)::Hoisting Type(PowerType)::Power Type(PumpSpecificationType)::PumpsSpecification Type(RigSizeType)::RigSize Type(CasingLinerChokeType)::CasingLinerChoke Type(PathGenerationType)::PathGeneration Type(WellSurveyDataType)::WellSurveyData Type(MudPropertiesType)::MudProperties type(ProblemsType)::problems type(BitProblemsType)::BitProblems type(BopProblemsType)::BopProblems type(ChokeProblemsType)::ChokeProblems type(DrillStemProblemsType)::DrillStemProblems type(GaugesProblemsType)::GaugesProblems type(HoistingProblemsType):: HoistingProblems type(KickProblemsType)::KickProblems type(LostProblemsType)::LostProblems type(MudTreatmentProblemsType)::MudTreatmentProblems type(OtherProblemsType)::OtherProblems type(PumpProblemsType)::PumpProblems type(RotaryProblemsType)::RotaryProblems end type SimulationDataType'" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "line" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "for fn in modules:\n", + " f = open(fn)\n", + " lines = f.readlines()\n", + " module_filenames = {}\n", + " used_modules = []\n", + " mod_count = 0\n", + " for l in lines:\n", + " l = l.strip().lower()\n", + " if l.startswith('module ') and not l.startswith('module procedure '):\n", + " mod_name = l.split(' ')[1]\n", + " module_filenames[mod_name] = fn\n", + " mod_count +=1\n", + " if l.startswith('use'):\n", + " used_modules.append(l.split(' ')[1])\n", + " if mod_count !=1:\n", + " print(f\"{fn} has {mod_count} modules\")\n", + " module_filenames,used_modules" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.4" + }, + "vscode": { + "interpreter": { + "hash": "1ef4a26de7183d96d6da1045a38581e0a15b2215d0c1b98c7b273c6e514c6c7e" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 b/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 index 79ef24c..512be7a 100644 --- a/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 +++ b/CSharp/BasicInputs/WellProfile/CPathGeneration.f90 @@ -14,12 +14,12 @@ module CPathGeneration ! 1. create new node call json%create_object(p,'Path') - ! 2. add member of data type to new node + ! 2. add member of data type to new node ! call StringConfigurationToJson(p) ! call FormationToJson(p) - ! call json%add(p,"",data%Configuration%Formation%Formations(i)%Abrasiveness) + ! call json%add(p,"",data%Configuration%Formation%Formations(i)%Abrasiveness) - ! 3. add new node to parent + ! 3. add new node to parent call json%add(parent,p) end subroutine diff --git a/CSharp/Equipments/ControlPanels/CBopControlPanel.f90 b/CSharp/Equipments/ControlPanels/CBopControlPanel.f90 index 6d2af0a..19e2753 100644 --- a/CSharp/Equipments/ControlPanels/CBopControlPanel.f90 +++ b/CSharp/Equipments/ControlPanels/CBopControlPanel.f90 @@ -4,6 +4,52 @@ module CBopControlPanel implicit none public contains + + subroutine CBopToJson(parent) + + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. create new node + call json%create_object(p,'CBop') + + call json%add(p,"AnnularRegulatorSetControl",data%Equipments%ContolPanel%CBop%AnnularRegulatorSetControl) + call json%add(p,"AirMasterValve",data%Equipments%ContolPanel%CBop%AirMasterValve) + call json%add(p,"ByePassValve",data%Equipments%ContolPanel%CBop%ByePassValve) + call json%add(p,"AnnularValve",data%Equipments%ContolPanel%CBop%AnnularValve) + call json%add(p,"UpperRamsValve",data%Equipments%ContolPanel%CBop%UpperRamsValve) + call json%add(p,"MiddleRamsValve",data%Equipments%ContolPanel%CBop%MiddleRamsValve) + call json%add(p,"KillLineValve",data%Equipments%ContolPanel%CBop%KillLineValve) + call json%add(p,"ChokeLineValve",data%Equipments%ContolPanel%CBop%ChokeLineValve) + call json%add(p,"LowerRamsValve",data%Equipments%ContolPanel%CBop%LowerRamsValve) + call json%add(p,"ManifoldPressureGauge",data%Equipments%ContolPanel%CBop%ManifoldPressureGauge) + call json%add(p,"AirSupplyPressureGauge",data%Equipments%ContolPanel%CBop%AirSupplyPressureGauge) + call json%add(p,"AccumulatorPressureGauge",data%Equipments%ContolPanel%CBop%AccumulatorPressureGauge) + call json%add(p,"AnnularPressureGauge",data%Equipments%ContolPanel%CBop%AnnularPressureGauge) + call json%add(p,"AnnularOpenLED",data%Equipments%ContolPanel%CBop%AnnularOpenLED) + call json%add(p,"AnnularCloseLED",data%Equipments%ContolPanel%CBop%AnnularCloseLED) + call json%add(p,"UpperRamsOpenLED",data%Equipments%ContolPanel%CBop%UpperRamsOpenLED) + call json%add(p,"UpperRamsCloseLED",data%Equipments%ContolPanel%CBop%UpperRamsCloseLED) + call json%add(p,"MiddleRamsOpenLED",data%Equipments%ContolPanel%CBop%MiddleRamsOpenLED) + call json%add(p,"MiddleRamsCloseLED",data%Equipments%ContolPanel%CBop%MiddleRamsCloseLED) + call json%add(p,"KillLineOpenLED",data%Equipments%ContolPanel%CBop%KillLineOpenLED) + call json%add(p,"KillLineCloseLED",data%Equipments%ContolPanel%CBop%KillLineCloseLED) + call json%add(p,"ChokeLineOpenLED",data%Equipments%ContolPanel%CBop%ChokeLineOpenLED) + call json%add(p,"ChokeLineCloseLED",data%Equipments%ContolPanel%CBop%ChokeLineCloseLED) + call json%add(p,"LowerRamsOpenLED",data%Equipments%ContolPanel%CBop%LowerRamsOpenLED) + call json%add(p,"LowerRamsCloseLED",data%Equipments%ContolPanel%CBop%LowerRamsCloseLED) + call json%add(p,"AnnularStatus",data%Equipments%ContolPanel%CBop%AnnularStatus) + call json%add(p,"UpperRamsStatus",data%Equipments%ContolPanel%CBop%UpperRamsStatus) + call json%add(p,"MiddleRamsStatus",data%Equipments%ContolPanel%CBop%MiddleRamsStatus) + call json%add(p,"LowerRamsStatus",data%Equipments%ContolPanel%CBop%LowerRamsStatus) + + + call json%add(parent,p) + end subroutine + + + subroutine OpenAnnular() use CManifolds implicit none diff --git a/CSharp/Equipments/ControlPanels/CChokeControlPanel.f90 b/CSharp/Equipments/ControlPanels/CChokeControlPanel.f90 index 6f22601..d8e8fe5 100644 --- a/CSharp/Equipments/ControlPanels/CChokeControlPanel.f90 +++ b/CSharp/Equipments/ControlPanels/CChokeControlPanel.f90 @@ -4,6 +4,33 @@ module CChokeControlPanel implicit none public contains + + subroutine CChokeToJson(parent) + + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. create new node + call json%create_object(p,'CChoke') + call json%add(p,"ChokePanelPumpSelectorSwitch",data%Equipments%ContolPanel%CChoke%ChokePanelPumpSelectorSwitch) + call json%add(p,"ChokePanelStrokeResetSwitch",data%Equipments%ContolPanel%CChoke%ChokePanelStrokeResetSwitch) + call json%add(p,"ChokeSelectorSwitch",data%Equipments%ContolPanel%CChoke%ChokeSelectorSwitch) + call json%add(p,"ChokeRateControlKnob",data%Equipments%ContolPanel%CChoke%ChokeRateControlKnob) + call json%add(p,"ChokeControlLever",data%Equipments%ContolPanel%CChoke%ChokeControlLever) + call json%add(p,"ChokePanelRigAirSwitch",data%Equipments%ContolPanel%CChoke%ChokePanelRigAirSwitch) + call json%add(p,"EnableAutoChoke",data%Equipments%ContolPanel%CChoke%EnableAutoChoke) + call json%add(p,"StandPipePressure",data%Equipments%ContolPanel%CChoke%StandPipePressure) + call json%add(p,"CasingPressure",data%Equipments%ContolPanel%CChoke%CasingPressure) + call json%add(p,"ChokePosition",data%Equipments%ContolPanel%CChoke%ChokePosition) + call json%add(p,"ChokePanelSPMCounter",data%Equipments%ContolPanel%CChoke%ChokePanelSPMCounter) + call json%add(p,"ChokePanelTotalStrokeCounter",data%Equipments%ContolPanel%CChoke%ChokePanelTotalStrokeCounter) + call json%add(p,"Choke1LED",data%Equipments%ContolPanel%CChoke%Choke1LED) + call json%add(p,"Choke2LED",data%Equipments%ContolPanel%CChoke%Choke2LED) + + + call json%add(parent,p) + end subroutine ! Input routines subroutine SetChokePanelPumpSelectorSwitch(v) diff --git a/CSharp/Equipments/ControlPanels/CChokeManifold.f90 b/CSharp/Equipments/ControlPanels/CChokeManifold.f90 index 90e53c3..bea8250 100644 --- a/CSharp/Equipments/ControlPanels/CChokeManifold.f90 +++ b/CSharp/Equipments/ControlPanels/CChokeManifold.f90 @@ -6,6 +6,40 @@ module CChokeManifold implicit none public contains + + subroutine CChokeManifoldToJson(parent) + + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. create new node + call json%create_object(p,'CChokeManifold') + call json%add(p,"ChokeManifoldValve1",data%Equipments%ContolPanel%CChokeManifold%ChokeManifoldValve1) + call json%add(p,"ChokeManifoldValve2",data%Equipments%ContolPanel%CChokeManifold%ChokeManifoldValve2) + call json%add(p,"LeftManualChoke",data%Equipments%ContolPanel%CChokeManifold%LeftManualChoke) + call json%add(p,"ChokeManifoldValve4",data%Equipments%ContolPanel%CChokeManifold%ChokeManifoldValve4) + call json%add(p,"ChokeManifoldValve5",data%Equipments%ContolPanel%CChokeManifold%ChokeManifoldValve5) + call json%add(p,"RightManualChoke",data%Equipments%ContolPanel%CChokeManifold%RightManualChoke) + call json%add(p,"ChokeManifoldValve7",data%Equipments%ContolPanel%CChokeManifold%ChokeManifoldValve7) + call json%add(p,"ChokeManifoldValve8",data%Equipments%ContolPanel%CChokeManifold%ChokeManifoldValve8) + call json%add(p,"ChokeManifoldValve9",data%Equipments%ContolPanel%CChokeManifold%ChokeManifoldValve9) + call json%add(p,"ChokeManifoldValve10",data%Equipments%ContolPanel%CChokeManifold%ChokeManifoldValve10) + call json%add(p,"ChokeManifoldValve11",data%Equipments%ContolPanel%CChokeManifold%ChokeManifoldValve11) + call json%add(p,"ChokeManifoldValve12",data%Equipments%ContolPanel%CChokeManifold%ChokeManifoldValve12) + call json%add(p,"ChokeManifoldValve13",data%Equipments%ContolPanel%CChokeManifold%ChokeManifoldValve13) + call json%add(p,"HydraulicChock1",data%Equipments%ContolPanel%CChokeManifold%HydraulicChock1) + call json%add(p,"HydraulicChock2",data%Equipments%ContolPanel%CChokeManifold%HydraulicChock2) + call json%add(p,"HyChock1OnProblem",data%Equipments%ContolPanel%CChokeManifold%HyChock1OnProblem) + call json%add(p,"HyChock2OnProblem",data%Equipments%ContolPanel%CChokeManifold%HyChock2OnProblem) + call json%add(p,"LeftManChokeOnProblem",data%Equipments%ContolPanel%CChokeManifold%LeftManChokeOnProblem) + call json%add(p,"RightManChokeOnProblem",data%Equipments%ContolPanel%CChokeManifold%RightManChokeOnProblem) + + + + call json%add(parent,p) + end subroutine + subroutine SetHydraulicChock1(v) implicit none integer, intent(in) :: v diff --git a/CSharp/Equipments/ControlPanels/CDataDisplayConsole.f90 b/CSharp/Equipments/ControlPanels/CDataDisplayConsole.f90 index 68053cb..784e0d8 100644 --- a/CSharp/Equipments/ControlPanels/CDataDisplayConsole.f90 +++ b/CSharp/Equipments/ControlPanels/CDataDisplayConsole.f90 @@ -4,6 +4,103 @@ module CDataDisplayConsole implicit none public contains + + subroutine CDataDisplayToJson(parent) + + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. create new node + call json%create_object(p,'CDataDisplay') + call json%add(p,"TripAlarmLow",data%Equipments%ControlPanel%CDataDisplay%TripAlarmLow) + call json%add(p,"TripAlarmHigh",data%Equipments%ControlPanel%CDataDisplay%TripAlarmHigh) + call json%add(p,"RetFlowAlarmLow",data%Equipments%ControlPanel%CDataDisplay%RetFlowAlarmLow) + call json%add(p,"RetFlowAlarmHigh",data%Equipments%ControlPanel%CDataDisplay%RetFlowAlarmHigh) + call json%add(p,"PitAlarmLow",data%Equipments%ControlPanel%CDataDisplay%PitAlarmLow) + call json%add(p,"PitAlarmHigh",data%Equipments%ControlPanel%CDataDisplay%PitAlarmHigh) + call json%add(p,"PortWeightOnBit",data%Equipments%ControlPanel%CDataDisplay%PortWeightOnBit) + call json%add(p,"PortHookLoad",data%Equipments%ControlPanel%CDataDisplay%PortHookLoad) + call json%add(p,"PortCasingPressure",data%Equipments%ControlPanel%CDataDisplay%PortCasingPressure) + call json%add(p,"PortPumpPressure",data%Equipments%ControlPanel%CDataDisplay%PortPumpPressure) + call json%add(p,"TripTankSetAlarmLow",data%Equipments%ControlPanel%CDataDisplay%TripTankSetAlarmLow) + call json%add(p,"TripTankSetAlarmHigh",data%Equipments%ControlPanel%CDataDisplay%TripTankSetAlarmHigh) + call json%add(p,"TripTankSetAlarmSwitch",data%Equipments%ControlPanel%CDataDisplay%TripTankSetAlarmSwitch) + call json%add(p,"TripTankPowerSwitch",data%Equipments%ControlPanel%CDataDisplay%TripTankPowerSwitch) + call json%add(p,"TripTankPumpSwitch",data%Equipments%ControlPanel%CDataDisplay%TripTankPumpSwitch) + call json%add(p,"TripTankHornSwitch",data%Equipments%ControlPanel%CDataDisplay%TripTankHornSwitch) + call json%add(p,"AcidGasDetectionHornSwitch",data%Equipments%ControlPanel%CDataDisplay%AcidGasDetectionHornSwitch) + call json%add(p,"TotalStrokeCounterResetSwitch",data%Equipments%ControlPanel%CDataDisplay%TotalStrokeCounterResetSwitch) + call json%add(p,"DrillingTrippingSelectorSwitch",data%Equipments%ControlPanel%CDataDisplay%DrillingTrippingSelectorSwitch) + call json%add(p,"MVTSetAlarmLowKnob",data%Equipments%ControlPanel%CDataDisplay%MVTSetAlarmLowKnob) + call json%add(p,"MVTSetAlarmHighKnob",data%Equipments%ControlPanel%CDataDisplay%MVTSetAlarmHighKnob) + call json%add(p,"MVTSetAlarmSwitch",data%Equipments%ControlPanel%CDataDisplay%MVTSetAlarmSwitch) + call json%add(p,"MudTank1Switch",data%Equipments%ControlPanel%CDataDisplay%MudTank1Switch) + call json%add(p,"MudTank2Switch",data%Equipments%ControlPanel%CDataDisplay%MudTank2Switch) + call json%add(p,"MudTank3Switch",data%Equipments%ControlPanel%CDataDisplay%MudTank3Switch) + call json%add(p,"MudTank4Switch",data%Equipments%ControlPanel%CDataDisplay%MudTank4Switch) + call json%add(p,"MVTFineKnob",data%Equipments%ControlPanel%CDataDisplay%MVTFineKnob) + call json%add(p,"MVTCoarseKnob",data%Equipments%ControlPanel%CDataDisplay%MVTCoarseKnob) + call json%add(p,"MVTHornSwitch",data%Equipments%ControlPanel%CDataDisplay%MVTHornSwitch) + call json%add(p,"MVTDeviationTripSelectionSwitch",data%Equipments%ControlPanel%CDataDisplay%MVTDeviationTripSelectionSwitch) + call json%add(p,"MVTPowerSwitch",data%Equipments%ControlPanel%CDataDisplay%MVTPowerSwitch) + call json%add(p,"MFFIResetTotalStrokes",data%Equipments%ControlPanel%CDataDisplay%MFFIResetTotalStrokes) + call json%add(p,"MFFIResetFillCounter",data%Equipments%ControlPanel%CDataDisplay%MFFIResetFillCounter) + call json%add(p,"MFFIPumpSelectorSwitch",data%Equipments%ControlPanel%CDataDisplay%MFFIPumpSelectorSwitch) + call json%add(p,"MFFIFillSPMSelectorSwitch",data%Equipments%ControlPanel%CDataDisplay%MFFIFillSPMSelectorSwitch) + call json%add(p,"MFFISetAlarmLowKnob",data%Equipments%ControlPanel%CDataDisplay%MFFISetAlarmLowKnob) + call json%add(p,"MFFISetAlarmHighKnob",data%Equipments%ControlPanel%CDataDisplay%MFFISetAlarmHighKnob) + call json%add(p,"MFFISetAlarmSwitch",data%Equipments%ControlPanel%CDataDisplay%MFFISetAlarmSwitch) + call json%add(p,"MFFIPowerSwitch",data%Equipments%ControlPanel%CDataDisplay%MFFIPowerSwitch) + call json%add(p,"MFFIHornSwitch",data%Equipments%ControlPanel%CDataDisplay%MFFIHornSwitch) + call json%add(p,"ResetWob",data%Equipments%ControlPanel%CDataDisplay%ResetWob) + call json%add(p,"Clutch",data%Equipments%ControlPanel%CDataDisplay%Clutch) + call json%add(p,"WOBPointer",data%Equipments%ControlPanel%CDataDisplay%WOBPointer) + call json%add(p,"HookLoadPointer",data%Equipments%ControlPanel%CDataDisplay%HookLoadPointer) + call json%add(p,"TripTankGauge",data%Equipments%ControlPanel%CDataDisplay%TripTankGauge) + call json%add(p,"TripTankAlarmLED",data%Equipments%ControlPanel%CDataDisplay%TripTankAlarmLED) + call json%add(p,"TripTankPumpLED",data%Equipments%ControlPanel%CDataDisplay%TripTankPumpLED) + call json%add(p,"StandPipePressureGauge",data%Equipments%ControlPanel%CDataDisplay%StandPipePressureGauge) + call json%add(p,"CasingPressureGauge",data%Equipments%ControlPanel%CDataDisplay%CasingPressureGauge) + call json%add(p,"MP1SPMGauge",data%Equipments%ControlPanel%CDataDisplay%MP1SPMGauge) + call json%add(p,"MP2SPMGauge",data%Equipments%ControlPanel%CDataDisplay%MP2SPMGauge) + call json%add(p,"ReturnLineTempGauge",data%Equipments%ControlPanel%CDataDisplay%ReturnLineTempGauge) + call json%add(p,"RotaryTorqueGauge",data%Equipments%ControlPanel%CDataDisplay%RotaryTorqueGauge) + call json%add(p,"RotaryRPMGauge",data%Equipments%ControlPanel%CDataDisplay%RotaryRPMGauge) + call json%add(p,"AcidGasDetectionLED",data%Equipments%ControlPanel%CDataDisplay%AcidGasDetectionLED) + call json%add(p,"TotalStrokeCounter",data%Equipments%ControlPanel%CDataDisplay%TotalStrokeCounter) + call json%add(p,"TotalStrokeCounter_temp",data%Equipments%ControlPanel%CDataDisplay%TotalStrokeCounter_temp) + call json%add(p,"PitGainLossGauge",data%Equipments%ControlPanel%CDataDisplay%PitGainLossGauge) + call json%add(p,"MudTanksVolumeGauge",data%Equipments%ControlPanel%CDataDisplay%MudTanksVolumeGauge) + call json%add(p,"MVTAlarmLED",data%Equipments%ControlPanel%CDataDisplay%MVTAlarmLED) + call json%add(p,"ReturnMudFlowGauge",data%Equipments%ControlPanel%CDataDisplay%ReturnMudFlowGauge) + call json%add(p,"FillStrokeCounter",data%Equipments%ControlPanel%CDataDisplay%FillStrokeCounter) + call json%add(p,"MFFITotalStrokeCounter",data%Equipments%ControlPanel%CDataDisplay%MFFITotalStrokeCounter) + call json%add(p,"MFFIAlarmLED",data%Equipments%ControlPanel%CDataDisplay%MFFIAlarmLED) + call json%add(p,"MFFIPumpLED",data%Equipments%ControlPanel%CDataDisplay%MFFIPumpLED) + call json%add(p,"TotalWellDepth",data%Equipments%ControlPanel%CDataDisplay%TotalWellDepth) + call json%add(p,"BitDepth",data%Equipments%ControlPanel%CDataDisplay%BitDepth) + call json%add(p,"HookLoad",data%Equipments%ControlPanel%CDataDisplay%HookLoad) + call json%add(p,"StandPipePressure",data%Equipments%ControlPanel%CDataDisplay%StandPipePressure) + call json%add(p,"CasingPressure",data%Equipments%ControlPanel%CDataDisplay%CasingPressure) + call json%add(p,"MP1SPM",data%Equipments%ControlPanel%CDataDisplay%MP1SPM) + call json%add(p,"MP2SPM",data%Equipments%ControlPanel%CDataDisplay%MP2SPM) + call json%add(p,"RTTorque",data%Equipments%ControlPanel%CDataDisplay%RTTorque) + call json%add(p,"RTRPM",data%Equipments%ControlPanel%CDataDisplay%RTRPM) + call json%add(p,"WOP",data%Equipments%ControlPanel%CDataDisplay%WOP) + call json%add(p,"ROP",data%Equipments%ControlPanel%CDataDisplay%ROP) + call json%add(p,"MudWeightIn",data%Equipments%ControlPanel%CDataDisplay%MudWeightIn) + call json%add(p,"MudWeightOut",data%Equipments%ControlPanel%CDataDisplay%MudWeightOut) + call json%add(p,"Buzzer1",data%Equipments%ControlPanel%CDataDisplay%Buzzer1) + call json%add(p,"Buzzer2",data%Equipments%ControlPanel%CDataDisplay%Buzzer2) + call json%add(p,"Buzzer3",data%Equipments%ControlPanel%CDataDisplay%Buzzer3) + call json%add(p,"Buzzer4",data%Equipments%ControlPanel%CDataDisplay%Buzzer4) + + + call json%add(parent,p) + end subroutine + + subroutine Set_TotalDepth(v) use SimulationVariables !@!!, only: data%EquipmentControl%DrillingWatch%Depth ! use CSimulationVariables, only: SetDistanceDrilled diff --git a/CSharp/Equipments/ControlPanels/CDrillingConsole.f90 b/CSharp/Equipments/ControlPanels/CDrillingConsole.f90 index 471fe9d..f074386 100644 --- a/CSharp/Equipments/ControlPanels/CDrillingConsole.f90 +++ b/CSharp/Equipments/ControlPanels/CDrillingConsole.f90 @@ -8,6 +8,102 @@ module CDrillingConsole implicit none public contains + + + subroutine CDrillingToJson(parent) + + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. create new node + call json%create_object(p,'CDrilling') + call json%add(p,"AssignmentSwitch",data%Equipments%ControlPanel%CDriling%AssignmentSwitch) + call json%add(p,"EmergencySwitch",data%Equipments%ControlPanel%CDriling%EmergencySwitch) + call json%add(p,"RTTorqueLimitKnob",data%Equipments%ControlPanel%CDriling%RTTorqueLimitKnob) + call json%add(p,"MP1CPSwitchI",data%Equipments%ControlPanel%CDriling%MP1CPSwitchI) + call json%add(p,"MP1CPSwitchT",data%Equipments%ControlPanel%CDriling%MP1CPSwitchT) + call json%add(p,"MP1CPSwitch",data%Equipments%ControlPanel%CDriling%MP1CPSwitch) + call json%add(p,"MP1ThrottleUpdate",data%Equipments%ControlPanel%CDriling%MP1ThrottleUpdate) + call json%add(p,"MP1Throttle",data%Equipments%ControlPanel%CDriling%MP1Throttle) + call json%add(p,"MP2SwitchI",data%Equipments%ControlPanel%CDriling%MP2SwitchI) + call json%add(p,"MP2SwitchT",data%Equipments%ControlPanel%CDriling%MP2SwitchT) + call json%add(p,"MP2Switch",data%Equipments%ControlPanel%CDriling%MP2Switch) + call json%add(p,"MP2ThrottleUpdate",data%Equipments%ControlPanel%CDriling%MP2ThrottleUpdate) + call json%add(p,"MP2Throttle",data%Equipments%ControlPanel%CDriling%MP2Throttle) + call json%add(p,"DWSwitch",data%Equipments%ControlPanel%CDriling%DWSwitch) + call json%add(p,"DWThrottle",data%Equipments%ControlPanel%CDriling%DWThrottle) + call json%add(p,"RTSwitch",data%Equipments%ControlPanel%CDriling%RTSwitch) + call json%add(p,"RTThrottle",data%Equipments%ControlPanel%CDriling%RTThrottle) + call json%add(p,"DWBreak",data%Equipments%ControlPanel%CDriling%DWBreak) + call json%add(p,"PreviousDWBreak",data%Equipments%ControlPanel%CDriling%PreviousDWBreak) + call json%add(p,"ForceBreak",data%Equipments%ControlPanel%CDriling%ForceBreak) + call json%add(p,"DWAcceleretor",data%Equipments%ControlPanel%CDriling%DWAcceleretor) + call json%add(p,"DWTransmisionLever",data%Equipments%ControlPanel%CDriling%DWTransmisionLever) + call json%add(p,"DWPowerLever",data%Equipments%ControlPanel%CDriling%DWPowerLever) + call json%add(p,"TongLever",data%Equipments%ControlPanel%CDriling%TongLever) + call json%add(p,"RTTransmissionLever",data%Equipments%ControlPanel%CDriling%RTTransmissionLever) + call json%add(p,"DWClutchLever",data%Equipments%ControlPanel%CDriling%DWClutchLever) + call json%add(p,"EddyBreakLever",data%Equipments%ControlPanel%CDriling%EddyBreakLever) + call json%add(p,"AutoDW",data%Equipments%ControlPanel%CDriling%AutoDW) + call json%add(p,"GEN1",data%Equipments%ControlPanel%CDriling%GEN1) + call json%add(p,"GEN2",data%Equipments%ControlPanel%CDriling%GEN2) + call json%add(p,"GEN3",data%Equipments%ControlPanel%CDriling%GEN3) + call json%add(p,"GEN4",data%Equipments%ControlPanel%CDriling%GEN4) + call json%add(p,"Permission_OpenKellyCock",data%Equipments%ControlPanel%CDriling%Permission_OpenKellyCock) + call json%add(p,"OpenKellyCock",data%Equipments%ControlPanel%CDriling%OpenKellyCock) + call json%add(p,"Permission_CloseKellyCock",data%Equipments%ControlPanel%CDriling%Permission_CloseKellyCock) + call json%add(p,"CloseKellyCock",data%Equipments%ControlPanel%CDriling%CloseKellyCock) + call json%add(p,"Permission_OpenSafetyValve",data%Equipments%ControlPanel%CDriling%Permission_OpenSafetyValve) + call json%add(p,"OpenSafetyValve",data%Equipments%ControlPanel%CDriling%OpenSafetyValve) + call json%add(p,"Permission_CloseSafetyValve",data%Equipments%ControlPanel%CDriling%Permission_CloseSafetyValve) + call json%add(p,"CloseSafetyValve",data%Equipments%ControlPanel%CDriling%CloseSafetyValve) + call json%add(p,"Permission_IRSafetyValve",data%Equipments%ControlPanel%CDriling%Permission_IRSafetyValve) + call json%add(p,"IRSafetyValve",data%Equipments%ControlPanel%CDriling%IRSafetyValve) + call json%add(p,"Permission_IRIBop",data%Equipments%ControlPanel%CDriling%Permission_IRIBop) + call json%add(p,"IRIBop",data%Equipments%ControlPanel%CDriling%IRIBop) + call json%add(p,"LatchPipe",data%Equipments%ControlPanel%CDriling%LatchPipe) + call json%add(p,"UnlatchPipe",data%Equipments%ControlPanel%CDriling%UnlatchPipe) + call json%add(p,"Swing",data%Equipments%ControlPanel%CDriling%Swing) + call json%add(p,"FillMouseHole",data%Equipments%ControlPanel%CDriling%FillMouseHole) + call json%add(p,"Slips",data%Equipments%ControlPanel%CDriling%Slips) + call json%add(p,"BrakeLeverCoefficient",data%Equipments%ControlPanel%CDriling%BrakeLeverCoefficient) + call json%add(p,"HideDrillingBrake",data%Equipments%ControlPanel%CDriling%HideDrillingBrake) + call json%add(p,"ParkingBrakeBtn",data%Equipments%ControlPanel%CDriling%ParkingBrakeBtn) + call json%add(p,"ParkingBrakeLed",data%Equipments%ControlPanel%CDriling%ParkingBrakeLed) + call json%add(p,"GEN1LED",data%Equipments%ControlPanel%CDriling%GEN1LED) + call json%add(p,"GEN2LED",data%Equipments%ControlPanel%CDriling%GEN2LED) + call json%add(p,"GEN3LED",data%Equipments%ControlPanel%CDriling%GEN3LED) + call json%add(p,"GEN4LED",data%Equipments%ControlPanel%CDriling%GEN4LED) + call json%add(p,"SCR1LED",data%Equipments%ControlPanel%CDriling%SCR1LED) + call json%add(p,"SCR2LED",data%Equipments%ControlPanel%CDriling%SCR2LED) + call json%add(p,"SCR3LED",data%Equipments%ControlPanel%CDriling%SCR3LED) + call json%add(p,"SCR4LED",data%Equipments%ControlPanel%CDriling%SCR4LED) + call json%add(p,"MP1BLWR",data%Equipments%ControlPanel%CDriling%MP1BLWR) + call json%add(p,"MP2BLWR",data%Equipments%ControlPanel%CDriling%MP2BLWR) + call json%add(p,"DWBLWR",data%Equipments%ControlPanel%CDriling%DWBLWR) + call json%add(p,"RTBLWR",data%Equipments%ControlPanel%CDriling%RTBLWR) + call json%add(p,"PWRLIM",data%Equipments%ControlPanel%CDriling%PWRLIM) + call json%add(p,"PWRLIMMTR",data%Equipments%ControlPanel%CDriling%PWRLIMMTR) + call json%add(p,"RTTorqueLimitGauge",data%Equipments%ControlPanel%CDriling%RTTorqueLimitGauge) + call json%add(p,"AutoDWLED",data%Equipments%ControlPanel%CDriling%AutoDWLED) + call json%add(p,"GEN1BTNLED",data%Equipments%ControlPanel%CDriling%GEN1BTNLED) + call json%add(p,"GEN2BTNLED",data%Equipments%ControlPanel%CDriling%GEN2BTNLED) + call json%add(p,"GEN3BTNLED",data%Equipments%ControlPanel%CDriling%GEN3BTNLED) + call json%add(p,"GEN4BTNLED",data%Equipments%ControlPanel%CDriling%GEN4BTNLED) + call json%add(p,"OpenKellyCockLed",data%Equipments%ControlPanel%CDriling%OpenKellyCockLed) + call json%add(p,"CloseKellyCockLed",data%Equipments%ControlPanel%CDriling%CloseKellyCockLed) + call json%add(p,"OpenSafetyValveLed",data%Equipments%ControlPanel%CDriling%OpenSafetyValveLed) + call json%add(p,"CloseSafetyValveLed",data%Equipments%ControlPanel%CDriling%CloseSafetyValveLed) + call json%add(p,"IRSafetyValveLed",data%Equipments%ControlPanel%CDriling%IRSafetyValveLed) + call json%add(p,"IRIBopLed",data%Equipments%ControlPanel%CDriling%IRIBopLed) + call json%add(p,"LatchPipeLED",data%Equipments%ControlPanel%CDriling%LatchPipeLED) + call json%add(p,"UnlatchPipeLED",data%Equipments%ControlPanel%CDriling%UnlatchPipeLED) + call json%add(p,"SwingLed",data%Equipments%ControlPanel%CDriling%SwingLed) + call json%add(p,"FillMouseHoleLed",data%Equipments%ControlPanel%CDriling%FillMouseHoleLed) + + call json%add(parent,p) + end subroutine ! Input routines subroutine SetAssignmentSwitch(v) diff --git a/CSharp/Equipments/ControlPanels/CHook.f90 b/CSharp/Equipments/ControlPanels/CHook.f90 index d64f6df..c80b292 100644 --- a/CSharp/Equipments/ControlPanels/CHook.f90 +++ b/CSharp/Equipments/ControlPanels/CHook.f90 @@ -4,6 +4,20 @@ module CHook implicit none public contains + + subroutine CHookToJson(parent) + + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. create new node + call json%create_object(p,'CHook') + call json%add(p,"HookHeight_S",data%Equipments%ControlPanel%CHook%HookHeight_S) + call json%add(p,"HookHeight",data%Equipments%ControlPanel%CHook%HookHeight) + + call json%add(parent,p) + end subroutine subroutine Set_HookHeight(v) use CDrillingConsoleVariables diff --git a/CSharp/Equipments/ControlPanels/CStandPipeManifold.f90 b/CSharp/Equipments/ControlPanels/CStandPipeManifold.f90 index a191f13..d58f1b4 100644 --- a/CSharp/Equipments/ControlPanels/CStandPipeManifold.f90 +++ b/CSharp/Equipments/ControlPanels/CStandPipeManifold.f90 @@ -5,6 +5,37 @@ module CStandPipeManifold implicit none public contains + + + subroutine CStandPipeToJson(parent) + + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. create new node + call json%create_object(p,'CStandPipe') + + call json%add(p,"StandPipeManifoldValve1",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve1) + call json%add(p,"StandPipeManifoldValve2",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve2) + call json%add(p,"StandPipeManifoldValve3",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve3) + call json%add(p,"StandPipeManifoldValve4",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve4) + call json%add(p,"StandPipeManifoldValve5",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve5) + call json%add(p,"StandPipeManifoldValve6",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve6) + call json%add(p,"StandPipeManifoldValve7",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve7) + call json%add(p,"StandPipeManifoldValve8",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve8) + call json%add(p,"StandPipeManifoldValve9",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve9) + call json%add(p,"StandPipeManifoldValve10",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve10) + call json%add(p,"StandPipeManifoldValve11",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve11) + call json%add(p,"StandPipeManifoldValve12",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve12) + call json%add(p,"StandPipeManifoldValve13",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve13) + call json%add(p,"StandPipeManifoldValve14",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve14) + call json%add(p,"StandPipeManifoldValve15",data%Equipments%ControlPanel%CStandPipe%StandPipeManifoldValve15) + call json%add(p,"StandPipeGauge1",data%Equipments%ControlPanel%CStandPipe%StandPipeGauge1) + call json%add(p,"StandPipeGauge2",data%Equipments%ControlPanel%CStandPipe%StandPipeGauge2) + + call json%add(parent,p) + end subroutine ! Input routines subroutine SetStandPipeManifoldValve1(v) diff --git a/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 b/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 index 14cdfb6..c544c13 100644 --- a/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 +++ b/CSharp/Equipments/ControlPanels/CTopDrivePanel.f90 @@ -5,6 +5,20 @@ module CTopDrivePanel implicit none public contains + + subroutine CDrivePanelToJson(parent) + + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. create new node + call json%create_object(p,'CDrivePanel') + + + + call json%add(parent,p) + end subroutine ! Input routines subroutine SetTopDriveTdsPowerState(v) diff --git a/CSharp/Equipments/Tanks/CTanks.f90 b/CSharp/Equipments/Tanks/CTanks.f90 index b1342ec..9ee0c32 100644 --- a/CSharp/Equipments/Tanks/CTanks.f90 +++ b/CSharp/Equipments/Tanks/CTanks.f90 @@ -4,7 +4,46 @@ use CManifolds implicit none public - contains + contains + + + subroutine CTankToJson(parent) + + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p,pform + integer :: i + + call json%create_array(p,'CTank') + + do i=1,data%Equipments%Tanks%CTank%Count + call json%create_object(pform,'') + call json%add(pform,"WaterRate",data%Equipments%Tanks%CTanks%WaterRate) + call json%add(pform,"CementTankVolume",data%Equipments%Tanks%CTanks%CementTankVolume) + call json%add(pform,"CementTankDensity",data%Equipments%Tanks%CTanks%CementTankDensity) + call json%add(pform,"TripTankVolume",data%Equipments%Tanks%CTanks%TripTankVolume) + call json%add(pform,"TripTankDensity",data%Equipments%Tanks%CTanks%TripTankDensity) + call json%add(pform,"ManualPumpPower",data%Equipments%Tanks%CTanks%ManualPumpPower) + call json%add(pform,"Valve1",data%Equipments%Tanks%CTanks%Valve1) + call json%add(pform,"Valve2",data%Equipments%Tanks%CTanks%Valve2) + call json%add(pform,"Valve3",data%Equipments%Tanks%CTanks%Valve3) + call json%add(pform,"Valve4",data%Equipments%Tanks%CTanks%Valve4) + call json%add(pform,"Valve5",data%Equipments%Tanks%CTanks%Valve5) + call json%add(pform,"Valve6",data%Equipments%Tanks%CTanks%Valve6) + call json%add(pform,"Valve7",data%Equipments%Tanks%CTanks%Valve7) + call json%add(pform,"Valve8",data%Equipments%Tanks%CTanks%Valve8) + call json%add(pform,"Valve9",data%Equipments%Tanks%CTanks%Valve9) + call json%add(pform,"Valve10",data%Equipments%Tanks%CTanks%Valve10) + call json%add(pform,"Valve11",data%Equipments%Tanks%CTanks%Valve11) + + call json%add(p,pform) + end do + + + call json%add(parent,p) + end subroutine + + subroutine Set_ManualPumpPower(v) use CManifolds, only:ChangeValve implicit none diff --git a/Simulator.f90 b/Simulator.f90 index 82b94f8..6e6a29b 100644 --- a/Simulator.f90 +++ b/Simulator.f90 @@ -148,7 +148,8 @@ contains type(json_value),pointer :: p print *,"write starts" call json%create_object(p,'') !create the root - call ConfigurationToJson(p) + call ConfigurationToJson(p) + call json%print(p,'test.json') !write it to a file call json%destroy(p) !cleanup print *,"written" print *,"write ends" diff --git a/Text1.txt b/Text1.txt index 2f308b2..6c308fa 100644 --- a/Text1.txt +++ b/Text1.txt @@ -1,15 +1,17 @@ - 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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/UpgradeLog.htm b/UpgradeLog.htm new file mode 100644 index 0000000..142b170 --- /dev/null +++ b/UpgradeLog.htm @@ -0,0 +1,273 @@ + + + + Migration Report +

+ Migration Report -

Overview

ProjectPathErrorsWarningsMessages
SimulationCore2SimulationCore2.vfproj100
SolutionSimulationCore2.sln001

Solution and projects

\ No newline at end of file diff --git a/helper.ipynb b/helper.ipynb index d609967..806d050 100644 --- a/helper.ipynb +++ b/helper.ipynb @@ -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" } @@ -32,28 +57,28 @@ "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,\"\",data%Configuration%CasingLinerChoke%)\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,\"\",data%Configuration%CasingLinerChoke%)\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,\"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" ] } ], "source": [ - "precode = \"\"\"call json%add(p,\"\",data%Configuration%CasingLinerChoke%\"\"\"\n", + "precode = \"\"\"call json%add(p,\"\",data%Equipments%Tanks%CTanks%\"\"\"\n", "input = open(\"Text1.txt\")\n", "lines = input.readlines()\n", "for line in lines:\n", @@ -98,7 +123,6 @@ ] }, { - "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -508,7 +532,7 @@ ], "metadata": { "kernelspec": { - "display_name": "base", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -522,9 +546,8 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.12" + "version": "3.11.4" }, - "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "1ef4a26de7183d96d6da1045a38581e0a15b2215d0c1b98c7b273c6e514c6c7e"