private void button1_Click(object sender, EventArgs e) { OpenFileDialog Dialog = new OpenFileDialog(); Dialog.Filter = "DB Files (*.db)| *.db"; Dialog.InitialDirectory = "C:\\Automation\\DB\\Yield"; Dialog.Multiselect = true; Dialog.ShowDialog(); if (Dialog.FileNames.Length > 0) { Csv_Interface = CSV.Open(Key); Data_Interface = Data_Edit.Open(Key); DB_Interface = DB.Open(Key); Csv_Interface.Read_Open(this.Files_path[0]); while (!Csv_Interface.StreamReader.EndOfStream) { Csv_Interface.Read(); Dic_Doc = new Dictionary <string, string>(); if (i == 0) { Iden = new string[Csv_Interface.Get_String.Length]; for (j = 0; j < Csv_Interface.Get_String.Length; j++) { Iden[j] = Csv_Interface.Get_String[j]; } } else { for (j = 0; j < Csv_Interface.Get_String.Length; j++) { Dic_Doc.Add(Iden[j], Csv_Interface.Get_String[j]); } List_Doc.Add(Dic_Doc); } i++; } } }
} ///Dist private void button1_Click(object sender, EventArgs e) { CSV_Interface = CSV.Open("YIELD"); DB_Interface.Line = Item_Y_Dist.ToArray(); if (DB_Interface.Line.Length != 0) { DB_Interface.Get_Selected_Para(Data_Interface, _dataTable); DB_Interface.Dic_Test_For_Spec_Gen = new Dictionary <string, CSV_Class.For_Box>(); foreach (Dictionary <string, CSV_Class.For_Box> test in DB_Interface.Dic_Test) { foreach (KeyValuePair <string, CSV_Class.For_Box> test2 in test) { DB_Interface.Dic_Test_For_Spec_Gen.Add(test2.Key, test2.Value); } } } DB_Interface.Line = Item_By_Dist.ToArray(); string[] By = new string[DB_Interface.Line.Length]; if (DB_Interface.Line.Length != 0) { int i = 0; DB_Interface.Get_Selected_Para(Data_Interface, _dataTable); Dic_By_Test = new Dictionary <string, CSV_Class.For_Box>(); foreach (Dictionary <string, CSV_Class.For_Box> test in DB_Interface.Dic_Test) { foreach (KeyValuePair <string, CSV_Class.For_Box> test2 in test) { Dic_By_Test.Add(test2.Key, test2.Value); By[i] = ":" + test2.Key; } } } int k = 0; Dictionary <string, CSV_Class.For_Box> Concot = new Dictionary <string, CSV_Class.For_Box>(); Concot = DB_Interface.Dic_Test_For_Spec_Gen.Concat(Dic_By_Test).ToDictionary(x => x.Key, x => x.Value); if (Concot.Count != 0) { CSV_Interface.Write_Open("C:\\temp\\dummy\\Distributions.csv"); CSV_Interface.Write(Concot); CSV_Interface.Write_Close(); Ordersequence_Method(); JMP_Draw("C:\\temp\\dummy\\Distributions.csv", DB_Interface.Dic_Test_For_Spec_Gen, null, Dic_By_Test, OrderbySequence, "Seleted_Distributions", null, By); DB_Interface.Dic_Test = new Dictionary <string, CSV_Class.For_Box> [Data_Interface.DB_Count]; } } ///Dist
private void button1_Click(object sender, EventArgs e) { CSV.Open("YIELD"); Csv_Interface = CSV.Open("YIELD"); string Filename = Path.Substring(Path.LastIndexOf("\\") + 1); int Length = Filename.Length; Filename = Path.Substring(0, Path.Length - Length); Filename += "Result_" + System.DateTime.Now.ToString("yyyyMMddhhmmss") + ".csv"; // Filename = "C:\\1.csv"; Csv_Interface.Write_Open(Filename); string dummy = ""; for (int i = 0; i < this.Length.Length + 1; i++) { if (i == 0) { dummy += "No,,"; } else if (i == this.Length.Length) { dummy += this.Length[i - 1]; } else { dummy += this.Length[i - 1] + ","; } } Csv_Interface.Write(dummy); for (int k = 0; k < Test_Result[0].Count + 4; k++) { dummy = ""; for (int i = 0; i < this.Length.Length + 2; i++) { if (i == this.Length.Length + 2) { dummy += dataGridView1.Rows[k].Cells[i].Value.ToString(); } else { dummy += dataGridView1.Rows[k].Cells[i].Value.ToString() + ","; } } Csv_Interface.Write(dummy); } Csv_Interface.Write_Close(); }
} ///Fit private void button2_Click(object sender, EventArgs e) { CSV_Interface = CSV.Open("YIELD"); DB_Interface.Line = Item_Y_Fit.ToArray(); DB_Interface.Dic_Test_For_Spec_Gen = new Dictionary <string, CSV_Class.For_Box>(); if (DB_Interface.Line.Length != 0) { DB_Interface.Get_Selected_Para(Data_Interface, _dataTable_Fit); foreach (Dictionary <string, CSV_Class.For_Box> test in DB_Interface.Dic_Test) { foreach (KeyValuePair <string, CSV_Class.For_Box> test2 in test) { DB_Interface.Dic_Test_For_Spec_Gen.Add(test2.Key, test2.Value); } } } DB_Interface.Line = Item_X_Fit.ToArray(); Dic_X_Test = new Dictionary <string, CSV_Class.For_Box>(); string[] X = new string[DB_Interface.Line.Length]; if (DB_Interface.Line.Length != 0) { int i = 0; DB_Interface.Get_Selected_Para(Data_Interface, _dataTable_Fit); foreach (Dictionary <string, CSV_Class.For_Box> test in DB_Interface.Dic_Test) { foreach (KeyValuePair <string, CSV_Class.For_Box> test2 in test) { Dic_X_Test.Add(test2.Key, test2.Value); X[i] = ":" + test2.Key; i++; } } } DB_Interface.Line = Item_By_Fit.ToArray(); string[] By = new string[DB_Interface.Line.Length]; Dic_By_Test = new Dictionary <string, CSV_Class.For_Box>(); if (DB_Interface.Line.Length != 0) { int i = 0; DB_Interface.Get_Selected_Para(Data_Interface, _dataTable_Fit); foreach (Dictionary <string, CSV_Class.For_Box> test in DB_Interface.Dic_Test) { foreach (KeyValuePair <string, CSV_Class.For_Box> test2 in test) { Dic_By_Test.Add(test2.Key, test2.Value); By[i] = ":" + test2.Key; i++; } } } int k = 0; if (DB_Interface.Dic_Test_For_Spec_Gen.Count != 0) { if (Dic_X_Test.Count != 0 || Dic_By_Test.Count != 0) { Dictionary <string, CSV_Class.For_Box> Concot = new Dictionary <string, CSV_Class.For_Box>(); Concot = DB_Interface.Dic_Test_For_Spec_Gen.Concat(Dic_X_Test).ToDictionary(x => x.Key, x => x.Value); Concot = Concot.Concat(Dic_By_Test).ToDictionary(x => x.Key, x => x.Value); if (Concot.Count != 0) { CSV_Interface.Write_Open("C:\\temp\\dummy\\Fit_Y_By_X.csv"); CSV_Interface.Write(Concot); CSV_Interface.Write_Close(); Ordersequence_Method(); JMP_Draw("C:\\temp\\dummy\\Fit_Y_By_X.csv", DB_Interface.Dic_Test_For_Spec_Gen, Dic_X_Test, Dic_By_Test, OrderbySequence, "Seleted_Fit_Y_By_X", X, By); DB_Interface.Dic_Test = new Dictionary <string, CSV_Class.For_Box> [Data_Interface.DB_Count]; } } else { MessageBox.Show("Please Check 'X' or 'By' Factor"); } } } ///Fit