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


Java DriverStationLCD.kLineLength方法代码示例

本文整理汇总了Java中edu.wpi.first.wpilibj.DriverStationLCD.kLineLength方法的典型用法代码示例。如果您正苦于以下问题:Java DriverStationLCD.kLineLength方法的具体用法?Java DriverStationLCD.kLineLength怎么用?Java DriverStationLCD.kLineLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.wpi.first.wpilibj.DriverStationLCD的用法示例。


在下文中一共展示了DriverStationLCD.kLineLength方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: log

import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
 * Log to Driver Station LCD.
 *
 * @param ln The line number from 1 to 6.
 * @param col The column - either 1 or 2.
 * @param text The line to send.
 */
public static void log(int ln, int col, String text) {
    Line line = lines[ln - 1];
    int pos = col == 1 ? 1 : (DriverStationLCD.kLineLength / 2);

    text = text.trim();//.substring(0, (DriverStationLCD.kLineLength / 2) - 1); // Constrain

    clearLine(ln);
    ds.println(line, pos, text);
    update();
}
 
开发者ID:OASTEM,项目名称:2014CataBot,代码行数:18,代码来源:Debug.java

示例2: clearLine

import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
public static void clearLine(int line) {
    String pad = "";

    for (int i = 0; i < DriverStationLCD.kLineLength; i++) {
        pad += " ";
    }

    ds.println(lines[line - 1], 1, pad);

    update();
}
 
开发者ID:OASTEM,项目名称:2014CataBot,代码行数:12,代码来源:Debug.java

示例3: clear

import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
public static void clear() {
    String pad = "";

    for (int i = 0; i < DriverStationLCD.kLineLength; i++) {
        pad += " ";
    }

    for (int i = 0; i < 6; i++) {
        ds.println(lines[i], 1, pad);
    }

    update();
}
 
开发者ID:OASTEM,项目名称:2014CataBot,代码行数:14,代码来源:Debug.java

示例4: shortenMessage

import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
 * Shorten the message for the LCD.
 * @param message
 * @return
 */
private static String shortenMessage(String message) {
    if (message.length() > DriverStationLCD.kLineLength) {
        return message.substring(0, DriverStationLCD.kLineLength);
    }
    else {
        return message;
    }
}
 
开发者ID:SaintsRobotics,项目名称:Treecoil-2014,代码行数:14,代码来源:DriverStationComm.java

示例5: printMessage

import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
 * Print a message to the "User messages" box in the driver station.
 * @param message the message to be printed
 * @param line the line number
 * @param startingColumn the column to start printing to
 */
public static void printMessage(String message, DriverStationLCD.Line line,
        int startingColumn) {
    if (message.length() > DriverStationLCD.kLineLength) {
        message = shortenMessage(message);
    } else {
        message = padMessage(message);
    }
    
    driverStationLCD.println(line, startingColumn, message);
    driverStationLCD.updateLCD();
}
 
开发者ID:SaintsRobotics,项目名称:FRC-2014-test,代码行数:18,代码来源:DriverStationComm.java

示例6: shortenMessage

import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
 * Shorten the message for the LCD.
 * @param message
 * @return 
 */
private static String shortenMessage(String message) {
    if(message.length() > DriverStationLCD.kLineLength)
    {
        return message.substring(0, DriverStationLCD.kLineLength);
    }
    else
    {
        return message;
    }
}
 
开发者ID:SaintsRobotics,项目名称:Woodchuck-2013,代码行数:16,代码来源:DriverStationComm.java

示例7: padMessage

import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
 * Pad the message with blanks to kLineLength characters long.
 * @param message the message to pad blanks with
 * @return the padded message
 */
private static String padMessage(String message) {
    String blanks = new String(new byte[DriverStationLCD.kLineLength -
            message.length()]);
    return message + blanks;
}
 
开发者ID:SaintsRobotics,项目名称:FRC-2014-test,代码行数:11,代码来源:DriverStationComm.java


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