Example #1
0
        int GetRTDataDetailData2(ClassCSV cCSV, DateTime datetimeTarg)
        {
            TimeSpan timeSpan = new TimeSpan(0, 0, 3, 0);
            string   strJyo;
            string   codeJyo;
            string   tmp;
            int      tmpint;
            string   numRace;
            int      numUma;
            long     rowTarget;
            long     rowMax;

            _form1.prgJVRead.Value = 0;

            rowTarget = 2;
            rowMax    = cCSV.getDataMaxRow();
            _form1.prgJVRead.Maximum = (int)rowMax;
            while (rowTarget < rowMax)
            {
                // 場コードの特定
                tmp     = cCSV.getData(rowTarget, 3);
                tmp     = tmp.Substring(1, 1);
                strJyo  = cCommon.ShortJyo2Jyo(tmp);
                codeJyo = cCommon.JyogyakuCord(strJyo);
                // レース番号
                tmpint  = int.Parse(cCSV.getData(rowTarget, 6));
                numRace = String.Format("{0:D2}", tmpint);
                // 頭数
                numUma = int.Parse(cCSV.getData(rowTarget, 4));
                operateLoop(cCSV, datetimeTarg, codeJyo, numRace, rowTarget);

                // 速報オッズ(単複枠)の呼び出し
                operateOne(cCSV, datetimeTarg, codeJyo, numRace, numUma, rowTarget, "0B31");

                // 速報タイム型データマイニング予想の呼び出し
                operateOne(cCSV, datetimeTarg, codeJyo, numRace, numUma, rowTarget, "0B13");

                // 速報馬体重の呼び出し
                operateOne(cCSV, datetimeTarg, codeJyo, numRace, numUma, rowTarget, "0B11");

                _form1.prgJVRead.Value = (int)rowTarget;
                _form1.prgJVRead.Value--;

                rowTarget += long.Parse(cCSV.getData(rowTarget, 4)) + 3;
            }
            // すべて終了
            _form1.prgJVRead.Maximum++;
            _form1.prgJVRead.Value =
                _form1.prgJVRead.Maximum;
            _form1.prgJVRead.Maximum--;

            int retJVClose = _form1.axJVLink1.JVClose();

            if (retJVClose != 0)
            {
                cLog.writeLog("[GetPlaceInfoX]JVClose エラー:" +
                              retJVClose);
            }
            return(1);
        }
        bool setDataDM(ClassCSV cCSV, string retbuff, DateTime datetimeTarg, bool isFind)
        {
            List <classDM> listDM = new List <classDM>();

            DateTime dateTime;
            string   strShortJyo;
            string   strJyo;
            long     rowTarget;
            int      numUma;
            int      cnt = 0;

            JVData_Struct.JV_DM_INFO mDMData =
                new JVData_Struct.JV_DM_INFO();
            mDMData.SetDataB(ref retbuff);
            dateTime = DateTime.Parse(
                (mDMData.id.Year +
                 mDMData.id.MonthDay).Insert(4, "/").Insert(7, "/"));
            if (dateTime.ToShortDateString() != datetimeTarg.ToShortDateString())
            {
                return(false);
            }
            if (isFind && dateTime > datetimeTarg)
            {
                return(true);
            }
            strJyo = cCommon.JyoCord(mDMData.id.JyoCD);
            if (strJyo == "")
            {
                return(false);
            }
            strShortJyo = cCommon.Jyo2ShortJyo(strJyo);
            rowTarget   = cCSV.getDataRow(strShortJyo,
                                          int.Parse(mDMData.id.RaceNum));
            numUma = int.Parse(cCSV.getData(rowTarget, 4));
            for (int i = 0; i < numUma; i++)
            {
                if (int.Parse(mDMData.DMInfo[cnt].Umaban) == 0 ||
                    int.Parse(mDMData.DMInfo[cnt].Umaban) > 18)
                {
                    break;
                }
                listDM.Add(new classDM(int.Parse(mDMData.DMInfo[cnt].Umaban),
                                       int.Parse(mDMData.DMInfo[cnt].DMTime)));
                cnt++;
            }
            listDM.Sort((a, b) => a.DMTime - b.DMTime);
            // 書き込み
            for (int i = 0; i < numUma; i++)
            {
                if (listDM[i].Umaban <= 18)
                {
                    cCSV.setData(rowTarget + 1 + listDM[i].Umaban, 9,
                                 (i + 1).ToString());
                }
            }

            return(false);
        }
Example #3
0
        void writeHeadData(ClassCSV cCSV)
        {
            long rowTarget = 2;

            while (rowTarget < cCSV.getDataMaxRow())
            {
                cCSV.setData(rowTarget + 1, 29, "馬体重");
                cCSV.setData(rowTarget + 1, 30, "増減");
                rowTarget += long.Parse(cCSV.getData(rowTarget, 4)) + 3;
            }
        }
Example #4
0
        void setDataTC(ClassCSV cCSV, string retbuff, DateTime datetimeTarg)
        {
            string strShortJyo;
            string strJyo;
            string tmp;
            string tmpTime;
            long   rowTarget;

            JVData_Struct.JV_TC_INFO mTCData =
                new JVData_Struct.JV_TC_INFO();
            mTCData.SetDataB(ref retbuff);
            strJyo = cCommon.JyoCord(mTCData.id.JyoCD);
            if (strJyo == "")
            {
                return;
            }
            strShortJyo = cCommon.Jyo2ShortJyo(strJyo);
            rowTarget   = 2;
            while (rowTarget < cCSV.getDataMaxRow())
            {
                tmp = int.Parse(mTCData.id.Kaiji).ToString() +
                      strShortJyo +
                      int.Parse(mTCData.id.Nichiji).ToString();
                tmpTime = int.Parse(mTCData.TCInfoAfter.Ji).ToString() +
                          ":" + mTCData.TCInfoAfter.Fun;
                if (cCSV.getData(rowTarget, 3) == tmp &&
                    int.Parse(cCSV.getData(rowTarget, 6)) ==
                    int.Parse(mTCData.id.RaceNum))
                {
                    if (cCSV.getData(rowTarget, 5) != tmpTime)
                    {
                        cCSV.setData(rowTarget, 5, tmpTime);
                        break;
                    }
                }
                rowTarget += long.Parse(cCSV.getData(rowTarget, 4)) + 3;
            }
        }
Example #5
0
        public void update(string pathTarg)
        {
            cLog.writeLog("update");
            cOperateForm.disableButton();

            DateTime datetimeTarg;
            //string pathTarg;
            string pathFileR;

            //pathTarg = _form1.textBox1.Text;

            // 出馬表の読み込み
            pathFileR = GetRaceCardFile(pathTarg);
            if (pathFileR == "")
            {
                cOperateForm.enableButton();
                return;
            }

            // 出馬表の読み込み
            //listRcsv = ReadCSV(pathFileR);

            var encoding = Encoding.GetEncoding("shift_jis");

            //cCSV.dataCsvAll = File.ReadAllText(pathFileR, encoding);
            cCSV.linedataCsvAll = File.ReadAllLines(pathFileR, encoding);
            cCSV.createCSVarrdata();



            string tmp;

            tmp          = cCSV.getData(2, 1);
            datetimeTarg = DateTime.Parse(tmp);

            // 追加項目を記入
            writeHeadData(cCSV);

            // 速報開催情報(一括)の呼び出し
            int retval = 0;

            retval = checkJVRTOpen(datetimeTarg);
            if (retval < -1)
            {
                return;
            }

            if (retval == -1)
            {
                cRaceCardStock.GetStockDataDetailData(cCSV, datetimeTarg);
            }
            else
            {
                cRaceCardRT.GetRTDataDetailData(cCSV, datetimeTarg);
            }

            deleteZanteiData(cCSV);

            // ファイル出力
            cCSV.createCSVdataAll();
            File.WriteAllText(pathFileR, cCSV.dataCsvAll, encoding);

            _form1.rtbData.Text = datetimeTarg.ToShortDateString() +
                                  " 出馬表更新完了しました。";

            //_axJVLink1.JVClose();
            _form1.axJVLink1.JVClose();
            System.Media.SystemSounds.Asterisk.Play();
            cOperateForm.enableButton();
        }
Example #6
0
        void deleteZanteiData(ClassCSV cCSV)
        {
            long     rowTarget = 2;
            string   tmp;
            DateTime datecheck;

            while (rowTarget < cCSV.getDataMaxRow())
            {
                tmp       = cCSV.getData(2, 1) + " " + cCSV.getData(rowTarget, 5);
                datecheck = DateTime.Parse(tmp);
                if (DateTime.Now > datecheck)
                {
                    if (cCSV.getData(rowTarget - 1, 13).Contains("(暫定)"))
                    {
                        cCSV.setData(rowTarget - 1, 13,
                                     cCSV.getData(rowTarget - 1, 13).Replace("(暫定)", ""));
                    }
                    if (cCSV.getData(rowTarget - 1, 14).Contains("(暫定)"))
                    {
                        cCSV.setData(rowTarget - 1, 14,
                                     cCSV.getData(rowTarget - 1, 14).Replace("(暫定)", ""));
                    }
                    if (cCSV.getData(rowTarget, 13).Contains("(暫定)"))
                    {
                        cCSV.setData(rowTarget, 13,
                                     cCSV.getData(rowTarget, 13).Replace("(暫定)", ""));
                    }
                    if (cCSV.getData(rowTarget, 14).Contains("(暫定)"))
                    {
                        cCSV.setData(rowTarget, 14,
                                     cCSV.getData(rowTarget, 14).Replace("(暫定)", ""));
                    }
                }

                rowTarget += long.Parse(cCSV.getData(rowTarget, 4)) + 3;
            }
        }
Example #7
0
        void setDataWE(ClassCSV cCSV, string retbuff, DateTime datetimeTarg)
        {
            DateTime timeHappyo;
            DateTime timeRace;
            string   strShortJyo;
            string   strJyo;
            string   tmp;
            string   tmpTenko = "";
            string   tmpSiba  = "";
            string   tmpDirt  = "";
            string   tmpBaba  = "";
            long     rowTarget;

            JVData_Struct.JV_WE_WEATHER mWEData =
                new JVData_Struct.JV_WE_WEATHER();
            mWEData.SetDataB(ref retbuff);
            if (int.Parse(mWEData.HenkoID) == 2)
            {
                strJyo = cCommon.JyoCord(mWEData.id.JyoCD);
                if (strJyo == "")
                {
                    return;
                }
                strShortJyo = cCommon.Jyo2ShortJyo(strJyo);
                rowTarget   = 2;
                timeHappyo  = new DateTime(datetimeTarg.Year,
                                           datetimeTarg.Month,
                                           datetimeTarg.Day,
                                           int.Parse(mWEData.HappyoTime.Hour),
                                           int.Parse(mWEData.HappyoTime.Minute),
                                           0);
                while (rowTarget < cCSV.getDataMaxRow())
                {
                    timeRace = new DateTime(datetimeTarg.Year,
                                            datetimeTarg.Month,
                                            datetimeTarg.Day,
                                            int.Parse(cCSV.getData(rowTarget, 5).Substring(0, 2)),
                                            int.Parse(cCSV.getData(rowTarget, 5).Substring(3, 2)),
                                            0);
                    tmp = int.Parse(mWEData.id.Kaiji).ToString() +
                          strShortJyo +
                          int.Parse(mWEData.id.Nichiji).ToString();
                    if (cCSV.getData(rowTarget, 3) == tmp &&
                        timeHappyo < timeRace)
                    {
                        tmpTenko = cCommon.TenkoCord(mWEData.TenkoBaba.TenkoCD);
                        break;
                    }
                    rowTarget += long.Parse(cCSV.getData(rowTarget, 4)) + 3;
                }
                rowTarget = 2;
                while (rowTarget < cCSV.getDataMaxRow())
                {
                    tmp = int.Parse(mWEData.id.Kaiji).ToString() +
                          strShortJyo +
                          int.Parse(mWEData.id.Nichiji).ToString();
                    if (cCSV.getData(rowTarget, 3) == tmp &&
                        cCSV.getData(rowTarget, 14) != tmpTenko)
                    {
                        cCSV.setData(rowTarget, 14, tmpTenko);
                    }
                    rowTarget += long.Parse(cCSV.getData(rowTarget, 4)) + 3;
                }
            }
            if (int.Parse(mWEData.HenkoID) == 3)
            {
                strJyo = cCommon.JyoCord(mWEData.id.JyoCD);
                if (strJyo == "")
                {
                    return;
                }
                strShortJyo = cCommon.Jyo2ShortJyo(strJyo);
                rowTarget   = 2;
                timeHappyo  = new DateTime(datetimeTarg.Year,
                                           datetimeTarg.Month,
                                           datetimeTarg.Day,
                                           int.Parse(mWEData.HappyoTime.Hour),
                                           int.Parse(mWEData.HappyoTime.Minute),
                                           0);
                while (rowTarget < cCSV.getDataMaxRow())
                {
                    timeRace = new DateTime(datetimeTarg.Year,
                                            datetimeTarg.Month,
                                            datetimeTarg.Day,
                                            int.Parse(cCSV.getData(rowTarget, 5).Substring(0, 2)),
                                            int.Parse(cCSV.getData(rowTarget, 5).Substring(3, 2)),
                                            0);
                    tmp = int.Parse(mWEData.id.Kaiji).ToString() +
                          strShortJyo +
                          int.Parse(mWEData.id.Nichiji).ToString();
                    if (cCSV.getData(rowTarget, 3) == tmp &&
                        timeHappyo < timeRace)
                    {
                        tmpSiba = cCommon.BabaCord(mWEData.TenkoBaba.SibaBabaCD)
                                  .Substring(0, 1);
                        tmpDirt = cCommon.BabaCord(mWEData.TenkoBaba.DirtBabaCD)
                                  .Substring(0, 1);
                        break;
                    }
                    rowTarget += long.Parse(cCSV.getData(rowTarget, 4)) + 3;
                }
                rowTarget = 2;
                while (rowTarget < cCSV.getDataMaxRow())
                {
                    tmpBaba = "";
                    if (cCSV.getData(rowTarget, 9).Contains("ダート"))
                    {
                        tmpBaba = tmpDirt;
                    }
                    else
                    {
                        tmpBaba = tmpSiba;
                    }
                    tmp = int.Parse(mWEData.id.Kaiji).ToString() +
                          strShortJyo +
                          int.Parse(mWEData.id.Nichiji).ToString();
                    if (cCSV.getData(rowTarget, 3) == tmp &&
                        cCSV.getData(rowTarget, 13) != tmpBaba)
                    {
                        cCSV.setData(rowTarget, 13, tmpBaba);
                    }
                    rowTarget += long.Parse(cCSV.getData(rowTarget, 4)) + 3;
                }
            }
        }
        void setDataRA(ClassCSV cCSV, string retbuff, DateTime datetimeTarg)
        {
            DateTime dateTime;
            string   strShortJyo;
            string   strJyo;
            long     rowTarget;
            string   tmpBaba;
            string   tmpTenko;

            JVData_Struct.JV_RA_RACE mRaData =
                new JVData_Struct.JV_RA_RACE();
            mRaData.SetDataB(ref retbuff);
            dateTime = DateTime.Parse(
                (mRaData.id.Year +
                 mRaData.id.MonthDay).Insert(4, "/").Insert(7, "/"));
            if (dateTime.ToShortDateString() != datetimeTarg.ToShortDateString())
            {
                return;
            }
            strJyo = cCommon.JyoCord(mRaData.id.JyoCD);
            if (strJyo == "")
            {
                return;
            }
            strShortJyo = cCommon.Jyo2ShortJyo(strJyo);
            if (strShortJyo == "")
            {
                return;
            }
            rowTarget = cCSV.getDataRow(strShortJyo,
                                        int.Parse(mRaData.id.RaceNum));
            // 発走時刻
            cCSV.setData(rowTarget, 5,
                         mRaData.HassoTime.Substring(0, 2) + ":" +
                         mRaData.HassoTime.Substring(2, 2));
            // 馬場状態
            if (cCSV.getData(rowTarget, 9).Contains("ダート"))
            {
                tmpBaba = cCommon.BabaCord(mRaData.TenkoBaba.DirtBabaCD.Substring(0, 1));
            }
            else
            {
                tmpBaba = cCommon.BabaCord(mRaData.TenkoBaba.SibaBabaCD.Substring(0, 1));
            }
            if (tmpBaba != "")
            {
                tmpBaba = tmpBaba.Substring(0, 1);
            }
            if (tmpBaba != "未設定")
            {
                cCSV.setData(rowTarget, 13, tmpBaba);
            }
            // 天候
            tmpTenko = cCommon.TenkoCord(mRaData.TenkoBaba.TenkoCD);
            if (tmpTenko != "未設定")
            {
                cCSV.setData(rowTarget, 14, tmpTenko);
            }
            if (cCSV.getData(rowTarget, 13).Contains("(暫定)"))
            {
                cCSV.setData(rowTarget, 13, cCSV.getData(rowTarget, 13).Replace("(暫定)", ""));
            }
            if (cCSV.getData(rowTarget, 14).Contains("(暫定)"))
            {
                cCSV.setData(rowTarget, 14, cCSV.getData(rowTarget, 14).Replace("(暫定)", ""));
            }
        }
        void setDataO1(ClassCSV cCSV, string retbuff, DateTime datetimeTarg)
        {
            DateTime dateTime;
            string   strShortJyo;
            string   strJyo;
            long     rowTarget;
            long     rowWrite;
            int      numUma;
            double   odds;
            double   oddslow;
            int      ninki;

            JVData_Struct.JV_O1_ODDS_TANFUKUWAKU mO1Data =
                new JVData_Struct.JV_O1_ODDS_TANFUKUWAKU();
            mO1Data.SetDataB(ref retbuff);
            dateTime = DateTime.Parse(
                (mO1Data.id.Year +
                 mO1Data.id.MonthDay).Insert(4, "/").Insert(7, "/"));
            if (dateTime.ToShortDateString() != datetimeTarg.ToShortDateString())
            {
                return;
            }
            strJyo = cCommon.JyoCord(mO1Data.id.JyoCD);
            if (strJyo == "")
            {
                return;
            }
            strShortJyo = cCommon.Jyo2ShortJyo(strJyo);
            rowTarget   = cCSV.getDataRow(strShortJyo,
                                          int.Parse(mO1Data.id.RaceNum));
            numUma = int.Parse(cCSV.getData(rowTarget, 4));
            for (int i = 0; i < numUma; i++)
            {
                rowWrite = rowTarget + 1 +
                           int.Parse(mO1Data.OddsTansyoInfo[i].Umaban);
                if (mO1Data.OddsTansyoInfo[i].Odds.Contains("*") ||
                    mO1Data.OddsTansyoInfo[i].Odds.Contains("-"))
                {
                    odds = 0;
                }
                else
                {
                    odds = double.Parse(mO1Data.OddsTansyoInfo[i].Odds) / 10;
                }
                cCSV.setData(rowWrite, 5, String.Format("{0:0.0}", odds));
                if (mO1Data.OddsFukusyoInfo[i].OddsLow.Contains("*") ||
                    mO1Data.OddsFukusyoInfo[i].OddsLow.Contains("-"))
                {
                    oddslow = 0;
                }
                else
                {
                    oddslow = double.Parse(mO1Data.OddsFukusyoInfo[i].OddsLow) / 10;
                }
                cCSV.setData(rowWrite, 6, String.Format("{0:0.0}", oddslow));
                if (mO1Data.OddsTansyoInfo[i].Ninki.Contains("*") ||
                    mO1Data.OddsTansyoInfo[i].Ninki.Contains("-"))
                {
                    ninki = 0;
                }
                else
                {
                    ninki = int.Parse(mO1Data.OddsTansyoInfo[i].Ninki);
                }
                cCSV.setData(rowWrite, 10, ninki.ToString());
            }
        }