public CutterPanel() { System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)Thread.CurrentThread.CurrentCulture.Clone(); customCulture.NumberFormat.NumberDecimalSeparator = "."; Thread.CurrentThread.CurrentCulture = customCulture; SystemUtilities.PreventSleepMode(); InitializeComponent(); MessageBox.Visibility = Visibility.Hidden; _motionCommands.Add(Calibration); _motionCommands.Add(GoToZeros); _motionCommands.Add(AlignHeads); _motionCommands.Add(StartPlan); _motionCommands.Add(CuttingDeltaT); Cnc = new DriverCNC2(); Cnc.OnConnectionStatusChange += () => Dispatcher.Invoke(refreshConnectionStatus); Cnc.OnHomeCalibrated += () => Dispatcher.Invoke(enableMotionCommands); Cnc.Initialize(); CoordController = new Coord2DController(Cnc); _messageTimer.Interval = TimeSpan.FromMilliseconds(_messageShowDelay); _messageTimer.IsEnabled = false; _messageTimer.Tick += _messageTimer_Tick; _statusTimer.Interval = TimeSpan.FromMilliseconds(20); _statusTimer.Tick += _statusTimer_Tick; _statusTimer.IsEnabled = true; _autosaveTime.IsEnabled = false; _autosaveTime.Interval = TimeSpan.FromMilliseconds(1000); _autosaveTime.Tick += _autosaveTime_Tick; KeyUp += keyUp; KeyDown += keyDown; ContextMenu = createWorkspaceMenu(); resetWorkspace(true); initializeTransitionHandlers(); _factory = new ShapeFactory(this); /*/ * OpenEditor_Click(null, null); * this.Hide(); * /**/ }
public RouterPanel() { Configuration.EnableRouterMode(); System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(this); System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)Thread.CurrentThread.CurrentCulture.Clone(); customCulture.NumberFormat.NumberDecimalSeparator = "."; Thread.CurrentThread.CurrentCulture = customCulture; SystemUtilities.PreventSleepMode(); InitializeComponent(); MessageBox.Visibility = Visibility.Hidden; _motionCommands.Add(Calibration); _motionCommands.Add(GoToZerosXY); _motionCommands.Add(StartPlan); _motionCommands.Add(SetZLevel); Cnc = new DriverCNC2(); Cnc.OnConnectionStatusChange += () => Dispatcher.Invoke(refreshConnectionStatus); Cnc.OnHomeCalibrated += () => Dispatcher.Invoke(enableMotionCommands); Cnc.Initialize(); CoordController = new CoordController(Cnc); _messageTimer.Interval = TimeSpan.FromMilliseconds(_messageShowDelay); _messageTimer.IsEnabled = false; _messageTimer.Tick += _messageTimer_Tick; _statusTimer.Interval = TimeSpan.FromMilliseconds(20); _statusTimer.Tick += _statusTimer_Tick; _statusTimer.IsEnabled = true; _autosaveTime.IsEnabled = false; _autosaveTime.Interval = TimeSpan.FromMilliseconds(1000); _autosaveTime.Tick += _autosaveTime_Tick; PreviewKeyUp += previewKeyUp; PreviewKeyDown += previewKeyDown; ContextMenu = createWorkspaceMenu(); resetWorkspace(true); initializeTransitionHandlers(); _factory = new MillingShapeFactory(this); }
public static void LineSlicing() { Configuration.EnableRouterMode(); System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)Thread.CurrentThread.CurrentCulture.Clone(); customCulture.NumberFormat.NumberDecimalSeparator = "."; Thread.CurrentThread.CurrentCulture = customCulture; SystemUtilities.PreventSleepMode(); var speed1Ticks = 900; var speed2Ticks = 10000; var timeGrainTicks = 3000; var lengthMm = 100; var v = new Vector( ControllerCNC.Primitives.Speed.FromDeltaT(speed1Ticks).ToMetric(), ControllerCNC.Primitives.Speed.FromDeltaT(speed2Ticks).ToMetric() ); var timeGrain = 1.0 * timeGrainTicks / Configuration.TimerFrequency; var speed = v.Length; v = v * lengthMm; var segment = new ToolPathSegment(new Point3D(0, 0, 0), new Point3D(v.X, v.Y, 0), MotionMode.IsLinearRapid); var logger = new StepLogger("."); var slicer = new ToolPathSegmentSlicer(segment); for (var i = 0; i < 15; ++i) { var instruction = slicer.Slice(speed, timeGrain); logger.LogInstruction(instruction); } logger.Flush(); }