public FormForDescriptorInfo(cDescriptorType CurrentDesc) { this.CurrentDesc = CurrentDesc; InitializeComponent(); this.textBoxNameDescriptor.Text = CurrentDesc.GetName(); this.richTextBoxDescription.Text = CurrentDesc.description; this.labelDataType.Text = CurrentDesc.GetDataType(); if (CurrentDesc.GetDataType() == "Single") this.numericUpDownBinValue.Visible = false; this.numericUpDownBinValue.Value = CurrentDesc.GetBinNumber(); this.OriginalBinNumber = CurrentDesc.GetBinNumber(); if (CurrentDesc.IsConnectedToDatabase) { this.labelDataBaseConnection.Text = "DataBase Connection."; panelForColor.BackColor = Color.LightGreen; } else { this.labelDataBaseConnection.Text = "No DataBase connection."; panelForColor.BackColor = Color.Red; } }
public void ExportToHTML(cDescriptorType Desc) { if (Desc.IsConnectedToDatabase == false) return; List<cDescriptorType> LCDT = new List<cDescriptorType>(); LCDT.Add(Desc); List<cCellularPhenotype> ListCellularPhenotypesToBeSelected = new List<cCellularPhenotype>(); cGUI_ListClasses GUIClasses = new cGUI_ListClasses(); GUIClasses.IsCheckBoxes = true; GUIClasses.IsSelectAll = true; GUIClasses.ClassType = eClassType.PHENOTYPE; if (!GUIClasses.Run().IsSucceed) return; int IDx = 0; foreach (var item in cGlobalInfo.ListCellularPhenotypes) { if ((GUIClasses.GetOutPut()[0][IDx++] != 0)) ListCellularPhenotypesToBeSelected.Add(item); } cExtendedTable ET = new cExtendedTable(cGlobalInfo.CurrentScreening.Columns, cGlobalInfo.CurrentScreening.Rows, 0); ET.Name = this.Name + " [" + Desc.GetName() + "]"; ET.ListRowNames = new List<string>(); for (int i = 0; i < ET[0].Count; i++) { ET.ListRowNames.Add(((char)(i + 65)).ToString()); } FormForProgress MyProgressBar = new FormForProgress(); MyProgressBar.progressBar.Maximum = this.ListActiveWells.Count; MyProgressBar.Show(); //ET.ListTags = new List<object>(); for (int i = 0; i < cGlobalInfo.CurrentScreening.Columns; i++) { ET[i].ListTags = new List<object>(); ET[i].Name = (i + 1).ToString(); for (int j = 0; j < cGlobalInfo.CurrentScreening.Rows; j++) { MyProgressBar.progressBar.Update(); cWell TmpWell = this.GetWell(i, j, true); if (TmpWell == null) { ET[i].ListTags.Add("n.a."); continue; } MyProgressBar.progressBar.Value++; cExtendedTable TmpET = null; if (cGlobalInfo.OptionsWindow.FFAllOptions.checkBoxHTMLExportStackedHisto.Checked) TmpET = TmpWell.GetValuesList(LCDT, ListCellularPhenotypesToBeSelected, true); else TmpET = TmpWell.GetValuesList(LCDT, ListCellularPhenotypesToBeSelected, false); TmpET.Name = "[" + TmpWell.GetPos() + "] - " + TmpET[0].Count + " Objects"; // get the values associated to this well and descriptor if (cGlobalInfo.OptionsWindow.FFAllOptions.checkBoxHTMLExportStackedHisto.Checked) { cExtendedTable FinalTable = new cExtendedTable(); FinalTable.Name = "Stacked Histogram - " + this.GetName(); int Idx = 0; foreach (var item in cGlobalInfo.ListCellularPhenotypes) { FinalTable.Add(new cExtendedList()); FinalTable[Idx].Name = item.Name; FinalTable[Idx].Tag = item; for (int k = 0; k < TmpET[1].Count; k++) { if (TmpET[1][k] == Idx) FinalTable[Idx].Add(TmpET[0][k]); } Idx++; } cViewerStackedHistogram VSH = new cViewerStackedHistogram(); VSH.SetInputData(FinalTable);//TmpET); VSH.Chart.LabelAxisX = Desc.GetName(); VSH.Chart.IsLine = false; VSH.Chart.CurrentTitle.Text = TmpET.Name; if ((cGlobalInfo.OptionsWindow.radioButtonHistoDisplayManualMinMax.Checked) || (cGlobalInfo.OptionsWindow.radioButtonHistoDisplayAutomatedMinMax.Checked)) { VSH.Chart.DefaultAxisXMin = new cExtendedList(); VSH.Chart.DefaultAxisXMin.Add((double)cGlobalInfo.OptionsWindow.numericUpDownManualMin.Value); VSH.Chart.DefaultAxisXMax = new cExtendedList(); VSH.Chart.DefaultAxisXMax.Add((double)cGlobalInfo.OptionsWindow.numericUpDownManualMax.Value); if (cGlobalInfo.OptionsWindow.FFAllOptions.checkBoxHTMLExportBackColorClass.Checked) VSH.Chart.BackgroundColor = TmpWell.GetClassColor(); } VSH.Chart.BinNumber = Desc.GetBinNumber(); VSH.Chart.IsShadow = false; VSH.Chart.IsBorder = false; VSH.Run(); ET[i].ListTags.Add((Chart)VSH.Chart); } else { cViewerHistogram VH = new cViewerHistogram(); VH.SetInputData(TmpET); VH.Chart.LabelAxisX = Desc.GetName(); VH.Chart.CurrentTitle.Text = TmpET.Name; if ((cGlobalInfo.OptionsWindow.radioButtonHistoDisplayManualMinMax.Checked) || (cGlobalInfo.OptionsWindow.radioButtonHistoDisplayAutomatedMinMax.Checked)) { VH.Chart.DefaultAxisXMin = new cExtendedList(); VH.Chart.DefaultAxisXMin.Add((double)cGlobalInfo.OptionsWindow.numericUpDownManualMin.Value); VH.Chart.DefaultAxisXMax = new cExtendedList(); VH.Chart.DefaultAxisXMax.Add((double)cGlobalInfo.OptionsWindow.numericUpDownManualMax.Value); if (cGlobalInfo.OptionsWindow.FFAllOptions.checkBoxHTMLExportBackColorClass.Checked) VH.Chart.BackgroundColor = TmpWell.GetClassColor(); } VH.Run(); ET[i].ListTags.Add((Chart)VH.Chart); } } } MyProgressBar.Close(); cTableToHTML TToHTML = new cTableToHTML(); TToHTML.IsDisplayUIForFilePath = true; TToHTML.SetInputData(ET); TToHTML.Run(); }
public void CreateNewColumnFromExisting(cDescriptorType NewDescType, string DescToBeDuplicated, cGlobalInfo GlobalInfo, ref cListWells ListWell) { this.CreateNewColumn(NewDescType.GetName(), 0); // cExtendedList ListResults = null; foreach (var item in GetListTableNames()) { SQLiteCommand mycommand = new SQLiteCommand(_SQLiteConnection); //update tableName set onefield = secondfield; string SQL = "UPDATE \"" + item + "\" SET \"" + NewDescType.GetName() + "\" = \"" + DescToBeDuplicated + "\""; using (SQLiteCommand Command = new SQLiteCommand(SQL, _SQLiteConnection)) { Command.ExecuteNonQuery(); } #region Update the screening data List<cDescriptorType> LDes = new List<cDescriptorType>(); LDes.Add(NewDescType); cExtendedTable LValues = this.GetWellValues(item, LDes); cListSignature LDesc = new cListSignature(); cSignature NewSignature = new cSignature(LValues[0], NewDescType.GetBinNumber(), NewDescType, cGlobalInfo.CurrentScreening); LDesc.Add(NewSignature); string[] Positions = item.Split('x'); ListWell.GetFirstWell(int.Parse(Positions[1]), int.Parse(Positions[2])).AddSignatures(LDesc); #endregion } return; }