Je kunt nu tekst naar het matrix scherm dumpen doormiddel van writePageToMatrix(regel1, regel2, regel3)

This commit is contained in:
jancoow
2014-10-08 23:15:03 +02:00
parent 4b3c2ed875
commit 8220696da6
Executable → Regular
+14 -14
View File
@@ -67,36 +67,38 @@ public class GUIboard {
} }
public static boolean writePageToMatrix(String name, double median, int page) public static boolean writePageToMatrix(String regel1, String regel2, String regel3)
{ {
clearBottom(); clearBottom();
if(regel1.length() > 20 && regel2.length() > 20 && regel3.length() > 11) //check if the length is not to long
char[] charArray = name.toCharArray();
String num = "Avg: " + median;
char[] numArray = num.toCharArray();
String nav = page + "/" + page + " < > S";
char[] navArray = nav.toCharArray();
if(charArray.length > 20)
{ {
return false; return false;
} }
String nav = "< > S"; //creates the navigation and will center it out to the right
for(int i=0; i < (12-regel3.length()); i++){
nav = " " + nav;
}
char[] regel1CharArray = regel1.toCharArray();
char[] regel2CharArray = regel2.toCharArray();
char[] regel3CharArray = (regel3 + nav).toCharArray();
for(char ch : charArray) for(char ch : regel1CharArray)
{ {
IO.writeShort(0x40, ch); IO.writeShort(0x40, ch);
} }
IO.writeShort(0x40, '\n'); IO.writeShort(0x40, '\n');
for(char ch : numArray) for(char ch : regel2CharArray)
{ {
IO.writeShort(0x40, ch); IO.writeShort(0x40, ch);
} }
IO.writeShort(0x40, '\n'); IO.writeShort(0x40, '\n');
for(char ch : navArray) for(char ch : regel3CharArray)
{ {
IO.writeShort(0x40, ch); IO.writeShort(0x40, ch);
} }
@@ -119,8 +121,6 @@ public class GUIboard {
} }
} }
//Private functions //Private functions
private static void createAxis(int x, int y) private static void createAxis(int x, int y)
{ {