本文整理汇总了Java中com.o3dr.services.android.lib.drone.connection.StreamRates类的典型用法代码示例。如果您正苦于以下问题:Java StreamRates类的具体用法?Java StreamRates怎么用?Java StreamRates使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StreamRates类属于com.o3dr.services.android.lib.drone.connection包,在下文中一共展示了StreamRates类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setConnectionParameter
import com.o3dr.services.android.lib.drone.connection.StreamRates; //导入依赖的package包/类
public void setConnectionParameter(ConnectionParameter connParams) {
this.connectionParams = connParams;
if (connParams != null) {
StreamRates connRates = connParams.getStreamRates();
Rates droneRates = new Rates();
droneRates.extendedStatus = connRates.getExtendedStatus();
droneRates.extra1 = connRates.getExtra1();
droneRates.extra2 = connRates.getExtra2();
droneRates.extra3 = connRates.getExtra3();
droneRates.position = connRates.getPosition();
droneRates.rcChannels = connRates.getRcChannels();
droneRates.rawSensors = connRates.getRawSensors();
droneRates.rawController = connRates.getRawController();
drone.getStreamRates().setRates(droneRates);
}
((MAVLinkClient) drone.getMavClient()).setConnectionParameter(connParams);
}
示例2: getStreamRates
import com.o3dr.services.android.lib.drone.connection.StreamRates; //导入依赖的package包/类
public StreamRates getStreamRates() {
StreamRates rates = new StreamRates();
rates.setExtendedStatus(Integer.parseInt(prefs.getString(
"pref_mavlink_stream_rate_ext_stat", "2")));
rates.setExtra1(Integer.parseInt(prefs.getString("pref_mavlink_stream_rate_extra1", "2")));
rates.setExtra2(Integer.parseInt(prefs.getString("pref_mavlink_stream_rate_extra2", "2")));
rates.setExtra3(Integer.parseInt(prefs.getString("pref_mavlink_stream_rate_extra3", "2")));
rates.setPosition(Integer.parseInt(prefs.getString("pref_mavlink_stream_rate_position",
"2")));
rates.setRcChannels(Integer.parseInt(prefs.getString("pref_mavlink_stream_rate_rc_channels",
"2")));
rates.setRawSensors(Integer.parseInt(prefs.getString("pref_mavlink_stream_rate_raw_sensors",
"2")));
rates.setRawController(Integer.parseInt(prefs.getString(
"pref_mavlink_stream_rate_raw_controller", "2")));
return rates;
}