本文整理汇总了Java中dji.sdk.base.BaseProduct类的典型用法代码示例。如果您正苦于以下问题:Java BaseProduct类的具体用法?Java BaseProduct怎么用?Java BaseProduct使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseProduct类属于dji.sdk.base包,在下文中一共展示了BaseProduct类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initPreviewer
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
private void initPreviewer() {
BaseProduct product = FPVDemoApplication.getProductInstance();
if (product == null || !product.isConnected()) {
showToast(getString(R.string.disconnected));
} else {
if (null != mVideoSurface) {
mVideoSurface.setSurfaceTextureListener(this);
}
if (!product.getModel().equals(Model.UNKNOWN_AIRCRAFT)) {
if (VideoFeeder.getInstance().getVideoFeeds() != null
&& VideoFeeder.getInstance().getVideoFeeds().size() > 0) {
VideoFeeder.getInstance().getVideoFeeds().get(0).setCallback(mReceivedVideoDataCallBack);
}
}
}
}
开发者ID:lupwei,项目名称:Croprotector,代码行数:19,代码来源:UAVControllerActivity.java
示例2: initFlightController
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
private void initFlightController() {
BaseProduct product = DJIDemoApplication.getProductInstance();
if (product != null && product.isConnected()) {
if (product instanceof Aircraft) {
mFlightController = ((Aircraft) product).getFlightController();
}
}
if (mFlightController != null) {
mFlightController.setStateCallback(
new FlightControllerState.Callback() {
@Override
public void onUpdate(FlightControllerState
djiFlightControllerCurrentState) {
droneLocationLat = djiFlightControllerCurrentState.getAircraftLocation().getLatitude();
droneLocationLng = djiFlightControllerCurrentState.getAircraftLocation().getLongitude();
updateDroneLocation();
}
});
}
}
开发者ID:lupwei,项目名称:Croprotector,代码行数:25,代码来源:WayPointActivity.java
示例3: refreshSDKRelativeUI
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
private void refreshSDKRelativeUI() {
BaseProduct mProduct = FPVDemoApplication.getProductInstance();
if (null != mProduct && mProduct.isConnected()) {
Log.v(TAG, "refreshSDK: True");
mBtnOpen.setEnabled(true);
String str = mProduct instanceof Aircraft ? "DJIAircraft" : "DJIHandHeld";
//mTextConnectionStatus.setText("Status: " + str + " connected");
//mProduct.setDJIVersionCallback(this);
if (null != mProduct.getModel()) {
mTextProduct.setText("" + mProduct.getModel().getDisplayName());
} else {
mTextProduct.setText(R.string.product_information);
}
} else {
Log.v(TAG, "refreshSDK: False");
mBtnOpen.setEnabled(false);
mTextProduct.setText(R.string.product_information);
//mTextConnectionStatus.setText(R.string.connection_loose);
}
}
开发者ID:lupwei,项目名称:Croprotector,代码行数:21,代码来源:UAV_fragment.java
示例4: updateTitleBar
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
private void updateTitleBar() {
if(mConnectStatusTextView == null) return;
boolean ret = false;
BaseProduct product = DJIDemoApplication.getProductInstance();
if (product != null) {
if(product.isConnected()) {
mConnectStatusTextView.setText(DJIDemoApplication.getProductInstance().getModel().getDisplayName() + " Connected");
ret = true;
} else {
if(product instanceof Aircraft) {
Aircraft aircraft = (Aircraft)product;
if(aircraft.getRemoteController() != null) {
}
if(aircraft.getRemoteController() != null && aircraft.getRemoteController().isConnected()) {
mConnectStatusTextView.setText("only RC Connected");
ret = true;
}
}
}
}
if(!ret) {
// mConnectStatusTextView.setText("Disconnected");
}
}
开发者ID:DJI-Mobile-SDK-Tutorials,项目名称:Android-Phantom4Missions,代码行数:26,代码来源:DemoBaseActivity.java
示例5: updateVersion
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
private void updateVersion() {
BaseProduct product = DJISDKManager.getInstance().getProduct();
if(product != null) {
version = product.getFirmwarePackageVersion();
}
if(version == null) {
version = "N/A";
}
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
mFirmwareVersionView.setText("Firmware version: " + version);
}
});
}
开发者ID:DJI-Mobile-SDK-Tutorials,项目名称:Android-Phantom4Missions,代码行数:19,代码来源:MainActivity.java
示例6: refreshSDKRelativeUI
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
private void refreshSDKRelativeUI() {
BaseProduct mProduct = DJIDemoApplication.getProductInstance();
if (null != mProduct && mProduct.isConnected()) {
Log.v(TAG, "refreshSDK: True");
mBtnOpen.setEnabled(true);
String str = mProduct instanceof Aircraft ? "DJIAircraft" : "DJIHandHeld";
mTextConnectionStatus.setText("Status: " + str + " connected");
if (null != mProduct.getModel()) {
mTextProduct.setText("" + mProduct.getModel().getDisplayName());
} else {
mTextProduct.setText(R.string.product_information);
}
} else {
Log.v(TAG, "refreshSDK: False");
mBtnOpen.setEnabled(false);
mTextProduct.setText(R.string.product_information);
mTextConnectionStatus.setText(R.string.connection_loose);
}
}
开发者ID:DJI-Mobile-SDK-Tutorials,项目名称:Android-GSDemo-GoogleMap,代码行数:25,代码来源:ConnectionActivity.java
示例7: initFlightController
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
private void initFlightController() {
BaseProduct product = DJIDemoApplication.getProductInstance();
if (product != null && product.isConnected()) {
if (product instanceof Aircraft) {
mFlightController = ((Aircraft) product).getFlightController();
}
}
if (mFlightController != null) {
mFlightController.setStateCallback(new FlightControllerState.Callback() {
@Override
public void onUpdate(FlightControllerState djiFlightControllerCurrentState) {
droneLocationLat = djiFlightControllerCurrentState.getAircraftLocation().getLatitude();
droneLocationLng = djiFlightControllerCurrentState.getAircraftLocation().getLongitude();
updateDroneLocation();
}
});
}
}
开发者ID:DJI-Mobile-SDK-Tutorials,项目名称:Android-GSDemo-GoogleMap,代码行数:22,代码来源:MainActivity.java
示例8: refreshSDKRelativeUI
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
private void refreshSDKRelativeUI() {
BaseProduct mProduct = FPVDemoApplication.getProductInstance();
if (null != mProduct && mProduct.isConnected()) {
Log.v(TAG, "refreshSDK: True");
mBtnOpen.setEnabled(true);
String str = mProduct instanceof Aircraft ? "DJIAircraft" : "DJIHandHeld";
mTextConnectionStatus.setText("Status: " + str + " connected");
if (null != mProduct.getModel()) {
mTextProduct.setText("" + mProduct.getModel().getDisplayName());
} else {
mTextProduct.setText(R.string.product_information);
}
} else {
Log.v(TAG, "refreshSDK: False");
mBtnOpen.setEnabled(false);
mTextProduct.setText(R.string.product_information);
mTextConnectionStatus.setText(R.string.connection_loose);
}
}
开发者ID:DJI-Mobile-SDK-Tutorials,项目名称:Android-FPVDemo,代码行数:27,代码来源:ConnectionActivity.java
示例9: onProductChange
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
@Override
public void onProductChange(BaseProduct oldProduct, BaseProduct newProduct) {
mProduct = newProduct;
if(mProduct != null) {
mProduct.setBaseProductListener(mDJIBaseProductListener);
}
notifyStatusChange();
}
开发者ID:lupwei,项目名称:Croprotector,代码行数:9,代码来源:MainActivity.java
示例10: onComponentChange
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
@Override
public void onComponentChange(BaseProduct.ComponentKey key, BaseComponent oldComponent, BaseComponent newComponent) {
if(newComponent != null) {
newComponent.setComponentListener(mDJIComponentListener);
}
notifyStatusChange();
}
开发者ID:lupwei,项目名称:Croprotector,代码行数:8,代码来源:MainActivity.java
示例11: getProductInstance
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
/**
* This function is used to get the instance of DJIBaseProduct.
* If no product is connected, it returns null.
*/
public static synchronized BaseProduct getProductInstance() {
if (null == mProduct) {
mProduct = DJISDKManager.getInstance().getProduct();
}
return mProduct;
}
开发者ID:lupwei,项目名称:Croprotector,代码行数:11,代码来源:FPVDemoApplication.java
示例12: onProductChange
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
@Override
public void onProductChange(BaseProduct oldProduct, BaseProduct newProduct) {
mProduct = newProduct;
if(mProduct != null) {
mProduct.setBaseProductListener(mDJIBaseProductListener);
}
notifyStatusChange();
}
开发者ID:lupwei,项目名称:Croprotector,代码行数:11,代码来源:FPVDemoApplication.java
示例13: onComponentChange
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
@Override
public void onComponentChange(BaseProduct.ComponentKey key, BaseComponent oldComponent, BaseComponent newComponent) {
if(newComponent != null) {
newComponent.setComponentListener(mDJIComponentListener);
}
notifyStatusChange();
}
开发者ID:lupwei,项目名称:Croprotector,代码行数:9,代码来源:FPVDemoApplication.java
示例14: startSDKRegistration
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
private void startSDKRegistration() {
if (isRegistrationInProgress.compareAndSet(false, true)) {
AsyncTask.execute(new Runnable() {
@Override
public void run() {
showToast( "registering, pls wait...");
DJISDKManager.getInstance().registerApp(getApplicationContext(), new DJISDKManager.SDKManagerCallback() {
@Override
public void onRegister(DJIError djiError) {
if (djiError == DJISDKError.REGISTRATION_SUCCESS) {
DJILog.e("App registration", DJISDKError.REGISTRATION_SUCCESS.getDescription());
DJISDKManager.getInstance().startConnectionToProduct();
showToast("Register Success");
} else {
showToast( "Register sdk fails, check network is available");
}
Log.v(TAG, djiError.getDescription());
}
@Override
public void onProductChange(BaseProduct oldProduct, BaseProduct newProduct) {
Log.d(TAG, String.format("onProductChanged oldProduct:%s, newProduct:%s", oldProduct, newProduct));
}
});
}
});
}
}
开发者ID:DJI-Mobile-SDK-Tutorials,项目名称:Android-Phantom4Missions,代码行数:29,代码来源:MainActivity.java
示例15: startSDKRegistration
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
private void startSDKRegistration() {
if (isRegistrationInProgress.compareAndSet(false, true)) {
AsyncTask.execute(new Runnable() {
@Override
public void run() {
showToast("registering, pls wait...");
DJISDKManager.getInstance().registerApp(MainActivity.this.getApplicationContext(), new DJISDKManager.SDKManagerCallback() {
@Override
public void onRegister(DJIError djiError) {
if (djiError == DJISDKError.REGISTRATION_SUCCESS) {
showToast("Register Success");
DJISDKManager.getInstance().startConnectionToProduct();
} else {
showToast("Register sdk fails, please check the bundle id and network connection!");
}
Log.v(TAG, djiError.getDescription());
}
@Override
public void onProductChange(BaseProduct oldProduct, BaseProduct newProduct) {
mProduct = newProduct;
if(mProduct != null) {
mProduct.setBaseProductListener(mDJIBaseProductListener);
}
notifyStatusChange();
}
});
}
});
}
}
开发者ID:DJI-Mobile-SDK-Tutorials,项目名称:Android-ImportAndActivateSDKInAndroidStudio,代码行数:34,代码来源:MainActivity.java
示例16: initPreviewer
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
private void initPreviewer() {
BaseProduct product = FPVDemoApplication.getProductInstance();
if (product == null || !product.isConnected()) {
showToast(getString(R.string.disconnected));
} else {
if (null != mVideoSurface) {
mVideoSurface.setSurfaceTextureListener(this);
}
if (!product.getModel().equals(Model.UNKNOWN_AIRCRAFT)) {
VideoFeeder.getInstance().getPrimaryVideoFeed().setCallback(mReceivedVideoDataCallBack);
}
}
}
开发者ID:DJI-Mobile-SDK-Tutorials,项目名称:Android-FPVDemo,代码行数:16,代码来源:MainActivity.java
示例17: getProductInstance
import dji.sdk.base.BaseProduct; //导入依赖的package包/类
public static synchronized BaseProduct getProductInstance() {
if (null == mProduct) {
mProduct = DJISDKManager.getInstance().getProduct();
}
return mProduct;
}
开发者ID:lupwei,项目名称:Croprotector,代码行数:7,代码来源:DJIDemoApplication.java
注:本文中的dji.sdk.base.BaseProduct类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论