コード例 #1
0
        public bool TryStart(Drawing drawing, Vector offset, MachineProfiles.IProfile machineProfile)
        {
            if (drawing == null)
            {
                return(false);
            }
            if (thread != null)
            {
                return(false);
            }

            paths = new List <Path>();
            foreach (Path path in drawing.Paths)
            {
                paths.Add(Path.Offset(path, offset));
            }
            paths = Clipper.ClipPaths(paths, new Rect(new Point(0.0, 0.0),
                                                      CornerMath.FarExtent(machineProfile.TableSize, machineProfile.Origin)));
            maxFeed = machineProfile.MaxFeedRate;

            stop   = false;
            thread = new Thread(threadStart);
            thread.Start();

            return(true);
        }
コード例 #2
0
        private void updateProfile(MachineProfiles.IProfile profile)
        {
            NotifyPropertyChanged(nameof(MachineSize));
            NotifyPropertyChanged(nameof(MachineOrigin));
            Point extent = CornerMath.FarExtent(profile.TableSize, profile.Origin);

            ViewCenter = new Point(extent.X / 2.0, extent.Y / 2.0);
        }