Skip to content
Browse files

add pull from craftoid

  • Loading branch information...
1 parent fe2f664 commit 07c9ca5ca239978e421991344a0b8a3b88e3b184 @mcanet committed Oct 22, 2012
Showing with 11 additions and 11 deletions.
  1. +2 −2 knitic_app/src/ofxOpenKnitting.cpp
  2. +9 −9 knitic_app/src/testApp.cpp
View
4 knitic_app/src/ofxOpenKnitting.cpp
@@ -20,7 +20,7 @@ void ofxOpenKnitting::setup(){
// default serial is first port
vector <ofSerialDeviceInfo> deviceList = serial.getDeviceList();
serialDevicePath = deviceList[0].getDevicePath();
- serial.setup(0, 9600);
+ serial.setup(0, 28800);
lastSerialData ="";
status = status_stop;
}
@@ -34,7 +34,7 @@ void ofxOpenKnitting::update(){
void ofxOpenKnitting::serialSend(){
string variables = "-s-1010101010101010-1-e-";
- serial.writeBytes((unsigned char*)&variables,variables.size());
+ serial.writeBytes((unsigned char*)variables.c_str(),variables.size());
}
void ofxOpenKnitting::serialReceive(){
View
18 knitic_app/src/testApp.cpp
@@ -18,10 +18,10 @@ void testApp::setup(){
red = 233; blue = 27; green = 52;
- float dim = 32;
float xInit = OFX_UI_GLOBAL_WIDGET_SPACING;
- float length = 320-xInit;
-
+ float length = 320;
+ float w = length - 2 * xInit;
+ float h = 32;
drawPadding = false;
@@ -30,19 +30,19 @@ void testApp::setup(){
gui_settings->addWidgetDown(new ofxUILabel("KNITTING MACHINE ACTIONS:", OFX_UI_FONT_MEDIUM));
- gui_settings->addWidgetDown(new ofxUISpacer(length-xInit, 2));
- gui_settings->addWidgetDown(new ofxUILabelButton(length-xInit, false, "Clear patterns", OFX_UI_FONT_MEDIUM));
- uploadLabelToggle = new ofxUILabelToggle(length-xInit, false, "Start Knitting", OFX_UI_FONT_MEDIUM);
+ gui_settings->addWidgetDown(new ofxUISpacer(w, 2));
+ gui_settings->addWidgetDown(new ofxUILabelButton("Clear patterns", false, w, h, OFX_UI_FONT_MEDIUM));
+ uploadLabelToggle = new ofxUILabelToggle("Start Knitting", false, w, h, OFX_UI_FONT_MEDIUM);
gui_settings->addWidgetDown(uploadLabelToggle);
gui_settings->addWidgetDown(new ofxUISpacer(length-xInit, 2));
// ofxUILabelButton(string _name, bool _value, float w = 0, float h = 0, float x = 0, float y = 0, int _size = OFX_UI_FONT_MEDIUM)
- gui_settings->addWidgetDown(new ofxUILabelButton("Refresh serial port",false,length-xInit));
+ gui_settings->addWidgetDown(new ofxUILabelButton("Refresh serial port", false, w, h));
//ofxUIRadio(string _name, vector<string> names, int _orientation, float w, float h, float x = 0, float y = 0)
- serialPortRadio = new ofxUIRadio( "Select serial port:", myKnittingMachine.getListSerialDevices(), OFX_UI_ORIENTATION_VERTICAL,dim/2, dim/2);
+ serialPortRadio = new ofxUIRadio( "Select serial port:", myKnittingMachine.getListSerialDevices(), OFX_UI_ORIENTATION_VERTICAL, h/2, h/2);
gui_settings->addWidgetDown(serialPortRadio);
gui_settings->addWidgetDown(new ofxUISpacer(length-xInit, 2));
@@ -239,6 +239,6 @@ void testApp::guiEvent(ofxUIEventArgs &e)
//--------------------------------------------------------------
void testApp::exit(){
- gui_settings->saveSettings("GUI/guiSettings_settings.xml");
+ gui_settings->saveSettings("gui/guiSettings_settings.xml");
delete gui_settings;
}

0 comments on commit 07c9ca5

Please sign in to comment.
Something went wrong with that request. Please try again.