public override void UpdatePlate(List <PlateBase> plates) { UIElementCollection children = GridPlate.Children; foreach (UIElement UIE in children) { if (UIE is Plate) { Plate plate = (Plate)UIE; PlateBase tempPlate = plates.FirstOrDefault(P => P.Position == plate.Position); if (tempPlate != null) { plate.Color = tempPlate.Color; plate.NeedVolume = tempPlate.NeedVolume; plate.DisplayName = tempPlate.DisplayName; plate.ItemType = tempPlate.ItemType; plate.ChineseName = tempPlate.ChineseName; plate.RelatedControls = tempPlate.RelatedControls; plate.Correct = tempPlate.Correct; plate.ConfigurationItemID = tempPlate.ConfigurationItemID; } } } Plates = plates; }
public override void ShiningStop() { UIElementCollection children = GridPlate.Children; foreach (UIElement UIE in children) { if (UIE is Plate) { Plate plate = (Plate)UIE; plate.ShiningStop(); } } }
public RubbishAlert(Guid RotationID) { InitializeComponent(); double lenghtUnit = deskTop.Width / 84; imgKingFisher.Width = lenghtUnit * 24; imgKingFisher.Height = lenghtUnit * 24; imgKingFisher.Margin = new Thickness(-lenghtUnit * 2 * 1.4, lenghtUnit * 1, 0, lenghtUnit * 2); deskTop.Children.Add(desktopService.DrawCoordinate(deskTop.Width, 69, lenghtUnit)); List <CarrierBase> carriers = desktopService.GetCarriers(lenghtUnit, 1.4); List <ReagentAndSuppliesConfiguration> supplies = new ReagentSuppliesConfigurationController(). GetRotationVolume(SessionInfo.ExperimentID, RotationID, new short[] { 0 }, ReagentAndSuppliesConfiguration.CurrentVolumeFieldName).FindAll(P => P.ItemType >= 100 && P.ItemType < 200); List <PlateBase> plates = new List <PlateBase>(); if (supplies.Exists(P => P.ItemType == 101)) { ReagentAndSuppliesConfiguration supply = supplies.First(P => P.ItemType == 101); PlateBase plate = new Control.Plate(); plate.DisplayName = supply.DisplayName; plate.ChineseName = supply.DisplayName; plate.NeedVolume = 1; plate.CurrentVolume = 1; plate.Grid = 1; plate.Position = 1; plate.ContainerName = "001"; plate.Color = new SolidColorBrush((Color)ColorConverter.ConvertFromString(supply.Color)); plate.ItemType = (short)supply.ItemType; plate.BarcodePrefix = supply.BarcodePrefix; plate.ConfigurationItemID = supply.ItemID; plate.Correct = false; plates.Add(plate); } Brush PCRPlateColor = new SolidColorBrush(Colors.Red); foreach (ReagentAndSuppliesConfiguration supply in supplies) { Brush color = new SolidColorBrush((Color)ColorConverter.ConvertFromString(supply.Color)); if (supply.ItemType == DiTiType.DiTi1000)//DiTi1000 { //int position = 1; //int grid = 1; //string containerName = supply.ContainerName; //int totalCount = int.Parse(decimal.Ceiling(decimal.Parse((supply.CurrentVolume / 96).ToString())).ToString()); //for (int i = 0; i < totalCount; i++) //{ // PlateBase plate = new WanTai.View.Control.Plate(); // plate.DisplayName = supply.DisplayName + " " + (i + 1).ToString(); // plate.ChineseName = supply.DisplayName; // plate.NeedVolume = 1; // plate.CurrentVolume = 1; // plate.Grid = grid; // plate.Position = position; // plate.ContainerName = "006"; // plate.Color = color; // plate.ItemType = (short)supply.ItemType; // plate.ConfigurationItemID = supply.ItemID; // plate.Correct = false; // plates.Add(plate); // position++; // if (i == 5) break; //} } else if (supply.ItemType == DiTiType.DiTi200)//DiTi200 { //int position = 1; //int grid = 1; //string containerName = supply.ContainerName; //int totalCount = int.Parse(decimal.Ceiling(decimal.Parse((supply.CurrentVolume / 96).ToString())).ToString()); //for (int i = 0; i < totalCount; i++) //{ // PlateBase plate = new WanTai.View.Control.Plate(); // plate.DisplayName = supply.DisplayName + " " + (i + 1).ToString(); // plate.ChineseName = supply.DisplayName; // plate.NeedVolume = 1; // plate.CurrentVolume = 1; // plate.Grid = grid; // plate.Position = position; // plate.ContainerName = "007"; // plate.Color = color; // plate.ItemType = (short)supply.ItemType; // plate.ConfigurationItemID = supply.ItemID; // plate.Correct = false; // plates.Add(plate); // position++; // if (i == 3) break; //} } else if (supply.ItemType == 103) //&& supply.NeedVolume>0)//PCR Plate { PCRPlateColor = color; int position = 2; int grid = 1; //string containerName = supply.ContainerName; //for (int i = 0; i < supply.CurrentVolume; i++) //{ PlateBase plate = new WanTai.View.Control.Plate(); plate.DisplayName = supply.DisplayName; plate.ChineseName = supply.DisplayName; plate.NeedVolume = 1; plate.CurrentVolume = 1; plate.Grid = grid; plate.Position = position; plate.ContainerName = "002"; plate.Color = color; plate.ItemType = (short)supply.ItemType; plate.ConfigurationItemID = supply.ItemID; plate.Correct = false; plates.Add(plate); //position++; //if (i == 2) break; //} } } /* * //DW96Plate3、DW96Plate4、DW96Plate5 * PlateBase PCRPlate = new WanTai.View.Control.Plate(); * PCRPlate.DisplayName = "DW96Plate3"; * PCRPlate.ChineseName = "DW96Plate3"; * PCRPlate.NeedVolume = 1; * PCRPlate.CurrentVolume = 1; * PCRPlate.Grid = 1; * PCRPlate.Position = 1; * PCRPlate.ContainerName = "002"; * PCRPlate.Color = PCRPlateColor; * PCRPlate.ItemType = 100; * PCRPlate.ConfigurationItemID = new Guid(); * PCRPlate.Correct = false; * plates.Add(PCRPlate); * * PlateBase PCRPlate = new WanTai.View.Control.Plate(); * PCRPlate.DisplayName = "DW96Plate4"; * PCRPlate.ChineseName = "DW96Plate4"; * PCRPlate.NeedVolume = 1; * PCRPlate.CurrentVolume = 1; * PCRPlate.Grid = 1; * PCRPlate.Position = 2; * PCRPlate.ContainerName = "002"; * PCRPlate.Color = PCRPlateColor; * PCRPlate.ItemType = 102; * PCRPlate.ConfigurationItemID = new Guid(); * PCRPlate.Correct = false; * plates.Add(PCRPlate); * * PCRPlate = new WanTai.View.Control.Plate(); * PCRPlate.DisplayName = "DW96Plate5"; * PCRPlate.ChineseName = "DW96Plate5"; * PCRPlate.NeedVolume = 1; * PCRPlate.CurrentVolume = 1; * PCRPlate.Grid = 1; * PCRPlate.Position = 3; * PCRPlate.ContainerName = "002"; * PCRPlate.Color = PCRPlateColor; * PCRPlate.ItemType = 103; * PCRPlate.ConfigurationItemID = new Guid(); * PCRPlate.Correct = false; * plates.Add(PCRPlate); */ foreach (CarrierBase c in carriers) { c.UpdatePlate(plates.FindAll(P => P.ContainerName == c.CarrierName)); deskTop.Children.Add(c); c.Scan(); } this.RotationID = RotationID; }
public PCRRubbishAlert(Guid RotationID) { InitializeComponent(); double lenghtUnit = deskTop.Width / 84; imgKingFisher.Width = lenghtUnit * 24; imgKingFisher.Height = lenghtUnit * 24; imgKingFisher.Margin = new Thickness(-lenghtUnit * 2 * 1.4, lenghtUnit * 1, 0, lenghtUnit * 2); deskTop.Children.Add(desktopService.DrawCoordinate(deskTop.Width, 69, lenghtUnit)); List <CarrierBase> carriers = desktopService.GetCarriers(lenghtUnit, 1.4); List <ReagentAndSuppliesConfiguration> supplies = new ReagentSuppliesConfigurationController(). GetRotationVolume(SessionInfo.ExperimentID, RotationID, new short[] { 0 }, ReagentAndSuppliesConfiguration.CurrentVolumeFieldName).FindAll(P => P.ItemType >= 100 && P.ItemType < 200); List <PlateBase> plates = new List <PlateBase>(); //if (supplies.Exists(P => P.ItemType == 101))//dw 96 plate //{ // ReagentAndSuppliesConfiguration supply = supplies.First(P => P.ItemType == 101); // PlateBase plate = new Control.Plate(); // plate.DisplayName = supply.DisplayName; // plate.ChineseName = supply.DisplayName; // plate.NeedVolume = 1; // plate.CurrentVolume = 1; // plate.Grid = 1; // plate.Position = 1; // plate.ContainerName = "001"; // plate.Color = new SolidColorBrush((Color)ColorConverter.ConvertFromString(supply.Color)); // plate.ItemType = (short)supply.ItemType; // plate.BarcodePrefix = supply.BarcodePrefix; // plate.ConfigurationItemID = supply.ItemID; // plate.Correct = false; // // plates.Add(plate); //} //if (supplies.Exists(P => P.ItemType == 102))//96 Tip Comb //{ // ReagentAndSuppliesConfiguration supply = supplies.First(P => P.ItemType == 102); // PlateBase plate = new Control.Plate(); // plate.DisplayName = supply.DisplayName; // plate.ChineseName = supply.DisplayName; // plate.NeedVolume = 1; // plate.CurrentVolume = 1; // plate.Grid = 1; // plate.Position = 1; // plate.ContainerName = "001"; // plate.Color = new SolidColorBrush((Color)ColorConverter.ConvertFromString(supply.Color)); // plate.ItemType = (short)supply.ItemType; // plate.BarcodePrefix = supply.BarcodePrefix; // plate.ConfigurationItemID = supply.ItemID; // plate.Correct = false; // plates.Add(plate); //} Brush PCRPlateColor = new SolidColorBrush(Colors.Red); foreach (ReagentAndSuppliesConfiguration supply in supplies) { if (supply.ItemType == 101)//dw 96 plate { for (int i = 1; i < 4; i++) { PlateBase plate = new Control.Plate(); plate.DisplayName = supply.DisplayName + " " + (6 - i).ToString();; plate.ChineseName = supply.DisplayName; plate.NeedVolume = 1; plate.CurrentVolume = 1; plate.Grid = 1; plate.Position = i; plate.ContainerName = "002"; plate.Color = new SolidColorBrush((Color)ColorConverter.ConvertFromString(supply.Color)); plate.ItemType = (short)supply.ItemType; plate.BarcodePrefix = supply.BarcodePrefix; plate.ConfigurationItemID = supply.ItemID; plate.Correct = true; plates.Add(plate); } } else if (supply.ItemType == 102 && supply.CurrentVolume > 0)//96 Tip Comb { PlateBase plate = new Control.Plate(); plate.DisplayName = supply.DisplayName; plate.ChineseName = supply.DisplayName; plate.NeedVolume = 1; plate.CurrentVolume = 1; plate.Grid = 1; plate.Position = 1; plate.ContainerName = "001"; plate.Color = new SolidColorBrush((Color)ColorConverter.ConvertFromString(supply.Color)); plate.ItemType = (short)supply.ItemType; plate.BarcodePrefix = supply.BarcodePrefix; plate.ConfigurationItemID = supply.ItemID; plate.Correct = true; plates.Add(plate); } else if (supply.ItemType == 103 && supply.CurrentVolume > 0)//PCR Plate { int position = 5; int grid = 1; PlateBase plate = new WanTai.View.Control.Plate(); plate.DisplayName = supply.DisplayName; plate.ChineseName = supply.DisplayName; plate.NeedVolume = 1; plate.CurrentVolume = 1; plate.Grid = grid; plate.Position = position; plate.ContainerName = "007"; plate.Color = new SolidColorBrush((Color)ColorConverter.ConvertFromString(supply.Color)); plate.ItemType = (short)supply.ItemType; plate.ConfigurationItemID = supply.ItemID; plate.Correct = true; plates.Add(plate); } } foreach (CarrierBase c in carriers) { List <PlateBase> greenPlate = plates.FindAll(P => P.ContainerName == c.CarrierName); c.UpdatePlate(greenPlate); deskTop.Children.Add(c); string[] plateNames = new string[greenPlate.Count]; int index = 0; foreach (PlateBase plate in greenPlate) { plateNames[index] = plate.DisplayName; index++; } c.ShiningWithGreen(plateNames); //c.Scan(); } }
/// <summary> /// Create plates and put plate on carrier /// </summary> /// <param name="reagentAndSupplies"></param> /// <param name="carriers"></param> /// <param name="flag">0 Need,1 Current</param> /// <returns></returns> public List <PlateBase> SetReagentPosition(List <ReagentAndSuppliesConfiguration> reagentAndSupplies, List <DataModel.Carrier> carriers, short flag) { List <PlateBase> plates = new List <PlateBase>(); double volume = 0; double actualSavedVolumn = 0; double currentActualVolumn = 0; foreach (ReagentAndSuppliesConfiguration reagent in reagentAndSupplies) { if (flag == 0) { volume = reagent.NeedVolume; if (reagent.ActualSavedVolume > 0) { actualSavedVolumn = reagent.ActualSavedVolume; } } else { volume = reagent.CurrentVolume; if (reagent.CurrentActualVolume > 0) { currentActualVolumn = reagent.CurrentActualVolume; } } if (volume <= 0) { continue; } Brush color = new SolidColorBrush((Color)ColorConverter.ConvertFromString(reagent.Color)); if (reagent.ItemType > 0 && reagent.ItemType < 100 && reagent.ItemType % 5 == 0) { PlateBase plate = new WanTai.View.Control.ReagentTub(); plate.DisplayName = reagent.DisplayName; plate.ChineseName = reagent.DisplayName; plate.EnglishName = reagent.EnglishName; plate.NeedVolume = reagent.NeedVolume; plate.CurrentVolume = reagent.CurrentVolume; plate.Grid = reagent.Grid; plate.Position = reagent.Position; plate.ContainerName = reagent.ContainerName; plate.CarrierGrid = (int)carriers.First(P => P.CarrierName == reagent.ContainerName).Grid; plate.Color = color; plate.ItemType = (short)reagent.ItemType; plate.BarcodePrefix = reagent.BarcodePrefix; plate.Barcode = reagent.BarcodePrefix; plate.ConfigurationItemID = reagent.ItemID; plate.Correct = reagent.Correct; plate.ConfigurationItemID = reagent.ItemID; plates.Add(plate); } else if (reagent.ItemType == 101)//DW 96 Plate { int position = reagent.Position; int grid = reagent.Grid; string containerName = reagent.ContainerName; for (int i = 0; i < volume; i++) { PlateBase plate = new WanTai.View.Control.Plate(); plate.DisplayName = reagent.DisplayName + " " + (i + 1).ToString(); plate.ChineseName = reagent.DisplayName; plate.EnglishName = reagent.EnglishName; plate.NeedVolume = i == 0 ? volume : 0; plate.CurrentVolume = reagent.CurrentVolume; plate.Grid = grid; plate.Position = position; plate.ContainerName = containerName; plate.CarrierGrid = (int)carriers.First(P => P.CarrierName == containerName).Grid; plate.Color = color; plate.ItemType = (short)reagent.ItemType; plate.BarcodePrefix = reagent.BarcodePrefix; plate.Barcode = reagent.BarcodePrefix; plate.ConfigurationItemID = reagent.ItemID; plate.Correct = reagent.Correct; plates.Add(plate); position--; if (i == 1) { containerName = "002"; position = 3; } if (i == 4) { break; } } } else if (reagent.ItemType == 103)//PCR Plate { int position = reagent.Position; int grid = reagent.Grid; string containerName = reagent.ContainerName; for (int i = 0; i < volume; i++) { PlateBase plate = new WanTai.View.Control.Plate(); plate.DisplayName = reagent.DisplayName + " " + (i + 1).ToString(); plate.ChineseName = reagent.DisplayName; plate.EnglishName = reagent.EnglishName; plate.NeedVolume = i == 0 ? volume : 0; plate.CurrentVolume = reagent.CurrentVolume; plate.Grid = grid; plate.Position = position; plate.ContainerName = containerName; plate.CarrierGrid = (int)carriers.First(P => P.CarrierName == containerName).Grid; plate.Color = color; plate.ItemType = (short)reagent.ItemType; plate.BarcodePrefix = reagent.BarcodePrefix; plate.Barcode = reagent.BarcodePrefix; plate.ConfigurationItemID = reagent.ItemID; plate.Correct = reagent.Correct; plates.Add(plate); position++; if (i == 0) { break; } } } else if (reagent.ItemType == 104)//1000 Diti { int position = reagent.Position; int grid = reagent.Grid; string containerName = reagent.ContainerName; for (int i = 0; i < volume; i++) { PlateBase plate = new WanTai.View.Control.Plate(); plate.DisplayName = reagent.DisplayName + " " + (i + 1).ToString(); plate.ChineseName = reagent.DisplayName; plate.EnglishName = reagent.EnglishName; plate.NeedVolume = i == 0 ? volume : 0; if (actualSavedVolumn > 0) { plate.ActualSavedVolume = i == 0 ? actualSavedVolumn : 0; } if (currentActualVolumn > 0) { plate.CurrentActualVolume = i == 0 ? currentActualVolumn : 0; } plate.Grid = grid; plate.Position = position; plate.ContainerName = containerName; plate.CarrierGrid = (int)carriers.First(P => P.CarrierName == containerName).Grid; plate.Color = color; plate.ItemType = (short)reagent.ItemType; plate.BarcodePrefix = reagent.BarcodePrefix; plate.Barcode = reagent.BarcodePrefix; plate.ConfigurationItemID = reagent.ItemID; plate.Correct = reagent.Correct; plates.Add(plate); position++; if (i == 1) { containerName = "006"; position = 2; } if (i == 5) { break; } } } else if (reagent.ItemType == 105)//200 Diti { int position = reagent.Position; int grid = reagent.Grid; string containerName = reagent.ContainerName; for (int i = 0; i < volume; i++) { PlateBase plate = new WanTai.View.Control.Plate(); plate.DisplayName = reagent.DisplayName + " " + (i + 1).ToString(); plate.ChineseName = reagent.DisplayName; plate.EnglishName = reagent.EnglishName; plate.NeedVolume = i == 0 ? volume : 0; if (actualSavedVolumn > 0) { plate.ActualSavedVolume = i == 0 ? actualSavedVolumn : 0; } if (currentActualVolumn > 0) { plate.CurrentActualVolume = i == 0 ? currentActualVolumn : 0; } plate.Grid = grid; plate.Position = position; plate.ContainerName = containerName; plate.CarrierGrid = (int)carriers.First(P => P.CarrierName == containerName).Grid; plate.Color = color; plate.ItemType = (short)reagent.ItemType; plate.BarcodePrefix = reagent.BarcodePrefix; plate.Barcode = reagent.BarcodePrefix; plate.ConfigurationItemID = reagent.ItemID; plate.Correct = reagent.Correct; plates.Add(plate); position++; if (i == 0) { containerName = "007"; position = 2; } if (i == 3) { break; } } } else if (reagent.ItemType < 200) { PlateBase plate = new WanTai.View.Control.Plate(); plate.DisplayName = reagent.DisplayName; plate.ChineseName = reagent.DisplayName; plate.EnglishName = reagent.EnglishName; plate.NeedVolume = reagent.NeedVolume; plate.CurrentVolume = reagent.CurrentVolume; plate.Grid = reagent.Grid; plate.Position = reagent.Position; plate.ContainerName = reagent.ContainerName; plate.CarrierGrid = (int)carriers.First(P => P.CarrierName == reagent.ContainerName).Grid; plate.Color = color; plate.ItemType = (short)reagent.ItemType; plate.BarcodePrefix = reagent.BarcodePrefix; plate.Barcode = reagent.BarcodePrefix; plate.ConfigurationItemID = reagent.ItemID; plate.Correct = reagent.Correct; plates.Add(plate); } } return(plates); }