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


Java MissionProxy类代码示例

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


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

示例1: onCreate

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
@Override
public void onCreate() {
    SDKInitializer.initialize(getApplicationContext());
    super.onCreate();
    final Context context = getApplicationContext();

    dpPrefs = new DroidPlannerPrefs(context);
    lbm = LocalBroadcastManager.getInstance(context);

    serviceMgr = new ServiceManager(context);
    drone = new Drone(serviceMgr, handler);
    missionProxy = new MissionProxy(context, this.drone);

    exceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
    Thread.setDefaultUncaughtExceptionHandler(dpExceptionHandler);

    GAUtils.initGATracker(this);
    GAUtils.startNewSession(context);

    registerReceiver(broadcastReceiver, new IntentFilter(ACTION_TOGGLE_DRONE_CONNECTION));
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:22,代码来源:DroidPlannerApp.java

示例2: onApiConnected

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
@Override
public void onApiConnected() {
    invalidateOptionsMenu();

    getBroadcastManager().registerReceiver(superReceiver, superIntentFilter);
    if (dpApp.getDrone().isConnected())
        onDroneConnected();
    else
        onDroneDisconnected();

    lbm.sendBroadcast(new Intent(MissionProxy.ACTION_MISSION_PROXY_UPDATE));
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:13,代码来源:SuperUI.java

示例3: onReceive

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    final String action = intent.getAction();
    if(MissionProxy.ACTION_MISSION_PROXY_UPDATE.equals(action)){
        if(missionProxy != null) {
            double missionLength = missionProxy.getMissionLength();
            double speedParameter = dpApp.getDrone().getSpeedParameter();
            String infoString = String.format("Distance %02.2fm", missionLength);
            if (speedParameter > 0) {
                int time = (int) (missionLength / speedParameter);
                infoString = infoString
                        + String.format(", Flight time: %02d:%02d", time / 60, time % 60);
            }
            infoView.setText(infoString);

            // Remove detail window if item is removed
            if (missionProxy.selection.getSelected().isEmpty() && itemDetailFragment != null) {
                removeItemDetail();
            }
        }
    }
    else if(AttributeEvent.MISSION_RECEIVED.equals(action)){
        final EditorMapFragment planningMapFragment = gestureMapFragment.getMapFragment();
        if (planningMapFragment != null) {
            planningMapFragment.zoomToFit();
        }
    }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:29,代码来源:EditorActivity.java

示例4: onReceive

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
    final String action = intent.getAction();
    if(MissionProxy.ACTION_MISSION_PROXY_UPDATE.equals(action)){
        updateViews();
    }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:8,代码来源:MissionSurveyFragment.java

示例5: onCheckedChanged

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
       Drone drone = getDrone();
	for (StructureScanner item : getMissionItems()) {
           item.setCrossHatch(isChecked);
           drone.buildComplexMissionItem(item);
       }

	MissionProxy missionProxy = getMissionProxy();
	if (missionProxy != null)
		missionProxy.notifyMissionUpdate();
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:13,代码来源:MissionStructureScannerFragment.java

示例6: MissionItemProxy

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
public MissionItemProxy(MissionProxy mission, MissionItem missionItem) {
	mMission = mission;
	mMissionItem = missionItem;
	mMarkerInfos = MissionItemMarkerInfo.newInstance(this);

       if(mMissionItem instanceof Survey){
           mMission.getDrone().buildComplexMissionItem((Survey) mMissionItem);
       }
       else if(mMissionItem instanceof StructureScanner){
           mMission.getDrone().buildComplexMissionItem((StructureScanner) mMissionItem);
       }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:13,代码来源:MissionItemProxy.java

示例7: getIcon

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
@Override
public Bitmap getIcon(Resources res) {
	int drawable;
	final MissionProxy missionProxy = mMarkerOrigin.getMissionProxy();
	if (missionProxy.selection.selectionContains(mMarkerOrigin)) {
		drawable = getSelectedIconResource();
	} else {
		drawable = getIconResource();
	}

	return MarkerWithText.getMarkerWithTextAndDetail(drawable,
			Integer.toString(missionProxy.getOrder(mMarkerOrigin)), getIconDetail(), res);
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:14,代码来源:MissionItemMarkerInfo.java

示例8: getIconDetail

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
private String getIconDetail() {
	try {
		final MissionProxy missionProxy = mMarkerOrigin.getMissionProxy();
		if (missionProxy.getAltitudeDiffFromPreviousItem(mMarkerOrigin) == 0) {
			return null;
		} else {
			return null; // altitude.toString();
		}
	} catch (Exception e) {
		return null;
	}
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:13,代码来源:MissionItemMarkerInfo.java

示例9: onOptionsItemSelected

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    final Drone dpApi = dpApp.getDrone();

    switch (item.getItemId()) {
        case R.id.menu_connect:
            toggleDroneConnection();
            return true;

        case R.id.menu_send_mission: {
            final MissionProxy missionProxy = dpApp.getMissionProxy();
            if (missionProxy.getItems().isEmpty() || missionProxy.hasTakeoffAndLandOrRTL()) {
                missionProxy.sendMissionToAPM(dpApi);
            } else {
                YesNoWithPrefsDialog dialog = YesNoWithPrefsDialog.newInstance(
                        getApplicationContext(), "Mission Upload",
                        "Do you want to append a Takeoff and RTL to your " + "mission?", "Ok",
                        "Skip", new YesNoDialog.Listener() {

                            @Override
                            public void onYes() {
                                missionProxy.addTakeOffAndRTL();
                                missionProxy.sendMissionToAPM(dpApi);
                            }

                            @Override
                            public void onNo() {
                                missionProxy.sendMissionToAPM(dpApi);
                            }
                        }, getString(R.string.pref_auto_insert_mission_takeoff_rtl_land_key));

                if (dialog != null) {
                    dialog.show(getSupportFragmentManager(), "Mission Upload check.");
                }
            }
            return true;
        }

        case R.id.menu_load_mission:
            dpApi.loadWaypoints();
            return true;
        case R.id.menu_triggerCamera:
            dpApi.triggerCamera();
            return true;
        case R.id.menu_epm_grab:
            dpApi.epmCommand(false);
            return true;
        case R.id.menu_epm_release:
            dpApi.epmCommand(true);
            return true;

        case android.R.id.home:
            NavUtils.navigateUpFromSameTask(this);
            return true;

        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:60,代码来源:SuperUI.java

示例10: onItemClick

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
@Override
public void onItemClick(MissionItemProxy item, boolean zoomToFit) {
       enableMultiEdit(false);

       if(missionProxy == null) return;

	switch (getTool()) {
	default:
		if (contextualActionBar != null) {
			if (missionProxy.selection.selectionContains(item)) {
				missionProxy.selection.removeItemFromSelection(item);
			} else {
				missionProxy.selection.addToSelection(item);
			}
		} else {
			if (missionProxy.selection.selectionContains(item)) {
				missionProxy.selection.clearSelection();
			} else {
				editorToolsFragment.setTool(EditorTools.NONE);
				missionProxy.selection.setSelectionTo(item);
			}
		}

		break;

	case TRASH:
		missionProxy.removeItem(item);
		missionProxy.selection.clearSelection();

		if (missionProxy.getItems().size() <= 0) {
			editorToolsFragment.setTool(EditorTools.NONE);
		}
		break;
	}

       if(zoomToFit) {
           final EditorMapFragment planningMapFragment = gestureMapFragment.getMapFragment();
           List<MissionItemProxy> selected = missionProxy.selection.getSelected();
           if (selected.isEmpty()) {
               planningMapFragment.zoomToFit();
           }
           else{
               planningMapFragment.zoomToFit(MissionProxy.getVisibleCoords(selected));
           }
       }
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:47,代码来源:EditorActivity.java

示例11: getMissionProxy

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
public MissionProxy getMissionProxy(){
    return this.missionProxy;
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:4,代码来源:DroidPlannerApp.java

示例12: MissionItemListAdapter

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
public MissionItemListAdapter(MissionProxy missionProxy, OnEditorInteraction editorListener) {
    this.missionProxy = missionProxy;
    this.editorListener = editorListener;
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:5,代码来源:MissionItemListAdapter.java

示例13: getMissionProxy

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
/**
 * Provides access to the owning mission render instance.
 * 
 * @return
 */
public MissionProxy getMissionProxy() {
	return mMission;
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:9,代码来源:MissionItemProxy.java

示例14: getMissionProxy

import com.playuav.android.proxy.mission.MissionProxy; //导入依赖的package包/类
protected MissionProxy getMissionProxy(){ return dpApp.getMissionProxy();} 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:2,代码来源:ApiListenerDialogFragment.java


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