mirror of
https://github.com/euphy/polargraphcontroller
synced 2025-01-09 03:34:25 +01:00
Got the console working again.
This commit is contained in:
parent
1179fd7471
commit
74636289e5
@ -183,6 +183,18 @@ void updateNumberboxValues()
|
|||||||
initialiseNumberboxValues(getAllControls());
|
initialiseNumberboxValues(getAllControls());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void initConsoleWindow() {
|
||||||
|
consoleArea = cp5.addTextarea("txt")
|
||||||
|
.setPosition(300, 100)
|
||||||
|
.setSize(400, 600)
|
||||||
|
.setFont(createFont("", 12))
|
||||||
|
.setLineHeight(14)
|
||||||
|
.setColor(color(255))
|
||||||
|
.setColorBackground(color(0, 200))
|
||||||
|
.setColorForeground(color(255, 100))
|
||||||
|
.setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
Set<String> buildControlsToLockIfBoxNotSpecified()
|
Set<String> buildControlsToLockIfBoxNotSpecified()
|
||||||
{
|
{
|
||||||
Set<String> result = new HashSet<String>();
|
Set<String> result = new HashSet<String>();
|
||||||
@ -220,6 +232,8 @@ Set<String> buildControlsToLockIfImageNotLoaded()
|
|||||||
|
|
||||||
Map<String, Controller> buildAllControls()
|
Map<String, Controller> buildAllControls()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
initConsoleWindow();
|
||||||
|
|
||||||
Map<String, Controller> map = new HashMap<String, Controller>();
|
Map<String, Controller> map = new HashMap<String, Controller>();
|
||||||
|
|
||||||
|
@ -422,6 +422,9 @@ public Integer windowHeight = 400;
|
|||||||
|
|
||||||
public static Integer serialPortNumber = -1;
|
public static Integer serialPortNumber = -1;
|
||||||
|
|
||||||
|
public Textarea consoleArea = null;
|
||||||
|
public Println console = null;
|
||||||
|
public PrintStream savedOut = null;
|
||||||
|
|
||||||
Properties props = null;
|
Properties props = null;
|
||||||
public static String propertiesFilename = "default.properties.txt";
|
public static String propertiesFilename = "default.properties.txt";
|
||||||
@ -485,9 +488,6 @@ public static final int VECTOR_FILTER_LOW_PASS = 0;
|
|||||||
|
|
||||||
String storeFilename = "comm.txt";
|
String storeFilename = "comm.txt";
|
||||||
boolean overwriteExistingStoreFile = true;
|
boolean overwriteExistingStoreFile = true;
|
||||||
//private static Logger logger;
|
|
||||||
public static Console console;
|
|
||||||
public boolean useWindowedConsole = false;
|
|
||||||
|
|
||||||
static boolean drawingTraceShape = true;
|
static boolean drawingTraceShape = true;
|
||||||
static boolean retraceShape = true;
|
static boolean retraceShape = true;
|
||||||
@ -1684,12 +1684,7 @@ void keyPressed()
|
|||||||
}
|
}
|
||||||
else if (checkKey(CONTROL) && checkKey(KeyEvent.VK_C))
|
else if (checkKey(CONTROL) && checkKey(KeyEvent.VK_C))
|
||||||
{
|
{
|
||||||
if (isUseWindowedConsole())
|
toggleShowConsole();
|
||||||
setUseWindowedConsole(false);
|
|
||||||
else
|
|
||||||
setUseWindowedConsole(true);
|
|
||||||
|
|
||||||
initLogging();
|
|
||||||
}
|
}
|
||||||
else if (checkKey(CONTROL) && checkKey(KeyEvent.VK_S))
|
else if (checkKey(CONTROL) && checkKey(KeyEvent.VK_S))
|
||||||
{
|
{
|
||||||
@ -1897,7 +1892,7 @@ void mouseWheel(int delta)
|
|||||||
|
|
||||||
void setChromaKey(PVector p)
|
void setChromaKey(PVector p)
|
||||||
{
|
{
|
||||||
color col = getDisplayMachine().getPixelAtScreenCoords(p);
|
color col = getDisplayMachine().getPixelAtScreenCoords(p);
|
||||||
chromaKeyColour = col;
|
chromaKeyColour = col;
|
||||||
if (getDisplayMachine().pixelsCanBeExtracted() && isBoxSpecified())
|
if (getDisplayMachine().pixelsCanBeExtracted() && isBoxSpecified())
|
||||||
{
|
{
|
||||||
@ -1919,6 +1914,26 @@ boolean isPreviewable(String command)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean toggleShowConsole() {
|
||||||
|
if (console == null) {
|
||||||
|
savedOut = System.out;
|
||||||
|
console = cp5.addConsole(consoleArea);
|
||||||
|
consoleArea.setVisible(true);
|
||||||
|
console.play();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.pause();
|
||||||
|
consoleArea.setVisible(false);
|
||||||
|
cp5.remove(console);
|
||||||
|
console = null;
|
||||||
|
System.setOut(savedOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
println("Ow");
|
||||||
|
|
||||||
|
return console == null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This will comb the command queue and attempt to draw a picture of what it contains.
|
This will comb the command queue and attempt to draw a picture of what it contains.
|
||||||
Coordinates here are in pixels.
|
Coordinates here are in pixels.
|
||||||
@ -3252,16 +3267,6 @@ Integer getBaudRate()
|
|||||||
return baudRate;
|
return baudRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isUseWindowedConsole()
|
|
||||||
{
|
|
||||||
return this.useWindowedConsole;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setUseWindowedConsole(boolean use)
|
|
||||||
{
|
|
||||||
this.useWindowedConsole = use;
|
|
||||||
}
|
|
||||||
|
|
||||||
void initLogging()
|
void initLogging()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
Loading…
x
Reference in New Issue
Block a user