Skip to content
Snippets Groups Projects
Verified Commit d9a986a8 authored by Anian Bühler's avatar Anian Bühler
Browse files

added editable label for SoftwareSerial with auto-function-name

parent 3746d23d
No related branches found
No related tags found
1 merge request!1Dev preferences
...@@ -313,7 +313,23 @@ public class BlockLabel implements MouseListener, MouseMotionListener, KeyListen ...@@ -313,7 +313,23 @@ public class BlockLabel implements MouseListener, MouseMotionListener, KeyListen
} }
workspace.getEnv().getBlock(blockID).setBlockLabel(text); workspace.getEnv().getBlock(blockID).setBlockLabel(text);
}else if(workspace.getEnv().getBlock(blockID).getGenusName().toUpperCase().startsWith("CONSTANT")){ }else if(workspace.getEnv().getBlock(blockID).getGenusName().toUpperCase().startsWith("SOFT")){ //SOFT_SERIAL
if(text.contains(" ")) {
text = text.substring(0, text.indexOf(" "));
}
if(workspace.getEnv().getBlock(blockID).getGenusName().toUpperCase().contains("AVAILABLE")){
text = text + "available";
} else if(workspace.getEnv().getBlock(blockID).getGenusName().toUpperCase().contains("BEGIN")){
text = text + " begin";
} else if(workspace.getEnv().getBlock(blockID).getGenusName().toUpperCase().contains("PRINT")){
text = text + " print";
} else if(workspace.getEnv().getBlock(blockID).getGenusName().toUpperCase().contains("READ")){
text = text + " read";
}
workspace.getEnv().getBlock(blockID).setBlockLabel(text);
}
else if(workspace.getEnv().getBlock(blockID).getGenusName().toUpperCase().startsWith("CONSTANT")){
workspace.getEnv().getBlock(blockID).setBlockLabel(text.toUpperCase()); workspace.getEnv().getBlock(blockID).setBlockLabel(text.toUpperCase());
}else { }else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment