Ejemplo n.º 1
0
        public static List <Visual3D> Representation3D(this JupiterWell Well, IXYPoint refpoint)
        {
            List <Visual3D> wellrep = new List <Visual3D>();

            double x = refpoint.X - Well.X;
            double y = refpoint.Y - Well.Y;

            TruncatedConeVisual3D tcvw = new TruncatedConeVisual3D();

            tcvw.TopRadius  = 0.5;
            tcvw.BaseRadius = 0.5;
            tcvw.Origin     = new System.Windows.Media.Media3D.Point3D(x, y, Well.Terrain - Well.Depth.Value);
            if (Well.Depth.HasValue)
            {
                tcvw.Height = Well.Depth.Value;
            }
            else if (Well.Intakes.SelectMany(var => var.Screens).Count() > 0)
            {
                tcvw.Height = Well.Intakes.SelectMany(var => var.Screens).Max(var2 => var2.DepthToBottom.Value);
            }
            else
            {
                tcvw.Height = Well.LithSamples.Max(var => var.Bottom);
            }

            tcvw.Fill = new SolidColorBrush(Colors.Gray);
            wellrep.Add(tcvw);


            foreach (var sc in Well.Intakes.SelectMany(var => var.Screens))
            {
                if (sc.DepthToBottom.HasValue & sc.DepthToTop.HasValue)
                {
                    TruncatedConeVisual3D tcv = new TruncatedConeVisual3D();
                    tcv.TopRadius  = 0.7;
                    tcv.BaseRadius = 0.7;
                    tcv.Origin     = new System.Windows.Media.Media3D.Point3D(x, y, sc.BottomAsKote.Value);
                    tcv.Height     = sc.TopAsKote.Value - sc.BottomAsKote.Value;
                    tcv.Fill       = new SolidColorBrush(Colors.Black);
                    wellrep.Add(tcv);
                }
            }

            foreach (var l in Well.LithSamples)
            {
                if (l.Top != -999 & l.Bottom != -999)
                {
                    TruncatedConeVisual3D tcv = new TruncatedConeVisual3D();
                    tcv.TopRadius  = 1;
                    tcv.BaseRadius = 1;
                    tcv.Origin     = new System.Windows.Media.Media3D.Point3D(x, y, Well.Terrain - l.Bottom);
                    tcv.Height     = l.Bottom - l.Top;
                    SolidColorBrush m;
                    if (l.RockSymbol.ToLower().Contains("s"))
                    {
                        m = new SolidColorBrush(Colors.Blue);
                    }
                    else if (l.RockSymbol.ToLower().Contains("l"))
                    {
                        m = new SolidColorBrush(Colors.Red);
                    }
                    else
                    {
                        m = new SolidColorBrush(Colors.Green);
                    }

                    m.Opacity = 0.3;
                    tcv.Fill  = m;

                    wellrep.Add(tcv);
                    TextVisual3D txt = new TextVisual3D();
                    txt.Center = new Point3D(x + 3, y + 3, Well.Terrain - (l.Bottom + l.Top) / 2.0);
                    txt.Text   = l.RockSymbol;
                    txt.Height = 1;
                    wellrep.Add(txt);
                }
            }
            return(wellrep);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Fills the data row with entries common for Intake and Extractions.
        /// </summary>
        /// <param name="CurrentIntake"></param>
        private static void AddCommonDataForNovana(JupiterIntake CurrentIntake)
        {
            JupiterWell CurrentWell = CurrentIntake.well as JupiterWell;

            ShapeOutputTables.IntakeCommonRow CurrentRow = (ShapeOutputTables.IntakeCommonRow)CurrentIntake.Data;

            CurrentWell = (JupiterWell)CurrentIntake.well;

            CurrentRow.NOVANAID = CurrentWell.ID.Replace(" ", "") + "_" + CurrentIntake.IDNumber;

            CurrentRow.XUTM = CurrentWell.X;
            CurrentRow.YUTM = CurrentWell.Y;


            CurrentRow.JUPKOTE    = CurrentWell.Terrain;
            CurrentRow.BOREHOLENO = CurrentWell.ID;
            CurrentRow.INTAKENO   = CurrentIntake.IDNumber;
            CurrentRow.LOCATION   = CurrentWell.Description;

            CurrentRow.ANTINT_B = CurrentWell.Intakes.Count();


            if (CurrentWell.EndDate.HasValue)
            {
                CurrentRow.DRILENDATE = CurrentWell.EndDate.Value;
            }

            if (CurrentWell.Depth.HasValue)
            {
                CurrentRow.DRILLDEPTH = CurrentWell.Depth.Value;
            }


            if (CurrentIntake.Depth.HasValue)
            {
                CurrentRow.CASIBOT = CurrentIntake.Depth.Value;
            }

            CurrentRow.PURPOSE   = CurrentWell.Purpose;
            CurrentRow.USE       = CurrentWell.Use;
            CurrentRow.INTAKETOP = -999;
            CurrentRow.INTAKEBOT = -999;

            if (CurrentIntake.Screens.Count != 0)
            {
                if (CurrentIntake.Screens.Where(var1 => var1.DepthToTop.HasValue).Count() != 0)
                {
                    CurrentRow.INTAKETOP = CurrentIntake.Screens.Where(var1 => var1.DepthToTop.HasValue).Min(var => var.DepthToTop.Value);
                }

                if (CurrentIntake.Screens.Where(var1 => var1.DepthToBottom.HasValue).Count() != 0)
                {
                    CurrentRow.INTAKEBOT = CurrentIntake.Screens.Where(var1 => var1.DepthToBottom.HasValue).Max(var => var.DepthToBottom.Value);
                }
            }

            CurrentRow.INTAKTOPK = -999;
            CurrentRow.INTAKBOTK = -999;

            if (CurrentRow.JUPKOTE != -999)
            {
                if (CurrentRow.INTAKETOP != -999)
                {
                    CurrentRow.INTAKTOPK = CurrentRow.JUPKOTE - CurrentRow.INTAKETOP;
                }
                if (CurrentRow.INTAKEBOT != -999)
                {
                    CurrentRow.INTAKBOTK = CurrentRow.JUPKOTE - CurrentRow.INTAKEBOT;
                }
            }



            CurrentRow.RESROCK = "-999";
            CurrentRow.RESROCK = CurrentIntake.ResRock;

            CurrentRow.SUMSAND = -999;
            CurrentRow.BOTROCK = "-999";


            if (CurrentWell.LithSamples.Count != 0 & CurrentIntake.Screens.Count != 0)
            {
                CurrentWell.LithSamples.Sort();
                CurrentRow.BOTROCK = CurrentWell.LithSamples[CurrentWell.LithSamples.Count - 1].RockSymbol;
                Dictionary <string, double> SoilLengths = new Dictionary <string, double>();

                double ScreenLength = 0;

                //Now build information about reservoir rock in front of screen
                //Loop all screens
                foreach (Screen SC in CurrentIntake.Screens)
                {
                    //Do not use dummy values
                    if (SC.DepthToBottom.HasValue & SC.DepthToTop.HasValue)
                    {
                        ScreenLength += SC.DepthToBottom.Value - SC.DepthToTop.Value;

                        //Get the samples that are within the filter
                        var sampleswithinFilter = CurrentWell.LithSamples.Where(var => var.Top <SC.DepthToBottom& var.Bottom> SC.DepthToTop);

                        //Now calculate the percentages
                        foreach (Lithology L in sampleswithinFilter)
                        {
                            double percent = (Math.Min(SC.DepthToBottom.Value, L.Bottom) - Math.Max(SC.DepthToTop.Value, L.Top));
                            if (SoilLengths.ContainsKey(L.RockSymbol))
                            {
                                SoilLengths[L.RockSymbol] += percent;
                            }
                            else
                            {
                                SoilLengths.Add(L.RockSymbol, percent);
                            }
                        }
                    }
                }

                if (SoilLengths.Count != 0)
                {
                    double   sumsand   = 0;
                    string[] magasiner = new string[] { "s", "k", "g" };
                    //Build the resrock string
                    StringBuilder resrock = new StringBuilder();
                    foreach (KeyValuePair <string, double> KVP in SoilLengths)
                    {
                        double percent = KVP.Value / ScreenLength * 100;
                        resrock.Append(KVP.Key + ": " + percent.ToString("###") + "% ");
                        if (magasiner.Contains(KVP.Key.ToLower()))
                        {
                            sumsand += percent;
                        }
                        if (KVP.Key.Length >= 2 && magasiner.Contains(KVP.Key.Substring(1, 1).ToLower()))
                        {
                            sumsand += percent;
                        }
                    }
                    CurrentRow.RESROCK = resrock.ToString();
                    CurrentRow.SUMSAND = sumsand;
                }
            }
        }