diff --git a/CSharp/BasicInputs/Bha/CStringConfiguration.f90 b/CSharp/BasicInputs/Bha/CStringConfiguration.f90 index 215d557..4155cf2 100644 --- a/CSharp/BasicInputs/Bha/CStringConfiguration.f90 +++ b/CSharp/BasicInputs/Bha/CStringConfiguration.f90 @@ -7,6 +7,70 @@ module CStringConfiguration 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,'StringConfigurationItems',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 diff --git a/Makefile b/Makefile index cc86c13..86c7bbe 100644 --- a/Makefile +++ b/Makefile @@ -402,6 +402,10 @@ $(TARGET): $(OBJS_F) $(OBJ_DIR)/%.o: %.f90 $(FC) $(FCFLAGS) -c -o $@ $< +testjson: + $(FC) -o Test_Json $(FCFLAGS) testjson.f90 lib/libjsonfortran.a + ./Test_Json + testredis: @echo "make test redis" cc Redis/redis_io.c -c -o obj/redis_io.o diff --git a/SimulationCore2 b/SimulationCore2 index 06148e8..26a556e 100644 Binary files a/SimulationCore2 and b/SimulationCore2 differ diff --git a/Simulator.f90 b/Simulator.f90 index f194d35..57f64d5 100644 --- a/Simulator.f90 +++ b/Simulator.f90 @@ -71,7 +71,6 @@ module Simulator type(json_value),pointer :: jsonvalue type(json_core) :: jsoncore logical :: is_found - real T1,T2 character(len=:),allocatable::redisContent contains @@ -221,9 +220,19 @@ module Simulator print *,"write ends" end subroutine - subroutine read_variables - call getData(redisContent) - call jsoncore%deserialize(jsonvalue,redisContent) + subroutine read_variables() + + ! call getData(redisContent) + ! call jsoncore%deserialize(jsonvalue,redisContent) + + call jsonfile%initialize() + call jsonfile%load_file('data-witharray.json'); if (jsonfile%failed()) stop + call jsonfile%json_file_get_root(jsonvalue) + + call ConfigurationFromJson(jsonvalue) + ! call WarningsFromJson(jsonvalue) + ! call ProblemsFromJson(jsonvalue) + ! call EquipmentsToJson(jsonvalue) ! print *,"Read from Redix:",redisContent ! ! Load the file. ! call jsonfile%load_file('config.json'); if (jsonfile%failed()) stop @@ -482,6 +491,184 @@ module Simulator call json%add(parent,p) end subroutine + subroutine ConfigurationFromJson(parent) + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. get related root + call jsonfile%get('Configuration',p,is_found) + + call StringConfigurationFromJson(p) + ! call FormationFromJson(p) + ! call ReservoirFromJson(p) + ! call ShoeFromJson(p) + ! call AccumulatorFromJson(p) + ! call BopStackFromJson(p) + ! call HoistingFromJson(p) + ! call PowerFromJson(p) + ! call PumpsFromJson(p) + ! call RigSizeFromJson(p) + ! call CasingLinerChokeFromJson(p) + ! call PathGenerationFromJson(p) + ! call MudPropertiesFromJson(p) + + ! 3. add new node to parent + call json%add(parent,p) + end subroutine + + subroutine WarningsFromJson(parent) + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. create new node + ! call json%create_object(p,'Warnings') + + ! ! 2. add member of data type to new node + ! call json%add(p,"PumpWithKellyDisconnected",data%Warnings%PumpWithKellyDisconnected) + ! call json%add(p,"PumpWithTopdriveDisconnected",data%Warnings%PumpWithTopdriveDisconnected) + ! call json%add(p,"Pump1PopOffValveBlown",data%Warnings%Pump1PopOffValveBlown) + ! call json%add(p,"Pump1Failure",data%Warnings%Pump1Failure) + ! call json%add(p,"Pump2PopOffValveBlown",data%Warnings%Pump2PopOffValveBlown) + ! call json%add(p,"Pump2Failure",data%Warnings%Pump2Failure) + ! call json%add(p,"Pump3PopOffValveBlown",data%Warnings%Pump3PopOffValveBlown) + ! call json%add(p,"Pump3Failure",data%Warnings%Pump3Failure) + ! call json%add(p,"DrawworksGearsAbuse",data%Warnings%DrawworksGearsAbuse) + ! call json%add(p,"RotaryGearsAbuse",data%Warnings%RotaryGearsAbuse) + ! call json%add(p,"HoistLineBreak",data%Warnings%HoistLineBreak) + ! call json%add(p,"PartedDrillString",data%Warnings%PartedDrillString) + ! call json%add(p,"ActiveTankOverflow",data%Warnings%ActiveTankOverflow) + ! call json%add(p,"ActiveTankUnderVolume",data%Warnings%ActiveTankUnderVolume) + ! call json%add(p,"TripTankOverflow",data%Warnings%TripTankOverflow) + ! call json%add(p,"DrillPipeTwistOff",data%Warnings%DrillPipeTwistOff) + ! call json%add(p,"DrillPipeParted",data%Warnings%DrillPipeParted) + ! call json%add(p,"TripWithSlipsSet",data%Warnings%TripWithSlipsSet) + ! call json%add(p,"Blowout",data%Warnings%Blowout) + ! call json%add(p,"UndergroundBlowout",data%Warnings%UndergroundBlowout) + ! call json%add(p,"MaximumWellDepthExceeded",data%Warnings%MaximumWellDepthExceeded) + ! call json%add(p,"CrownCollision",data%Warnings%CrownCollision) + ! call json%add(p,"FloorCollision",data%Warnings%FloorCollision) + ! call json%add(p,"TopdriveRotaryTableConfilict",data%Warnings%TopdriveRotaryTableConfilict) + + ! ! 3. add new node to parent + ! call json%add(parent,p) + end subroutine + + subroutine ProblemsFromJson(parent) + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. create new node + ! call json%create_object(p,'Problems') + + ! ! 2. add member of data type to new node + ! call BitProblemsFromJson(p) + ! call BopProblemsFromJson(p) + ! call ChokeProblemsFromJson(p) + ! call DrillStemProblemsFromJson(p) + ! call GaugesProblemsFromJson(p) + ! call HoistingProblemsFromJson(p) + ! call KickProblemsFromJson(p) + ! call LostProblemsFromJson(p) + ! call MudTreatmentProblemsFromJson(p) + ! call OtherProblemsFromJson(p) + ! call PumpProblemsFromJson(p) + ! call RotaryProblemsFromJson(p) + + ! ! 3. add new node to parent + ! call json%add(parent,p) + end subroutine + + subroutine StateFromJson(parent) + + type(json_value),pointer :: parent + type(json_core) :: json + type(json_value),pointer :: p + + ! 1. create new node + ! call json%create_object(p,'State') + + ! ! call OperationScenarioFromJson(p) + ! call notificationsFromJson(p) + ! call permissionsFromJson(p) + ! call unitySignalsFromJson(p) + ! call StudentStationFromJson(p) + ! call BopStackInputFromJson(p) + ! call BopStackAccFromJson(p) + ! call RamLineFromJson(p) + ! call AnnularComputationalFromJson(p) + ! call AnnularFromJson(p) + ! call PipeRam1FromJson(p) + ! call ShearRamFromJson(p) + ! call PipeRam2FromJson(p) + ! call ChokeLineFromJson(p) + ! call KillLineFromJson(p) + ! call PumpsFromJson(p) + ! call RAMFromJson(p) + ! call RAMSFromJson(p) + ! call ChokeFromJson(p) + ! call AirDrivenPumpFromJson(p) + ! call AirPumpLineFromJson(p) + ! call CHOOKEFromJson(p) + ! call DrawworksFromJson(p) + ! call MudSystemFromJson(p) + ! call MUDFromJson(p) + ! call MPumpsFromJson(p) + ! call PUMPFromJson(p) + ! call RTableFromJson(p) + ! call TDSFromJson(p) + ! call GasType(3)FromJson(p) + ! call PressureDisplayFromJson(p) + ! call FricPressDropFromJson(p) + ! call ROP_SpecFromJson(p) + ! call ROP_BitFromJson(p) + ! call TDGeoFromJson(p) + ! call F_String(:)FromJson(p) + ! call F_CountsFromJson(p) + ! call F_Interval(:)FromJson(p) + ! call OD_Annulus(4)FromJson(p) + ! call TD_DrillStemFromJson(p) + ! call TD_DrillStemsFromJson(p) + ! call TD_StringFromJson(p) + ! call TD_CountFromJson(p) + ! call G_StringElementFromJson(p) + ! call TD_VolFromJson(p) + ! call TD_GeneralFromJson(p) + ! call TD_BOPFromJson(p) + ! call TD_BOPElement(4)FromJson(p) + ! call TD_StConnFromJson(p) + ! call TD_LoadFromJson(p) + ! call TD_WellElFromJson(p) + ! call TD_CasingFromJson(p) + ! call TD_LinerFromJson(p) + ! call TD_OpenHoleFromJson(p) + ! call TD_ROPHoleFromJson(p) + ! call TD_WellGeneralFromJson(p) + ! call TD_WellGeo(:)FromJson(p) + + ! 2. add member of data type to new node + + ! 3. add new node to parent + call json%add(parent,p) + end subroutine + + !use this as a template + subroutine notificationsFromJson(parent) + + type(json_value),pointer :: parent + ! type(json_core) :: json + ! type(json_value),pointer :: p + + ! 1. create new node + ! call json%create_object(p,'Notifications') + + ! ! 2. add member of data type to new node + + ! ! 3. add new node to parent + ! call json%add(parent,p) + end subroutine end module Simulator diff --git a/Test/test.f90 b/Test/test.f90 deleted file mode 100644 index b7c0019..0000000 --- a/Test/test.f90 +++ /dev/null @@ -1,18 +0,0 @@ -Module RedisInterface - Interface - SUBROUTINE addnums(a, b) BIND(C,name='addnums') - USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_INT - IMPLICIT NONE - INTEGER(C_INT) :: a, b - END SUBROUTINE addnums - End Interface -END Module RedisInterface -program test - use RedisInterface - ! external addnums - integer::x,y - x=5 - y=12 - call addnums(x,y) -end program - diff --git a/Test_Json b/Test_Json new file mode 100644 index 0000000..d859f95 Binary files /dev/null and b/Test_Json differ diff --git a/Text1.txt b/Text1.txt index 052e4f9..ba03c73 100644 --- a/Text1.txt +++ b/Text1.txt @@ -1,19 +1,10 @@ - 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) :: 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 + integer :: BitType + real(8) :: BitSize + integer :: BitCodeHundreds + integer :: BitCodeTens + integer :: BitCodeOnes + real(8) :: BitNozzleSize + real(8) :: BitLength + real(8) :: BitWeightPerLength + integer :: BitNozzleNo + logical :: FloatValve \ No newline at end of file diff --git a/data-witharray.json b/data-witharray.json new file mode 100644 index 0000000..47623d8 --- /dev/null +++ b/data-witharray.json @@ -0,0 +1,249 @@ +{ + "Configuration": { + "StringConfiguration": { + "StringConfigurationItems": [ + {"ComponentType":1, + "NumberOfJoint":0, + "LengthPerJoint":0, + "NominalOd":0, + "NominalId":0, + "WeightPerLength":0, + "ComponentLength":1.5, + "NominalToolJointOd":0, + "Grade":"A" + }, + {"ComponentType":2, + "NumberOfJoint":0, + "LengthPerJoint":0, + "NominalOd":0, + "NominalId":0, + "WeightPerLength":0, + "ComponentLength":2.6, + "NominalToolJointOd":0, + "Grade":"B" + } + ], + "BitDefenition": { + "BitCodeHundreds": 0, + "BitCodeOnes": 0, + "BitCodeTens": 0, + "BitLength": 0.0E+0, + "BitNozzleNo": 0, + "BitNozzleSize": 0.0E+0, + "BitSize": 0.0E+0, + "BitType": 0, + "BitWeightPerLength": 0.0E+0, + "FloatValve": false + } + }, + "Fromations": [ + {"Top":0, + "Thickness":0, + "Drillablity":0, + "Abrasiveness":0, + "ThresholdWeight":0, + "PorePressureGradient":0 + }, + {"Top":0, + "Thickness":0, + "Drillablity":0, + "Abrasiveness":0, + "ThresholdWeight":0, + "PorePressureGradient":0 + } + ], + "Reservoir": { + "AutoMigrationRate": 0.0E+0, + "FluidGradient": 0.0E+0, + "FluidType": 0, + "FluidViscosity": 0.0E+0, + "FormationNo": 0, + "FormationPermeability": 0.0E+0, + "FormationTop": 0.0E+0, + "GeothermalGradient": 0.0E+0, + "InactiveInflux": false, + "IsAutoMigrationRateSelected": false, + "MakeKickSinglePacket": false, + "PressureGradient": 0.0E+0 + }, + "Shoe": { + "Breakdown": 0.0E+0, + "FormationNo": 0, + "FracturePropagation": 0.0E+0, + "InactiveFracture": false, + "LeakOff": 0.0E+0, + "ShoeDepth": 0.0E+0 + }, + "Accumulator": { + "AccumulatorMinimumOperatingPressure": 0.0E+0, + "AccumulatorSystemSize": 0.0E+0, + "AirPlungerPumpOutput": 0.0E+0, + "ElectricPumpOutput": 0.0E+0, + "NumberOfBottels": 0, + "OilTankVolume": 0.0E+0, + "PrechargePressure": 0.0E+0, + "StartPressure": 0.0E+0, + "StartPressure2": 0.0E+0, + "StopPressure": 0.0E+0, + "StopPressure2": 0.0E+0 + }, + "BopStack": { + "AboveAnnularHeight": 0.1E+2, + "AnnularPreventerClose": 0.0E+0, + "AnnularPreventerHeight": 0.10199999999999999E+2, + "AnnularPreventerOpen": 0.0E+0, + "AnnularStringDrag": 0.0E+0, + "BlindRamClose": 0.0E+0, + "BlindRamHeight": 0.16239999999999998E+2, + "BlindRamOpen": 0.0E+0, + "ChokeClose": 0.0E+0, + "ChokeLineId": 0.0E+0, + "ChokeLineLength": 0.0E+0, + "ChokeOpen": 0.0E+0, + "GroundLevel": 0.3E+2, + "KillClose": 0.15E+1, + "KillHeight": 0.18800000000000001E+2, + "KillOpen": 0.15E+1, + "LowerRamClose": 0.0E+0, + "LowerRamHeight": 0.21350000000000001E+2, + "LowerRamOpen": 0.0E+0, + "RamStringDrag": 0.0E+0, + "UpperRamClose": 0.0E+0, + "UpperRamHeight": 0.14632E+2, + "UpperRamOpen": 0.0E+0 + }, + "Hoisting": { + "DrillingLineBreakingLoadAbrasiveness": 0.0E+0, + "DriveTypeAbrasiveness": 0, + "KellyWeightAbrasiveness": 0.0E+0, + "NumberOfLineAbrasiveness": 0, + "TopDriveWeightAbrasiveness": 0.0E+0, + "TravelingBlockWeightAbrasiveness": 0.0E+0 + }, + "Power": { + "CementPump": 0.0E+0, + "Drawworks": 0.0E+0, + "GeneratorPowerRating": 0.0E+0, + "MudPump1": 0.0E+0, + "MudPump2": 0.0E+0, + "NumberOfgenerators": 0, + "RotaryTable": 0.0E+0, + "TopDrive": 0.0E+0 + }, + "Pumps": { + "MudPump1LinerDiameter": 0.0E+0, + "MudPump1Stroke": 0.0E+0, + "MudPump1MechanicalEfficiency": 0.0E+0, + "MudPump1VolumetricEfficiency": 0.0E+0, + "MudPump1Output": 0.0E+0, + "MudPump1OutputBblStroke": 0.0E+0, + "MudPump1Maximum": 0.0E+0, + "MudPump1ReliefValvePressure": 0.0E+0, + "MudPump2LinerDiameter": 0.0E+0, + "MudPump2Stroke": 0.0E+0, + "MudPump2MechanicalEfficiency": 0.0E+0, + "MudPump2VolumetricEfficiency": 0.0E+0, + "MudPump2Output": 0.0E+0, + "MudPump2OutputBblStroke": 0.0E+0, + "MudPump2Maximum": 0.0E+0, + "MudPump2ReliefValvePressure": 0.0E+0, + "CementPumpLinerDiameter": 0.0E+0, + "CementPumpStroke": 0.0E+0, + "CementPumpMechanicalEfficiency": 0.0E+0, + "CementPumpVolumetricEfficiency": 0.0E+0, + "CementPumpOutput": 0.0E+0, + "CementPumpOutputBblStroke": 0.0E+0, + "CementPumpMaximum": 0.0E+0, + "CementPumpReliefValvePressure": 0.0E+0, + "MudPump1ReliefValveIsSet": false, + "MudPump2ReliefValveIsSet": false, + "CementPumpReliefValveIsSet": false, + "ManualPumpPower": false, + "Valve1": false, + "Valve2": false, + "Valve3": false, + "Valve4": false, + "Valve5": false + }, + "RigSize": { + "RigType": 0, + "CrownHeight": 0.0E+0, + "MonkeyBoandHeight": 0.0E+0, + "RigFloorHeight": 0.0E+0 + }, + "CasingLinerChoke": { + "CasingDepth": 0.0E+0, + "CasingId": 0.0E+0, + "CasingOd": 0.0E+0, + "CasingWeight": 0.0E+0, + "CasingCollapsePressure": 0.0E+0, + "CasingTensileStrength": 0.0E+0, + "LinerTopDepth": 0.0E+0, + "LinerLength": 0.0E+0, + "LinerId": 0.0E+0, + "LinerOd": 0.0E+0, + "LinerWeight": 0.0E+0, + "LinerCollapsePressure": 0.0E+0, + "LinerTensileStrength": 0.0E+0, + "OpenHoleId": 0.0E+0, + "OpenHoleLength": 0.0E+0 + }, + "Path": { + "Items": [ + {"HoleType":0, + "Angle":0, + "Length":0, + "FinalAngle":0, + "TotalLength":0, + "MeasuredDepth":0, + "TotalVerticalDepth":0 + }, + {"HoleType":0, + "Angle":0, + "Length":0, + "FinalAngle":0, + "TotalLength":0, + "MeasuredDepth":0, + "TotalVerticalDepth":0 + } + ], + "DataPoints": [ + {"X":0, + "Y":0 + }, + {"X":0, + "Y":0 + } + ] + }, + "Mud": { + "ActiveMudType": 0, + "ActiveRheologyModel": 0, + "ActiveMudVolume": 0.0E+0, + "ActiveMudVolumeGal": 0.0E+0, + "ActiveDensity": 0.0E+0, + "ActivePlasticViscosity": 0.0E+0, + "ActiveYieldPoint": 0.0E+0, + "ActiveThetaThreeHundred": 0.0E+0, + "ActiveThetaSixHundred": 0.0E+0, + "ReserveMudType": 0, + "ReserveMudVolume": 0.0E+0, + "ReserveMudVolumeGal": 0.0E+0, + "ReserveDensity": 0.0E+0, + "ReservePlasticViscosity": 0.0E+0, + "ReserveYieldPoint": 0.0E+0, + "ReserveThetaThreeHundred": 0.0E+0, + "ReserveThetaSixHundred": 0.0E+0, + "ActiveTotalTankCapacity": 0.0E+0, + "ActiveTotalTankCapacityGal": 0.0E+0, + "ActiveSettledContents": 0.0E+0, + "ActiveSettledContentsGal": 0.0E+0, + "ActiveTotalContents": 0.0E+0, + "ActiveTotalContentsGal": 0.0E+0, + "ActiveAutoDensity": false, + "InitialTripTankMudVolume": 0.0E+0, + "InitialTripTankMudVolumeGal": 0.0E+0, + "PedalFlowMeter": 0.0E+0 + } + } +} diff --git a/helper.ipynb b/helper.ipynb index 05f3235..0cce7f0 100644 --- a/helper.ipynb +++ b/helper.ipynb @@ -384,25 +384,34 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": 12, "metadata": {}, "outputs": [ { - "ename": "ValueError", - "evalue": "cannot prepare() more than once", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32mc:\\Projects\\VSIM\\SimulationCore2\\helper.ipynb Cell 3\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m files \u001b[39m=\u001b[39m \u001b[39mtuple\u001b[39;49m(ts\u001b[39m.\u001b[39;49mstatic_order())\n\u001b[0;32m 2\u001b[0m \u001b[39mfor\u001b[39;00m file \u001b[39min\u001b[39;00m files:\n\u001b[0;32m 3\u001b[0m \u001b[39mprint\u001b[39m(file\u001b[39m.\u001b[39mreplace(\u001b[39m\"\u001b[39m\u001b[39m\\\\\u001b[39;00m\u001b[39m\"\u001b[39m,\u001b[39m\"\u001b[39m\u001b[39m/\u001b[39m\u001b[39m\"\u001b[39m)\u001b[39m+\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m /\u001b[39m\u001b[39m\"\u001b[39m)\n", - "File \u001b[1;32mc:\\Users\\Mahmood\\Anaconda3\\lib\\graphlib.py:242\u001b[0m, in \u001b[0;36mTopologicalSorter.static_order\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 233\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mstatic_order\u001b[39m(\u001b[39mself\u001b[39m):\n\u001b[0;32m 234\u001b[0m \u001b[39m\"\"\"Returns an iterable of nodes in a topological order.\u001b[39;00m\n\u001b[0;32m 235\u001b[0m \n\u001b[0;32m 236\u001b[0m \u001b[39m The particular order that is returned may depend on the specific\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 240\u001b[0m \u001b[39m cycle is detected, :exc:`CycleError` will be raised.\u001b[39;00m\n\u001b[0;32m 241\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[1;32m--> 242\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mprepare()\n\u001b[0;32m 243\u001b[0m \u001b[39mwhile\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mis_active():\n\u001b[0;32m 244\u001b[0m node_group \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mget_ready()\n", - "File \u001b[1;32mc:\\Users\\Mahmood\\Anaconda3\\lib\\graphlib.py:93\u001b[0m, in \u001b[0;36mTopologicalSorter.prepare\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 85\u001b[0m \u001b[39m\"\"\"Mark the graph as finished and check for cycles in the graph.\u001b[39;00m\n\u001b[0;32m 86\u001b[0m \n\u001b[0;32m 87\u001b[0m \u001b[39mIf any cycle is detected, \"CycleError\" will be raised, but \"get_ready\" can\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 90\u001b[0m \u001b[39mtherefore no more nodes can be added using \"add\".\u001b[39;00m\n\u001b[0;32m 91\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[0;32m 92\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_ready_nodes \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m---> 93\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\u001b[39m\"\u001b[39m\u001b[39mcannot prepare() more than once\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[0;32m 95\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_ready_nodes \u001b[39m=\u001b[39m [\n\u001b[0;32m 96\u001b[0m i\u001b[39m.\u001b[39mnode \u001b[39mfor\u001b[39;00m i \u001b[39min\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_node2info\u001b[39m.\u001b[39mvalues() \u001b[39mif\u001b[39;00m i\u001b[39m.\u001b[39mnpredecessors \u001b[39m==\u001b[39m \u001b[39m0\u001b[39m\n\u001b[0;32m 97\u001b[0m ]\n\u001b[0;32m 98\u001b[0m \u001b[39m# ready_nodes is set before we look for cycles on purpose:\u001b[39;00m\n\u001b[0;32m 99\u001b[0m \u001b[39m# if the user wants to catch the CycleError, that's fine,\u001b[39;00m\n\u001b[0;32m 100\u001b[0m \u001b[39m# they can continue using the instance to grab as many\u001b[39;00m\n\u001b[0;32m 101\u001b[0m \u001b[39m# nodes as possible before cycles block more progress\u001b[39;00m\n", - "\u001b[1;31mValueError\u001b[0m: cannot prepare() more than once" + "name": "stdout", + "output_type": "stream", + "text": [ + "CSharp/Equipments/ControlPanels/CBopControlPanel.f90\n", + "CSharp/Equipments/ControlPanels/CChokeControlPanel.f90\n", + "CSharp/Equipments/ControlPanels/CChokeManifold.f90\n", + "CSharp/Equipments/ControlPanels/CDataDisplayConsole.f90\n", + "CSharp/Equipments/ControlPanels/CDrillingConsole.f90\n", + "CSharp/Equipments/ControlPanels/CEquipmentsConstants.f90\n", + "CSharp/Equipments/ControlPanels/CHook.f90\n", + "CSharp/Equipments/ControlPanels/CHookActions.f90\n", + "CSharp/Equipments/ControlPanels/CStandPipeManifold.f90\n", + "CSharp/Equipments/ControlPanels/CTopDrivePanel.f90\n" ] } ], "source": [ - "files = tuple(ts.static_order())\n" + "dir = 'CSharp/Equipments/ControlPanels'\n", + "import os\n", + "os.listdir(dir)\n", + "for f in os.listdir(dir):\n", + " if f.endswith('Variables.f90'):\n", + " continue\n", + " print(dir+'/'+f)" ] }, { @@ -894,6 +903,65 @@ " print(f\"2-{a}\")" ] }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# FromJson" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\t\t\tcall json%get(pitem,\"ComponentType\",pval)\n", + "\t\t\tcall json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentType)\n", + "\n", + "\t\t\tcall json%get(pitem,\"NumberOfJoint\",pval)\n", + "\t\t\tcall json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%NumberOfJoint)\n", + "\n", + "\t\t\tcall json%get(pitem,\"LengthPerJoint\",pval)\n", + "\t\t\tcall json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%LengthPerJoint)\n", + "\n", + "\t\t\tcall json%get(pitem,\"NominalOd\",pval)\n", + "\t\t\tcall json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%NominalOd)\n", + "\n", + "\t\t\tcall json%get(pitem,\"NominalId\",pval)\n", + "\t\t\tcall json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%NominalId)\n", + "\n", + "\t\t\tcall json%get(pitem,\"WeightPerLength\",pval)\n", + "\t\t\tcall json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%WeightPerLength)\n", + "\n", + "\t\t\tcall json%get(pitem,\"ComponentLength\",pval)\n", + "\t\t\tcall json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%ComponentLength)\n", + "\n", + "\t\t\tcall json%get(pitem,\"NominalToolJointOd\",pval)\n", + "\t\t\tcall json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%NominalToolJointOd)\n", + "\n", + "\t\t\tcall json%get(pitem,\"Grade\",pval)\n", + "\t\t\tcall json%get(pval,data%Configuration%StringConfiguration%StringConfigurations(i)%Grade)\n", + "\n" + ] + } + ], + "source": [ + "pattern=\"\"\"\t\tcall json%get(pbit,'@@@',pval)\n", + "\t\tcall json%get(pval,data%Configuration%StringConfiguration%BitDefinition%@@@)\"\"\"\n", + "\n", + "input = open(\"Text1.txt\")\n", + "lines = input.readlines()\n", + "for line in lines:\n", + "\tname = line.split(\"::\")[-1].strip()\n", + "\tnewline = pattern.replace(\"@@@\",name)\n", + "\tprint(newline)\n" + ] + }, { "attachments": {}, "cell_type": "markdown", @@ -904,32 +972,22 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{\"Depth\":0,\n", - "\"BitPosition\":0,\n", - "\"HookLoad\":0,\n", - "\"WeightOnBit\":0,\n", - "\"RPM\":0,\n", - "\"ROP\":0,\n", - "\"Torque\":0,\n", - "\"PumpPressure\":0,\n", - "\"SPM1\":0,\n", - "\"SPM2\":0,\n", - "\"CasingPressure\":0,\n", - "\"PercentFlow\":0,\n", - "\"PitGainLose\":0,\n", - "\"PitVolume\":0,\n", - "\"KillMudVolume\":0,\n", - "\"TripTankVolume\":0,\n", - "\"MudWeightIn\":0,\n", - "\"FillVolume\":0,\n", - "\"MudWeightOut\":0,\n", + "{\"ComponentType\":0,\n", + "\"NumberOfJoint\":0,\n", + "\"LengthPerJoint\":0,\n", + "\"NominalOd\":0,\n", + "\"NominalId\":0,\n", + "\"WeightPerLength\":0,\n", + "\"ComponentLength\":0,\n", + "\"NominalToolJointOd\":0,\n", + "\"Grade\":0,\n", "}\n" ] } @@ -950,21 +1008,37 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "call ProblemToJson(p,\"ElevatorConnection\",data%State%OperationScenarios%ElevatorConnection)\n", - "call ProblemToJson(p,\"StringUpdate\",data%State%OperationScenarios%StringUpdate)\n", - "call ProblemToJson(p,\"KellyConnection\",data%State%OperationScenarios%KellyConnection)\n" + "call json%add(p,\"Depth\",data%EquipmentControl%DrillingWatch%Depth)\n", + "call json%add(p,\"BitPosition\",data%EquipmentControl%DrillingWatch%BitPosition)\n", + "call json%add(p,\"HookLoad\",data%EquipmentControl%DrillingWatch%HookLoad)\n", + "call json%add(p,\"WeightOnBit\",data%EquipmentControl%DrillingWatch%WeightOnBit)\n", + "call json%add(p,\"RPM\",data%EquipmentControl%DrillingWatch%RPM)\n", + "call json%add(p,\"ROP\",data%EquipmentControl%DrillingWatch%ROP)\n", + "call json%add(p,\"Torque\",data%EquipmentControl%DrillingWatch%Torque)\n", + "call json%add(p,\"PumpPressure\",data%EquipmentControl%DrillingWatch%PumpPressure)\n", + "call json%add(p,\"SPM1\",data%EquipmentControl%DrillingWatch%SPM1)\n", + "call json%add(p,\"SPM2\",data%EquipmentControl%DrillingWatch%SPM2)\n", + "call json%add(p,\"CasingPressure\",data%EquipmentControl%DrillingWatch%CasingPressure)\n", + "call json%add(p,\"PercentFlow\",data%EquipmentControl%DrillingWatch%PercentFlow)\n", + "call json%add(p,\"PitGainLose\",data%EquipmentControl%DrillingWatch%PitGainLose)\n", + "call json%add(p,\"PitVolume\",data%EquipmentControl%DrillingWatch%PitVolume)\n", + "call json%add(p,\"KillMudVolume\",data%EquipmentControl%DrillingWatch%KillMudVolume)\n", + "call json%add(p,\"TripTankVolume\",data%EquipmentControl%DrillingWatch%TripTankVolume)\n", + "call json%add(p,\"MudWeightIn\",data%EquipmentControl%DrillingWatch%MudWeightIn)\n", + "call json%add(p,\"FillVolume\",data%EquipmentControl%DrillingWatch%FillVolume)\n", + "call json%add(p,\"MudWeightOut\",data%EquipmentControl%DrillingWatch%MudWeightOut)\n" ] } ], "source": [ - "precode = \"\"\"call json%add(pform,\"TopDriveTdsPowerState\",data%EquipmentControl%DrillingWatch%\"\"\"\n", + "precode = \"\"\"call json%add(p,\"\",data%EquipmentControl%DrillingWatch%\"\"\"\n", "input = open(\"Text1.txt\")\n", "lines = input.readlines()\n", "for line in lines:\n", diff --git a/test.json b/test.json index ca18ce2..3df0ef5 100644 --- a/test.json +++ b/test.json @@ -1,7 +1,30 @@ { "Configuration": { "StringConfiguration": { - "StringConfigurationItems": [], + "StringConfigurationItems": [ + { + "ComponentType": 1, + "NumberOfJoint": 0, + "LengthPerJoint": 0, + "NominalOd": 0, + "NominalId": 0, + "WeightPerLength": 0, + "ComponentLength": 0.15E+1, + "NominalToolJointOd": 0, + "Grade": "A" + }, + { + "ComponentType": 2, + "NumberOfJoint": 0, + "LengthPerJoint": 0, + "NominalOd": 0, + "NominalId": 0, + "WeightPerLength": 0, + "ComponentLength": 0.26000000000000001E+1, + "NominalToolJointOd": 0, + "Grade": "B" + } + ], "BitDefenition": { "BitCodeHundreds": 0, "BitCodeOnes": 0, @@ -15,7 +38,24 @@ "FloatValve": false } }, - "Formations": [], + "Fromations": [ + { + "Top": 0, + "Thickness": 0, + "Drillablity": 0, + "Abrasiveness": 0, + "ThresholdWeight": 0, + "PorePressureGradient": 0 + }, + { + "Top": 0, + "Thickness": 0, + "Drillablity": 0, + "Abrasiveness": 0, + "ThresholdWeight": 0, + "PorePressureGradient": 0 + } + ], "Reservoir": { "AutoMigrationRate": 0.0E+0, "FluidGradient": 0.0E+0, @@ -153,8 +193,36 @@ "OpenHoleLength": 0.0E+0 }, "Path": { - "Items": [], - "DataPoints": [] + "Items": [ + { + "HoleType": 0, + "Angle": 0, + "Length": 0, + "FinalAngle": 0, + "TotalLength": 0, + "MeasuredDepth": 0, + "TotalVerticalDepth": 0 + }, + { + "HoleType": 0, + "Angle": 0, + "Length": 0, + "FinalAngle": 0, + "TotalLength": 0, + "MeasuredDepth": 0, + "TotalVerticalDepth": 0 + } + ], + "DataPoints": [ + { + "X": 0, + "Y": 0 + }, + { + "X": 0, + "Y": 0 + } + ] }, "Mud": { "ActiveMudType": 0, @@ -186,859 +254,259 @@ "PedalFlowMeter": 0.0E+0 } }, - "Warnings": { - "PumpWithKellyDisconnected": false, - "PumpWithTopdriveDisconnected": false, - "Pump1PopOffValveBlown": false, - "Pump1Failure": false, - "Pump2PopOffValveBlown": false, - "Pump2Failure": false, - "Pump3PopOffValveBlown": false, - "Pump3Failure": false, - "DrawworksGearsAbuse": false, - "RotaryGearsAbuse": false, - "HoistLineBreak": false, - "PartedDrillString": false, - "ActiveTankOverflow": false, - "ActiveTankUnderVolume": false, - "TripTankOverflow": false, - "DrillPipeTwistOff": false, - "DrillPipeParted": false, - "TripWithSlipsSet": false, - "Blowout": false, - "UndergroundBlowout": false, - "MaximumWellDepthExceeded": false, - "CrownCollision": false, - "FloorCollision": false, - "TopdriveRotaryTableConfilict": false - }, - "Problems": { - "BitProblems": { - "JetWashout": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "PlugJets": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "JetWashoutCount": 0, - "PlugJetsCount": 0 - }, - "BopProblems": { - "AnnularWash": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "AnnularFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "AnnularLeak": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "UpperRamWash": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "UpperRamFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "UpperRamLeak": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "MiddleRamWash": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "MiddleRamFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "MiddleRamLeak": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "LowerRamWash": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "LowerRamFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "LowerRamLeak": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "AccumulatorPumpFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "AccumulatorPumpLeak": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "AccumulatorSystemFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "AccumulatorSystemLeak": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - } - }, - "ChokeProblems": { - "HydraulicChoke1Plugged": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "HydraulicChoke1Fail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "HydraulicChoke1Washout": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "HydraulicChoke2Plugged": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "HydraulicChoke2Fail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "HydraulicChoke2Washout": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ManualChoke1Plugged": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ManualChoke1Fail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ManualChoke1Washout": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ManualChoke2Plugged": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ManualChoke2Fail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ManualChoke2Washout": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ChokePanelAirFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - } - }, - "DrillStemsProblems": { - "StringDragIncrease": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "StringTorqueIncrease": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "StringTorqueFluctuation": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "StringDragIncreaseTime": 0.0E+0, - "StringTorqueIncreaseTime": 0.0E+0 - }, - "GaugesProblems": { - "WeightIndicator": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "RotaryRpm": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "RotaryTorque": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "StandPipePressure": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "CasingPressure": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Pump1Strokes": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Pump2Strokes": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ReturnLineTemperature": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "TripTank": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "PitGainLoss": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "MudTankVolume": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ReturnMudFlow": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "TorqueLimit": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "PowerLimit": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "AccumulatorPressure": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ManifoldPressure": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "AnnularPressure": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "RigAirPressure": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "StandPipe1": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "StandPipe2": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "DrillPipePressure": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ChokePosition": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "CasingPressure2": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 + "Configuration": { + "StringConfiguration": { + "StringConfigurationItems": [ + { + "ComponentType": 1, + "NumberOfJoint": 0, + "LengthPerJoint": 0, + "NominalOd": 0, + "NominalId": 0, + "WeightPerLength": 0, + "ComponentLength": 0.15E+1, + "NominalToolJointOd": 0, + "Grade": "A" + }, + { + "ComponentType": 2, + "NumberOfJoint": 0, + "LengthPerJoint": 0, + "NominalOd": 0, + "NominalId": 0, + "WeightPerLength": 0, + "ComponentLength": 0.26000000000000001E+1, + "NominalToolJointOd": 0, + "Grade": "B" + } + ], + "BitDefenition": { + "BitCodeHundreds": 0, + "BitCodeOnes": 0, + "BitCodeTens": 0, + "BitLength": 0.0E+0, + "BitNozzleNo": 0, + "BitNozzleSize": 0.0E+0, + "BitSize": 0.0E+0, + "BitType": 0, + "BitWeightPerLength": 0.0E+0, + "FloatValve": false } }, - "HoistingProblems": { - "MotorFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ClutchEngage": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ClutchDisengage": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 + "Fromations": [ + { + "Top": 0, + "Thickness": 0, + "Drillablity": 0, + "Abrasiveness": 0, + "ThresholdWeight": 0, + "PorePressureGradient": 0 + }, + { + "Top": 0, + "Thickness": 0, + "Drillablity": 0, + "Abrasiveness": 0, + "ThresholdWeight": 0, + "PorePressureGradient": 0 } - }, - "KickProblems": { - "Kick": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, + ], + "Reservoir": { + "AutoMigrationRate": 0.0E+0, + "FluidGradient": 0.0E+0, "FluidType": 0, - "FlowRate": 0, - "OverBalancePressure": 0, + "FluidViscosity": 0.0E+0, + "FormationNo": 0, + "FormationPermeability": 0.0E+0, + "FormationTop": 0.0E+0, + "GeothermalGradient": 0.0E+0, + "InactiveInflux": false, "IsAutoMigrationRateSelected": false, - "AutoMigrationRate": 0.0E+0 - }, - "Configuration": { - "LostCirculation": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "FlowRate": 0.0E+0 - }, - "MudTreatmentProblems": { - "Degasser": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "ShaleShaker": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Desander": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Desilter": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - } - }, - "OtherProblems": { - "RigAlarm": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "RigWaterSupply": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "RigAir": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Gen1": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Gen2": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Gen3": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Gen4": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Scr1": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Scr2": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Scr3": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Scr4": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - } + "MakeKickSinglePacket": false, + "PressureGradient": 0.0E+0 }, - "PumpProblems": { - "Pump1PowerFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Pump1BlowPopOffValve": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Pump2PowerFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "Pump2BlowPopOffValve": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "CementPumpPowerFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "CementPumpBlowPopOffValve": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - } + "Shoe": { + "Breakdown": 0.0E+0, + "FormationNo": 0, + "FracturePropagation": 0.0E+0, + "InactiveFracture": false, + "LeakOff": 0.0E+0, + "ShoeDepth": 0.0E+0 }, - "RotaryProblems": { - "MotorFail": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - }, - "OverideTorqueLimit": { - "ProblemType": 0, - "StatusType": 0, - "Value": 0.0E+0, - "DueValue": 0.0E+0 - } - } - }, - "Equipments": { - "BopControl": { - "AnnularRegulatorSetControl": 0.0E+0, - "AirMasterValve": 0.0E+0, - "ByePassValve": 0.0E+0, - "AnnularValve": 0.0E+0, - "UpperRamsValve": 0.0E+0, - "MiddleRamsValve": 0.0E+0, - "KillLineValve": 0.0E+0, - "ChokeLineValve": 0.0E+0, - "LowerRamsValve": 0.0E+0, - "ManifoldPressureGauge": 0.0E+0, - "AirSupplyPressureGauge": 0.0E+0, - "AccumulatorPressureGauge": 0.0E+0, - "AnnularPressureGauge": 0.0E+0, - "AnnularOpenLED": 0, - "AnnularCloseLED": 0, - "UpperRamsOpenLED": 0, - "UpperRamsCloseLED": 0, - "MiddleRamsOpenLED": 0, - "MiddleRamsCloseLED": 0, - "KillLineOpenLED": 0, - "KillLineCloseLED": 0, - "ChokeLineOpenLED": 0, - "ChokeLineCloseLED": 0, - "LowerRamsOpenLED": 0, - "LowerRamsCloseLED": 0, - "AnnularStatus": 0.0E+0, - "UpperRamsStatus": 0.0E+0, - "MiddleRamsStatus": 0.0E+0, - "LowerRamsStatus": 0.0E+0 + "Accumulator": { + "AccumulatorMinimumOperatingPressure": 0.0E+0, + "AccumulatorSystemSize": 0.0E+0, + "AirPlungerPumpOutput": 0.0E+0, + "ElectricPumpOutput": 0.0E+0, + "NumberOfBottels": 0, + "OilTankVolume": 0.0E+0, + "PrechargePressure": 0.0E+0, + "StartPressure": 0.0E+0, + "StartPressure2": 0.0E+0, + "StopPressure": 0.0E+0, + "StopPressure2": 0.0E+0 }, - "ChokeControl": { - "ChokePanelPumpSelectorSwitch": 0, - "ChokePanelStrokeResetSwitch": false, - "ChokeSelectorSwitch": false, - "ChokeRateControlKnob": 0.0E+0, - "ChokeControlLever": 0.0E+0, - "ChokePanelRigAirSwitch": false, - "EnableAutoChoke": false, - "StandPipePressure": 0.0E+0, - "CasingPressure": 0.0E+0, - "ChokePosition": 0.0E+0, - "ChokePanelSPMCounter": 0.0E+0, - "ChokePanelTotalStrokeCounter": 0.0E+0, - "Choke1LED": 0, - "Choke2LED": 0 + "BopStack": { + "AboveAnnularHeight": 0.1E+2, + "AnnularPreventerClose": 0.0E+0, + "AnnularPreventerHeight": 0.10199999999999999E+2, + "AnnularPreventerOpen": 0.0E+0, + "AnnularStringDrag": 0.0E+0, + "BlindRamClose": 0.0E+0, + "BlindRamHeight": 0.16239999999999998E+2, + "BlindRamOpen": 0.0E+0, + "ChokeClose": 0.0E+0, + "ChokeLineId": 0.0E+0, + "ChokeLineLength": 0.0E+0, + "ChokeOpen": 0.0E+0, + "GroundLevel": 0.3E+2, + "KillClose": 0.15E+1, + "KillHeight": 0.18800000000000001E+2, + "KillOpen": 0.15E+1, + "LowerRamClose": 0.0E+0, + "LowerRamHeight": 0.21350000000000001E+2, + "LowerRamOpen": 0.0E+0, + "RamStringDrag": 0.0E+0, + "UpperRamClose": 0.0E+0, + "UpperRamHeight": 0.14632E+2, + "UpperRamOpen": 0.0E+0 }, - "ChokeManifold": { - "ChokeManifoldValve1": false, - "ChokeManifoldValve2": false, - "LeftManualChoke": 0.0E+0, - "ChokeManifoldValve4": false, - "ChokeManifoldValve5": false, - "RightManualChoke": 0.0E+0, - "ChokeManifoldValve7": false, - "ChokeManifoldValve8": false, - "ChokeManifoldValve9": false, - "ChokeManifoldValve10": false, - "ChokeManifoldValve11": false, - "ChokeManifoldValve12": false, - "ChokeManifoldValve13": false, - "HydraulicChock1": 0, - "HydraulicChock2": 0, - "HyChock1OnProblem": false, - "HyChock2OnProblem": false, - "LeftManChokeOnProblem": false, - "RightManChokeOnProblem": false + "Hoisting": { + "DrillingLineBreakingLoadAbrasiveness": 0.0E+0, + "DriveTypeAbrasiveness": 0, + "KellyWeightAbrasiveness": 0.0E+0, + "NumberOfLineAbrasiveness": 0, + "TopDriveWeightAbrasiveness": 0.0E+0, + "TravelingBlockWeightAbrasiveness": 0.0E+0 }, - "DataDisplay": { - "TripAlarmLow": 0.0E+0, - "TripAlarmHigh": 0.0E+0, - "RetFlowAlarmLow": 0.0E+0, - "RetFlowAlarmHigh": 0.0E+0, - "PitAlarmLow": 0.0E+0, - "PitAlarmHigh": 0.0E+0, - "PortWeightOnBit": 0.0E+0, - "PortHookLoad": 0.0E+0, - "PortCasingPressure": 0.0E+0, - "PortPumpPressure": 0.0E+0, - "TripTankSetAlarmLow": 0.0E+0, - "TripTankSetAlarmHigh": 0.0E+0, - "TripTankSetAlarmSwitch": 0, - "TripTankPowerSwitch": false, - "TripTankPumpSwitch": false, - "TripTankHornSwitch": false, - "AcidGasDetectionHornSwitch": false, - "TotalStrokeCounterResetSwitch": false, - "DrillingTrippingSelectorSwitch": false, - "MVTSetAlarmLowKnob": 0.0E+0, - "MVTSetAlarmHighKnob": 0.0E+0, - "MVTSetAlarmSwitch": 0, - "MudTank1Switch": false, - "MudTank2Switch": false, - "MudTank3Switch": false, - "MudTank4Switch": false, - "MVTFineKnob": 0.0E+0, - "MVTCoarseKnob": 0.0E+0, - "MVTHornSwitch": false, - "MVTDeviationTripSelectionSwitch": false, - "MVTPowerSwitch": false, - "MFFIResetTotalStrokes": false, - "MFFIResetFillCounter": false, - "MFFIPumpSelectorSwitch": 0, - "MFFIFillSPMSelectorSwitch": false, - "MFFISetAlarmLowKnob": 0.0E+0, - "MFFISetAlarmHighKnob": 0.0E+0, - "MFFISetAlarmSwitch": 0, - "MFFIPowerSwitch": false, - "MFFIHornSwitch": false, - "ResetWob": false, - "Clutch": false, - "WOBPointer": 0.0E+0, - "HookLoadPointer": 0.0E+0, - "TripTankGauge": 0.0E+0, - "TripTankAlarmLED": 0, - "TripTankPumpLED": 0, - "StandPipePressureGauge": 0.0E+0, - "CasingPressureGauge": 0.0E+0, - "MP1SPMGauge": 0.0E+0, - "MP2SPMGauge": 0.0E+0, - "ReturnLineTempGauge": 0.0E+0, - "RotaryTorqueGauge": 0.0E+0, - "RotaryRPMGauge": 0.0E+0, - "AcidGasDetectionLED": 0, - "TotalStrokeCounter": 0.0E+0, - "PitGainLossGauge": 0.0E+0, - "MudTanksVolumeGauge": 0.0E+0, - "MVTAlarmLED": 0, - "ReturnMudFlowGauge": 0.0E+0, - "FillStrokeCounter": 0.0E+0, - "MFFITotalStrokeCounter": 0.0E+0, - "MFFIAlarmLED": 0, - "MFFIPumpLED": 0, - "TotalWellDepth": 0.0E+0, - "BitDepth": 0.0E+0, - "HookLoad": 0.0E+0, - "StandPipePressure": 0.0E+0, - "CasingPressure": 0.0E+0, - "MP1SPM": 0.0E+0, - "MP2SPM": 0.0E+0, - "RTTorque": 0.0E+0, - "RTRPM": 0.0E+0, - "WOP": 0.0E+0, - "ROP": 0.0E+0, - "MudWeightIn": 0.0E+0, - "MudWeightOut": 0.0E+0, - "Buzzer1": false, - "Buzzer2": false, - "Buzzer3": false, - "Buzzer4": false + "Power": { + "CementPump": 0.0E+0, + "Drawworks": 0.0E+0, + "GeneratorPowerRating": 0.0E+0, + "MudPump1": 0.0E+0, + "MudPump2": 0.0E+0, + "NumberOfgenerators": 0, + "RotaryTable": 0.0E+0, + "TopDrive": 0.0E+0 }, - "Drilling": { - "AssignmentSwitch": 0, - "EmergencySwitch": false, - "RTTorqueLimitKnob": 0.0E+0, - "MP1CPSwitchI": 0, - "MP1CPSwitchT": 0, - "MP1CPSwitch": 0, - "MP1ThrottleUpdate": false, - "MP1Throttle": -0.1E+1, - "MP2SwitchI": 0, - "MP2SwitchT": false, - "MP2Switch": false, - "MP2ThrottleUpdate": false, - "MP2Throttle": -0.1E+1, - "DWSwitch": 0, - "DWThrottle": 0.0E+0, - "RTSwitch": 0, - "RTThrottle": 0.0E+0, - "DWBreak": 0.0E+0, - "PreviousDWBreak": 0.0E+0, - "ForceBreak": false, - "DWAcceleretor": 0.0E+0, - "DWTransmisionLever": 0.0E+0, - "DWPowerLever": 0.0E+0, - "TongLever": 0.0E+0, - "RTTransmissionLever": 0.0E+0, - "DWClutchLever": 0.0E+0, - "EddyBreakLever": 0.0E+0, - "AutoDW": false, - "GEN1": false, - "GEN2": false, - "GEN3": false, - "GEN4": false, - "Permission_OpenKellyCock": false, - "OpenKellyCock": false, - "Permission_CloseKellyCock": false, - "CloseKellyCock": false, - "Permission_OpenSafetyValve": false, - "OpenSafetyValve": false, - "Permission_CloseSafetyValve": false, - "CloseSafetyValve": false, - "Permission_IRSafetyValve": false, - "IRSafetyValve": false, - "Permission_IRIBop": false, - "IRIBop": false, - "LatchPipe": false, - "UnlatchPipe": false, - "Swing": false, - "FillMouseHole": false, - "Slips": false, - "BrakeLeverCoefficient": 0.0E+0, - "HideDrillingBrake": false, - "ParkingBrakeBtn": false, - "ParkingBrakeLed": false, - "GEN1LED": 0, - "GEN2LED": 0, - "GEN3LED": 0, - "GEN4LED": 0, - "SCR1LED": 0, - "SCR2LED": 0, - "SCR3LED": 0, - "SCR4LED": 0, - "MP1BLWR": 0, - "MP2BLWR": 0, - "DWBLWR": 0, - "RTBLWR": 0, - "PWRLIM": 0, - "PWRLIMMTR": 0.0E+0, - "RTTorqueLimitGauge": 0.0E+0, - "AutoDWLED": 0, - "GEN1BTNLED": 0, - "GEN2BTNLED": 0, - "GEN3BTNLED": 0, - "GEN4BTNLED": 0, - "OpenKellyCockLed": 0, - "CloseKellyCockLed": 0, - "OpenSafetyValveLed": 0, - "CloseSafetyValveLed": 0, - "IRSafetyValveLed": 0, - "IRIBopLed": 0, - "LatchPipeLED": 0, - "UnlatchPipeLED": 0, - "SwingLed": 0, - "FillMouseHoleLed": 0 + "Pumps": { + "MudPump1LinerDiameter": 0.0E+0, + "MudPump1Stroke": 0.0E+0, + "MudPump1MechanicalEfficiency": 0.0E+0, + "MudPump1VolumetricEfficiency": 0.0E+0, + "MudPump1Output": 0.0E+0, + "MudPump1OutputBblStroke": 0.0E+0, + "MudPump1Maximum": 0.0E+0, + "MudPump1ReliefValvePressure": 0.0E+0, + "MudPump2LinerDiameter": 0.0E+0, + "MudPump2Stroke": 0.0E+0, + "MudPump2MechanicalEfficiency": 0.0E+0, + "MudPump2VolumetricEfficiency": 0.0E+0, + "MudPump2Output": 0.0E+0, + "MudPump2OutputBblStroke": 0.0E+0, + "MudPump2Maximum": 0.0E+0, + "MudPump2ReliefValvePressure": 0.0E+0, + "CementPumpLinerDiameter": 0.0E+0, + "CementPumpStroke": 0.0E+0, + "CementPumpMechanicalEfficiency": 0.0E+0, + "CementPumpVolumetricEfficiency": 0.0E+0, + "CementPumpOutput": 0.0E+0, + "CementPumpOutputBblStroke": 0.0E+0, + "CementPumpMaximum": 0.0E+0, + "CementPumpReliefValvePressure": 0.0E+0, + "MudPump1ReliefValveIsSet": false, + "MudPump2ReliefValveIsSet": false, + "CementPumpReliefValveIsSet": false, + "ManualPumpPower": false, + "Valve1": false, + "Valve2": false, + "Valve3": false, + "Valve4": false, + "Valve5": false }, - "Hook": { - "HookHeight_S": 0.0E+0, - "HookHeight": 0.0E+0 + "RigSize": { + "RigType": 0, + "CrownHeight": 0.0E+0, + "MonkeyBoandHeight": 0.0E+0, + "RigFloorHeight": 0.0E+0 }, - "StandPipeManifold": { - "StandPipeManifoldValve1": false, - "StandPipeManifoldValve2": false, - "StandPipeManifoldValve3": false, - "StandPipeManifoldValve4": false, - "StandPipeManifoldValve5": false, - "StandPipeManifoldValve6": false, - "StandPipeManifoldValve7": false, - "StandPipeManifoldValve8": false, - "StandPipeManifoldValve9": false, - "StandPipeManifoldValve10": false, - "StandPipeManifoldValve11": false, - "StandPipeManifoldValve12": false, - "StandPipeManifoldValve13": false, - "StandPipeManifoldValve14": false, - "StandPipeManifoldValve15": false, - "StandPipeGauge1": 0.0E+0, - "StandPipeGauge2": 0.0E+0 + "CasingLinerChoke": { + "CasingDepth": 0.0E+0, + "CasingId": 0.0E+0, + "CasingOd": 0.0E+0, + "CasingWeight": 0.0E+0, + "CasingCollapsePressure": 0.0E+0, + "CasingTensileStrength": 0.0E+0, + "LinerTopDepth": 0.0E+0, + "LinerLength": 0.0E+0, + "LinerId": 0.0E+0, + "LinerOd": 0.0E+0, + "LinerWeight": 0.0E+0, + "LinerCollapsePressure": 0.0E+0, + "LinerTensileStrength": 0.0E+0, + "OpenHoleId": 0.0E+0, + "OpenHoleLength": 0.0E+0 }, - "DrillingWatch": { - "Depth": 0.0E+0, - "BitPosition": 0.0E+0, - "HookLoad": 0.0E+0, - "WeightOnBit": 0.0E+0, - "RPM": 0.0E+0, - "ROP": 0.0E+0, - "Torque": 0.0E+0, - "PumpPressure": 0.0E+0, - "SPM1": 0.0E+0, - "SPM2": 0.0E+0, - "CasingPressure": 0.0E+0, - "PercentFlow": 0.0E+0, - "PitGainLose": 0.0E+0, - "PitVolume": 0.0E+0, - "KillMudVolume": 0.0E+0, - "TripTankVolume": 0.0E+0, - "MudWeightIn": 0.0E+0, - "FillVolume": 0.0E+0, - "MudWeightOut": 0.0E+0 + "Path": { + "Items": [ + { + "HoleType": 0, + "Angle": 0, + "Length": 0, + "FinalAngle": 0, + "TotalLength": 0, + "MeasuredDepth": 0, + "TotalVerticalDepth": 0 + }, + { + "HoleType": 0, + "Angle": 0, + "Length": 0, + "FinalAngle": 0, + "TotalLength": 0, + "MeasuredDepth": 0, + "TotalVerticalDepth": 0 + } + ], + "DataPoints": [ + { + "X": 0, + "Y": 0 + }, + { + "X": 0, + "Y": 0 + } + ] }, - "Tank": [] + "Mud": { + "ActiveMudType": 0, + "ActiveRheologyModel": 0, + "ActiveMudVolume": 0.0E+0, + "ActiveMudVolumeGal": 0.0E+0, + "ActiveDensity": 0.0E+0, + "ActivePlasticViscosity": 0.0E+0, + "ActiveYieldPoint": 0.0E+0, + "ActiveThetaThreeHundred": 0.0E+0, + "ActiveThetaSixHundred": 0.0E+0, + "ReserveMudType": 0, + "ReserveMudVolume": 0.0E+0, + "ReserveMudVolumeGal": 0.0E+0, + "ReserveDensity": 0.0E+0, + "ReservePlasticViscosity": 0.0E+0, + "ReserveYieldPoint": 0.0E+0, + "ReserveThetaThreeHundred": 0.0E+0, + "ReserveThetaSixHundred": 0.0E+0, + "ActiveTotalTankCapacity": 0.0E+0, + "ActiveTotalTankCapacityGal": 0.0E+0, + "ActiveSettledContents": 0.0E+0, + "ActiveSettledContentsGal": 0.0E+0, + "ActiveTotalContents": 0.0E+0, + "ActiveTotalContentsGal": 0.0E+0, + "ActiveAutoDensity": false, + "InitialTripTankMudVolume": 0.0E+0, + "InitialTripTankMudVolumeGal": 0.0E+0, + "PedalFlowMeter": 0.0E+0 + } } } diff --git a/testjson.f90 b/testjson.f90 new file mode 100644 index 0000000..1219d82 --- /dev/null +++ b/testjson.f90 @@ -0,0 +1,28 @@ +program RedisInterface + use json_module + use CStringConfigurationVariables + + type(json_file) :: jsonfile + type(json_value),pointer :: jsonvalue,jsonvalue2,child,child2,jsonvalue3 + type(json_core) :: jsoncore + logical :: is_found + integer ::n_children,i,j + type(CStringItem), allocatable :: StringConfigurations(:) + + call jsonfile%initialize() + call jsonfile%load_file('data-witharray.json'); if (jsonfile%failed()) stop + call jsonfile%json_file_get_root(jsonvalue) + call jsoncore%get(jsonvalue,'Configuration',jsonvalue2) + call jsoncore%get(jsonvalue2,'StringConfiguration',jsonvalue) + call jsoncore%get(jsonvalue,'StringConfigurationItems',jsonvalue2) + call jsoncore%info(jsonvalue2, n_children=n_children) + do i=1,n_children + call jsoncore%get_child(jsonvalue2, i, child, found=is_found) + if (.not. is_found) print *,"not found" + call jsoncore%get(child,"BitCodeHundreds",child2) + call jsoncore%get(child2,j) + print *,"BitCodeHundreds=",j + end do + print *,"n_children=",n_children + call jsonfile%destroy() +end program \ No newline at end of file