public void SetEnergySavingRatio(EnergySavingRatio ratio)
 {
     foreach (var unit in AllUnits)
     {
         unit.EnergySavingCoefficient = ratio;
     }
 }
Exemple #2
0
        private void SavingRatioInit()
        {
            SavingRatioTextBox.Text = "";
            EnergySavingRatio standard = baseParams.Standard;

            originalEnergySavingRatio = standard;

            switch (standard.EnergyType)
            {
            case EnergySavingType.SavingRatioType:
                SavingRatioType.IsChecked = true;
                SavingRatioTextBox.Text   = standard.TempValue.ToString();
                break;

            case EnergySavingType.LeedStandardType:
                LeedStandardType.IsChecked = true;
                LEEDComboBox.SelectedIndex = (int)standard.TempValue;
                break;

            case EnergySavingType.ChineseGreenBuildingStandardType:
                ChineseGreenBuildingStandardType.IsChecked         = true;
                ChineseGreenBuildingStandar_ComboBox.SelectedIndex = (int)standard.TempValue;
                break;

            default:
                throw new Exception("Unknown EnergyType!");
            }

            IsRunning = true;
        }
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context,
                                         System.IServiceProvider provider, object value)
        {
            EnergySavingRatio ratio = value as EnergySavingRatio;

            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (edSvc != null)
            {
                var ratioParameterWindow = new EnergySavingEditorWindow(ratio)
                {
                    Owner = MainWindow.Current
                };
                ratioParameterWindow.ShowDialog();

                if (ratioParameterWindow.IsOk)
                {
                    value = ratioParameterWindow.Standard;
                }
            }

            return(value);
        }
Exemple #4
0
        public BaseParams()
        {
            Standard                    = new EnergySavingRatio(EnergySavingType.SavingRatioType, 0);
            BaseYear                    = 2005;
            CoalElectricityRatio        = 100;
            NaturalGasRatio             = 0;
            OtherCleanEnergyRatio       = 0;
            ElectricityProductionFactor = 0.8115;
            GasProductionFactor         = 0.20736;
            LifeCycle                   = 50;

            BaseYearStrings = new string[] { "2005年", "2006年", "2007年", "2008年", "2009年", "2010年",
                                             "2011年", "2012年", "2013年", "2014年", "2015年", "2016年", "2017年", "2018年", "2019年", "2020年" };

            BaseYearStringsE = new string[] { "Year 2005", "Year 2006", "Year 2007", "Year 2008", "Year 2009", "Year 2010",
                                              "Year 2011", "Year 2012", "Year 2013", "Year 2014", "Year 2015", "Year 2016", "Year 2017", "Year 2018", "Year 2019", "Year 2020" };

            //Optimize: . use XML to update this way
            CityDict = new Dictionary <string, CityClimateType>
            {
                // Todo Fill the data
                { "北京", CityClimateType.NorthClimate },
                { "上海", CityClimateType.MiddleClimate },
                { "广东", CityClimateType.SouthClimate },
                { "天津", CityClimateType.NorthClimate },
                { "重庆", CityClimateType.MiddleClimate },
                { "河北", CityClimateType.NorthClimate },
                { "山西", CityClimateType.NorthClimate },
                { "内蒙", CityClimateType.NorthClimate },
                { "辽宁", CityClimateType.NorthClimate },
                { "吉林", CityClimateType.NorthClimate },
                { "黑龙江", CityClimateType.NorthClimate },
                { "江苏", CityClimateType.MiddleClimate },
                { "浙江", CityClimateType.MiddleClimate },
                { "安徽", CityClimateType.MiddleClimate },
                { "福建", CityClimateType.MiddleClimate },
                { "江西", CityClimateType.MiddleClimate },
                { "山东", CityClimateType.NorthClimate },
                { "河南", CityClimateType.MiddleClimate },
                { "湖北", CityClimateType.MiddleClimate },
                { "湖南", CityClimateType.MiddleClimate },
                { "广西", CityClimateType.SouthClimate },
                { "海南", CityClimateType.SouthClimate },
                { "四川", CityClimateType.MiddleClimate },
                { "贵州", CityClimateType.SouthClimate },
                { "云南", CityClimateType.SouthClimate },
                { "陕西", CityClimateType.NorthClimate },
                { "甘肃", CityClimateType.NorthClimate },
                { "青海", CityClimateType.NorthClimate },
                { "宁夏", CityClimateType.NorthClimate },
                { "新疆", CityClimateType.NorthClimate },
                { "西藏", CityClimateType.NorthClimate },
                { "台湾", CityClimateType.SouthClimate },
                { "香港", CityClimateType.SouthClimate },
                { "澳门", CityClimateType.SouthClimate }
            };

            CityDictE = new Dictionary <string, CityClimateType>
            {
                // Todo Fill the data
                { "Beijing", CityClimateType.NorthClimate },
                { "Shanghai", CityClimateType.MiddleClimate },
                { "Guangdong", CityClimateType.SouthClimate },
                { "Tianjin", CityClimateType.NorthClimate },
                { "Chongqing", CityClimateType.MiddleClimate },
                { "Hebei", CityClimateType.NorthClimate },
                { "Shanxi", CityClimateType.NorthClimate },
                { "Neimeng", CityClimateType.NorthClimate },
                { "Liaoning", CityClimateType.NorthClimate },
                { "Jilin", CityClimateType.NorthClimate },
                { "Heilongjiang", CityClimateType.NorthClimate },
                { "Jiangsu", CityClimateType.MiddleClimate },
                { "Zhejiang", CityClimateType.MiddleClimate },
                { "Anhui", CityClimateType.MiddleClimate },
                { "Fujian", CityClimateType.MiddleClimate },
                { "Jiangxi", CityClimateType.MiddleClimate },
                { "Shandong", CityClimateType.NorthClimate },
                { "Henan", CityClimateType.MiddleClimate },
                { "Hubei", CityClimateType.MiddleClimate },
                { "Hunan", CityClimateType.MiddleClimate },
                { "Guangxi", CityClimateType.SouthClimate },
                { "Hainan", CityClimateType.SouthClimate },
                { "Sichuan", CityClimateType.MiddleClimate },
                { "Guizhou", CityClimateType.SouthClimate },
                { "Yunnan", CityClimateType.SouthClimate },
                { "Shaanxi", CityClimateType.NorthClimate },
                { "Gansu", CityClimateType.NorthClimate },
                { "Qinghai", CityClimateType.NorthClimate },
                { "Ningxia", CityClimateType.NorthClimate },
                { "Xinjiang", CityClimateType.NorthClimate },
                { "Tibet", CityClimateType.NorthClimate },
                { "Taiwan", CityClimateType.SouthClimate },
                { "Hongkong", CityClimateType.SouthClimate },
                { "Macau", CityClimateType.SouthClimate }
            };
        }
 public EnergySavingRatio(EnergySavingRatio other)
 {
     EnergyType = other.EnergyType;
     TempValue  = other.TempValue;
 }