using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows;
|
using System.Windows.Controls;
|
using System.Windows.Data;
|
using System.Windows.Documents;
|
using System.Windows.Input;
|
using System.Windows.Media;
|
using System.Windows.Media.Imaging;
|
using System.Windows.Navigation;
|
using System.Windows.Shapes;
|
using XHandler.Class;
|
using XHandler.Controls;
|
using XImagingXhandler.XDAL;
|
|
namespace XHandler.View.MethodProperty
|
{
|
/// <summary>
|
/// VolumnSettingPerWell.xaml 的交互逻辑
|
/// </summary>
|
public partial class VolumnSettingPerWell : UserControl
|
{
|
public event EventHandler closeEvent;
|
public List<int> currentChannels = new List<int>();
|
public AspirateProperty aspirateProperty = null;
|
public DispenseProperty dispenseProperty= null;
|
public List<DropdownName> singleChannelValues = new List<DropdownName>();
|
public VolumnSettingPerWell()
|
{
|
InitializeComponent();
|
}
|
|
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
{
|
if (EventResponseController.Instance.CanExecute() == false)
|
return;
|
|
closeEvent?.Invoke(this, EventArgs.Empty);
|
}
|
|
private void btnSave_Click(object sender, RoutedEventArgs e)
|
{
|
if (EventResponseController.Instance.CanExecute() == false)
|
return;
|
|
if(aspirateProperty!= null)
|
{
|
//aspirateProperty.methodAspirate.
|
}
|
|
closeEvent?.Invoke(this, EventArgs.Empty);
|
}
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
{
|
if(currentChannels.Count!=0)
|
{
|
for(int i=1;i< gdChannelSettings.RowDefinitions.Count;i++)
|
{
|
if (!currentChannels.Contains(i))
|
{
|
gdChannelSettings.RowDefinitions[i].Height = new GridLength(0, GridUnitType.Pixel);
|
|
if (aspirateProperty != null)
|
{
|
singleChannelValues = aspirateProperty.methodAspirate.singlewellvolume;
|
}
|
if(dispenseProperty!= null)
|
{
|
singleChannelValues = dispenseProperty.methodDispense.singlewellvolume;
|
}
|
|
var a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "1");
|
if (a1 != null)
|
{
|
tbxChannel1Value.Text = a1.dropdown_name;
|
}
|
else
|
{
|
}
|
}
|
else
|
{
|
if (aspirateProperty != null)
|
{
|
singleChannelValues = aspirateProperty.methodAspirate.singlewellvolume;
|
}
|
if (dispenseProperty != null)
|
{
|
singleChannelValues = dispenseProperty.methodDispense.singlewellvolume;
|
}
|
|
var a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "1");
|
if (a1 != null)
|
{
|
tbxChannel1Value.Text = a1.dropdown_name;
|
}
|
else
|
{
|
}
|
|
a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "2");
|
if (a1 != null)
|
{
|
tbxChannel2Value.Text = a1.dropdown_name;
|
}
|
else
|
{
|
}
|
|
a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "3");
|
if (a1 != null)
|
{
|
tbxChannel3Value.Text = a1.dropdown_name;
|
}
|
else
|
{
|
}
|
|
a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "4");
|
if (a1 != null)
|
{
|
tbxChannel4Value.Text = a1.dropdown_name;
|
}
|
else
|
{
|
}
|
|
a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "5");
|
if (a1 != null)
|
{
|
tbxChannel5Value.Text = a1.dropdown_name;
|
}
|
else
|
{
|
}
|
|
a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "6");
|
if (a1 != null)
|
{
|
tbxChannel6Value.Text = a1.dropdown_name;
|
}
|
else
|
{
|
}
|
|
a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "7");
|
if (a1 != null)
|
{
|
tbxChannel7Value.Text = a1.dropdown_name;
|
}
|
else
|
{
|
}
|
|
a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "8");
|
if (a1 != null)
|
{
|
tbxChannel8Value.Text = a1.dropdown_name;
|
}
|
else
|
{
|
}
|
gdChannelSettings.RowDefinitions[i].Height = new GridLength(40, GridUnitType.Pixel);
|
}
|
}
|
}
|
}
|
|
private void tbxChannel1Value_TextChanged(object sender, TextChangedEventArgs e)
|
{
|
var a1 =singleChannelValues.FirstOrDefault(x => x.dropdown_id == "1");
|
if(a1 != null)
|
{
|
a1.dropdown_name = tbxChannel1Value.Text;
|
}
|
else
|
{
|
DropdownName dropdownName= new DropdownName();
|
dropdownName.dropdown_id= "1";
|
dropdownName.dropdown_name= tbxChannel1Value.Text;
|
singleChannelValues.Add(dropdownName);
|
}
|
|
if (aspirateProperty != null)
|
{
|
aspirateProperty.methodAspirate.singlewellvolume = singleChannelValues;
|
}
|
|
if(dispenseProperty!=null)
|
{
|
dispenseProperty.methodDispense.singlewellvolume = singleChannelValues;
|
}
|
}
|
|
private void tbxChannel2Value_TextChanged(object sender, TextChangedEventArgs e)
|
{
|
var a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "2");
|
if (a1 != null)
|
{
|
a1.dropdown_name = tbxChannel2Value.Text;
|
}
|
else
|
{
|
DropdownName dropdownName = new DropdownName();
|
dropdownName.dropdown_id = "2";
|
dropdownName.dropdown_name = tbxChannel2Value.Text;
|
singleChannelValues.Add(dropdownName);
|
}
|
|
if (aspirateProperty != null)
|
{
|
aspirateProperty.methodAspirate.singlewellvolume = singleChannelValues;
|
}
|
|
if (dispenseProperty != null)
|
{
|
dispenseProperty.methodDispense.singlewellvolume = singleChannelValues;
|
}
|
}
|
|
private void tbxChannel3Value_TextChanged(object sender, TextChangedEventArgs e)
|
{
|
var a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "3");
|
if (a1 != null)
|
{
|
a1.dropdown_name = tbxChannel3Value.Text;
|
}
|
else
|
{
|
DropdownName dropdownName = new DropdownName();
|
dropdownName.dropdown_id = "3";
|
dropdownName.dropdown_name = tbxChannel3Value.Text;
|
singleChannelValues.Add(dropdownName);
|
}
|
|
if (aspirateProperty != null)
|
{
|
aspirateProperty.methodAspirate.singlewellvolume = singleChannelValues;
|
}
|
|
if (dispenseProperty != null)
|
{
|
dispenseProperty.methodDispense.singlewellvolume = singleChannelValues;
|
}
|
}
|
|
private void tbxChannel4Value_TextChanged(object sender, TextChangedEventArgs e)
|
{
|
var a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "4");
|
if (a1 != null)
|
{
|
a1.dropdown_name = tbxChannel4Value.Text;
|
}
|
else
|
{
|
DropdownName dropdownName = new DropdownName();
|
dropdownName.dropdown_id = "4";
|
dropdownName.dropdown_name = tbxChannel4Value.Text;
|
singleChannelValues.Add(dropdownName);
|
}
|
|
if (aspirateProperty != null)
|
{
|
aspirateProperty.methodAspirate.singlewellvolume = singleChannelValues;
|
}
|
|
if (dispenseProperty != null)
|
{
|
dispenseProperty.methodDispense.singlewellvolume = singleChannelValues;
|
}
|
}
|
|
private void tbxChannel5Value_TextChanged(object sender, TextChangedEventArgs e)
|
{
|
var a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "5");
|
if (a1 != null)
|
{
|
a1.dropdown_name = tbxChannel5Value.Text;
|
}
|
else
|
{
|
DropdownName dropdownName = new DropdownName();
|
dropdownName.dropdown_id = "5";
|
dropdownName.dropdown_name = tbxChannel5Value.Text;
|
singleChannelValues.Add(dropdownName);
|
}
|
|
if (aspirateProperty != null)
|
{
|
aspirateProperty.methodAspirate.singlewellvolume = singleChannelValues;
|
}
|
|
if (dispenseProperty != null)
|
{
|
dispenseProperty.methodDispense.singlewellvolume = singleChannelValues;
|
}
|
}
|
|
private void tbxChannel6Value_TextChanged(object sender, TextChangedEventArgs e)
|
{
|
var a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "6");
|
if (a1 != null)
|
{
|
a1.dropdown_name = tbxChannel6Value.Text;
|
}
|
else
|
{
|
DropdownName dropdownName = new DropdownName();
|
dropdownName.dropdown_id = "6";
|
dropdownName.dropdown_name = tbxChannel6Value.Text;
|
singleChannelValues.Add(dropdownName);
|
}
|
|
if (aspirateProperty != null)
|
{
|
aspirateProperty.methodAspirate.singlewellvolume = singleChannelValues;
|
}
|
|
if (dispenseProperty != null)
|
{
|
dispenseProperty.methodDispense.singlewellvolume = singleChannelValues;
|
}
|
}
|
|
private void tbxChannel7Value_TextChanged(object sender, TextChangedEventArgs e)
|
{
|
var a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "7");
|
if (a1 != null)
|
{
|
a1.dropdown_name = tbxChannel7Value.Text;
|
}
|
else
|
{
|
DropdownName dropdownName = new DropdownName();
|
dropdownName.dropdown_id = "7";
|
dropdownName.dropdown_name = tbxChannel7Value.Text;
|
singleChannelValues.Add(dropdownName);
|
}
|
|
if (aspirateProperty != null)
|
{
|
aspirateProperty.methodAspirate.singlewellvolume = singleChannelValues;
|
}
|
|
if (dispenseProperty != null)
|
{
|
dispenseProperty.methodDispense.singlewellvolume = singleChannelValues;
|
}
|
}
|
|
private void tbxChannel8Value_TextChanged(object sender, TextChangedEventArgs e)
|
{
|
var a1 = singleChannelValues.FirstOrDefault(x => x.dropdown_id == "8");
|
if (a1 != null)
|
{
|
a1.dropdown_name = tbxChannel8Value.Text;
|
}
|
else
|
{
|
DropdownName dropdownName = new DropdownName();
|
dropdownName.dropdown_id = "8";
|
dropdownName.dropdown_name = tbxChannel8Value.Text;
|
singleChannelValues.Add(dropdownName);
|
}
|
|
if (aspirateProperty != null)
|
{
|
aspirateProperty.methodAspirate.singlewellvolume = singleChannelValues;
|
}
|
|
if (dispenseProperty != null)
|
{
|
dispenseProperty.methodDispense.singlewellvolume = singleChannelValues;
|
}
|
}
|
}
|
}
|