Beispiel #1
0
        private async void EditPnPJob_Click(object sender, RoutedEventArgs e)
        {
            if (_pnpJob != null)
            {
                var pnpViewModel = new PnPJobViewModel(ViewModel.Machine, _pnpJob);
                pnpViewModel.FileName = _pnpJobFileName;
                await pnpViewModel.InitAsync();

                var jobWindow = new Views.PNPJobWindow();
                jobWindow.DataContext = pnpViewModel;
                //jobWindow.Owner = this;
                jobWindow.Show();
            }
            else
            {
                MessageBox.Show("Please open a PnP Job First");
            }
        }
Beispiel #2
0
        private async Task OpenPnPJobAsync(string fileName)
        {
            _pnpJobFileName = fileName;
            ViewModel.AddPnPJobFile(fileName);
            _pnpJob = await Core.PlatformSupport.Services.Storage.GetAsync <PnPJob>(fileName);

            await _pnpJob.OpenAsync();

            var pnpViewModel = new PnPJobViewModel(ViewModel.Machine, _pnpJob);

            pnpViewModel.FileName = fileName;
            await pnpViewModel.InitAsync();

            var jobWindow = new Views.PNPJobWindow();

            jobWindow.DataContext = pnpViewModel;
            jobWindow.Show();
            EditPnPJob.IsEnabled           = true;
            ClosePnPJob.IsEnabled          = true;
            FeederAlignementView.IsEnabled = true;
        }
Beispiel #3
0
        private async void NewPnPJob_Click(object sender, RoutedEventArgs e)
        {
            if (ViewModel.Machine.PCBManager.HasProject)
            {
                if (ViewModel.Machine.PCBManager.HasBoard)
                {
                    var pnpJob = new PnPJob();
                    pnpJob.Board            = ViewModel.Machine.PCBManager.Board;
                    pnpJob.EagleBRDFilePath = ViewModel.Machine.PCBManager.Project.EagleBRDFilePath;
                    var pnpViewModel = new PnPJobViewModel(ViewModel.Machine, pnpJob);
                    await pnpViewModel.InitAsync();

                    var jobWindow = new Views.PNPJobWindow();
                    jobWindow.DataContext = pnpViewModel;
                    jobWindow.Owner       = this;
                    jobWindow.ShowDialog();
                    EditPnPJob.IsEnabled           = true;
                    FeederAlignementView.IsEnabled = true;
                    if (String.IsNullOrEmpty(pnpViewModel.FileName))
                    {
                        _pnpJob                        = pnpJob;
                        _pnpJobFileName                = pnpViewModel.FileName;
                        EditPnPJob.IsEnabled           = true;
                        ClosePnPJob.IsEnabled          = true;
                        FeederAlignementView.IsEnabled = true;
                    }
                }
                else
                {
                    MessageBox.Show("Please make sure your PCB Project includes a PCB.");
                }
            }
            else
            {
                MessageBox.Show("Please open or create a PCB Project First.");
            }
        }