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


Java UnitProvider类代码示例

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


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

示例1: updateTextViews

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