Ejemplo n.º 1
0
        public void ReadWellsFromShape()
        {
            PointShapeReader SR = new PointShapeReader(_config.WellShapeFile);
              DataTable _wellData = SR.Data.Read();
              SR.Dispose();

              foreach (DataRow dr in _wellData.Rows)
              {
            IrrigationWell IW = new IrrigationWell(dr[_config.IdHeader].ToString());
              IW.X =  Convert.ToDouble(dr[_config.XHeader]);
              IW.Y = Convert.ToDouble(dr[_config.YHeader]);

            IIntake I = IW.AddNewIntake(1);

            IW.MaxDepth = Convert.ToDouble(dr[_config.MaxDepthHeader]);
            IW.MaxRate = Convert.ToDouble(dr[_config.MaxRateHeader]);

            Screen CurrentScreen = new Screen(I);
            CurrentScreen.DepthToBottom =  Convert.ToDouble(dr[_config.BottomHeader]);
            CurrentScreen.DepthToTop = Convert.ToDouble(dr[_config.TopHeader]);
            _wells.Add(IW);
              }
              _wellData.Dispose();
        }
Ejemplo n.º 2
0
        public Dictionary<string, IWell> WellsForNovana(bool Lithology, bool WaterLevel, bool Chemistry, bool OnlyRo)
        {
            string[] NotExtractionPurpose = new string[] { "A", "G", "I", "J", "L", "R", "U", "M", "P"};

              string[] ExtractionUse = new string[]{"C","V","VA","VD","VH","VI","VM","VP","VV"};
              string[] NotExtractionUse = new string[] { "A", "G", "I", "J", "L", "R", "U", "M", "P"};

              Dictionary<string, IWell> Wells = new Dictionary<string, IWell>();
              //Construct the data set
              if (WaterLevel)
              JXL.ReadWaterLevels(OnlyRo);

              if (Lithology)
            JXL.ReadInLithology();
              if (Chemistry)
            JXL.ReadInChemistrySamples();

            JXL.ReadWells(false, WaterLevel);

              JupiterWell CurrentWell;
              IIntake CurrentIntake;

              //Loop the wells
              foreach (var Boring in JXL.BOREHOLE)
              {
            CurrentWell = new JupiterWell(Boring.BOREHOLENO);
            Wells.Add(Boring.BOREHOLENO, CurrentWell);

            if (!Boring.IsXUTMNull())
            CurrentWell.X = Boring.XUTM;
              else //If no x set x to 0!
            CurrentWell.X = 0;

              if (!Boring.IsYUTMNull())
            CurrentWell.Y = Boring.YUTM;
              else
            CurrentWell.Y = 0;

              CurrentWell.Description = Boring.LOCATION;
              CurrentWell.Terrain = Boring.ELEVATION;

              CurrentWell.UsedForExtraction = true;

            //Hvis USE er noget andet end indvinding
              if (NotExtractionUse.Contains(Boring.USE.ToUpper()))
            CurrentWell.UsedForExtraction = false;

            //Hvis den er oprettet med et andet formål og USE ikke er sat til indvinding er det ikke en indvindingsboring
              if (NotExtractionPurpose.Contains(Boring.PURPOSE.ToUpper()) & !ExtractionUse.Contains(Boring.USE.ToUpper()))
            CurrentWell.UsedForExtraction = false;

              //Loop the lithology
              foreach (var Lith in Boring.GetLITHSAMPRows())
              {
            Lithology L = new Lithology();
            L.Bottom = Lith.BOTTOM;
            L.Top = Lith.TOP;
            L.RockSymbol = Lith.ROCKSYMBOL;
            L.RockType = Lith.ROCKTYPE;
            L.TotalDescription = Lith.TOTALDESCR;
            CurrentWell.LithSamples.Add(L);
              }

              //Reads in chemistry
              foreach (var Chem in Boring.GetGRWCHEMSAMPLERows())
              {
            foreach (var analysis in Chem.GetGRWCHEMANALYSISRows())
            {
              ChemistrySample C = new ChemistrySample();
              C.SampleDate = Chem.SAMPLEDATE;
              C.CompoundNo = analysis.COMPOUNDNO;
              C.Amount = analysis.AMOUNT;
              C.Unit = analysis.UNIT;
              C.CompoundName = JXL.COMPOUNDLIST.FindByCOMPOUNDNO(C.CompoundNo).LONG_TEXT;
              CurrentWell.ChemSamples.Add(C);
            }
              }

            //Loop the intakes
            foreach (var Intake in Boring.GetINTAKERows())
            {
              CurrentIntake = CurrentWell.AddNewIntake(Intake.INTAKENO);

              //Loop the screens. One intake can in special cases have multiple screens
              foreach (var ScreenData in Intake.GetSCREENRows())
              {
            Screen CurrentScreen = new Screen(CurrentIntake);
            CurrentScreen.DepthToTop = ScreenData.TOP;
            CurrentScreen.DepthToBottom = ScreenData.BOTTOM;
            CurrentScreen.Number = ScreenData.SCREENNO;
              }//Screen loop

              //Read in the water levels
              foreach (var WatLev in Intake.GetWATLEVELRows())
              {
            ((JupiterIntake)CurrentIntake).RefPoint = WatLev.REFPOINT;
            FillInWaterLevel(CurrentIntake, WatLev);
              }

            }//Intake loop

              }//Bore loop
              JXL.WATLEVEL.Clear();
              return Wells;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates wells from DataRows based on ShapeReaderConfiguration
        /// </summary>
        /// <param name="DS"></param>
        /// <param name="SRC"></param>
        public static void FillInFromNovanaShape(DataRow[] DS, ShapeReaderConfiguration SRC, Dictionary<string, IWell> Wells, Dictionary<int, Plant> Plants)
        {
            bool ReadPumpActivity = false;
              bool ReadPlants = false;
              bool ReadLayer = false;
              if (DS.First().Table.Columns.Contains(SRC.FraAArHeader) & DS.First().Table.Columns.Contains(SRC.TilAArHeader))
            ReadPumpActivity = true;

              if (DS.First().Table.Columns.Contains(SRC.LayerHeader))
            ReadLayer = true;

              if (Plants != null)
            if (DS.First().Table.Columns.Contains(SRC.PlantIDHeader))
              ReadPlants = true;

              IWell CurrentWell;
              IIntake CurrentIntake;
              foreach (DataRow DR in DS)
              {
            //Find the well in the dictionary
            if (!Wells.TryGetValue((string)DR[SRC.WellIDHeader], out CurrentWell))
            {
              //Add a new well if it was not found
              CurrentWell = new Well(DR[SRC.WellIDHeader].ToString());
              CurrentWell.UsedForExtraction = true;
              Wells.Add(CurrentWell.ID, CurrentWell);
            }

            int intakeno = Convert.ToInt32(DR[SRC.IntakeNumber]);

            CurrentIntake = CurrentWell.Intakes.FirstOrDefault(var => var.IDNumber == intakeno);

            if (CurrentIntake==null)
              CurrentIntake = CurrentWell.AddNewIntake(intakeno);

            if (ReadLayer)
              if (!Convert.IsDBNull(DR[SRC.LayerHeader]))
            CurrentIntake.Layer = Convert.ToInt32(DR[SRC.LayerHeader]);

            if (ReadPlants)
            {
              Plant CurrentPlant;
              int PlantID = Convert.ToInt32(DR[SRC.PlantIDHeader]);
              if (!Plants.TryGetValue(PlantID, out CurrentPlant))
              {
            CurrentPlant = new Plant(PlantID);
            Plants.Add(PlantID, CurrentPlant);
              }
              PumpingIntake CurrentPumpingIntake = new PumpingIntake(CurrentIntake);
              CurrentPlant.PumpingIntakes.Add(CurrentPumpingIntake);
              if (ReadPumpActivity)
              {
            CurrentPumpingIntake.Start = new DateTime(Convert.ToInt32(DR[SRC.FraAArHeader]), 1, 1);
            CurrentPumpingIntake.End = new DateTime(Convert.ToInt32(DR[SRC.TilAArHeader]), 12, 31);
              }
            }
            CurrentWell.X = Convert.ToDouble(DR[SRC.XHeader]);
            CurrentWell.Y = Convert.ToDouble(DR[SRC.YHeader]);
            CurrentWell.Terrain = Convert.ToDouble(DR[SRC.TerrainHeader]);
            Screen CurrentScreen = new Screen(CurrentIntake);
            CurrentScreen.BottomAsKote = Convert.ToDouble(DR[SRC.BOTTOMHeader]);
            CurrentScreen.TopAsKote = Convert.ToDouble(DR[SRC.TOPHeader]);
              }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Reads in all wells from a Jupiter database. 
        /// Only reads geographical information and location of Intakes and screen
        /// </summary>
        /// <param name="DataBaseFile"></param>
        public Dictionary<string, IWell> Wells()
        {
            Dictionary<string, IWell> Wells = new Dictionary<string, IWell>();
              //Construct the data set
              JXL.ReadWells(true, false);

              Well CurrentWell;
              IIntake CurrentIntake;

              //Loop the wells
              foreach (var Boring in JXL.BOREHOLE)
              {
            CurrentWell = new Well(Boring.BOREHOLENO);
            Wells.Add(CurrentWell.ID, CurrentWell);

            if (!Boring.IsXUTMNull())
              CurrentWell.X = Boring.XUTM;
            if (!Boring.IsYUTMNull())
              CurrentWell.Y = Boring.YUTM;

            CurrentWell.Description = Boring.LOCATION;
            if (!Boring.IsELEVATIONNull())
              CurrentWell.Terrain = Boring.ELEVATION;

            //Loop the intakes
            foreach (var IntakeData in Boring.GetINTAKERows())
            {
              CurrentIntake = CurrentWell.Intakes.FirstOrDefault(var => var.IDNumber == IntakeData.INTAKENO);
              if (CurrentIntake == null)
            CurrentIntake = CurrentWell.AddNewIntake(IntakeData.INTAKENO);

              //Loop the screens. One intake can in special cases have multiple screens
              foreach (var ScreenData in IntakeData.GetSCREENRows())
              {
              Screen CurrentScreen = new Screen(CurrentIntake);
              CurrentScreen.DepthToTop = ScreenData.TOP;
              CurrentScreen.DepthToBottom = ScreenData.BOTTOM;
              CurrentScreen.Number = ScreenData.SCREENNO;
              }//Screen loop
            }//Intake loop
              }//Bore loop

              return Wells;
        }