Add more info about error heartbeat

This commit is contained in:
Victor Shcherb 2014-09-27 12:44:37 +03:00
parent 5e9a232a05
commit 82120c920e
2 changed files with 5 additions and 5 deletions

View file

@ -248,18 +248,18 @@ public class MapUtils {
return (rotateSin * dTileX + rotateCos * dTileY) * tileSize ; return (rotateSin * dTileX + rotateCos * dTileY) * tileSize ;
} }
public static double getLatitudeFromTile(float zoom, double y){ public static double getLatitudeFromTile(float zoom, double y) {
int sign = y < 0 ? -1 : 1; int sign = y < 0 ? -1 : 1;
return Math.atan(sign*Math.sinh(Math.PI * (1 - 2 * y / getPowZoom(zoom)))) * 180d / Math.PI; return Math.atan(sign * Math.sinh(Math.PI * (1 - 2 * y / getPowZoom(zoom)))) * 180d / Math.PI;
} }
public static int getPixelShiftX(float zoom, double long1, double long2, int tileSize){ public static int getPixelShiftX(float zoom, double long1, double long2, double tileSize){
return (int) ((getTileNumberX(zoom, long1) - getTileNumberX(zoom, long2)) * tileSize); return (int) ((getTileNumberX(zoom, long1) - getTileNumberX(zoom, long2)) * tileSize);
} }
public static int getPixelShiftY(float zoom, double lat1, double lat2, int tileSize){ public static int getPixelShiftY(float zoom, double lat1, double lat2, double tileSize){
return (int) ((getTileNumberY(zoom, lat1) - getTileNumberY(zoom, lat2)) * tileSize); return (int) ((getTileNumberY(zoom, lat1) - getTileNumberY(zoom, lat2)) * tileSize);
} }

View file

@ -165,7 +165,7 @@ public class OsMoThread {
} }
} catch (Exception e) { } catch (Exception e) {
log.info("Exception selecting socket", e); log.info("Exception selecting socket", e);
cmd("ERROR HEARTBEAT", true); cmd("ERROR HEARTBEAT" + e.getMessage(), true);
e.printStackTrace(); e.printStackTrace();
if (activeChannel != null && !activeChannel.isConnected()) { if (activeChannel != null && !activeChannel.isConnected()) {
activeChannel = null; activeChannel = null;