예제 #1
0
 public static UserInfoSingleton GetInstance()
 {
     if (instance == null)
     {
         lock (syncLocker)
         {
             if (instance == null)
             {
                 instance = new UserInfoSingleton();
             }
         }
     }
     return(instance);
 }
        public void CreateEle(ElectrodeInfo eleInfo)
        {
            UserInfoSingleton user = UserInfoSingleton.GetInstance();

            if (user.UserInfo == null)
            {
                return;
            }
            this.eleInfo = eleInfo;
            this.eleInfo.EleHeadDis[0] = Math.Round(this.head.DisPt.X, 3);
            this.eleInfo.EleHeadDis[1] = Math.Round(this.head.DisPt.Y, 3);
            this.eleInfo.EleMinDim     = head.AskMinDim();
            Matrix4 workMat = this.model.Work.WorkMatr;
            double  zHeight = setValue.GetZHeight(eleInfo.Extrudewith);
            Matrix4 mat     = setValue.GetEleMatr(eleInfo.Preparation, GetCenter());

            this.model.Work.MoldInfo.CreatedDate = DateTime.Now.ToString("yyyy-MM-dd");
            this.model.Work.MoldInfo.CreatorName = user.UserInfo.UserName;
            ElectrodePart elePart = new ElectrodePart(eleInfo, this.model.Work.MoldInfo, this.head, mat);

            elePart.CreateElectrode(eleInfo.ZDatum, zHeight, Expression);
        }