public NewEttBoard(AltiumParser.AltiumParser parser) { Board = parser; DutCount = GetDutNumber(); ActiveChanels = new List <Chanel>(); GetActiveChanels(); Connections = new List <ConnectionUnion>(); Connections = GetConnections(); }
public ChanelSelectWindow(string path, Window startupWindow) { _codeclosing = false; _startupWindow = startupWindow; Connections = new List <ConnectionUnion>(); InitializeComponent(); Title = ApplicationSettings.Name; MyWindow.SizeChanged += MyWindowOnSizeChanged; var parser = new AltiumParser.AltiumParser(path); var type = GetPsbType(parser); switch (type) { case PcbTypes.EttNew: pcb = new NewEttBoard(parser); Connections = pcb.Connections; break; case PcbTypes.EttOld: pcb = new OldEttBoard(parser); Connections = pcb.Connections; break; case PcbTypes.F2kNew: pcb = new NewF2KBoard(parser); Connections = pcb.Connections; break; } foreach (var connection in Connections) { Console.WriteLine(connection); } ConnectionList.ItemsSource = Connections; ConnectionList.SelectionChanged += ConnectionListOnSelectionChanged; var counter = 0; foreach (var connection in Connections) { counter += connection.Chanels.Count; } PCBInfo = "Плата " + Path.GetFileName(parser.FilePath)?.Replace(".SchDoc", "") + " || " + counter + " Каналов"; Report.Text = PCBInfo; if (pcb.GetType() == typeof(NewEttBoard) || pcb.GetType() == typeof(OldEttBoard)) { var temppcb = (EttPCB)pcb; Report.Text += " || " + temppcb.DutCount + " DUTs"; } }
public NewF2KBoard(AltiumParser.AltiumParser parser) { Board = parser; ActiveChanels = new List <Chanel>(); FreeChanels = new List <ConnectionUnion>(); BlackBoxes = new List <BlackBox>(); GetActiveChanels(); DUT = DeterminateDut(); GetBlackBoxes(); Connections = new List <ConnectionUnion>(); Connections = GetConnections(); }
private static PcbTypes GetPsbType(AltiumParser.AltiumParser board) { if (board.BuildOfMaterials.Exists(x => x.DeviceType.Contains(NewettSmall)) && board.BuildOfMaterials.Exists(x => x.DeviceType.Contains(NewettBig))) { return(PcbTypes.EttNew); } if (board.BuildOfMaterials.Exists(x => x.DeviceType.Contains(OldettSmall)) && board.BuildOfMaterials.Exists(x => x.DeviceType.Contains(OldettBig))) { return(PcbTypes.EttOld); } if (board.BuildOfMaterials.Exists(x => x.DeviceType.Contains(NewF2k)) || board.BuildOfMaterials.Exists(x => x.DeviceType.Contains(NewF2k2))) { return(PcbTypes.F2kNew); } return(PcbTypes.Unknown); }