Esempio n. 1
0
        private void CalcApertures()
        {
            CalcAperturesSkyBkgndBrightness = SkyBkgndBrightness;
            var view = new GenLib.Progress.Manual.View();

            new Thread(() => view.ShowDialog())
            {
                Name = "CalcApertures"
            }.Start();
            view.SetParms("Calculate Progress", "Calculating minimum apertures and best exit pupils to detect objects");
            var progState = new ProgressState
            {
                Total    = GridViewObjects.DataSource.CastSafe <List <DisplayRecord> >().Count,
                Current  = 0,
                Interval = 100,
            };

            GridViewObjects.DataSource.CastSafe <List <DisplayRecord> >()
            .ForEach(displayRecord =>
            {
                CalcAnAperture(displayRecord);
                progState.IncrementAndReport(view.UpdateProgress);
            });
            view.InvokeExt(v => v.Close());
            GridViewObjects.RefreshData();
        }
Esempio n. 2
0
 private static void Finished(GenLib.Progress.Manual.View view)
 {
     new Timer(_ =>
     {
         view.UpdateProgress("finished", 100);
         Close(view);
     }, null, StepMilliSec, 0);
 }
Esempio n. 3
0
 private static void OneTwoThree(GenLib.Progress.Manual.View view)
 {
     new Timer(_ =>
     {
         view.UpdateProgress("123 123", 67);
         Finished(view);
     }, null, StepMilliSec, 0);
 }
Esempio n. 4
0
 private static void TestingTesting(GenLib.Progress.Manual.View view)
 {
     new Timer(_ =>
     {
         view.UpdateProgress("testing testing", 33);
         OneTwoThree(view);
     }, null, StepMilliSec, 0);
 }
Esempio n. 5
0
        public void Run()
        {
            var view = new GenLib.Progress.Manual.View();

            view.SetParms("Progress Test", "Testing progress framework with manual calls");
            view.GetVisibleChanged().Subscribe(_ => ReadyToBegin(view));

            var viewThread = new Thread(() => view.ShowDialog())
            {
                Name = "ViaManual"
            };

            viewThread.Start();
            viewThread.Join();

            Assert.True(true);
        }
Esempio n. 6
0
 private static void ReadyToBegin(GenLib.Progress.Manual.View view)
 {
     view.UpdateProgress("ready to begin", 0);
     TestingTesting(view);
 }