public Coord2DController(DriverCNC cnc) { _cnc = cnc; _movementWorker = new Thread(worker); _movementWorker.Start(); _movementWorker.IsBackground = true; }
internal SpeedController(DriverCNC cnc) { _cnc = cnc; _desiredDeltaT = Constants.StartDeltaT; _currentDeltaT = _desiredDeltaT; _speedWorker = new Thread(worker); _speedWorker.IsBackground = true; _stop = true; SetRPM(400); _speedWorker.Start(); }
public CutterPanel() { System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)Thread.CurrentThread.CurrentCulture.Clone(); customCulture.NumberFormat.NumberDecimalSeparator = "."; Thread.CurrentThread.CurrentCulture = customCulture; InitializeComponent(); MessageBox.Visibility = Visibility.Hidden; _motionCommands.Add(Calibration); _motionCommands.Add(GoToZeros); _motionCommands.Add(AlignHeads); _motionCommands.Add(StartPlan); _motionCommands.Add(CuttingDeltaT); Cnc = new DriverCNC(); Cnc.OnConnectionStatusChange += () => Dispatcher.Invoke(refreshConnectionStatus); Cnc.OnHomingEnded += () => 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 TestPanel() { InitializeComponent(); Output.ScrollToEnd(); _cnc = new DriverCNC(); _cnc.OnDataReceived += _driver_OnDataReceived; _cnc.Initialize(); _positionController = new PositionController(_cnc); _speedController = new SpeedController(_cnc); _coord2DController = new Coord2DController(_cnc); _positionTimer.Interval = new TimeSpan(1 * 10 * 1000); _positionTimer.Tick += _positionTimer_Tick; _positionTimer.IsEnabled = false; _statusTimer.Interval = new TimeSpan(100 * 10 * 1000); _statusTimer.Tick += _statusTimer_Tick; _statusTimer.IsEnabled = true; }
public PositionController(DriverCNC driver) { _cnc = driver; }