internal AxisY(AnalogGraphic graphic) { Graphics = new ReadOnlyCollection <AnalogGraphic>(_graphics); _graphics.Add(graphic); //a graphic.GroupY = this; Init(); InitEvent(); //a ViewMin = _graphics[0].MinViewValue; //a ViewMax = _graphics[0].MaxViewValue; }
internal void AddGraphic(AnalogGraphic graphic) { _graphics.Add(graphic); //a graphic.GroupY = this; if (!IsOverlayed) { IsOverlayed = true; } if (graphic.Num < MinGraphicNum) { MinGraphicNum = graphic.Num; } if ((graphic.Param.DecimalPlaces > DecimalPlaces) && (DecimalPlaces != -1)) { DecimalPlacesMaskFill(graphic.Param.DecimalPlaces); } }
internal void RemoveGraphic(AnalogGraphic graphic) { if (_graphics.Count > 1) { _graphics.Remove(graphic); //a graphic.GroupY = null; if (IsOverlayed && _graphics.Count == 1) { IsOverlayed = false; } if (UpperGraphic.Num == graphic.Num) { var newUpperGraphic = Graphics.FirstOrDefault(gr => gr.Visible); UpperGraphic = newUpperGraphic ?? _graphics[0]; IsVisible = (newUpperGraphic != null); } if (MinGraphicNum == graphic.Num) { MinGraphicNum = UpperGraphic.Num; foreach (var gr in Graphics) { if (gr.Num < MinGraphicNum) { MinGraphicNum = gr.Num; } } } if (DecimalPlaces == graphic.Param.DecimalPlaces) { var dP = UpperGraphic.Param.DecimalPlaces; foreach (var gr in Graphics) { if ((gr.Param.DecimalPlaces > dP) && (dP != -1)) { dP = gr.Param.DecimalPlaces; } } DecimalPlacesMaskFill(dP); } } }