public bool Init(string matchName)
        {
            Matching matching = MyRun.model.matchings.Find(x => x.Name == matchName);

            txt定位模板名称.Text = matchName;
            cmb定位模板类型.Text = matching.Type;
            matchingfun    = MyRun.GetMatchingFun(matching.Type);

            matchingfun.Read(MyRun.appPath + "\\model\\" + MyRun.model.modelName, matching);

            MyRun.nowModel.CamName   = matching.CamName;
            MyRun.nowModel.MatchName = matchName;
            RelateCam();
            return(true);
        }
示例#2
0
        private void RelateMatch()
        {
            if (MyRun.nowModel.MatchName is null)
            {
                return;
            }
            if (MyRun.nowModel.MatchName.Equals("无模板定位"))
            {
                lab当前匹配模板.Text = "当前匹配模板:" + MyRun.nowModel.MatchName;
                matchName      = MyRun.nowModel.MatchName;
            }
            else if (matchName != MyRun.nowModel.MatchName)
            {
                Matching nowMatching = MyRun.model.matchings.Find(x => x.Name == MyRun.nowModel.MatchName);
                matchingfun = MyRun.GetMatchingFun(nowMatching.Type);
                matchingfun.Read(MyRun.appPath + "\\model\\" + MyRun.model.modelName, nowMatching);

                lab当前匹配模板.Text = "当前匹配模板:" + MyRun.nowModel.MatchName;
                matchName      = MyRun.nowModel.MatchName;
            }
        }