コード例 #1
0
          private void FindProperties()
          {
              nameProperty      = IRServoPartType.GetProperty("Name");
              highlightProperty = IRServoPartType.GetProperty("Highlight");
              UIDProperty       = IRServoPartType.GetProperty("UID");
              HostPartProperty  = IRServoPartType.GetProperty("HostPart");

              var mechanismProperty = IRServoType.GetProperty("Mechanism");

              actualServoMechanism = mechanismProperty.GetValue(actualServo, null);

              var motorProperty = IRServoType.GetProperty("Motor");

              actualServoMotor = motorProperty.GetValue(actualServo, null);

              positionProperty    = IRServoMechanismType.GetProperty("Position");
              minPositionProperty = IRServoMechanismType.GetProperty("MinPositionLimit");
              maxPositionProperty = IRServoMechanismType.GetProperty("MaxPositionLimit");

              minConfigPositionProperty = IRServoMechanismType.GetProperty("MinPosition");
              maxConfigPositionProperty = IRServoMechanismType.GetProperty("MaxPosition");

              isMovingProperty     = IRServoMechanismType.GetProperty("IsMoving");
              isFreeMovingProperty = IRServoMechanismType.GetProperty("IsFreeMoving");
              isLockedProperty     = IRServoMechanismType.GetProperty("IsLocked");

              speedProperty          = IRServoMotorType.GetProperty("SpeedLimit");
              configSpeedProperty    = IRServoMotorType.GetProperty("DefaultSpeed");
              currentSpeedProperty   = IRServoMotorType.GetProperty("CurrentSpeed");
              accelerationProperty   = IRServoMotorType.GetProperty("AccelerationLimit");
              isAxisInvertedProperty = IRServoMotorType.GetProperty("IsAxisInverted");
          }
コード例 #2
0
 private void FindMethods()
 {
     moveRightMethod      = IRServoMotorType.GetMethod("MoveRight", BindingFlags.Public | BindingFlags.Instance);
     moveLeftMethod       = IRServoMotorType.GetMethod("MoveLeft", BindingFlags.Public | BindingFlags.Instance);
     moveCenterMethod     = IRServoMotorType.GetMethod("MoveCenter", BindingFlags.Public | BindingFlags.Instance);
     moveNextPresetMethod = IRServoMotorType.GetMethod("MoveNextPreset", BindingFlags.Public | BindingFlags.Instance);
     movePrevPresetMethod = IRServoMotorType.GetMethod("MovePrevPreset", BindingFlags.Public | BindingFlags.Instance);
     stopMethod           = IRServoMotorType.GetMethod("Stop", BindingFlags.Public | BindingFlags.Instance);
     moveToMethod         = IRServoMotorType.GetMethod("MoveTo", new[] { typeof(float), typeof(float) });
 }