Esempio n. 1
0
 private void buttonDisplayVolumes_Click(object sender, EventArgs e)
 {
     cWindowToDisplayHisto WindowToDisplayHisto = new cWindowToDisplayHisto(CompleteScreening, Parent.NewWorld.ListCells.GetVolumes());
     WindowToDisplayHisto.Show();
 }
Esempio n. 2
0
        public void DisplayHistogram(int DescIdx)
        {
            cExtendedList Pos = new cExtendedList();
            //cWell TempWell;

            foreach (cWell item in this.ListActiveWells)
            {
                Pos.Add(item.ListSignatures[DescIdx].GetValue());

            }

            if (Pos.Count == 0)
            {
                MessageBox.Show("Not enough active well selected !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            //List<double[]> HistoPos = cGlobalInfo.WindowHCSAnalyzer.CreateHistogram(Pos.ToArray(), (int)cGlobalInfo.OptionsWindow.numericUpDownHistoBin.Value);
            cWindowToDisplayHisto NewWindow = new cWindowToDisplayHisto(ParentScreening, Pos);

            Series SeriesPos = new Series();
            SeriesPos.ShadowOffset = 1;

            /*      if (HistoPos.Count == 0) return;

                  for (int IdxValue = 0; IdxValue < HistoPos[0].Length; IdxValue++)
                  {
                      SeriesPos.Points.AddXY(HistoPos[0][IdxValue], HistoPos[1][IdxValue]);
                      SeriesPos.Points[IdxValue].ToolTip = HistoPos[1][IdxValue].ToString();
                      SeriesPos.Points[IdxValue].Color = Color.DarkBlue;

                  }

                  ChartArea CurrentChartArea = new ChartArea();
                  CurrentChartArea.BorderColor = Color.Black;

                  NewWindow.chartForSimpleForm.ChartAreas.Add(CurrentChartArea);
                  CurrentChartArea.Axes[0].MajorGrid.Enabled = false;
                  CurrentChartArea.Axes[0].Title = ParentScreening.ListDescriptors[DescIdx].GetName();
                  CurrentChartArea.Axes[1].Title = "Sum";
                  CurrentChartArea.AxisX.LabelStyle.Format = "N2";

                  NewWindow.chartForSimpleForm.TextAntiAliasingQuality = TextAntiAliasingQuality.High;
                  CurrentChartArea.BackGradientStyle = GradientStyle.TopBottom;
                  CurrentChartArea.BackColor = cGlobalInfo.OptionsWindow.panel1.BackColor;
                  CurrentChartArea.BackSecondaryColor = Color.White;

                  SeriesPos.ChartType = SeriesChartType.Column;
                  SeriesPos.Color = cGlobalInfo.GetColor(1);
                  NewWindow.chartForSimpleForm.Series.Add(SeriesPos);

                  NewWindow.chartForSimpleForm.ChartAreas[0].CursorX.IsUserEnabled = true;
                  NewWindow.chartForSimpleForm.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
                  NewWindow.chartForSimpleForm.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
                  NewWindow.chartForSimpleForm.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true;

                  if (cGlobalInfo.OptionsWindow.checkBoxDisplayHistoStats.Checked)
                  {
                      StripLine AverageLine = new StripLine();
                      AverageLine.BackColor = Color.Black;
                      AverageLine.IntervalOffset = Pos.Mean();
                      AverageLine.StripWidth = double.Epsilon;
                      CurrentChartArea.AxisX.StripLines.Add(AverageLine);
                      AverageLine.Text = String.Format("{0:0.###}", AverageLine.IntervalOffset);

                      StripLine StdLine = new StripLine();
                      StdLine.BackColor = Color.FromArgb(64, Color.Black);
                      double Std = Pos.Std();
                      StdLine.IntervalOffset = AverageLine.IntervalOffset - 0.5 * Std;
                      StdLine.StripWidth = Std;
                      CurrentChartArea.AxisX.StripLines.Add(StdLine);
                      AverageLine.StripWidth = 0.0001;
                  }
                  */
            Title CurrentTitle = null;

            CurrentTitle = new Title(ParentScreening.GetCurrentDisplayPlate().Name + " - " + ParentScreening.ListDescriptors[DescIdx].GetName() + " histogram.");

            CurrentTitle.Font = new System.Drawing.Font("Arial", 11, FontStyle.Bold);
            NewWindow.chartForSimpleForm.Titles.Add(CurrentTitle);
            NewWindow.Text = CurrentTitle.Text;
            NewWindow.Show();
            NewWindow.chartForSimpleForm.Update();
            NewWindow.chartForSimpleForm.Show();
            NewWindow.Controls.AddRange(new System.Windows.Forms.Control[] { NewWindow.chartForSimpleForm });
            return;
        }