예제 #1
0
        private void SelectedGroupChanged(object sender, SelectionChangedEventArgs e)
        {
            PhidgetsServoBoard board = Interface as PhidgetsServoBoard;
            PhidgetsServo      servo = board.Servos[MotorListBox.SelectedIndex];

            CalibrationEditor.Calibration = servo.Calibration;

            SelectedServo = servo;
        }
예제 #2
0
        public override void Closed()
        {
            base.Closed();
            PhidgetsServoBoard board = Interface as PhidgetsServoBoard;

            if (board != null)
            {
                board.Detach();
            }
        }
예제 #3
0
        public PhidgetsServo(PhidgetsServoBoard servoBoard, int servoNumber)
        {
            _servoNum   = servoNumber;
            _servoBoard = servoBoard;

            _targetPosition          = new HeliosValue(servoBoard, new BindingValue(0d), "Servo " + _servoNum.ToString(), "target position", "Sets the raw target position of this stepper.", "", BindingValueUnits.Numeric);
            _targetPosition.Execute += TargetPosition_Execute;

            _value          = new HeliosValue(servoBoard, new BindingValue(0d), "Servo " + _servoNum.ToString(), "input value", "Sets the input value to be displayed on this stepper.", "Input value will be interpolated with the calibration data and set the target position for the stepper as appropriate.", BindingValueUnits.Numeric);
            _value.Execute += Value_Execute;

            _calibration = new CalibrationPointCollectionDouble(-6000d, 0d, 6000d, 180d);
            _calibration.CalibrationChanged += new EventHandler(_calibration_CalibrationChanged);
        }
예제 #4
0
        protected override void OnInterfaceChanged(HeliosInterface oldInterface, HeliosInterface newInterface)
        {
            PhidgetsServoBoard oldBoard = oldInterface as PhidgetsServoBoard;

            if (oldBoard != null)
            {
                oldBoard.Detach();
            }

            PhidgetsServoBoard newBoard = newInterface as PhidgetsServoBoard;

            if (newBoard != null)
            {
                newBoard.Attach();
            }

            _motorList.Clear();
            for (int i = 0; i < newBoard.ServoCount; i++)
            {
                _motorList.Add("Servo " + i);
            }
        }