public static DataTable InitiateEmptyTable(string packageName) { DataTable dt = AccessDb.GetTable("Capacitor - " + packageName); dt.Rows.Add(new object[] { "NC_" + packageName, "N/A", "NC", "0pF", packageName, "CAP,SM," + packageName + ",NO POP/DEBUG/PLACE HOLDER", "N/A", "N/A", "CAPACITOR", @"Basic\Basic.SchLib", packageName + "_NC", @"Basic\Capacitor.PcbLib", "Ideal Simulation Data", "General", "Capacitor", "X", string.Empty, "(1:1),(2:2)", string.Empty, "Ideal" }); dt.AcceptChanges(); return(dt); }
public static DataTable InitiateEmptyTable(string packageCode) { string packageName = Packages[packageCode].packageName; DataTable dt = AccessDb.GetTable("Resistor - " + packageName); dt.Rows.Add(new object[] { "NC_" + packageName, "N/A", "NC", "1/GMIN", packageName, "RES,SM," + packageName + ",NO POP/DEBUG/PLACE HOLDER", "N/A", "N/A", "RESISTOR", @"Basic\Basic.SchLib", packageName + "_NC", @"Basic\Resistor.PcbLib", "Ideal Simulation Data", "General", "Resistor", "X", string.Empty, "(1:1),(2:2)", string.Empty, "Ideal" }); /*dt.Rows.Add(new object[] { "0R_" + Packages[packageCode].current + "A", "210-000000A-01", "0R", "0.05", packageName, * "RES,SM," + packageName + ",0.05R MAX," + Packages[packageCode].current + "A,THICK_FILM,-55~" + ((packageName == "01005") ? "+125" : "+155") + "DEG(TJ),AEC-Q200", * "KOA Speer", "RK73Z" + packageCode + "T" + Packages[packageCode].pack, * "RESISTOR", @"Basic\Basic.SchLib", packageName + ((packageName == "0201" || packageName == "0402") ? "_GREEN" : string.Empty), @"Basic\Resistor.PcbLib", * "Ideal Simulation Data", "General", "Resistor", "X", string.Empty, "(1:1),(2:2)", string.Empty, "Ideal" });*/ dt.AcceptChanges(); return(dt); }
public static void WriteToTable <T>(this IDictionary <string, HashSet <T> > list) where T : Component { foreach (KeyValuePair <string, HashSet <T> > desc in list) { HashSet <T> subSet = desc.Value; Component c = subSet.Where(c0 => c0.Variation.Id == 1).ElementAt(0); if (!Accdb_Basic.Keys.Contains(c.TableName)) { Accdb_Basic.Add(c.TableName, AccessDb.GetTable(c.TableName)); } DataTable dt = Accdb_Basic[c.TableName]; if (!dt.Rows.Contains(c.Name)) { dt.Rows.Add(c.DataRow); } } }