コード例 #1
0
        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]));
        }
コード例 #2
0
 public static IsotopeModel GetIsotope(string symbol, int massNumber)
 {
     IsotopeDataDictionary.TryGetValue(symbol, out var isotopeData);
     return(GetIsotope(isotopeData, massNumber));
 }