/// <summary> /// Draw the dendogram signature for a specific well /// </summary> /// <param name="Well"></param> /// <param name="Size"></param> /// <param name="PosX"></param> /// <param name="PosY"></param> /// <returns>Lenght of the signature</returns> private int DrawSignature(cWell Well, int Size, int PosX, int PosY) { int RealIdx = 0; int SizeFont = Size / 4; int ScrollShiftY = this.VerticalScroll.Value; double Min, Max; int ConvertedValue; g.DrawString("[" + Well.GetPosX() + "x" + Well.GetPosY() + "]", new Font("Arial", 8), Brushes.Black, 15, PosY - ScrollShiftY); Rectangle CurrentRect = new Rectangle(5, PosY, 8, Size); SolidBrush CurrBrush = new SolidBrush(Well.GetClassColor()); // draw the rectangle g.FillRectangle(CurrBrush, CurrentRect); for (int iDesc = 0; iDesc < cGlobalInfo.CurrentScreening.ListDescriptors.Count; iDesc++) { if (!cGlobalInfo.CurrentScreening.ListDescriptors[iDesc].IsActive()) continue; // specify the rect shape CurrentRect = new Rectangle(PosX + RealIdx * Size, PosY, Size, Size); // specify the color cSignature CurrentDesc = Well.ListSignatures[iDesc]; byte[][] LUT = cGlobalInfo.CurrentPlateLUT; Min = CurrentDendo.InfoForHierarchical.ListMin[RealIdx]; Max = CurrentDendo.InfoForHierarchical.ListMax[RealIdx]; if (Min == Max) ConvertedValue = 0; else ConvertedValue = (int)(((CurrentDesc.GetValue() - Min) * (LUT[0].Length - 1)) / (Max - Min)); if (ConvertedValue >= LUT[0].Length) ConvertedValue = LUT[0].Length - 1; CurrBrush = new SolidBrush(Color.FromArgb(LUT[0][ConvertedValue], LUT[1][ConvertedValue], LUT[2][ConvertedValue])); // draw the rectangle g.FillRectangle(CurrBrush, CurrentRect); RealIdx++; } return PosX + RealIdx * Size; }
public bool AddWell(cWell NewWell) { int PosX = NewWell.GetPosX() - 1; int PosY = NewWell.GetPosY() - 1; try { ListWell[PosX, PosY] = NewWell; ListActiveWells.Add(NewWell); ListWells.Add(NewWell); } catch (Exception) { return false; } return true; }
public void LoadFromDisk(string Path) { if (ListWell == null) { cGlobalInfo.ConsoleWriteLine("ListWell NULL"); return; } IEnumerable<string> ListFile = Directory.EnumerateFiles(Path, "*.txt", SearchOption.TopDirectoryOnly); int ProcessedWell = 0; foreach (string FileName in ListFile) { cWell NewWell = new cWell(FileName, this.ParentScreening, this); if (NewWell.GetPosX() != -1) ProcessedWell++; this.AddWell(NewWell); //ListWell[NewWell.GetPosX() - 1, NewWell.GetPosY() - 1] = NewWell; } ListMinMax = new List<double[]>(); for (int i = 0; i < ParentScreening.ListDescriptors.Count; i++) { double[] TmpMinMax = GetMinMax(i); ListMinMax.Add(TmpMinMax); } this.NumberOfActiveWells = ProcessedWell; cGlobalInfo.ConsoleWriteLine(ProcessedWell + " well(s) succesfully processed"); }
public void DisplayTable(cWell Well) { SQLiteCommand mycommand = new SQLiteCommand(_SQLiteConnection); mycommand.CommandText = "SELECT * FROM \"" + Well.SQLTableName + "\""; SQLiteDataReader value = mycommand.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(value); cDisplayScatter2D WindowForTable = new cDisplayScatter2D(dt); WindowForTable.comboBoxAxeX.DataSource = this.GetDescriptorNames(Well); WindowForTable.comboBoxAxeY.DataSource = this.GetDescriptorNames(Well); WindowForTable.comboBoxVolume.DataSource = this.GetDescriptorNames(Well); WindowForTable.chartForPoints.Series[0].MarkerColor = Well.GetClassColor(); // WindowForTable.ch WindowForTable.Text = Well.AssociatedPlate.GetName() + " [" + Well.GetPosX() + "x" + Well.GetPosY() + "]"; WindowForTable.Show(); }