Exemplo n.º 1
0
        private static NumericMaterialParameterViewModel GetThicknessSection(Material material)
        {
            var thicknessField = new NumericMaterialParameterViewModel(ParameterType.Thickness)
            {
                Minimum  = 0.1,
                Maximum  = 10.0,
                StepSize = 0.1,
                Value    = material.Thickness.Nanometers
            };

            thicknessField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.Thickness = Length.FromNanometers(thicknessField.Value);
            };

            return(thicknessField);
        }
Exemplo n.º 2
0
        private static List <MaterialParameterViewModel> GetMetalParameterSection(Metal material)
        {
            var metalSection = new List <MaterialParameterViewModel>();
            var metalField   = new NumericMaterialParameterViewModel(ParameterType.WorkFunction)
            {
                Minimum  = 0.0,
                Maximum  = 10,
                StepSize = 0.1,
                Value    = material.WorkFunction?.ElectronVolts ?? 0.0
            };

            metalField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.WorkFunction = Energy.FromElectronVolts(metalField.Value);
            };

            metalSection.Add(GetThicknessSection(material));
            metalSection.Add(metalField);
            return(metalSection);
        }
Exemplo n.º 3
0
        private static List <MaterialParameterViewModel> GetSemiconductorParameterSection(Semiconductor material)
        {
            var semiconductorSection = new List <MaterialParameterViewModel>();
            var bgField = new MaterialParameterViewModel <string>(ParameterType.SemiconductorBandGap)
            {
                Value = material.BandGap?.Expression
            };

            bgField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.BandGap = new MathExpression <Energy>(bgField.Value);
            };

            semiconductorSection.Add(bgField);

            var eaField = new NumericMaterialParameterViewModel(ParameterType.ElectronAffinity)
            {
                Minimum  = 0,
                Maximum  = 5,
                StepSize = 0.05,
                Value    = material.ElectronAffinity?.ElectronVolts ?? 0.0
            };

            eaField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.ElectronAffinity = Energy.FromElectronVolts(eaField.Value);
            };

            semiconductorSection.Add(eaField);

            var dcField = new NumericMaterialParameterViewModel(ParameterType.DielectricConstant)
            {
                Minimum  = 0,
                Maximum  = 30,
                StepSize = 1,
                Value    = material.DielectricConstant
            };

            dcField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.DielectricConstant = dcField.Value;
            };

            semiconductorSection.Add(dcField);

            var iccField = new MaterialParameterViewModel <string>(ParameterType.IntrinsicCarrierConcentration)
            {
                Value = material.IntrinsicCarrierConcentration?.Expression
            };

            iccField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.IntrinsicCarrierConcentration = new MathExpression <Concentration>(iccField.Value);
            };

            semiconductorSection.Add(iccField);

            var dtField = new MaterialParameterViewModel <DopingType>(ParameterType.DopingType)
            {
                Value = material.DopingType
            };

            dtField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.DopingType = dtField.Value;
            };

            semiconductorSection.Add(dtField);

            var dopCField = new MaterialParameterViewModel <string>(ParameterType.DopantConcentration)
            {
                Value = material.DopantConcentration?.Expression
            };

            dopCField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.DopantConcentration = new MathExpression <Concentration>(dopCField.Value);
            };

            semiconductorSection.Add(dopCField);

            var tempField = new NumericMaterialParameterViewModel(ParameterType.Temperature)
            {
                Minimum  = 100.0,
                Maximum  = 500.0,
                StepSize = 25.0,
                Value    = material.Temperature?.Kelvin ?? 0.0
            };

            tempField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.Temperature = new Temperature(tempField.Value);
            };

            semiconductorSection.Add(tempField);

            return(semiconductorSection);
        }
Exemplo n.º 4
0
        private static List <MaterialParameterViewModel> GetDielectricParameterSection(Dielectric material)
        {
            var dielectricSection = new List <MaterialParameterViewModel>();
            var bandGapField      = new NumericMaterialParameterViewModel(ParameterType.BandGap)
            {
                Minimum  = 0,
                Maximum  = 10,
                StepSize = 0.1,
                Value    = material.BandGap?.ElectronVolts ?? 0.0
            };

            bandGapField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.BandGap = Energy.FromElectronVolts(bandGapField.Value);
            };

            var eaField = new NumericMaterialParameterViewModel(ParameterType.ElectronAffinity)
            {
                Minimum  = 0,
                Maximum  = 5,
                StepSize = 0.05,
                Value    = material.ElectronAffinity?.ElectronVolts ?? 0.0
            };

            eaField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.ElectronAffinity = Energy.FromElectronVolts(eaField.Value);
            };

            var dcField = new NumericMaterialParameterViewModel(ParameterType.DielectricConstant)
            {
                Minimum  = .1,
                Maximum  = 30,
                StepSize = 1,
                Value    = material.DielectricConstant
            };

            dcField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.DielectricConstant = dcField.Value;
            };

            dielectricSection.Add(GetThicknessSection(material));
            dielectricSection.Add(bandGapField);
            dielectricSection.Add(eaField);
            dielectricSection.Add(dcField);

            return(dielectricSection);
        }