Exemplo n.º 1
0
        /*  DataGridView1[0, 0].Style.BackColor =*/

        unsafe private void Form2_Load(object sender, EventArgs e)
        {
            /* レース名書き込み */
            String Grade = DataClass.getRaceGrade();

            this.Text = Int32.Parse(DataClass.getRaceKaiji()) + Cource + Int32.Parse(DataClass.getRaceNichiji()) + " "
                        + DataClass.getRaceNum() + "R:" + DataClass.getRaceName();
            LabelCource.Text = Cource + DataClass.getRaceNum() + "R";

            if (Grade == "一般" || Grade == "特別" || Grade == "")
            {
                LabelRaceName.Text = DataClass.getRaceName();
            }
            else
            {
                LabelRaceName.Text = DataClass.getRaceName() + "(" + DataClass.getRaceGrade() + ")";
            }

            switch (CourceColor)
            {
            case 1:
                flowLayoutPanel1.BackColor = Color.Blue;
                break;

            case 2:
                flowLayoutPanel1.BackColor = Color.Green;
                break;

            case 3:
                flowLayoutPanel1.BackColor = Color.Purple;
                break;
            }

            /* トラック */

            int    CODE   = 2009;
            String tmp    = DataClass.getCourceTrack();
            String LibTmp = "";

            LibJvConvFuncClass.jvSysConvFunction(&CODE, tmp, ref LibTmp);
            DataClass.setCourceTrack(LibTmp);

            LabelTrack.Text = DataClass.getCourceTrack() + ":" + DataClass.getDistance() + "m";

            /* フォントの変更 */
            dataGridView1.DefaultCellStyle.Font = new Font("Meiryo UI", 12);
            dataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font("Meiryo UI", 9);
        }
Exemplo n.º 2
0
        unsafe private void InitForm()
        {
            String LibTmp = "";
            int    CODE   = LibJvConvFuncClass.COURCE_CODE;

            String tmp = DataClass.getRaceCource();

            LibJvConvFuncClass.jvSysConvFunction(&CODE, tmp, ref LibTmp);
            Cource = LibTmp;

            /* DataGridViewの高さの変更を出来ないようにする */
            dataGridView1.AllowUserToResizeRows = false;

            /* レース名 */
            LabelCource.Text = Cource;
        }
Exemplo n.º 3
0
        unsafe private String MappingGetRaceCource()
        {
            String LibTmp = "";
            int    CODE   = LibJvConvFuncClass.COURCE_CODE;

            String tmp = DataClass.getRaceCource();

            LibJvConvFuncClass.jvSysConvFunction(&CODE, tmp, ref LibTmp);
            Cource = LibTmp;

            CODE = 2009;
            tmp  = DataClass.getCourceTrack();
            LibJvConvFuncClass.jvSysConvFunction(&CODE, tmp, ref LibTmp);
            DataClass.setCourceTrack(LibTmp);


            return(Cource);
        }
Exemplo n.º 4
0
        unsafe private void SetFormDataWriter()
        {
            int Code;

            Code = 2002;
            String LibTmp = "";

            LibJvConvFuncClass.jvSysConvFunction(&Code, raceData.getWeekDay(), ref LibTmp);
            this.Date.Text = ConvertDateToDate(raceData.getRaceDate()) + "(" + LibTmp + "曜)";

            Code = LibJvConvFuncClass.COURCE_CODE;
            LibJvConvFuncClass.jvSysConvFunction(&Code, raceData.getRaceCource(), ref LibTmp);
            this.Kaisai.Text = "第" + Int32.Parse(raceData.getRaceKaiji()) + "回" + LibTmp + Int32.Parse(raceData.getRaceNichiji()) + "日目";

            RaceNum.Text  = (raceData.getRaceNum().Length ==  1 ? " " : "");
            RaceNum.Text += raceData.getRaceNum() + "R";

            if (raceData.getRaceGradeKai() != 0)
            {
                this.kaiji.Text = "第" + raceData.getRaceGradeKai() + "回";
            }
            else
            {
                this.kaiji.Text = "";
            }

            this.racename.Text = raceData.getRaceName();

            LibTmp = "";
            Code   = LibJvConvFuncClass.RACE_SHUBETSU_LONG_CODE;
            LibJvConvFuncClass.jvSysConvFunction(&Code, raceData.getOldYear(), ref LibTmp);
            this.OldYear.Text = LibTmp;

            //発走時間
            this.label4.Text = raceData.getRaceStartTime().Substring(0, 2) + "時" + raceData.getRaceStartTime().Substring(2, 2) + "分";
        }
Exemplo n.º 5
0
        /* 競走馬データ */
        unsafe private void InitHorceData()
        {
            /* 他クラス共有用のクラスデータの初期化 */
            horceClasses = new List <Class.MainDataHorceClass>();

            /* 自クラス用クラスデータの定義 */
            Class.MainDataHorceClass pHorceClasses;

            /* ライブラリ用呼び出し指定変数 */
            int CODE;

            /* スレッド起動 */
            Thread t = new Thread(new ParameterizedThreadStart(LogOutPutFormThread));

            t.SetApartmentState(ApartmentState.STA);
            main.LogMainCancelFlagChanger(true);        //スレッド開始処理
            String        SE_KEY = DataClass.GET_RA_KEY();
            String        tmp    = "";
            List <String> Arraytmp;

            //RA初回読み込み時にエラーチェック 0もエラー
            if (db.TextReader_aCell("RA", SE_KEY, SE_KEY.Substring(0, 8), 19, ref tmp) == 0)
            {
                main.LogMainCancelFlagChanger(false);        //スレッド開始処理
                return;
            }

            t.Start(tmp);

            for (int i = 1; ; i++)
            {
                pHorceClasses = new Class.MainDataHorceClass();
                String covData = String.Format("{0:00}", i);
                Arraytmp = new List <string>();


                //SE初回読み込み時にエラーチェック 0もエラー
                if (db.TextReader_aCell("SE", SE_KEY + covData, SE_KEY.Substring(0, 8), 0, ref tmp) == 0)
                {
                    break;
                }

                if (tmp == "0" || tmp == "")
                {
                    break;
                }
                else if (tmp.Substring(0, 16) != SE_KEY)
                {
                    break;
                }
                pHorceClasses.KEY1 = tmp;

                if (db.TextReader_Col(SE_KEY.Substring(0, 8), "SE", 0, ref Arraytmp, SE_KEY + covData) == 0)
                {
                    break;
                }

                pHorceClasses.Waku1     = Arraytmp[SE_WAKU];
                pHorceClasses.Umaban1   = Arraytmp[SE_UMA];
                pHorceClasses.KettoNum1 = Int32.Parse(Arraytmp[SE_KETTO]);
                pHorceClasses.Name1     = Arraytmp[SE_NAME];
                pHorceClasses.Futan1    = Arraytmp[SE_FUTAN].Substring(0, 2) + "." + Arraytmp[SE_FUTAN].Substring(2, 1);
                pHorceClasses.Jockey1   = Arraytmp[SE_JOCKEY];

                CODE = LibJvConv.LibJvConvFuncClass.HOUCE_KIND;
                LibJvConvFuncClass.jvSysConvFunction(&CODE, Arraytmp[SE_CODE], ref tmp);
                pHorceClasses.UmaKigou1 = tmp;

                CODE = LibJvConv.LibJvConvFuncClass.JOCKEY_MINARAI_CD;
                LibJvConvFuncClass.jvSysConvFunction(&CODE, Arraytmp[SE_MINARA], ref tmp);
                pHorceClasses.MinaraiCd1 = tmp;

                /**
                 *              db.TextReader_aCell("SE", SE_KEY + covData, SE_KEY.Substring(0, 8), SE_WAKU, ref tmp);
                 *              db.TextReader_aCell("SE", SE_KEY + covData, SE_KEY.Substring(0, 8), SE_UMA, ref tmp);
                 *              db.TextReader_aCell("SE", SE_KEY + covData, SE_KEY.Substring(0, 8), SE_KETTO, ref tmp);
                 *              db.TextReader_aCell("SE", SE_KEY + covData, SE_KEY.Substring(0, 8), SE_NAME, ref tmp);
                 *              db.TextReader_aCell("SE", SE_KEY + covData, SE_KEY.Substring(0, 8), SE_FUTAN, ref tmp);
                 *              db.TextReader_aCell("SE", SE_KEY + covData, SE_KEY.Substring(0, 8), SE_JOCKEY, ref tmp);
                 */

                Arraytmp = new List <string>();

                /* 血統登録番号からマスタを取得 */
                if (db.TextReader_Col("0", "UM", 0, ref Arraytmp, pHorceClasses.KettoNum1.ToString()) == 0)
                {
                    break;
                }

                pHorceClasses.F1       = Arraytmp[6];
                pHorceClasses.M1       = Arraytmp[7];
                pHorceClasses.FM1      = Arraytmp[9];
                pHorceClasses.FFM1     = Arraytmp[10];
                pHorceClasses.F_NUM1   = Arraytmp[15];
                pHorceClasses.FM_NUM1  = Arraytmp[16];
                pHorceClasses.FFM_NUM1 = Arraytmp[17];
                pHorceClasses.FF_NUM1  = Arraytmp[18]; //父父
                pHorceClasses.FFF_NUM1 = Arraytmp[19]; //父父父
                pHorceClasses.FMM_NUM1 = Arraytmp[20]; //母父父

/**
 *              db.TextReader_aCell("UM", pHorceClasses.KettoNum1.ToString(), "0", 15, ref tmp);
 *              db.TextReader_aCell("UM", pHorceClasses.KettoNum1.ToString(), "0", 7, ref tmp);
 *              db.TextReader_aCell("UM", pHorceClasses.KettoNum1.ToString(), "0", 9, ref tmp);
 *              db.TextReader_aCell("UM", pHorceClasses.KettoNum1.ToString(), "0", 16, ref tmp);
 *              db.TextReader_aCell("UM", pHorceClasses.KettoNum1.ToString(), "0", 10, ref tmp);
 *              db.TextReader_aCell("UM", pHorceClasses.KettoNum1.ToString(), "0", 17, ref tmp);
 *              db.TextReader_aCell("UM", pHorceClasses.KettoNum1.ToString(), "0", 18, ref tmp);
 *              db.TextReader_aCell("UM", pHorceClasses.KettoNum1.ToString(), "0", 19, ref tmp);
 *              db.TextReader_aCell("UM", pHorceClasses.KettoNum1.ToString(), "0", 20, ref tmp);
 */


                /* 他クラス共有用のクラスに書き込み */
                horceClasses.Add(pHorceClasses);

                /* 書き込み */
                dataGridView1.Rows.Add(pHorceClasses.Waku1, pHorceClasses.Umaban1, pHorceClasses.UmaKigou1 + pHorceClasses.Name1, "", "", pHorceClasses.MinaraiCd1,
                                       pHorceClasses.Jockey1, pHorceClasses.Futan1 + "kg", "", pHorceClasses.F1, "", pHorceClasses.FM1, "", pHorceClasses.FFM1);

                switch (pHorceClasses.Waku1)
                {
                case "1":
                    dataGridView1[0, i - 1].Style.ForeColor = Color.Black;
                    dataGridView1[0, i - 1].Style.BackColor = Color.White;
                    break;

                case "2":
                    dataGridView1[0, i - 1].Style.ForeColor = Color.White;
                    dataGridView1[0, i - 1].Style.BackColor = Color.Black;
                    break;

                case "3":
                    dataGridView1[0, i - 1].Style.ForeColor = Color.White;
                    dataGridView1[0, i - 1].Style.BackColor = Color.Red;
                    break;

                case "4":
                    dataGridView1[0, i - 1].Style.ForeColor = Color.White;
                    dataGridView1[0, i - 1].Style.BackColor = Color.Blue;
                    break;

                case "5":
                    dataGridView1[0, i - 1].Style.ForeColor = Color.Black;
                    dataGridView1[0, i - 1].Style.BackColor = Color.Yellow;
                    break;

                case "6":
                    dataGridView1[0, i - 1].Style.ForeColor = Color.White;
                    dataGridView1[0, i - 1].Style.BackColor = Color.Green;
                    break;

                case "7":
                    dataGridView1[0, i - 1].Style.ForeColor = Color.Black;
                    dataGridView1[0, i - 1].Style.BackColor = Color.Orange;
                    break;

                case "8":
                    dataGridView1[0, i - 1].Style.ForeColor = Color.Black;
                    dataGridView1[0, i - 1].Style.BackColor = Color.Pink;
                    break;
                }
                dataGridView1[8, i - 1].Style.BackColor  = FuncBloodColor(pHorceClasses.F_NUM1, pHorceClasses.FF_NUM1, pHorceClasses.FFF_NUM1);
                dataGridView1[10, i - 1].Style.BackColor = FuncBloodColor(pHorceClasses.FM_NUM1, pHorceClasses.FMM_NUM1, null);
                dataGridView1[12, i - 1].Style.BackColor = FuncBloodColor(pHorceClasses.FFM_NUM1, null, null);

                /* プログレスバー更新 */
                ProgressStatus++;
            }
            main.LogMainCancelFlagChanger(false);        //スレッド開始処理
            // t.Join();
            t.Abort();
            t.Join();
        }
Exemplo n.º 6
0
        unsafe private void InitTrackStatusInfo(String Key)
        {
            int           LibCode;
            int           GetKind;
            int           ret;
            String        tmp   = "";
            List <String> str   = new List <string>();
            String        Track = raceData.getCourceTrack();

            LibCode = LibJvConvFuncClass.TRACK_CODE_SHORT;
            LibJvConvFuncClass.jvSysConvFunction(&LibCode, Track, ref tmp);

            if (tmp == "")
            {
                return;
            }

            GetKind = (tmp == "芝" ? 2 : 3);

            //競走馬情報

            tmp = "";
            ret = db.TextReader_Col(raceData.getRaceDate(), "WE", 0, ref str, Key);
            if (ret == 0 || str.Count() == 0)
            {
                weLabel.Text       = "---";
                TrackDistance.Text = "---";
                HappyoTime.Text    = "発表前";
            }
            else
            {
                LibCode = 2011;
                LibJvConvFuncClass.jvSysConvFunction(&LibCode, str[1], ref tmp);
                weLabel.Text = tmp;

                HappyoTime.Text = ConvertDateToLongDate(str[4]);

                if (str[4] == "00000000")
                {
                    HappyoTime.Text = "発売前時点";
                }
                else
                {
                    HappyoTime.Text = ConvertDateToLongDate(str[4]);
                }


                LibCode = 2010;
                LibJvConvFuncClass.jvSysConvFunction(&LibCode, str[GetKind], ref tmp);
                TrackDistance.Text = tmp;
            }


            TrackLabel.Text      = (GetKind == 2 ? "芝" : "ダート");
            TrackLabel.BackColor = (GetKind == 2 ? Color.LightGreen : Color.Tan);

            LibCode = 2007;
            LibJvConvFuncClass.jvSysConvFunction(&LibCode, raceData.getRaceClass(), ref tmp);
            ClassLabel.Text = tmp;

            LibCode = 2006;
            LibJvConvFuncClass.jvSysConvFunction(&LibCode, raceData.getRaceKindKigo(), ref tmp);
            KigoLabel.Text = tmp;

            DistanceLabel.Text = raceData.getDistance();

            LibCode = LibJvConvFuncClass.TRACK_CODE;
            LibJvConvFuncClass.jvSysConvFunction(&LibCode, raceData.getCourceTrack(), ref tmp);
            TrackNameLabel.Text = tmp;
        }