本文整理汇总了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);
}
}
示例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);
}
示例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;
}
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
}
示例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);
}
示例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;
}
示例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);
}
}
}
示例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());
}
}
}
示例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);
}