Skip to content

Commit

Permalink
Internal and external fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tainfante committed Jan 22, 2018
1 parent 5078b07 commit 75a4722
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 41 deletions.
77 changes: 40 additions & 37 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified out/production/KCC_App/sample/Controller.class
Binary file not shown.
Binary file modified out/production/KCC_App/sample/Port.class
Binary file not shown.
5 changes: 3 additions & 2 deletions src/sample/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ public void onStartAction(ActionEvent actionEvent) {
float time = calculateTime(impulses);
log("Estimated time is: " + time + " " + units + "\n");
}
Port.getInstance().SendStop();
else{
log("Estimated time is 0 s\n");

}
}

private float calculateTime(long impulses) {
Expand Down Expand Up @@ -161,6 +163,5 @@ public void onChooseMode(ActionEvent actionEvent) {
Port.getInstance().SendComment(new Commend((byte)96,(byte)1));

}
Port.getInstance().SendStop();
}
}
6 changes: 4 additions & 2 deletions src/sample/Port.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ public long readTime() {
int numberOfBytes=0;
byte data;
while(time==0){
Stop=false;
if(Stop){
return 0;
}
while (!Stop)
{
try {
Expand Down Expand Up @@ -168,7 +170,7 @@ public void SendRead(byte b) {
}
public void SendStop(){
try {
serialPort.getOutputStream().write(0);
serialPort.getOutputStream().write(2);
} catch (IOException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit 75a4722

Please sign in to comment.