本文整理汇总了Java中com.o3dr.services.android.lib.drone.attribute.AttributeEvent.HEARTBEAT_RESTORED属性的典型用法代码示例。如果您正苦于以下问题:Java AttributeEvent.HEARTBEAT_RESTORED属性的具体用法?Java AttributeEvent.HEARTBEAT_RESTORED怎么用?Java AttributeEvent.HEARTBEAT_RESTORED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.o3dr.services.android.lib.drone.attribute.AttributeEvent
的用法示例。
在下文中一共展示了AttributeEvent.HEARTBEAT_RESTORED属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onReceive
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
switch (action) {
case MissionProxy.ACTION_MISSION_PROXY_UPDATE:
if (mAppPrefs.isZoomToFitEnable()) gestureMapFragment.getMapFragment().zoomToFit();
// FALL THROUGH
case AttributeEvent.PARAMETERS_REFRESH_COMPLETED:
case DroidPlannerPrefs.PREF_VEHICLE_DEFAULT_SPEED:
case AttributeEvent.STATE_CONNECTED:
case AttributeEvent.HEARTBEAT_RESTORED:
updateMissionLength();
break;
case AttributeEvent.MISSION_RECEIVED:
final EditorMapFragment planningMapFragment = gestureMapFragment.getMapFragment();
if (planningMapFragment != null) {
planningMapFragment.zoomToFit();
}
break;
}
}
示例2: onReceive
@Override
public void onReceive(Context context, Intent intent) {
switch(intent.getAction()){
case AttributeEvent.HEARTBEAT_RESTORED:
case AttributeEvent.STATE_DISCONNECTED:
case AttributeEvent.STATE_CONNECTED:
case AttributeEvent.HOME_UPDATED:
updateHomeDistance();
break;
}
}
示例3: onReceive
@Override
public void onReceive(Context context, Intent intent) {
final Activity activity = getActivity();
if(activity == null)
return;
final String action = intent.getAction();
switch (action) {
case AttributeEvent.STATE_DISCONNECTED:
updateMavlinkVersionPreference(null);
updateFirmwareVersionPreference(null);
break;
case AttributeEvent.HEARTBEAT_FIRST:
case AttributeEvent.HEARTBEAT_RESTORED:
int mavlinkVersion = intent.getIntExtra(AttributeEventExtra.EXTRA_MAVLINK_VERSION, -1);
if (mavlinkVersion == -1)
updateMavlinkVersionPreference(null);
else
updateMavlinkVersionPreference(String.valueOf(mavlinkVersion));
break;
case AttributeEvent.STATE_CONNECTED:
case AttributeEvent.TYPE_UPDATED:
Drone drone = dpApp.getDrone();
if (drone.isConnected()) {
Type droneType = drone.getAttribute(AttributeType.TYPE);
updateFirmwareVersionPreference(droneType.getFirmwareVersion());
} else
updateFirmwareVersionPreference(null);
break;
}
}