private void swapClassesToolStripMenuItem_Click(object sender, EventArgs e) { if (CompleteScreening == null) return; FormForSwapClasses WindowSwapClasses = new FormForSwapClasses(GlobalInfo); if (WindowSwapClasses.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; int Idx = 0; int NumberOfPlates = CompleteScreening.ListPlatesActive.Count; int OriginalIdx = WindowSwapClasses.comboBoxOriginalClass.SelectedIndex - 1; int DestinatonIdx = WindowSwapClasses.comboBoxDestinationClass.SelectedIndex - 1; // loop on all the plate for (int PlateIdx = 0; PlateIdx < NumberOfPlates; PlateIdx++) { cPlate CurrentPlateToProcess = CompleteScreening.ListPlatesActive.GetPlate(PlateIdx); for (int IdxValue = 0; IdxValue < CompleteScreening.Columns; IdxValue++) for (int IdxValue0 = 0; IdxValue0 < CompleteScreening.Rows; IdxValue0++) { cWell TmpWell = CurrentPlateToProcess.GetWell(IdxValue, IdxValue0, false); if (TmpWell == null) continue; if (TmpWell.GetClass() == OriginalIdx) { if (DestinatonIdx == -1) TmpWell.SetAsNoneSelected(); else TmpWell.SetClass(DestinatonIdx); Idx++; } } } CompleteScreening.GetCurrentDisplayPlate().DisplayDistribution(CompleteScreening.ListDescriptors.CurrentSelectedDescriptor, false); MessageBox.Show(Idx + " wells have been swapped !", "Process over !", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); }
private void swapClassesToolStripMenuItem_Click(object sender, EventArgs e) { if (cGlobalInfo.CurrentScreening == null) return; FormForSwapClasses WindowSwapClasses = new FormForSwapClasses(GlobalInfo); PanelForClassSelection ClassSelectionPanel = new PanelForClassSelection(true, eClassType.WELL); ClassSelectionPanel.Height = WindowSwapClasses.panelToBeSwapped.Height; //ClassSelectionPanel.Location.Y = ClassSelectionPanel.Location.Y+ 20; ClassSelectionPanel.UnSelectAll(); WindowSwapClasses.panelToBeSwapped.Controls.Add(ClassSelectionPanel); if (WindowSwapClasses.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; int Idx = 0; int NumberOfPlates = cGlobalInfo.CurrentScreening.ListPlatesActive.Count; // int OriginalIdx = WindowSwapClasses.comboBoxOriginalClass.SelectedIndex - 1; int DestinatonIdx = WindowSwapClasses.comboBoxDestinationClass.SelectedIndex - 1; // loop on all the plate for (int PlateIdx = 0; PlateIdx < NumberOfPlates; PlateIdx++) { cPlate CurrentPlateToProcess = cGlobalInfo.CurrentScreening.ListPlatesActive.GetPlate(PlateIdx); for (int IdxValue = 0; IdxValue < cGlobalInfo.CurrentScreening.Columns; IdxValue++) for (int IdxValue0 = 0; IdxValue0 < cGlobalInfo.CurrentScreening.Rows; IdxValue0++) { cWell TmpWell = CurrentPlateToProcess.GetWell(IdxValue, IdxValue0, false); if (TmpWell == null) continue; if ((TmpWell.GetCurrentClassIdx() > -1) && (ClassSelectionPanel.GetListSelectedClass()[TmpWell.GetCurrentClassIdx()])) { if (DestinatonIdx == -1) TmpWell.SetAsNoneSelected(); else TmpWell.SetClass(DestinatonIdx); Idx++; } } } cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().DisplayDistribution(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor(), false); MessageBox.Show(Idx + " wells have been swapped !", "Process over !", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); }