public void GenerateAdditionalWaves(List <int> orders, SystemConfig self) { var max_crystal_2d = self.CrystalProps.crystal2d.Max(); List <Tuple <DataBaseWavelength, int> > waveToAdd = new List <Tuple <DataBaseWavelength, int> >(); foreach (int order in orders.Where(x => x != 0)) { foreach (var wave in m_Waves.Where(x => x.name.Contains("_order_") == false)) { if (wave.Order != order) { var newLine = new DataBaseWavelength() { name = wave.name + "_order_" + order.ToString(), lambda = wave.lambda * order / wave.Order * ( self.CrystalProps.crystal2d[order - 1] / self.CrystalProps.crystal2d[wave.Order - 1]), intensity = wave.intensity * (double)(wave.Order) / (double)order }; newLine.dlambda = newLine.lambda; if (m_Waves.Find(x => x.name == newLine.name) == null && newLine.lambda <= max_crystal_2d) { waveToAdd.Add(new Tuple <DataBaseWavelength, int>(newLine, order)); } } } } foreach (var newLine in waveToAdd) { this.Add(newLine.Item1, newLine.Item2); } }
public void Add(DataBaseWavelength dwave, int order) { m_Waves.Add(new Interface.Wave(dwave) { Order = order }); onWaveAdd?.Invoke(this, new EventArgs()); }
public DataBaseWavelength(DataBaseWavelength w) { if (w == null) { return; } name = w.name; lambda = Math.Round(w.lambda, 5); dlambda = w.dlambda; intensity = w.intensity; }
private void WaveTraced(WaveTraceResult waveInfo) { DataBaseWavelength dbWave = new DataBaseWavelength() { lambda = waveInfo.lambda, dlambda = waveInfo.dlambda, intensity = waveInfo.intensity }; Wave tracedWave = new Wave(dbWave) { Emited = waveInfo.generate, Reflected = waveInfo.reflected, Efficiency = waveInfo.reflected / waveInfo.generate * (m_self.SolidCone / (4.0 * Math.PI)), }; WaveProcessed?.Invoke(this, tracedWave); }
public static Wave[] GenerateWaveInRangeUniform(double LowLimit, double HiLimit, uint Count) { Wave[] generated = new Wave[Count]; double WaveStep = (HiLimit - LowLimit) / Count; for (uint index = 0; index < Count; ++index) { var wavel = LowLimit + index * WaveStep; DataBaseWavelength dbWave = new DataBaseWavelength() { lambda = wavel, dlambda = wavel, intensity = 1.0, name = "Line " + wavel.ToString("#.00") }; generated[index] = new Wave(dbWave); } return(generated); }
public Wave(DataBaseWavelength w) : base(w) { }