|
@@ -48,8 +48,10 @@ namespace OTSIncAReportGraph.Controls
|
|
|
float m_i_draw_start = 0; //整个界面绘制的起始点
|
|
|
float m_i_draw_end = 1004; //整个界面绘制的边界
|
|
|
|
|
|
+ float m_Y_draw_end = 220; //整个界面绘制的边界高
|
|
|
float m_Y_draw_TopDiff = 15; //Y轴距离顶部距离
|
|
|
float m_Y_MaxValue = 0; //Y轴显示的最大刻度长度
|
|
|
+ uint m_Y_Value = 50; //Y轴大刻度包含像素数
|
|
|
|
|
|
float m_i_rightdrawlabellocation_x = 850; //右上角要显示文字的位置
|
|
|
float m_i_rightdrawlabellocation_y = 5; //右上角要显示文字的位置
|
|
@@ -164,6 +166,22 @@ namespace OTSIncAReportGraph.Controls
|
|
|
public Control_XRayTable()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
+ pictureBox1.Visible = false;
|
|
|
+ pictureBox2.Visible = false;
|
|
|
+ m_i_draw_start += 25;
|
|
|
+ }
|
|
|
+ public Control_XRayTable(Bitmap a_bitmap)
|
|
|
+ {
|
|
|
+ InitializeComponent();
|
|
|
+ pictureBox1.Visible = true;
|
|
|
+ pictureBox2.Visible = true;
|
|
|
+ m_i_draw_start += pictureBox1.Width+pictureBox2.Width+25;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void SetBitmapOfPictureBox(Bitmap a_bitmap1, Bitmap a_bitmap2)
|
|
|
+ {
|
|
|
+ pictureBox1.Image = a_bitmap1;
|
|
|
+ pictureBox2.Image = a_bitmap2;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -190,8 +208,9 @@ namespace OTSIncAReportGraph.Controls
|
|
|
{
|
|
|
//重新加载时,对当前的宽度等重新加载并计算
|
|
|
m_i_draw_end = this.Width;
|
|
|
- m_i_smalkd = (m_i_draw_end - 4) / m_i_smallkd_number;//按宽度重新计算小刻度的长度 -4是有4像素的边框差
|
|
|
- m_i_bigkd = (m_i_draw_end - 4) / m_i_bigkd_number; //按宽度重新计算大刻度的长度
|
|
|
+ m_Y_draw_end = this.Height;
|
|
|
+ m_i_smalkd = (m_i_draw_end- m_i_draw_start - 4) / m_i_smallkd_number;//按宽度重新计算小刻度的长度 -4是有4像素的边框差
|
|
|
+ m_i_bigkd = (m_i_draw_end- m_i_draw_start - 4) / m_i_bigkd_number; //按宽度重新计算大刻度的长度
|
|
|
|
|
|
|
|
|
#region 重新初始化相关全局变量
|
|
@@ -272,7 +291,7 @@ namespace OTSIncAReportGraph.Controls
|
|
|
|
|
|
double ls_width = m_i_draw_end;//改成固定值,整个绘制浪线的总长
|
|
|
double ls_cs = 2000;
|
|
|
- m_f_zl = (float)(ls_width / ls_cs);
|
|
|
+ m_f_zl = (float)((ls_width- m_i_draw_start) / ls_cs);
|
|
|
|
|
|
//计算KML峰值判定的上标值与下标值
|
|
|
GetKMLFPD_MAXANDMIN(m_analysis_xray);
|
|
@@ -447,16 +466,19 @@ namespace OTSIncAReportGraph.Controls
|
|
|
/// </summary>
|
|
|
/// <param name="g"></param>
|
|
|
protected void DrawXrayImage(Graphics g)
|
|
|
- {
|
|
|
+ {
|
|
|
|
|
|
#region //绘制标尺表盘部份----------------------------------------------------------------------------------------------
|
|
|
-
|
|
|
+
|
|
|
//宽度比的缩放基数
|
|
|
float f_js_width = 1;//经过考虑,先定为1,为固定的像素进行绘制
|
|
|
|
|
|
+
|
|
|
#region 绘制下面的标尺
|
|
|
//x轴标尺的线
|
|
|
g.DrawLine(m_this_p, m_i_draw_start, m_f_rulerX_location, m_i_draw_end * f_js_width, m_f_rulerX_location);
|
|
|
+ //y轴标尺的线
|
|
|
+ g.DrawLine(m_this_p, m_i_draw_start, m_f_rulerX_location, m_i_draw_start, -m_Y_draw_end+ m_Y_draw_TopDiff+ m_f_rulerX_location+20);
|
|
|
|
|
|
//200个小刻度
|
|
|
for (int i = 0; i < m_i_smallkd_number; i++)
|
|
@@ -476,6 +498,18 @@ namespace OTSIncAReportGraph.Controls
|
|
|
g.DrawString((i_count - 1).ToString(), m_thisfont_bold, m_this_sb, m_i_draw_start + (i * m_i_bigkd * f_js_width) + 1, m_f_rulerX_location + 10);
|
|
|
}
|
|
|
}
|
|
|
+ int m_Y_Value_Count = (int)Math.Floor(m_xraytopixel_multiple * 150 / 25);
|
|
|
+ m_Y_Value = (uint)(m_Y_Value_Count/4) * 25;
|
|
|
+ //纵坐标
|
|
|
+ for (int i = 0; i < 30; i++)
|
|
|
+ {
|
|
|
+ if (i * m_Y_Value <= m_xraytopixel_multiple*150)
|
|
|
+ {
|
|
|
+ g.DrawLine(m_this_p, m_i_draw_start, m_f_rulerX_location - (i * GetValueByRatio(m_Y_Value) * f_js_width), m_i_draw_start + 3, m_f_rulerX_location - (i * GetValueByRatio(m_Y_Value) * f_js_width));
|
|
|
+ int aa = i * Convert.ToInt16(m_Y_Value);
|
|
|
+ g.DrawString(aa.ToString(), m_thisfont_bold, m_this_sb, m_i_draw_start - 10 - ((aa.ToString().Length - 1) * 6), m_f_rulerX_location - (i * GetValueByRatio(m_Y_Value) * f_js_width) - 7);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//补充输入文字,为了美观
|
|
|
//g.DrawString("kv", m_thisfont_bold, m_this_sb, 8, m_f_rulerX_location + 10);
|
|
@@ -498,9 +532,9 @@ namespace OTSIncAReportGraph.Controls
|
|
|
for (int i = 0; i < m_list_twopoint1.Count(); i++)
|
|
|
{
|
|
|
PointF ls_pf1 = m_list_twopoint1[i].pf1;
|
|
|
- ls_pf1.X = ls_pf1.X * f_js_width;
|
|
|
+ ls_pf1.X = ls_pf1.X * f_js_width+ m_i_draw_start;
|
|
|
PointF ls_pf2 = m_list_twopoint1[i].pf2;
|
|
|
- ls_pf2.X = ls_pf2.X * f_js_width;
|
|
|
+ ls_pf2.X = ls_pf2.X * f_js_width+ m_i_draw_start;
|
|
|
|
|
|
g.DrawLine(m_this_p, ls_pf1, ls_pf2);
|
|
|
|
|
@@ -514,9 +548,9 @@ namespace OTSIncAReportGraph.Controls
|
|
|
for (int i = 0; i < m_list_twopoint2.Count(); i++)
|
|
|
{
|
|
|
PointF ls_pf1_2 = m_list_twopoint2[i].pf1;
|
|
|
- ls_pf1_2.X = ls_pf1_2.X * f_js_width;
|
|
|
+ ls_pf1_2.X = (ls_pf1_2.X) * f_js_width+ m_i_draw_start ;
|
|
|
PointF ls_pf2_2 = m_list_twopoint2[i].pf2;
|
|
|
- ls_pf2_2.X = ls_pf2_2.X * f_js_width;
|
|
|
+ ls_pf2_2.X = (ls_pf2_2.X) * f_js_width+ m_i_draw_start ;
|
|
|
|
|
|
g.DrawLine(m_this_p_blue, ls_pf1_2, ls_pf2_2);
|
|
|
|
|
@@ -545,28 +579,28 @@ namespace OTSIncAReportGraph.Controls
|
|
|
//先把峰值上的文字去掉,因为这里与底层分析出的结果不太一致,为了不产生疑问所以这里去掉
|
|
|
|
|
|
//绘制竖线
|
|
|
- g.DrawLine(new Pen(Color.Wheat, 0.5f), f_js_width * (m_list_kmlfpoint[i].kml_x * (m_i_draw_end / 20)), m_f_rulerX_location / 3 + i_py, f_js_width * (m_list_kmlfpoint[i].kml_x * (m_i_draw_end / 20)), m_f_rulerX_location - 3);
|
|
|
+ g.DrawLine(new Pen(Color.Wheat, 0.5f), f_js_width * (m_list_kmlfpoint[i].kml_x * ((m_i_draw_end- m_i_draw_start) / 20)) + m_i_draw_start, m_f_rulerX_location / 3 + i_py, f_js_width * (m_list_kmlfpoint[i].kml_x * ((m_i_draw_end - m_i_draw_start) / 20) + m_i_draw_start), m_f_rulerX_location - 3);
|
|
|
//输出文字,并将字输出到线的上面
|
|
|
SizeF out_testsizef = g.MeasureString(m_list_kmlfpoint[i].ysm, m_thisfont);
|
|
|
PointF ut_test_pointF = new PointF(m_mouse_point.X - (out_testsizef.Width / 2), 2);
|
|
|
- g.FillRectangle(Brushes.Goldenrod, new RectangleF(new PointF(f_js_width * (m_list_kmlfpoint[i].kml_x * (m_i_draw_end / 20) - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py), out_testsizef));
|
|
|
+ g.FillRectangle(Brushes.Goldenrod, new RectangleF(new PointF(f_js_width * ((m_list_kmlfpoint[i].kml_x * ((m_i_draw_end - m_i_draw_start) / 20)) + m_i_draw_start - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py), out_testsizef));
|
|
|
g.DrawString(m_list_kmlfpoint[i].ysm,
|
|
|
m_thisfont_bold,
|
|
|
m_this_sb,
|
|
|
- new PointF(f_js_width * (m_list_kmlfpoint[i].kml_x * (m_i_draw_end / 20) - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py));
|
|
|
+ new PointF(f_js_width * ((m_list_kmlfpoint[i].kml_x * ((m_i_draw_end - m_i_draw_start) / 20)) + m_i_draw_start - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py));
|
|
|
|
|
|
if (m_list_kmlfpoint[i].lml_x != 0)
|
|
|
{
|
|
|
//绘制竖线
|
|
|
- g.DrawLine(new Pen(Color.Wheat, 0.5f), f_js_width * (m_list_kmlfpoint[i].lml_x * (m_i_draw_end / 20)), m_f_rulerX_location / 3 + i_py, f_js_width * (m_list_kmlfpoint[i].lml_x * (m_i_draw_end / 20)), m_f_rulerX_location - 3);
|
|
|
+ g.DrawLine(new Pen(Color.Wheat, 0.5f), f_js_width * (m_list_kmlfpoint[i].lml_x * ((m_i_draw_end - m_i_draw_start) / 20)) + m_i_draw_start, m_f_rulerX_location / 3 + i_py, f_js_width * (m_list_kmlfpoint[i].lml_x * ((m_i_draw_end - m_i_draw_start) / 20) + m_i_draw_start), m_f_rulerX_location - 3);
|
|
|
//输出文字,并将字输出到线的上面
|
|
|
SizeF out_testsizef2 = g.MeasureString(m_list_kmlfpoint[i].ysm, m_thisfont);
|
|
|
PointF ut_test_pointF2 = new PointF(m_mouse_point.X - (out_testsizef.Width / 2), 2);
|
|
|
- g.FillRectangle(Brushes.Goldenrod, new RectangleF(new PointF(f_js_width * (m_list_kmlfpoint[i].lml_x * (m_i_draw_end / 20) - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py), out_testsizef));
|
|
|
+ g.FillRectangle(Brushes.Goldenrod, new RectangleF(new PointF(f_js_width * ((m_list_kmlfpoint[i].lml_x * ((m_i_draw_end - m_i_draw_start) / 20))+ m_i_draw_start - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py), out_testsizef));
|
|
|
g.DrawString(m_list_kmlfpoint[i].ysm,
|
|
|
m_thisfont_bold,
|
|
|
m_this_sb,
|
|
|
- new PointF(f_js_width * (m_list_kmlfpoint[i].lml_x * (m_i_draw_end / 20) - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py));
|
|
|
+ new PointF(f_js_width * ((m_list_kmlfpoint[i].lml_x * ((m_i_draw_end - m_i_draw_start) / 20)) + m_i_draw_start - out_testsizef.Width / 2), m_f_rulerX_location / 3 - 20 + i_py));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -583,11 +617,11 @@ namespace OTSIncAReportGraph.Controls
|
|
|
if (m_analysis_xray[i] > m_f_kmlfzpd_mix)
|
|
|
{
|
|
|
//用绘线线段,的起始点与鼠标当前位置进行对应上的话,那么就进行取kmlf值,进行显示
|
|
|
- if (Convert.ToInt32(m_list_twopoint2[i].pf1.X * f_js_width) == m_mouse_point.X)
|
|
|
+ if (Convert.ToInt32(m_list_twopoint2[i].pf1.X * f_js_width) == m_mouse_point.X+ m_i_draw_start)
|
|
|
{
|
|
|
ls_label_str = m_list_twopoint2[i].kmlf_value.ToString();
|
|
|
}
|
|
|
- if (Convert.ToInt32(m_list_twopoint2[i].pf2.X * f_js_width) == m_mouse_point.X)
|
|
|
+ if (Convert.ToInt32(m_list_twopoint2[i].pf2.X * f_js_width) == m_mouse_point.X + m_i_draw_start)
|
|
|
{
|
|
|
ls_label_str = m_list_twopoint2[i].kmlf_value.ToString();
|
|
|
}
|
|
@@ -697,6 +731,10 @@ namespace OTSIncAReportGraph.Controls
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ private void label_close_Click(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ this.Visible = false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#region 用来显示连接线封装的类
|