Exemplo n.º 1
0
        private void UpdateUIFromOtherThread(TransmitStatus status, TSMatchInfo matchInfo)
        {
            if (status == TransmitStatus.StartList || status == TransmitStatus.RankList)
            {
                lbHeight.Text        = matchInfo.StartInfo.Height;
                lbStartBib.Text      = matchInfo.StartInfo.BibNumber;
                lbStartDiff.Text     = matchInfo.StartInfo.Difficulty;
                lbStartDiveCode.Text = matchInfo.StartInfo.DiveCode;
                lbStartName.Text     = matchInfo.StartInfo.PlayerName;
                lbStartRound.Text    = matchInfo.StartInfo.RoundNumber;
                lbStartNO.Text       = matchInfo.StartInfo.StartNumber;
                lbStartNOC.Text      = matchInfo.StartInfo.NOC;
                lbStartPoints.Text   = matchInfo.StartInfo.Points;
                lbStartRank.Text     = matchInfo.StartInfo.Rank;
            }
            else if (status == TransmitStatus.Score)
            {
                OVRDataBaseUtils.FillDataGridView(dgJudgeScore, matchInfo.ScoreInfo);
                dgJudgeScore.ClearSelection();
            }
            if (status == TransmitStatus.RankList)
            {
                OVRDataBaseUtils.FillDataGridView(dgRankList, matchInfo.RankInfo);
                dgRankList.ClearSelection();
            }

            TSDlg_OnTSUpdateDB();
        }
Exemplo n.º 2
0
 private void m_diveProcess_RecvData(TransmitStatus arg1, TSMatchInfo arg2)
 {
     if (OnRecvData != null)
     {
         OnRecvData(arg1, arg2);
     }
 }
Exemplo n.º 3
0
        public void m_manager_OnRecvData(TransmitStatus status, TSMatchInfo matchInfo)
        {
            Action <TransmitStatus, TSMatchInfo> action = (arg1, arg2) => this.UpdateUIFromOtherThread(arg1, arg2);

            this.Invoke(action, status, matchInfo);
        }
Exemplo n.º 4
0
        public void ProcessData(string strData)
        {
            if (strData.Length < 6)
            {
                return;
            }

            string type  = strData.Substring(4, 2);
            string type3 = strData.Substring(4, 3);

            switch (type)
            {
            case "E1":
                m_status    = TransmitStatus.StartList;
                m_matchInfo = new TSMatchInfo();
                if (TransimitAction != null)
                {
                    TransimitAction(true, strData);
                }
                break;

            case "E2":
                m_status = TransmitStatus.Score;
                m_matchInfo.ReInitJudgeScore();
                break;

            case "E0":
                m_status = TransmitStatus.RankList;
                m_matchInfo.ReInitRankInfo();
                break;

            case "GS":
                if (m_status == TransmitStatus.StartList)
                {
                    m_matchInfo.StartInfo.RoundNumber = GetFieldData(strData);
                }
                break;

            case "GN":
                if (m_status == TransmitStatus.StartList)
                {
                    m_matchInfo.StartInfo.BibNumber = GetFieldData(strData);
                }
                break;

            case "GO":
                if (m_status == TransmitStatus.StartList)
                {
                    String strStartNumber = GetFieldData(strData);
                    m_matchInfo.StartInfo.StartNumber = GetFieldData(strData);
                    DVCommon.g_DVDBManager.ExcuteDV_TS_UpdateMatchSplitCurrentDiver(m_iMatchID, m_matchInfo.StartInfo.RoundNumber, strStartNumber);
                    if (RecvData != null)
                    {
                        RecvData(m_status, m_matchInfo);
                    }
                }
                break;

            case "GD":
                if (m_status == TransmitStatus.StartList)
                {
                    m_matchInfo.StartInfo.DiveCode = GetFieldData(strData);
                }
                break;

            case "GC":
                if (m_status == TransmitStatus.StartList)
                {
                    m_matchInfo.StartInfo.Difficulty = GetFieldData(strData);
                }
                break;

            case "GH":
                if (m_status == TransmitStatus.StartList)
                {
                    m_matchInfo.StartInfo.Height = GetFieldData(strData);
                }
                break;

            case "SC":
                if (m_status == TransmitStatus.StartList)
                {
                    m_matchInfo.StartInfo.Points = GetFieldData(strData);
                }
                else if (m_status == TransmitStatus.Score)
                {
                    string strValue = GetFieldData(strData);
                    m_matchInfo.ScoreInfo.AddValue("To.All", strValue);
                }
                break;

            case "PR":
                if (m_status == TransmitStatus.StartList)
                {
                    m_matchInfo.StartInfo.Rank = GetFieldData13(strData);
                }
                else if (m_status == TransmitStatus.Score)
                {
                    string strValue = GetFieldData13(strData);
                    m_matchInfo.ScoreInfo.AddValue("Rank", strValue);
                    if (RecvData != null)
                    {
                        RecvData(m_status, m_matchInfo);
                    }
                }
                break;

            case "GL":
                if (m_status == TransmitStatus.RankList)
                {
                    m_matchInfo.StartInfo.PlayerName = GetFieldData(strData);
                }
                break;

            case "GY":
                if (m_status == TransmitStatus.RankList)
                {
                    m_matchInfo.StartInfo.NOC = GetFieldData(strData);
                }
                break;

            case "S1":
            case "S2":
            case "S3":
            case "S4":
            case "S5":
            case "S6":
            case "S7":
            case "S8":
            case "S9":
            case "S10":
            case "S11":
            case "ST":
            case "GP":
                if (m_status == TransmitStatus.Score)
                {
                    string strValue = "";
                    if (type3.Substring(2, 1) != "\x02")
                    {
                        type     = type3;
                        strValue = GetFieldData15(strData);
                    }
                    else
                    {
                        strValue = GetFieldData13(strData);
                    }

                    if (type == "ST")
                    {
                        type     = "Total";
                        strValue = GetFieldData(strData);
                    }
                    else if (type == "GP")
                    {
                        type     = "Penalty";
                        strValue = GetFieldData(strData);
                        if (strValue == "")
                        {
                            strValue = "0";
                        }
                    }

                    m_matchInfo.ScoreInfo.AddValue(type, strValue);

                    if (type.StartsWith("S") || type == "Penalty")
                    {
                        UpdateToDatabase(type, strValue);
                    }
                }
                break;

            case "LY":
            case "LS":
            case "LP":
            case "LL":
                if (m_status == TransmitStatus.RankList)
                {
                    string strCode  = GetPlayerCode(strData);
                    string strValue = GetFieldData(strData);
                    if (type == "LY")
                    {
                        type = "NOC";
                    }
                    else if (type == "LS")
                    {
                        type = "Rank";
                    }
                    else if (type == "LP")
                    {
                        type = "Points";
                    }
                    else if (type == "LL")
                    {
                        type = "Name";
                    }
                    m_matchInfo.RankInfo.AddValue(strCode, type, strValue);
                }
                break;

            case "G0":
                if (RecvData != null)
                {
                    RecvData(m_status, m_matchInfo);
                }
                if (type3 == "G02")
                {
                    if (TransimitAction != null)
                    {
                        TransimitAction(false, strData);
                    }
                }
                break;
            }
        }
Exemplo n.º 5
0
 public DivingProcess()
 {
     m_matchInfo = new TSMatchInfo();
 }