Example #1
0
 public SubSetFocusOn(Form2DModelStyle Style)
 {
     InitializeComponent();
 }
Example #2
0
 public void SetStyle(Form2DModelStyle style)
 {
     this.style = style;
     OnPaint();
 }
Example #3
0
        public void DrawWell(ECL.WELLDATA well, Font font, Brush brush, CoordConverter cordconv, Form2DModelStyle style, bool MoveMode)
        {
            PointF point = cordconv.ConvertWorldToScreen(well.XC, well.YC);

            // 100 m3 = 10 pt

            float  size = 0; // Размер круга
            float  wcut = 1; // Обводненность
            double wlpr = 0;

            Rectangle  bubble_rec      = new Rectangle(0, 0, 0, 0);
            RectangleF value_label_rec = new RectangleF(0, 0, 0, 0);
            Rectangle  point_rec       = new Rectangle(0, 0, 0, 0);

            if (style.BubbleMode == BubbleMode.Simulation)
            {
                size = (int)(Math.Abs(well.WLPR) * style.ScaleFactor * 0.01);
                if (size < min_bubble_size)
                {
                    size = min_bubble_size;
                }

                wcut = well.WLPR == 0 ? 0 : (float)(well.WWPR / well.WLPR);
                wlpr = well.WLPR;
            }

            if (style.BubbleMode == BubbleMode.Historical)
            {
                if (well.WLPR < 0)
                {
                    size = (int)(Math.Abs(well.WWPRH) * style.ScaleFactor * 0.01);
                    wlpr = Math.Abs(well.WWPRH);
                    wcut = 1;
                }
                else
                {
                    size = (int)(Math.Abs(well.WLPRH) * style.ScaleFactor * 0.01);
                    wcut = well.WLPRH == 0 ? 0 : (float)(well.WWPRH / well.WLPRH);
                    wlpr = well.WLPRH;
                }

                if (size < min_bubble_size)
                {
                    size = min_bubble_size;
                }
            }

            // Добывающие скважины

            if (well.WLPR >= 0)
            {
                if (style.ShowBubbles && !MoveMode)
                {
                    Point bubble_centr = new Point((int)(point.X - size / 2), (int)(point.Y - size / 2));
                    bubble_rec = new Rectangle(bubble_centr, new Size((int)size, (int)size));

                    gfx.DrawEllipse(new Pen(Color.Black, pen_bubble_width), bubble_rec);
                    gfx.FillPie(Brushes.BurlyWood, bubble_rec, 0, (float)Math.Round(360.0 * (1 - wcut)));
                    gfx.FillPie(Brushes.SteelBlue, bubble_rec, (float)Math.Round(360.0 * (1 - wcut)), 360 - (float)Math.Round(360.0 * (1 - wcut)));
                }


                Point  value_label_point = new Point((int)(point.X + value_label_pos_x), (int)(point.Y + value_label_pos_y));
                string value_label_text  = wlpr.ToString("N1") + " / " + (100 * wcut).ToString("N1");
                SizeF  label_size_text   = gfx.MeasureString(value_label_text, InfoFont);
                value_label_rec = new RectangleF(value_label_point, label_size_text);
                gfx.DrawString(value_label_text, InfoFont, brush, value_label_point);
            }

            // Нагнетательные скважины

            if (well.WLPR < 0) // Меньше нуля, это у нас закачка
            {
                if (style.ShowBubbles && !MoveMode)
                {
                    Point bubble_centr = new Point((int)(point.X - size / 2), (int)(point.Y - size / 2));
                    bubble_rec = new Rectangle(bubble_centr, new Size((int)size, (int)size));
                    gfx.DrawEllipse(new Pen(Color.Black, pen_bubble_width), bubble_rec);
                    gfx.FillPie(Brushes.LightBlue, bubble_rec, 0, 360);
                }

                wlpr = Math.Abs(wlpr);

                Point  value_label_point = new Point((int)(point.X + value_label_pos_x), (int)(point.Y + value_label_pos_y));
                string value_label_text  = wlpr.ToString("N1") + " / " + (100 * wcut).ToString("N1");
                SizeF  label_size_text   = gfx.MeasureString(value_label_text, InfoFont);
                value_label_rec = new RectangleF(value_label_point, label_size_text);
                gfx.DrawString(value_label_text, InfoFont, brush, value_label_point);
            }

            if (!MoveMode)
            {
                Point well_point = new Point((int)(point.X) - 4, (int)(point.Y) - 4);
                point_rec = new Rectangle(well_point, new Size(8, 8));
                gfx.FillEllipse(Brushes.White, point_rec);
                gfx.DrawEllipse(Pens.Black, point_rec);
            }

            SizeF  size_wellname_text = gfx.MeasureString(well.WELLNAME, font);
            PointF well_name_point    = new PointF(point.X + label_pos_x, point.Y + label_pos_y);

            gfx.DrawString(well.WELLNAME, font, brush, well_name_point);


            // Подготовка активного прямоугольника для обновления текстуры

            RectangleF rec = new RectangleF(well_name_point, size_wellname_text);

            if (value_label_rec.Width > 0 && value_label_rec.Height > 0)
            {
                rec = RectangleF.Union(rec, value_label_rec);
            }

            if (style.ShowBubbles && !MoveMode)
            {
                if (bubble_rec.Width > 0 && bubble_rec.Height > 0)
                {
                    rec = RectangleF.Union(rec, bubble_rec);
                }
            }

            if (!MoveMode)
            {
                if (point_rec.Width > 0 && point_rec.Height > 0)
                {
                    rec = RectangleF.Union(rec, point_rec);
                }
            }

            if (rec.X > 2)
            {
                rec.X     += -2;
                rec.Width += 4;
            }

            if (rec.Y > 2)
            {
                rec.Y      += -2;
                rec.Height += 4;
            }

            rec = RectangleF.Intersect(rec, new Rectangle(0, 0, bmp.Width, bmp.Height));

            dirty_region = Rectangle.Round(rec);

            //dirty_region = new Rectangle(0, 0, bmp.Width, bmp.Height);

            //dirty_region = Rectangle.Round(RectangleF.Union(dirty_region, new RectangleF(point, size_text)));
            //dirty_region = Rectangle.Intersect(dirty_region, new Rectangle(0, 0, bmp.Width, bmp.Height));


            //gfx.DrawRectangle(Pens.Black, Rectangle.Round(rec));

            if (dirty_region.Height > 0 && dirty_region.Width > 0)
            {
                UploadBitmap();
            }
        }
Example #4
0
        public Sub2DOptions(Form2DModelStyle Style)
        {
            InitializeComponent();

            this.Style = Style;

            plotModel = new PlotModel
            {
                Title           = "(No keyword)",
                DefaultFont     = "Tahoma",
                TitleFontWeight = 2,
                TitleFontSize   = 10,
                DefaultFontSize = 10
            };

            plotModel.Axes.Add(new OxyPlot.Axes.CategoryAxis
            {
                Position     = AxisPosition.Bottom,
                Title        = "Value",
                StringFormat = "N2",
                Angle        = -90
            });


            plotModel.Axes.Add(new OxyPlot.Axes.LinearAxis
            {
                Position        = OxyPlot.Axes.AxisPosition.Left,
                Title           = "Cell count",
                AbsoluteMinimum = 0
            });

            plotView.Model = plotModel;

            UpdateMode = true;

            checkShowGridLines.Checked = Style.ShowGridLines;
            checkShowBubbles.Checked   = Style.ShowBubbles;
            checkNoFillColor.Checked   = Style.ShowNoFillColor;

            boxBubbleMode.SelectedIndex = 0;
            numericScaleFactor.Value    = (decimal)Style.ScaleFactor;
            numericZScale.Value         = (decimal)Style.ZScale;

            boxMinimum.Text = Style.MinValue.ToString();
            boxMaximum.Text = Style.MaxValue.ToString();

            switch (Style.BubbleMode)
            {
            case BubbleMode.Simulation:
                boxBubbleMode.SelectedIndex = 0;
                break;

            case BubbleMode.Historical:
                boxBubbleMode.SelectedIndex = 1;
                break;

            default:
                break;
            }

            UpdateMode = false;
        }
Example #5
0
 public SubMainFiltered(Form2DModelStyle Style)
 {
     InitializeComponent();
 }