public JointControllerVM(Robot robot) { if (robot == null) { throw new ArgumentNullException("Robot not initialized"); } _robot = robot; Joints = new ObservableCollection<Joint>(_robot.Joints); _timer = new Timer(1000); _timer.Elapsed += RefreshEvent; _timer.AutoReset = true; _timer.Enabled = true; }
public JointAnglesVM(Robot robot) { if (robot == null) { throw new ArgumentNullException("Robot not initialized"); } _robot = robot; JointNumbers = new ObservableCollection<string>(_robot.Joints.Select(t => t.Number.ToString()).ToList()); JointAngles = new ObservableCollection<double>(_robot.Joints.Select(t => t.CurrentValue.ValueDegree).ToList()); _timer = new Timer(50); _timer.Elapsed += RefreshEvent; _timer.AutoReset = true; _timer.Enabled = true; }