本文整理汇总了Java中edu.wpi.first.wpilibj.DriverStationLCD.Line方法的典型用法代码示例。如果您正苦于以下问题:Java DriverStationLCD.Line方法的具体用法?Java DriverStationLCD.Line怎么用?Java DriverStationLCD.Line使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.wpi.first.wpilibj.DriverStationLCD
的用法示例。
在下文中一共展示了DriverStationLCD.Line方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: display
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
*
* @param line which line to print the message on
* @param msg the message to be sent
*/
public static void display(int line, String msg) {
DriverStationLCD.Line l;
switch (line) {
case 1:
/* kMain6 is depreciated - use kUser1 for top of the screen */
l = DriverStationLCD.Line.kUser1;
break;
case 2:
l = DriverStationLCD.Line.kUser2;
break;
case 3:
l = DriverStationLCD.Line.kUser3;
break;
case 4:
l = DriverStationLCD.Line.kUser4;
break;
case 5:
l = DriverStationLCD.Line.kUser5;
break;
case 6:
l = DriverStationLCD.Line.kUser6;
break;
default:
l = DriverStationLCD.Line.kUser2;
break;
}
DriverStationLCD.getInstance().println(l, 1, msg);
DriverStationLCD.getInstance().updateLCD();
}
示例2: printMessage
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
* Print a boolean message to the User Messages box.
* @param line
* @param startingColumn
* @param booleanMessage
*/
public static void printMessage(DriverStationLCD.Line line,
int startingColumn,
boolean booleanMessage) {
String message = (booleanMessage ? "True" : "False");
printMessage(line, startingColumn, message);
}
示例3: MessageDisplay
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
public MessageDisplay() {
driverStationLCD = DriverStationLCD.getInstance();
displayLines = new DriverStationLCD.Line[6];
displayLines[0] = DriverStationLCD.Line.kUser1;
displayLines[1] = DriverStationLCD.Line.kUser2;
displayLines[2] = DriverStationLCD.Line.kUser3;
displayLines[3] = DriverStationLCD.Line.kUser4;
displayLines[4] = DriverStationLCD.Line.kUser5;
displayLines[5] = DriverStationLCD.Line.kUser6;
}
示例4: 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();
}
示例5: println
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
public void println (int i, int startingColumn, String msg) {
DriverStationLCD.Line l;
switch(i) {
case 1: l = DriverStationLCD.Line.kUser1; break;
case 2: l = DriverStationLCD.Line.kUser2; break;
case 3: l = DriverStationLCD.Line.kUser3; break;
case 4: l = DriverStationLCD.Line.kUser4; break;
case 5: l = DriverStationLCD.Line.kUser5; break;
case 6: l = DriverStationLCD.Line.kUser6; break;
default: l = DriverStationLCD.Line.kUser1; break;
};
DriverStationLCD.getInstance().println(l, startingColumn, msg);
}
示例6: printMessage
import edu.wpi.first.wpilibj.DriverStationLCD; //导入方法依赖的package包/类
/**
* Print a message to the User Messages box.
* @param line
* @param startingColumn
* @param message
*/
public static void printMessage(DriverStationLCD.Line line, int startingColumn,
String message) {
String shortenedMessage = shortenMessage(message);
LCD.println(line, startingColumn, shortenedMessage);
LCD.updateLCD();
}