本文整理汇总了Java中com.qualcomm.robotcore.eventloop.opmode.OpModeManager类的典型用法代码示例。如果您正苦于以下问题:Java OpModeManager类的具体用法?Java OpModeManager怎么用?Java OpModeManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OpModeManager类属于com.qualcomm.robotcore.eventloop.opmode包,在下文中一共展示了OpModeManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: register
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
/**
* {@link #register(OpModeManager)} is called by the SDK game in order to register
* OpMode classes or instances that will participate in an FTC game.
*
* There are two mechanisms by which an OpMode may be registered.
*
* 1) The preferred method is by means of class annotations in the OpMode itself.
* See, for example the class annotations in {@link ConceptNullOp}.
*
* 2) The other, retired, method is to modify this {@link #register(OpModeManager)}
* method to include explicit calls to OpModeManager.register().
* This method of modifying this file directly is discouraged, as it
* makes updates to the SDK harder to integrate into your code.
*
* @param manager the object which contains methods for carrying out OpMode registrations
*
* @see com.qualcomm.robotcore.eventloop.opmode.TeleOp
* @see com.qualcomm.robotcore.eventloop.opmode.Autonomous
*/
public void register(OpModeManager manager) {
/**
* Register OpModes implemented in the Blocks visual programming language.
*/
BlocksOpMode.registerAll(manager);
/**
* Register OpModes that use the annotation-based registration mechanism.
*/
//AnnotatedOpModeRegistrar.register(manager);
try {
final HashMap<String, Integer> integers = DataBinder.getInstance().integers();
integers.put(DataBinder.RC_VIEW, R.id.entire_screen);
integers.put(DataBinder.CAMERA_VIEW, R.id.cameraMonitorViewId);
AnnotationFtcRegister.loadOpModes(manager); // Use the Xtensible version
} catch (Exception ex) {
AnnotatedOpModeRegistrar.register(manager); // Use the FIRST version, in case of error
}
/**
* Any manual OpMode class registrations should go here.
*/
}
示例2: register
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
/**
* The Op Mode Manager will call this method when it wants a list of all
* available op modes. Add your op mode to the list to enable it.
*
* @param manager op mode manager
*/
public void register(OpModeManager manager) {
/*
* register your op modes here.
* The first parameter is the name of the op mode
* The second parameter is the op mode class property
*
* If two or more op modes are registered with the same name, the app will display an error.
*/
manager.register("Driver Control", TeleOp6038.class);
manager.register("Autonomous Backup", AutonomousBackup.class);
manager.register("Autonomous Blue", AutonomousBlue_v3.class);
manager.register("Autonomous Red", AutonomousRed_v3.class);
manager.register("Autonomous 2", Autonomous2.class);
manager.register("Limit Switch Testing", LimitSwitchTest.class);
manager.register("Servo Testing", ServoLinear.class);
}
示例3: registerMyOpModes
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
@OpModeRegistrar
public static void registerMyOpModes(OpModeManager manager) {
// Un-comment any line to enable that sample.
// Or add your own lines to register your Team opmodes.
// Basic Templates
// manager.register("Iterative Opmode", TemplateOpMode_Iterative.class);
// manager.register("Linear Opmode", TemplateOpMode_Linear.class);
// Driving Samples
// manager.register("Teleop POV", PushbotTeleopPOV_Linear.class);
// manager.register("Teleop Tank", PushbotTeleopTank_Iterative.class);
// manager.register("Auto Drive Gyro", PushbotAutoDriveByGyro_Linear.class);
// manager.register("Auto Drive Encoder", PushbotAutoDriveByEncoder_Linear.class);
// manager.register("Auto Drive Time", PushbotAutoDriveByTime_Linear.class);
// manager.register("Auto Drive Line", PushbotAutoDriveToLine_Linear.class);
// manager.register("K9 Telop", K9botTeleopTank_Linear.class);
// Sensor Samples
// manager.register("AdaFruit Color", SensorAdafruitRGB.class);
// manager.register("HT Color", SensorHTColor.class);
// manager.register("LEGO Light", SensorLEGOLight.class);
// manager.register("LEGO Touch", SensorLEGOTouch.class);
// manager.register("MR Color", SensorMRColor.class);
// manager.register("MR Gyro", SensorMRGyro.class);
// manager.register("MR IR Seeker", SensorMRIrSeeker.class);
// manager.register("MR ODS", SensorMROpticalDistance.class);
// Concept Samples
// manager.register("Null Op", ConceptNullOp.class);
// manager.register("Compass Calibration", ConceptCompassCalibration.class);
// manager.register("DIM as Indicator", ConceptDIMAsIndicator.class);
// manager.register("I2C Address Change", ConceptI2cAddressChange.class);
// manager.register("Ramp Motor Speed", ConceptRampMotorSpeed.class);
// manager.register("Scan Servo", ConceptScanServo.class);
// manager.register("Telemetry", ConceptTelemetry.class);
// manager.register("Vuforia Navigation", ConceptVuforiaNavigation.class);
}
示例4: configure
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
public static void configure(boolean debug, @NonNull OpModeManager mgr,
@IdRes int RelativeLayout, @Nullable Object... objects) {
Bindings.setRelativeLayout(RelativeLayout);
Bindings.setOpModeManager(mgr);
boolean lastWasString = false;
String lastString = "";
if (objects != null) {
for (Object o : objects) {
if (!lastWasString) {
if (o instanceof String) {
lastString = (String) o;
} else {
if (debug) {
throw new IllegalArgumentException("Invalid mismatch of elements");
} else {
Log.i(FtcSimpleBootstrap.class.getSimpleName(),
"Invalid mismatch of elements after \"" + lastString + "\"");
}
}
}
if (lastWasString) {
Bindings.register(lastString, o);
}
lastWasString = o instanceof String;
}
}
AnnotationFtcRegister.loadOpModes(mgr);
}
示例5: register
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
/**
* The Op Mode Manager will call this method when it wants a list of all
* available op modes. Add your op mode to the list to enable it.
*
* @param manager op mode manager
*/
public void register(OpModeManager manager) {
/*
* register your op modes here.
* The first parameter is the name of the op mode
* The second parameter is the op mode class property
*
* If two or more op modes are registered with the same name, the app will display an error.
*/
FtcSimpleBootstrap.configure(manager, R.id.RelativeLayout);
}
示例6: register
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
/**
* The Op Mode Manager will call this method when it wants a list of all
* available op modes. Add your op mode to the list to enable it.
*
* @param manager op mode manager
*/
public void register(OpModeManager manager) {
/*
* register your op modes here.
* The first parameter is the name of the op mode
* The second parameter is the op mode class property
*
* If two or more op modes are registered with the same name, the app will display an error.
*/
manager.register("NullOp", NullOp.class);
manager.register("Basic Vision Sample", BasicVisionSample.class);
manager.register("Linear Vision Sample", LinearVisionSample.class);
manager.register("Manual Vision Sample", ManualVisionSample.class);
}
示例7: prepare
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
@Override
public void prepare(Context ctx, HardwareMap basicHardwareMap, Gamepad gamepad1, Gamepad gamepad2) {
checkArgument(ctx instanceof Activity, "Invalid context; it must be of an activity context type");
bindAppContext(ctx);
bindHardwareMap(checkNotNull(basicHardwareMap));
this.gamepad1 = checkNotNull(gamepad1, "Gamepad 1 is null");
this.gamepad2 = checkNotNull(gamepad2, "Gamepad 2 is null");
layout = ((Activity) appContext()).findViewById(controllerBindings().integers().get(DataBinder.RC_VIEW));
opModeManager = ((OpModeManager) controllerBindings().objects().get(DataBinder.RC_MANAGER));
}
示例8: opModeManager
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
@Override
@NotNull
public OpModeManager opModeManager() {
if (opModeManager == null) {
throw new IllegalStateException("Prepare has not been called correctly yet.");
}
return opModeManager;
}
示例9: register
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
/**
* The Op Mode Manager will call this method when it wants a list of all
* available op modes. Add your op mode to the list to enable it.
*
* @param manager op mode manager
*/
public void register(OpModeManager manager) {
//Custom op modes
manager.register("Null", NullOp.class);
//manager.register("Mecanum Prototype", MecanumPrototypeTeleop.class);
manager.register("MonkeyC Do", MonkeyCDo.class);
manager.register("MonkeyC Write", MonkeyCWrite.class);
manager.register("LoggingSample", LoggingSample.class);
manager.register("OptionsSample", OptionsSample.class);
}
示例10: register
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
public void register(OpModeManager manager) {
manager.register("FTC4991AutoTest", FTC4991AutoTest.class);
manager.register("FTC4991EncoderTest", FTC4991EncoderTest.class);
manager.register("FTC4991MainOp", FTC4991MainOp.class);
manager.register("FTC4991TankOp", FTC4991TankOp.class);
manager.register("FTCColorSensorTest", FTCColorSensorTest.class);
manager.register("FTC4991TelopSwitchSpeed", FTC4991TelopSwitchSpeed.class);
}
示例11: register
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
/**
* {@link #register(OpModeManager)} is called by the SDK game in order to register
* OpMode classes or instances that will participate in an FTC game.
*
* There are two mechanisms by which an OpMode may be registered.
*
* 1) The preferred method is by means of class annotations in the OpMode itself.
* See, for example the class annotations in {@link ConceptNullOp}.
*
* 2) The other, retired, method is to modify this {@link #register(OpModeManager)}
* method to include explicit calls to OpModeManager.register().
* This method of modifying this file directly is discouraged, as it
* makes updates to the SDK harder to integrate into your code.
*
* @param manager the object which contains methods for carrying out OpMode registrations
*
* @see com.qualcomm.robotcore.eventloop.opmode.TeleOp
* @see com.qualcomm.robotcore.eventloop.opmode.Autonomous
*/
public void register(OpModeManager manager) {
/**
* Register OpModes implemented in the Blocks visual programming language.
*/
BlocksOpMode.registerAll(manager);
/**
* Register OpModes that use the annotation-based registration mechanism.
*/
AnnotatedOpModeRegistrar.register(manager);
/**
* Any manual OpMode class registrations should go here.
*/
}
示例12: registerMyOpModes
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
@OpModeRegistrar
public static void registerMyOpModes(OpModeManager manager) {
// Un-comment any line to enable that sample.
// Or add your own lines to register your Team opmodes.
// Basic Templates
// manager.register("Iterative Opmode", TemplateOpMode_Iterative.class);
// manager.register("Linear Opmode", TemplateOpMode_Linear.class);
// Driving Samples
// manager.register("Teleop POV", PushbotTeleopPOV_Linear.class);
// manager.register("Teleop Tank", PushbotTeleopTank_Iterative.class);
// manager.register("Auto Drive Gyro", PushbotAutoDriveByGyro_Linear.class);
// manager.register("Auto Drive Encoder", PushbotAutoDriveByEncoder_Linear.class);
// manager.register("Auto Drive Time", PushbotAutoDriveByTime_Linear.class);
// manager.register("Auto Drive Line", PushbotAutoDriveToLine_Linear.class);
// manager.register("K9 Telop", K9botTeleopTank_Linear.class);
// Sensor Samples
// manager.register("AdaFruit IMU", SensorAdafruitIMU.class);
// manager.register("AdaFruit IMU Cal", SensorAdafruitIMUCalibration.class);
// manager.register("AdaFruit Color", SensorAdafruitRGB.class);
// manager.register("DIM DIO", SensorDIO.class);
// manager.register("HT Color", SensorHTColor.class);
// manager.register("LEGO Light", SensorLEGOLight.class);
// manager.register("LEGO Touch", SensorLEGOTouch.class);
// manager.register("MR Color", SensorMRColor.class);
// manager.register("MR Gyro", SensorMRGyro.class);
// manager.register("MR IR Seeker", SensorMRIrSeeker.class);
// manager.register("MR ODS", SensorMROpticalDistance.class);
// Concept Samples
// manager.register("Null Op", ConceptNullOp.class);
// manager.register("Compass Calibration", ConceptCompassCalibration.class);
// manager.register("DIM as Indicator", ConceptDIMAsIndicator.class);
// manager.register("I2C Address Change", ConceptI2cAddressChange.class);
// manager.register("Ramp Motor Speed", ConceptRampMotorSpeed.class);
// manager.register("Scan Servo", ConceptScanServo.class);
// manager.register("Telemetry", ConceptTelemetry.class);
// manager.register("Vuforia Navigation", ConceptVuforiaNavigation.class);
}
示例13: registerMyOpModes
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
@OpModeRegistrar
public static void registerMyOpModes(OpModeManager manager) {
// Un-comment any line to enable that sample.
// Or add your own lines to register your Team opmodes.
// Basic Templates
// manager.register("Iterative Opmode", BasicOpMode_Iterative.class);
// manager.register("Linear Opmode", BasicOpMode_Linear.class);
// Driving Samples
// manager.register("Teleop POV", PushbotTeleopPOV_Linear.class);
// manager.register("Teleop Tank", PushbotTeleopTank_Iterative.class);
// manager.register("Auto Drive Gyro", PushbotAutoDriveByGyro_Linear.class);
// manager.register("Auto Drive Encoder", PushbotAutoDriveByEncoder_Linear.class);
// manager.register("Auto Drive Time", PushbotAutoDriveByTime_Linear.class);
// manager.register("Auto Drive Line", PushbotAutoDriveToLine_Linear.class);
// manager.register("K9 Telop", K9botTeleopTank_Linear.class);
// Sensor Samples
// manager.register("BNO055 IMU", SensorBNO055IMU.class);
// manager.register("BNO055 IMU Cal", SensorBNO055IMUCalibration.class);
// manager.register("AdaFruit Color", SensorAdafruitRGB.class);
// manager.register("Digital Touch", SensorDigitalTouch.class);
// manager.register("DIM DIO", SensorDIO.class);
// manager.register("HT Color", SensorHTColor.class);
// manager.register("HT Gyro", SensorHTGyro.class);
// manager.register("LEGO Light", SensorLEGOLight.class);
// manager.register("LEGO Touch", SensorLEGOTouch.class);
// manager.register("MR Color", SensorMRColor.class);
// manager.register("MR Compass", SensorMRCompass.class);
// manager.register("MR Gyro", SensorMRGyro.class);
// manager.register("MR IR Seeker", SensorMRIrSeeker.class);
// manager.register("MR ODS", SensorMROpticalDistance.class);
// manager.register("MR Range Sensor", SensorMRRangeSensor.class);
// manager.register("REV Color Distance", SensorREVColorDistance.class);
// Concept Samples
// manager.register("Null Op", ConceptNullOp.class);
// manager.register("Compass Calibration", ConceptCompassCalibration.class);
// manager.register("DIM as Indicator", ConceptDIMAsIndicator.class);
// manager.register("I2C Address Change", ConceptI2cAddressChange.class);
// manager.register("Ramp Motor Speed", ConceptRampMotorSpeed.class);
// manager.register("Scan Servo", ConceptScanServo.class);
// manager.register("Telemetry", ConceptTelemetry.class);
// manager.register("Vuforia Navigation", ConceptVuforiaNavigation.class);
}
示例14: setOpModeManager
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
static void setOpModeManager(@NonNull OpModeManager opModeManager) {
cOpModeManager = opModeManager;
}
示例15: OpModeManager
import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
@NonNull
public static OpModeManager OpModeManager() {
return cOpModeManager;
}