/// <summary> /// 区间标注(超过或低于设定的温度) /// </summary> /// <param name="tempMax">设定的温度Max</param> /// <param name="tempMin">设定的温度Min</param> /// <param name="Tm">出水温度数组</param> private void SetRemark(float tempMax, float tempMin, float[] Tm) { bool isHigh = false; int highStartIndex = 0; int highEndIndex = 0; bool islow = false; int belowStartIndex = 0; int belowEndIndex = 0; for (int i = 0; i < Tm.Length; i++) { if ((isHigh == false) && (Tm[i] > tempMax)) { isHigh = true; highStartIndex = i; } if (isHigh && (Tm[i] <= tempMax)) { isHigh = false; highEndIndex = i; int totalTimes = (highEndIndex - highStartIndex) * 10; HslControls.HslMarkForeSection foreSection = new HslControls.HslMarkForeSection() //区间表示操作 { StartIndex = highStartIndex, EndIndex = highEndIndex, StartHeight = 0.3f, // 如果值是(0-1)的话,表示的是位置百分比,0.9就是曲线高度为90%,从上往下看的视角,如果填了600,那就是绝对坐标 Height = 0.4f, // 和上面同理 LinePen = Pens.Chocolate, // 指定颜色 IsRenderTimeText = false, // 是否显示额外的起始时间和结束时间,此处就不要了 MarkText = "温度超标了:" + totalTimes + "ms", }; hslCurveHistory1.AddMarkForeSection(foreSection); } if ((islow == false) && (Tm[i] < tempMin)) { islow = true; belowStartIndex = i; } if (islow && (Tm[i] >= tempMin)) { islow = false; belowEndIndex = i; int totalTimes = (belowEndIndex - belowStartIndex) * 10; HslControls.HslMarkForeSection foreSection = new HslControls.HslMarkForeSection() //区间表示操作 { StartIndex = belowStartIndex, EndIndex = belowEndIndex, StartHeight = 0.3f, // 如果值是(0-1)的话,表示的是位置百分比,0.9就是曲线高度为90%,从上往下看的视角,如果填了600,那就是绝对坐标 Height = 0.9f, // 和上面同理 LinePen = Pens.Chocolate, // 指定颜色 IsRenderTimeText = false, // 是否显示额外的起始时间和结束时间,此处就不要了 MarkText = "温度过低了:" + totalTimes + "ms", }; hslCurveHistory1.AddMarkForeSection(foreSection); } } }
private void HslCurveHistory1_onCurveRangeSelect(HslControls.HslCurveHistory hslCurve, HslControls.HslMarkForeSection foreSection) { label4.Text = DateTime.Now.ToString("HH:mm:ss") + " Start:" + foreSection.StartIndex + " End:" + foreSection.EndIndex; foreSection.MarkText = "这是标记的自定义的数据"; }
private void ThreadReadExample1( ) { string info = "154,154,153,153,153,153,154,154,154,154,154,154,155,155,155,155,154,154,154,154,155,155,154,155,154,154,153,153,153," + "153,154,154,153,153,153,153,155,155,155,155,153,153,154,154,154,154,155,155,153,154,153,153,153,153,154,154,154,154,153,154,154," + "154,154,154,153,153,152,152,152,152,150,151,148,149,73,147,0,0,0,0,0,0,0,0,107,143,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0," + "109,109,110,111,83,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," + "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," + "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,0,154,154,154,154,156,156,156,156,156,156,156,156,155,155,154,155,154,154,154,154,155,155," + "153,154,153,153,153,153,154,154,153,154,153,153,153,153,153,153,154,154,153,153,153,153,153,153,153,153,153,153,153,153,154,154," + "154,154,154,154,154,154,153,154,152,152,153,153,153,153,154,154,153,154,153,153,153,153,153,153,153,153,153,153,152,152,153,153," + "154,154,153,154,153,153,153,153,153,153,154,154,155,156,154,155,153,154,151,152,151,152,152,152,152,152,152,152,151,152,151,152," + "151,152,151,151,150,150,149,150,37,0,0,0,0,0,0,0,35,0,107,143,0,0,106,142,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," + "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," + "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," + "0,0,0,0,0,0,0,0,0,0,0,0,154,154,154,154,77,154,0,0,0,0,153,153,153,153,153,153,154,154,153,154,153,153,153,153,153,153,154,154,153," + "154,152,153,151,152,113,151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,153,38,0,0,0,38,0,153,154,152,152,151,151,113,151,0,0,0,0,0,0,77,154,0," + "0,0,0,0,0,0,0,114,153,153,153,155,155,155,156,154,154,154,154,154,154,153,154,153,153,154,154,156,156,156,157,155,156,155,155,155," + "156,152,152,113,151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,103,138,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," + "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,0,106,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53,0,106,106,53,106,0,0," + "0,0,52,0,52,104,0,0,0,0,0,0,52,105,0,0,0,0,54,108,0,0,0,0,0,0,27,0,108,108,110,110,83,111,0,0,0,0,87,116,118,119,90,120,0,0,0,0,0,0,0," + "0,0,0,0,0,0,0,0,0,0,0,110,147,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," + "0,0,0,0,0,0,0,0,116,155,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,154,154,154,154,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,78,0,154," + "154,153,153,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,72,0,143,144,143,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0," + "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53,0,53,0,53,106,0,0,51,0,103,103,103,103,53,106,0,0,53,0,106,107,53,106,0,0,26,0,105,105," + "78,105,0,0,26,0,105,105,79,106,0,0,0,0,78,105,104,104,26,0,0,0,78,104,105,105,26,0,0,0,78,105,105,105,26,0,0,0,26,0,107,107,26,0,0,0," + "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,143,144,146,147,149,149,37,0,0,0,0,0,0,0,0,0,78,156," + "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"; string[] infos = info.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); List <string> lists = new List <string>(info.Length * 10); lists.AddRange(infos); lists.AddRange(infos); lists.AddRange(infos); lists.AddRange(infos); lists.AddRange(infos); lists.AddRange(infos); lists.AddRange(infos); lists.AddRange(infos); lists.AddRange(infos); lists.AddRange(infos); infos = lists.ToArray( ); int datalength = infos.Length; Thread.Sleep(2000); // 我们假定从数据库中获取到了这些数据信息 float[] steps = new float[datalength]; float[] data = new float[datalength]; float[] press = new float[datalength]; DateTime[] times = new DateTime[datalength]; for (int i = 0; i < data.Length; i++) { // 模拟中间空了一些数据段 //if(i > 200 && i < 300) //{ // steps[i] = random.Next( 10 ); // data[i] = float.NaN; // times[i] = DateTime.Now.AddSeconds( i - datalength ); // press[i] = (float)(Math.Sin( 2 * Math.PI * i / 100 ) * 0.5d + 4.1d); // continue; //} //if( i > 1000 && i < 1200) //{ // steps[i] = random.Next( 10 ); // data[i] = float.NaN; // times[i] = DateTime.Now.AddSeconds( i - datalength ); // press[i] = (float)(Math.Sin( 2 * Math.PI * i / 100 ) * 0.5d + 4.1d); // continue; //} steps[i] = random.Next(10); data[i] = float.Parse(infos[i]) == 0 ? float.NaN : float.Parse(infos[i]); // (float)(Math.Sin( 2 * Math.PI * i / 50 ) * 20 + 120); times[i] = DateTime.Now.AddSeconds(i - datalength); press[i] = (float)(Math.Sin(2 * Math.PI * i / 100) * 0.5d + 4.1d); } // 显示出数据信息来 Invoke(new Action(() => { hslCurveHistory1.SetLeftCurve("步序", steps); hslCurveHistory1.SetLeftCurve("温度", data, Color.DodgerBlue, false, "{0:F1} ℃"); hslCurveHistory1.SetRightCurve("压力", press, Color.Tomato, true, "{0:F2} Mpa"); hslCurveHistory1.SetDateTimes(times); hslCurveHistory1.AddAuxiliaryLabel(new HslControls.AuxiliaryLable( ) { LocationX = 0.6f, Text = $"今日产量:{random.Next(10)}个", TextBack = new SolidBrush(Color.FromArgb(10, 10, 10)), TextBrush = Brushes.Gray, }); hslCurveHistory1.AddMarkBackSection(new HslControls.HslMarkBackSection( ) { StartIndex = 1000, EndIndex = 1200, MarkText = "报警了" }); // 添加两个背景标记的示例,可以用来标记特殊用途的背景,例如一个产品的周期,停机,维修等等状态 hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 900, EndIndex = 1300, StartHeight = 0.2f, Height = 0.8f, }); hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 500, EndIndex = 700, StartHeight = 0.3f, Height = 0.7f, IsRenderTimeText = false, LinePen = Pens.Orange, MarkText = "报警区域" }); // 增加一个三角形的线段标记示例 Points的每个点的X是数据索引,Y是数据值(需要选对参考坐标轴,默认为左坐标轴) hslCurveHistory1.AddMarkLine(new HslControls.HslMarkLine( ) { CircleBrush = Brushes.DodgerBlue, IsLeftFrame = true, IsLineClosed = true, LinePen = Pens.DodgerBlue, TextBrush = Brushes.DodgerBlue, Points = new PointF[] { new PointF(200, 180f), new PointF(260, 20f), new PointF(550, 150f), }, Marks = new string[] { "AA", "BB", "CC" }, }); // 添加一个活动的标记 HslControls.HslMarkForeSection active = new HslControls.HslMarkForeSection( ) { StartIndex = 1000, EndIndex = 1500, Height = 0.9f, }; active.CursorTexts.Add("条码", "A123123124ashdiahsd是的iahsidasd"); active.CursorTexts.Add("工号", "asd2sd123dasf"); hslCurveHistory1.AddMarkActiveSection(active); hslCurveHistory1.SetCurveVisible("步序", false); // 步序不是曲线信息,不用显示出来 hslCurveHistory1.RenderCurveUI( ); })); }
private void ThreadReadExample1( ) { Thread.Sleep(2000); // 我们假定从数据库中获取到了这些数据信息 float[] steps = new float[2000]; float[] data = new float[2000]; float[] press = new float[2000]; float[] upper = new float[2000]; float[] lower = new float[2000]; DateTime[] times = new DateTime[2000]; for (int i = 0; i < data.Length; i++) { steps[i] = random.Next(10); data[i] = Convert.ToSingle(random.NextDouble( ) * 40 + 100); times[i] = DateTime.Now.AddSeconds(i - 2000); press[i] = Convert.ToSingle(random.NextDouble( ) * 0.5d + 4); upper[i] = Convert.ToSingle(random.NextDouble( ) * 10 + 150); lower[i] = Convert.ToSingle(random.NextDouble( ) * 10 + 30); } // 显示出数据信息来 Invoke(new Action(() => { // 区间颜色参考LineColor,背景色使用的透明的,淡化的LineColor,需要指定参考的坐标轴,数据,颜色 // 样式只能选择 LineSegment 及 Curve // 下限如果设置为NULL,就使用坐标轴的最小值,需要指定参考的坐标轴,数据 hslCurveHistory1.CurveRanges = new HslControls.HslCurveRange[] { new HslControls.HslCurveRange( ) { ReferenceAxisIndex = 0, LineColor = Color.FromArgb(175, 226, 253), Upper = upper, Lower = lower, Style = HslControls.CurveStyle.Curve, // 可选 LineSegment 及 Curve } }; hslCurveHistory1.SetLeftCurve("步序", steps); hslCurveHistory1.SetLeftCurve("温度", data, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetRightCurve("压力", press, Color.Tomato, HslControls.CurveStyle.Curve, "{0:F2} Mpa"); hslCurveHistory1.SetDateTimes(times); hslCurveHistory1.AddMarkBackSection(new HslControls.HslMarkBackSection( ) { StartIndex = 1000, EndIndex = 1200, MarkText = "报警了", BackColor = Color.FromArgb(244, 244, 244) }); // 添加两个标记 hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 900, EndIndex = 1300, StartHeight = 0.2f, Height = 0.8f, LinePen = Pens.Blue, FontBrush = Brushes.Chocolate }); hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 500, EndIndex = 700, StartHeight = 0.3f, Height = 0.7f, IsRenderTimeText = false, LinePen = Pens.Orange, MarkText = "报警区域", FontBrush = Brushes.Chocolate }); // 添加一个活动的标记 HslControls.HslMarkForeSection active = new HslControls.HslMarkForeSection( ) { StartIndex = 1000, EndIndex = 1500, Height = 0.9f, LinePen = Pens.Blue, FontBrush = Brushes.Chocolate }; active.CursorTexts.Add("条码", "A123123124ashdiahsd是的iahsidasd"); active.CursorTexts.Add("工号", "asd2sd123dasf"); hslCurveHistory1.AddMarkActiveSection(active); hslCurveHistory1.DateTimeFormate = "yyyy-MM-dd\r\nHH:mm:ss"; hslCurveHistory1.SetCurveVisible("步序", false); hslCurveHistory1.RenderCurveUI( ); })); }
private void ThreadReadExample1( ) { Thread.Sleep(2000); // 我们假定从数据库中获取到了这些数据信息 float[] steps = new float[2000]; float[] data = new float[2000]; float[] press = new float[2000]; DateTime[] times = new DateTime[2000]; for (int i = 0; i < data.Length; i++) { steps[i] = random.Next(10); data[i] = Convert.ToSingle(random.NextDouble( ) * 40 + 100); times[i] = DateTime.Now.AddSeconds(i - 2000); press[i] = Convert.ToSingle(random.NextDouble( ) * 0.5d + 4); } // 显示出数据信息来 Dispatcher.Invoke(new Action(() => { hslCurveHistory1.SetLeftCurve("步序", steps); hslCurveHistory1.SetLeftCurve("温度", data, System.Drawing.Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetRightCurve("压力", press, System.Drawing.Color.Tomato, HslControls.CurveStyle.Curve, "{0:F2} Mpa"); hslCurveHistory1.SetDateTimes(times); hslCurveHistory1.AddMarkBackSection(new HslControls.HslMarkBackSection( ) { StartIndex = 1000, EndIndex = 1200, MarkText = "报警了", BackColor = System.Drawing.Color.FromArgb(56, 56, 56) }); // 添加两个标记 hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 900, EndIndex = 1300, StartHeight = 0.2f, Height = 0.8f, LinePen = System.Drawing.Pens.Blue, FontBrush = System.Drawing.Brushes.Chocolate }); hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 500, EndIndex = 700, StartHeight = 0.3f, Height = 0.7f, IsRenderTimeText = false, LinePen = System.Drawing.Pens.Orange, MarkText = "报警区域", FontBrush = System.Drawing.Brushes.Chocolate }); // 添加一个活动的标记 HslControls.HslMarkForeSection active = new HslControls.HslMarkForeSection( ) { StartIndex = 1000, EndIndex = 1500, Height = 0.9f, LinePen = System.Drawing.Pens.Blue, FontBrush = System.Drawing.Brushes.Chocolate }; active.CursorTexts.Add("条码", "A123123124ashdiahsd是的iahsidasd"); active.CursorTexts.Add("工号", "asd2sd123dasf"); hslCurveHistory1.AddMarkActiveSection(active); hslCurveHistory1.SetCurveVisible("步序", false); hslCurveHistory1.RenderCurveUI( ); })); }
private void ThreadReadExample1( ) { Thread.Sleep(2000); // 我们假定从数据库中获取到了这些数据信息 int total = 200000; float[] steps = new float[total]; float[] press = new float[total]; float[] data1 = new float[total]; float[] data2 = new float[total]; float[] data3 = new float[total]; float[] data4 = new float[total]; float[] data5 = new float[total]; float[] data6 = new float[total]; float[] data7 = new float[total]; float[] data8 = new float[total]; float[] data9 = new float[total]; float[] data10 = new float[total]; DateTime[] times = new DateTime[total]; for (int i = 0; i < total; i++) { steps[i] = random.Next(10); data1[i] = (float)(Math.Sin(2 * Math.PI * i / 50) * 20 + 120); data2[i] = (float)(Math.Sin(2 * Math.PI * i / 50) * 20 + 20); data3[i] = (float)(Math.Sin(2 * Math.PI * i / 50) * 20 + 30); data4[i] = (float)(Math.Sin(2 * Math.PI * i / 50) * 20 + 50); data5[i] = (float)(Math.Sin(2 * Math.PI * i / 50) * 20 + 75); data6[i] = (float)(Math.Sin(2 * Math.PI * i / 50) * 20 + 105); data7[i] = (float)(Math.Sin(2 * Math.PI * i / 50) * 20 + 135); data8[i] = (float)(Math.Sin(2 * Math.PI * i / 50) * 20 + 165); data9[i] = (float)(Math.Sin(2 * Math.PI * i / 50) * 20 + 195); data10[i] = (float)(Math.Sin(2 * Math.PI * i / 50) * 20 + 200); times[i] = DateTime.Now.AddSeconds(i - total); press[i] = (float)(Math.Sin(2 * Math.PI * i / 100) * 0.5d + 4.1d); } // 显示出数据信息来 Invoke(new Action(() => { hslCurveHistory1.DateTimeFormate = "yyyy-MM-dd\r\nHH:mm:ss"; hslCurveHistory1.SetLeftCurve("步序", steps); hslCurveHistory1.SetLeftCurve("温度1", data1, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetLeftCurve("温度2", data2, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetLeftCurve("温度3", data3, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetLeftCurve("温度4", data4, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetLeftCurve("温度5", data5, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetLeftCurve("温度6", data6, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetLeftCurve("温度7", data7, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetLeftCurve("温度8", data8, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetLeftCurve("温度9", data9, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetLeftCurve("温度10", data10, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetRightCurve("压力", press, Color.Tomato, HslControls.CurveStyle.Curve, "{0:F2} Mpa"); hslCurveHistory1.SetDateTimes(times); hslCurveHistory1.AddAuxiliaryLabel(new HslControls.AuxiliaryLable( ) { LocationX = 0.6f, Text = $"今日产量:{random.Next(10)}个", TextBack = new SolidBrush(Color.FromArgb(10, 10, 10)), TextBrush = Brushes.Gray, }); hslCurveHistory1.AddMarkBackSection(new HslControls.HslMarkBackSection( ) { StartIndex = 1000, EndIndex = 1200, MarkText = "报警了" }); // 添加两个背景标记的示例,可以用来标记特殊用途的背景,例如一个产品的周期,停机,维修等等状态 hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 900, EndIndex = 1300, StartHeight = 0.2f, Height = 0.8f, }); hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 500, EndIndex = 700, StartHeight = 0.3f, Height = 0.7f, IsRenderTimeText = false, LinePen = Pens.Orange, MarkText = "报警区域" }); // 增加一个三角形的线段标记示例 Points的每个点的X是数据索引,Y是数据值(需要选对参考坐标轴,默认为左坐标轴) hslCurveHistory1.AddMarkLine(new HslControls.HslMarkLine( ) { CircleBrush = Brushes.DodgerBlue, IsLeftFrame = true, IsLineClosed = true, LinePen = Pens.DodgerBlue, TextBrush = Brushes.DodgerBlue, Points = new PointF[] { new PointF(200, 180f), new PointF(260, 20f), new PointF(550, 150f), }, Marks = new string[] { "AA", "BB", "CC" }, }); // 添加一个活动的标记 HslControls.HslMarkForeSection active = new HslControls.HslMarkForeSection( ) { StartIndex = 1000, EndIndex = 1500, Height = 0.9f, }; active.CursorTexts.Add("条码", "A123123124ashdiahsd是的iahsidasd"); active.CursorTexts.Add("工号", "asd2sd123dasf"); hslCurveHistory1.AddMarkActiveSection(active); hslCurveHistory1.SetCurveVisible("步序", false); // 步序不是曲线信息,不用显示出来 hslCurveHistory1.RenderCurveUI( ); })); }
private void ThreadReadExample1( ) { Thread.Sleep(2000); // 我们假定从数据库中获取到了这些数据信息 float[] steps = new float[2000]; float[] data = new float[2000]; float[] press = new float[2000]; DateTime[] times = new DateTime[2000]; for (int i = 0; i < data.Length; i++) { steps[i] = random.Next(10); data[i] = Convert.ToSingle(random.NextDouble( ) * 40 + 100); times[i] = DateTime.Now.AddSeconds(i - 2000); press[i] = Convert.ToSingle(random.NextDouble( ) * 0.5d + 4); } // 显示出数据信息来 Invoke(new Action(() => { hslCurveHistory1.SetLeftCurve("步序", steps); hslCurveHistory1.SetLeftCurve("温度", data, Color.DodgerBlue, true, "{0:F1} ℃"); hslCurveHistory1.SetRightCurve("压力", press, Color.Tomato, true, "{0:F2} Mpa"); hslCurveHistory1.SetDateTimes(times); hslCurveHistory1.AddMarkBackSection(new HslControls.HslMarkBackSection( ) { StartIndex = 1000, EndIndex = 1200, MarkText = "报警了" }); // 添加两个背景标记的示例,可以用来标记特殊用途的背景,例如一个产品的周期,停机,维修等等状态 hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 900, EndIndex = 1300, StartHeight = 0.2f, Height = 0.8f, }); hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 500, EndIndex = 700, StartHeight = 0.3f, Height = 0.7f, IsRenderTimeText = false, LinePen = Pens.Orange, MarkText = "报警区域" }); // 增加一个三角形的线段标记示例 Points的每个点的X是数据索引,Y是数据值(需要选对参考坐标轴,默认为左坐标轴) hslCurveHistory1.AddMarkLine(new HslControls.HslMarkLine( ) { CircleBrush = Brushes.DodgerBlue, IsLeftFrame = true, IsLineClosed = true, LinePen = Pens.DodgerBlue, TextBrush = Brushes.DodgerBlue, Points = new PointF[] { new PointF(200, 180f), new PointF(260, 20f), new PointF(550, 150f), }, Marks = new string[] { "AA", "BB", "CC" }, }); // 添加一个活动的标记 HslControls.HslMarkForeSection active = new HslControls.HslMarkForeSection( ) { StartIndex = 1000, EndIndex = 1500, Height = 0.9f, }; active.CursorTexts.Add("条码", "A123123124ashdiahsd是的iahsidasd"); active.CursorTexts.Add("工号", "asd2sd123dasf"); hslCurveHistory1.AddMarkActiveSection(active); hslCurveHistory1.SetCurveVisible("步序", false); // 步序不是曲线信息,不用显示出来 hslCurveHistory1.RenderCurveUI( ); hslCurveHistory2.SetLeftCurve("步序", steps); hslCurveHistory2.SetLeftCurve("温度", data, Color.DodgerBlue, true, "{0:F1} ℃"); hslCurveHistory2.SetRightCurve("压力", press, Color.Tomato, true, "{0:F2} Mpa"); hslCurveHistory2.SetDateTimes(times); hslCurveHistory2.SetCurveVisible("步序", false); hslCurveHistory2.RenderCurveUI( ); })); }
private void ThreadRead_AngleTm() { float[] Tm = new float[graphDt.Rows.Count]; float[] Angle = new float[graphDt.Rows.Count]; DateTime[] dateTime = new DateTime[graphDt.Rows.Count]; DateTimeFormatInfo dtFormat = new DateTimeFormatInfo(); dtFormat.ShortDatePattern = "yyyy-MM-dd hh:mm:ss:fff"; //加载数据 for (int i = 0; i < graphDt.Rows.Count; i++) { try { Angle[i] = (float)Convert.ToDouble(graphDt.Rows[i][1]); Tm[i] = (float)Convert.ToDouble(graphDt.Rows[i][2]); dateTime[i] = DateTime.ParseExact((string)graphDt.Rows[i][0], "yyyy-MM-dd hh:mm:ss:fff", dtFormat); } catch (Exception ex) { Log.Error(ex.ToString()); return; } } DateTime start = dateTime[0]; DateTime PointA = dateTime[0].AddSeconds(2); TimeSpan ts = new TimeSpan(1); // 显示出数据信息来 Invoke(new Action(() => { //总流量达到6L加载数据 if (false) { hslCurveHistory1.Text = "累计流量未达到6L..."; hslCurveHistory1.RemoveAllCurve(); } else { hslCurveHistory1.Text = "正在加载数据..."; hslCurveHistory1.RemoveAllCurve(); hslCurveHistory1.SetLeftCurve("出水温度Tm", Tm, Color.Green, true, "{0:F2} ℃");//布尔变量:是否开启曲线平滑 hslCurveHistory1.SetLeftCurve("旋转角度Angle", Angle, Color.Red, true, "{0:F2} °"); hslCurveHistory1.SetDateTimes(dateTime); // 增加一个三角形的线段标记示例 Points的每个点的X是数据索引,Y是数据值(需要选对参考坐标轴,默认为左坐标轴) // 添加一个活动的标记 HslControls.HslMarkForeSection active = new HslControls.HslMarkForeSection() { StartIndex = 1000, EndIndex = 1500, Height = 0.9f, }; //active.CursorTexts.Add("条码", "A123123124ashdiahsd是的iahsidasd"); //active.CursorTexts.Add("工号", "asd2sd123dasf"); //hslCurveHistory1.AddMarkActiveSection(active); //hslCurveHistory1.SetCurveVisible("步序", false); // 步序不是曲线信息,不用显示出来 //hslCurveHistory1.ValueMaxLeft = 10; //hslCurveHistory1.ValueMinLeft = 0; //SetTempLight(28); //SetTempLight(29); //SetTempLight(30); //SetRemark(29f,28f,Tm); hslCurveHistory1.SetScaleByXAxis(xAxis); hslCurveHistory1.RenderCurveUI(); } } )); }
private void ThreadReadExample1( ) { int total = 400000; Thread.Sleep(2000); // 我们假定从数据库中获取到了这些数据信息 float[] steps = new float[total]; float[] data = new float[total]; float[] press = new float[total]; DateTime[] times = new DateTime[total]; for (int i = 0; i < data.Length; i++) { steps[i] = random.Next(10); data[i] = (float)(Math.Sin(2 * Math.PI * i / 50) * 20 + 120); times[i] = DateTime.Now.AddSeconds(i - total); press[i] = (float)(Math.Sin(2 * Math.PI * i / 100) * 0.5d + 4.1d); } // 显示出数据信息来 Invoke(new Action(() => { hslCurveHistory1.SetLeftCurve("步序", steps); hslCurveHistory1.SetLeftCurve("温度", data, Color.DodgerBlue, HslControls.CurveStyle.Curve, "{0:F1} ℃"); hslCurveHistory1.SetRightCurve("压力", press, Color.Tomato, HslControls.CurveStyle.Curve, "{0:F2} Mpa"); hslCurveHistory1.SetDateTimes(times); hslCurveHistory1.AddAuxiliaryLabel(new HslControls.AuxiliaryLable( ) { LocationX = 0.6f, Text = $"今日产量:{random.Next( 10 )}个", TextBack = new SolidBrush(Color.FromArgb(10, 10, 10)), TextBrush = Brushes.Gray, }); hslCurveHistory1.AddMarkBackSection(new HslControls.HslMarkBackSection( ) { StartIndex = 1000, EndIndex = 1200, MarkText = "报警了" }); // 添加两个背景标记的示例,可以用来标记特殊用途的背景,例如一个产品的周期,停机,维修等等状态 hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 900, EndIndex = 1300, StartHeight = 0.2f, Height = 0.8f, }); hslCurveHistory1.AddMarkForeSection(new HslControls.HslMarkForeSection( ) { StartIndex = 500, EndIndex = 700, StartHeight = 0.3f, Height = 0.7f, IsRenderTimeText = false, LinePen = Pens.Orange, MarkText = "报警区域" }); // 增加一个三角形的线段标记示例 Points的每个点的X是数据索引,Y是数据值(需要选对参考坐标轴,默认为左坐标轴) hslCurveHistory1.AddMarkLine(new HslControls.HslMarkLine( ) { CircleBrush = Brushes.DodgerBlue, IsLeftFrame = true, IsLineClosed = true, LinePen = Pens.DodgerBlue, TextBrush = Brushes.DodgerBlue, Points = new PointF[] { new PointF(200, 180f), new PointF(260, 20f), new PointF(550, 150f), }, Marks = new string[] { "AA", "BB", "CC" }, }); // 增加一个点的标记图片 hslCurveHistory1.AddMarkText(new HslControls.HslMarkText( ) { CircleBrush = Brushes.Tomato, CurveKey = "温度", Index = 300, TextBrush = Brushes.Tomato, MarkImage = global::HslControlsDemo.Properties.Resources.plane }); hslCurveHistory1.AddMarkText(new HslControls.HslMarkText( ) { CircleBrush = Brushes.Tomato, CurveKey = "温度", Index = 400, TextBrush = Brushes.Tomato, MarkImage = global::HslControlsDemo.Properties.Resources.weatherRain }); // 添加一张图片的背景 hslCurveHistory1.AddMarkImage(new HslControls.HslMarkImage( ) { Index = 800, OffsetY = 0.2f, MarkImage = Properties.Resources.weipay }); // 添加一个活动的标记 HslControls.HslMarkForeSection active = new HslControls.HslMarkForeSection( ) { StartIndex = 1000, EndIndex = 1500, Height = 0.9f, }; active.CursorTexts.Add("条码", "A123123124ashdiahsd是的iahsidasd"); active.CursorTexts.Add("工号", "asd2sd123dasf"); hslCurveHistory1.AddMarkActiveSection(active); hslCurveHistory1.SetCurveVisible("步序", false); // 步序不是曲线信息,不用显示出来 hslCurveHistory1.RenderCurveUI( ); })); }
private void ThreadReadExample1() { //float[] Qc = new float[graphDt.Rows.Count]; //float[] Qh = new float[graphDt.Rows.Count]; float[] Qm = new float[graphDt.Rows.Count]; //float[] Tc = new float[graphDt.Rows.Count]; //float[] Th = new float[graphDt.Rows.Count]; float[] Tm = new float[graphDt.Rows.Count]; //float[] Tm2 = new float[graphDt.Rows.Count]; //float[] Pc = new float[graphDt.Rows.Count]; //float[] Ph = new float[graphDt.Rows.Count]; //float[] Pm = new float[graphDt.Rows.Count]; //float[] Qm5 = new float[graphDt.Rows.Count]; //float[] Wh = new float[graphDt.Rows.Count]; DateTime[] dateTime = new DateTime[graphDt.Rows.Count]; DateTimeFormatInfo dtFormat = new DateTimeFormatInfo(); dtFormat.ShortDatePattern = "yyyy-MM-dd hh:mm:ss:fff"; //加载流量数据 for (int i = 0; i < graphDt.Rows.Count; i++) { try { //Qc[i] = (float)Convert.ToDouble(graphDt.Rows[i][1]); //Qh[i] = (float)Convert.ToDouble(graphDt.Rows[i][2]); Qm[i] = (float)Convert.ToDouble(graphDt.Rows[i][3]); //Tc[i] = (float)Convert.ToDouble(graphDt.Rows[i][4]); //Th[i] = (float)Convert.ToDouble(graphDt.Rows[i][5]); Tm[i] = (float)Convert.ToDouble(graphDt.Rows[i][6]); //Tm2[i] = (float)Convert.ToDouble(graphDt.Rows[i][7]); //Pc[i] = (float)Convert.ToDouble(graphDt.Rows[i][7]); //Ph[i] = (float)Convert.ToDouble(graphDt.Rows[i][8]); //Pm[i] = (float)Convert.ToDouble(graphDt.Rows[i][9]); //Qm5[i] = (float)Convert.ToDouble(graphDt.Rows[i][10]); //Wh[i] = (float)Convert.ToDouble(graphDt.Rows[i][11]); // dateTime[i] = Convert.ToDateTime(dt.Rows[i][0],dtFormat); dateTime[i] = DateTime.ParseExact((string)graphDt.Rows[i][0], "yyyy-MM-dd hh:mm:ss:fff", dtFormat); } catch (Exception ex) { Log.Error(ex.ToString()); return; } } //快速傅里叶变化滤波 Console.WriteLine("1:" + Qm.Length); Qm = TWFFT.FFT_filter(Qm); Tm = TWFFT.FFT_filter(Tm); Console.WriteLine("2:" + Qm.Length); for (int i = 0; i < graphDt.Rows.Count; i++) { } DateTime start = dateTime[0]; DateTime PointA = dateTime[0].AddSeconds(2); TimeSpan ts = new TimeSpan(1); // 显示出数据信息来 Invoke(new Action(() => { //总流量达到6L加载数据 if (false) { hslCurveHistory1.Text = "累计流量未达到6L..."; hslCurveHistory1.RemoveAllCurve(); } else { hslCurveHistory1.Text = "正在加载数据..."; hslCurveHistory1.RemoveAllCurve(); hslCurveHistory1.SetLeftCurve("出水流量Qm", Qm, Color.DodgerBlue, true, "{0:F2} L/min");//布尔变量:是否开启曲线平滑 //hslCurveHistory1.SetLeftCurve("冷水流量Qc", Qc, Color.Tomato, true, "{0:F2} L/min"); //hslCurveHistory1.SetLeftCurve("热水流量Qh", Qh, Color.GreenYellow, true, "{0:F2} L/min"); //hslCurveHistory1.SetLeftCurve("Qm5", Qm5, Color.Purple, true, "{0:F2} L/min"); //hslCurveHistory1.SetLeftCurve("出水压力Pm", Pm, Color.Red, true, "{0:F2} Bar"); //hslCurveHistory1.SetLeftCurve("热水压力Ph", Ph, Color.Orange, true, "{0:F2} Bar"); //hslCurveHistory1.SetLeftCurve("冷水压力Pc", Pc, Color.Yellow, true, "{0:F2} Bar"); hslCurveHistory1.SetLeftCurve("出水温度Tm", Tm, Color.Red, true, "{0:F2} ℃"); //hslCurveHistory1.SetLeftCurve("出水温度Tm2", Tm2, Color.Yellow, true, "{0:F2} ℃"); //hslCurveHistory1.SetRightCurve("热水温度Th", Th, Color.Honeydew, true, "{0:F2} ℃"); //hslCurveHistory1.SetRightCurve("冷水温度Tc", Tc, Color.Pink, true, "{0:F2} ℃"); //hslCurveHistory1.SetRightCurve("液面高度Wh", Tc, Color.Blue, true, "{0:F2} mm"); hslCurveHistory1.SetDateTimes(dateTime); // 增加一个三角形的线段标记示例 Points的每个点的X是数据索引,Y是数据值(需要选对参考坐标轴,默认为左坐标轴) // 添加一个活动的标记 HslControls.HslMarkForeSection active = new HslControls.HslMarkForeSection() { StartIndex = 1000, EndIndex = 1500, Height = 0.9f, }; //active.CursorTexts.Add("条码", "A123123124ashdiahsd是的iahsidasd"); //active.CursorTexts.Add("工号", "asd2sd123dasf"); //hslCurveHistory1.AddMarkActiveSection(active); //hslCurveHistory1.SetCurveVisible("步序", false); // 步序不是曲线信息,不用显示出来 //hslCurveHistory1.ValueMaxLeft = 10; //hslCurveHistory1.ValueMinLeft = 0; SetTempLight(28); SetTempLight(29); SetTempLight(30); SetRemark(29f, 28f, Tm); hslCurveHistory1.SetScaleByXAxis((float)0.1); hslCurveHistory1.RenderCurveUI(); } } )); }
private void ThreadReadExample1() { DataTable dt = Form2.dt; float[] flow = new float[dt.Rows.Count]; DateTime[] dateTime = new DateTime[dt.Rows.Count]; DateTimeFormatInfo dtFormat = new DateTimeFormatInfo(); dtFormat.ShortDatePattern = "yyyy-MM-dd hh:mm:ss:fff"; //加载流量数据 for (int i = 0; i < dt.Rows.Count; i++) { flow[i] = (float)Convert.ToDouble(dt.Rows[i][2]); // dateTime[i] = Convert.ToDateTime(dt.Rows[i][0],dtFormat); dateTime[i] = DateTime.ParseExact((string)dt.Rows[i][0], "yyyy-MM-dd hh:mm:ss:fff", dtFormat); //Console.WriteLine((array[i, 0])); } //BSEN曲线 { A_BSEN.X = (int)(dt.Rows.Count * 0.2); A_BSEN.Y = 0; B_BSEN.X = (int)(dt.Rows.Count * 0.7); B_BSEN.Y = 0; QM_BSEN.Y = (float)Form2.maxFlow; QM_BSEN.X = 0; C_BSEN.X = 0; C_BSEN.Y = (float)(QM_BSEN.Y * 0.7); M_BSEN.Y = C_BSEN.Y; N_BSEN.Y = C_BSEN.Y; M_BSEN.X = A_BSEN.X; N_BSEN.X = B_BSEN.X; QM_INGRAPH_BSEN = QM_BSEN; QM_INGRAPH_BSEN.X = Form2.maxflow_pose; hslCurveHistory3.Text = "正在加载数据..."; hslCurveHistory3.RemoveAllCurve(); hslCurveHistory3.SetLeftCurve("流量", flow, Color.DodgerBlue, true, "{0:F1} L/s");//布尔变量:是否开启曲线平滑 hslCurveHistory3.SetDateTimes(dateTime); // 增加一个三角形的线段标记示例 Points的每个点的X是数据索引,Y是数据值(需要选对参考坐标轴,默认为左坐标轴) //增加abmn矩阵 hslCurveHistory3.AddMarkLine(new HslControls.HslMarkLine() { CircleBrush = Brushes.Yellow, IsLeftFrame = true, IsLineClosed = true, LinePen = Pens.Yellow, TextBrush = Brushes.Yellow, Points = new PointF[] { A_BSEN, B_BSEN, N_BSEN, M_BSEN }, Marks = new string[] { "A", "B", "N", "M" }, }); //cm hslCurveHistory3.AddMarkLine(new HslControls.HslMarkLine() { CircleBrush = Brushes.Yellow, IsLeftFrame = true, IsLineClosed = false, LinePen = Pens.Yellow, TextBrush = Brushes.Yellow, Points = new PointF[] { C_BSEN, M_BSEN }, Marks = new string[] { " C", " " }, }); //qm-qm_ingraph hslCurveHistory3.AddMarkLine(new HslControls.HslMarkLine() { CircleBrush = Brushes.Yellow, IsLeftFrame = true, IsLineClosed = false, LinePen = Pens.Yellow, TextBrush = Brushes.Yellow, Points = new PointF[] { QM_BSEN, QM_INGRAPH_BSEN }, Marks = new string[] { " QM", " " }, }); hslCurveHistory3.ValueMaxLeft = 10; hslCurveHistory3.ValueMinLeft = 0; hslCurveHistory3.SetScaleByXAxis(xAxis); hslCurveHistory3.RenderCurveUI(); } DateTime start = dateTime[0]; DateTime PointA = dateTime[0].AddSeconds(2); TimeSpan ts = new TimeSpan(1); //寻找开始两秒以后的点 for (int i = 0; i < dt.Rows.Count; i++) { if (dateTime[i].Second - PointA.Second == 0 && Math.Abs(dateTime[i].Millisecond - PointA.Millisecond) < 100) { A.X = i; Console.WriteLine("A.X:" + A.X); Console.WriteLine("PointA:" + PointA); Console.WriteLine("dateTime[i]:" + dateTime[i]); Console.WriteLine("i:" + i); break; } } A.Y = 0; B.X = Form2.L6; B.Y = 0; C.X = Form2.L9; C.Y = 0; E.X = 0; E.Y = (float)Properties.Settings.Default.qmin; //暂未赋值的点 :B 、C、E //D D.X = 0; D.Y = (float)0.85 * E.Y; //H H.X = A.X; H.Y = E.Y; //M M.X = B.X; M.Y = D.Y; //N N.X = C.X; N.Y = D.Y; try { // 显示出数据信息来 Invoke(new Action(() => { //总流量达到6L加载数据 if ((totalFlow < 6)) { hslCurveHistory1.Text = "累计流量未达到6L..."; hslCurveHistory1.RemoveAllCurve(); } else { hslCurveHistory1.Text = "正在加载数据..."; hslCurveHistory1.RemoveAllCurve(); hslCurveHistory1.SetLeftCurve("流量", flow, Color.DodgerBlue, true, "{0:F1} L/s");//布尔变量:是否开启曲线平滑 hslCurveHistory1.SetDateTimes(dateTime); // 增加一个三角形的线段标记示例 Points的每个点的X是数据索引,Y是数据值(需要选对参考坐标轴,默认为左坐标轴) //增加EHAO矩阵 hslCurveHistory1.AddMarkLine(new HslControls.HslMarkLine() { CircleBrush = Brushes.Yellow, IsLeftFrame = true, IsLineClosed = false, LinePen = Pens.Yellow, TextBrush = Brushes.Yellow, Points = new PointF[] { E, H, A }, Marks = new string[] { " E(Qmin)", "H", "A" }, }); //HMBA hslCurveHistory1.AddMarkLine(new HslControls.HslMarkLine() { CircleBrush = Brushes.Yellow, IsLeftFrame = true, IsLineClosed = false, LinePen = Pens.Yellow, TextBrush = Brushes.Yellow, Points = new PointF[] { H, M, B }, Marks = new string[] { "H", "M", "B" }, }); //DM Console.WriteLine(); hslCurveHistory1.AddMarkLine(new HslControls.HslMarkLine() { CircleBrush = Brushes.Yellow, IsLeftFrame = true, IsLineClosed = true, LinePen = Pens.Yellow, TextBrush = Brushes.Yellow, Points = new PointF[] { D, M }, Marks = new string[] { " D(Qs)", "" }, }); // 添加一个活动的标记 HslControls.HslMarkForeSection active = new HslControls.HslMarkForeSection() { StartIndex = 1000, EndIndex = 1500, Height = 0.9f, }; //active.CursorTexts.Add("条码", "A123123124ashdiahsd是的iahsidasd"); //active.CursorTexts.Add("工号", "asd2sd123dasf"); //hslCurveHistory1.AddMarkActiveSection(active); //hslCurveHistory1.SetCurveVisible("步序", false); // 步序不是曲线信息,不用显示出来 hslCurveHistory1.ValueMaxLeft = 10; hslCurveHistory1.ValueMinLeft = 0; hslCurveHistory1.SetScaleByXAxis(7); hslCurveHistory1.RenderCurveUI(); Console.WriteLine("AY:" + A.Y + ":" + A.X); } if (totalFlow >= 9)//总流量达到9L加载数据 { //9L 流量图 hslCurveHistory2.Text = "正在加载数据..."; hslCurveHistory2.RemoveAllCurve(); hslCurveHistory2.SetLeftCurve("流量", flow, Color.DodgerBlue, true, "{0:F1} L/s");//布尔变量:是否开启曲线平滑 hslCurveHistory2.SetDateTimes(dateTime); // 增加一个三角形的线段标记示例 Points的每个点的X是数据索引,Y是数据值(需要选对参考坐标轴,默认为左坐标轴) //增加EHAO矩阵 hslCurveHistory2.AddMarkLine(new HslControls.HslMarkLine() { CircleBrush = Brushes.Yellow, IsLeftFrame = true, IsLineClosed = false, LinePen = Pens.Yellow, TextBrush = Brushes.Yellow, Points = new PointF[] { E, H, A }, Marks = new string[] { " E(Qmin)", "H", "A" }, }); //HMBA hslCurveHistory2.AddMarkLine(new HslControls.HslMarkLine() { CircleBrush = Brushes.Yellow, IsLeftFrame = true, IsLineClosed = false, LinePen = Pens.Yellow, TextBrush = Brushes.Yellow, Points = new PointF[] { H, N, C }, Marks = new string[] { "H", "N", "C" }, }); //DM Console.WriteLine(); hslCurveHistory2.AddMarkLine(new HslControls.HslMarkLine() { CircleBrush = Brushes.Yellow, IsLeftFrame = true, IsLineClosed = true, LinePen = Pens.Yellow, TextBrush = Brushes.Yellow, Points = new PointF[] { D, N }, Marks = new string[] { " D(Qs)", "" }, }); hslCurveHistory2.ValueMaxLeft = 10; hslCurveHistory2.ValueMinLeft = 0; hslCurveHistory2.SetScaleByXAxis(xAxis); hslCurveHistory2.RenderCurveUI(); } } )); } catch { } }