87 lines
2.7 KiB
C#
87 lines
2.7 KiB
C#
using CaeGlobals;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing.Design;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace CaeKnowledge.View
|
|
{
|
|
public class ViewCuttingForceCalc : INotifyPropertyChanged
|
|
{
|
|
private string _filePath;
|
|
private string _cutter;
|
|
private string _cuttingParameter;
|
|
private int _totalPointsPerLayer = 50;
|
|
private double _radialDepth = 1.0;
|
|
private double _zOrigin;
|
|
|
|
[Category("1数据")]
|
|
[OrderedDisplayName(0, 6, "刀位文件")]
|
|
[Description("刀位文件由文件读取,此处输入文件路径!")]
|
|
[Editor(typeof(FileNameEditor), typeof(UITypeEditor))]
|
|
public string FilePath
|
|
{
|
|
get => _filePath;
|
|
set => SetField(ref _filePath, value);
|
|
}
|
|
|
|
[Category("1数据")]
|
|
[OrderedDisplayName(1, 6, "刀具参数")]
|
|
[Description("从刀具信息表自动读取!")]
|
|
[TypeConverter(typeof(CutterConverter))]
|
|
public string Cutter
|
|
{
|
|
get => _cutter;
|
|
set => SetField(ref _cutter, value);
|
|
}
|
|
|
|
[Category("1数据")]
|
|
[OrderedDisplayName(2, 6, "切削力系数")]
|
|
[Description("从切削力系数表自动读取!")]
|
|
[TypeConverter(typeof(CuttingParameterConverter))]
|
|
public string CuttingParameter
|
|
{
|
|
get => _cuttingParameter;
|
|
set => SetField(ref _cuttingParameter, value);
|
|
}
|
|
|
|
[Category("2切削参数")]
|
|
[OrderedDisplayName(3, 6, "单层仿真点数")]
|
|
public int TotalPointsPerLayer
|
|
{
|
|
get => _totalPointsPerLayer;
|
|
set => SetField(ref _totalPointsPerLayer, value);
|
|
}
|
|
|
|
[Category("2切削参数")]
|
|
[OrderedDisplayName(4, 6, "径向切深")]
|
|
public double RadialDepth
|
|
{
|
|
get => _radialDepth;
|
|
set => SetField(ref _radialDepth, value);
|
|
}
|
|
|
|
[Category("2切削参数")]
|
|
[OrderedDisplayName(5, 6, "首层轴向切深")]
|
|
public double ZOrigin
|
|
{
|
|
get => _zOrigin;
|
|
set => SetField(ref _zOrigin, value);
|
|
}
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
|
|
protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
|
|
{
|
|
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
|
|
field = value;
|
|
OnPropertyChanged(propertyName);
|
|
return true;
|
|
}
|
|
}
|
|
} |