Skip to content

Commit

Permalink
#27, #33 - Calculate distance properly. To do this requires the use of
Browse files Browse the repository at this point in the history
a square-root function, hence the addition of the MATH EE.  While
rebuilding the project to produce the Math.class file, I hit a
compilation error in UI.java, for a missing constructor, SetData( Float,
Unit ).  For now, I've added that constructor to SetData.java, but it's
not clear precisely when or how this issue was injected.

This commit also includes the following files that were not previously
in the Git index:
Debug/.gitignore
bin/library/UI$GuiConnection.class
bin/library/UI.class
bin/uidatatypes/Unit.class
bin/uiinterfaces/IActionsAndDataFromProvider.class
bin/uiinterfaces/IActionsAndDataToProvider.class
javasrc/lib/MATH.java
bin/lib/MATH.class
I created the final two to provide access to the square-root function,
so I'm confident that adding these into the Git index is correct.
However, I'm less confident about the others, as they may have been
intentionally left out, perhaps because they include path names that are
specific to a particular Eclipse installation.

This version runs fine with Verifier now.
  • Loading branch information
John Wolfe committed Jun 13, 2014
1 parent d1e6d56 commit a276296
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions applications/gps/GPS Watch/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
!bin
gen/code_generation/*
src/*
1 change: 1 addition & 0 deletions applications/gps/GPS Watch/Debug/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/src
Binary file added applications/gps/GPS Watch/bin/lib/MATH.class
Binary file not shown.
Binary file modified applications/gps/GPS Watch/bin/lib/SetData.class
Binary file not shown.
Binary file not shown.
Binary file added applications/gps/GPS Watch/bin/library/UI.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions applications/gps/GPS Watch/javasrc/lib/MATH.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package lib;

public class MATH {
public static float sqrt( float x ) {
return (float) java.lang.Math.sqrt( x );
}
}
7 changes: 7 additions & 0 deletions applications/gps/GPS Watch/javasrc/lib/SetData.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.io.DataOutputStream;
import java.util.StringTokenizer;
import uidatatypes.Unit;

public class SetData extends SignalData {
public static final long serialVersionUID = 0;
Expand All @@ -19,6 +20,12 @@ public SetData(float value, int unit) {
this.unit = unit;
}

public SetData(float value, Unit unit) {
super(SIGNAL_NO_SET_DATA);
this.value = value;
this.unit = unit.getValue();
}

@Override
public void unserialize(StringTokenizer in) {
value = Float.parseFloat(in.nextToken());
Expand Down
Binary file not shown.

0 comments on commit a276296

Please sign in to comment.