From 574c2000b66831df0a5b01d59ca559814e26eaaa Mon Sep 17 00:00:00 2001 From: James Cotton Date: Thu, 10 May 2012 16:38:49 -0500 Subject: [PATCH] Lower all the debugging levels again --- .../org/openpilot/androidgcs/OPTelemetryService.java | 2 +- androidgcs/src/org/openpilot/uavtalk/Telemetry.java | 2 +- .../src/org/openpilot/uavtalk/TelemetryMonitor.java | 10 ++++++++-- androidgcs/src/org/openpilot/uavtalk/UAVTalk.java | 10 ++++------ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/androidgcs/src/org/openpilot/androidgcs/OPTelemetryService.java b/androidgcs/src/org/openpilot/androidgcs/OPTelemetryService.java index 074049d79..1a4b61eb8 100644 --- a/androidgcs/src/org/openpilot/androidgcs/OPTelemetryService.java +++ b/androidgcs/src/org/openpilot/androidgcs/OPTelemetryService.java @@ -33,7 +33,7 @@ public class OPTelemetryService extends Service { // Logging settings private final String TAG = "OPTelemetryService"; - public static int LOGLEVEL = 2; + public static int LOGLEVEL = 0; public static boolean WARN = LOGLEVEL > 1; public static boolean DEBUG = LOGLEVEL > 0; diff --git a/androidgcs/src/org/openpilot/uavtalk/Telemetry.java b/androidgcs/src/org/openpilot/uavtalk/Telemetry.java index 11e6cb2ca..1395a5c08 100644 --- a/androidgcs/src/org/openpilot/uavtalk/Telemetry.java +++ b/androidgcs/src/org/openpilot/uavtalk/Telemetry.java @@ -17,7 +17,7 @@ import android.util.Log; public class Telemetry { private final String TAG = "Telemetry"; - public static int LOGLEVEL = 2; + public static int LOGLEVEL = 0; public static boolean WARN = LOGLEVEL > 1; public static boolean DEBUG = LOGLEVEL > 0; diff --git a/androidgcs/src/org/openpilot/uavtalk/TelemetryMonitor.java b/androidgcs/src/org/openpilot/uavtalk/TelemetryMonitor.java index 903b6b29f..87a0cdc70 100644 --- a/androidgcs/src/org/openpilot/uavtalk/TelemetryMonitor.java +++ b/androidgcs/src/org/openpilot/uavtalk/TelemetryMonitor.java @@ -13,7 +13,7 @@ import android.util.Log; public class TelemetryMonitor extends Observable{ private static final String TAG = "TelemetryMonitor"; - public static int LOGLEVEL = 2; + public static int LOGLEVEL = 0; public static boolean WARN = LOGLEVEL > 1; public static boolean DEBUG = LOGLEVEL > 0; @@ -204,6 +204,8 @@ public class TelemetryMonitor extends Observable{ Telemetry.TelemetryStats telStats = tel.getStats(); tel.resetStats(); + if (DEBUG) Log.d(TAG, "processStatsUpdates() - stats reset"); + // Update stats object gcsStatsObj.getField("RxDataRate").setDouble( (float)telStats.rxBytes / ((float)currentPeriod/1000.0) ); gcsStatsObj.getField("TxDataRate").setDouble( (float)telStats.txBytes / ((float)currentPeriod/1000.0) ); @@ -214,6 +216,8 @@ public class TelemetryMonitor extends Observable{ field = gcsStatsObj.getField("TxRetries"); field.setDouble(field.getDouble() + telStats.txRetries); + if (DEBUG) Log.d(TAG, "processStatsUpdates() - stats updated"); + // Check for a connection timeout boolean connectionTimeout; if ( telStats.rxObjects > 0 ) @@ -296,8 +300,10 @@ public class TelemetryMonitor extends Observable{ objects_updated = false; setChanged(); } + + if (DEBUG) Log.d(TAG, "processStatsUpdates() - before notify"); notifyObservers(); - + if (DEBUG) Log.d(TAG, "processStatsUpdates() - after notify"); } private void setPeriod(int ms) { diff --git a/androidgcs/src/org/openpilot/uavtalk/UAVTalk.java b/androidgcs/src/org/openpilot/uavtalk/UAVTalk.java index 5a3a9a1a5..9cdd11ccb 100644 --- a/androidgcs/src/org/openpilot/uavtalk/UAVTalk.java +++ b/androidgcs/src/org/openpilot/uavtalk/UAVTalk.java @@ -12,7 +12,7 @@ import android.util.Log; public class UAVTalk extends Observable { static final String TAG = "UAVTalk"; - public static int LOGLEVEL = 2; + public static int LOGLEVEL = 0; public static boolean WARN = LOGLEVEL > 1; public static boolean DEBUG = LOGLEVEL > 0; @@ -504,8 +504,7 @@ public class UAVTalk extends Observable { case TYPE_OBJ_ACK: // All instances, not allowed for OBJ_ACK messages if (!allInstances) { - System.out.println("Received object ack: " + objId + " " + - objMngr.getObject(objId).getName()); + if (DEBUG) Log.d(TAG,"Received object ack: " + objId + " " + objMngr.getObject(objId).getName()); // Get object and update its data obj = updateObject(objId, instId, data); // Transmit ACK @@ -521,7 +520,7 @@ public class UAVTalk extends Observable { case TYPE_OBJ_REQ: // Get object, if all instances are requested get instance 0 of the // object - System.out.println("Received object request: " + objId + " " + + if (DEBUG) Log.d(TAG,"Received object request: " + objId + " " + objMngr.getObject(objId).getName()); if (allInstances) { obj = objMngr.getObject(objId); @@ -538,8 +537,7 @@ public class UAVTalk extends Observable { case TYPE_ACK: // All instances, not allowed for ACK messages if (!allInstances) { - System.out.println("Received ack: " + objId + " " + - objMngr.getObject(objId).getName()); + if (DEBUG) Log.d(TAG,"Received ack: " + objId + " " + objMngr.getObject(objId).getName()); // Get object obj = objMngr.getObject(objId, instId); // Check if an ack is pending