public void setOwner(DataViewer _owner) { CanClose = false; cbList.Items.Clear(); cbXRange.Items.Clear(); int found = 0; int diff = abs(_owner.timerangesms[0] - _owner.config.xrange); for (int i = 0; i < _owner.timerangesms.Length; i++) { int ms = _owner.timerangesms[i]; string setname = ""; if (ms < 1000) { setname = string.Format("{0} ms", ms); } else { setname = string.Format("{0} s", ms / 1000); } cbXRange.Items.Add(setname); int ddiff = abs(_owner.timerangesms[i] - _owner.config.xrange); if (ddiff < diff) { diff = ddiff; found = i; } } cbXRange.SelectedIndex = found; cbYAutoscale.Checked = _owner.config.yautoscale; cbYLog.Checked = _owner.config.ylog; cbRunning.Checked = running; tbYMin.Text = string.Format("{0}", _owner.config.ymin); tbYMax.Text = string.Format("{0}", _owner.config.ymax); int tracelength = _owner.config.xrange * _owner.owner.sampleRate / _owner.owner.blockSize / 1000; if ((tracelength != dv.traceLength) || (_owner.config.xrange / 1000.0 != dv.traceTime)) { dv.updateTraceTime(tracelength, _owner.config.xrange / 1000.0); } dv.updateTraceNumber(_owner.config.traces); dv.updateYRange(_owner.config.ymin, _owner.config.ymax, _owner.config.ylog, _owner.config.yautoscale); owner = _owner; }
public void DoClose() { CanClose = true; owner = null; Close(); }