本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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;
}
}
示例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();
}
示例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;
}
}
示例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;
}