internal AnalogGraphic(FormGraphic formGraphic, Param param, int num) : base(formGraphic, param, num) { int lineWidth = FormGraphic.LineWidth; GraphicVisual = new GraphicVisual(lineWidth, num); Area.AxisY.Minimum = Param.Min; Area.AxisY.Maximum = Param.Max; //Area.AxisX.Minimum = formGraphic.TimeBegin.ToOADate(); //Area.AxisX.Maximum = formGraphic.TimeEnd.ToOADate(); GroupY = null; }
internal DiscretGraphic(FormGraphic formGraphic, Param param, int num) : base(formGraphic, param, num) { int lineWidth = FormGraphic.CbLineWidth; //Возможно не надо lineWidth GraphicVisual = new GraphicVisual(lineWidth, num, false); Area.AxisY.Minimum = 0; Area.AxisY.Maximum = 1; //Area.AxisX.Minimum = formGraphic.TimeBegin.ToOADate(); //Area.AxisX.Maximum = formGraphic.TimeEnd.ToOADate(); Init(); }
//Задаёт начальное и конечное значение Area графика по Y //Расчитывает необходимые значения для GraphicVisual.SetAxisYScaleView(...), если значения в процентах internal void SetAxisYScaleView(double minAxY, double maxAxY, bool isInPercent = false) { if (!isInPercent) { GraphicVisual.SetAxisYScaleView(minAxY, maxAxY); } else { //double minScV = Param.Min + (Param.Max - Param.Min) * minAxY * .01; //double maxScV = Param.Min + (Param.Max - Param.Min) * maxAxY * .01; //mm double minScV = Param.PercentToValue(minAxY); double minScV = PercentToValue(minAxY); //mm double maxScV = Param.PercentToValue(maxAxY); double maxScV = PercentToValue(maxAxY); GraphicVisual.SetAxisYScaleView(minScV, maxScV); } }