コード例 #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
ファイル: PhidgetsServo.cs プロジェクト: BlueFinBima/Helios14
        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);
            }
        }