public Line(LinePlotterWin _root, int _len, int __intMax, Color _col) { root = _root; data = new double[_len]; len = _len; inbuf = new double[32]; color = _col; drawPen = new Pen(color); _scale = 1.0; _offset = 0.0; _on = true; _acIn = false; _acOut = false; acOutOfs = 0; _intMax = __intMax; useScreen = 0; valMax = 0.0; valMaxPos = 0; valMin = 0.0; valMinPos = 0; _averager = new Averager(root.linePlotter.owner.sampleRate, __intMax, averagerCallback); averagers = Averager.getList(); newdata = false; }
public void initLinePlotterScreen(LinePlotterWin _root, int _channels, SinkSource.LinePlotterWin.Line[] _lines) { root = _root; lines = _lines; sizeXLable = GraphicsUtil.sizeText(Vector.Zero, _axesFont, 1.0, "0.01", -1, 2, -1, 0, Vector.X).boundingDim(); sizeYLable = GraphicsUtil.sizeText(Vector.Zero, _axesFont, 1.0, "-1.000", -1, 2, -1, 0, Vector.X).boundingDim(); gridX = new GridCalculator(-60, 0, 0.1, 0.1, 2, -60, 0, false, sizeYLable.x + 5, Width - 10, sizeXLable.x + 10); gridY = new GridCalculator[grids]; for (int i = 0; i < grids; i++) { gridY[i] = new GridCalculator(-1000, 1000, 1, 1e-10, 1.1, -5, 5, false, Height - sizeXLable.y - 10, 10, sizeYLable.y + 10); } autoScale = new Boolean[grids]; for (int i = 0; i < grids; i++) { autoScale[i] = false; } useGrids = 1; arrangeGrids(); channels = _channels; }
private void init() { InitializeComponent(); int ymax = Height; if (channels < 4) { ioD.Hide(); ymax = ioD.Location.Y; } if (channels < 3) { ioC.Hide(); ymax = ioC.Location.Y; } if (channels < 2) { ioB.Hide(); ymax = ioB.Location.Y; } Height = ymax; bnDisplayWin.buttonStateChanged += BnDisplayWin_buttonStateChanged; linePlotterWin = null; processingType = ProcessingType.Sink; }
public override void Disconnect() { base.Disconnect(); if (linePlotterWin != null) { linePlotterWin.CanClose = true; linePlotterWin.Close(); linePlotterWin.linePlotter = null; linePlotterWin = null; } }
private void BnDisplayWin_buttonStateChanged(object sender, EventArgs e) { if (linePlotterWin == null) { linePlotterWin = new LinePlotterWin(); linePlotterWin.initLinePlotterWin(this, channels); linePlotterWin.Show(); } else { linePlotterWin.Show(); } }