예제 #1
0
 /// <summary>
 /// 读取属性
 /// </summary>
 public static ElectrodeAllInfo GetAttribute(NXObject obj)
 {
     try
     {
         ElectrodeRemarksInfo     rem   = ElectrodeRemarksInfo.GetAttribute(obj);
         ElectrodeCAMInfo         cam   = ElectrodeCAMInfo.GetAttribute(obj);
         ElectrodeGapValueInfo    gap   = ElectrodeGapValueInfo.GetAttribute(obj);
         ElectrodePitchInfo       pitch = ElectrodePitchInfo.GetAttribute(obj);
         ElectrodePreparationInfo pre   = ElectrodePreparationInfo.GetAttribute(obj);
         ElectrodeSetValueInfo    sv    = ElectrodeSetValueInfo.GetAttribute(obj);
         ElectrodeNameInfo        name  = ElectrodeNameInfo.GetAttribute(obj);
         ElectrodeDatumInfo       da    = ElectrodeDatumInfo.GetAttribute(obj);
         return(new ElectrodeAllInfo()
         {
             Remarks = rem,
             CAM = cam,
             GapValue = gap,
             Pitch = pitch,
             Preparetion = pre,
             SetValue = sv,
             Name = name,
             Datum = da
         });
     }
     catch (NXException ex)
     {
         throw ex;
     }
 }
예제 #2
0
        /// <summary>
        ///创建行
        /// </summary>
        /// <param name="row"></param>
        public void CreateDataRow(ref DataRow row)
        {
            ElectrodePitchInfo info = this.Clone() as ElectrodePitchInfo;

            foreach (PropertyInfo propertyInfo in typeof(ElectrodePitchInfo).GetProperties())
            {
                try
                {
                    row[propertyInfo.Name] = propertyInfo.GetValue(info, null);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
예제 #3
0
        /// <summary>
        /// 读取属性
        /// </summary>
        public static ElectrodePitchInfo GetAttribute(NXObject obj)
        {
            ElectrodePitchInfo info = new ElectrodePitchInfo();

            try
            {
                info.PitchX    = AttributeUtils.GetAttrForDouble(obj, "PitchX");
                info.PitchXNum = AttributeUtils.GetAttrForInt(obj, "PitchXNum");
                info.PitchY    = AttributeUtils.GetAttrForDouble(obj, "PitchY");
                info.PitchYNum = AttributeUtils.GetAttrForInt(obj, "PitchYNum");

                return(info);
            }
            catch (NXException ex)
            {
                throw ex;
            }
        }
예제 #4
0
        /// <summary>
        /// 通过行获取数据
        /// </summary>
        /// <param name="row"></param>
        public static ElectrodePitchInfo GetInfoForDataRow(DataRow row)
        {
            ElectrodePitchInfo info = new ElectrodePitchInfo();

            for (int i = 0; i < row.Table.Columns.Count; i++)
            {
                try
                {
                    PropertyInfo propertyInfo = info.GetType().GetProperty(row.Table.Columns[i].ColumnName);
                    if (propertyInfo != null && row[i] != DBNull.Value)
                    {
                        propertyInfo.SetValue(info, row[i], null);
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            return(info);
        }
예제 #5
0
        /// <summary>
        /// 创建表头
        /// </summary>
        /// <param name="table"></param>
        public static DataTable CreateDataTable()
        {
            try
            {
                DataTable table = new DataTable();
                ElectrodeCAMInfo.CreateDataTable(ref table);
                ElectrodeDatumInfo.CreateDataTable(ref table);
                ElectrodeGapValueInfo.CreateDataTable(ref table);
                ElectrodeNameInfo.CreateDataTable(ref table);

                ElectrodePitchInfo.CreateDataTable(ref table);
                ElectrodePreparationInfo.CreateDataTable(ref table);
                ElectrodeRemarksInfo.CreateDataTable(ref table);
                ElectrodeSetValueInfo.CreateDataTable(ref table);
                return(table);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #6
0
 /// <summary>
 /// 通过行获取数据
 /// </summary>
 /// <param name="row"></param>
 public static ElectrodeAllInfo GetInfoForDataRow(DataRow row)
 {
     try
     {
         ElectrodeAllInfo info = new ElectrodeAllInfo()
         {
             CAM         = ElectrodeCAMInfo.GetInfoForDataRow(row),
             Datum       = ElectrodeDatumInfo.GetInfoForDataRow(row),
             GapValue    = ElectrodeGapValueInfo.GetInfoForDataRow(row),
             Name        = ElectrodeNameInfo.GetInfoForDataRow(row),
             Pitch       = ElectrodePitchInfo.GetInfoForDataRow(row),
             Preparetion = ElectrodePreparationInfo.GetInfoForDataRow(row),
             Remarks     = ElectrodeRemarksInfo.GetInfoForDataRow(row),
             SetValue    = ElectrodeSetValueInfo.GetInfoForDataRow(row)
         };
         return(info);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #7
0
 /// <summary>
 /// 比较是否修改电极
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool IsEquals(ElectrodePitchInfo other)
 {
     return(this.PitchX == other.PitchX && this.PitchXNum == other.PitchXNum &&
            this.PitchY == other.PitchY && this.PitchYNum == other.PitchYNum);
 }