using System;
|
using System.Collections.ObjectModel;
|
using System.Windows.Controls;
|
using System.Windows.Input;
|
using XHandler.Class;
|
using XHandler.Class.DataEx;
|
using XImagingXhandler.XDAL;
|
|
namespace XHandler.View.Consumables
|
{
|
/// <summary>
|
/// CircularDishSetting.xaml 的交互逻辑
|
/// </summary>
|
public partial class CircularDishSetting : UserControl
|
{
|
public Labware labware { get; set; }
|
|
public CircularDishSetting()
|
{
|
InitializeComponent();
|
}
|
|
public CircularDishSetting(Labware l)
|
{
|
InitializeComponent();
|
|
labware = l;
|
this.DataContext = labware;
|
btnTopColor.RGB = labware.labware_color_top; // 顶面
|
|
ObservableCollection<string> divisionList = DataModule.getInstance().GetDivisionList();
|
cbDivision.ItemsSource = divisionList;
|
string division = labware.labware_round_division.ToString() + Properties.Resources.strDivision;
|
if(divisionList.Contains(division))
|
cbDivision.SelectedItem = division;
|
|
ObservableCollection<string> specsDiameterList = DataModule.getInstance().GetSpecsDiameterList();
|
cbSpecsDiameter.ItemsSource = specsDiameterList;
|
string diameter = labware.labware_round_diameter + " mm";
|
if(specsDiameterList.Contains(diameter))
|
cbSpecsDiameter.SelectedItem = diameter;
|
|
ObservableCollection<string> specsHeightList = DataModule.getInstance().GetSpecsHeightList();
|
cbSpecsHeight.ItemsSource = specsHeightList;
|
string height = labware.labware_round_height + " mm";
|
if(specsHeightList.Contains(height))
|
cbSpecsHeight.SelectedItem = height;
|
}
|
|
#region 顶部颜色
|
private void btnTopColor_SelectedColorChangedEvent(object sender, EventArgs e)
|
{
|
if (labware == null)
|
{
|
return;
|
}
|
|
labware.labware_color_top = btnTopColor.RGB;
|
}
|
#endregion
|
|
private void PreviewTextInput(object sender, TextCompositionEventArgs e)
|
{
|
if (!Utilities.isNumberic(e.Text))
|
{
|
e.Handled = true;
|
}
|
else
|
e.Handled = false;
|
}
|
|
private void cbDivision_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
{
|
string strDivision = cbDivision.SelectedItem as string;
|
string tmp = strDivision.Substring(0, 1);
|
int division = 1;
|
int.TryParse(tmp, out division);
|
labware.labware_round_division = division;
|
}
|
|
private void cbSpecsDiameter_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
{
|
string strDiameter = cbSpecsDiameter.SelectedItem as string;
|
string[] ary = strDiameter.Split(' ');
|
int diameter = 35;
|
int.TryParse(ary[0], out diameter);
|
labware.labware_round_diameter = diameter;
|
}
|
|
private void cbSpecsHeight_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
{
|
string strHeight = cbSpecsHeight.SelectedItem as string;
|
string[] ary = strHeight.Split(' ');
|
int height = 9;
|
int.TryParse(ary[0], out height);
|
labware.labware_round_height = height;
|
}
|
|
private void tbInnerBottomDiameter_TextChanged(object sender, TextChangedEventArgs e)
|
{
|
|
}
|
}
|
}
|