Пример #1
0
        private async Task StartCZT()
        {
            await Task.Run(() =>
            {
                CZTMessage   = "Starting CZT";
                IsCZTRunning = true;
                SRE3021API.StartAcqusition();
                System.Windows.Application.Current.Dispatcher.Invoke(
                    DispatcherPriority.ApplicationIdle,
                    new Action(() => {
                    StopCZTCommmand.RaiseCanExecuteChanged();
                    StartCZTCommmand.RaiseCanExecuteChanged();
                }));

                CZTSpectrumEnergy = new SpectrumEnergy(5, 1500);

                CZTMessage = "CZT is Started";
                while (IsCZTRunning)
                {
                    for (int i = 0; i < 1000; ++i)
                    {
                        Thread.Sleep(1);
                        DataCount = DataCountStatic;
                    }
                    CZTSpectrum = new ObservableCollection <HistoEnergy>(CZTSpectrumEnergy.HistoEnergies);
                }
            });
        }
Пример #2
0
        private async Task InitiateCZTAsync()
        {
            try
            {
                SRE3021API.OpenUDPPort();
                SRE3021API.OpenTCPPort();
                SRE3021API.CheckAPI();
            }
            catch
            {
                return;
            }
            if (IsCZTInitiate == true)
            {
                return;
            }
            IsCZTInitiate = true;
            SRE3021API.IMGDataEventRecieved += ProcessImgData;

            await Task.Run(() =>
            {
                SRE3021API.CheckBaseline();
                for (int i = 0; i < 11; ++i)
                {
                    for (int j = 0; j < 11; ++j)
                    {
                        Console.WriteLine($"X: {i}, Y: {j}, Baseline {SRE3021API.AnodeValueBaseline[i, j]} // TimingBaseline{SRE3021API.AnodeTimingBaseline[i, j]}");
                    }
                }
            });
        }
Пример #3
0
 private async Task SetHV()
 {
     await Task.Run(() =>
     {
         SRE3021API.SetHighVoltage(hvValue, 10, 100);
     });
 }
Пример #4
0
        private async Task CloseMainWindow()
        {
            await StopRealsensePipeline().ConfigureAwait(false);
            await StopSLAM().ConfigureAwait(false);

            FPGAControl.SetVaribles(FPGAVariable);
            await FPGAControl.Dispose().ConfigureAwait(false);

            SRE3021API.Close();
            // rsControl.Dispose();
        }
Пример #5
0
        private async Task StopCZT()
        {
            await Task.Run(() =>
            {
                IsCZTRunning = false;
                SRE3021API.StopAcqusition();
            });

            CZTMessage = "CZT is stop";
            System.Windows.Application.Current.Dispatcher.Invoke(
                DispatcherPriority.ApplicationIdle,
                new Action(() => {
                StartCZTCommmand.RaiseCanExecuteChanged();
                StopCZTCommmand.RaiseCanExecuteChanged();
            }));
        }