Skip to content

Commit

Permalink
Add Debug console
Browse files Browse the repository at this point in the history
  • Loading branch information
drachezoil committed Sep 30, 2015
1 parent a080f62 commit f25c0e6
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 5 deletions.
6 changes: 3 additions & 3 deletions protoAppKnitic_p5/application.windows32/data/settings.json
@@ -1,6 +1,6 @@
{
"knittingType": "Single bed",
"usbDevice": "COM2",
"kniticModel": "Openknit",
"maxNeedles": "200",
"kniticModel": "Openknit"
"knittingType": "Single bed",
"usbDevice": "COM4"
}
Binary file not shown.
Binary file modified protoAppKnitic_p5/application.windows32/protoAppKnitic_p5.exe
Binary file not shown.
33 changes: 33 additions & 0 deletions protoAppKnitic_p5/buttons_actions.pde
Expand Up @@ -3,6 +3,21 @@
void addButtonsInSetup() {
controlP5 = new ControlP5(this);
controlP5.setFont(createFont("Quantico-Regular",12));
// debug things
controlP5.enableShortcuts();
myTextarea = controlP5.addTextarea("txt")
.setPosition(230, 400)
.setSize(600, 290)
.setFont(createFont("", 10))
.setLineHeight(14)
.setColor(color(200))
.setColorBackground(color(50, 55, 100))
.setColorForeground(color(255));
;
myTextarea.setVisible(false);
console = controlP5.addConsole(myTextarea);//
debugButton = controlP5.addButton("Debug", 4, 40, 600, 100, 30).setId(19);

controlP5.addButton("Open", 4, 855, 45, 70, 30).setId(3);
controlP5.addToggle("Repeating pattern mode", true, 855, 210, 20, 20).setId(4);

Expand All @@ -25,6 +40,7 @@ void addButtonsInSetup() {
machineList.update();
knittingTypeList = controlP5.addScrollableList("knittingType", 855, 550, 200, 300).setId(16);
fillListKnittingType(knittingTypeList);
// last id : 19
}

//------------------------------------------------------------------------------------
Expand Down Expand Up @@ -182,6 +198,9 @@ void controlEvent(ControlEvent theEvent) {
myPort.clear();
myPort.stop();
}
if (theEvent.controller().getId()==19) {
showHideFeaturesDebug();
}
}

if (theEvent.isAssignableFrom(Textfield.class)) {
Expand Down Expand Up @@ -364,3 +383,17 @@ void howMuchPatternToLeft(String message) {

//------------------------------------------------------------------------------------

void showHideFeaturesDebug() {
if (debugMode == false) {
myTextarea.setVisible(true);
debugButton.setLabel("Close Debug");
debugMode = true;
}
else {
myTextarea.setVisible(false);
debugButton.setLabel("Debug");
debugMode = false;
}
}

//------------------------------------------------------------------------------------
2 changes: 1 addition & 1 deletion protoAppKnitic_p5/data/settings.json
Expand Up @@ -2,5 +2,5 @@
"kniticModel": "Openknit",
"maxNeedles": "200",
"knittingType": "Single bed",
"usbDevice": "COM4"
"usbDevice": "COM3"
}
8 changes: 7 additions & 1 deletion protoAppKnitic_p5/protoAppKnitic_p5.pde
Expand Up @@ -62,6 +62,8 @@ boolean editPixels = false;
boolean endLineStarted = false;
boolean lastEndLineStarted = false;
boolean waitingMessageFromKnitting=false;
//debug mode
boolean debugMode=false;

int dataToSolenoidHex;
int bitRegister16SolenoidTemp[];
Expand All @@ -87,8 +89,12 @@ controlP5.Textfield llargM;
controlP5.Textfield collAmple;
PFont font;
Boolean createSweater;
// debug things
Textarea myTextarea;
Println console;

controlP5.Button parametricSweaterButton;
controlP5.Button debugButton;
controlP5.Button saveParametricSweaterButton;
controlP5.Button applyParametricSweaterButton;
controlP5.Button loadParametricSweaterButton;
Expand All @@ -111,7 +117,7 @@ void setup() {
// load fonts
laurentFont = loadFont("Quantico-Regular-20.vlw");
laurentFont14 = loadFont("Quantico-Regular-14.vlw");

my_brother = new m_brother();
setupSweater();
// List all the available serial ports:
Expand Down

0 comments on commit f25c0e6

Please sign in to comment.