Пример #1
0
 /// <summary>
 /// 接收来自底层的数据
 /// </summary>
 /// <param name="path"></param>
 public bool InsertPathToDB(string path)
 {
     // SaveDataToFile(path);
     if (path.StartsWith("0|"))
     {
         MatchPerson(path);
     }
     else if (path.StartsWith("1|"))
     {
         Track t = Track.Parse(path);
         if (Rmode == Runmode.Match)
         {
             Cmatch?.AddNewTrack(t);
         }
         else
         {
             Ctrain?.AddNewTrack(t);
         }
     }
     else
     {
         matchSpeed(path);
     }
     return(true);
 }
Пример #2
0
 /// <summary>
 /// 匹配人员坐标
 /// </summary>
 /// <param name="SubjectString"></param>
 private void MatchPerson(string SubjectString)
 {
     try
     {
         string strPosition = Regex.Match(SubjectString, "\\|[0-9]*\\|-?[0-9]*\\.[0-9]*,-?[0-9]*\\.[0-9]*,-?[0-9]*\\.[0-9]*").Value;
         if (!string.IsNullOrEmpty(strPosition))
         {
             FramePosition position = FramePosition.Parse(strPosition.Substring(1, strPosition.LastIndexOf("|") - 1), strPosition.Substring(strPosition.LastIndexOf("|") + 1));
             if (position != null)
             {
                 if (Rmode == Runmode.Match)
                 {
                     Cmatch?.AddPosition(position);
                 }
                 else if (rmode == Runmode.Train)
                 {
                     Ctrain?.AddPosition(position);
                 }
             }
         }
     }
     catch (ArgumentException ex)
     {
         LogText.Error("MatchPerson", ex.Message);
     }
 }
Пример #3
0
        /// <summary>
        /// 结束比赛
        /// </summary>
        /// <param name="match"></param>
        public bool EndMatch(string matchID)
        {
            //结束最后一个回合
            Cmatch.CompleteRand();

            //保存运动员的轨迹
            Cmatch.SavePlayersTrack();

            //保存人员的轨迹信息
            LogText.Info("EndMatch", "结束比赛");
            return(true);
        }