当前位置: 首页>>代码示例>>Java>>正文


Java OpModeManager类代码示例

本文整理汇总了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.
     */
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:RadicalRobotics2017,代码行数:44,代码来源:FtcOpModeRegister.java

示例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);
}
 
开发者ID:TinoShockwave,项目名称:Opmodes,代码行数:24,代码来源:FtcOpModeRegister.java

示例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);
}
 
开发者ID:forgod01,项目名称:5094-2016-2017,代码行数:39,代码来源:ConceptRegisterOpModes.java

示例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);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:FTC-Simple,代码行数:33,代码来源:FtcSimpleBootstrap.java

示例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);
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:FTC-Simple,代码行数:18,代码来源:FtcOpModeRegister.java

示例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);
}
 
开发者ID:FTC7729,项目名称:2016-FTC,代码行数:21,代码来源:FtcOpModeRegister.java

示例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));
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:12,代码来源:RobotContext.java

示例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;
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:TeamClutch2016,代码行数:10,代码来源:RobotContext.java

示例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);
}
 
开发者ID:lasarobotics,项目名称:FTCLibrary,代码行数:16,代码来源:FtcOpModeRegister.java

示例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);

  }
 
开发者ID:FTCTeam4991,项目名称:FTC2015-2016Game,代码行数:11,代码来源:FtcOpModeRegister.java

示例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.
     */
}
 
开发者ID:ykarim,项目名称:FTC2016,代码行数:36,代码来源:FtcOpModeRegister.java

示例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);
}
 
开发者ID:ykarim,项目名称:FTC2016,代码行数:42,代码来源:ConceptRegisterOpModes.java

示例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);
}
 
开发者ID:trc492,项目名称:Ftc2018RelicRecovery,代码行数:47,代码来源:ConceptRegisterOpModes.java

示例14: setOpModeManager

import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
static void setOpModeManager(@NonNull OpModeManager opModeManager) {
    cOpModeManager = opModeManager;
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:FTC-Simple,代码行数:4,代码来源:Bindings.java

示例15: OpModeManager

import com.qualcomm.robotcore.eventloop.opmode.OpModeManager; //导入依赖的package包/类
@NonNull
public static OpModeManager OpModeManager() {
    return cOpModeManager;
}
 
开发者ID:MHS-FIRSTrobotics,项目名称:FTC-Simple,代码行数:5,代码来源:Bindings.java


注:本文中的com.qualcomm.robotcore.eventloop.opmode.OpModeManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。