コード例 #1
0
 public void Init(HeatPumpController heatPumpController, HouseController houseController, DeviceController deviceController)
 {
     _deviceController                 = deviceController;
     _houseController                  = houseController;
     _heatPumpController               = heatPumpController;
     _heatPump                         = _heatPumpController.HeatPump;
     HeatPumpDesGrid.ItemsSource       = _heatPump.HeatPumpDescriptions;
     CoefficientComboBox.SelectedIndex = 0;
     NominalHeatProductionTextBox.Text = _heatPump.NominalHeatProduction.ToString();
     NominalPowerTextBox.Text          = _heatPump.NominalPower.ToString();
     HeatPumpCountTextBox.Text         = _heatPump.HeatPumpCount.ToString();
     CirculationPumpCountTextBox.Text  = _heatPump.CirculationPumpCount.ToString();
     CirculationPumpPowerTextBox.Text  = _heatPump.CirculationPower.ToString();
     FancoilCountTextBox.Text          = _heatPump.FancoilCount.ToString();
     FancoilPowerTextBox.Text          = _heatPump.FancoilPower.ToString();
     _heatPump.PricePerKwht            = _deviceController.ElectricalPrices.OneKwhtPriceFor1PhaseMore100;
     Calculate();
 }
コード例 #2
0
        private StrcutureSystem SetHeatPump(LayoutColumn valueSplitted, StrcutureSystem structure)
        {
            var heatPumpFund = structure.HeatPumpList.Find(c => c.ModelName == valueSplitted.ModelName);

            if (heatPumpFund == null)
            {
                var item = new HeatPump()
                {
                    InstallationArea = valueSplitted.Area,
                    ModelName        = valueSplitted.ModelName
                };
                if (!string.IsNullOrEmpty(valueSplitted.Value))
                {
                    if (item.HeatPumpValue == null)
                    {
                        item.HeatPumpValue = new List <HeatPumpValue>();
                    }
                    if (item.HeatPumpValue.Count == 0)
                    {
                        HeatPumpValue heatPumpValue = new HeatPumpValue();
                        heatPumpValue.LabelValues = new List <string>()
                        {
                            valueSplitted.Value
                        };
                        item.HeatPumpValue.Add(heatPumpValue);
                    }
                }
                structure.HeatPumpList.Add(item);
            }
            else
            {
                if (!string.IsNullOrEmpty(valueSplitted.Value))
                {
                    var valueBag = heatPumpFund.HeatPumpValue.LastOrDefault();
                    if (valueBag != null && !valueBag.LabelValues.Contains(valueSplitted.Value))
                    {
                        valueBag.LabelValues.Add(valueSplitted.Value);
                    }
                }
            }
            return(structure);
        }