private void BindRatio() { ListMaxRatio = new ObservableCollection <int>(); double max = 1.3; double min = 0.5; double defaultMaxRatio = 1; defaultMaxRatio = 0; ListMaxRatio.Clear(); SelectedMaxRatio = 0; if (SelectedSeries != null) { if (SelectedSeries.Contains("FSNP") || SelectedSeries.Contains("FSXNP")) { max = 1.5; } else if (JCHVRF.Model.Project.CurrentProject.SubRegionCode == "TW" && SelectedSeries.StartsWith("IVX,")) { min = 1; } for (int i = (int)(max * 100); i >= min * 100; i -= 10) { ListMaxRatio.Add(i); } this.SelectedIndex = (int)(Math.Round(max - defaultMaxRatio, 2) * 10); } }
private void BindRatio() { ListMaxRatio = new ObservableCollection <ComboBox>(); double max = 1.3; double min = 0.5; double defaultMaxRatio = 1; defaultMaxRatio = 0; ListMaxRatio.Clear(); if (SelectedSeries != null) { if (SelectedSeries.Contains("FSNP") || SelectedSeries.Contains("FSXNP")) { max = 1.5; } else if (JCHVRF.Model.Project.CurrentProject.SubRegionCode == "TW" && SelectedSeries.StartsWith("IVX,")) { min = 1; } } for (int i = (int)(max * 100); i >= min * 100; i -= 10) { ListMaxRatio.Add(new ComboBox { DisplayName = Convert.ToString(i), Value = Convert.ToString(i) }); } if (CurrentProject.SystemListNextGen != null) { if (CurrentSystem.MaxRatio == 0) { SelectedMaxRatio = Convert.ToString((double)(Math.Round(max - defaultMaxRatio, 2) * 100)); } else { SelectedMaxRatio = Convert.ToString(CurrentSystem.MaxRatio * 100); } // if (CurrentProject.SystemListNextGen.FirstOrDefault(sys => sys.IsActiveSystem == true) != null && CurrentProject.SystemListNextGen.FirstOrDefault(sys => sys.IsActiveSystem == true).OutdoorItem != null) //{ // if (CurrentProject.SystemListNextGen.FirstOrDefault(sys => sys.IsActiveSystem == true).OutdoorItem.MaxRatio == 0) // { // SelectedMaxRatio = Convert.ToString((int)(Math.Round(max - defaultMaxRatio, 2) * 100)); // } // else // { // SelectedMaxRatio = Convert.ToString(CurrentProject.SystemListNextGen.FirstOrDefault(sys => sys.IsActiveSystem == true).OutdoorItem.MaxRatio); // } //} } }
private void BindMaxRatio() { listMaxRatio = new ObservableCollection <int>(); double max = 1.3; double min = 0.5; double defaultMaxRatio = 1; if (SelectedSeries.Contains("FSNP") || SelectedSeries.Contains("FSXNP")) { max = 1.5; } else if (newProjectLegacy.SubRegionCode == "TW" && SelectedSeries.StartsWith("IVX,")) { min = 1; } if (curSystemItem.OutdoorItem != null) { if (SelectedSeries.Contains("FSXNPE") && curSystemItem.OutdoorItem.CoolingCapacity > 150) { max = 1.3; } else if (SelectedSeries.Contains("FSXNPE") && curSystemItem.OutdoorItem.CoolingCapacity <= 150) { max = 1.5; } } if (curSystemItem.SysType == SystemType.OnlyFreshAir) { return; } if (curSystemItem.MaxRatio > max) { curSystemItem.MaxRatio = max; } defaultMaxRatio = curSystemItem.MaxRatio; for (int i = (int)(max * 100); i >= min * 100; i -= 10) { listMaxRatio.Add(i); } this.ListMaxRatio = listMaxRatio; this.SelectedIndex = (int)(Math.Round(max - defaultMaxRatio, 2) * 10); }