Exemple #1
0
        private void UpdateForceOutput()
        {
            List <WallPointResult> cr = null;

            if (AllResults != null)
            {
                if (ReportingPierPointLocation != PierPointLocation.Both)
                {
                    //foreach (var story in SelectedStories)
                    //{
                    if (SelectedStory != null & SelectedCombo != null)
                    {
                        cr = AllResults.Where(k => k.ComboName == SelectedCombo)
                             .SelectMany(r => r.PierForces
                                         .Where(f => f.PierName == SelectedPier)
                                         .Where(b => b.Result.PierPointLocation == ReportingPierPointLocation)
                                         .Where(b => b.Result.StoryName == _SelectedStory)
                                         .Select(a => a.Result)).ToList();
                    }
                    //}
                }

                else
                {
                    //foreach (var story in SelectedStories)
                    //{
                    if (SelectedStory != null & SelectedCombo != null)
                    {
                        cr = AllResults.Where(k => k.ComboName == SelectedCombo)
                             .SelectMany(r => r.PierForces
                                         .Where(f => f.PierName == SelectedPier)
                                         .Where(b => b.Result.StoryName == _SelectedStory)
                                         .Select(a => a.Result)).ToList();
                    }
                    //}
                }

                if (cr != null)
                {
                    if (cr.Count > 0)
                    {
                        V_major_max = cr.Select(r => r.V2_Max).Max();
                        V_major_min = cr.Select(r => r.V2_Min).Min();
                        M_major_max = cr.Select(r => r.M3_Max).Max();
                        M_major_min = cr.Select(r => r.M3_Min).Min();
                        P_max       = cr.Select(r => r.P_Max).Max();
                        P_min       = cr.Select(r => r.P_Min).Min();
                        V_minor_max = cr.Select(r => r.V3_Max).Max();
                        V_minor_min = cr.Select(r => r.V3_Min).Min();
                        M_minor_max = cr.Select(r => r.M2_Max).Max();
                        M_minor_min = cr.Select(r => r.M2_Min).Min();
                    }
                }
            }
        }
Exemple #2
0
        //private void RefreshEtabsData()
        //{
        //    ErrorMessage = "";

        //    try
        //    {
        //        ETABSModelManager manager = new ETABSModelManager();

        //        List<string> comboNames = manager.GetModelComboNames();
        //        AvaliableCombos = new ObservableCollection<string>(comboNames);

        //        List<string> PierNames = manager.GetModelPierNames();
        //        AvaliablePiers = new ObservableCollection<string>(PierNames);

        //        List<string> StoryNames = manager.GetModelStoryNames();
        //        AvaliableStories = new ObservableCollection<string>(StoryNames);
        //    }
        //    catch (Exception)
        //    {

        //        ErrorMessage = "Could not connect to ETABS model.";
        //    }


        //}

        private void UpdateStoryList()
        {
            if (SelectedPier != null)
            {
                if (AllResults != null)
                {
                    if (AvaliableCombos.Count > 0)
                    {
                        var resultsForCurrentPier = AllResults.Where(k => k.ComboName == AvaliableCombos[0]).SelectMany(r => r.PierForces.Where(f => f.PierName == SelectedPier).Select(a => a.Result.StoryName)).Distinct().ToList();
                        AvaliableStories = new ObservableCollection <string>(resultsForCurrentPier);
                    }
                }
            }
        }
        public void PleaseWaitSearch()
        {
            ChangeTracker.SearchString = (ChangeTracker.SearchString == null) ? "" : ChangeTracker.SearchString.Trim();

            if (ChangeTracker.SearchString.Length < 3)
            {
                ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_SEARCH_STRING_TOO_SHORT).ToString());
                ClearSearchResults("");
                return;
            }

            Repository.FindMatches(AllResults, "", SelectedLanguage, MatchFilter2, delegate(IMatchVw m1, IMatchVw m2) { return(0); });

            if (AllResults.Count == 0)
            {
                ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_FORM_NO_MATCH_FOUND).ToString());
                ClearSearchResults("");
            }
            else
            {
                var sportscb = new List <ComboBoxItem>();
                var sports   = AllResults.Where(x => x.SportView != null).Select(x => x.SportView).Distinct().ToList();
                foreach (var group in sports)
                {
                    if (sportscb.Count(x => x.Id == group.LineObject.GroupId) == 0)
                    {
                        sportscb.Add(new ComboBoxItem(group.DisplayName, group.LineObject.GroupId)
                        {
                            OrderId = AllResults.Count(x => x.SportView.LineObject.GroupId == @group.LineObject.GroupId)
                        });
                    }
                }
                for (int i = 1; i < sportscb.Count;)
                {
                    var comboBoxItem = sportscb[i];

                    if (sports.Count(x => x.LineObject.GroupId != comboBoxItem.Id) == 0)
                    {
                        sportscb.RemoveAt(i);
                    }
                    else
                    {
                        i++;
                    }
                }
                Sports = new ObservableCollection <ComboBoxItem>(sportscb.OrderByDescending(x => x.OrderId).ToList());
                ChangeTracker.SearchSelectedSport = Sports[0];
                OnPropertyChanged("SelectedSport");


                var tournaments = new List <ComboBoxItem>();
                var groups      = AllResults.Where(x => x.SportView.LineObject.GroupId == ChangeTracker.SearchSelectedSport.Id).Where(x => x.TournamentView != null).Select(x => x.TournamentView).Distinct().ToList();
                foreach (var group in groups)
                {
                    if (tournaments.Count(x => x.Id == group.LineObject.GroupId) == 0)
                    {
                        tournaments.Add(new ComboBoxItem(group.DisplayName, group.LineObject.GroupId)
                        {
                            OrderId = AllResults.Count(x => x.TournamentView.LineObject.GroupId == @group.LineObject.GroupId)
                        });
                    }
                }
                for (int i = 1; i < tournaments.Count;)
                {
                    var comboBoxItem = tournaments[i];

                    if (groups.Count(x => x.LineObject.GroupId != comboBoxItem.Id) == 0)
                    {
                        tournaments.RemoveAt(i);
                    }
                    else
                    {
                        i++;
                    }
                }
                Tournaments = new ObservableCollection <ComboBoxItem>(tournaments.OrderByDescending(x => x.OrderId).ToList());
                ChangeTracker.SearchSelectedTournament = Tournaments[0];
                OnPropertyChanged("SelectedTournament");

                FillMatches();
            }
        }