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

Java FollowType类代码示例

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

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



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

示例1: onGuidedClick

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onGuidedClick(LatLong coord) {
    final Drone drone = getDrone();
    final FollowState followState = drone.getAttribute(AttributeType.FOLLOW_STATE);
    if (followState != null && followState.isEnabled() && followState.getMode().hasParam(FollowType.EXTRA_FOLLOW_ROI_TARGET)) {
        Toast.makeText(getContext(), R.string.guided_scan_roi_set_message, Toast.LENGTH_LONG).show();

        final double roiHeight = roiHeightWheel.getCurrentValue().toBase().getValue();
        final LatLongAlt roiCoord = new LatLongAlt(coord.getLatitude(), coord.getLongitude(), roiHeight);

        pushROITargetToVehicle(drone, roiCoord);
        updateROITargetMarker(coord);
    } else {
        super.onGuidedClick(coord);
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:17,代码来源:ModeFollowFragment.java


示例2: onViewCreated

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onViewCreated(View parentView, Bundle savedInstanceState) {
	super.onViewCreated(parentView, savedInstanceState);

	final Context context = getActivity().getApplicationContext();

	final NumericWheelAdapter radiusAdapter = new NumericWheelAdapter(context,
			R.layout.wheel_text_centered, 0, 200, "%d m");

	mRadiusWheel = (CardWheelHorizontalView) parentView.findViewById(R.id.radius_spinner);
	mRadiusWheel.setViewAdapter(radiusAdapter);
	updateCurrentRadius();
	mRadiusWheel.addChangingListener(this);

	spinner = (Spinner) parentView.findViewById(R.id.follow_type_spinner);
	adapter = new ArrayAdapter<FollowType>(getActivity(), android.R.layout.simple_spinner_item);
	spinner.setAdapter(adapter);
	spinner.setOnItemSelectedListener(this);
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:20,代码来源:ModeFollowFragment.java


示例3: onReceive

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    final String action = intent.getAction();
    switch (action) {
        case AttributeEvent.FOLLOW_UPDATE:
            final FollowState followState = getDrone().getAttribute(AttributeType.FOLLOW_STATE);
            if (followState != null) {
                final FollowType followType = followState.getMode();
                onFollowTypeUpdate(followType, followState.getParams());
            }
            break;
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:14,代码来源:ModeFollowFragment.java


示例4: onApiConnected

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onApiConnected() {
    super.onApiConnected();

    final FollowState followState = getDrone().getAttribute(AttributeType.FOLLOW_STATE);
    if (followState != null) {
        final FollowType followType = followState.getMode();
        onFollowTypeUpdate(followType, followState.getParams());
    }

    parent.addMarker(roiMarkerInfo);
    getBroadcastManager().registerReceiver(eventReceiver, eventFilter);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:14,代码来源:ModeFollowFragment.java


示例5: updateModeDescription

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
private void updateModeDescription(FollowType followType) {
    if(followType == null)
        return;

    switch (followType) {
        case GUIDED_SCAN:
            modeDescription.setText(R.string.mode_follow_guided_scan);
            break;

        default:
            modeDescription.setText(R.string.mode_follow);
            break;
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:15,代码来源:ModeFollowFragment.java


示例6: onScrollingEnded

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onScrollingEnded(CardWheelHorizontalView cardWheel, LengthUnit oldValue, LengthUnit newValue) {
    final Drone drone = getDrone();
    switch (cardWheel.getId()) {
        case R.id.radius_spinner:
            if (drone.isConnected()) {
                Bundle params = new Bundle();
                params.putDouble(FollowType.EXTRA_FOLLOW_RADIUS, newValue.toBase().getValue());
                FollowApi.getApi(drone).updateFollowParams(params);
            }
            break;

        case R.id.roi_height_spinner:
            if (drone.isConnected()) {
                final LatLongAlt roiCoord = roiMarkerInfo.getPosition();
                if (roiCoord != null) {
                    roiCoord.setAltitude(newValue.toBase().getValue());
                    pushROITargetToVehicle(drone, roiCoord);
                }
            }
            break;

        default:
            super.onScrollingEnded(cardWheel, oldValue, newValue);
            break;
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:28,代码来源:ModeFollowFragment.java


示例7: onItemSelected

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
    final FollowType type = adapter.getItem(position);

    getAppPrefs().setLastKnownFollowType(type);

    final Drone drone = getDrone();
    if (drone.isConnected()) {
        FollowApi.getApi(drone).enableFollowMe(type);
    }
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:12,代码来源:ModeFollowFragment.java


示例8: pushROITargetToVehicle

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
private void pushROITargetToVehicle(Drone drone, LatLongAlt roiCoord) {
    if (roiCoord == null)
        return;

    Bundle params = new Bundle();
    params.putParcelable(FollowType.EXTRA_FOLLOW_ROI_TARGET, roiCoord);
    FollowApi.getApi(drone).updateFollowParams(params);
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:9,代码来源:ModeFollowFragment.java


示例9: getView

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    TextView view;
    if (convertView == null) {
        view = (TextView) inflater.inflate(R.layout.list_item_follow_types, parent, false);
    } else {
        view = (TextView) convertView;
    }

    final FollowType followType = getItem(position);
    view.setText(followType.getTypeLabel());
    return view;
}
 
开发者ID:mxiao6,项目名称:Tower-develop,代码行数:14,代码来源:ModeFollowFragment.java


示例10: receiveData

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void receiveData(Context context, int transactionId, PebbleDictionary data) {
	FollowState followMe = dpApi.getFollowState();
          if(followMe == null)
              return ;
	PebbleKit.sendAckToPebble(applicationContext, transactionId);
	int request = (data.getInteger(KEY_PEBBLE_REQUEST).intValue());
	switch (request) {

	case KEY_REQUEST_MODE_FOLLOW:
              if(followMe.isEnabled()){
                  dpApi.disableFollowMe();
              }
              else {
                  dpApi.enableFollowMe(followMe.getMode());
              }
		break;

	case KEY_REQUEST_CYCLE_FOLLOW_TYPE:
              List<FollowType> followTypes = Arrays.asList(FollowType.values());
              int currentTypeIndex = followTypes.indexOf(followMe.getMode());
              int nextTypeIndex = currentTypeIndex++ % followTypes.size();
              dpApi.enableFollowMe(followTypes.get(nextTypeIndex));
		break;

	case KEY_REQUEST_PAUSE:
		dpApi.pauseAtCurrentLocation();
		break;

	case KEY_REQUEST_MODE_RTL:
		dpApi.changeVehicleMode(VehicleMode.COPTER_RTL);
		break;
	}
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:35,代码来源:PebbleNotificationProvider.java


示例11: onApiConnected

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onApiConnected() {
	super.onApiConnected();

	adapter.addAll(FollowType.values());
	getBroadcastManager().registerReceiver(eventReceiver, eventFilter);
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:8,代码来源:ModeFollowFragment.java


示例12: followModeToType

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
private static FollowType followModeToType(FollowAlgorithm.FollowModes followMode) {
    final FollowType followType;

    switch (followMode) {
        default:
        case LEASH:
            followType = FollowType.LEASH;
            break;

        case LEAD:
            followType = FollowType.LEAD;
            break;

        case RIGHT:
            followType = FollowType.RIGHT;
            break;

        case LEFT:
            followType = FollowType.LEFT;
            break;

        case CIRCLE:
            followType = FollowType.CIRCLE;
            break;

        case ABOVE:
            followType = FollowType.ABOVE;
            break;
    }

    return followType;
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:33,代码来源:DroneApi.java


示例13: enableFollowMe

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
public void enableFollowMe(FollowType followType) {
    if (isStarted()) {
        try {
            droneApi.enableFollowMe(followType);
        } catch (RemoteException e) {
            handleRemoteException(e);
        }
    }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:10,代码来源:Drone.java


示例14: onReceive

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    final String action = intent.getAction();
    if (AttributeEvent.FOLLOW_UPDATE.equals(action)) {
        final FollowState followState = getDrone().getAttribute(AttributeType.FOLLOW_STATE);
        if (followState != null) {
            final FollowType followType = followState.getMode();
            spinner.setSelection(adapter.getPosition(followType));
            onFollowTypeUpdate(followType, followState.getParams());
        }
    }
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:13,代码来源:ModeFollowFragment.java


示例15: onApiConnected

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onApiConnected() {
    super.onApiConnected();

    final FollowState followState = getDrone().getAttribute(AttributeType.FOLLOW_STATE);
    if (followState != null) {
        final FollowType followType = followState.getMode();
        spinner.setSelection(adapter.getPosition(followType));
        onFollowTypeUpdate(followType, followState.getParams());
    }

    parentActivity.addMapMarkerProvider(this);
    getBroadcastManager().registerReceiver(eventReceiver, eventFilter);
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:15,代码来源:ModeFollowFragment.java


示例16: onFollowTypeUpdate

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
private void onFollowTypeUpdate(FollowType followType, Bundle params) {
    if(followType == null)
        return;

    updateModeDescription(followType);

    if (followType.hasParam(FollowType.EXTRA_FOLLOW_RADIUS)) {
        double radius = DEFAULT_MIN_RADIUS;
        if (params != null) {
            radius = params.getDouble(FollowType.EXTRA_FOLLOW_RADIUS, DEFAULT_MIN_RADIUS);
        }

        mRadiusWheel.setVisibility(View.VISIBLE);
        mRadiusWheel.setCurrentValue((getLengthUnitProvider().boxBaseValueToTarget(radius)));
    } else {
        mRadiusWheel.setVisibility(View.GONE);
    }

    double roiHeight = GuidedScanROIMarkerInfo.DEFAULT_FOLLOW_ROI_ALTITUDE;
    LatLong roiTarget = null;
    if (followType.hasParam(FollowType.EXTRA_FOLLOW_ROI_TARGET)) {
        roiTarget = roiMarkerInfo.getPosition();

        if (params != null) {
            params.setClassLoader(LatLong.class.getClassLoader());
            roiTarget = params.getParcelable(FollowType.EXTRA_FOLLOW_ROI_TARGET);
        }

        if (roiTarget instanceof LatLongAlt)
            roiHeight = ((LatLongAlt) roiTarget).getAltitude();
    }

    roiHeightWheel.setCurrentValue(getLengthUnitProvider().boxBaseValueToTarget(roiHeight));
    updateROITargetMarker(roiTarget);
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:36,代码来源:ModeFollowFragment.java


示例17: onScrollingEnded

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onScrollingEnded(CardWheelHorizontalView cardWheel, LengthUnit oldValue, LengthUnit newValue) {
    final Drone drone = getDrone();
    switch (cardWheel.getId()) {
        case R.id.radius_spinner:
            if (drone.isConnected()) {
                Bundle params = new Bundle();
                params.putDouble(FollowType.EXTRA_FOLLOW_RADIUS, newValue.toBase().getValue());
                FollowApi.updateFollowParams(drone, params);
            }
            break;

        case R.id.roi_height_spinner:
            if (drone.isConnected()) {
                final LatLongAlt roiCoord = roiMarkerInfo.getPosition();
                if (roiCoord != null) {
                    roiCoord.setAltitude(newValue.toBase().getValue());
                    pushROITargetToVehicle(drone, roiCoord);
                }
            }
            break;

        default:
            super.onScrollingEnded(cardWheel, oldValue, newValue);
            break;
    }
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:28,代码来源:ModeFollowFragment.java


示例18: onItemSelected

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
    final FollowType type = adapter.getItem(position);

    final Drone drone = getDrone();
    if (drone.isConnected()) {
        drone.enableFollowMe(type);
    }
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:10,代码来源:ModeFollowFragment.java


示例19: pushROITargetToVehicle

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
private void pushROITargetToVehicle(Drone drone, LatLongAlt roiCoord) {
    if (roiCoord == null)
        return;

    Bundle params = new Bundle();
    params.putParcelable(FollowType.EXTRA_FOLLOW_ROI_TARGET, roiCoord);
    FollowApi.updateFollowParams(drone, params);
}
 
开发者ID:sommishra,项目名称:DroidPlanner-Tower,代码行数:9,代码来源:ModeFollowFragment.java


示例20: onClick

import com.o3dr.services.android.lib.gcs.follow.FollowType; //导入依赖的package包/类
@Override
public void onClick(WearableListView.ViewHolder viewHolder) {
    final FollowType followType = (FollowType) viewHolder.itemView.getTag();
    startService(new Intent(getApplicationContext(), WearReceiverService.class)
            .setAction(WearUtils.ACTION_CHANGE_FOLLOW_ME_TYPE)
            .putExtra(WearReceiverService.EXTRA_ACTION_DATA, (Parcelable) followType));

    finish();
}
 
开发者ID:DroidPlanner,项目名称:tower-wear,代码行数:10,代码来源:FollowMeTypesSelector.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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