78 lines
2.4 KiB
C#
78 lines
2.4 KiB
C#
|
|
using CaeGlobals;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.ComponentModel;
|
|||
|
|
using System.Drawing.Design;
|
|||
|
|
using System.Runtime.CompilerServices;
|
|||
|
|
|
|||
|
|
namespace CaeKnowledge.View
|
|||
|
|
{
|
|||
|
|
public class ViewProcessingParameter : INotifyPropertyChanged
|
|||
|
|
{
|
|||
|
|
private double _spindleSpeed;
|
|||
|
|
private double _feedingSpeed;
|
|||
|
|
private string _filePath;
|
|||
|
|
private string _cutter;
|
|||
|
|
private string _cuttingParameter;
|
|||
|
|
|
|||
|
|
[Category("数据")]
|
|||
|
|
[OrderedDisplayName(0, 5, "主轴转速")]
|
|||
|
|
public double SpindleSpeed
|
|||
|
|
{
|
|||
|
|
get => _spindleSpeed;
|
|||
|
|
set => SetField(ref _spindleSpeed, value);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[Category("数据")]
|
|||
|
|
[OrderedDisplayName(1, 5, "进给速度")]
|
|||
|
|
public double FeedingSpeed
|
|||
|
|
{
|
|||
|
|
get => _feedingSpeed;
|
|||
|
|
set => SetField(ref _feedingSpeed, value);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[Category("数据")]
|
|||
|
|
[OrderedDisplayName(2, 5, "切削宽度")]
|
|||
|
|
[Description("由文件读取,此处输入文件路径!")]
|
|||
|
|
[Editor(typeof(FileNameEditor), typeof(UITypeEditor))]
|
|||
|
|
public string FilePath
|
|||
|
|
{
|
|||
|
|
get => _filePath;
|
|||
|
|
set => SetField(ref _filePath, value);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[Category("数据")]
|
|||
|
|
[OrderedDisplayName(3, 5, "刀具参数")]
|
|||
|
|
[Description("从刀具信息表自动读取!")]
|
|||
|
|
[TypeConverter(typeof(CutterConverter))]
|
|||
|
|
public string Cutter
|
|||
|
|
{
|
|||
|
|
get => _cutter;
|
|||
|
|
set => SetField(ref _cutter, value);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[Category("数据")]
|
|||
|
|
[OrderedDisplayName(4, 5, "切削力系数")]
|
|||
|
|
[Description("从切削力系数表自动读取!")]
|
|||
|
|
[TypeConverter(typeof(CuttingParameterConverter))]
|
|||
|
|
public string CuttingParameter
|
|||
|
|
{
|
|||
|
|
get => _cuttingParameter;
|
|||
|
|
set => SetField(ref _cuttingParameter, 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;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|