public void CalacCorrentVolume() { ReagentSuppliesConfigurationController configurationController = new ReagentSuppliesConfigurationController(); CurrentList = configurationController.GetAll(); bool normalLevel = true; while (RunningLiquidThread) { configurationController.UpdateExperimentVolume(SessionInfo.ExperimentID, ref CurrentList, new short[] { 1, 2, 3 }, ReagentAndSuppliesConfiguration.CurrentVolumeFieldName); configurationController.NeededVolumeofProcessingRotations(ref CurrentList); normalLevel = CheckCurrentVolume(); if (normalLevel) { RiseNormal(this, null); Thread.Sleep(t); } else { if (RiseWarning != null) { ReagentWarningArgs args = new ReagentWarningArgs(); args.CurrentList = CurrentList; RiseWarning(this, args); } } } }
public bool CalacCorrentVolumeIsValid() { ReagentSuppliesConfigurationController configurationController = new ReagentSuppliesConfigurationController(); CurrentList = configurationController.GetAll(); bool normalLevel = true; configurationController.UpdateExperimentVolume(SessionInfo.ExperimentID, ref CurrentList, new short[] { 1, 2, 3 }, ReagentAndSuppliesConfiguration.CurrentVolumeFieldName); configurationController.NeededVolumeofProcessingRotations(ref CurrentList); normalLevel = CheckCurrentVolume(); return(normalLevel); }
private void WhenAdd() { //DataGrid AddColumns(dtReagent); ReagentSuppliesConfigurationController configurationController = new ReagentSuppliesConfigurationController(); List <ReagentAndSuppliesConfiguration> configurations = configurationController.GetAllActived().Where(P => P.ItemType < 100).OrderBy(P => P.ItemType).ToList(); configurationController.UpdateExperimentVolume(SessionInfo.ExperimentID, ref configurations, new short[] { ConsumptionType.consume, ConsumptionType.Add, ConsumptionType.FirstAdd }, ReagentAndSuppliesConfiguration.CurrentVolumeFieldName); //configurationController.UpdateExperimentVolume(SessionInfo.ExperimentID, ref configurations, new short[] { // ConsumptionType.Need }, ReagentAndSuppliesConfiguration.NeedVolumeFieldName); configurationController.NeededVolumeofProcessingRotations(ref configurations); List <ReagentAndSupply> reagents = new ReagentAndSuppliesController().GetAll(SessionInfo.ExperimentID); foreach (ReagentAndSuppliesConfiguration config in configurations) { if (config.ItemType >= 100) { continue; } Guid?reagentAndSuppplieID = null; config.Correct = config.Correct = config.NeedVolume == 0 ? true : config.CurrentVolume > config.NeedVolume * Common.Configuration.GetMinVolume(); ReagentAndSupply reagent = reagents.FirstOrDefault(P => P.ConfigurationItemID == config.ItemID); if (reagent != null) { reagentAndSuppplieID = reagent.ItemID; } dtReagent.Rows.Add(config.DisplayName, config.CurrentVolume, 0, config.Unit, config.Correct, config.ItemType, reagentAndSuppplieID, config.NeedVolume, config.NeedVolume * Common.Configuration.GetMinVolume(), config.ItemID); } dtReagent.DefaultView.Sort = "ItemType"; dgReagent.DataContext = dtReagent.DefaultView.FindRows(0); foreach (short dataGridKey in dataGridDictionary.Keys) { dataGridDictionary[dataGridKey].ItemsSource = dtReagent.DefaultView.FindRows(dataGridKey); } //Drawing Plates and Carriers viewPlates = new Services.DeskTopService().SetReagentPosition(configurations, new CarrierController().GetCarrier(), 0); double lengthUnit = (this.Width - 50) / 84; double cooPoint = 1.4; panelDeskTop.Width = (this.Width - 50); panelDeskTop.Height = lengthUnit * 30; View.Services.DeskTopService desktopService = new Services.DeskTopService(); carrierBases = desktopService.GetCarriers(lengthUnit, cooPoint); foreach (CarrierBase carrier in carrierBases) { carrier.UpdatePlate(viewPlates.FindAll(P => P.ContainerName == carrier.CarrierName)); panelDeskTop.Children.Add(carrier); } panelDeskTop.Children.Add(desktopService.DrawCoordinate((this.Width - 50), 69, lengthUnit)); for (int i = 0; i < dtReagent.Rows.Count; i++) { if (!(bool)dtReagent.Rows[i]["Correct"]) { this.btnSave.Visibility = System.Windows.Visibility.Visible; } } }