Ejemplo n.º 1
0
 /** Simple GPS destination. No db query required */
 public Destination(StorageService service, double lon, double lat) {
   GpsParams params = service.getGpsParams();
   mPref = new Preferences(service.getApplicationContext());
   if (null != params) {
     mLonInit = params.getLongitude();
     mLatInit = params.getLatitude();
   } else {
     mLonInit = lon;
     mLatInit = lat;
   }
   mInited = true;
   mService = service;
   mDbType = GPS;
   mFound = true;
   mLooking = false;
   mRunways = new LinkedList<Runway>();
   mTrackShape = new TrackShape();
   mEte = new String("--:--");
   mEta = new String("--:--");
   mFuel = new String("-.-");
   mLond = lon;
   mLatd = lat;
   mParams = new LinkedHashMap<String, String>();
   mFreq = new LinkedHashMap<String, String>();
   mAwos = new LinkedList<Awos>();
   mParams.put(DataBaseHelper.LONGITUDE, "" + mLond);
   mParams.put(DataBaseHelper.LATITUDE, "" + mLatd);
   mParams.put(DataBaseHelper.FACILITY_NAME, GPS);
   addTime();
   mTrackShape.updateShape(new GpsParams(getLocationInit()), Destination.this);
   mAfdFound = null;
   mName = Helper.truncGeo(lat) + "&" + Helper.truncGeo(lon);
   mDestType = GPS;
 }
Ejemplo n.º 2
0
 /**
  * @param name
  * @param type
  * @param pref
  * @param service
  */
 public Destination(String name, String type, Preferences pref, StorageService service) {
   GpsParams params = service.getGpsParams();
   mInited = false;
   if (null != params) {
     mLonInit = params.getLongitude();
     mLatInit = params.getLatitude();
     mInited = true;
   }
   mDbType = "";
   mFound = mLooking = false;
   mRunways = new LinkedList<Runway>();
   mService = service;
   mDataSource = mService.getDBResource();
   mTrackShape = new TrackShape();
   mPref = pref;
   mEte = new String("--:--");
   mEta = new String("--:--");
   mEteSec = Long.MAX_VALUE;
   mFuel = "-.-";
   mFuelGallons = Float.MAX_VALUE;
   mParams = new LinkedHashMap<String, String>();
   mFreq = new LinkedHashMap<String, String>();
   mAwos = new LinkedList<Awos>();
   mAfdFound = null;
   mName = name.toUpperCase(Locale.getDefault());
   mDestType = type;
   mLond = mLatd = 0;
 }