public Wave[] GetWaveInRagne(SystemConfig.WaveLimits limits) { for (int i = 0; i < m_Waves.Count; ++i) { m_Waves[i].Clear(); } return(m_Waves.Where(x => (limits.min.lambda * 0.95 < x.lambda && x.lambda < limits.max.lambda * 1.05)).ToArray()); }
public void SetWaveLimits(SystemConfig.WaveLimits WaveLimits) { m_Limits = WaveLimits; m_Model.Series.Remove(m_WaveLimitBar); if (FullRange == false) { m_Model.Axes[0].Minimum = m_Limits.min.lambda * 0.95; m_Model.Axes[0].Maximum = m_Limits.max.lambda * 1.05; } else { if (m_Limits == null) { m_Limits = new SystemConfig.WaveLimits() { min = new SystemConfig.WaveLimit() { lambda = 0, position = 0 }, max = new SystemConfig.WaveLimit() { lambda = 1, position = 1 } } } ; if (m_Model.Axes[0].Minimum > m_Limits.min.lambda * 0.95 || Double.IsNaN(m_Model.Axes[0].Minimum)) { m_Model.Axes[0].Minimum = m_Limits.min.lambda * 0.95; } if (m_Model.Axes[0].Maximum < m_Limits.max.lambda * 1.05 || Double.IsNaN(m_Model.Axes[0].Maximum)) { m_Model.Axes[0].Maximum = m_Limits.max.lambda * 1.05; } } List <DataPoint> limitBar = new List <DataPoint>(); limitBar.Add(new DataPoint(m_Limits.min.lambda, 1.0)); limitBar.Add(new DataPoint(m_Limits.max.lambda, 1.0)); m_WaveLimitBar.ItemsSource = limitBar; m_Model.Series.Add(m_WaveLimitBar); m_Model.InvalidatePlot(true); }
private void SysConf_onWaveLimitChange(object sender, SystemConfig.WaveLimits e) { m_WavePlot.SetWaveLimits(e); }