• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Home类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: zoomToFit

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
public void zoomToFit() {
	// get visible mission coords
	final List<LatLong> visibleCoords = missionProxy == null ? new ArrayList<LatLong>() : missionProxy.getVisibleCoords();

	// add home coord if visible
	if(drone != null) {
		Home home = drone.getAttribute(AttributeType.HOME);
		if (home != null && home.isValid()) {
			final LatLong homeCoord = home.getCoordinate();
			if (homeCoord.getLongitude() != 0 && homeCoord.getLatitude() != 0)
				visibleCoords.add(homeCoord);
		}
	}

	if (!visibleCoords.isEmpty())
		zoomToFit(visibleCoords);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:18,代码来源:EditorMapFragment.java


示例2: updateItemView

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的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


示例3: updateHomeTelem

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
private void updateHomeTelem() {
    final Context context = getActivity().getApplicationContext();
    final Drone drone = getDrone();

    String update = getString(R.string.empty_content);
    if (drone.isConnected()) {
        final Gps droneGps = drone.getAttribute(AttributeType.GPS);
        final Home droneHome = drone.getAttribute(AttributeType.HOME);
        if (droneGps.isValid() && droneHome.isValid()) {
            LengthUnit distanceToHome = getLengthUnitProvider().boxBaseValueToTarget
                    (MathUtils.getDistance(droneHome.getCoordinate(), droneGps.getPosition()));
            update = String.format("%s", distanceToHome);
        }
    }

    homeTelem.setText(update);
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:18,代码来源:ActionBarTelemFragment.java


示例4: updateDistanceFromHome

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
protected void updateDistanceFromHome() {
    TextView distanceTextView = (TextView) findViewById(R.id.distanceValueTextView);
    Altitude droneAltitude = this.drone.getAttribute(AttributeType.ALTITUDE);
    double vehicleAltitude = droneAltitude.getAltitude();
    Gps droneGps = this.drone.getAttribute(AttributeType.GPS);
    LatLong vehiclePosition = droneGps.getPosition();

    double distanceFromHome = 0;

    if (droneGps.isValid()) {
        LatLongAlt vehicle3DPosition = new LatLongAlt(vehiclePosition.getLatitude(), vehiclePosition.getLongitude(), vehicleAltitude);
        Home droneHome = this.drone.getAttribute(AttributeType.HOME);
        distanceFromHome = distanceBetweenPoints(droneHome.getCoordinate(), vehicle3DPosition);
    } else {
        distanceFromHome = 0;
    }

    distanceTextView.setText(String.format("%3.1f", distanceFromHome) + "m");
}
 
开发者ID:3drobotics,项目名称:DroneKit-Android-Starter,代码行数:20,代码来源:MainActivity.java


示例5: updateHome

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
private void updateHome(Drone drone) {
    if (mInboxBuilder == null)
        return;

    String update = "--";
    final Gps droneGps = this.drone.getAttribute(AttributeType.GPS);
    final Home droneHome = this.drone.getAttribute(AttributeType.HOME);
    if (droneGps != null && droneGps.isValid() && droneHome != null && droneHome.isValid()) {
        LengthUnit distanceToHome = UnitManager.getUnitSystem(mContext).getLengthUnitProvider()
                .boxBaseValueToTarget(MathUtils.getDistance2D(droneHome.getCoordinate(), droneGps.getPosition()));
        update = String.format("Home\n%s", distanceToHome);
    }
    mInboxBuilder.setLine(0, SpannableUtils.normal("Home:   ", update));
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:15,代码来源:StatusBarNotificationProvider.java


示例6: updateHomeTelem

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
private void updateHomeTelem() {
    final Drone drone = getDrone();

    String update = getString(R.string.empty_content);
    int drawableResId = appPrefs.isReturnToMeEnabled()
            ? R.drawable.ic_person_grey_700_18dp
            : R.drawable.ic_home_grey_700_18dp;

    if (drone.isConnected()) {
        final Gps droneGps = drone.getAttribute(AttributeType.GPS);
        final Home droneHome = drone.getAttribute(AttributeType.HOME);
        if (droneGps.isValid() && droneHome.isValid()) {
            LengthUnit distanceToHome = getLengthUnitProvider().boxBaseValueToTarget
                    (MathUtils.getDistance2D(droneHome.getCoordinate(), droneGps.getPosition()));
            update = String.format("%s", distanceToHome);

            final ReturnToMeState returnToMe = drone.getAttribute(AttributeType.RETURN_TO_ME_STATE);
            switch (returnToMe.getState()) {

                case ReturnToMeState.STATE_UPDATING_HOME:
                    //Change the home telemetry icon
                    drawableResId = R.drawable.ic_person_blue_a400_18dp;
                    break;

                case ReturnToMeState.STATE_USER_LOCATION_INACCURATE:
                case ReturnToMeState.STATE_USER_LOCATION_UNAVAILABLE:
                case ReturnToMeState.STATE_WAITING_FOR_VEHICLE_GPS:
                case ReturnToMeState.STATE_ERROR_UPDATING_HOME:
                    drawableResId = R.drawable.ic_person_red_500_18dp;
                    update = getString(R.string.empty_content);
                    break;
            }
        }
    }

    homeTelem.setCompoundDrawablesWithIntrinsicBounds(drawableResId, 0, 0, 0);
    homeTelem.setText(update);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:39,代码来源:ActionBarTelemFragment.java


示例7: updateHomeDistance

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
private void updateHomeDistance(){
    if(distanceView == null && distanceLabelView == null)
        return;

    boolean hideDistanceInfo = true;

    Drone drone = getDrone();
    Home home = drone == null ? null : drone.<Home>getAttribute(AttributeType.HOME);

    if(home != null && home.isValid() && mSelectedProxies.size() == 1) {
        MissionItemProxy itemProxy = mSelectedProxies.get(0);
        MissionItem item = itemProxy.getMissionItem();
        if(item instanceof MissionItem.SpatialItem) {
            LatLongAlt itemCoordinate = ((MissionItem.SpatialItem)item).getCoordinate();
            LatLongAlt homeCoordinate = home.getCoordinate();
            double homeDistance = MathUtils.getDistance3D(homeCoordinate, itemCoordinate);
            if(homeDistance > 0) {
                hideDistanceInfo = false;

                if (distanceView != null) {
                    distanceView.setText(getLengthUnitProvider().boxBaseValueToTarget(homeDistance).toString());
                    distanceView.setVisibility(View.VISIBLE);

                    if (distanceLabelView != null) {
                        distanceLabelView.setVisibility(View.VISIBLE);
                    }
                }
            }
        }
    }

    if(hideDistanceInfo){
        if(distanceView != null)
            distanceView.setVisibility(View.GONE);

        if(distanceLabelView != null){
            distanceLabelView.setVisibility(View.GONE);
        }
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:41,代码来源:MissionDetailFragment.java


示例8: getPosition

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
@Override
public LatLong getPosition() {
       Home droneHome = drone.getAttribute(AttributeType.HOME);
       if(droneHome == null) return null;

	return droneHome.getCoordinate();
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:8,代码来源:GraphicHome.java


示例9: updateHome

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的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


示例10: zoomToFit

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
public void zoomToFit() {
	// get visible mission coords
	final List<LatLong> visibleCoords = missionProxy.getVisibleCoords();

	// add home coord if visible
       Home home = drone.getHome();
       if(home != null ) {
           final LatLong homeCoord = drone.getHome().getCoordinate();
           if (homeCoord != null && homeCoord.getLongitude() != 0 && homeCoord.getLatitude() != 0)
               visibleCoords.add(homeCoord);
       }

       zoomToFit(visibleCoords);
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:15,代码来源:EditorMapFragment.java


示例11: getHome

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
private Home getHome()  {
    org.droidplanner.core.drone.variables.Home droneHome = this.droneMgr.getDrone().getHome();
    LatLongAlt homePosition = droneHome.isValid()
            ? new LatLongAlt(droneHome.getCoord().getLat(), droneHome.getCoord().getLng(),
            droneHome.getAltitude().valueInMeters())
            : null;

    return new Home(homePosition);
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:10,代码来源:DroneApi.java


示例12: getPosition

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
@Override
public LatLong getPosition() {
       Home droneHome = drone.getHome();
       if(droneHome == null) return null;

	return droneHome.getCoordinate();
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:8,代码来源:GraphicHome.java


示例13: updateHome

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
private void updateHome(Drone drone) {
	if (mInboxBuilder == null)
		return;

       String update = "--";
           final Gps droneGps = this.drone.getAttribute(AttributeType.GPS);
           final Home droneHome = this.drone.getAttribute(AttributeType.HOME);
           if(droneGps != null && droneGps.isValid() && droneHome != null && droneHome.isValid()) {
               LengthUnit distanceToHome = UnitManager.getUnitSystem(mContext).getLengthUnitProvider()
                       .boxBaseValueToTarget(MathUtils.getDistance(droneHome.getCoordinate(), droneGps.getPosition()));
               update = String.format("Home\n%s", distanceToHome);
           }
	mInboxBuilder.setLine(0, SpannableUtils.normal("Home:   ", update));
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:15,代码来源:StatusBarNotificationProvider.java


示例14: zoomToFit

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
public void zoomToFit() {
	// get visible mission coords
	final List<LatLong> visibleCoords = missionProxy.getVisibleCoords();

	// add home coord if visible
       Home home = drone.getAttribute(AttributeType.HOME);
       if(home != null ) {
           final LatLong homeCoord = home.getCoordinate();
           if (homeCoord != null && homeCoord.getLongitude() != 0 && homeCoord.getLatitude() != 0)
               visibleCoords.add(homeCoord);
       }

       zoomToFit(visibleCoords);
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:15,代码来源:EditorMapFragment.java


示例15: isValid

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
public boolean isValid() {
       Home droneHome = drone.getAttribute(AttributeType.HOME);
	return droneHome != null && droneHome.isValid();
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:5,代码来源:GraphicHome.java


示例16: getSnippet

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
@Override
public String getSnippet() {
       Home droneHome = drone.getAttribute(AttributeType.HOME);
	LatLongAlt coordinate = droneHome == null ? null : droneHome.getCoordinate();
	return "Home " + (coordinate == null ? "N/A" : coordinate.getAltitude());
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:7,代码来源:GraphicHome.java


示例17: isValid

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
public boolean isValid() {
       Home droneHome = drone.getHome();
	return droneHome != null && droneHome.isValid();
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:5,代码来源:GraphicHome.java


示例18: getSnippet

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
@Override
public String getSnippet() {
       Home droneHome = drone.getHome();
	return "Home " + (droneHome == null ? "N/A" : droneHome.getCoordinate().getAltitude());
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:6,代码来源:GraphicHome.java


示例19: getHome

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
public Home getHome() {
    Home home = getAttribute(AttributeType.HOME, Home.class.getClassLoader());
    return home == null ? new Home() : home;
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:5,代码来源:Drone.java


示例20: getSnippet

import com.o3dr.services.android.lib.drone.property.Home; //导入依赖的package包/类
@Override
public String getSnippet() {
       Home droneHome = drone.getAttribute(AttributeType.HOME);
	return "Home " + (droneHome == null ? "N/A" : droneHome.getCoordinate().getAltitude());
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:6,代码来源:GraphicHome.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CacheReportRequestProto类代码示例发布时间:2022-05-23
下一篇:
Java MediaStoreSignature类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap