Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoldd98 committed Apr 22, 2021
1 parent 2373c66 commit a4cfe7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public void run() {

public double[] parsePredictionJSONForResult(String jsonResult, String type) throws JSONException {
double[] result;
System.out.println("JSONRESULT: " + jsonResult);
switch (type) {
case "reg":
JSONObject json = new JSONObject(jsonResult);
Expand All @@ -187,7 +188,6 @@ public double[] parsePredictionJSONForResult(String jsonResult, String type) thr
JSONArray legalPointsArray = legalPoints.getJSONArray("LEGAL_POINTS");
result = new double[]{legalPointsArray.getJSONArray(result2).getDouble(0),
legalPointsArray.getJSONArray(result2).getDouble(1)};
Toast.makeText(context, "CLF: " + result[0] + ", " + result[1], Toast.LENGTH_SHORT).show();
break;

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ public void onError() {
System.out.println("Failed to parse JSON prediction string. Check code under ModelPrediction.parsePredictionJSONForResult()");
}
});
// reset number of scans and collected wifi data so far back to original state
scansMade = 0;
scannedData = new ArrayList<List<Double>>();
}
}
} catch (Exception e) {
Expand Down

0 comments on commit a4cfe7a

Please sign in to comment.