private void AddPeriodicTableElement(ElementDataModel element, ObservableCollection <PeriodicTableElementModel> to, int index) { double avarageEnergyReleased = mainViewModel.DecayChainViewModel.SetupDecayChains(element); double normalizedAER = avarageEnergyReleased / 6.9246087974211306E-09; var aerColor = System.Windows.Media.Color.FromArgb(255, 255, (byte)(255 - (normalizedAER /* hm */ * 255)), (byte)(255 - (normalizedAER /* hm */ * 255))); var aerSolidColorBrush = new System.Windows.Media.SolidColorBrush(aerColor); IsotopeDataDictionary.TryGetValue(element.Symbol, out var isotopeData); double halfLife = GetAvarageHalfLife(isotopeData); double normalizedHalfLife = halfLife / 6.311390375E+28; var instabilityColor = System.Windows.Media.Color.FromArgb(255, 255, (byte)(0 + (normalizedHalfLife * 255)), (byte)(0 + (normalizedHalfLife * 255))); var instabilitySolidColorBrush = new System.Windows.Media.SolidColorBrush(instabilityColor); to.Add(new PeriodicTableElementModel(element, aerSolidColorBrush, instabilitySolidColorBrush, PeriodicTableMasses[index])); }
public static double GetMassInAMU(ElementDataModel element) => (element.AtomicNumber * Constants.Proton.Mass.AtomicMassUnits) + ((element.MassNumber - element.AtomicNumber) * Constants.Neutron.Mass.AtomicMassUnits);