예제 #1
0
        public override void Closed()
        {
            base.Closed();
            PhidgetsServoBoard board = Interface as PhidgetsServoBoard;

            if (board != null)
            {
                board.Detach();
            }
        }
예제 #2
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);
            }
        }