84 lines
2.2 KiB
C#
84 lines
2.2 KiB
C#
|
|
using CaeKnowledge.View;
|
|||
|
|
using System.Windows.Forms;
|
|||
|
|
|
|||
|
|
namespace CPSO.Forms._92_Knowledge
|
|||
|
|
{
|
|||
|
|
public partial class FrmAddCutter : Form
|
|||
|
|
{
|
|||
|
|
public FrmAddCutter()
|
|||
|
|
{
|
|||
|
|
InitializeComponent();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void SetCutter(ViewCutter cutter)
|
|||
|
|
{
|
|||
|
|
gbProperties.Text = @"刀具信息";
|
|||
|
|
propertyGrid.SelectedObject = cutter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void SetCutter(DynamicDescriptors.DynamicTypeDescriptor descriptor)
|
|||
|
|
{
|
|||
|
|
gbProperties.Text = @"刀具信息";
|
|||
|
|
propertyGrid.SelectedObject = descriptor;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public ViewCutter GetCutter()
|
|||
|
|
{
|
|||
|
|
if (propertyGrid.SelectedObject is ViewCutter cutter)
|
|||
|
|
{
|
|||
|
|
return cutter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void SetCuttingParameter(ViewCuttingParameter cuttingParameter)
|
|||
|
|
{
|
|||
|
|
gbProperties.Text = @"切削力系数";
|
|||
|
|
propertyGrid.SelectedObject = cuttingParameter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void SetCuttingParameter(DynamicDescriptors.DynamicTypeDescriptor descriptor)
|
|||
|
|
{
|
|||
|
|
gbProperties.Text = @"切削力系数";
|
|||
|
|
propertyGrid.SelectedObject = descriptor;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public ViewCuttingParameter GetCuttingParameter()
|
|||
|
|
{
|
|||
|
|
if (propertyGrid.SelectedObject is ViewCuttingParameter cuttingParameter)
|
|||
|
|
{
|
|||
|
|
return cuttingParameter;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void SetMaterial(ViewElasticWithDensity material)
|
|||
|
|
{
|
|||
|
|
gbProperties.Text = @"材料";
|
|||
|
|
propertyGrid.SelectedObject = material;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public void SetToolPosition(ViewToolPosition toolPosition)
|
|||
|
|
{
|
|||
|
|
gbProperties.Text = @"切削力";
|
|||
|
|
propertyGrid.SelectedObject = toolPosition;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void btnOK_Click(object sender, System.EventArgs e)
|
|||
|
|
{
|
|||
|
|
DialogResult = DialogResult.OK;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void FrmAddCutter_FormClosing(object sender, FormClosingEventArgs e)
|
|||
|
|
{
|
|||
|
|
if (e.CloseReason == CloseReason.UserClosing)
|
|||
|
|
{
|
|||
|
|
e.Cancel = true;
|
|||
|
|
Hide();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|