Пример #1
0
        public async Task <bool> OpSetRef()        //sjw
        {
            double[] refraw = new double[] { };
            await Task.Run(() =>
            {
                Stg.SendAndReady(Stg.GoAbs + 0.ToOffPos(Axis.X));
                Stg.SendAndReady(Stg.Go);
                refraw = GetSpectrum();
                evtSpectrum(refraw, SelectedWaves);
                Refs = PickedIdx.Select(x => refraw [x]).ToList();
                Stg.SendAndReady(Stg.GoAbs + 0.ToPos(Axis.X));
                Stg.SendAndReady(Stg.Go);
            });


            //Stopwatch stw = new Stopwatch();
            //bool flgout = false;
            //stw.Start();
            //while ( !flgout )
            //{
            //	if ( stw.ElapsedMilliseconds / 1000 > SpectrometerDelayTime )
            //		flgout = true;
            //}
            //stw.ElapsedMilliseconds.Print( "Waited Time" );
            //stw.Stop();

            //await Task.Delay( SpectrometerDelayTime );



            StringBuilder stb = new StringBuilder();

            refraw.ActLoop(x =>
            {
                stb.Append(x);
                stb.Append(Environment.NewLine);
            });

            Clipboard.SetText(stb.ToString());
            return(true);
        }