|
@@ -6,10 +6,12 @@ using System.Drawing.Imaging;
|
|
|
using System.Globalization;
|
|
|
using System.IO;
|
|
|
using System.Linq;
|
|
|
+using System.Reflection.Emit;
|
|
|
using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
|
using System.Windows.Input;
|
|
|
using System.Windows.Media;
|
|
|
+using System.Windows.Media.Animation;
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
|
namespace Venus_Themes.UserControls
|
|
@@ -31,7 +33,7 @@ namespace Venus_Themes.UserControls
|
|
|
private double m_StartDrawLineX = 0;
|
|
|
|
|
|
private System.Drawing.Brush m_BrushText = System.Drawing.Brushes.Black;
|
|
|
- private System.Drawing.Brush m_BrushXYText = System.Drawing.Brushes.Blue;
|
|
|
+ private System.Drawing.Brush m_BrushXYText = System.Drawing.Brushes.DarkRed;
|
|
|
private System.Drawing.Pen m_PenLine;
|
|
|
private System.Drawing.Pen m_PenLightGray;
|
|
|
private System.Drawing.Pen m_PenBlue;
|
|
@@ -47,6 +49,8 @@ namespace Venus_Themes.UserControls
|
|
|
private System.Windows.Point m_EndPoint;
|
|
|
private System.Windows.Point m_CurrentPoint;
|
|
|
|
|
|
+ private float LineThickness = 2.0f;
|
|
|
+
|
|
|
#region Property
|
|
|
public PointCollection PlotDataPoints
|
|
|
{
|
|
@@ -173,22 +177,22 @@ namespace Venus_Themes.UserControls
|
|
|
m_PenASData = new System.Drawing.Pen(System.Drawing.Brushes.Red, 1);
|
|
|
m_PenCollencteions = new System.Drawing.Pen[]
|
|
|
{
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.Green,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.Red,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.Blue,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.Orange,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.Yellow,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.YellowGreen,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.AliceBlue,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.Chocolate,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.Cyan,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.DarkGreen,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.LightBlue,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.DarkBlue,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.Pink,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.DarkViolet,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.Cyan,1),
|
|
|
- new System.Drawing.Pen(System.Drawing.Brushes.HotPink,1),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.Green,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.Red,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.Blue,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.Orange,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.Yellow,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.YellowGreen,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.AliceBlue,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.Chocolate,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.Cyan,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.DarkGreen,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.LightBlue,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.DarkBlue,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.Pink,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.DarkViolet,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.Cyan,LineThickness),
|
|
|
+ new System.Drawing.Pen(System.Drawing.Brushes.HotPink,LineThickness),
|
|
|
};
|
|
|
|
|
|
IsHorizontalNavigationEnabled = false;
|
|
@@ -217,8 +221,9 @@ namespace Venus_Themes.UserControls
|
|
|
{
|
|
|
m_WavePlotX = m_WavePlotMinX;
|
|
|
m_WavePlotWidth = m_WavePlotMaxX - m_WavePlotMinX;
|
|
|
- m_WavePlotY = m_WavePlotMinY;
|
|
|
- m_WavePlotHeight = m_WavePlotMaxY - m_WavePlotMinY;
|
|
|
+
|
|
|
+ m_WavePlotY = m_WavePlotMinY-1000;
|
|
|
+ m_WavePlotHeight = (m_WavePlotMaxY - m_WavePlotMinY)+2000;
|
|
|
GraphicDraw();
|
|
|
}
|
|
|
}
|
|
@@ -643,18 +648,18 @@ namespace Venus_Themes.UserControls
|
|
|
{
|
|
|
double X = m_WavePlotX + (m_CurrentPoint.X - m_StartDrawLineX) / ((this.ActualWidth - m_StartDrawLineX) / m_WavePlotWidth);
|
|
|
double Y = m_WavePlotY + (this.ActualHeight - 50 - m_CurrentPoint.Y) / ((this.ActualHeight - 50) / m_WavePlotHeight);
|
|
|
- if (this.PointCollections == null || this.PointCollections.Count <= 1)
|
|
|
+ if (this.PointCollections == null || this.PointCollections.Count <= 10)
|
|
|
{
|
|
|
graphics.DrawLine(m_PenBlue, new System.Drawing.PointF((float)m_StartDrawLineX, (float)m_CurrentPoint.Y), new PointF((float)Canvas_Main.ActualWidth, (float)m_CurrentPoint.Y));
|
|
|
graphics.DrawLine(m_PenBlue, new System.Drawing.PointF((float)m_CurrentPoint.X, 0), new PointF((float)m_CurrentPoint.X, (float)Canvas_Main.ActualHeight - 50));
|
|
|
- if (IsHorizontalDateTimeAxis)
|
|
|
- {
|
|
|
- graphics.DrawString(string.Format("X={0};Y={1}", DateTime.FromOADate(X), Y.ToString("0.00")), System.Drawing.SystemFonts.DefaultFont, m_BrushXYText, new PointF((float)m_CurrentPoint.X + 10, (float)m_CurrentPoint.Y + 10));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- graphics.DrawString(string.Format("X={0};Y={1}", X.ToString("0.00"), Y.ToString("0.00")), System.Drawing.SystemFonts.DefaultFont, m_BrushXYText, new PointF((float)m_CurrentPoint.X + 10, (float)m_CurrentPoint.Y + 10));
|
|
|
- }
|
|
|
+ //if (IsHorizontalDateTimeAxis)
|
|
|
+ //{
|
|
|
+ // graphics.DrawString(string.Format("X={0};Y={1}", DateTime.FromOADate(X), Y.ToString("0.00")), System.Drawing.SystemFonts.DefaultFont, m_BrushXYText, new PointF((float)m_CurrentPoint.X + 10, (float)m_CurrentPoint.Y + 10));
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // graphics.DrawString(string.Format("X={0};Y={1}", X.ToString("0.00"), Y.ToString("0.00")), System.Drawing.SystemFonts.DefaultFont, m_BrushXYText, new PointF((float)m_CurrentPoint.X + 10, (float)m_CurrentPoint.Y + 10));
|
|
|
+ //}
|
|
|
}
|
|
|
//
|
|
|
if (this.PlotDataPoints != null && this.PlotDataPoints.Count > 0)
|
|
@@ -745,7 +750,7 @@ namespace Venus_Themes.UserControls
|
|
|
}
|
|
|
}
|
|
|
//
|
|
|
- if (this.PointCollections != null && this.PointCollections.Count <= 1)
|
|
|
+ if (this.PointCollections != null && this.PointCollections.Count <= 10)
|
|
|
{
|
|
|
foreach (PointCollection point in this.PointCollections)
|
|
|
{
|
|
@@ -770,11 +775,11 @@ namespace Venus_Themes.UserControls
|
|
|
graphics.DrawEllipse(m_PenBlue, rectangle);
|
|
|
if (IsHorizontalDateTimeAxis)
|
|
|
{
|
|
|
- graphics.DrawString(string.Format("X={0};Y={1}", DateTime.FromOADate(point[index].X), point[index].Y.ToString("0.00")), System.Drawing.SystemFonts.DefaultFont, m_BrushXYText, new PointF((float)StartX + 10, (float)StartY + 10));
|
|
|
+ graphics.DrawString(string.Format("X={0};Y={1}", DateTime.FromOADate(point[index].X), point[index].Y.ToString("0.00")), new Font("Times New Roman", 15.0F), m_BrushXYText, new PointF((float)StartX + 10, (float)StartY + 10));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- graphics.DrawString(string.Format("X={0};Y={1}", point[index].X.ToString("0.00"), point[index].Y.ToString("0.00")), System.Drawing.SystemFonts.DefaultFont, m_BrushXYText, new PointF((float)StartX + 10, (float)StartY + 10));
|
|
|
+ graphics.DrawString(string.Format("X={0};Y={1}", point[index].X.ToString("0.00"), point[index].Y.ToString("0.00")), new Font("Times New Roman", 15.0F), m_BrushXYText, new PointF((float)StartX + 10, (float)StartY + 10));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -825,6 +830,7 @@ namespace Venus_Themes.UserControls
|
|
|
|
|
|
private void Canvas_Main_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
|
|
{
|
|
|
+ this.Cursor = Cursors.Hand;
|
|
|
if (e.ClickCount == 2)
|
|
|
{
|
|
|
FitControl();
|
|
@@ -855,7 +861,7 @@ namespace Venus_Themes.UserControls
|
|
|
m_StartPoint = m_EndPoint;
|
|
|
GraphicDraw();
|
|
|
}
|
|
|
- else if (this.PointCollections == null || this.PointCollections.Count <= 1)
|
|
|
+ else if (this.PointCollections == null || this.PointCollections.Count <= 10)
|
|
|
{
|
|
|
GraphicDraw();
|
|
|
}
|
|
@@ -863,6 +869,7 @@ namespace Venus_Themes.UserControls
|
|
|
|
|
|
private void Canvas_Main_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
|
|
{
|
|
|
+ this.Cursor = Cursors.Arrow;
|
|
|
if (m_StartMouseMove && m_MouseMove && e.LeftButton == MouseButtonState.Released)
|
|
|
{
|
|
|
m_StartMouseMove = false;
|
|
@@ -885,7 +892,7 @@ namespace Venus_Themes.UserControls
|
|
|
|
|
|
private void Canvas_Main_MouseEnter(object sender, MouseEventArgs e)
|
|
|
{
|
|
|
- if (this.PointCollections == null || this.PointCollections.Count <= 1)
|
|
|
+ if (this.PointCollections == null || this.PointCollections.Count <= 10)
|
|
|
{
|
|
|
m_MouseEnter = true;
|
|
|
}
|
|
@@ -893,7 +900,7 @@ namespace Venus_Themes.UserControls
|
|
|
|
|
|
private void Canvas_Main_MouseLeave(object sender, MouseEventArgs e)
|
|
|
{
|
|
|
- if (this.PointCollections == null || this.PointCollections.Count <= 1) m_MouseEnter = false;
|
|
|
+ if (this.PointCollections == null || this.PointCollections.Count <= 10) m_MouseEnter = false;
|
|
|
GraphicDraw();
|
|
|
}
|
|
|
|