public ElectrodeModel(string filePath, int workNum, ElectrodeInfo info, MoldInfoModel mold, Matrix4 mat, Point3d center)
 {
     this.PartType = "Electrode";
     this.EleInfo  = info;
     this.MoldInfo = mold;
     this.EleMatr  = mat;
     this.CenterPt = center;
     GetAssembleName();
     this.WorkpieceDirectoryPath = filePath;
     this.WorkpiecePath          = filePath + this.AssembleName + ".prt";
     this.WorkNumber             = workNum;
 }
        public static ElectrodeInfo GetEleInfo(DataRow dr)
        {
            ElectrodeInfo model = new ElectrodeInfo();

            for (int i = 0; i < dr.Table.Columns.Count; i++)
            {
                PropertyInfo propertyInfo = model.GetType().GetProperty(dr.Table.Columns[i].ColumnName);
                if (propertyInfo != null && dr[i] != DBNull.Value)
                {
                    propertyInfo.SetValue(model, dr[i], null);
                }
            }
            model.EleSetValue[0] = Convert.ToDouble(dr["EleSetValueX"]);
            model.EleSetValue[1] = Convert.ToDouble(dr["EleSetValueY"]);
            model.EleSetValue[2] = Convert.ToDouble(dr["EleSetValueZ"]);

            model.Preparation[0] = Convert.ToInt32(dr["PreparationX"]);
            model.Preparation[1] = Convert.ToInt32(dr["PreparationY"]);
            model.Preparation[2] = Convert.ToInt32(dr["PreparationZ"]);

            return(model);
        }
Exemple #3
0
 protected override void GetModelForAttribute(NXObject obj)
 {
     this.Info = ElectrodeInfo.GetAttribute(obj);
 }
Exemple #4
0
 public ElectrodeModel(ElectrodeInfo info)
 {
     this.Info = info;
 }