Exemplo n.º 1
0
        /// <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;
        }
Exemplo n.º 2
0
        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();
        }