public CWLineProperty(RealTimeLineOR LineOR, RealTimeT _timeT) { InitializeComponent(); _RealLineOr = LineOR; _RealTimeData = _timeT; this.lineProperty1.SetRealTimeLineOR(_RealLineOr.LineInfo); }
/// <summary> /// 隐藏曲线信息,只显示时间 /// </summary> /// <param name="LineOR"></param> /// <param name="ISHideInfo"></param> public CWLineProperty(RealTimeLineOR LineOR,bool ISHideInfo) { InitializeComponent(); _RealLineOr = LineOR; this.lineProperty1.HideInfo(); this.Title = "曲线时间"; this.lineProperty1.SetRealTimeLineOR(_RealLineOr.LineInfo); }
/// <summary> /// 画X轴 /// </summary> private void PaintX(RealTimeLineOR objOR,int LineNumber) { double Axzheight = XZTxtHeight + XZLineHeight; double xYStartP = _Canvas.Height - _YStart; xYStartP += Axzheight * LineNumber; double axzMainSize = xGridWidth / (this._XMainNumber + 1); //double xzY = yGridHeight; //x轴 Line mXZ = new Line(); mXZ.X1 = _XStart; mXZ.X2 = _XStart + xGridWidth; if (RightShowYZB) { mXZ.X1 = 0; mXZ.X2 = xGridWidth; } mXZ.Y1 = mXZ.Y2 = xYStartP; mXZ.Stroke = new SolidColorBrush(Common1.StringToColor(objOR.LineInfo.LineColor)); mXZ.StrokeThickness = 2; _CanvasZ.Children.Add(mXZ); objOR.TextList.Clear(); for (int imain = 0; imain < _XMainNumber + 2; imain++) { double _x = _XStart + imain * axzMainSize; if (RightShowYZB) { _x = imain * axzMainSize; } Line mkd = new Line(); mkd.X1 = mkd.X2 = _x; mkd.Y1 = xYStartP; mkd.Y2 = xYStartP + XZLineHeight; mkd.Stroke = new SolidColorBrush(Common1.StringToColor(objOR.LineInfo.LineColor)); mkd.StrokeThickness = 1; _CanvasZ.Children.Add(mkd); //添加X轴标签 TextBlock tb = new TextBlock(); //tb.Text = DateTime.Now.ToString("hh:MM:ss"); objOR.TextList.Add(tb); tb.Foreground = new SolidColorBrush(Common1.StringToColor(objOR.LineInfo.LineColor)); tb.SetValue(Canvas.LeftProperty, _x - 24); tb.SetValue(Canvas.TopProperty, xYStartP + XZLineHeight); _CanvasZ.Children.Add(tb); } objOR.SetXZTextBoxValue(); }
/// <summary> /// 获取Y轴文本值 /// </summary> /// <returns></returns> private string[] GetYText(RealTimeLineOR obj) { string[] ytextArr = new string[_YMainNumber + 2]; double half = obj.GetHalf(); double max = int.Parse(obj.LineInfo.MaxValue) + half; double min = int.Parse(obj.LineInfo.MinValue) - half; double v = max - min; double vPer = v / (_YMainNumber + 1); ytextArr[0] = max.ToString(); for (int i = 1; i <= _YMainNumber; i++) { double val= Math.Round(max - (i * vPer),obj.LineInfo.ValueDecimal); ytextArr[i] = val.ToString(); } ytextArr[_YMainNumber + 1] = min.ToString(); return ytextArr; }
/// <summary> /// 初使化曲线 /// </summary> private void InitLine() { if (null == _lines) { //_lines = new ElementRealTimeLineDA().selectAllDate(); } var vLine = _lines; if (vLine.Count() > 0) { foreach (t_Element_RealTimeLine tLine in vLine) { RealTimeLineOR obj = new RealTimeLineOR(tLine); _listRealTimeLine.Add(obj); } } else { t_Element_RealTimeLine objLine = new t_Element_RealTimeLine(); objLine.ID = "N" + Guid.NewGuid().ToString("N"); objLine.LineName = "ll"; objLine.MaxValue = "100"; objLine.MinValue = "0"; objLine.LineCZ = 0; objLine.LineCYZQLent = "1"; objLine.LineCYZQType = "ss"; objLine.TimeLen = 50; objLine.TimeLenType = "ss"; objLine.LineShowType = 0; objLine.LineStyle = 0; objLine.LinePointBJ = 0; objLine.ShowFormat = "mm:ss"; objLine.LineColor = Colors.Blue.ToString(); RealTimeLineOR obj = new RealTimeLineOR(objLine); _listRealTimeLine.Add(obj); } }
private void ShowYText(RealTimeLineOR objOR) { string[] arrText = null; arrText = GetYText(objOR); if (objOR.TextYList != null && objOR.TextYList.Count > 0) { for (int imain = 0; imain < _YMainNumber + 2; imain++) { objOR.TextYList[imain].Text = arrText[imain]; } } }
/// <summary> /// 画Y轴 /// </summary> private void PaintY(RealTimeLineOR objOR,int LineNumber) { ///Y轴X坐标 double yXStartP = (YZLineWidth + YZTxtWidth) * (LineNumber + 1); //右边显示Y轴 double ayzMainSize = yGridHeight / (this._YMainNumber+1); //double yzX = yXStartP;//y轴X坐标 if (_RightShowYZB) { yXStartP = xGridWidth + (YZLineWidth + YZTxtWidth) * LineNumber; } //Y轴 Line mXZ = new Line(); mXZ.X2 = mXZ.X1 = yXStartP; mXZ.Y1 = 0; mXZ.Y2 = yGridHeight; mXZ.Stroke = new SolidColorBrush(Common1.StringToColor(objOR.LineInfo.LineColor)); mXZ.StrokeThickness = 2; _CanvasZ.Children.Add(mXZ); string[] arrText = null; arrText = GetYText(objOR); //文本显示位置 double txtPosintionStart = (YZLineWidth + YZTxtWidth) * (LineNumber); if (RightShowYZB) txtPosintionStart =txtPosintionStart+ xGridWidth+ YZLineWidth; txtPosintionStart += 3; for (int imain = 0; imain < _YMainNumber + 2; imain++) { double _y = imain * ayzMainSize; double _X = 0; if (RightShowYZB) _X = yXStartP + YZLineWidth; else _X = yXStartP - YZLineWidth; //y轴刻度线 Line mkd = new Line(); mkd.X1 = _X; mkd.X2 = yXStartP; mkd.Y1 = mkd.Y2 = _y; mkd.Stroke = new SolidColorBrush(Common1.StringToColor(objOR.LineInfo.LineColor)); mkd.StrokeThickness = 1; _CanvasZ.Children.Add(mkd); //添加Y轴标签 TextBlock tb = new TextBlock(); tb.Foreground = new SolidColorBrush(Common1.StringToColor(objOR.LineInfo.LineColor)); tb.Text = arrText[imain]; if (!_RightShowYZB) _X = _X + YZTxtWidth + 2; tb.SetValue(Canvas.LeftProperty, txtPosintionStart); tb.SetValue(Canvas.TopProperty, _y - 5); _CanvasZ.Children.Add(tb); } }
/// <summary> /// 初使化曲线 /// </summary> private void InitLine() { if (null == _lines) { _lines = new ElementRealTimeLineDA().SelectBy(this.ScreenElement.ElementID); } // var vLine = _lines.Where(a => a.ElementID == this.ScreenElement.ElementID); if (_lines != null && _lines.Count() > 0) { foreach (t_Element_RealTimeLine tLine in _lines) { RealTimeLineOR obj = new RealTimeLineOR(tLine); _listRealTimeLine.Add(obj); } FirstLineOR = _listRealTimeLine.First(); } else { t_Element_RealTimeLine objLine = new t_Element_RealTimeLine(); objLine.ID = "N" + Guid.NewGuid().ToString("N"); objLine.LineName = "ll"; objLine.MaxValue = "100"; objLine.MinValue = "0"; objLine.LineCZ = 0; objLine.LineCYZQLent = "1"; objLine.LineCYZQType = "ss"; objLine.TimeLen = 50; objLine.TimeLenType = "ss"; objLine.LineShowType = 0; objLine.LineStyle = 0; objLine.LinePointBJ = 0; objLine.ShowFormat = "mm:ss"; objLine.LineColor = Colors.Blue.ToString(); RealTimeLineOR obj = new RealTimeLineOR(objLine); _listRealTimeLine.Add(obj); } }
public RealLineShow(RealTimeLineOR obj) { Init(); _LineOR = obj; ShowInfo(); }
private void AdminLine() { //移出 if (DeleteRealTime.Count > 0) { foreach (t_Element_RealTimeLine obj in DeleteRealTime) { //_RealTimeData. RealTimeLineOR _line = GetRealLine(obj); if (_line != null) { _RealTimeData.ListRealTimeLine.Remove(_line); _RealTimeData._CanvasLine.Children.Remove(_line.PolyLine); if (_RealTimeData.ElementState == MonitorSystemGlobal.ElementSate.Save) { var v = LoadScreen._DataContext.t_Element_RealTimeLines.Where(a => a.ID == obj.ID); if (v.Count() == 1) { LoadScreen._DataContext.t_Element_RealTimeLines.Remove(v.First()); } } } } } //修改、添加 foreach (t_Element_RealTimeLine obj in ListEletement) { RealTimeLineOR _line = GetRealLine(obj); if (_line != null) { _line.LineInfo = obj; } else { RealTimeLineOR _data = new RealTimeLineOR(obj); _RealTimeData.ListRealTimeLine.Add(_data); if (_RealTimeData.ElementState == MonitorSystemGlobal.ElementSate.Save) { obj.ScreenID = _RealTimeData.ScreenElement.ScreenID.Value; obj.ElementID = _RealTimeData.ScreenElement.ElementID; LoadScreen._DataContext.t_Element_RealTimeLines.Add(obj); } } } }
private void AdminLine() { //ElementRealTimeLineDA da = new ElementRealTimeLineDA(); //移出 _lines = new List<t_Element_RealTimeLine>(); if (DeleteRealTime.Count > 0) { foreach (t_Element_RealTimeLine obj in DeleteRealTime) { RealTimeLineOR _line = GetRealLine(obj); if (_line != null) { _RealTimeData.ListRealTimeLine.Remove(_line); _RealTimeData._CanvasLine.Children.Remove(_line.PolyLine); } } } //修改、添加 foreach (t_Element_RealTimeLine obj in ListEletement) { RealTimeLineOR _line = GetRealLine(obj); if (_line != null) { _line.LineInfo = obj; _lines.Add(obj); } else { obj.ScreenID = _RealTimeData.ScreenElement.ScreenID; RealTimeLineOR _data = new RealTimeLineOR(obj); _RealTimeData.ListRealTimeLine.Add(_data); _lines.Add(obj); } } }
/// <summary> /// 初使化曲线 /// </summary> private void InitLine() { var vLine = LoadScreen._DataContext.t_Element_RealTimeLines.Where(a => a.ElementID == this.ScreenElement.ElementID); if (vLine.Count() > 0) { foreach (t_Element_RealTimeLine tLine in vLine) { RealTimeLineOR obj = new RealTimeLineOR(tLine); _listRealTimeLine.Add(obj); } FirstLineOR = _listRealTimeLine.First(); } else { t_Element_RealTimeLine objLine = new t_Element_RealTimeLine(); objLine.ID = Guid.NewGuid().ToString(); objLine.LineName = "ll"; objLine.MaxValue = "100"; objLine.MinValue = "0"; objLine.LineCZ = 0; objLine.LineCYZQLent = "1"; objLine.LineCYZQType = "ss"; objLine.TimeLen = 50; objLine.TimeLenType = "ss"; objLine.LineShowType = 0; objLine.LineStyle = 0; objLine.LinePointBJ = 0; objLine.ShowFormat = "mm:ss"; objLine.LineColor = Colors.Blue.ToString(); RealTimeLineOR obj = new RealTimeLineOR(objLine); _listRealTimeLine.Add(obj); } }