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


Java FollowType类代码示例

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


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


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