コード例 #1
0
        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";
            }
        }
コード例 #2
0
        private void NextButtonClick(object sender, RoutedEventArgs e)
        {
            if (Connections.Count != 0)
            {
                if (pcb.GetType() == typeof(NewEttBoard) || pcb.GetType() == typeof(OldEttBoard))
                {
                    var chanelConfigurationWindow =
                        new ChanelConfigurationWindow(Connections, this)
                    {
                        WindowStartupLocation = WindowStartupLocation.Manual,
                        Left   = Left,
                        Top    = Top,
                        Width  = ActualWidth,
                        Height = ActualHeight
                    };
                    chanelConfigurationWindow.Show();
                    Hide();
                }
                else
                {
                    if (pcb.GetType() == typeof(NewF2KBoard))
                    {
                        var outputWindow = new F2KOutputWindow(Connections, this, PCBInfo)
                        {
                            WindowStartupLocation = WindowStartupLocation.Manual,
                            Left   = Left,
                            Top    = Top,
                            Width  = ActualWidth,
                            Height = ActualHeight
                        };

                        outputWindow.Show();
                        Hide();
                    }
                }
            }
        }