Пример #1
0
        public async Task PrepareStringsAsyncTest()
        {
            var validFilePath = @".\TestFiles\valid.nc";
            var preparer      = new GCodePreparer();
            await preparer.OpenFileAsync(validFilePath, new Progress <float>());

            try
            {
                await preparer.PrepareStringsAsync();
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
            Assert.Pass();
        }
Пример #2
0
        public virtual async Task LoadProgramAsync(string path, IProgress <float> progressChanger)
        {
            progressChanger.Report(0);
            Program.Clear();
            progressChanger.Report(1);
            GCodePreparer preparer = new GCodePreparer();
            await preparer.OpenFileAsync(path, progressChanger);

            progressChanger.Report(5);
            await preparer.PrepareStringsAsync();

            progressChanger.Report(10);

            await InterpretProgram(preparer, progressChanger);

            if (Program.Count == 0)
            {
                return;
            }
            FrameNumber  = 0;
            CurrentFrame = Program[FrameNumber];
            InitFrame();
            progressChanger.Report(100);
        }