当前位置: 首页>>代码示例>>Java>>正文


Java UnitManager类代码示例

本文整理汇总了Java中com.playuav.android.utils.unit.UnitManager的典型用法代码示例。如果您正苦于以下问题:Java UnitManager类的具体用法?Java UnitManager怎么用?Java UnitManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UnitManager类属于com.playuav.android.utils.unit包,在下文中一共展示了UnitManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateItemView

import com.playuav.android.utils.unit.UnitManager; //导入依赖的package包/类
@Override
public void updateItemView(final Context context, final Drone drone) {
	if (mItemView != null) {
		String update = "--";
              if(drone != null && drone.isConnected()) {
                  final Gps droneGps = drone.getGps();
                  final Home droneHome = drone.getHome();
                  if(droneGps.isValid() && droneHome.isValid()) {
                      double distanceToHome = MathUtils.getDistance(droneHome.getCoordinate(),
                              droneGps.getPosition());
                      update = String.format("Home\n%s", UnitManager.getUnitProvider()
                              .distanceToString(distanceToHome));
                  }
              }
		((TextView) mItemView).setText(update);
	}
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:18,代码来源:InfoBarItem.java

示例2: updateHome

import com.playuav.android.utils.unit.UnitManager; //导入依赖的package包/类
private void updateHome(Drone drone) {
	if (mInboxBuilder == null)
		return;

       String update = "--";
           final Gps droneGps = this.drone.getGps();
           final Home droneHome = this.drone.getHome();
           if(droneGps != null && droneGps.isValid() && droneHome != null && droneHome.isValid()) {
               double distanceToHome = MathUtils.getDistance(droneHome.getCoordinate(),
                       droneGps.getPosition());
               update = String.format("Home\n%s", UnitManager.getUnitProvider().distanceToString
                       (distanceToHome));
           }
	mInboxBuilder.setLine(0, SpannableUtils.normal("Home:   ", update));
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:16,代码来源:StatusBarNotificationProvider.java

示例3: updateTextViews

import com.playuav.android.utils.unit.UnitManager; //导入依赖的package包/类
private void updateTextViews() {
	boolean setDefault = true;
	List<Survey> surveyList = getMissionItems();
	if (!surveyList.isEmpty()) {
           Survey survey = surveyList.get(0);
		SurveyDetail surveyDetail = survey.getSurveyDetail();
		try {
               UnitProvider unitProvider = UnitManager.getUnitProvider();

			footprintTextView.setText(String.format("%s: %s x %s",
                       getString(R.string.footprint),
                       unitProvider.distanceToString(surveyDetail.getLateralFootPrint()),
                       unitProvider.distanceToString(surveyDetail
                               .getLongitudinalFootPrint())));

			groundResolutionTextView.setText(String.format("%s: %s /px",
                       getString(R.string.ground_resolution),
                       unitProvider.areaToString(surveyDetail.getGroundResolution())));

			distanceTextView.setText(String.format("%s: %s",
                       getString(R.string.distance_between_pictures),
                       unitProvider.distanceToString(surveyDetail
                               .getLongitudinalPictureDistance())));

			distanceBetweenLinesTextView.setText(String.format("%s: %s",
                       getString(R.string.distance_between_lines),
                       unitProvider.distanceToString(surveyDetail
                               .getLateralPictureDistance())));

			areaTextView.setText(String.format("%s: %s", getString(R.string.area),
                       unitProvider.areaToString(survey.getPolygonArea())));

			lengthView.setText(String.format("%s: %s", getString(R.string.mission_length),
                       unitProvider.distanceToString(survey.getGridLength())));

			numberOfPicturesView.setText(String.format("%s: %d", getString(R.string.pictures),
                       survey.getCameraCount()));

			numberOfStripsView.setText(String.format("%s: %d", getString(R.string.number_of_strips),
                       survey.getNumberOfLines()));

			setDefault = false;
		} catch (Exception e) {
			setDefault = true;
		}
	}

	if (setDefault) {
		footprintTextView.setText(getString(R.string.footprint) + ": ???");
		groundResolutionTextView.setText(getString(R.string.ground_resolution) + ": ???");
		distanceTextView.setText(getString(R.string.distance_between_pictures) + ": ???");
		distanceBetweenLinesTextView.setText(getString(R.string.distance_between_lines)
				+ ": ???");
		areaTextView.setText(getString(R.string.area) + ": ???");
		lengthView.setText(getString(R.string.mission_length) + ": ???");
		numberOfPicturesView.setText(getString(R.string.pictures) + "???");
		numberOfStripsView.setText(getString(R.string.number_of_strips) + "???");
	}
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:60,代码来源:MissionSurveyFragment.java


注:本文中的com.playuav.android.utils.unit.UnitManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。