Exemplo n.º 1
0
 public FilterFactorsForm(Horse horse, List<FactorPerformance> selectedFactors)
 {
     _horse = horse;
     _originalSelectedFactors = selectedFactors;
     CopyFPList(_originalSelectedFactors, _selectedFactors);
     InitializeComponent();
 }
Exemplo n.º 2
0
        public void Bind(Horse horse)
        {
            if(null==horse)
            {
                return;
            }

            _horse = horse;

            Cursor = Cursors.WaitCursor;
            try
            {

                string jockey = horse.CorrespondingBrisHorse.Jockey;
                string trainer = horse.CorrespondingBrisHorse.TrainersFullName;

                _tbJockeyName.Text = jockey;
                _tbTrainerName.Text = trainer;

                _tbTrainersStatistics.Text = FactorStatisticManager.GlobalStatisticsPerTrainer(trainer).ToString();
                _tbJockeyStats.Text = FactorStatisticManager.GlobalStatisticsPerJockey(jockey).ToString();
                _tbJockeyTrainer.Text = FactorStatisticManager.GlobalStatisticsPerTrainerAndJockey(trainer, jockey).ToString();
                _grid.Rows.Clear();

                var factorsStatics = horse.FactorStatisticsForHorse;

                _grid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None;
                factorsStatics.ForEach(AddFactorToGrid);
                _grid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
Exemplo n.º 3
0
        public void Bind(Horse horse)
        {
            _horse = horse;

            RefreshDisplay();
            horse._updateObserverEvent += UpdateGrid;
            horse._updateRunningLineEvent += UpdateRunningLine;
            var ppc = _horse.CorrespondingBrisHorse.PastPerformances;

            if (null == _xrayCtrl)
            {
                return;
            }

            if (null == ppc || ppc.Count <= 0)
            {
                _xrayCtrl.Clear();
            }
            else
            {
                var pp = ppc[0];
                _xrayCtrl.Bind(pp.Date, pp.TrackCode, pp.Parent.Name, Convert.ToInt32(pp.RaceNumber));
            }

            //            LoadDistancesToFlowControl();
        }
Exemplo n.º 4
0
        public IndividualTrainerStatsForm(string trainerName)
        {
            _horse = null;
            _trainerName = trainerName;

            InitializeComponent();
        }
Exemplo n.º 5
0
 Horse GetDummyHorse()
 {
     if(null == _dummyHorse)
     {
         _dummyHorse = DailyCard.Load(DailyCard.ExistingFiles[0]).Races[0].Horses[0];
     }
     return _dummyHorse;
 }
Exemplo n.º 6
0
 public void BindHorse(Horse horse)
 {
     if (_horse != horse)
     {
         _horse = horse;
         _cynthiaProjectionsCtrl.Bind(horse);
     }
 }
Exemplo n.º 7
0
        public void BindHorse(Horse horse)
        {
            string sire1 = horse.CorrespondingBrisHorse.Sire;
            string sire2 = horse.CorrespondingBrisHorse.DamSire;

            DataTable dt = Sire.GetSiresInfo(sire1, sire2);

            _grid.Columns.Clear();

            _grid.Columns.Add("S-DS", "S-DS");
            _grid.Columns.Add("Name", "Name");
            _grid.Columns.Add("FTS", "FTS");
            _grid.Columns.Add("MUD", "MUD");
            _grid.Columns.Add("TURF", "TURF");
            _grid.Columns.Add("AWS", "AWS");
            _grid.Columns.Add("DIST", "DIST");

            int index = _grid.Rows.Add();

            Font boldFont = new Font(_grid.DefaultCellStyle.Font, FontStyle.Bold);
            _grid.Rows[index].DefaultCellStyle.Font = boldFont;

            _grid["FTS", index].Value = "FTS";
            _grid["MUD", index].Value = "M";
            _grid["TURF", index].Value = "T";
            _grid["AWS", index].Value = "AWS";
            _grid["DIST", index].Value = "D";

            foreach (DataRow dr in dt.Rows)
            {
                index = _grid.Rows.Add();
                DataGridViewCellCollection cells = _grid.Rows[index].Cells;

                cells[0].Value = dr["S/DS"].ToString();
                cells[0].Style.Font = boldFont;
                cells[1].Value = dr["Name"].ToString();
                cells[2].Value = dr["FTS"].ToString();
                cells[3].Value = dr["MUD"].ToString();
                cells[4].Value = dr["TURF"].ToString();
                cells[5].Value = dr["AWS"].ToString();
                cells[6].Value = dr["DIST"].ToString();
            }

            for(int i =0; i < _grid.Columns.Count; ++i)
            {
                _grid.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
            }

            _grid.BorderStyle = BorderStyle.None;
            _grid.CellBorderStyle = DataGridViewCellBorderStyle.None;
            _grid.DefaultCellStyle.BackColor = Color.Beige;
            _grid.DefaultCellStyle.SelectionBackColor = Color.Beige;
            _grid.RowHeadersVisible = false;
            _grid.ColumnHeadersVisible = false;

            _grid.BackgroundColor = Color.Beige;
        }
Exemplo n.º 8
0
 public FactorStatsPerTrainerForm(Horse horse, long bitMask)
 {
     _horse = horse;
     _selectedFactorStatistic = FactorStatisticManager.Get(bitMask);
     _selectedFactorStatisticForTrainer = FactorStatisticManager.Get(bitMask,_horse.CorrespondingBrisHorse.TrainersFullName);
     _trainerSummary = TrainerSummary.Make(_horse.CorrespondingBrisHorse.TrainersFullName);
     _horseFactors = horse.FactorStatisticsForHorse;
     InitializeComponent();
 }
Exemplo n.º 9
0
 double GetExactaPayout(Horse firstHorse, Horse secondHorse)
 {
     Debug.Assert(null != _oddsRetriever);
     int h1 = firstHorse.GetProgramNumberWithoutEntryChar();
     int h2 = secondHorse.GetProgramNumberWithoutEntryChar();
     DataTable dt = _oddsRetriever.ExactaPayouts;
     Debug.Assert(null != dt);
     return (double) dt.Rows[h1 - 1][h2 - 1];
 }
Exemplo n.º 10
0
        public void Bind(Horse horse)
        {
            _horse = horse;
            _labelHorseName.Text = _horse.Name;
            ShowCynthiaParsToGrid(_gridTodaysRacePars, horse.Parent.CynthiaParsForTheRace,null);
            LoadPastPerformances(horse);

            _cynthiaProjectionsCtrl.Bind(horse);
        }
        public IndividualHorsePastPerformancesForm(string trackCode, int year, int month, int day, int raceNumber, string programNumber)
        {
            DailyCard dc = DailyCard.Load(trackCode,year,month,day);
            Race race = dc.GetRaceFromRaceNumber(raceNumber);
            _myHorse = race.GetHorseByProgramNumber(programNumber);

            if (null == _myHorse)
            {
                throw new Exception("Sorry, horse not found");
            }
            InitializeComponent();
        }
 public void Bind(Horse horse)
 {
     List<Factor> list = horse.CorrespondingBrisHorse.GetMatchingHandicappingFactors(horse);
     this.SuspendLayout();
     string txt = "";
     foreach (Factor f in list)
     {
         txt += f.Name + Environment.NewLine;
     }
     _txtbox.Text = txt;
     this.ResumeLayout(false);
     this.Refresh();
 }
Exemplo n.º 13
0
        public static int NumberOfKeyRaces(Horse horse, KeyRaces keyRaces)
        {
            int count = 0;

            foreach (var ri in keyRaces.Graph[horse])
            {
                if(ri.Matches >=2)
                {
                    ++count;
                }
            }

            return count;
        }
Exemplo n.º 14
0
        public EditHorseWeightsForm(Horse horse)
        {
            _horse = horse;
            InitializeComponent();

            _valueIndexRadioButtons.Add(_rbVI_0);
            _valueIndexRadioButtons.Add(_rbVI_1);
            _valueIndexRadioButtons.Add(_rbVI_2);
            _valueIndexRadioButtons.Add(_rbVI_3);
            _valueIndexRadioButtons.Add(_rbVI_4);
            _valueIndexRadioButtons.Add(_rbVI_5);

            _weightIndexRadioButtons.Add(_rbWI_0);
            _weightIndexRadioButtons.Add(_rbWI_1);
            _weightIndexRadioButtons.Add(_rbWI_2);
            _weightIndexRadioButtons.Add(_rbWI_3);
            _weightIndexRadioButtons.Add(_rbWI_4);
            _weightIndexRadioButtons.Add(_rbWI_5);
        }
Exemplo n.º 15
0
        public void BindHorse(Horse horse)
        {
            _trackCode = "";
            _horse = horse;

            if (null != horse && null != horse.MatchingFactors)
            {
                DataTable dt = horse.MatchingFactors.Tables[0];

                List<DataRow> rowsToDelete = new List<DataRow>();
                foreach (DataRow dr in dt.Rows)
                {
                    if ((int)dr["M"] == 1)
                    {
                        rowsToDelete.Add(dr);
                    }
                }

                foreach (DataRow dr in rowsToDelete)
                {
                    dt.Rows.Remove(dr);
                }

                _grid.DataSource = dt;
                _trackCode = horse.CorrespondingBrisHorse.Parent.Parent.TrackCode;
                _raceAttributes = horse.Parent.RaceAttributesFlag;
                _grid.Columns["ROI"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                _grid.Columns["ROI"].DefaultCellStyle.Format = "##.00";
                _grid.Columns["IV"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                _grid.Columns["IV"].DefaultCellStyle.Format = "##.00";
                _grid.Sort(_grid.Columns["ROI"], ListSortDirection.Descending);
                _grid.Columns["M"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
                _grid.Columns["W"].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

                InitializeSelectedFactors();
            }
        }
        private void InsertHorseToGrid(Horse horse)
        {
            int rowIndex = _grid.Rows.Add();
            var cells = _grid.Rows[rowIndex].Cells;

            cells[0].Value = horse.ProgramNumber;
            cells[1].Value = horse.Name;
            cells[2].Value = horse.CorrespondingBrisHorse.TrainersFullName;

            double iv;
            int starters;
            double winningPercent;
            double roi;
            /*
             * TODO : fix this
            var fs = FactorStatisticManager.Get()
            FactorStatistics.GetTrainersIV(horse.CorrespondingBrisHorse.TrainersFullName, out iv, out starters, out winningPercent, out roi);

            cells[3].Value = starters;
            cells[4].Value = string.Format("{0:0.00}%",winningPercent);
            cells[5].Value = string.Format("{0:0.00}", roi);
            cells[6].Value = string.Format("{0:0.00}", iv);
            */
        }
Exemplo n.º 17
0
        internal static List<Factor> GetMatchingFactors(Horse myhorse)
        {
            BrisRace race = myhorse.CorrespondingBrisHorse.Parent;
            BrisHorse horse = myhorse.CorrespondingBrisHorse;

            var af = new List<Factor>();

            foreach (Factor f in AvailableFactorsAsList)
            {
                if (f.AppliesToHorse(myhorse))
                {
                    af.Add(f);
                }
            }
            return af;
        }
Exemplo n.º 18
0
 public abstract bool AppliesToHorse(Horse myhorse);
Exemplo n.º 19
0
 public RealTimeOddsHistoryForm(Horse horse, DataTable exactaPayouts)
 {
     _horse = horse;
     _exactaPayouts = exactaPayouts;
     InitializeComponent();
 }
Exemplo n.º 20
0
 public HorseFractionsComponent(Horse myHorse, BrisHorse.TimingType timingType)
 {
     _myHorse = myHorse;
     _timingType = timingType;
     InitializeComponent();
 }
Exemplo n.º 21
0
 public ShowAllTimeGraphsForm(Horse horse)
 {
     _horse = horse;
     InitializeComponent();
 }
Exemplo n.º 22
0
        void LoadPastPerformances(Horse horse)
        {
            DataGridView g = _gridPastPerformances;
            g.Columns.Clear();

            g.Columns.Add("DaysOff", "DaysOff");
            g.Columns.Add("Track", "Track");
            g.Columns.Add("Class", "Class");
            g.Columns.Add("Dist", "Dist");
            g.Columns.Add("Surf", "Surf");
            g.Columns.Add("About", "About");
            g.Columns.Add("1stCall", "1stCall");
            g.Columns.Add("2ndCall", "2ndCall");
            g.Columns.Add("Final", "Final");
            g.Columns.Add("Var", "Var");
            g.Columns.Add("AvgVar", "AvgVar");
            g.Columns.Add("Adj1stCall", "Adj1stCall");
            g.Columns.Add("Adj2ndCall", "Adj2ndCall");
            g.Columns.Add("AdjFinal", "AdjFinal");

            foreach (BrisPastPerformance pp in horse.CorrespondingBrisHorse.PastPerformances)
            {
                int i = g.Rows.Add();
                g["DaysOff", i].Value = pp.DaysSinceLastRace;
                g["Class", i].Value = pp.CynthiaParForTheRace.CynthiaClassification;
                g["Track", i].Value = pp.TrackCode;
                g["Dist", i].Value = pp.Distance;
                g["Surf", i].Value = pp.Surface;
                BrisPastPerformance.FractionCallsToUseForCynthia f = pp.FractionsToUseForCynthia;
                g["1stCall", i].Value = Utilities.ConvertTimeToMMSSFifth(f.FirstCall);
                g["2ndCall", i].Value = Utilities.ConvertTimeToMMSSFifth(f.SecondCall);
                g["Final", i].Value = Utilities.ConvertTimeToMMSSFifth(f.FinalCall);
                g["Var", i].Value = pp.TrackVariant.ToString();
                g["AvgVar", i].Value = pp.AvgVariant.ToString();
                g["Adj1stCall", i].Value = Utilities.ConvertTimeToMMSSFifth(pp.AdjustedFirstCall);
                g["Adj2ndCall", i].Value = Utilities.ConvertTimeToMMSSFifth(pp.AdjustedSecondCall);
                g["AdjFinal", i].Value = Utilities.ConvertTimeToMMSSFifth(pp.AdjustedFinalCall);

                g.Rows[i].Tag = pp;

                foreach (DataGridViewCell cell in g.Rows[i].Cells)
                {
                    if (!pp.CynthiaParForTheRace.IsValid)
                    {
                        cell.Style.BackColor = Color.Red;
                    }
                    else
                    {
                        if (pp.IsATurfRace)
                        {
                            cell.Style.BackColor = Color.LightGreen;
                        }
                    }
                }

            }
        }
Exemplo n.º 23
0
        private void UpdateRunningLine(Horse horse)
        {
            foreach (DataGridViewRow row in _grid.Rows)
            {
                if (row.Tag == horse)
                {
                    //UpdateNeuralNetworkDecisions(row, horse);
                    BrisPastPerformance pp = horse.SelectedRunningLine;
                    if (null != pp)
                    {
                        row.Cells[_goldenPaceFigureForThisHorse].Value = pp.GoldenPaceFigureForThisHorse;
                        row.Cells[_goldenPaceFigureIndex].Value = pp.GoldenPaceFigureForTheRace;
                        row.Cells[_goldenFigureForTheWinnerIndex].Value = pp.GoldenFigureForTheWinner;
                        row.Cells[_goldenFigureForThisIndex].Value = pp.GoldenFigureForThisHorse;

                        Color backColor = Color.Black;
                        Color foreColor = Color.White;

                        if (pp.GoldenFigureForTheWinner == -999)
                        {
                            backColor = Color.Gray;
                            foreColor = Color.Gray;
                        }

                        row.Cells[_goldenFigureForTheWinnerIndex].Style.BackColor = backColor;
                        row.Cells[_goldenFigureForTheWinnerIndex].Style.ForeColor = foreColor;
                        row.Cells[_goldenFigureForTheWinnerIndex].Style.SelectionBackColor = backColor;
                        row.Cells[_goldenFigureForTheWinnerIndex].Style.SelectionForeColor = foreColor;

                        backColor = Color.Black;
                        foreColor = Color.White;

                        if (pp.GoldenFigureForThisHorse == -999)
                        {
                            backColor = Color.Gray;
                            foreColor = Color.Gray;
                        }

                        row.Cells[_goldenFigureForThisIndex].Style.BackColor = backColor;
                        row.Cells[_goldenFigureForThisIndex].Style.ForeColor = foreColor;
                        row.Cells[_goldenFigureForThisIndex].Style.SelectionBackColor = backColor;
                        row.Cells[_goldenFigureForThisIndex].Style.SelectionForeColor = foreColor;

                        backColor = Color.DarkTurquoise;
                        foreColor = Color.White;

                        if (pp.GoldenPaceFigureForTheRace == -999)
                        {
                            backColor = Color.Gray;
                            foreColor = Color.Gray;
                        }

                        row.Cells[_goldenPaceFigureForThisHorse].Style.BackColor = backColor;
                        row.Cells[_goldenPaceFigureForThisHorse].Style.ForeColor = foreColor;
                        row.Cells[_goldenPaceFigureForThisHorse].Style.SelectionBackColor = backColor;
                        row.Cells[_goldenPaceFigureForThisHorse].Style.SelectionForeColor = foreColor;

                        row.Cells[_goldenPaceFigureIndex].Style.BackColor = backColor;
                        row.Cells[_goldenPaceFigureIndex].Style.ForeColor = foreColor;
                        row.Cells[_goldenPaceFigureIndex].Style.SelectionBackColor = backColor;
                        row.Cells[_goldenPaceFigureIndex].Style.SelectionForeColor = foreColor;

                        row.Cells[_goldenPaceFigureForThisHorse].Style.Font = _boldFont;
                        row.Cells[_goldenPaceFigureIndex].Style.Font = _boldFont;

                        row.Cells[_goldenFigureForThisIndex].Style.Font = _boldFont;
                        row.Cells[_goldenFigureForTheWinnerIndex].Style.Font = _boldFont;

                        row.Cells[_goldenFigureForThisIndex].Style.Alignment = DataGridViewContentAlignment.MiddleRight;
                        row.Cells[_goldenFigureForTheWinnerIndex].Style.Alignment = DataGridViewContentAlignment.MiddleRight;

                        row.Cells[_distanceColumnIndex].Value = Utilities.ConvertYardsToMilesOrFurlongsAbreviation(pp.DistanceInYards);

                    }
                    else
                    {
                        row.Cells[_goldenPaceFigureForThisHorse].Value = "";
                        row.Cells[_goldenPaceFigureIndex].Value = "";
                        row.Cells[_goldenFigureForTheWinnerIndex].Value = "";
                        row.Cells[_goldenFigureForThisIndex].Value = "";
                        row.Cells[_distanceColumnIndex].Value = "";
                    }
                }
            }
        }
Exemplo n.º 24
0
 private void PaintIsBetBetCell(int rowIndex, Horse horse)
 {
     if (horse.IsBestBet)
     {
         _grid[_isBestBetColumnIndex, rowIndex].Value = Properties.Resources.Pointer;
     }
     else
     {
         _grid[_isBestBetColumnIndex, rowIndex].Value = Properties.Resources.NonPointer;
     }
 }
Exemplo n.º 25
0
 public IndividualTrainerStatsForm(Horse horse)
 {
     _horse = horse;
     _trainerName = _horse.CorrespondingBrisHorse.TrainersFullName;
     InitializeComponent();
 }
Exemplo n.º 26
0
 private void PaintIsDonkeyBetCell(int rowIndex, Horse horse)
 {
     if (horse.IsDonkey)
     {
         _grid[_donkeyColumnIndex, rowIndex].Value = Properties.Resources.Donkey;
     }
     else
     {
         _grid[_donkeyColumnIndex, rowIndex].Value = Properties.Resources.ContenderHorse;
     }
 }
Exemplo n.º 27
0
 private static int ComparePrimeRatings(Horse horse1, Horse horse2)
 {
     int h1 = horse1.CorrespondingBrisHorse.PrimePowerRating;
     int h2 = horse2.CorrespondingBrisHorse.PrimePowerRating;
     if (h1 > h2)
     {
         return -1;
     }
     else if (h1 < h2)
     {
         return 1;
     }
     else
     {
         return 0;
     }
 }
 public IndividualHorsePastPerformancesForm(Horse myHorse)
 {
     _myHorse = myHorse;
     InitializeComponent();
 }
Exemplo n.º 29
0
        private void ShowHorseDetails(int rowIndex)
        {
            Horse h = (Horse) _grid.Rows[rowIndex].Tag;
            _currentHorse = h;
            _labelHorseDetails.Text = h.ProgramNumber + ". " + h.Name + " ( Days off: " + h.CorrespondingBrisHorse.DaysSinceLastRace.ToString() + " Period: " + h.CorrespondingBrisHorse.PeriodCoveredByPastPerformancesInDays.ToString() + " Freq: " + h.CorrespondingBrisHorse.RacingFrequencyInDays.ToString() + " )";

            _showRunTogethersControl.BindHorse(h.CorrespondingBrisHorse);
            _cynthiaParsSummaryCtrl1.BindHorse(h);

            _breedingInfoCtrl.BindHorse(h);
            _factorAnalysisCtrl1.Bind(h);

            Form parent = GetParentForm(this);

            if (null != parent)
            {
                parent.Closing += new CancelEventHandler(ParentClosing);
            }
        }
Exemplo n.º 30
0
 public List<Factor> GetMatchingHandicappingFactors(Horse horse)
 {
     if (null == _matchingFactors)
     {
         _matchingFactors = Factor.GetMatchingFactors(horse);
     }
     return _matchingFactors;
 }