本文整理汇总了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) + "???");
}
}