Ejemplo n.º 1
0
        public void Init(AppDataModel dm, Race race)
        {
            _dm   = dm;
            _race = race;

            _race.RunsChanged += OnRaceRunsChanged;

            UiUtilities.FillCmbRaceRun(cmbRaceRun, _race);
            UiUtilities.FillGrouping(cmbResultGrouping, _currentRaceRun.GetResultViewProvider().ActiveGrouping);

            cmbFilter.Items.Clear();
            cmbFilter.Items.Add(new CBItem {
                Text = "alle Teilnehmer", Value = "all"
            });
            cmbFilter.Items.Add(new CBItem {
                Text = "Teilnehmer ohne Zeit", Value = "no_time"
            });
            cmbFilter.Items.Add(new CBItem {
                Text = "ausgeschiedene Teilnehmer", Value = "out"
            });
            cmbFilter.Items.Add(new CBItem {
                Text = "offene Teilnehmer (keine Zeit oder Ausscheidung)", Value = "no_data"
            });
            cmbFilter.SelectedIndex = 1;

            cmbDisqualify.ItemsSource = ListOfResultCodesToSet;

            cmbDisqualifyReason.Items.Add("Vorbei am Tor");
            cmbDisqualifyReason.Items.Add("Eingefädelt am Tor");
            cmbDisqualifyReason.Items.Add("Nicht weit genug zurückgestiegen am Tor");
            cmbDisqualifyReason.Items.Add("Hilfe durch fremde Person am Tor");

            this.KeyDown += new KeyEventHandler(Timing_KeyDown);
        }
Ejemplo n.º 2
0
        public void Init(AppDataModel dm, Race race, IImportTime importTimeDevice)
        {
            _importTimeVM = new ImportTimeEntryVM(race, importTimeDevice);

            dgImportTime.ItemsSource = _importTimeVM.ImportEntries;

            cmbRun.SelectedValuePath = "Value";
            UiUtilities.FillCmbRaceRun(cmbRun, race);
        }
Ejemplo n.º 3
0
 private void DisqualifyUC_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (!(bool)e.OldValue && (bool)e.NewValue)
     {
         UiUtilities.FillCmbRaceRun(cmbRaceRun, _race);
         setRaceRun(_dm.GetCurrentRaceRun());
         _viewDisqualifications.View.Refresh();
     }
 }
Ejemplo n.º 4
0
        public void Init(AppDataModel dm, Race race)
        {
            _dm = dm;

            _handTimingVMManager = new HandTimingVMManager(_dm);
            _handTimingVMManager.LoadHandTimingFromFile();

            _race = race;

            cmbCalcRun.SelectedValuePath = "Value";
            UiUtilities.FillCmbRaceRun(cmbCalcRun, race);

            updateHandTimingVM();
        }
        private void StartNumbersUC_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (!(bool)e.OldValue && (bool)e.NewValue) // Became visible
            {
                _snaWorkspace.LoadFromRace(_race, true);

                UiUtilities.FillGrouping(cmbGrouping, _race.RaceConfiguration.Run1_StartistViewGrouping);
                txtNotToBeAssigned.Text = Properties.Settings.Default.StartNumbersNotToBeAssigned;

                SetupDefaults();

                OnWorkspaceChanged(this, null);
                OnCurrentGroupChangedHandler(this, null);
            }
        }
Ejemplo n.º 6
0
        private void initialize()
        {
            RaceResultViewProvider vp = _thisRace.GetResultViewProvider();

            UiUtilities.FillGrouping(cmbTotalResultGrouping, vp.ActiveGrouping);

            cmbTotalResult.Items.Clear();
            cmbTotalResult.Items.Add(new CBItem {
                Text = "Teilnehmer", Value = new CBObjectTotalResults {
                    Type = "participants"
                }
            });
            FillCmbTotalsResultsWithRaceSpecifics(cmbTotalResult);
            cmbTotalResult.Items.Add(new CBItem {
                Text = "Rennergebnis", Value = new CBObjectTotalResults {
                    Type = "raceresults"
                }
            });
            cmbTotalResult.SelectedIndex = cmbTotalResult.Items.Count - 1;
        }
Ejemplo n.º 7
0
        private void InitializeTiming()
        {
            UiUtilities.FillCmbRaceRun(cmbRaceRun, _thisRace);

            cmbManualMode.Items.Add(new CBItem {
                Text = "Laufzeit", Value = "Absolut"
            });
            cmbManualMode.Items.Add(new CBItem {
                Text = "Differenz", Value = "Difference"
            });
            cmbManualMode.SelectedIndex = 1;

            gridManualMode.Visibility = Visibility.Collapsed;

            this.KeyDown += new KeyEventHandler(Timing_KeyDown);

            Properties.Settings.Default.PropertyChanged += SettingChangingHandler;

            _thisRace.RunsChanged += OnRaceRunsChanged;

            UpdateLiveTimingStartStopButtons(false); // Initial status
        }
Ejemplo n.º 8
0
        private void ConnectUiToRaceRun(RaceRun raceRun)
        {
            if (raceRun != null)
            {
                _rslVP = (new ViewConfigurator(_thisRace)).GetRemainingStartersViewProvider(raceRun);
                dgRemainingStarters.ItemsSource = _rslVP.GetView();
                UiUtilities.EnableOrDisableColumns(_thisRace, dgRemainingStarters);

                dgRunning.ItemsSource = raceRun.GetOnTrackList();
                UiUtilities.EnableOrDisableColumns(_thisRace, dgRunning);

                dgFinish.ItemsSource = raceRun.GetInFinishList();
                UiUtilities.EnableOrDisableColumns(_thisRace, dgFinish);

                lblStartList.DataContext = _rslVP.GetView();
            }
            else
            {
                dgRemainingStarters.ItemsSource = null;
                dgRunning.ItemsSource           = null;
                dgFinish.ItemsSource            = null;
            }
        }
        public void Init(RaceConfiguration raceConfig)
        {
            // ApplicationFolder + raceconfigpresets
            _raceConfigurationPresets = new RaceConfigurationPresets(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), @"raceconfigpresets"));
            _raceConfiguration        = raceConfig.Copy();

            refreshConfigPresetsUI();

            // Configuration Screen
            cmbRuns.Items.Clear();
            cmbRuns.Items.Add(new CBItem {
                Text = "1", Value = 1
            });
            cmbRuns.Items.Add(new CBItem {
                Text = "2", Value = 2
            });
            cmbRuns.Items.Add(new CBItem {
                Text = "3", Value = 3
            });
            cmbRuns.Items.Add(new CBItem {
                Text = "4", Value = 4
            });
            cmbRuns.Items.Add(new CBItem {
                Text = "5", Value = 5
            });
            cmbRuns.Items.Add(new CBItem {
                Text = "6", Value = 6
            });

            // Result
            UiUtilities.FillGrouping(cmbConfigErgebnisGrouping);

            cmbConfigErgebnis.Items.Clear();
            cmbConfigErgebnis.Items.Add(new CBItem {
                Text = "Bester Durchgang", Value = "RaceResult_BestOfTwo"
            });
            cmbConfigErgebnis.Items.Add(new CBItem {
                Text = "Summe der besten 2 Durchgänge", Value = "RaceResult_SumBest2"
            });
            cmbConfigErgebnis.Items.Add(new CBItem {
                Text = "Summe", Value = "RaceResult_Sum"
            });
            cmbConfigErgebnis.Items.Add(new CBItem {
                Text = "Summe + Punkte nach DSV Schülerreglement", Value = "RaceResult_SumDSVPointsSchool"
            });

            // Run 1
            UiUtilities.FillGrouping(cmbConfigStartlist1Grouping);
            cmbConfigStartlist1.Items.Clear();
            cmbConfigStartlist1.Items.Add(new CBItem {
                Text = "Startnummer (aufsteigend)", Value = "Startlist_1stRun_StartnumberAscending"
            });
            cmbConfigStartlist1.Items.Add(new CBItem {
                Text = "Punkte (nicht gelost)", Value = "Startlist_1stRun_Points_0"
            });
            cmbConfigStartlist1.Items.Add(new CBItem {
                Text = "Punkte (ersten 15 gelost)", Value = "Startlist_1stRun_Points_15"
            });
            cmbConfigStartlist1.Items.Add(new CBItem {
                Text = "Punkte (ersten 30 gelost)", Value = "Startlist_1stRun_Points_30"
            });

            // Run 2
            UiUtilities.FillGrouping(cmbConfigStartlist2Grouping);
            cmbConfigStartlist2.Items.Clear();
            cmbConfigStartlist2.Items.Add(new CBItem {
                Text = "Startnummer (aufsteigend)", Value = "Startlist_2nd_StartnumberAscending"
            });
            //cmbConfigStartlist2.Items.Add(new GroupingCBItem { Text = "Startnummer (aufsteigend, inkl. ohne Ergebnis)", Value = "Startlist_2nd_StartnumberAscending" });
            cmbConfigStartlist2.Items.Add(new CBItem {
                Text = "Startnummer (absteigend)", Value = "Startlist_2nd_StartnumberDescending"
            });
            //cmbConfigStartlist2.Items.Add(new GroupingCBItem { Text = "Startnummer (absteigend, inkl. ohne Ergebnis)", Value = "Startlist_2nd_StartnumberDescending" });
            cmbConfigStartlist2.Items.Add(new CBItem {
                Text = "Vorheriger Lauf nach Zeit (nicht gedreht)", Value = "Startlist_2nd_PreviousRun_0_OnlyWithResults"
            });
            cmbConfigStartlist2.Items.Add(new CBItem {
                Text = "Vorheriger Lauf nach Zeit (nicht gedreht, inkl. ohne Ergebnis)", Value = "Startlist_2nd_PreviousRun_0_AlsoWithoutResults"
            });
            cmbConfigStartlist2.Items.Add(new CBItem {
                Text = "Vorheriger Lauf nach Zeit (ersten 15 gedreht)", Value = "Startlist_2nd_PreviousRun_15_OnlyWithResults"
            });
            cmbConfigStartlist2.Items.Add(new CBItem {
                Text = "Vorheriger Lauf nach Zeit (ersten 15 gedreht, inkl. ohne Ergebnis)", Value = "Startlist_2nd_PreviousRun_15_AlsoWithoutResults"
            });
            cmbConfigStartlist2.Items.Add(new CBItem {
                Text = "Vorheriger Lauf nach Zeit (ersten 30 gedreht)", Value = "Startlist_2nd_PreviousRun_30_OnlyWithResults"
            });
            cmbConfigStartlist2.Items.Add(new CBItem {
                Text = "Vorheriger Lauf nach Zeit (ersten 30 gedreht, inkl. ohne Ergebnis)", Value = "Startlist_2nd_PreviousRun_30_AlsoWithoutResults"
            });
            cmbConfigStartlist2.Items.Add(new CBItem {
                Text = "Vorheriger Lauf nach Zeit (alle gedreht)", Value = "Startlist_2nd_PreviousRun_all_OnlyWithResults"
            });
            cmbConfigStartlist2.Items.Add(new CBItem {
                Text = "Vorheriger Lauf nach Zeit (alle gedreht, inkl. ohne Ergebnis)", Value = "Startlist_2nd_PreviousRun_all_AlsoWithoutResults"
            });

            ResetConfigurationSelectionUI(_raceConfiguration);
        }
Ejemplo n.º 10
0
 private void OnRaceRunsChanged(object sender, EventArgs e)
 {
     UiUtilities.FillCmbRaceRun(cmbRaceRun, _thisRace);
 }
Ejemplo n.º 11
0
        private void displayView(ViewProvider viewProvider)
        {
            clearDataGrid();

            _viewProvider = viewProvider;

            if (_viewProvider == null)
            {
                return;
            }

            if (!(_viewProvider is StartListViewProvider))
            {
                dgView.Columns.Add(createColumnPosition("Position", "Position", false));
            }

            dgView.Columns.Add(createColumn("StartNumber", "Participant.StartNumber", "StNr"));
            dgView.Columns.Add(createColumn("Name", "Participant.Name", "Name"));
            dgView.Columns.Add(createColumn("Firstname", "Participant.Firstname", "Vorname"));
            dgView.Columns.Add(createColumn("Year", "Participant.Year", "Jg."));
            dgView.Columns.Add(createColumn("Class", "Participant.Class", "Klasse"));
            dgView.Columns.Add(createColumn("Club", "Participant.Club", "Verein"));
            dgView.Columns.Add(createColumn("Nation", "Participant.Nation", "Nat."));

            // Race Run Results
            if (_viewProvider is RaceRunResultViewProvider rrrVP)
            {
                dgView.Columns.Add(createColumnTime("Zeit", "Runtime", "ResultCode"));
                dgView.Columns.Add(createColumnDiff("Diff", "DiffToFirst"));
                dgView.Columns.Add(createColumnDiffInPercentage("[%]", "DiffToFirstPercentage"));
                dgView.Columns.Add(createColumnAnmerkung());

                setWarningLabelHandler(new RaceRunCompletedWarningLabelHandler(rrrVP.RaceRun, lblWarning));
            }

            // Total Results
            else if (_viewProvider is RaceResultViewProvider)
            {
                foreach (var r in _thisRace.GetRuns())
                {
                    dgView.Columns.Add(createColumnTime(string.Format("Zeit {0}", r.Run), string.Format("SubResults[{0}].Runtime", r.Run), string.Format("SubResults[{0}].RunResultCode ", r.Run)));
                    dgView.Columns.Add(createColumnDiff(string.Format("Diff {0}", r.Run), string.Format("SubResults[{0}].DiffToFirst", r.Run)));
                    dgView.Columns.Add(createColumnDiffInPercentage(string.Format("[%] {0}", r.Run), string.Format("SubResults[{0}].DiffToFirstPercentage", r.Run)));
                    dgView.Columns.Add(createColumnPosition(string.Format("SubResults[{0}].Position", r.Run), string.Format("SubResults[{0}].Position", r.Run), true));
                }

                dgView.Columns.Add(createColumnTime("Total", "TotalTime", "ResultCode"));
                dgView.Columns.Add(createColumnAnmerkung());

                setWarningLabelHandler(new RaceCompletedWarningLabelHandler(_thisRace, lblWarning));
            }
            // Start List
            else if (_viewProvider is StartListViewProvider)
            {
                if (_viewProvider is BasedOnResultsFirstRunStartListViewProvider slVP2)
                {
                    dgView.Columns.Add(createColumnTime("Zeit", "Runtime", "ResultCode"));
                    setWarningLabelHandler(new RaceRunCompletedWarningLabelHandler(slVP2.BasedOnRun, lblWarning));
                }
                else
                {
                    setWarningLabelHandler(new RaceWarningLabelHandler(_thisRace, lblWarning));
                }
            }

            dgView.ItemsSource = _viewProvider.GetView();
            cmbTotalResultGrouping.SelectCBItem(_viewProvider.ActiveGrouping);

            UiUtilities.EnableOrDisableColumns(_thisRace, dgView);
        }