private void drawLine(string sjh, string yjh, double data, Color color) { if (!wells.TryGetValue(sjh, out _) || !wells.TryGetValue(yjh, out _)) { return; } Line line = new Line { Stroke = new SolidColorBrush(color), StrokeThickness = Math.Abs(data) * lineWidth }; if (data < 0) { line.StrokeDashArray = new DoubleCollection() { 2, 4 } } ; Well_ZB well_sj = wells[sjh]; Well_ZB well_yj = wells[yjh]; line.X1 = well_sj.ZB_X - X_min + 20; line.Y1 = well_sj.ZB_Y - Y_min + 10; line.X2 = well_yj.ZB_X - X_min + 20; line.Y2 = well_yj.ZB_Y - Y_min + 10; line.ToolTip = data; myConvas.Children.Add(line); Label lb = new Label { FontSize = 8, Content = data }; Canvas.SetLeft(lb, (well_sj.ZB_X + well_yj.ZB_X) / 2 - X_min); Canvas.SetTop(lb, (well_sj.ZB_Y + well_yj.ZB_Y) / 2 - Y_min); this.myConvas.Children.Add(lb); }
private void addWell(string jh) { if (wells.ContainsKey(jh)) { return; } DataRow[] drs = wellLocation.Select(string.Format("JH = '{0}'", jh)); if (drs.Length == 0) { return; } Well_ZB well = new Well_ZB(); well.JH = jh; well.ZB_X = Convert.ToDouble(drs[0]["ZB_X"]); well.ZB_Y = Convert.ToDouble(drs[0]["ZB_Y"]); //wells.Add(well); wells.Add(jh, well); }
private void drawPoint(string jh, string type) { if (!wells.TryGetValue(jh, out _)) { return; } Well_ZB well = wells[jh]; Ellipse el = new Ellipse(); if (type == "SJ") { el.Fill = new SolidColorBrush(Color.FromRgb(0, 0, 0xff)); } else { el.Fill = Brushes.Black; } el.Width = 10; el.Height = 10; el.ToolTip = jh; double temp_x = Math.Round(well.ZB_X - X_min, 2); Canvas.SetLeft(el, temp_x + 15); double temp_y = Math.Round(well.ZB_Y - Y_min, 2); Canvas.SetTop(el, temp_y + 5); this.myConvas.Children.Add(el); Label name = new Label(); name.FontSize = 8; name.Content = jh; //name.Foreground = System.Windows.Media.Brushes.SlateGray; Canvas.SetLeft(name, temp_x); Canvas.SetTop(name, temp_y + 10); this.myConvas.Children.Add(name); }