Esempio n. 1
0
 public bool AddFit(FittingModel model)
 {
     if (model == null)
     {
         return(false);
     }
     if (this.checkExist(this._fitPath, model.FullPath))
     {
         return(false);
     }
     this._fit.Add(model);
     this._fitPath.Add(model.FullPath);
     this._trained = false;
     return(true);
 }
Esempio n. 2
0
        public bool AddFit(FittingModel model)
        {
            if (model == null)
            {
                return(false);
            }
            if (this.checkExist(this._fitPath, model.FullPath))
            {
                return(false);
            }

            if (this.FitModels != null && this.FitModels.Count > 0)//要检查其参数与已有拟合库是否相同
            {
                if (!this.FitModels[0].Equals(model))
                {
                    return(false);
                }
            }

            this._fit.Add(model);
            this._fitPath.Add(model.FullPath);
            if (this._fitSelectMatrix != null) //设置选中
            {
                foreach (var c in model.SpecLib.Components)
                {
                    var cidx = this._comps.GetIndex(c.Name);
                    if (cidx >= 0)
                    {
                        this._fitSelectMatrix[cidx] += (int)Math.Pow(2, this._fitPath.Count - 1);
                    }
                }
            }

            this._trained = false;
            return(true);
        }