Skip to content

Commit

Permalink
- updated android-wheelphone-library to rev31
Browse files Browse the repository at this point in the history
- clear "calibData.csv" file before writing new calibration data to it
  • Loading branch information
stefano@gctronic.com committed Jan 14, 2014
1 parent 9e13a4b commit 00cac50
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 14 deletions.
Binary file not shown.
Binary file modified android-applications/WheelphoneCalibration/bin/classes.dex
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 0 additions & 3 deletions android-applications/WheelphoneCalibration/bin/jarlist.cache

This file was deleted.

Binary file modified android-applications/WheelphoneCalibration/bin/resources.ap_
Binary file not shown.
Binary file not shown.
Expand Up @@ -125,7 +125,6 @@ protected void onCreate(Bundle savedInstanceState) {
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);

wheelphone = new WheelphoneRobot(getApplicationContext(), getIntent());
wheelphone.setUSBCommunicationTimeout(5000);

msgbox("calibration", "Place the robot with the right wheel next to the black line and press the calibrate button. Wait until the process is terminated.");

Expand All @@ -134,13 +133,12 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onStart() {
super.onStart();
wheelphone.startUSBCommunication();
}

@Override
public void onResume() {
super.onResume();
wheelphone.resumeUSBCommunication();
wheelphone.startUSBCommunication();
wheelphone.setWheelPhoneRobotListener(this);
}

Expand All @@ -153,7 +151,7 @@ public void onStop() {
@Override
public void onPause() {
super.onPause();
wheelphone.pauseUSBCommunication();
wheelphone.closeUSBCommunication();
wheelphone.setWheelPhoneRobotListener(null);
}

Expand All @@ -179,7 +177,7 @@ public void onWheelphoneUpdate() {
}
}

if(wheelphone.isUSBConnected()) {
if(wheelphone.isRobotConnected()) {
txtConnected.setText("Connected");
txtConnected.setTextColor(getResources().getColor(R.color.green));
} else {
Expand Down Expand Up @@ -273,12 +271,22 @@ public void writeCalibrationDataToFile() {
int i = 0;

File logFile = new File("sdcard/calibData.csv");
try {
logFile.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (!logFile.exists()) {
try {
logFile.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
logFile.delete();
try {
logFile.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

try {
//BufferedWriter for performance, true to set append to file flag
Expand Down

0 comments on commit 00cac50

Please sign in to comment.