44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using System.Windows;
|
||
|
||
namespace XP.Calibration.Views;
|
||
|
||
/// <summary>
|
||
/// CT 校准设置对话框(HIGH MAGNIFICATION)
|
||
/// </summary>
|
||
public partial class CTCalibrationSetupDialog : Window
|
||
{
|
||
/// <summary>标定体直径 (μm)</summary>
|
||
public double ObjectDiameter { get; private set; } = 6000;
|
||
|
||
/// <summary>像素大小 (μm)</summary>
|
||
public double PixelSize { get; private set; } = 119;
|
||
|
||
public CTCalibrationSetupDialog()
|
||
{
|
||
InitializeComponent();
|
||
}
|
||
|
||
public CTCalibrationSetupDialog(double defaultDiameter, double defaultPixelSize) : this()
|
||
{
|
||
DiameterTextBox.Text = defaultDiameter.ToString();
|
||
PixelSizeTextBox.Text = defaultPixelSize.ToString();
|
||
}
|
||
|
||
private void OkButton_Click(object sender, RoutedEventArgs e)
|
||
{
|
||
if (double.TryParse(DiameterTextBox.Text, out double d))
|
||
ObjectDiameter = d;
|
||
if (double.TryParse(PixelSizeTextBox.Text, out double p))
|
||
PixelSize = p;
|
||
|
||
DialogResult = true;
|
||
Close();
|
||
}
|
||
|
||
private void CancelButton_Click(object sender, RoutedEventArgs e)
|
||
{
|
||
DialogResult = false;
|
||
Close();
|
||
}
|
||
}
|