org.tizen.injector.location.core_1.0.0.201310291329

16:50:04.694 INFO  jd.cli.Main - Decompiling org.tizen.injector.location.core_1.0.0.201310291329.jar
package org.tizen.injector.location.core.injector;

import java.io.PrintStream;

public class DebugLog
{
  public static void log(Object paramObject)
  {
    System.out.println(paramObject);
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.injector.DebugLog
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.injector;

import java.io.IOException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
import org.tizen.injector.location.core.model.GeoLocationVO;
import org.tizen.injector.location.core.protocol.GeoLocation;
import org.tizen.injector.model.ITableVO;
import org.tizen.injector.socket.TelephonySocket;
import org.tizen.injector.view.InjectorView;
import org.tizen.sdblib.service.FileEntry;

public class LocationInjector
  implements ConnectionPlugin.ISelectionListener
{
  private IProgressMonitor monitor;
  private final String logFileName = "nmea_replay.log";
  private final String remoteFilePath = "/opt/media/gps-manager/replay/nmea_replay.log";
  private final String SETSTOPMODE = "0";
  private final String SETLOGMODE = "1";
  private final String SETMANUALMODE = "2";
  private boolean isChange = false;
  private GeoLocation location = null;
  private TelephonySocket injectorSocket = TelephonySocket.getInstance();
  
  public LocationInjector()
  {
    InjectorView.getDefault().addSelectionListener(this);
  }
  
  private void setStopMode()
    throws IOException
  {
    try
    {
      injectorSocket.sendLocation("0");
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
      throw localIOException;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  private void setLogMode()
    throws IOException
  {
    try
    {
      injectorSocket.sendLocation("1,nmea_replay.log");
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
      throw localIOException;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  private void setManualMode()
    throws IOException
  {
    try
    {
      injectorSocket.sendLocation("2");
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
      throw localIOException;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }
  
  private boolean injectLocation(double paramDouble1, double paramDouble2)
    throws IOException
  {
    String str = "2," + paramDouble1 + "," + paramDouble2;
    try
    {
      injectorSocket.sendLocation(str);
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
      throw localIOException;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
      return false;
    }
    return true;
  }
  
  /* Error */
  public boolean inject(java.io.File paramFile, IProgressMonitor paramIProgressMonitor)
    throws IOException
  {
    // Byte code:
    //   0: aload_2
    //   1: ifnonnull +11 -> 12
    //   4: new 114	org/eclipse/core/runtime/NullProgressMonitor
    //   7: dup
    //   8: invokespecial 116	org/eclipse/core/runtime/NullProgressMonitor:<init>	()V
    //   11: astore_2
    //   12: aload_0
    //   13: aload_2
    //   14: invokevirtual 117	org/tizen/injector/location/core/injector/LocationInjector:setMonitor	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   17: invokestatic 121	org/tizen/common/connection/ConnectionPlugin:getDefault	()Lorg/tizen/common/connection/ConnectionPlugin;
    //   20: invokevirtual 126	org/tizen/common/connection/ConnectionPlugin:getCurrentDevice	()Lorg/tizen/sdblib/IDevice;
    //   23: astore_3
    //   24: aload_3
    //   25: invokeinterface 130 1 0
    //   30: astore 4
    //   32: aload 4
    //   34: ifnull +89 -> 123
    //   37: aconst_null
    //   38: astore 5
    //   40: new 136	java/io/FileInputStream
    //   43: dup
    //   44: aload_1
    //   45: invokevirtual 138	java/io/File:getPath	()Ljava/lang/String;
    //   48: invokespecial 143	java/io/FileInputStream:<init>	(Ljava/lang/String;)V
    //   51: astore 5
    //   53: aload 4
    //   55: aload 5
    //   57: aload_3
    //   58: ldc 15
    //   60: invokeinterface 144 2 0
    //   65: aconst_null
    //   66: iconst_m1
    //   67: invokevirtual 148	org/tizen/sdblib/service/SyncService:doPush	(Ljava/io/InputStream;Lorg/tizen/sdblib/service/FileEntry;Lorg/tizen/sdblib/service/ISyncProgressMonitor;I)Lorg/tizen/sdblib/service/SyncResult;
    //   70: astore 6
    //   72: aload 6
    //   74: invokevirtual 154	org/tizen/sdblib/service/SyncResult:isOk	()Z
    //   77: ifne +34 -> 111
    //   80: iconst_1
    //   81: anewarray 3	java/lang/Object
    //   84: dup
    //   85: iconst_0
    //   86: aload 5
    //   88: aastore
    //   89: invokestatic 160	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   92: iconst_0
    //   93: ireturn
    //   94: astore 7
    //   96: iconst_1
    //   97: anewarray 3	java/lang/Object
    //   100: dup
    //   101: iconst_0
    //   102: aload 5
    //   104: aastore
    //   105: invokestatic 160	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   108: aload 7
    //   110: athrow
    //   111: iconst_1
    //   112: anewarray 3	java/lang/Object
    //   115: dup
    //   116: iconst_0
    //   117: aload 5
    //   119: aastore
    //   120: invokestatic 160	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   123: aload_0
    //   124: invokespecial 166	org/tizen/injector/location/core/injector/LocationInjector:setLogMode	()V
    //   127: aload_2
    //   128: dup
    //   129: astore 5
    //   131: monitorenter
    //   132: aload_2
    //   133: ldc2_w 168
    //   136: invokevirtual 170	java/lang/Object:wait	(J)V
    //   139: goto +10 -> 149
    //   142: astore 6
    //   144: aload 6
    //   146: invokevirtual 174	java/lang/InterruptedException:printStackTrace	()V
    //   149: aload 5
    //   151: monitorexit
    //   152: goto +7 -> 159
    //   155: aload 5
    //   157: monitorexit
    //   158: athrow
    //   159: aload_2
    //   160: invokeinterface 177 1 0
    //   165: ifeq -38 -> 127
    //   168: aload_0
    //   169: invokespecial 182	org/tizen/injector/location/core/injector/LocationInjector:setStopMode	()V
    //   172: iconst_1
    //   173: ireturn
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	174	0	this	LocationInjector
    //   0	174	1	paramFile	java.io.File
    //   0	174	2	paramIProgressMonitor	IProgressMonitor
    //   23	35	3	localIDevice	org.tizen.sdblib.IDevice
    //   30	24	4	localSyncService	org.tizen.sdblib.service.SyncService
    //   38	80	5	localFileInputStream	java.io.FileInputStream
    //   70	3	6	localSyncResult	org.tizen.sdblib.service.SyncResult
    //   142	3	6	localInterruptedException	InterruptedException
    //   94	15	7	localObject1	Object
    // Exception table:
    //   from	to	target	type
    //   40	80	94	finally
    //   132	139	142	java/lang/InterruptedException
    //   132	152	155	finally
    //   155	158	155	finally
  }
  
  public void injectChange(GeoLocation paramGeoLocation)
  {
    location = paramGeoLocation;
    isChange = true;
  }
  
  public void inject(GeoLocation paramGeoLocation, IProgressMonitor paramIProgressMonitor)
    throws IOException
  {
    if (paramIProgressMonitor == null) {
      paramIProgressMonitor = new NullProgressMonitor();
    }
    setMonitor(paramIProgressMonitor);
    setManualMode();
    if (!injectLocation(paramGeoLocation.getLatitude(), paramGeoLocation.getLongitude()))
    {
      paramIProgressMonitor.setCanceled(true);
      return;
    }
    for (;;)
    {
      synchronized (paramIProgressMonitor)
      {
        try
        {
          paramIProgressMonitor.wait(1000L);
        }
        catch (InterruptedException localInterruptedException)
        {
          localInterruptedException.printStackTrace();
        }
      }
      if (paramIProgressMonitor.isCanceled())
      {
        setStopMode();
        return;
      }
      if (isChange)
      {
        if (!injectLocation(location.getLatitude(), location.getLongitude()))
        {
          paramIProgressMonitor.setCanceled(true);
          return;
        }
        isChange = false;
      }
    }
  }
  
  public boolean inject(ITableVO[] paramArrayOfITableVO, IProgressMonitor paramIProgressMonitor)
    throws IOException
  {
    if (paramIProgressMonitor == null) {
      paramIProgressMonitor = new NullProgressMonitor();
    }
    setMonitor(paramIProgressMonitor);
    setManualMode();
    for (;;)
    {
      for (int i = 0; i < paramArrayOfITableVO.length; i++)
      {
        GeoLocationVO localGeoLocationVO = (GeoLocationVO)paramArrayOfITableVO[i];
        if (!injectLocation(localGeoLocationVO.getLocation().getLatitude(), localGeoLocationVO.getLocation().getLongitude()))
        {
          paramIProgressMonitor.setCanceled(true);
          return false;
        }
        synchronized (paramIProgressMonitor)
        {
          try
          {
            paramIProgressMonitor.wait(1000L);
          }
          catch (InterruptedException localInterruptedException)
          {
            localInterruptedException.printStackTrace();
          }
        }
        if (paramIProgressMonitor.isCanceled())
        {
          setStopMode();
          return true;
        }
      }
    }
  }
  
  public void setCancel(boolean paramBoolean)
  {
    monitor.setCanceled(paramBoolean);
  }
  
  public void setMonitor(IProgressMonitor paramIProgressMonitor)
  {
    monitor = paramIProgressMonitor;
  }
  
  public boolean isCanceld()
  {
    return monitor.isCanceled();
  }
  
  public void connect() {}
  
  public void disconnect()
  {
    setCancel(true);
  }
  
  protected void finalize()
    throws Throwable
  {
    InjectorView.getDefault().removeSelectionListener(this);
    super.finalize();
  }
  
  public void selectionChanged(FileEntry paramFileEntry) {}
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.injector.LocationInjector
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.model;

import org.tizen.injector.location.core.protocol.GeoLocation;
import org.tizen.injector.model.AbstractTableVO;

public class GeoLocationVO
  extends AbstractTableVO
{
  private int seq;
  private GeoLocation location;
  
  public int getSeq()
  {
    return seq;
  }
  
  public void setSeq(int paramInt)
  {
    seq = paramInt;
  }
  
  public GeoLocation getLocation()
  {
    return location;
  }
  
  public void setLocation(GeoLocation paramGeoLocation)
  {
    location = paramGeoLocation;
  }
  
  private String getLatitudeString()
  {
    return getLocation().getNorthSouth() + "," + Double.toString(Math.abs(getLocation().getLatitude()));
  }
  
  private String getLongitudeString()
  {
    return getLocation().getEastWest() + "," + Double.toString(Math.abs(getLocation().getLongitude()));
  }
  
  public String[] getColumnNames()
  {
    return null;
  }
  
  public Object getColumnValue(int paramInt)
  {
    Object localObject = null;
    switch (paramInt)
    {
    case 0: 
      localObject = Integer.valueOf(getSeq());
      break;
    case 1: 
      localObject = getLatitudeString();
      break;
    case 2: 
      localObject = getLongitudeString();
      break;
    }
    return localObject;
  }
  
  public void setColumnValue(int paramInt, Object paramObject) {}
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.model.GeoLocationVO
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.protocol;

import java.util.ArrayList;
import java.util.Formatter;
import java.util.List;
import java.util.Locale;

public abstract class AbstractNMEA0183
{
  private static String PREFIX = "$";
  private static String DELIMITER = ",";
  private static String CHECKSUM_PREFIX = "*";
  private String sentenceID;
  private List<String> body;
  private String fullSentence;
  private int checksum = 0;
  protected static String NULL = "";
  
  public AbstractNMEA0183(String paramString)
  {
    sentenceID = paramString;
  }
  
  public String getSentence()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    Formatter localFormatter = new Formatter(localStringBuilder, Locale.US);
    localFormatter.format("%02x", new Object[] { Integer.valueOf(checksum) });
    String str = PREFIX.concat(fullSentence);
    str = str + CHECKSUM_PREFIX;
    str = str + localStringBuilder.toString().toUpperCase();
    return str;
  }
  
  protected List<String> getBody()
  {
    return body;
  }
  
  protected void createSentence()
  {
    body = new ArrayList();
    createBody();
    createChecksum();
  }
  
  private void createChecksum()
  {
    fullSentence = sentenceID;
    for (int i = 0; i < body.size(); i++)
    {
      fullSentence += DELIMITER;
      fullSentence += (String)body.get(i);
    }
    for (i = 0; i < fullSentence.length(); i++) {
      checksum ^= fullSentence.charAt(i);
    }
  }
  
  protected abstract void createBody();
  
  protected abstract boolean validate();
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.protocol.AbstractNMEA0183
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.protocol;

public enum GeoLocation$Directions
{
  NORTH,  SOUTH,  EAST,  WEST;
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.protocol.GeoLocation.Directions
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.protocol;

public class GeoLocation
{
  private double latitude;
  private double NMEAlatitude;
  private Directions northSouth;
  private double longitude;
  private double NMEAlongitude;
  private Directions eastWest;
  
  public GeoLocation(double paramDouble1, double paramDouble2)
  {
    setLatitude(paramDouble1);
    setLongitude(paramDouble2);
  }
  
  public double getLatitude()
  {
    return latitude;
  }
  
  public double getLongitude()
  {
    return longitude;
  }
  
  public String getNorthSouth()
  {
    return northSouth == Directions.NORTH ? "N" : "S";
  }
  
  public String getEastWest()
  {
    return eastWest == Directions.EAST ? "E" : "W";
  }
  
  public double getNMEAlatitude()
  {
    return NMEAlatitude;
  }
  
  public double getNMEAlongitude()
  {
    return NMEAlongitude;
  }
  
  public void setLatitude(double paramDouble)
  {
    latitude = paramDouble;
    if (paramDouble < 0.0D) {
      setNorthSouth(Directions.SOUTH);
    } else {
      setNorthSouth(Directions.NORTH);
    }
    setNMEAlatitude(Math.abs(paramDouble));
  }
  
  public void setLongitude(double paramDouble)
  {
    longitude = paramDouble;
    if (paramDouble < 0.0D) {
      setEastWest(Directions.WEST);
    } else {
      setEastWest(Directions.EAST);
    }
    setNMEAlongitude(Math.abs(paramDouble));
  }
  
  private void setNorthSouth(Directions paramDirections)
  {
    northSouth = paramDirections;
  }
  
  private void setEastWest(Directions paramDirections)
  {
    eastWest = paramDirections;
  }
  
  private void setNMEAlatitude(double paramDouble)
  {
    int i = (int)paramDouble;
    double d = (paramDouble - i) * 60.0D;
    NMEAlatitude = (i * 100 + d);
  }
  
  private void setNMEAlongitude(double paramDouble)
  {
    int i = (int)paramDouble;
    double d = (paramDouble - i) * 60.0D;
    NMEAlongitude = (i * 100 + d);
  }
  
  public static enum Directions
  {
    NORTH,  SOUTH,  EAST,  WEST;
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.protocol.GeoLocation
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.protocol;

public class IdentifiersConstants
{
  public static String SATELITES_IN_VIEW = "GPGSV";
  public static String GPS_FIX_DATA_TIME_POSITION_AND_FIX_RELATED_DATA = "GPGGA";
  public static String RECOMMENDED_MINIMUM_NAVIGATION_INFORMATION = "GPRMC";
  public static String GPS_DOP_AND_ACTIVE_SATELITES = "GPGSA";
  public static String TRACK_MODE_GOOD_AND_GROUND_SPEED = "GPVGT";
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.protocol.IdentifiersConstants
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.protocol;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.tizen.injector.location.core.protocol.messages";
  public static String SatelliteInfo_0;
  
  static
  {
    NLS.initializeMessages("org.tizen.injector.location.core.protocol.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.protocol.Messages
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.protocol;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class NMEA0183_GPGGA
  extends AbstractNMEA0183
{
  private Date currentDate = new Date();
  private String date;
  private GeoLocation location;
  private String qualityIndicator = "1";
  private int numOfSatellites = 5;
  private double hdop = 0.0D;
  private double altitude = 0.0D;
  private String altitudeUnit = "M";
  
  public NMEA0183_GPGGA()
  {
    this(0.0D, 0.0D);
  }
  
  public NMEA0183_GPGGA(double paramDouble1, double paramDouble2)
  {
    super("GPGGA");
    SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat("HHmmss.0");
    date = localSimpleDateFormat.format(currentDate);
    location = new GeoLocation(paramDouble1, paramDouble2);
    createSentence();
  }
  
  protected void createBody()
  {
    DecimalFormat localDecimalFormat1 = new DecimalFormat("0000.000000");
    DecimalFormat localDecimalFormat2 = new DecimalFormat("00000.000000");
    DecimalFormat localDecimalFormat3 = new DecimalFormat("00");
    DecimalFormat localDecimalFormat4 = new DecimalFormat("0.0");
    DecimalFormat localDecimalFormat5 = new DecimalFormat("###0.0");
    getBody().add(date);
    getBody().add(localDecimalFormat1.format(location.getNMEAlatitude()));
    getBody().add(location.getNorthSouth());
    getBody().add(localDecimalFormat2.format(location.getNMEAlongitude()));
    getBody().add(location.getEastWest());
    getBody().add(qualityIndicator);
    getBody().add(localDecimalFormat3.format(numOfSatellites));
    getBody().add(localDecimalFormat4.format(hdop));
    getBody().add(localDecimalFormat5.format(altitude));
    getBody().add(altitudeUnit);
    getBody().add(NULL);
    getBody().add(NULL);
    getBody().add(NULL);
    getBody().add(NULL);
  }
  
  protected boolean validate()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.protocol.NMEA0183_GPGGA
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.protocol;

import java.text.DecimalFormat;
import java.util.List;

public class NMEA0183_GPGSA
  extends AbstractNMEA0183
{
  private static String selectionMode = "A";
  private static String mode = "3";
  private int[] satellteIDs = { 1, 2, 3, 4, 5 };
  private double pdop = 0.0D;
  private double hdop = 0.0D;
  private double vdop = 0.0D;
  
  public NMEA0183_GPGSA()
  {
    super("GPGSA");
    createSentence();
  }
  
  protected void createBody()
  {
    DecimalFormat localDecimalFormat1 = new DecimalFormat("00");
    DecimalFormat localDecimalFormat2 = new DecimalFormat("0.0");
    getBody().add(selectionMode);
    getBody().add(mode);
    for (int i = 0; i < 12; i++) {
      if (i >= satellteIDs.length) {
        getBody().add(NULL);
      } else {
        getBody().add(localDecimalFormat1.format(satellteIDs[i]));
      }
    }
    getBody().add(localDecimalFormat2.format(pdop));
    getBody().add(localDecimalFormat2.format(hdop));
    getBody().add(localDecimalFormat2.format(vdop));
  }
  
  protected boolean validate()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.protocol.NMEA0183_GPGSA
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.protocol;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

public class NMEA0183_GPGSV
  extends AbstractNMEA0183
{
  private int numTotalMessage = 3;
  private int seq;
  private int satellitesInView = 10;
  private SatelliteInfo[] satellites;
  
  public NMEA0183_GPGSV(int paramInt)
  {
    this(paramInt, createDefaultSatellites(paramInt));
  }
  
  public NMEA0183_GPGSV(int paramInt, SatelliteInfo[] paramArrayOfSatelliteInfo)
  {
    super("GPGSV");
    seq = paramInt;
    satellites = paramArrayOfSatelliteInfo;
    createSentence();
  }
  
  protected void createBody()
  {
    DecimalFormat localDecimalFormat1 = new DecimalFormat("##0");
    DecimalFormat localDecimalFormat2 = new DecimalFormat("00");
    getBody().add(localDecimalFormat1.format(numTotalMessage));
    getBody().add(localDecimalFormat1.format(seq));
    getBody().add(localDecimalFormat1.format(satellitesInView));
    for (int i = 0; i < satellites.length; i++)
    {
      getBody().add(localDecimalFormat2.format(satellites[i].getId()));
      getBody().add(localDecimalFormat1.format(satellites[i].getElevation()));
      getBody().add(localDecimalFormat1.format(satellites[i].getAzimuth()));
      if (satellites[i].getSnr() == 0) {
        getBody().add(NULL);
      } else {
        getBody().add(localDecimalFormat1.format(satellites[i].getSnr()));
      }
    }
  }
  
  protected boolean validate()
  {
    return true;
  }
  
  private static SatelliteInfo[] createDefaultSatellites(int paramInt)
  {
    ArrayList localArrayList = new ArrayList();
    int i = 4;
    if (paramInt == 3) {
      i = 2;
    }
    for (int j = 1; j <= i; j++) {
      localArrayList.add(new SatelliteInfo(4 * (paramInt - 1) + j, 45, 300, 0));
    }
    return (SatelliteInfo[])localArrayList.toArray(new SatelliteInfo[localArrayList.size()]);
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.protocol.NMEA0183_GPGSV
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.protocol;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class NMEA0183_GPRMC
  extends AbstractNMEA0183
{
  private Date currentDate = new Date();
  private String time;
  private String status = "A";
  private GeoLocation location;
  private double speed = 0.0D;
  private double track = 0.0D;
  private String date;
  private String magenticDirection = "A";
  
  public NMEA0183_GPRMC()
  {
    this(0.0D, 0.0D);
  }
  
  public NMEA0183_GPRMC(double paramDouble1, double paramDouble2)
  {
    super("GPRMC");
    SimpleDateFormat localSimpleDateFormat1 = new SimpleDateFormat("HHmmss.0");
    time = localSimpleDateFormat1.format(currentDate);
    location = new GeoLocation(paramDouble1, paramDouble2);
    SimpleDateFormat localSimpleDateFormat2 = new SimpleDateFormat("ddMMyy");
    date = localSimpleDateFormat2.format(currentDate);
    createSentence();
  }
  
  protected void createBody()
  {
    DecimalFormat localDecimalFormat1 = new DecimalFormat("0000.000000");
    DecimalFormat localDecimalFormat2 = new DecimalFormat("00000.000000");
    DecimalFormat localDecimalFormat3 = new DecimalFormat("000.0");
    getBody().add(time);
    getBody().add(status);
    getBody().add(localDecimalFormat1.format(location.getNMEAlatitude()));
    getBody().add(location.getNorthSouth());
    getBody().add(localDecimalFormat2.format(location.getNMEAlongitude()));
    getBody().add(location.getEastWest());
    getBody().add(localDecimalFormat3.format(speed));
    getBody().add(localDecimalFormat3.format(track));
    getBody().add(date);
    getBody().add(NULL);
    getBody().add(NULL);
    getBody().add(magenticDirection);
  }
  
  protected boolean validate()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.protocol.NMEA0183_GPRMC
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.injector.location.core.protocol;

import javax.management.RuntimeErrorException;

public class SatelliteInfo
{
  private int id;
  private int elevation;
  private int azimuth;
  private int snr;
  
  public SatelliteInfo(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    setId(paramInt1);
    setElevation(paramInt2);
    setAzimuth(paramInt3);
    setSnr(paramInt4);
    if (!validate()) {
      throw new RuntimeErrorException(null, Messages.SatelliteInfo_0);
    }
  }
  
  private boolean validate()
  {
    if ((id < 1) || (id > 32)) {
      return false;
    }
    if ((elevation < 0) || (elevation > 90)) {
      return false;
    }
    if ((azimuth < 0) || (id > 359)) {
      return false;
    }
    return (snr >= 0) && (id <= 99);
  }
  
  public void setId(int paramInt)
  {
    id = paramInt;
  }
  
  public int getId()
  {
    return id;
  }
  
  public void setElevation(int paramInt)
  {
    elevation = paramInt;
  }
  
  public int getElevation()
  {
    return elevation;
  }
  
  public void setAzimuth(int paramInt)
  {
    azimuth = paramInt;
  }
  
  public int getAzimuth()
  {
    return azimuth;
  }
  
  public void setSnr(int paramInt)
  {
    snr = paramInt;
  }
  
  public int getSnr()
  {
    return snr;
  }
}

/* Location:
 * Qualified Name:     org.tizen.injector.location.core.protocol.SatelliteInfo
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd