本文整理汇总了Java中com.o3dr.services.android.lib.drone.attribute.AttributeEvent.AUTOPILOT_ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java AttributeEvent.AUTOPILOT_ERROR属性的具体用法?Java AttributeEvent.AUTOPILOT_ERROR怎么用?Java AttributeEvent.AUTOPILOT_ERROR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.o3dr.services.android.lib.drone.attribute.AttributeEvent
的用法示例。
在下文中一共展示了AttributeEvent.AUTOPILOT_ERROR属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onReceive
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
switch (action) {
case AttributeEvent.AUTOPILOT_ERROR:
final String errorName = intent.getStringExtra(AttributeEventExtra.EXTRA_AUTOPILOT_ERROR_ID);
final ErrorType errorType = ErrorType.getErrorById(errorName);
if (errorType != null && ErrorType.NO_ERROR != errorType) {
final HitBuilders.EventBuilder eventBuilder = new HitBuilders.EventBuilder()
.setCategory(GAUtils.Category.FAILSAFE)
.setAction("Autopilot error")
.setLabel(errorType.getLabel(context).toString());
GAUtils.sendEvent(eventBuilder);
}
break;
}
}
示例2: onReceive
@Override
public void onReceive(Context context, Intent intent) {
switch (intent.getAction()) {
case AttributeEvent.STATE_CONNECTED:
if (notificationHandler != null)
notificationHandler.init();
if (NetworkUtils.isOnSoloNetwork(context)) {
bringUpCellularNetwork();
}
break;
case AttributeEvent.STATE_DISCONNECTED:
if (notificationHandler != null) {
notificationHandler.terminate();
}
stopSelf();
break;
case AttributeEvent.AUTOPILOT_ERROR:
final String errorName = intent.getStringExtra(AttributeEventExtra.EXTRA_AUTOPILOT_ERROR_ID);
if (notificationHandler != null)
notificationHandler.onAutopilotError(errorName);
break;
}
}
示例3: onReceive
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
switch (action) {
case AttributeEvent.AUTOPILOT_ERROR:
String errorName = intent.getStringExtra(AttributeEventExtra.EXTRA_AUTOPILOT_ERROR_ID);
final ErrorType errorType = ErrorType.getErrorById(errorName);
onAutopilotError(errorType);
break;
case AttributeEvent.STATE_ARMING:
case AttributeEvent.STATE_CONNECTED:
case AttributeEvent.STATE_DISCONNECTED:
case AttributeEvent.STATE_UPDATED:
enableSlidingUpPanel(dpApp.getDrone());
break;
case AttributeEvent.FOLLOW_START:
//Extend the sliding drawer if collapsed.
if (!mSlidingPanelCollapsing.get() && mSlidingPanel.isSlidingEnabled() &&
!mSlidingPanel.isPanelExpanded()) {
mSlidingPanel.expandPanel();
}
break;
case AttributeEvent.MISSION_DRONIE_CREATED:
float dronieBearing = intent.getFloatExtra(AttributeEventExtra.EXTRA_MISSION_DRONIE_BEARING, -1);
if (dronieBearing != -1)
updateMapBearing(dronieBearing);
break;
}
}
示例4: onReceive
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
switch (action) {
case AttributeEvent.AUTOPILOT_ERROR:
String errorName = intent.getStringExtra(AttributeEventExtra.EXTRA_AUTOPILOT_ERROR_ID);
final ErrorType errorType = ErrorType.getErrorById(errorName);
onAutopilotError(errorType);
break;
case AttributeEvent.AUTOPILOT_MESSAGE:
final int logLevel = intent.getIntExtra(AttributeEventExtra.EXTRA_AUTOPILOT_MESSAGE_LEVEL, Log.VERBOSE);
final String message = intent.getStringExtra(AttributeEventExtra.EXTRA_AUTOPILOT_MESSAGE);
onAutopilotError(logLevel, message);
break;
case AttributeEvent.STATE_ARMING:
case AttributeEvent.STATE_CONNECTED:
case AttributeEvent.STATE_DISCONNECTED:
case AttributeEvent.STATE_UPDATED:
case AttributeEvent.TYPE_UPDATED:
enableSlidingUpPanel(getDrone());
break;
case AttributeEvent.FOLLOW_START:
//Extend the sliding drawer if collapsed.
if (!mSlidingPanelCollapsing.get()
&& mSlidingPanel.isEnabled()
&& mSlidingPanel.getPanelState() != SlidingUpPanelLayout.PanelState.EXPANDED) {
mSlidingPanel.setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
}
break;
case AttributeEvent.MISSION_DRONIE_CREATED:
float dronieBearing = intent.getFloatExtra(AttributeEventExtra.EXTRA_MISSION_DRONIE_BEARING, -1);
if (dronieBearing != -1)
updateMapBearing(dronieBearing);
break;
}
}