最新版

This commit is contained in:
cuijingzhou 2025-11-12 09:23:40 +08:00
parent d6e90f8384
commit 0c4a765709
69 changed files with 3626 additions and 2024 deletions

View File

@ -71,6 +71,8 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.squareup.okio:okio:3.2.0'
implementation 'com.google.code.gson:gson:2.10.1'

View File

@ -8,7 +8,8 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 允许获取wifi网络信息用于网络定位若无gps但仍需实现定位小蓝点功能则此权限必选 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 允许获取wifi状态改变用于网络定位若无gps但仍需实现定位小蓝点功能则此权限必选 -->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 允许写设备缓存,用于问题排查 -->
<uses-permission android:name="android.permission.WRITE_SETTINGS" /> <!-- 高精度定位 -->
<uses-permission android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" /><!-- 高精度定位 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
@ -57,6 +58,7 @@
<activity
android:name=".Main.Activity.MainActivity"
android:exported="true"
android:hardwareAccelerated="true"
android:screenOrientation="landscape" />
<service android:name=".Main.Service.MyBoundService" />

View File

@ -98,12 +98,7 @@ public class LoginActivity extends AppCompatActivity {
}
});
// allView.rb_bt1.setOnClickListener(v -> {
// type = 0;
// });
// allView.rb_bt2.setOnClickListener(v -> {
// type = 1;
// });
}
@ -114,4 +109,6 @@ public class LoginActivity extends AppCompatActivity {
}
}

View File

@ -0,0 +1,63 @@
package com.example.longyi_groundstation.Login.Void;
import static androidx.core.content.ContextCompat.startActivity;
import static com.example.longyi_groundstation.Util.Http.HttpUrl.LOGIN;
import android.app.Activity;
import android.content.Intent;
import android.widget.EditText;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.example.longyi_groundstation.Funcation.Activity.FuncationActivity;
import com.example.longyi_groundstation.Util.Http.HttpUtil;
import com.example.longyi_groundstation.Util.SharedPreferencesTool;
import org.json.JSONObject;
import java.io.IOException;
import okhttp3.Call;
import okhttp3.Response;
public class UrlVoid {
public static HttpUtil httpUtil = new HttpUtil();
private void Login(Activity activity, EditText et_username, EditText et_password) {
httpUtil.postForm(
LOGIN,
"mobile=" + et_username.getText().toString() +
"&password=" + et_password.getText().toString(),
null, new okhttp3.Callback() {
@Override
public void onFailure(@NonNull Call call, @NonNull IOException e) {
}
@Override
public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
try {
String json = response.body().string();
JSONObject jsonObject = new JSONObject(json);
if (jsonObject.getInt("code") == 1) {
SharedPreferencesTool.saveLogin(activity, jsonObject.getJSONObject("data"));
activity.startActivity(new Intent(activity, FuncationActivity.class));
activity.finish();
} else {
Toast.makeText(activity, "账号密码错误", Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
Toast.makeText(activity, "网络解析错误", Toast.LENGTH_SHORT).show();
}
}
});
}
});
}
}

View File

@ -30,6 +30,7 @@ public class AllLinkAdapter extends RecyclerView.Adapter<AllLinkAdapter.AllLinkV
private List<SQLClass.LinkListInfo> linkListInfoList;
private SQLClass sqlClass;
private OnItemClickListener onItemClickListener;
private OnItemEditClickListener onItemEditClickListener;
public AllLinkAdapter(Context context, List<SQLClass.LinkListInfo> linkListInfoList, SQLClass sqlClass) {
this.context = context;
@ -73,6 +74,14 @@ public class AllLinkAdapter extends RecyclerView.Adapter<AllLinkAdapter.AllLinkV
List<SQLClass.LinkListInfo> updatedList = sqlClass.getAllLinkListInfo();
updateDataList(updatedList);
});
// 点击编辑按钮
holder.tv_edit.setOnClickListener(v -> {
if (onItemEditClickListener != null) {
setSelects(position);
onItemEditClickListener.onItemEditClick(linkListInfo.getListId(), position);
}
});
// 设置整个item的点击事件
holder.itemView.setOnClickListener(v -> {
@ -99,6 +108,16 @@ public class AllLinkAdapter extends RecyclerView.Adapter<AllLinkAdapter.AllLinkV
notifyDataSetChanged();
}
public int getSelectLinkListInfo() {
int selectPosition = -1;
for (int i = 0; i < linkListInfoList.size(); i++) {
if (linkListInfoList.get(i).isSelect()){
selectPosition = linkListInfoList.get(i).getListId();
}
}
return selectPosition;
}
@Override
public int getItemCount() {
return linkListInfoList != null ? linkListInfoList.size() : 0;
@ -149,6 +168,13 @@ public class AllLinkAdapter extends RecyclerView.Adapter<AllLinkAdapter.AllLinkV
public void setOnItemClickListener(OnItemClickListener listener) {
this.onItemClickListener = listener;
}
/**
* 设置item点击监听器
* @param listener 监听器
*/
public void setOnItemEditClickListener(OnItemEditClickListener listener) {
this.onItemEditClickListener = listener;
}
static class AllLinkViewHolder extends RecyclerView.ViewHolder {
LinearLayout ll_main;
@ -156,6 +182,7 @@ public class AllLinkAdapter extends RecyclerView.Adapter<AllLinkAdapter.AllLinkV
TextView tv_time;
TextView tv_number;
TextView tv_del;
TextView tv_edit;
public AllLinkViewHolder(@NonNull View itemView) {
super(itemView);
@ -164,6 +191,7 @@ public class AllLinkAdapter extends RecyclerView.Adapter<AllLinkAdapter.AllLinkV
tv_number = itemView.findViewById(R.id.tv_number);
tv_del = itemView.findViewById(R.id.tv_del);
ll_main = itemView.findViewById(R.id.ll_main);
tv_edit = itemView.findViewById(R.id.tv_edit);
}
}
@ -173,4 +201,11 @@ public class AllLinkAdapter extends RecyclerView.Adapter<AllLinkAdapter.AllLinkV
public interface OnItemClickListener {
void onItemClick(int listId, int position);
}
/**
* Item点击监听器接口
*/
public interface OnItemEditClickListener {
void onItemEditClick(int listId, int position);
}
}

View File

@ -2,18 +2,15 @@
package com.example.longyi_groundstation.Main.Adapter;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.NonNull;
@ -65,7 +62,333 @@ public class CreateLinkAdapter extends RecyclerView.Adapter<CreateLinkAdapter.Vi
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
CreateLink createLink = createLinkList.get(position);
holder.bind(createLink, position);
holder.etHeight.setText(String.valueOf((int) createLink.getHeight()));
holder.tv_title.setText(createLink.getName());
// 修改为保留7位小数
holder.et_lat.setText(String.format("%.7f", createLink.getLatLng().latitude));
holder.et_lon.setText(String.format("%.7f", createLink.getLatLng().longitude));
// // 为Spinner设置选择监听器
// linkAdapter.se(new AdapterView.OnItemSelectedListener() {
// @Override
// public void onItemSelected(AdapterView<?> parent, View view, int positions, long id) {
// Log.d("onItemSelected", positions+"");
// holder.tv_turn.setText(parent.getItemAtPosition(positions).toString());
// if (positions == 0) {
// holder.et_turn_time.setText("0");
// createLinkList.get(position).setStop_time(0);
// notifyDataSetChanged();
// } else {
// holder.et_turn_time.setText("1");
// createLinkList.get(position).setStop_time(1);
// }
// }
//
// @Override
// public void onNothingSelected(AdapterView<?> parent) {
// // 什么都不做
// Log.d("onItemSelected", "11");
// }
// });
holder.et_turn_time.setText(createLink.getStop_time() + "");
holder.et_speed.setText(createLink.getSpeed() + "");
//投弹是否显示
if (createLink.isBom1_show()) {
holder.ll_bom_layout1.setVisibility(View.VISIBLE);
} else {
holder.ll_bom_layout1.setVisibility(View.GONE);
}
if (createLink.isBom2_show()) {
holder.ll_bom_layout2.setVisibility(View.VISIBLE);
} else {
holder.ll_bom_layout2.setVisibility(View.GONE);
}
//投弹高度
holder.et_bom1.setText(createLink.getBom1_height() + "");
holder.et_bom2.setText(createLink.getBom2_height() + "");
if (!createLink.isBom1_show() && !createLink.isBom2_show()) {
holder.tv_null_data.setVisibility(View.VISIBLE);
} else {
holder.tv_null_data.setVisibility(View.GONE);
}
if (createLink.isBom1_select()) {
holder.tv_bom_text1.setBackgroundResource(R.drawable.ff029a45_4round_1stroke_bg);
holder.iv_bom1.setImageResource(R.mipmap.icon_select_link_yes);
// ll_bom_height_layout1.setVisibility(View.VISIBLE);
} else {
holder.tv_bom_text1.setBackgroundResource(R.drawable.b2101010_4round_1stroke_bg);
holder.iv_bom1.setImageResource(R.mipmap.icon_select_link_no);
// ll_bom_height_layout1.setVisibility(View.INVISIBLE);
}
if (createLink.isBom2_select()) {
holder.tv_bom_text2.setBackgroundResource(R.drawable.ff029a45_4round_1stroke_bg);
holder.iv_bom2.setImageResource(R.mipmap.icon_select_link_yes);
// ll_bom_height_layout2.setVisibility(View.VISIBLE);
} else {
holder.tv_bom_text2.setBackgroundResource(R.drawable.b2101010_4round_1stroke_bg);
holder.iv_bom2.setImageResource(R.mipmap.icon_select_link_no);
// ll_bom_height_layout2.setVisibility(View.INVISIBLE);
}
holder.tvDel.setOnClickListener(v -> {
if (onItemClickListener != null) {
onItemClickListener.onDeleteClick(position);
}
});
// 为停留时间输入框添加实时监听事件
holder.et_turn_time.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
try {
if (s.length() > 0){
createLinkList.get(position).setStop_time(Integer.parseInt(s.toString()));
}else {
createLinkList.get(position).setStop_time(0);
}
}catch (Exception e){
Log.d("不用理会", "afterTextChanged: ");
}
}
});
// 为停留时间输入框添加实时监听事件
holder.etHeight.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
try {
if (s.length() > 0){
createLinkList.get(position).setHeight(Integer.parseInt(s.toString()));
}else {
createLinkList.get(position).setHeight(0);
}
}catch (Exception e){
Log.d("不用理会", "afterTextChanged: ");
}
}
});
// 为停留时间输入框添加实时监听事件
holder.et_lat.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
try {
if (s.length() > 0){
Log.d("afterTextChanged", "afterTextChanged: "+s);
// 更新CreateLink中的LatLng对象
double newLat = Double.parseDouble(s.toString());
double newLng = createLinkList.get(position).getLatLng().longitude;
createLinkList.get(position).setLatLng(new com.amap.api.maps.model.LatLng(newLat, newLng));
}else {
createLinkList.get(position).setLatLng(new com.amap.api.maps.model.LatLng(0, createLinkList.get(position).getLatLng().longitude));
}
} catch (Exception e){
Log.d("不用理会", "afterTextChanged: ");
}
}
});
// 为停留时间输入框添加实时监听事件
holder.et_lon.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
try {
if (s.length() > 0){
Log.d("afterTextChanged", "afterTextChanged: "+s);
// 更新CreateLink中的LatLng对象
double newLng = Double.parseDouble(s.toString());
double newLat = createLinkList.get(position).getLatLng().latitude;
createLinkList.get(position).setLatLng(new com.amap.api.maps.model.LatLng(newLat, newLng));
}else {
createLinkList.get(position).setLatLng(new com.amap.api.maps.model.LatLng(createLinkList.get(position).getLatLng().latitude, 0));
}
}catch (Exception e){
Log.d("不用理会", "afterTextChanged: ");
}
}
});
// 为停留时间输入框添加实时监听事件
holder.et_speed.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
try{
if (s.length() > 0){
createLinkList.get(position).setSpeed(Double.parseDouble(s.toString()));
}else {
createLinkList.get(position).setSpeed(0);
}
}catch (Exception e){
Log.d("不用理会", "afterTextChanged: ");
}
}
});
//展开
holder.tv_expand.setOnClickListener(v -> {
if (holder.ll_expand.getVisibility() == View.VISIBLE) {
holder.ll_expand.setVisibility(View.GONE);
holder.tv_expand.setText("展开");
} else {
holder.ll_expand.setVisibility(View.VISIBLE);
holder.tv_expand.setText("收起");
}
});
//投弹选中1
holder.ll_bom_layout1.setOnClickListener(v -> {
if (createLinkList.get(position).isBom1_select()) {
// 取消选中状态
holder.tv_bom_text1.setBackgroundResource(R.drawable.b2101010_4round_1stroke_bg);
holder.iv_bom1.setImageResource(R.mipmap.icon_select_link_no);
} else {
// 设置当前项为选中状态
holder.tv_bom_text1.setBackgroundResource(R.drawable.ff029a45_4round_1stroke_bg);
holder.iv_bom1.setImageResource(R.mipmap.icon_select_link_yes);
}
// 选中状态 - 先取消其他所有项的选中状态
clearAllSelectionsExcept(position, 1); // 1表示bom1
});
//投弹选中2
holder.ll_bom_layout2.setOnClickListener(v -> {
if (createLinkList.get(position).isBom2_select()) {
// 取消选中状态
holder.tv_bom_text2.setBackgroundResource(R.drawable.b2101010_4round_1stroke_bg);
holder.iv_bom2.setImageResource(R.mipmap.icon_select_link_no);
} else {
// 设置当前项为选中状态
holder.tv_bom_text2.setBackgroundResource(R.drawable.ff029a45_4round_1stroke_bg);
holder.iv_bom2.setImageResource(R.mipmap.icon_select_link_yes);
}
// 选中状态 - 先取消其他所有项的选中状态
clearAllSelectionsExcept(position, 2); // 2表示bom2
});
}
/**
* 清除除指定位置和类型外的所有显示状态
*
* @param currentPosition 当前项的位置
* @param type 1表示bom12表示bom2
*/
private void clearAllSelectionsExcept(int currentPosition, int type) {
// bom1
if (type == 1) {
//如果当前项是选中状态则取消所有bom1的选中状态并显示出来
if (createLinkList.get(currentPosition).isBom1_select()) {
for (int i = 0; i < createLinkList.size(); i++) {
CreateLink link = createLinkList.get(i);
link.setBom1_show(true);
link.setBom1_select(false);
}
isExpand.set(0, true);
}
//如果当前项不是选中状态则取消除了当前项其它所有bom1的选中状态并隐藏
else {
for (int i = 0; i < createLinkList.size(); i++) {
CreateLink link = createLinkList.get(i);
if (i == currentPosition) {
link.setBom1_show(true);
link.setBom1_select(true);
} else {
link.setBom1_show(false);
link.setBom1_select(false);
}
}
isExpand.set(0, false);
}
}
//bom2
else {
if (createLinkList.get(currentPosition).isBom2_select()) {
for (int i = 0; i < createLinkList.size(); i++) {
CreateLink link = createLinkList.get(i);
link.setBom2_show(true);
link.setBom2_select(false);
}
isExpand.set(1, true);
}
//如果当前项不是选中状态则取消除了当前项其它所有bom2的选中状态并隐藏
else {
for (int i = 0; i < createLinkList.size(); i++) {
CreateLink link = createLinkList.get(i);
if (i == currentPosition) {
link.setBom2_show(true);
link.setBom2_select(true);
} else {
link.setBom2_show(false);
link.setBom2_select(false);
}
}
isExpand.set(1, false);
}
}
notifyDataSetChanged();
}
@Override
@ -73,14 +396,13 @@ public class CreateLinkAdapter extends RecyclerView.Adapter<CreateLinkAdapter.Vi
return createLinkList.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private LinearLayout ll_item;
private LinearLayout ll_expand;
private TextView tvDel, tv_title;
private EditText etHeight, et_lat, et_lon;
private RelativeLayout rl_turn;
private TextView tv_turn;
private Spinner sp_turn;
private TextView tv_expand;
private LinearLayout ll_bom_layout1, ll_bom_layout2;
private TextView tv_bom_text1, tv_bom_text2;
@ -88,6 +410,7 @@ public class CreateLinkAdapter extends RecyclerView.Adapter<CreateLinkAdapter.Vi
private EditText et_bom1, et_bom2;
private LinearLayout ll_turn;
private EditText et_turn_time;
private EditText et_speed;
private TextView tv_null_data;
// private LinearLayout ll_bom_height_layout1, ll_bom_height_layout2;
@ -100,9 +423,6 @@ public class CreateLinkAdapter extends RecyclerView.Adapter<CreateLinkAdapter.Vi
etHeight = itemView.findViewById(R.id.et_height);
et_lat = itemView.findViewById(R.id.et_lat);
et_lon = itemView.findViewById(R.id.et_lon);
rl_turn = itemView.findViewById(R.id.rl_turn);
tv_turn = itemView.findViewById(R.id.tv_turn);
sp_turn = itemView.findViewById(R.id.sp_turn);
ll_expand = itemView.findViewById(R.id.ll_expand);
tv_expand = itemView.findViewById(R.id.tv_expand);
ll_bom_layout1 = itemView.findViewById(R.id.ll_bom_layout1);
@ -113,6 +433,7 @@ public class CreateLinkAdapter extends RecyclerView.Adapter<CreateLinkAdapter.Vi
tv_bom_text2 = itemView.findViewById(R.id.tv_bom_text2);
iv_bom2 = itemView.findViewById(R.id.iv_bom2);
et_bom2 = itemView.findViewById(R.id.et_bom2);
et_speed = itemView.findViewById(R.id.et_speed);
ll_turn = itemView.findViewById(R.id.ll_turn);
et_turn_time = itemView.findViewById(R.id.et_turn_time);
tv_null_data = itemView.findViewById(R.id.tv_null_data);
@ -120,224 +441,8 @@ public class CreateLinkAdapter extends RecyclerView.Adapter<CreateLinkAdapter.Vi
// ll_bom_height_layout2 = itemView.findViewById(R.id.ll_bom_height_layout2);
}
public void bind(CreateLink createLink, int position) {
etHeight.setText(String.valueOf((int) createLink.getHeight()));
tv_title.setText(createLink.getName());
// 修改为保留7位小数
et_lat.setText(String.format("%.7f", createLink.getLatLng().latitude));
et_lon.setText(String.format("%.7f", createLink.getLatLng().longitude));
// 链路保护动作Spinner
String[] linkOptions = {"协调转弯", "到点转弯"};
ArrayAdapter<String> linkAdapter = new ArrayAdapter<>(content,
android.R.layout.simple_spinner_item, linkOptions);
linkAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sp_turn.setAdapter(linkAdapter);
//投弹是否显示
if (createLink.isBom1_show()){
ll_bom_layout1.setVisibility(View.VISIBLE);
}else {
ll_bom_layout1.setVisibility(View.GONE);
}
if (createLink.isBom2_show()){
ll_bom_layout2.setVisibility(View.VISIBLE);
}else {
ll_bom_layout2.setVisibility(View.GONE);
}
//投弹高度
et_bom1.setText(createLink.getBom1_height() + "");
et_bom2.setText(createLink.getBom2_height() + "");
if (!createLink.isBom1_show() && !createLink.isBom2_show()){
tv_null_data.setVisibility(View.VISIBLE);
}else {
tv_null_data.setVisibility(View.GONE);
}
if (createLink.isBom1_select()) {
tv_bom_text1.setBackgroundResource(R.drawable.ff029a45_2round_1stroke_bg);
iv_bom1.setImageResource(R.mipmap.icon_select_link_yes);
// ll_bom_height_layout1.setVisibility(View.VISIBLE);
} else {
tv_bom_text1.setBackgroundResource(R.drawable.b2101010_4round_1stroke_bg);
iv_bom1.setImageResource(R.mipmap.icon_select_link_no);
// ll_bom_height_layout1.setVisibility(View.INVISIBLE);
}
if (createLink.isBom2_select()) {
tv_bom_text2.setBackgroundResource(R.drawable.ff029a45_2round_1stroke_bg);
iv_bom2.setImageResource(R.mipmap.icon_select_link_yes);
// ll_bom_height_layout2.setVisibility(View.VISIBLE);
} else {
tv_bom_text2.setBackgroundResource(R.drawable.b2101010_4round_1stroke_bg);
iv_bom2.setImageResource(R.mipmap.icon_select_link_no);
// ll_bom_height_layout2.setVisibility(View.INVISIBLE);
}
tvDel.setOnClickListener(v -> {
if (onItemClickListener != null) {
onItemClickListener.onDeleteClick(position);
}
});
// 可以添加文本变化监听器来更新数据
etHeight.setOnFocusChangeListener((v, hasFocus) -> {
if (!hasFocus) {
try {
createLink.setHeight(Double.parseDouble(etHeight.getText().toString()));
} catch (NumberFormatException e) {
etHeight.setText(String.valueOf((int) createLink.getHeight()));
}
}
});
// 为Spinner设置选择监听器
sp_turn.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
tv_turn.setText(parent.getItemAtPosition(position).toString());
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
// 什么都不做
}
});
rl_turn.setOnClickListener(v -> {
showCustomDropdown(rl_turn, tv_turn,ll_turn);
});
//长按弹出窗口
tv_expand.setOnClickListener(v -> {
if (ll_expand.getVisibility() == View.VISIBLE) {
ll_expand.setVisibility(View.GONE);
tv_expand.setText("展开");
} else {
ll_expand.setVisibility(View.VISIBLE);
tv_expand.setText("收起");
}
});
//投弹选中1
ll_bom_layout1.setOnClickListener(v -> {
if (createLink.isBom1_select()) {
// 取消选中状态
tv_bom_text1.setBackgroundResource(R.drawable.b2101010_4round_1stroke_bg);
iv_bom1.setImageResource(R.mipmap.icon_select_link_no);
} else {
// 设置当前项为选中状态
tv_bom_text1.setBackgroundResource(R.drawable.ff029a45_2round_1stroke_bg);
iv_bom1.setImageResource(R.mipmap.icon_select_link_yes);
}
// 选中状态 - 先取消其他所有项的选中状态
clearAllSelectionsExcept(position, 1); // 1表示bom1
});
//投弹选中2
ll_bom_layout2.setOnClickListener(v -> {
if (createLink.isBom2_select()) {
// 取消选中状态
tv_bom_text2.setBackgroundResource(R.drawable.b2101010_4round_1stroke_bg);
iv_bom2.setImageResource(R.mipmap.icon_select_link_no);
} else {
// 设置当前项为选中状态
tv_bom_text2.setBackgroundResource(R.drawable.ff029a45_2round_1stroke_bg);
iv_bom2.setImageResource(R.mipmap.icon_select_link_yes);
}
// 选中状态 - 先取消其他所有项的选中状态
clearAllSelectionsExcept(position, 2); // 2表示bom2
});
}
/**
* 清除除指定位置和类型外的所有显示状态
* @param currentPosition 当前项的位置
* @param type 1表示bom12表示bom2
*/
private void clearAllSelectionsExcept(int currentPosition, int type) {
// bom1
if (type == 1){
//如果当前项是选中状态则取消所有bom1的选中状态并显示出来
if (createLinkList.get(currentPosition).isBom1_select()){
for (int i = 0; i < createLinkList.size(); i++) {
CreateLink link = createLinkList.get(i);
link.setBom1_show(true);
link.setBom1_select(false);
}
isExpand.set(0,true);
}
//如果当前项不是选中状态则取消除了当前项其它所有bom1的选中状态并隐藏
else {
for (int i = 0; i < createLinkList.size(); i++) {
CreateLink link = createLinkList.get(i);
if (i == currentPosition){
link.setBom1_show(true);
link.setBom1_select(true);
}else {
link.setBom1_show(false);
link.setBom1_select(false);
}
}
isExpand.set(0,false);
}
}
//bom2
else {
if (createLinkList.get(currentPosition).isBom2_select()){
for (int i = 0; i < createLinkList.size(); i++) {
CreateLink link = createLinkList.get(i);
link.setBom2_show(true);
link.setBom2_select(false);
}
isExpand.set(1,true);
}
//如果当前项不是选中状态则取消除了当前项其它所有bom2的选中状态并隐藏
else {
for ( int i = 0; i < createLinkList.size(); i++) {
CreateLink link = createLinkList.get(i);
if (i == currentPosition){
link.setBom2_show(true);
link.setBom2_select(true);
}else {
link.setBom2_show(false);
link.setBom2_select(false);
}
}
isExpand.set(1,false);
}
}
notifyDataSetChanged();
}
}
//转弯方式选择弹窗
private void showCustomDropdown(RelativeLayout anchor, TextView tv_turn,LinearLayout ll_turn) {
String[] options = {"协调转弯", "到点转弯"};
AlertDialog.Builder builder = new AlertDialog.Builder(content);
builder.setItems(options, (dialog, which) -> {
tv_turn.setText(options[which]);
if (which == 1){
ll_turn.setVisibility(View.VISIBLE);
}else {
ll_turn.setVisibility(View.GONE);
}
// 更新选中状态
});
builder.show();
}
}

View File

@ -9,6 +9,7 @@ public class CreateLink {
private double speed;//速度
private int waypointIndex;//航点索引
private LatLng latLng;//点经纬度
private int stop_time;//停留时间
private boolean bom1_select;//弹道1选择
private boolean bom1_show;//弹道1是否显示
private int bom1_height;//弹道1投弹高度
@ -18,14 +19,16 @@ public class CreateLink {
public CreateLink(String name, double height, double speed, int waypointIndex, LatLng latLng
,boolean bom1_show,boolean bom2_show) {
,int stop_time,boolean bom1_show,boolean bom2_show) {
this.name = name;
this.height = height;
this.speed = speed;
this.waypointIndex = waypointIndex;
this.latLng = latLng;
this.stop_time = stop_time;
this.bom1_show = bom1_show;
this.bom2_show = bom2_show;
}
public CreateLink(String name, double height, double speed, int waypointIndex, LatLng latLng) {
@ -123,4 +126,12 @@ public class CreateLink {
public void setBom2_show(boolean bom2_show) {
this.bom2_show = bom2_show;
}
public int getStop_time() {
return stop_time;
}
public void setStop_time(int stop_time) {
this.stop_time = stop_time;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -41,6 +41,8 @@ import com.example.longyi_groundstation.MAVLink.common.msg_request_data_stream;
import com.example.longyi_groundstation.Main.Base.MLData;
import com.example.longyi_groundstation.Main.Setting.Base.Param;
import com.example.longyi_groundstation.Main.Void.FlyVoid;
import com.example.longyi_groundstation.Main.Void.HeartbeatManager;
import com.example.longyi_groundstation.Main.Void.LidarDataParser;
import com.example.longyi_groundstation.Main.Void.LogCat.LogUtil;
import com.example.longyi_groundstation.Main.Void.MyTool;
import com.example.longyi_groundstation.Util.BroadcastUtil;
@ -116,14 +118,23 @@ public class MyBoundService extends Service {
private Parser parser = new Parser();
private MAVLinkMessage msgOld = null;
// 在类成员变量区域添加以下两个标志位
private boolean isAttitudeDataRequested = false;
private boolean isParamReadListRequested = false;
// 在成员变量区域添加
private HeartbeatManager heartbeatManager;
private void getData() {
// 启动定时器
paramTimeoutHandler.post(paramTimeoutRunnable);
isRunning = true;
// serialPortFinder = new SerialPortFinder();
//判断打开方式0串口 2UDP
//判断打开方式0串口 1UDP
if (type == 0) {
serialHelper = new SerialHelper("/dev/ttyHS0", 115200) {
// serialHelper = new SerialHelper("/dev/ttyHS0", 57600) {
@Override
protected void onDataReceived(final ComBean comBean) {
// Log.d("cuijingzhou", Tool.bytesToHex(comBean.bRec));
@ -134,10 +145,6 @@ public class MyBoundService extends Service {
};
try {
serialHelper.open();
// 可以在这里添加回复逻辑
requestAttitudeData();
requestParamReadList();
// wordT1();
} catch (IOException e) {
// throw new RuntimeException(e);
Log.d(TAG, e.toString());
@ -148,27 +155,19 @@ public class MyBoundService extends Service {
new Thread(() -> {
try {
serverSocket = new DatagramSocket(Integer.parseInt(serverPort));
// 可以在这里添加回复逻辑
requestAttitudeData();
requestParamReadList();
byte[] buffer = new byte[1024];
byte[] buffer = new byte[512];
while (isRunning) {
try {
DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
serverSocket.receive(packet);
Log.d("cesssss", "接收数据: " + bytesToHex(packet.getData()));
// 获取客户端IP和端口
InetAddress clientAddress = packet.getAddress();
int clientPort = packet.getPort();
// 处理接收到的数据
// String receivedData = MyTool.bytesToHex(packet.getData(), packet.getLength());
// Log.e("cuijingzhou-size", packet.getLength()+"");
String logMsg = "来自 " + clientAddress.getHostAddress() + ":" + clientPort + " 的消息: ";
// Log.e("cuijingzhou-IP:", logMsg);
dataWork(packet.getData(), packet.getLength());
// requestParamRead();
} catch (Exception e) {
Log.e(TAG, "接收数据错误: " + e.getMessage());
@ -186,69 +185,87 @@ public class MyBoundService extends Service {
wordT();
}
/**
* 方法初始化数据请求确保只执行一次
*/
private void requestInitialData() {
// 请求参数列表只执行一次
requestParamReadList();
// 请求姿态数据只执行一次
requestAttitudeData();
}
private LidarDataParser lidarParser = new LidarDataParser();
/**
* 方法连接串口2获取高度或一些其他的硬件设施
*
* @cuijingzhou
*/
private void getDataSerial() {
if (type == 0){
serialHelper2 = new SerialHelper("/dev/ttyHS2", 9600) {
@Override
protected void onDataReceived(final ComBean comBean) {
// Log.d("cuijingzhou", Tool.bytesToHex(comBean.bRec));
// 接收数据
byte[] receivedData = comBean.bRec;
int[] parseSerialData = parseSerialData(receivedData);
// 保存接收到的数据
FlyVoid.parseSerialData = parseSerialData;
Log.d("cuijingzhou_getDataSerial", parseSerialData[0]+"-"+parseSerialData[1]);
// dataWork(receivedData, receivedData.length);
}
};
if (type == 0) {
try {
serialHelper2 = new SerialHelper("/dev/ttyHS2", 9600) {
@Override
protected void onDataReceived(final ComBean comBean) {
// 接收数据
byte[] receivedData = comBean.bRec;
int maxLoop = 100; // 最大解析次数防止耗时过长
// 200Hz以上高频率调用
for (int i = 0; i < receivedData.length && maxLoop > 0; i++) {
lidarParser.parseByte(receivedData[i]);
maxLoop--;
}
}
};
serialHelper2.open();
// wordT1();
} catch (IOException e) {
// throw new RuntimeException(e);
Log.d(TAG, e.toString());
Log.d("getDataSerialE", e.toString());
}
}else {
} else {
new Thread(() -> {
try {
serverSocket2 = new DatagramSocket(13551);
byte[] buffer = new byte[1024];
// 增加缓冲区大小以适应完整数据包
byte[] buffer = new byte[10];
while (isRunning) {
try {
DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
serverSocket2.receive(packet);
// 获取客户端IP和端口
int[] parseSerialData = parseSerialData(packet.getData());
// 保存接收到的数据
FlyVoid.parseSerialData = parseSerialData;
Log.d("cuijingzhou_getDataSerial", parseSerialData[0]+"-"+parseSerialData[1]);
// Log.e("cuijingzhou-IP:", logMsg);
if (packet.getData() != null && packet.getLength() > 0) {
// 使用新方法解析数据
// int maxLoop = 100; // 最大解析次数防止耗时过长
// 200Hz以上高频率调用
for (int i = 0; i < packet.getData().length; i++) {
lidarParser.parseByte(packet.getData()[i]);
// maxLoop--;
}
}
} catch (Exception e) {
Log.e(TAG, "接收数据错误: " + e.getMessage());
Log.d("cuijingzhou_getDataSerial", "处理数据包时出错: " + e.toString());
}
}
} catch (SocketException e) {
Log.e(TAG, "启动服务端失败: " + e.getMessage());
Log.d("cuijingzhou_getDataSerial", "启动失败");
} finally {
stopUdpServer();
}
}).start();
}
}
/**
* 方法发送请求姿态数据的MAVLink指令
*/
public void requestAttitudeData() {
// 确保只执行一次
if (isAttitudeDataRequested) {
return;
}
isAttitudeDataRequested = true;
// 构造REQUEST_DATA_STREAM消息
msg_request_data_stream request = new msg_request_data_stream();
request.target_system = 1; // 飞机系统ID
@ -289,6 +306,11 @@ public class MyBoundService extends Service {
* 请求特定参数 (MAVLINK_MSG_ID_PARAM_REQUEST_READ)
*/
public void requestParamReadList() {
// 确保只执行一次
if (isParamReadListRequested) {
return;
}
isParamReadListRequested = true;
msg_param_request_list request = new msg_param_request_list();
request.target_system = 1; // 飞控系统ID
@ -323,6 +345,8 @@ public class MyBoundService extends Service {
}
/**
* 方法处理返回的mavlink协议byte[]
* receivedData:字节[]
@ -336,23 +360,51 @@ public class MyBoundService extends Service {
MAVLinkPacket mavLinkPacket = parser.mavlink_parse_char(receivedData[i]);
if (mavLinkPacket != null) {
MAVLinkMessage msg = mavLinkPacket.unpack();
// new_ts = get_sys_ms;
// switch (msg.id)
// {
// case 0:
// if (new_ts - id_0_ts > 100 ) {
// MAV.heartbeat = msg.payload;
// id_0_ts = new_ts;
// }
// break;
//
// case 121:
// id_121_down_sample_count ++;
// if (id_121_down_sample_count % 10 == 0) {
// MAV.gps = msg.payload;
// }
// break;
//
// default:
// break;
// }
if (msg.msgid == 0) {
// Log.d("msg.msgid", "213");
// Log.d("msg.msgid", MsgList.get(msg.msgid)+"");
requestInitialData();
}
//判断当前索引下的数据是否有变动如过没有变动就不储存用一个判断增加性能
if (!msg.toString().equals(MsgList.get(msg.msgid))) {
// Log.d("cuijigzhou_msg_all", msg.toString());
LogUtil.d("cuijigzhou_msg_all", msg.toString());
// LogUtil.d("cuijigzhou_msg_all", msg.toString());
MsgList.set(msg.msgid, msg.toString());
if (msgOld == null) {
MsgList.set(msg.msgid, msg.toString());
msgOld = msg;
} else {
// if (msg.msgid == 0) {
// Log.d("msg.msgid", MsgList.get(msg.msgid));
// }
//主要是应对STATUSTEXT(253)这样的特殊数据
wordT1(msg);
msgOld = msg;
if (msg.msgid == MAVLINK_MSG_ID_MISSION_ACK){
Log.d("msg.msgid", MsgList.get(msg.msgid));
}
// if (msg.msgid == MAVLINK_MSG_ID_MISSION_ACK) {
// Log.d("msg.msgid", MsgList.get(msg.msgid));
// }
}
}
@ -401,10 +453,6 @@ public class MyBoundService extends Service {
BroadcastUtil.Broadcast_MISSION_CURRENT(getApplication(), MsgList.get(MAVLINK_MSG_ID_MISSION_CURRENT));
}
Thread.sleep(50);
}

View File

@ -118,13 +118,18 @@ public class SettingActivity extends AppCompatActivity {
private void initView() {
allView = new AllView(this);
// 只预加载默认的 MotorFragment
// 预加载默认的 FoundationFragment SettingsFragment
androidx.fragment.app.FragmentManager fragmentManager = getSupportFragmentManager();
androidx.fragment.app.FragmentTransaction transaction = fragmentManager.beginTransaction();
foundationFragment = new FoundationFragment();
transaction.add(R.id.fragment_container, foundationFragment, "FoundationFragment");
settingsFragment = new SettingsFragment(); // 同时预加载 SettingsFragment
transaction.add(R.id.fragment_container, settingsFragment, "SettingsFragment");
transaction.commit();
}
/**
@ -153,10 +158,10 @@ public class SettingActivity extends AppCompatActivity {
private void selectItem(int index) {
for (int i = 0; i < allView.views.size(); i++) {
if (index == i) {
allView.views.get(i).setBackgroundResource(R.drawable.ff029a45_2round_1stroke_bg);
allView.views.get(i).setBackgroundResource(R.drawable.ff029a45_4round_1stroke_bg);
allView.views.get(i).setTextColor(Color.parseColor("#ffffff"));
} else {
allView.views.get(i).setBackgroundResource(R.drawable.b2303030_4round_1stroke_bg);
allView.views.get(i).setBackgroundResource(R.drawable.ffffffff_4round_bg);
allView.views.get(i).setTextColor(Color.parseColor("#303030"));
}
}

View File

@ -40,7 +40,7 @@ public class MultiSelectAdapter extends RecyclerView.Adapter<MultiSelectAdapter.
// 设置背景
if (data.isSelect) {
holder.tv_item.setBackgroundResource(R.drawable.ff029a45_2round_1stroke_bg);
holder.tv_item.setBackgroundResource(R.drawable.ff029a45_4round_1stroke_bg);
holder.tv_item.setTextColor(Color.parseColor("#ffffff"));
} else {
holder.tv_item.setBackgroundResource(R.drawable.b2303030_4round_1stroke_bg);

View File

@ -10,7 +10,6 @@ import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.longyi_groundstation.Main.Setting.Base.Param;
import com.example.longyi_groundstation.Main.Setting.Base.ParamGroup;
import com.example.longyi_groundstation.R;
import java.util.List;
@ -47,13 +46,13 @@ public class ParamAdapter extends RecyclerView.Adapter<ParamAdapter.ParamViewHol
}
Param param = paramList.get(position);
holder.param_name.setText("参数名称:\n"+param.getParam_id());
holder.param_value.setText("参数值:\n"+param.getParam_value());
holder.param_name.setText(""+param.getParam_id());
holder.param_value.setText(""+param.getParam_value());
// holder.param_type.setText(param.getParam_type());
if (param.isSelect()){
holder.ll_main.setBackgroundResource(R.drawable.ff8decec_2round_bg);
holder.ll_main.setBackgroundResource(R.drawable.ff029a45_4round_1stroke_bg);
}else {
holder.ll_main.setBackgroundResource(R.drawable.ffcfcfcf_2round_bg);
holder.ll_main.setBackgroundResource(R.drawable.b2303030_4round_1stroke_bg);
}
holder.itemView.setOnClickListener(v -> {
if (position < paramList.size()) { // 再次检查索引有效性

View File

@ -9,7 +9,6 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.longyi_groundstation.Main.Setting.Base.Param;
import com.example.longyi_groundstation.Main.Setting.Base.ParamGroup;
import com.example.longyi_groundstation.R;
@ -46,9 +45,9 @@ public class ParamGroupAdapter extends RecyclerView.Adapter<ParamGroupAdapter.Pa
// holder.paramValue.setText(param.getValue());
//
if (param.isSelect()) {
holder.ll_main.setBackgroundResource(R.drawable.ff8decec_2round_bg);
holder.ll_main.setBackgroundResource(R.drawable.ff029a45_4round_1stroke_bg);
} else {
holder.ll_main.setBackgroundResource(R.drawable.ffcfcfcf_2round_bg);
holder.ll_main.setBackgroundResource(R.drawable.b2303030_4round_1stroke_bg);
}
holder.itemView.setOnClickListener(v -> {
setSelect(position);

View File

@ -81,7 +81,7 @@ public class ControlFragment extends Fragment {
adapter = new ParamGridAdapter(paramItems);
updata();
// 设置GridLayoutManager每行显示2个item
// 设置GridLayoutManager每行显示3个item
rv_data.setLayoutManager(new GridLayoutManager(getContext(), 3));
rv_data.setAdapter(adapter);
}
@ -104,10 +104,10 @@ public class ControlFragment extends Fragment {
//广播接收-RcChannelsRawlistener
mBroadcast_RC_CHANNELS.setRcChannelsRawlistener(data -> {
Log.d("cuijingzhou_ctrl", data.toString());
// Log.d("cuijingzhou_ctrl", data.toString());
try {
JSONObject jsonObject = new JSONObject(data.toString());
for (int i = 0; i < 12; i++){
for (int i = 0; i < 14; i++){
paramItems.get(i).setCurrentValue(jsonObject.optString("chan" + (i + 1) + "_raw"));
}
}catch (Exception e){
@ -236,6 +236,21 @@ public class ControlFragment extends Fragment {
FlyVoid.paramList.get("RC12_TRIM").getParam_value(),
"待定",
"待定"));
// 添加数据
paramItems.add(new ParamGridAdapter.ParamItem(
"通道13",
FlyVoid.paramList.get("RC13_MAX").getParam_value(),
FlyVoid.paramList.get("RC13_MIN").getParam_value(),
FlyVoid.paramList.get("RC13_TRIM").getParam_value(),
"待定",
"待定"));
paramItems.add(new ParamGridAdapter.ParamItem(
"通道14",
FlyVoid.paramList.get("RC14_MAX").getParam_value(),
FlyVoid.paramList.get("RC14_MIN").getParam_value(),
FlyVoid.paramList.get("RC14_TRIM").getParam_value(),
"待定",
"待定"));
}

View File

@ -50,6 +50,7 @@ public class FlyFragment extends Fragment {
if (FlyVoid.isParamUpdateComplete()){
initData();
initView(view);
getData();
initOnClick();
}
return view;
@ -201,7 +202,7 @@ public class FlyFragment extends Fragment {
int progress = seekBar_horizontal_angle.getProgress();
if (progress > 1000) {
seekBar_horizontal_angle.setProgress(progress - 100);
tv_horizontal_angle.setText(seekBar_horizontal_angle.getProgress() + "cdeg");
tv_horizontal_angle.setText((seekBar_horizontal_angle.getProgress() / 100) + "");
}
});
@ -209,14 +210,14 @@ public class FlyFragment extends Fragment {
int progress = seekBar_horizontal_angle.getProgress();
if (progress < seekBar_horizontal_angle.getMax()) {
seekBar_horizontal_angle.setProgress(progress + 100);
tv_horizontal_angle.setText(seekBar_horizontal_angle.getProgress() + "cdeg");
tv_horizontal_angle.setText(((seekBar_horizontal_angle.getProgress() / 100)) + "");
}
});
seekBar_horizontal_angle.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
tv_horizontal_angle.setText(progress + "");
tv_horizontal_angle.setText((progress / 100) + "");
}
@Override
@ -271,13 +272,11 @@ public class FlyFragment extends Fragment {
seekBar_decline_speed.setProgress(0);
tv_decline_speed.setText(seekBar_decline_speed.getProgress() + "m/s");
seekBar_horizontal_angle.setProgress(3000);
tv_horizontal_angle.setText(seekBar_horizontal_angle.getProgress() + "cdeg");
tv_horizontal_angle.setText((seekBar_horizontal_angle.getProgress()/100) + "");
seekBar_rotation_rate.setProgress(2025);
tv_rotation_rate.setText(((double)seekBar_rotation_rate.getProgress()/10) + "度/s");
Toast.makeText(getActivity(), "初始化完成", Toast.LENGTH_SHORT).show();
});
}
/**
@ -293,7 +292,7 @@ public class FlyFragment extends Fragment {
seekBar_decline_speed.setProgress(Integer.parseInt(FlyVoid.paramList.get("PILOT_SPEED_DN").getParam_value()));
tv_decline_speed.setText(seekBar_decline_speed.getProgress() + "m/s");
seekBar_horizontal_angle.setProgress(Integer.parseInt(FlyVoid.paramList.get("ANGLE_MAX").getParam_value()));
tv_horizontal_angle.setText(seekBar_horizontal_angle.getProgress() + "cdeg");
tv_horizontal_angle.setText((seekBar_horizontal_angle.getProgress()/100) + "");
//旋转速率单独运算一下
float rotation_rate = Float.parseFloat(FlyVoid.paramList.get("PILOT_Y_RATE").getParam_value())*10;
seekBar_rotation_rate.setProgress((int) rotation_rate);
@ -316,6 +315,6 @@ public class FlyFragment extends Fragment {
@Override
public void onStart() {
super.onStart();
getData();
}
}

View File

@ -35,7 +35,7 @@ public class FoundationFragment extends Fragment {
private RelativeLayout rl_low_end,rl_mid_range,rl_high_end;
private Spinner sp_low_end,sp_mid_range,sp_high_end;
private TextView tv_low_end_text,tv_mid_range_text,tv_high_end_text,tv_save;
private TextView et_speed_text;
private FlyVoid flyVoid = new FlyVoid();
@Override
@ -75,6 +75,7 @@ public class FoundationFragment extends Fragment {
tv_low_end_text = view.findViewById(R.id.tv_low_end_text);
tv_mid_range_text = view.findViewById(R.id.tv_mid_range_text);
tv_high_end_text = view.findViewById(R.id.tv_high_end_text);
et_speed_text = view.findViewById(R.id.et_speed_text);
tv_save = view.findViewById(R.id.tv_save);
initSpinnerData();
initText();
@ -183,6 +184,12 @@ public class FoundationFragment extends Fragment {
FlyVoid.paramList.get("FLTMODE5").getParam_type());
flyVoid.requestParamSet("FLTMODE6",
getSelectedChannelValue(sp_high_end) + "");
Thread.sleep(100);
flyVoid.requestParamSet("WPNAV_SPEED",
et_speed_text.getText().toString(),
FlyVoid.paramList.get("WPNAV_SPEED").getParam_type());
Thread.sleep(100);
Toast.makeText(requireContext(), "保存成功", Toast.LENGTH_SHORT).show();
}catch (Exception e){
@ -199,6 +206,7 @@ public class FoundationFragment extends Fragment {
setSelectedChannel(sp_low_end, Integer.parseInt(FlyVoid.paramList.get("FLTMODE1").getParam_value()));
setSelectedChannel(sp_mid_range, Integer.parseInt(FlyVoid.paramList.get("FLTMODE3").getParam_value()));
setSelectedChannel(sp_high_end, Integer.parseInt(FlyVoid.paramList.get("FLTMODE5").getParam_value()));
et_speed_text.setText(FlyVoid.paramList.get("WPNAV_SPEED").getParam_value());
}
/**

View File

@ -216,8 +216,6 @@ public class LoadFragment extends Fragment {
// 给flyTextViews里面所有的view添加点击事件点击后会打开对应的Spinner
initFlyTextViewClickListeners();
}
/**

View File

@ -66,9 +66,9 @@ public class MotorFragment extends Fragment {
for (int i = 1; i <= 12; i++) {
if (i <= 6) {
list.add(new Motor("电机" + i, i, true));
list.add(new Motor("" + i, i, true));
} else {
list.add(new Motor("电机" + i, i, false));
list.add(new Motor("" + i, i, false));
}
}

View File

@ -43,6 +43,7 @@ import com.example.longyi_groundstation.R;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
@ -428,6 +429,8 @@ public class SettingsFragment extends Fragment {
// Map 中的值转换为 List 并添加到 paramGroupsList
paramGroupsList.addAll(groupMap.values());
// 添加这行代码来执行排序
sortParamGroupsByName();
// 通知适配器刷新数据
if (!paramGroupsList.isEmpty()) {
@ -460,6 +463,22 @@ public class SettingsFragment extends Fragment {
});
}
/**
* 方法按照参数组名称字母顺序排序
*
* @cuijingzhou
*/
private void sortParamGroupsByName() {
if (paramGroupsList != null && !paramGroupsList.isEmpty()) {
paramGroupsList.sort((group1, group2) -> {
if (group1 == null || group2 == null) return 0;
if (group1.getParam_name() == null || group2.getParam_name() == null) return 0;
return group1.getParam_name().compareToIgnoreCase(group2.getParam_name());
});
}
}
@Override
public void onResume() {

View File

@ -85,18 +85,24 @@ public class BombingDialog {
window.setBackgroundDrawableResource(R.drawable.ffffffff_4round_bg);
}
unlockView.setText("滑动执行");
unlockView.setText("滑动确认");
unlockView.setOnUnlockListener(new SlideToUnlockView.OnUnlockListener() {
@Override
public void onUnlock() {
// 发送命令
// flyVoid.sendMavlinkMessage(MyBoundService.type,command);
flyVoid.requestBombing(et_height.getText().toString());
if (et_height.getText().toString().length() > 0){
flyVoid.requestBombing(et_height.getText().toString());
// 滑动到阈值后触发如关闭对话框或执行操作
Toast.makeText(context, "操作已确认", Toast.LENGTH_SHORT).show();
}else {
unlockView.resetProgress();
Toast.makeText(context, "请输入高度", Toast.LENGTH_SHORT).show();
}
dialog.dismiss();
// 滑动到阈值后触发如关闭对话框或执行操作
Toast.makeText(context, "操作已确认", Toast.LENGTH_SHORT).show();
MyTool.hideBottomNavigationBar(context);
}
});

View File

@ -8,6 +8,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
@ -19,9 +20,8 @@ import com.example.longyi_groundstation.R;
public class PointFlyDialog {
private final Activity context;
private String title;
private String message;
private String positiveButtonText;
private String speed;
private String height;
private LatLng latLng;
private FlyVoid flyVoid = new FlyVoid();
@ -29,10 +29,9 @@ public class PointFlyDialog {
public PointFlyDialog(Activity context) {
this.context = context;
this.title = "错误日志";
this.message = "";
this.positiveButtonText = "确定";
this.latLng = latLng;
this.speed = "3";
this.height = "30";
this.latLng = null;
}
@ -43,22 +42,18 @@ public class PointFlyDialog {
}
// 设置弹窗标题
public PointFlyDialog setTitle(String title) {
this.title = title;
public PointFlyDialog setSpeed(String speed) {
this.speed = speed;
return this;
}
// 设置弹窗内容
public PointFlyDialog setMessage(String message) {
this.message = message;
public PointFlyDialog setHeight(String height) {
this.height = height;
return this;
}
// 设置确认按钮文字
public PointFlyDialog setPositiveButtonText(String text) {
this.positiveButtonText = text;
return this;
}
// 显示弹窗
public void show() {
@ -70,9 +65,22 @@ public class PointFlyDialog {
@SuppressLint({"MissingInflatedId", "LocalSuppress"}) TextView tvMessage = view.findViewById(R.id.tv_message);
// 滑动模块
@SuppressLint({"MissingInflatedId", "LocalSuppress"}) SlideToUnlockView unlockView = view.findViewById(R.id.unlockView);
//经度
@SuppressLint({"MissingInflatedId", "LocalSuppress"}) EditText et_lon = view.findViewById(R.id.et_lon);
//纬度
@SuppressLint({"MissingInflatedId", "LocalSuppress"}) EditText et_lat = view.findViewById(R.id.et_lat);
//高度
@SuppressLint({"MissingInflatedId", "LocalSuppress"}) EditText et_height = view.findViewById(R.id.et_height);
//速度
@SuppressLint({"MissingInflatedId", "LocalSuppress"}) EditText et_speed = view.findViewById(R.id.et_speed);
if (latLng != null){
tvMessage.setText("经度:" + latLng.latitude + "\n纬度" + latLng.latitude);
et_lon.setText(String.valueOf(latLng.longitude));
et_lat.setText(String.valueOf(latLng.latitude));
et_height.setText(height);
et_speed.setText(speed);
}
// 添加日志
@ -95,8 +103,28 @@ public class PointFlyDialog {
unlockView.setOnUnlockListener(new SlideToUnlockView.OnUnlockListener() {
@Override
public void onUnlock() {
// // 发送命令
if (et_lat.getText().toString().isEmpty() || et_lon.getText().toString().isEmpty()){
Toast.makeText(context, "请填写经纬度", Toast.LENGTH_SHORT).show();
return;
}
if (et_height.getText().toString().isEmpty()){
Toast.makeText(context, "请填写高度", Toast.LENGTH_SHORT).show();
return;
}
if (Integer.parseInt(et_height.getText().toString()) < 5){
Toast.makeText(context, "高度过低", Toast.LENGTH_SHORT).show();
return;
}
// // 发送命令
flyVoid.adviseFly(
context,
new LatLng(
Double.parseDouble(et_lat.getText().toString()),
Double.parseDouble(et_lon.getText().toString()))
,
Double.parseDouble(et_height.getText().toString()),
Double.parseDouble(et_speed.getText().toString()));
MyTool.hideBottomNavigationBar( context);
dialog.dismiss();
// 滑动到阈值后触发如关闭对话框或执行操作
@ -108,7 +136,6 @@ public class PointFlyDialog {
tvMessage.setOnClickListener(v -> {
dialog.dismiss();
MyTool.hideBottomNavigationBar(context);
});
}

View File

@ -92,9 +92,6 @@ public class SaveLinkNameDialog {
}else {
context.saveLink(null);
}
MyTool.hideBottomNavigationBar( context);
dialog.dismiss();
// 滑动到阈值后触发如关闭对话框或执行操作
Toast.makeText(context, "操作已确认", Toast.LENGTH_SHORT).show();

View File

@ -94,14 +94,19 @@ public class AllView {
public ImageView iv_open_link_list;
public LinearLayout ll_clear_fly_line;
public LinearLayout ll_create_link_item_layout;
public ImageView iv_marker_top;
public ImageView iv_marker_left;
public ImageView iv_marker_right;
public ImageView iv_marker_bottom;
public LinearLayout ll_marker_ctrl;
public EditText et_marker_distance;
// public SlideToUnlockView unlockView;
// public RelativeLayout rl_unlock;
public EditText et_start_execute_height;
public AllView(Activity activity) {
this.activity = activity;
init();
@ -182,6 +187,11 @@ public class AllView {
ll_clear_fly_line = activity.findViewById(R.id.ll_clear_fly_line);
ll_create_link_item_layout = activity.findViewById(R.id.ll_create_link_item_layout);
iv_open_link_list = activity.findViewById(R.id.iv_open_link_list);
iv_marker_top = activity.findViewById(R.id.iv_marker_top);
iv_marker_left = activity.findViewById(R.id.iv_marker_left);
iv_marker_right = activity.findViewById(R.id.iv_marker_right);
iv_marker_bottom = activity.findViewById(R.id.iv_marker_bottom);
ll_marker_ctrl = activity.findViewById(R.id.ll_marker_ctrl);
et_marker_distance = activity.findViewById(R.id.et_marker_distance);
}
}

View File

@ -34,6 +34,7 @@ import com.example.longyi_groundstation.MAVLink.common.msg_mission_request_int;
import com.example.longyi_groundstation.MAVLink.common.msg_mission_request_list;
import com.example.longyi_groundstation.MAVLink.common.msg_param_request_read;
import com.example.longyi_groundstation.MAVLink.common.msg_param_set;
import com.example.longyi_groundstation.MAVLink.common.msg_set_position_target_global_int;
import com.example.longyi_groundstation.MAVLink.enums.MAV_CMD;
import com.example.longyi_groundstation.MAVLink.enums.MAV_COMPONENT;
import com.example.longyi_groundstation.MAVLink.enums.MAV_FRAME;
@ -365,113 +366,9 @@ public class FlyVoid {
* @param createLinkList 航线航点列表
* @cuijingzhou
*/
public void sendMissionToFlightController(Activity context, ArrayList<CreateLink> createLinkList, String height) {
if (createLinkList == null || createLinkList.isEmpty()) {
return;
}
if (height == null){
height = "10";
}
// 创建 ProgressDialog
android.app.ProgressDialog progressDialog = new android.app.ProgressDialog(context);
progressDialog.setTitle("任务上传中");
progressDialog.setMessage("正在发送航线到飞控...");
progressDialog.setProgressStyle(android.app.ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setCancelable(false); // 设置不可手动关闭
progressDialog.setMax(100);
progressDialog.show();
MsgList.set(MAVLINK_MSG_ID_MISSION_REQUEST,null);
String finalHeight = height;
new Thread(() -> {
try {
// 2. 发送航点计数
msg_mission_count count = new msg_mission_count();
count.target_system = 1;
count.target_component = 1;
count.count = createLinkList.size() + 2; // 航点数量
sendMavlinkMessage(type, count);
Log.d("Missions-count", "--" + ( createLinkList.size() + 2));
// 在FlyVoid.java的sendMissionToFlightController方法中找到以下代码块并修改
boolean isOk = true;
int sentWaypoints = 0;
int totalWaypoints = createLinkList.size() + 2;
int lastSeq = -1; // 添加这一行来记录上一次的seq值
while (isOk) {
try {
String msgRequest = MsgList.get(MAVLINK_MSG_ID_MISSION_REQUEST);
if (msgRequest != null) {
JSONObject jsonObject = new JSONObject(msgRequest);
int seq = jsonObject.optInt("seq");
// 添加判断如果seq值没有改变跳过本次循环
if (seq == lastSeq) {
Thread.sleep(100); // 短暂休眠避免过度占用CPU
continue; // 跳过本次循环
}
upDataLinkPoint(seq, createLinkList, finalHeight);
lastSeq = seq; // 更新lastSeq值
sentWaypoints = seq + 1;
// 更新发送进度
final int progress = (int) ((sentWaypoints / (float) totalWaypoints) * 92); // 发送占50%进度
context.runOnUiThread(() -> {
progressDialog.setProgress(progress);
});
// 如果当前序号+1大于等于航点总数则结束循环
if ((seq + 1) >= createLinkList.size()+2) {
isOk = false;
}
}
// 添加短暂延迟以避免过度占用CPU
Thread.sleep(100);
} catch (Exception e) {
Log.e("Mission", "Error processing mission request: " + e.getMessage());
// 出错时也退出循环避免无限循环
isOk = false;
}
}
context.runOnUiThread(() -> {
progressDialog.setMessage("正在校验航线...");
});
Log.d("Missions", "verifyResult");
// 校验点位是否正常上传
boolean verifyResult = verifyPoint(createLinkList);
// 更新校验进度
context.runOnUiThread(() -> {
progressDialog.setProgress(100);
progressDialog.dismiss();
if (verifyResult) {
Toast.makeText(context, "航线上传成功", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(context, "航线发送完成但校验失败", Toast.LENGTH_SHORT).show();
}
});
} catch (Exception e) {
context.runOnUiThread(() -> {
progressDialog.dismiss();
Toast.makeText(context, "航线发送过程中出现错误", Toast.LENGTH_SHORT).show();
});
e.printStackTrace();
}
}).start();
}
/**
@ -479,8 +376,94 @@ public class FlyVoid {
*
* @cuijingzhou
* */
private void creatDataList (ArrayList<CreateLink> createLinkList, String height) {
ArrayList<msg_mission_item_int> dataList = new ArrayList<>();
public static ArrayList<msg_mission_item_int> createLinkListToFlyList = null;//当前飞行计划
public void creatDataList (Activity context,ArrayList<CreateLink> createLinkList, String height) {
try {
//转换一下
ArrayList<msg_mission_item_int> list1 = createLinkListToFlyList(createLinkList);
Log.d("sss", "creatDataList: ");
if (createLinkList == null || createLinkList.isEmpty()) {
return;
}
if (height == null){
height = "10";
}
// // 创建 ProgressDialog
// android.app.ProgressDialog progressDialog = new android.app.ProgressDialog(context);
// progressDialog.setTitle("任务上传中");
// progressDialog.setMessage("正在发送航线到飞控...");
// progressDialog.setProgressStyle(android.app.ProgressDialog.STYLE_HORIZONTAL);
// progressDialog.setCancelable(false); // 设置不可手动关闭
// progressDialog.setMax(100);
// progressDialog.show();
MsgList.set(MAVLINK_MSG_ID_MISSION_REQUEST,null);
String finalHeight = height;
new Thread(() -> {
try {
// 2. 发送航点计数
msg_mission_count count = new msg_mission_count();
count.target_system = 1;
count.target_component = 1;
count.count = list1.size(); // 航点数量
sendMavlinkMessage(type, count);
Log.d("Missions-count", "--" + ( list1.size()));
boolean isOk = true;
int lastSeq = -1; // 添加这一行来记录上一次的seq值
while (isOk) {
try {
String msgRequest = MsgList.get(MAVLINK_MSG_ID_MISSION_REQUEST);
if (msgRequest != null) {
JSONObject jsonObject = new JSONObject(msgRequest);
int seq = jsonObject.optInt("seq");
// 添加判断如果seq值没有改变跳过本次循环
if (seq <= lastSeq) {
Thread.sleep(100); // 短暂休眠避免过度占用CPU
continue; // 跳过本次循环
}
lastSeq = seq; // 更新lastSeq值
// 发送消息请求航点列表
sendMavlinkMessage(type, list1.get( lastSeq));
// 如果当前序号+1大于等于航点总数则结束循环
if ((lastSeq + 1) >= list1.size()) {
Log.d("cjz_航线上传", "上传成功");
context.runOnUiThread(() -> {
Toast.makeText(context, "上传成功", Toast.LENGTH_SHORT).show();
});
isOk = false;
}
}
// 添加短暂延迟以避免过度占用CPU
Thread.sleep(100);
} catch (Exception e) {
Log.e("Mission", "Error processing mission request: " + e.getMessage());
// 出错时也退出循环避免无限循环
isOk = false;
}
}
} catch (Exception e) {
e.printStackTrace();
}
}).start();
} catch (Exception e) {
e.printStackTrace();
Log.d("问题1", "creatDataList: "+e);
}
}
public ArrayList<msg_mission_item_int> createLinkListToFlyList(ArrayList<CreateLink> createLinkList){
ArrayList<msg_mission_item_int> list1 = new ArrayList<>();
//home点默认第一个为home点
msg_mission_item_int waypoint = new msg_mission_item_int();
waypoint.target_system = 1; // 无人机系统ID
@ -497,7 +480,8 @@ public class FlyVoid {
waypoint.x = 0;
waypoint.y = 0;
waypoint.z = 0; // 高度(相对)
dataList.add(waypoint);
list1.add(waypoint);
//起飞将飞机拉起来
msg_mission_item_int waypoint1 = new msg_mission_item_int();
waypoint1.target_system = 1; // 无人机系统ID
@ -513,103 +497,137 @@ public class FlyVoid {
waypoint1.param4 = 0; // 航向角
waypoint1.x = 0;
waypoint1.y = 0;
waypoint1.z = Float.parseFloat(height); // 高度(相对)
waypoint1.z = Float.parseFloat("10"); // 高度(相对)
waypoint1.mission_type = MAV_MISSION_TYPE.MAV_MISSION_TYPE_MISSION;
list1.add(waypoint1);
// //添加航点
// for (int i = 0; i < createLinkList.size(); i++) {
// if (){
//
// }
// }
for (int i = 0; i < createLinkList.size(); i++) {
CreateLink link = createLinkList.get(i);
// 在特定航点前添加速度变化指令
msg_mission_item_int speedChange = new msg_mission_item_int();
speedChange.target_system = 1;
speedChange.target_component = 1;
speedChange.seq = list1.size(); // 序号
speedChange.frame = MAV_FRAME.MAV_FRAME_GLOBAL_RELATIVE_ALT;
speedChange.command = MAV_CMD.MAV_CMD_DO_CHANGE_SPEED;
speedChange.current = 0;
speedChange.autocontinue = 1;
speedChange.param1 = 1; // 地速
speedChange.param2 = (float) link.getSpeed(); // 使用CreateLink中的速度值
speedChange.param3 = 0; // 不限制推力
speedChange.param4 = 0; // 绝对速度
speedChange.x = 0;
speedChange.y = 0;
speedChange.z = Float.parseFloat("10");
list1.add(speedChange);
//第一个点特殊处理
if ( i-1 == -1){
msg_mission_item_int command = new msg_mission_item_int();
command.target_system = 1;
command.target_component = 1;
command.seq = list1.size(); // 序号
command.frame = MAV_FRAME.MAV_FRAME_GLOBAL_RELATIVE_ALT;
command.command = MAV_CMD.MAV_CMD_CONDITION_YAW;
// 设置偏航参数
command.param1 = getYaw(
MainActivity.homeLatLng.latitude,
MainActivity.homeLatLng.longitude,
link.getLatLng().latitude,
link.getLatLng().longitude); // 目标偏航角度
command.param2 = 0; // 偏航角变化速率
command.param3 = 0; // 方向-1=逆时针1=顺时针
command.param4 = 0; // 相对或绝对偏航0=绝对1=相对
list1.add(command);
}
}
if (link.getStop_time() > 0 && i <= createLinkList.size()-1 && i-1 != -1){
msg_mission_item_int command = new msg_mission_item_int();
command.target_system = 1;
command.target_component = 1;
command.seq = list1.size(); // 序号
command.frame = MAV_FRAME.MAV_FRAME_GLOBAL_RELATIVE_ALT;
command.command = MAV_CMD.MAV_CMD_CONDITION_YAW;
// 设置偏航参数
command.param1 = getYaw(
createLinkList.get(i-1).getLatLng().latitude,
createLinkList.get(i-1).getLatLng().longitude,
link.getLatLng().latitude,
link.getLatLng().longitude); // 目标偏航角度
command.param2 = 0; // 偏航角变化速率
command.param3 = 0; // 方向-1=逆时针1=顺时针
command.param4 = 0; // 相对或绝对偏航0=绝对1=相对
list1.add(command);
}
/**
* 方法给飞控发送点位
*
* @cuijingzhou
*/
private void upDataLinkPoint(int i,ArrayList<CreateLink> createLinkList,String height) throws InterruptedException {
// Log.d("Missions", "--" + i);
// Log.d("Missions", "myReceiver_MISSION_ACK: ");
//由于第一个点是home点所以要从第2个点开始上传
if (i == 0){
msg_mission_item_int waypoint = new msg_mission_item_int();
waypoint.target_system = 1; // 无人机系统ID
waypoint.target_component = 1; // 无人机组件ID
waypoint.seq = 0; // 航点序号
waypoint.frame = MAV_FRAME.MAV_FRAME_GLOBAL_RELATIVE_ALT; // 坐标系
waypoint.command = MAV_CMD.MAV_CMD_NAV_WAYPOINT; // 航点指令
waypoint.current = 1 ; // 第一个航点设为当前航点
waypoint.autocontinue = 1; // 自动继续到下一个航点
waypoint.param1 = 0; // 停留时间()
waypoint.param2 = 0; // 接受半径(m)
waypoint.param3 = 0; // 通过半径(m)
waypoint.param4 = 0; // 航向角
waypoint.x = 0;
waypoint.y = 0;
waypoint.z = 0; // 高度(相对)
sendMavlinkMessage(type, waypoint);
Log.d("Missions", i+"--"+ waypoint.toString());
Thread.sleep(100);
} else if (i == 1) {
msg_mission_item_int waypoint1 = new msg_mission_item_int();
waypoint1.target_system = 1; // 无人机系统ID
waypoint1.target_component = 1; // 无人机组件ID
waypoint1.seq = i; // 航点序号
waypoint1.frame = MAV_FRAME.MAV_FRAME_GLOBAL_RELATIVE_ALT; // 坐标系
waypoint1.command = MAV_CMD.MAV_CMD_NAV_TAKEOFF; // 航点指令
waypoint1.current = 0; // 第一个航点设为当前航点
waypoint1.autocontinue = 1; // 自动继续到下一个航点
waypoint1.param1 = 0; // 停留时间()
waypoint1.param2 = 0; // 接受半径(m)
waypoint1.param3 = 0; // 通过半径(m)
waypoint1.param4 = 0; // 航向角
waypoint1.x = 0;
waypoint1.y = 0;
waypoint1.z = Float.parseFloat(height); // 高度(相对)
waypoint1.mission_type = MAV_MISSION_TYPE.MAV_MISSION_TYPE_MISSION;
sendMavlinkMessage(type, waypoint1);
Log.d("Missions", i+"--"+ waypoint1.toString());
Thread.sleep(100);
}
//正常上传
else {
CreateLink link = createLinkList.get(i-2);
LatLng latLng = link.getLatLng();
double[] doubles = CoordinateConverter.gcj02ToWgs84(latLng.longitude, latLng.latitude);
if (doubles != null) {
msg_mission_item_int waypoint = new msg_mission_item_int();
waypoint.target_system = 1; // 无人机系统ID
waypoint.target_component = 1; // 无人机组件ID
waypoint.seq = i; // 航点序号
waypoint.frame = MAV_FRAME.MAV_FRAME_GLOBAL_RELATIVE_ALT; // 坐标系
waypoint.command = MAV_CMD.MAV_CMD_NAV_WAYPOINT; // 航点指令
waypoint.current = 0; // 第一个航点设为当前航点
waypoint.autocontinue = 1; // 自动继续到下一个航点
waypoint.param1 = 0; // 停留时间()
waypoint.param2 = 0; // 接受半径(m)
waypoint.param3 = 0; // 通过半径(m)
waypoint.param4 = 0; // 航向角
waypoint.x = (int) (doubles[1] * 10000000);
waypoint.y = (int) (doubles[0] * 10000000);
// 经度
waypoint.z = (float) link.getHeight(); // 高度(相对)
sendMavlinkMessage(type, waypoint);
Log.d("Missions", i+"--"+ waypoint.toString());
Thread.sleep(100);
}
//点位其中包含停留时间
msg_mission_item_int waypointss = new msg_mission_item_int();
waypointss.target_system = 1; // 无人机系统ID
waypointss.target_component = 1; // 无人机组件ID
waypointss.seq = list1.size(); // 航点序号
waypointss.frame = MAV_FRAME.MAV_FRAME_GLOBAL_RELATIVE_ALT; // 坐标系
waypointss.command = MAV_CMD.MAV_CMD_NAV_WAYPOINT; // 航点指令
waypointss.current = 0; // 第一个航点设为当前航点
waypointss.autocontinue = 1; // 自动继续到下一个航点
waypointss.param1 = link.getStop_time(); // 停留时间()
waypointss.param2 = 0; // 接受半径(m)
waypointss.param3 = 0; // 通过半径(m)
waypointss.param4 = 0; // 航向角
waypointss.x = (int) (doubles[1] * 10000000);
waypointss.y = (int) (doubles[0] * 10000000);
// 经度
waypointss.z = (float) link.getHeight(); // 高度(相对)
waypointss.mission_type = MAV_MISSION_TYPE.MAV_MISSION_TYPE_MISSION;
list1.add(waypointss);
}
return list1;
}
/**
* 方法计算从当前点到下一个点的方位角Yaw
* 以正北为0度顺时针方向为正
*
* @param currentLat 当前点纬度
* @param currentLon 当前点经度
* @param nextLat 下一个点纬度
* @param nextLon 下一个点经度
* @return 方位角0-360度正北为0度
*/
public static float getYaw(double currentLat, double currentLon, double nextLat, double nextLon) {
// 将角度转换为弧度
double lat1 = Math.toRadians(currentLat);
double lon1 = Math.toRadians(currentLon);
double lat2 = Math.toRadians(nextLat);
double lon2 = Math.toRadians(nextLon);
// 计算经度差
double dLon = lon2 - lon1;
// 使用球面三角法计算方位角
double y = Math.sin(dLon) * Math.cos(lat2);
double x = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(dLon);
double bearing = Math.atan2(y, x);
// 将结果从弧度转换为度
bearing = Math.toDegrees(bearing);
// 规范化到0-360度范围
bearing = (bearing + 360) % 360;
return (int) bearing;
}
/**
* 方法校验发送的点位是否正确
*
@ -790,6 +808,73 @@ public class FlyVoid {
}
/**
* 方法指点飞行
*
* @cuijingzhou
*/
public void adviseFly(Activity context, LatLng latLng, double height, double speed) {
// 先切换到GUIDED模式
setFlightMode(4);
// 延时一段时间确保模式切换完成
new Thread(() -> {
try {
Thread.sleep(1000);
// 使用 SET_POSITION_TARGET_GLOBAL_INT 消息发送目标位置
adviseFlyWithGlobalPosition(latLng, height, speed);
} catch (InterruptedException e) {
e.printStackTrace();
}
}).start();
}
/**
* 方法使用 SET_POSITION_TARGET_GLOBAL_INT 消息进行指点飞行
*
* @param latLng 目标位置坐标
* @param altitude 目标高度
* @param speed 目标速度
*/
public void adviseFlyWithGlobalPosition(LatLng latLng, double altitude, double speed) {
try {
// 转换坐标系 (GCJ02转WGS84)
double[] wgs84Coords = CoordinateConverter.gcj02ToWgs84(latLng.longitude, latLng.latitude);
// 创建 SET_POSITION_TARGET_GLOBAL_INT 消息
msg_set_position_target_global_int positionTarget = new msg_set_position_target_global_int();
positionTarget.target_system = 1; // 目标系统ID
positionTarget.target_component = 1; // 目标组件ID
positionTarget.coordinate_frame = MAV_FRAME.MAV_FRAME_GLOBAL_RELATIVE_ALT; // 坐标系
positionTarget.type_mask = 0b0000111111111000; // 仅位置控制速度和加速度不控制
// 设置目标位置
positionTarget.lat_int = (int) (wgs84Coords[1] * 10000000); // 纬度 (单位: 1e-7度)
positionTarget.lon_int = (int) (wgs84Coords[0] * 10000000); // 经度 (单位: 1e-7度)
positionTarget.alt = (float) altitude; // 高度 (单位: )
// 设置目标速度
positionTarget.vx = 0; // X轴速度 (单位: m/s)
positionTarget.vy = 0; // Y轴速度 (单位: m/s)
positionTarget.vz = 0; // Z轴速度 (单位: m/s)
// 其他参数设置为0
positionTarget.afx = 0;
positionTarget.afy = 0;
positionTarget.afz = 0;
positionTarget.yaw = 0;
positionTarget.yaw_rate = 0;
// 发送消息
sendMavlinkMessage(MyBoundService.type, positionTarget);
} catch (Exception e) {
Log.e("FlyVoid", "adviseFlyWithGlobalPosition error: " + e.getMessage());
}
}
/**
* 方法切换无人机飞行模式
*
@ -816,4 +901,35 @@ public class FlyVoid {
}
/**
* 控制通道
* @param servoInstance 舵机编号 (1-8)
* @param pwmValue PWM值 (1000-2000微秒)
* 使用示例将第1个舵机设置到中立位置
* controlServo(1, 1500);
*/
public void controlServo(int servoInstance, int pwmValue) {
// 构造命令
msg_command_long command = new msg_command_long();
command.target_system = 1; // 目标系统ID飞控
command.target_component = 1; // 目标组件ID
command.command = MAV_CMD.MAV_CMD_DO_SET_SERVO; // 设置舵机命令
command.confirmation = 0; // 确认位
// 设置舵机参数
command.param1 = servoInstance; // 舵机实例号
command.param2 = pwmValue; // PWM值
command.param3 = 0; // 保留
command.param4 = 0; // 保留
command.param5 = 0; // 保留
command.param6 = 0; // 保留
command.param7 = 0; // 保留
// 发送命令
sendMavlinkMessage(MyBoundService.type, command);
}
}

View File

@ -0,0 +1,140 @@
// 新建文件 HeartbeatManager.java
package com.example.longyi_groundstation.Main.Void;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.example.longyi_groundstation.MAVLink.MAVLinkPacket;
import com.example.longyi_groundstation.MAVLink.minimal.msg_heartbeat;
import java.net.DatagramPacket;
import java.net.InetAddress;
import tp.xmaihh.serialport.SerialHelper;
/**
* 心跳管理器类用于管理与飞控的心跳通信
*/
public class HeartbeatManager {
private static final String TAG = "HeartbeatManager";
private static final long HEARTBEAT_INTERVAL = 1000; // 心跳间隔1秒
private Handler heartbeatHandler;
private Runnable heartbeatRunnable;
private boolean isHeartbeatRunning = false;
private int connectionType; // 0: 串口, 1: UDP
private SerialHelper serialHelper;
private java.net.DatagramSocket serverSocket;
public HeartbeatManager(int type, SerialHelper serialHelper, java.net.DatagramSocket serverSocket) {
this.connectionType = type;
this.serialHelper = serialHelper;
this.serverSocket = serverSocket;
this.heartbeatHandler = new Handler(Looper.getMainLooper());
}
/**
* 方法启动心跳包发送
*/
public void startHeartbeat() {
if (!isHeartbeatRunning) {
isHeartbeatRunning = true;
heartbeatRunnable = new Runnable() {
@Override
public void run() {
if (isHeartbeatRunning) {
sendHeartbeat();
heartbeatHandler.postDelayed(this, HEARTBEAT_INTERVAL);
}
}
};
heartbeatHandler.post(heartbeatRunnable);
}
}
/**
* 方法停止心跳包发送
*/
public void stopHeartbeat() {
isHeartbeatRunning = false;
if (heartbeatHandler != null && heartbeatRunnable != null) {
heartbeatHandler.removeCallbacks(heartbeatRunnable);
}
}
/**
* 方法发送心跳包到飞控
*/
private void sendHeartbeat() {
try {
// 创建心跳消息
msg_heartbeat heartbeat = new msg_heartbeat();
// 设置心跳参数
heartbeat.type = 6; // GCS类型
heartbeat.autopilot = 8; // MAV_AUTOPILOT_INVALID
heartbeat.base_mode = 0;
heartbeat.custom_mode = 0;
heartbeat.system_status = 0; // MAV_STATE_UNINIT
// 编码为MAVLinkPacket
MAVLinkPacket packet = heartbeat.pack();
// 发送数据根据连接方式选择
if (connectionType == 0) {
// 串口发送
if (serialHelper != null) {
serialHelper.send(packet.encodePacket());
}
} else {
// UDP发送
try {
if (serverSocket != null && !serverSocket.isClosed()) {
InetAddress targetAddress = InetAddress.getByName("127.0.0.1");
int targetPort = 14553; // 默认MAVLink端口
DatagramPacket udpPacket = new DatagramPacket(
packet.encodePacket(),
packet.encodePacket().length,
targetAddress,
targetPort
);
serverSocket.send(udpPacket);
}
} catch (Exception e) {
Log.e(TAG, "发送心跳包失败: " + e.getMessage());
}
}
} catch (Exception e) {
Log.e(TAG, "构建心跳包失败: " + e.getMessage());
}
}
/**
* 方法设置连接类型
*/
public void setConnectionType(int type) {
this.connectionType = type;
}
/**
* 方法设置串口助手
*/
public void setSerialHelper(SerialHelper serialHelper) {
this.serialHelper = serialHelper;
}
/**
* 方法设置UDP套接字
*/
public void setServerSocket(java.net.DatagramSocket serverSocket) {
this.serverSocket = serverSocket;
}
/**
* 方法检查心跳是否正在运行
*/
public boolean isRunning() {
return isHeartbeatRunning;
}
}

View File

@ -0,0 +1,212 @@
package com.example.longyi_groundstation.Main.Void;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.widget.TextView;
/**
* 雷达高度数据解析器
* 用于解析以0xFF开头的数据包格式FF + 高度高字节 + 高度低字节 + 引爆高度 + 校验字节
* 支持高频率调用200Hz以上和传感器失效监测
*/
public class LidarDataParser {
// 解析状态定义
public static final int PARSE_STATE_HEAD = 0; // 等待包头
public static final int PARSE_STATE_PAYLOAD = 1; // 接收数据载荷
public static final int PARSE_STATE_CHECKSUM = 2; // 校验和检查
// 协议定义
public static final byte PROTOCOL_HEAD = (byte) 0xFF;
public static final int PROTOCOL_LENGTH = 5; // 总长度FF + 2字节高度 + 1字节引爆高度 + 1字节校验
// 监测相关常量
public static final int SENSOR_FAILURE_THRESHOLD = 5; // 失效阈值
public static final int UPDATE_INTERVAL = 1000; // 更新间隔(毫秒)
// 解析状态变量
public int parseStep = PARSE_STATE_HEAD; // 当前解析步骤
public int packetIndex = 0; // 数据包索引
public byte[] packetBuffer = new byte[5]; // 数据包缓冲区
// 监测相关变量
public int invalidCount = 0; // 无效计数
public boolean isSensorFailed = false; // 传感器是否失效
public static int[] parsedData = null; // 解析后的数据 [雷达高度, 引爆高度]
// UI更新相关
public static Handler uiHandler;
public static Runnable updateRunnable;
public static boolean isUpdating = false;
/**
* 解析单个字节数据高频率调用版本
* 建议在200Hz以上频率调用
*
* @param data 单个接收到的字节
* @return 1表示解析成功并更新了数据0表示未完成解析
*/
public int parseByte(byte data) {
int result = 0;
switch (parseStep) {
// 等待包头
case PARSE_STATE_HEAD:
if (data == PROTOCOL_HEAD) {
packetBuffer[packetIndex++] = data;
parseStep = PARSE_STATE_PAYLOAD;
}
break;
// 接收数据载荷
case PARSE_STATE_PAYLOAD:
packetBuffer[packetIndex++] = data;
// 检查是否收到完整数据包
if (packetIndex >= PROTOCOL_LENGTH) {
parseStep = PARSE_STATE_CHECKSUM;
}
break;
// 校验和检查
case PARSE_STATE_CHECKSUM:
int calculatedChecksum = 0;
// 计算前4个字节的校验和累加求和方式
for (int i = 0; i < 4; i++) {
calculatedChecksum += (packetBuffer[i] & 0xFF);
}
calculatedChecksum &= 0xFF; // 取低8位作为校验和
// 校验
if (calculatedChecksum == (packetBuffer[4] & 0xFF)) {
// 解析成功更新数据
int radarHeight = ((packetBuffer[1] & 0xFF) << 8) | (packetBuffer[2] & 0xFF);
int triggerHeight = packetBuffer[3] & 0xFF;
// Log.d("LidarDataParser", radarHeight + "m");
// 保存解析结果
parsedData = new int[]{radarHeight, triggerHeight};
// 重置监测计数
invalidCount = 0;
isSensorFailed = false;
result = 1;
} else {
// 校验失败增加错误计数
invalidCount++;
checkSensorFailure();
}
// 重置状态准备接收下一数据包
packetIndex = 0;
parseStep = PARSE_STATE_HEAD;
break;
}
return result;
}
/**
* 监测传感器状态
* 建议以10Hz频率定期调用
*/
private void checkSensorFailure() {
if (invalidCount > SENSOR_FAILURE_THRESHOLD) {
isSensorFailed = true;
}
}
/**
* 获取传感器失效状态
*
* @return true表示传感器失效false表示正常
*/
public boolean isSensorFailed() {
return isSensorFailed;
}
/**
* 获取解析后的数据
*
* @return int数组[0]为雷达高度[1]为引爆高度如果无有效数据则返回null
*/
public static int[] getParsedData() {
return parsedData;
}
/**
* 启动高度显示更新线程
* 每隔1秒更新TextView显示雷达高度数据
*
* @param textView 要更新的TextView
*/
public static void startHeightUpdate(TextView textView) {
if (isUpdating) {
stopHeightUpdate();
}
isUpdating = true;
uiHandler = new Handler(Looper.getMainLooper());
updateRunnable = new Runnable() {
@Override
public void run() {
if (isUpdating) {
int[] data = getParsedData();
if (data != null && textView != null) {
// Log.d("startHeightUpdate", "激光:"+data[0]+"m"+" 引爆:"+data[1]+"m");
textView.setText(data[0] + "m");
} else if (textView != null) {
textView.setText("--");
}
// 每隔1秒更新一次
uiHandler.postDelayed(this, UPDATE_INTERVAL);
}
}
};
// 立即开始更新
uiHandler.post(updateRunnable);
}
/**
* 停止高度显示更新
*/
public static void stopHeightUpdate() {
isUpdating = false;
if (uiHandler != null && updateRunnable != null) {
uiHandler.removeCallbacks(updateRunnable);
uiHandler = null;
updateRunnable = null;
}
}
/**
* 检查是否正在更新UI
*
* @return true表示正在更新false表示未更新
*/
public boolean isUpdating() {
return isUpdating;
}
/**
* 重置传感器状态和解析器状态
*/
public void reset() {
invalidCount = 0;
isSensorFailed = false;
packetIndex = 0;
parseStep = PARSE_STATE_HEAD;
parsedData = null;
}
/**
* 增加无效计数用于外部监测调用
*/
public void incrementInvalidCount() {
invalidCount++;
checkSensorFailure();
}
}

View File

@ -6,10 +6,10 @@ import android.util.Log;
public class LogUtil {
public static void d(String tag, String msg) {
// 正常打印日志
// Log.d(tag, msg);
Log.d(tag, msg);
// 保存日志到文件
LogManager.getInstance().saveLog(tag, msg);
// LogManager.getInstance().saveLog(tag, msg);
}
// 可以添加其他级别的日志方法 (e, w, i等)

View File

@ -163,7 +163,7 @@ public class MapVoid {
}
} catch (Exception e) {
// e.printStackTrace();
Log.d(TAG, "error: "+e);
Log.d("cui_error", "error: "+e);
// 2秒后再次执行
flightTrackHandler.postDelayed(this, 600);
}
@ -194,17 +194,17 @@ public class MapVoid {
flightTrackPolyline.remove();
}
// 控制轨迹点数量不超过20个
if (flightTrackPoints.size() > 2048) {
flightTrackPoints.remove(0); // 删除最后一个点
}
List<LatLng> sparsePoints = new ArrayList<>();
// 每5个点取1个点减少点密度
for (int i = 0; i < flightTrackPoints.size(); i += 5) {
for (int i = 0; i < flightTrackPoints.size(); i++) {
sparsePoints.add(flightTrackPoints.get(i));
}
// 控制轨迹点数量不超过20个
if (flightTrackPoints.size() > 300) {
flightTrackPoints.remove(0); // 删除最后一个点
}
flightTrackPolyline = allView.map.getMap().addPolyline(new PolylineOptions()
.addAll(sparsePoints)
.width(12)
@ -230,6 +230,33 @@ public class MapVoid {
flightTrackPoints.clear();
}
/**
* 计算两个带高度的坐标点之间的直线距离单位厘米返回整数
* @param latLng1 第一个坐标点包含纬度经度
* @param altitude1 第一个点的高度
* @param latLng2 第二个坐标点包含纬度经度
* @param altitude2 第二个点的高度
* @return 距离厘米整数
*/
public static int calculateDistanceWithAltitudeInCm(LatLng latLng1, double altitude1,
LatLng latLng2, double altitude2) {
if (latLng1 == null || latLng2 == null) {
return 0;
}
// 计算水平距离
double horizontalDistance = AMapUtils.calculateLineDistance(latLng1, latLng2);
// 计算高度差
double altitudeDifference = Math.abs(altitude2 - altitude1);
// 使用三维勾股定理计算直线距离
double straightDistance = Math.sqrt(horizontalDistance * horizontalDistance +
altitudeDifference * altitudeDifference);
// 转换为厘米并返回整数
return (int) Math.round(straightDistance * 100);
}

View File

@ -47,7 +47,7 @@ public class SQLClass extends SQLiteOpenHelper {
// 数据库名称和版本
private static final String DATABASE_NAME = "create_link_list.db";
private static final int DATABASE_VERSION = 1;
private static final int DATABASE_VERSION = 4; // 更新版本号以支持stop_time字段
// 主表 - 存储列表信息
private static final String TABLE_LINK_LIST = "link_list";
@ -65,9 +65,15 @@ public class SQLClass extends SQLiteOpenHelper {
private static final String COLUMN_WAYPOINT_INDEX = "waypoint_index";
private static final String COLUMN_LATITUDE = "latitude";
private static final String COLUMN_LONGITUDE = "longitude";
private static final String COLUMN_BOM1_SELECT = "bom1_select";
private static final String COLUMN_BOM2_SELECT = "bom2_select";
// CreateLink类中的字段
private static final String COLUMN_BOM1_SELECT = "bom1_select";
private static final String COLUMN_BOM1_SHOW = "bom1_show";
private static final String COLUMN_BOM1_HEIGHT = "bom1_height";
private static final String COLUMN_BOM2_SELECT = "bom2_select";
private static final String COLUMN_BOM2_SHOW = "bom2_show";
private static final String COLUMN_BOM2_HEIGHT = "bom2_height";
private static final String COLUMN_STOP_TIME = "stop_time"; // 新增字段
private static final String COLUMN_ITEM_ORDER = "item_order"; // 项在列表中的顺序
@ -78,7 +84,7 @@ public class SQLClass extends SQLiteOpenHelper {
COLUMN_LIST_NAME + " TEXT NOT NULL, " +
COLUMN_CREATED_TIME + " INTEGER NOT NULL)";
// 创建详情表的SQL语句
// 创建详情表的SQL语句包含所有字段
private static final String CREATE_ITEMS_TABLE_SQL =
"CREATE TABLE " + TABLE_LINK_ITEMS + " (" +
COLUMN_ITEM_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
@ -89,6 +95,13 @@ public class SQLClass extends SQLiteOpenHelper {
COLUMN_WAYPOINT_INDEX + " INTEGER NOT NULL, " +
COLUMN_LATITUDE + " REAL, " +
COLUMN_LONGITUDE + " REAL, " +
COLUMN_BOM1_SELECT + " INTEGER DEFAULT 0, " +
COLUMN_BOM1_SHOW + " INTEGER DEFAULT 0, " +
COLUMN_BOM1_HEIGHT + " INTEGER DEFAULT 0, " +
COLUMN_BOM2_SELECT + " INTEGER DEFAULT 0, " +
COLUMN_BOM2_SHOW + " INTEGER DEFAULT 0, " +
COLUMN_BOM2_HEIGHT + " INTEGER DEFAULT 0, " +
COLUMN_STOP_TIME + " INTEGER DEFAULT 0, " + // 新增字段
COLUMN_ITEM_ORDER + " INTEGER NOT NULL, " +
"FOREIGN KEY(" + COLUMN_LIST_REF_ID + ") REFERENCES " +
TABLE_LINK_LIST + "(" + COLUMN_LIST_ID + ") ON DELETE CASCADE)";
@ -105,9 +118,31 @@ public class SQLClass extends SQLiteOpenHelper {
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_LINK_ITEMS);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_LINK_LIST);
onCreate(db);
if (oldVersion < 2) {
// 添加第2版新增的列
db.execSQL("ALTER TABLE " + TABLE_LINK_ITEMS + " ADD COLUMN " + COLUMN_BOM1_SELECT + " INTEGER DEFAULT 0");
db.execSQL("ALTER TABLE " + TABLE_LINK_ITEMS + " ADD COLUMN " + COLUMN_BOM2_SELECT + " INTEGER DEFAULT 0");
}
if (oldVersion < 3) {
// 添加第3版新增的列
db.execSQL("ALTER TABLE " + TABLE_LINK_ITEMS + " ADD COLUMN " + COLUMN_BOM1_SHOW + " INTEGER DEFAULT 0");
db.execSQL("ALTER TABLE " + TABLE_LINK_ITEMS + " ADD COLUMN " + COLUMN_BOM1_HEIGHT + " INTEGER DEFAULT 0");
db.execSQL("ALTER TABLE " + TABLE_LINK_ITEMS + " ADD COLUMN " + COLUMN_BOM2_SHOW + " INTEGER DEFAULT 0");
db.execSQL("ALTER TABLE " + TABLE_LINK_ITEMS + " ADD COLUMN " + COLUMN_BOM2_HEIGHT + " INTEGER DEFAULT 0");
}
if (oldVersion < 4) {
// 添加第4版新增的列stop_time字段
db.execSQL("ALTER TABLE " + TABLE_LINK_ITEMS + " ADD COLUMN " + COLUMN_STOP_TIME + " INTEGER DEFAULT 0");
}
if (oldVersion < 1 || oldVersion >= 4) {
// 原有的升级逻辑版本1或更高版本时
db.execSQL("DROP TABLE IF EXISTS " + TABLE_LINK_ITEMS);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_LINK_LIST);
onCreate(db);
}
}
@Override
@ -155,6 +190,16 @@ public class SQLClass extends SQLiteOpenHelper {
itemValues.put(COLUMN_SPEED, createLink.getSpeed());
itemValues.put(COLUMN_WAYPOINT_INDEX, createLink.getWaypointIndex());
// 添加所有字段的处理
itemValues.put(COLUMN_BOM1_SELECT, createLink.isBom1_select() ? 1 : 0);
itemValues.put(COLUMN_BOM1_SHOW, createLink.isBom1_show() ? 1 : 0);
itemValues.put(COLUMN_BOM1_HEIGHT, createLink.getBom1_height());
itemValues.put(COLUMN_BOM2_SELECT, createLink.isBom2_select() ? 1 : 0);
itemValues.put(COLUMN_BOM2_SHOW, createLink.isBom2_show() ? 1 : 0);
itemValues.put(COLUMN_BOM2_HEIGHT, createLink.getBom2_height());
// 新增字段处理
itemValues.put(COLUMN_STOP_TIME, createLink.getStop_time());
if (createLink.getLatLng() != null) {
itemValues.put(COLUMN_LATITUDE, createLink.getLatLng().latitude);
itemValues.put(COLUMN_LONGITUDE, createLink.getLatLng().longitude);
@ -239,11 +284,28 @@ public class SQLClass extends SQLiteOpenHelper {
int waypointIndex = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_WAYPOINT_INDEX));
double latitude = cursor.getDouble(cursor.getColumnIndexOrThrow(COLUMN_LATITUDE));
double longitude = cursor.getDouble(cursor.getColumnIndexOrThrow(COLUMN_LONGITUDE));
// boolean bom1_select = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_BOM1_SELECT)) == 1;
// boolean bom2_select = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_BOM2_SELECT)) == 1;
// 获取字段的值
boolean bom1_select = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_BOM1_SELECT)) == 1;
boolean bom1_show = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_BOM1_SHOW)) == 1;
int bom1_height = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_BOM1_HEIGHT));
boolean bom2_select = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_BOM2_SELECT)) == 1;
boolean bom2_show = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_BOM2_SHOW)) == 1;
int bom2_height = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_BOM2_HEIGHT));
// 新增字段读取
int stop_time = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_STOP_TIME));
LatLng latLng = new LatLng(latitude, longitude);
CreateLink createLink = new CreateLink(name, height, speed, waypointIndex, latLng);
CreateLink createLink = new CreateLink(name, height, speed, waypointIndex, latLng,stop_time, bom1_show, bom2_show);
// 设置其他字段
createLink.setBom1_select(bom1_select);
createLink.setBom1_height(bom1_height);
createLink.setBom2_select(bom2_select);
createLink.setBom2_height(bom2_height);
createLink.setBom2_show(bom2_show);
// 设置新增字段
createLink.setStop_time(stop_time);
createLinkList.add(createLink);
} while (cursor.moveToNext());
}
@ -299,6 +361,16 @@ public class SQLClass extends SQLiteOpenHelper {
itemValues.put(COLUMN_SPEED, createLink.getSpeed());
itemValues.put(COLUMN_WAYPOINT_INDEX, createLink.getWaypointIndex());
// 添加所有字段的处理
itemValues.put(COLUMN_BOM1_SELECT, createLink.isBom1_select() ? 1 : 0);
itemValues.put(COLUMN_BOM1_SHOW, createLink.isBom1_show() ? 1 : 0);
itemValues.put(COLUMN_BOM1_HEIGHT, createLink.getBom1_height());
itemValues.put(COLUMN_BOM2_SELECT, createLink.isBom2_select() ? 1 : 0);
itemValues.put(COLUMN_BOM2_SHOW, createLink.isBom2_show() ? 1 : 0);
itemValues.put(COLUMN_BOM2_HEIGHT, createLink.getBom2_height());
// 新增字段处理
itemValues.put(COLUMN_STOP_TIME, createLink.getStop_time());
if (createLink.getLatLng() != null) {
itemValues.put(COLUMN_LATITUDE, createLink.getLatLng().latitude);
itemValues.put(COLUMN_LONGITUDE, createLink.getLatLng().longitude);

View File

@ -80,12 +80,12 @@ public class SerialTool {
* @return 包含解析结果的数组[0]为第23字节组合的值[1]为第4字节的值校验失败返回null
*/
public static int[] parseSerialData(byte[] data) {
if (data == null || data.length < 4) {
if (data == null || data.length < 5) {
throw new IllegalArgumentException("数据长度不足,无法解析");
}
// 校验第4个字节应该等于前三个字节之和的低8位
int checksum = (data[0] & 0xFF) + (data[1] & 0xFF) + (data[2] & 0xFF);
int checksum = (data[1] & 0xFF) + (data[2] & 0xFF) + (data[3] & 0xFF);
checksum = checksum & 0xFF; // 取低8位
// 如果校验失败返回null

View File

@ -0,0 +1,8 @@
package com.example.longyi_groundstation.Util.Http;
public class HttpUrl {
public static final String BASE_URL = "https://api.longyi-uav-cloud.com";
public static final String LOGIN = BASE_URL + "/admin-api/system/auth/login";
}

View File

@ -0,0 +1,130 @@
package com.example.longyi_groundstation.Util.Http;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import okhttp3.Callback;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/**
* 基于OkHttp3的网络请求工具类
*/
public class HttpUtil {
private static final MediaType MEDIA_TYPE_JSON = MediaType.parse("application/json; charset=utf-8");
private static final MediaType MEDIA_TYPE_FORM = MediaType.parse("application/x-www-form-urlencoded");
private OkHttpClient client;
public HttpUtil() {
this.client = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.retryOnConnectionFailure(true)
.build();
}
/**
* GET请求
* @param url 请求地址
* @param headers 请求头
* @param callback 回调函数
*/
public void get(String url, Map<String, String> headers, Callback callback) {
Request.Builder builder = new Request.Builder().url(url);
// 添加请求头
addHeaders(builder, headers);
Request request = builder.get().build();
client.newCall(request).enqueue(callback);
}
/**
* POST请求 - JSON格式
* @param url 请求地址
* @param json JSON数据
* @param headers 请求头
* @param callback 回调函数
*/
public void postJson(String url, String json, Map<String, String> headers, Callback callback) {
RequestBody body = RequestBody.create(json, MEDIA_TYPE_JSON);
Request.Builder builder = new Request.Builder()
.url(url)
.post(body);
addHeaders(builder, headers);
Request request = builder.build();
client.newCall(request).enqueue(callback);
}
/**
* POST请求 - 表单格式
* @param url 请求地址
* @param formData 表单数据
* @param headers 请求头
* @param callback 回调函数
*/
public void postForm(String url, String formData, Map<String, String> headers, Callback callback) {
RequestBody body = RequestBody.create(formData, MEDIA_TYPE_FORM);
Request.Builder builder = new Request.Builder()
.url(url)
.post(body);
addHeaders(builder, headers);
Request request = builder.build();
client.newCall(request).enqueue(callback);
}
/**
* 同步GET请求
* @param url 请求地址
* @param headers 请求头
* @return Response响应对象
* @throws IOException IO异常
*/
public Response executeGet(String url, Map<String, String> headers) throws IOException {
Request.Builder builder = new Request.Builder().url(url);
addHeaders(builder, headers);
Request request = builder.get().build();
return client.newCall(request).execute();
}
/**
* 同步POST请求 - JSON格式
* @param url 请求地址
* @param json JSON数据
* @param headers 请求头
* @return Response响应对象
* @throws IOException IO异常
*/
public Response executePostJson(String url, String json, Map<String, String> headers) throws IOException {
RequestBody body = RequestBody.create(json, MEDIA_TYPE_JSON);
Request.Builder builder = new Request.Builder().url(url).post(body);
addHeaders(builder, headers);
Request request = builder.build();
return client.newCall(request).execute();
}
/**
* 添加请求头
* @param builder Request.Builder构建器
* @param headers 请求头Map
*/
private void addHeaders(Request.Builder builder, Map<String, String> headers) {
if (headers != null) {
for (Map.Entry<String, String> entry : headers.entrySet()) {
builder.addHeader(entry.getKey(), entry.getValue());
}
}
}
}

View File

@ -0,0 +1,65 @@
package com.example.longyi_groundstation.Util;
import static android.content.Context.MODE_PRIVATE;
import android.content.Context;
import android.util.Log;
import org.json.JSONObject;
public class SharedPreferencesTool {
private static String TAG = "SharedPreferencesTool";
public static void saveLogin(Context context, JSONObject userData) {
try {
// 使用 SharedPreferences 保存用户信息
android.content.SharedPreferences sharedPreferences =
context.getSharedPreferences("user_info", MODE_PRIVATE);
android.content.SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putInt("id", userData.getInt("id"));
editor.putString("avatar", userData.getString("avatar"));
editor.putString("nickname", userData.getString("nickname"));
editor.putString("mobile", userData.getString("mobile"));
editor.putLong("create_time", userData.getLong("create_time"));
editor.putLong("update_time", userData.getLong("update_time"));
editor.putInt("is_active", userData.getInt("is_active"));
editor.putInt("sort", userData.getInt("sort"));
editor.putString("token", userData.getString("token"));
editor.apply(); // 异步保存
}catch (Exception e){
Log.d(TAG, "saveLogin:error " + e);
}
}
public static String getToken(Context context){
android.content.SharedPreferences sharedPreferences =
context.getSharedPreferences("user_info", MODE_PRIVATE);
String token = sharedPreferences.getString("token", null);
return token;
}
public static JSONObject getUserInfo(Context context){
android.content.SharedPreferences sharedPreferences =
context.getSharedPreferences("user_info", MODE_PRIVATE);
JSONObject userInfo = new JSONObject();
try {
userInfo.put("id", sharedPreferences.getInt("id", 0));
userInfo.put("avatar", sharedPreferences.getString("avatar", ""));
userInfo.put("nickname", sharedPreferences.getString("nickname", ""));
userInfo.put("mobile", sharedPreferences.getString("mobile", ""));
userInfo.put("create_time", sharedPreferences.getLong("create_time", 0));
userInfo.put("update_time", sharedPreferences.getLong( "update_time", 0));
userInfo.put("is_active", sharedPreferences.getInt("is_active", 0));
userInfo.put("sort", sharedPreferences.getInt("sort", 0));
userInfo.put("token", sharedPreferences.getString("token", ""));
return userInfo;
}catch (Exception e){
return null;
}
}
}

View File

@ -1,18 +0,0 @@
package com.example.longyi_groundstation.Util;
public class Url {
public static String getBaseUrl() {
return "https://api.longyi-uav-cloud.com";
}
/**
* 方法登录接口
*
* @cuijingzhou
*/
public static String LoginUrl() {
return getBaseUrl() + "/admin-api/system/auth/login";
}
}

View File

@ -5,7 +5,7 @@
<stroke
android:width="0.3dp"
android:color="#101010"/>
android:color="#3A3A3A"/>
<solid android:color="#C4101010"/>

View File

@ -7,6 +7,6 @@
android:width="0.5dp"
android:color="#303030"/>
<solid android:color="#80ECECEC"/>
<solid android:color="#4D9E9C9C"/>
</shape>

View File

@ -3,7 +3,7 @@
<corners android:radius="16dp"/>
<solid android:color="#80555f75"/>
<solid android:color="#CC3D4453"/>
</shape>

View File

@ -3,7 +3,7 @@
<corners android:radius="4dp"/>
<solid android:color="#80555f75"/>
<solid android:color="#CC3D4453"/>
</shape>

View File

@ -3,6 +3,6 @@
<corners android:radius="2dp"/>
<solid android:color="#8DECEC"/>
<solid android:color="#029B45"/>
</shape>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp"/>
<stroke
android:width="0.5dp"
android:color="#029a45"/>
</shape>

View File

@ -3,6 +3,6 @@
<corners android:radius="4dp"/>
<solid android:color="#112446"/>
<solid android:color="#403B3A"/>
</shape>

View File

@ -2,6 +2,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="1dp" />
<stroke android:color="#33B138" android:width="0.4dp" />
<stroke android:color="#4D33B138" android:width="0.4dp" />
</shape>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp"/>
<stroke
android:width="0.5dp"
android:color="#029a45"/>
<solid android:color="#909090"/>
</shape>

View File

@ -3,7 +3,7 @@
<corners android:radius="8dp"/>
<solid android:color="#94555F75"/>
<solid android:color="#CC3D4453"/>

View File

@ -3,6 +3,6 @@
<corners android:radius="4dp"/>
<solid android:color="#BD202020"/>
<solid android:color="#D9202020"/>
</shape>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp"/>
<solid android:color="#E6687286"/>
</shape>

View File

@ -153,7 +153,7 @@
android:layout_marginTop="10dp"
android:layout_width="180dp"
android:layout_height="40dp"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/cc3d4453_4round_bg"
android:gravity="center"
android:orientation="horizontal">

View File

@ -14,7 +14,7 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="20dp"
android:background="@drawable/x94555f75_16round_bg"
android:background="@drawable/cc3d4453_16round_bg"
android:elevation="4dp">
<TextView
@ -85,7 +85,7 @@
android:layout_height="28dp"
android:text="登录"
android:textColor="@android:color/white"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/xff555f75_4round_bg"
android:layout_marginBottom="16dp"
/>

View File

@ -311,8 +311,8 @@
<!-- 底部状态栏 -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_height="90dp"
android:layout_marginRight="10dp"
android:gravity="right"
android:orientation="horizontal"
tools:ignore="RtlHardcoded">
@ -446,7 +446,7 @@
android:background="@drawable/b2ffffff_4round_1stroke_bg"
android:gravity="center"
android:padding="5dp"
android:visibility="gone">
android:visibility="visible">
<ImageView
android:layout_width="15dp"
@ -577,7 +577,6 @@
</LinearLayout>
<!-- 初始化航线列表 -->
<LinearLayout
android:id="@+id/ll_create_link_layout"
android:minHeight="35dp"
@ -789,8 +788,6 @@
</LinearLayout>
<!-- 所有航线 -->
<LinearLayout
android:id="@+id/ll_all_link_layout"
@ -805,7 +802,7 @@
android:visibility="gone">
<LinearLayout
android:layout_width="190dp"
android:layout_width="235dp"
android:layout_height="wrap_content"
android:background="@drawable/ffffffff_4round_1stroke_bg"
android:orientation="horizontal"
@ -1311,7 +1308,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:visibility="visible">
android:visibility="gone">
<View
android:layout_width="0.2dp"
@ -1477,7 +1474,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:gravity="center"
android:text="广播"
android:text="喊话"
android:textColor="#ffffff"
android:textSize="7sp" />
@ -1510,14 +1507,17 @@
<!-- 航线规划 -->
<LinearLayout
android:paddingLeft="20dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:paddingBottom="30dp"
android:id="@+id/ll_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_title"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical"
android:gravity="center_horizontal"
android:visibility="gone">
<LinearLayout
@ -1564,6 +1564,138 @@
</LinearLayout>
<LinearLayout
android:id="@+id/ll_marker_ctrl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:gravity="center"
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="28dp"
android:layout_marginTop="4dp"
android:background="@drawable/ffffffff_4round_bg"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="2dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ffffff"
android:text="移动距离"
android:textColor="#303030"
android:textSize="9sp" />
<EditText
android:id="@+id/et_marker_distance"
android:layout_width="0dp"
android:layout_height="28dp"
android:layout_weight="1"
android:background="#ffffff"
android:gravity="center"
android:text="10"
android:textColor="#303030"
android:textSize="7sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ffffff"
android:paddingRight="5dp"
android:text="米"
android:textColor="#303030"
android:textSize="9sp" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_marker_top"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/x80000000_4round_bg"
android:padding="3dp"
android:src="@mipmap/icon_ptz_top" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_marker_left"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/x80000000_4round_bg"
android:padding="3dp"
android:src="@mipmap/icon_ptz_left" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_marker_right"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/x80000000_4round_bg"
android:padding="3dp"
android:src="@mipmap/icon_ptz_right" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_marker_bottom"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/x80000000_4round_bg"
android:padding="3dp"
android:src="@mipmap/icon_ptz_down" />
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!-- 航线执行 -->
@ -1631,7 +1763,6 @@
</LinearLayout>
<LinearLayout
android:id="@+id/ll_link_start_fun2"
android:layout_width="65dp"
@ -1654,7 +1785,7 @@
<LinearLayout
android:id="@+id/ll_link_start_back"
android:layout_width="match_parent"
android:layout_width="65dp"
android:layout_height="28dp"
android:layout_marginTop="10dp"
android:background="@drawable/b2101010_4round_1stroke_bg"
@ -1672,6 +1803,8 @@
</LinearLayout>
</LinearLayout>
<!-- 右下角辅助按钮 -->

View File

@ -55,7 +55,7 @@
<TextView
android:textSize="12sp"
android:layout_marginTop="3dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:textColor="#ffffff"
android:id="@+id/tv_foundation"
android:gravity="center"
@ -66,7 +66,7 @@
<TextView
android:textSize="12sp"
android:layout_marginTop="1dp"
android:background="@drawable/b2303030_4round_1stroke_bg"
android:background="@drawable/ffffffff_4round_bg"
android:textColor="#303030"
android:id="@+id/tv_control"
android:gravity="center"
@ -77,7 +77,7 @@
<TextView
android:textSize="12sp"
android:layout_marginTop="1dp"
android:background="@drawable/b2303030_4round_1stroke_bg"
android:background="@drawable/ffffffff_4round_bg"
android:textColor="#303030"
android:id="@+id/tv_fly"
android:gravity="center"
@ -88,7 +88,7 @@
<TextView
android:textSize="12sp"
android:layout_marginTop="1dp"
android:background="@drawable/b2303030_4round_1stroke_bg"
android:background="@drawable/ffffffff_4round_bg"
android:textColor="#303030"
android:id="@+id/tv_secure"
android:gravity="center"
@ -99,7 +99,7 @@
<TextView
android:textSize="12sp"
android:layout_marginTop="1dp"
android:background="@drawable/b2303030_4round_1stroke_bg"
android:background="@drawable/ffffffff_4round_bg"
android:textColor="#303030"
android:id="@+id/tv_motor"
android:gravity="center"
@ -110,7 +110,7 @@
<TextView
android:textSize="12sp"
android:layout_marginTop="1dp"
android:background="@drawable/b2303030_4round_1stroke_bg"
android:background="@drawable/ffffffff_4round_bg"
android:textColor="#303030"
android:id="@+id/tv_load"
android:gravity="center"
@ -122,7 +122,7 @@
<TextView
android:textSize="12sp"
android:layout_marginTop="1dp"
android:background="@drawable/b2303030_4round_1stroke_bg"
android:background="@drawable/ffffffff_4round_bg"
android:textColor="#303030"
android:id="@+id/tv_sensor"
android:gravity="center"
@ -135,7 +135,7 @@
android:textSize="12sp"
android:id="@+id/tv_parameter"
android:layout_marginTop="1dp"
android:background="@drawable/b2303030_4round_1stroke_bg"
android:background="@drawable/ffffffff_4round_bg"
android:textColor="#303030"
android:gravity="center"
android:text="专家设置"

View File

@ -7,7 +7,7 @@
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:layout_marginBottom="3dp"
android:layout_width="190dp"
android:layout_width="235dp"
android:layout_height="wrap_content">
<LinearLayout
@ -109,6 +109,19 @@
android:layout_width="40dp"
android:layout_height="28dp"/>
<TextView
android:layout_marginLeft="5dp"
android:layout_gravity="center_vertical"
android:layout_alignParentRight="true"
android:id="@+id/tv_edit"
android:gravity="center"
android:textColor="#ffffff"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:textSize="9sp"
android:text="编辑"
android:layout_width="40dp"
android:layout_height="28dp"/>
</LinearLayout>

View File

@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="310dp"
android:background="@drawable/ff33b138_1round_1stroke"
android:layout_height="wrap_content">
<LinearLayout
@ -22,6 +23,7 @@
android:layout_height="match_parent"/>
<EditText
android:maxLines="1"
android:textColor="#ffffff"
android:background="@drawable/ff33b138_1round_1stroke"
android:gravity="center"
@ -32,6 +34,7 @@
android:layout_height="match_parent"/>
<EditText
android:maxLines="1"
android:textColor="#ffffff"
android:background="@drawable/ff33b138_1round_1stroke"
android:gravity="center"
@ -41,7 +44,20 @@
android:layout_width="40dp"
android:layout_height="match_parent"/>
<EditText
android:maxLines="1"
android:textColor="#ffffff"
android:background="@drawable/ff33b138_1round_1stroke"
android:gravity="center"
android:text="110.1234567"
android:textSize="7sp"
android:id="@+id/et_lon"
android:layout_width="60dp"
android:layout_height="match_parent"/>
<EditText
android:maxLines="1"
android:textColor="#ffffff"
android:background="@drawable/ff33b138_1round_1stroke"
android:gravity="center"
@ -52,16 +68,6 @@
android:layout_height="match_parent"/>
<EditText
android:textColor="#ffffff"
android:background="@drawable/ff33b138_1round_1stroke"
android:gravity="center"
android:text="110.1234567"
android:textSize="7sp"
android:id="@+id/et_lon"
android:layout_width="60dp"
android:layout_height="match_parent"/>
<LinearLayout
android:gravity="center"
@ -98,7 +104,7 @@
</LinearLayout>
<LinearLayout
android:visibility="visible"
android:visibility="gone"
android:id="@+id/ll_expand"
android:orientation="horizontal"
android:layout_width="match_parent"
@ -137,58 +143,13 @@
android:gravity="right|center"
android:textColor="#ffffff"
android:textSize="7sp"
android:text="转弯方式"
android:text="转弯时间"
android:layout_width="45dp"
android:layout_height="match_parent"/>
<RelativeLayout
android:layout_marginLeft="1dp"
android:layout_width="60dp"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/rl_turn"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:gravity="center"
android:id="@+id/tv_turn"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:textColor="#ffffff"
android:textSize="7sp"
android:text="协调转弯"
android:layout_width="60dp"
android:padding="5dp"
android:layout_height="wrap_content"/>
<ImageView
android:layout_marginRight="5dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@mipmap/icon_spinner_dowm"
android:layout_width="8dp"
android:layout_height="8dp"/>
</RelativeLayout>
<Spinner
android:id="@+id/sp_turn"
android:layout_below="@+id/rl_turn"
android:layout_width="match_parent"
android:layout_height="0dp"
android:spinnerMode="dropdown"/>
</RelativeLayout>
<LinearLayout
android:visibility="gone"
android:visibility="visible"
android:layout_gravity="center_vertical"
android:id="@+id/ll_turn"
android:orientation="horizontal"
@ -197,6 +158,7 @@
<EditText
android:maxLines="1"
android:id="@+id/et_turn_time"
android:layout_gravity="center_vertical"
android:text="1"
@ -217,6 +179,15 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<TextView
android:layout_marginLeft="1dp"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="6sp"
android:text="0=协调转弯 >0秒定点转弯"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
</LinearLayout>

View File

@ -4,9 +4,10 @@
android:layout_height="wrap_content">
<TextView
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:id="@+id/tv_item"
android:layout_width="100dp"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:layout_margin="6dp"
android:textColor="@android:color/white"

View File

@ -4,7 +4,7 @@
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:id="@+id/ll_main"
android:background="@drawable/ff8decec_2round_bg"
android:background="@drawable/ff029b45_2round_bg"
android:orientation="vertical"
android:layout_centerInParent="true"
android:padding="8dp">
@ -15,7 +15,7 @@
android:id="@+id/param_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp" />
android:textSize="11sp" />
</LinearLayout>

View File

@ -4,7 +4,7 @@
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:id="@+id/ll_main"
android:background="@drawable/ff8decec_2round_bg"
android:background="@drawable/ff029b45_2round_bg"
android:orientation="horizontal"
android:layout_centerInParent="true"
android:padding="8dp">
@ -16,7 +16,7 @@
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="14sp" />
android:textSize="11sp" />
<TextView
android:gravity="center"
@ -26,7 +26,7 @@
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="14sp" />
android:textSize="11sp" />

View File

@ -33,7 +33,7 @@
android:layout_height="22dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -58,7 +58,7 @@
android:layout_height="22dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -89,7 +89,7 @@
<TextView
android:id="@+id/tv_value_on_minus"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:layout_width="20dp"
android:layout_height="20dp"
android:gravity="center"
@ -112,7 +112,7 @@
<TextView
android:id="@+id/tv_value_on_add"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:layout_width="20dp"
android:layout_height="20dp"
android:gravity="center"
@ -133,7 +133,7 @@
<TextView
android:id="@+id/tv_value_off_minus"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:layout_width="20dp"
android:layout_height="20dp"
android:gravity="center"
@ -156,7 +156,7 @@
<TextView
android:id="@+id/tv_value_off_add"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:layout_width="20dp"
android:layout_height="20dp"
android:gravity="center"

View File

@ -11,7 +11,7 @@
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="8sp"
android:textSize="9sp"
android:maxWidth="400dp"
android:minWidth="0dp"
android:singleLine="true"

View File

@ -17,7 +17,7 @@
android:background="@drawable/ff029a45_4round_bg"
android:gravity="center"
android:padding="8dp"
android:text="投弹"
android:text="投弹设置"
android:textColor="#fff"
android:textSize="13sp" />

View File

@ -92,6 +92,7 @@
android:layout_height="wrap_content"/>
<EditText
android:id="@+id/et_height"
android:padding="6dp"
android:background="@drawable/ffffffff_4round_bg"
android:textColor="#101010"
@ -118,6 +119,7 @@
android:layout_height="wrap_content"/>
<EditText
android:id="@+id/et_speed"
android:padding="6dp"
android:background="@drawable/ffffffff_4round_bg"
android:textColor="#101010"

View File

@ -11,7 +11,7 @@
android:textSize="10sp"
android:layout_alignParentRight="true"
android:layout_margin="6dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:textColor="#ffffff"
android:id="@+id/tv_calibration"
android:gravity="center"

View File

@ -32,7 +32,7 @@
android:layout_marginRight="20dp"
android:gravity="center"
android:textColor="#ffffff"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:textSize="10sp"
android:text="恢复默认"
android:paddingLeft="20dp"
@ -45,7 +45,7 @@
android:id="@+id/tv_save"
android:gravity="center"
android:textColor="#ffffff"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:textSize="10sp"
android:text="保存"
android:layout_width="42dp"
@ -80,7 +80,7 @@
android:text="-"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<!-- 滑动条 -->
<SeekBar
@ -104,7 +104,7 @@
android:text="+"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<TextView
@ -145,7 +145,7 @@
android:text="-"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<!-- 滑动条 -->
<SeekBar
@ -168,7 +168,7 @@
android:text="+"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<TextView
@ -209,7 +209,7 @@
android:text="-"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<!-- 滑动条 -->
<SeekBar
@ -232,7 +232,7 @@
android:text="+"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<TextView
@ -274,7 +274,7 @@
android:text="-"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<!-- 滑动条 -->
<SeekBar
@ -297,7 +297,7 @@
android:text="+"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<TextView
@ -338,7 +338,7 @@
android:text="-"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<!-- 滑动条 -->
<SeekBar
@ -360,7 +360,7 @@
android:text="+"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<TextView

View File

@ -34,7 +34,7 @@
<TextView
android:id="@+id/tv_save"
android:layout_alignParentRight="true"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="10sp"
@ -46,7 +46,6 @@
</RelativeLayout>
<LinearLayout
android:layout_marginLeft="12dp"
android:layout_width="match_parent"
@ -80,7 +79,7 @@
<TextView
android:id="@+id/tv_low_end_text"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="10sp"
@ -133,7 +132,7 @@
<TextView
android:id="@+id/tv_mid_range_text"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="10sp"
@ -186,7 +185,7 @@
<TextView
android:id="@+id/tv_high_end_text"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="10sp"
@ -220,4 +219,65 @@
</LinearLayout>
<RelativeLayout
android:layout_margin="12dp"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:textStyle="bold"
android:gravity="right"
android:layout_gravity="center_vertical"
android:textSize="11sp"
android:text="航线/指点最大飞行速度:"
android:textColor="#ffffff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
<LinearLayout
android:layout_marginTop="12dp"
android:layout_marginLeft="36dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_centerVertical="true"
android:textSize="10sp"
android:text="速度:"
android:textColor="#ffffff"
android:layout_width="100dp"
android:layout_height="wrap_content"/>
<RelativeLayout
android:layout_toRightOf="@+id/tv_high_end"
android:layout_width="80dp"
android:layout_height="wrap_content">
<EditText
android:inputType="number"
android:id="@+id/et_speed_text"
android:background="@drawable/ffffffff_4round_bg"
android:gravity="center"
android:textColor="#303030"
android:textSize="10sp"
android:text="6"
android:layout_width="80dp"
android:padding="5dp"
android:layout_height="wrap_content"/>
</RelativeLayout>
<TextView
android:textSize="10sp"
android:layout_marginLeft="5dp"
android:layout_gravity="center_vertical"
android:textColor="#ffffff"
android:text="cm/s"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>

View File

@ -134,7 +134,7 @@
android:layout_height="22dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -154,7 +154,7 @@
android:layout_height="22dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -187,7 +187,7 @@
android:id="@+id/tv_value_minus_m7"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -213,7 +213,7 @@
android:id="@+id/tv_value_add_m7"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -234,7 +234,7 @@
android:id="@+id/tv_off_minus_m7"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -260,7 +260,7 @@
android:id="@+id/tv_off_add_m7"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -294,7 +294,7 @@
android:layout_height="22dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -314,7 +314,7 @@
android:layout_height="22dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -347,7 +347,7 @@
android:id="@+id/tv_value_minus_m8"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -373,7 +373,7 @@
android:id="@+id/tv_value_add_m8"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -394,7 +394,7 @@
android:id="@+id/tv_off_minus_m8"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -420,7 +420,7 @@
android:id="@+id/tv_off_add_m8"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -454,7 +454,7 @@
android:layout_height="22dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -474,7 +474,7 @@
android:layout_height="22dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -507,7 +507,7 @@
android:id="@+id/tv_value_minus_m9"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -533,7 +533,7 @@
android:id="@+id/tv_value_add_m9"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -554,7 +554,7 @@
android:id="@+id/tv_off_minus_m9"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -580,7 +580,7 @@
android:id="@+id/tv_off_add_m9"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -614,7 +614,7 @@
android:layout_height="22dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -634,7 +634,7 @@
android:layout_height="22dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -667,7 +667,7 @@
android:id="@+id/tv_value_minus_m10"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -693,7 +693,7 @@
android:id="@+id/tv_value_add_m10"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -714,7 +714,7 @@
android:id="@+id/tv_off_minus_m10"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -740,7 +740,7 @@
android:id="@+id/tv_off_add_m10"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -853,7 +853,7 @@
android:layout_height="22dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -873,7 +873,7 @@
android:layout_height="22dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -906,7 +906,7 @@
android:id="@+id/tv_value_minus_m11"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -932,7 +932,7 @@
android:id="@+id/tv_value_add_m11"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -953,7 +953,7 @@
android:id="@+id/tv_off_minus_m11"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -979,7 +979,7 @@
android:id="@+id/tv_off_add_m11"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1092,7 +1092,7 @@
android:layout_height="22dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -1112,7 +1112,7 @@
android:layout_height="22dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -1145,7 +1145,7 @@
android:id="@+id/tv_value_minus_m12"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1171,7 +1171,7 @@
android:id="@+id/tv_value_add_m12"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1192,7 +1192,7 @@
android:id="@+id/tv_off_minus_m12"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1218,7 +1218,7 @@
android:id="@+id/tv_off_add_m12"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1329,7 +1329,7 @@
android:layout_height="22dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -1349,7 +1349,7 @@
android:layout_height="22dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:orientation="vertical">
<TextView
@ -1382,7 +1382,7 @@
android:id="@+id/tv_value_minus_m13"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1408,7 +1408,7 @@
android:id="@+id/tv_value_add_m13"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1429,7 +1429,7 @@
android:id="@+id/tv_off_minus_m13"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1455,7 +1455,7 @@
android:id="@+id/tv_off_add_m13"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"

View File

@ -3,14 +3,13 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#112446"
android:orientation="horizontal"
tools:context=".Main.Setting.Fragment.MotorFragment">
<LinearLayout
android:orientation="vertical"
android:layout_weight="1"
android:layout_weight="2"
android:layout_width="0dp"
android:layout_height="match_parent">
@ -29,7 +28,7 @@
<TextView
android:layout_marginTop="16dp"
android:layout_gravity="center"
android:text="FT60"
android:text="六轴六翼"
android:textColor="#ffffff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
@ -46,6 +45,8 @@
<!-- 持续时间控制区域 -->
<LinearLayout
android:padding="6dp"
android:background="@drawable/ff101010_2round_1stroke_bg"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_gravity="center_horizontal"
@ -53,7 +54,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginBottom="24dp">
android:layout_marginBottom="8dp">
<TextView
android:textSize="10sp"
@ -71,7 +72,7 @@
android:text="-"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<!-- 滑动条 -->
<SeekBar
@ -80,7 +81,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:max="10"
android:progress="0"
android:progress="2"
/>
@ -95,13 +96,13 @@
android:text="+"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<TextView
android:textSize="10sp"
android:id="@+id/tv_time"
android:text="0秒"
android:text="2秒"
android:textColor="#ffffff"
android:layout_width="40dp"
android:gravity="right"
@ -110,6 +111,8 @@
<!-- 持续时间控制区域 -->
<LinearLayout
android:padding="6dp"
android:background="@drawable/ff101010_2round_1stroke_bg"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
@ -117,7 +120,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginBottom="24dp">
android:layout_marginBottom="7dp">
<TextView
android:textSize="10sp"
@ -135,7 +138,7 @@
android:text="-"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<!-- 滑动条 -->
<SeekBar
@ -144,9 +147,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:max="100"
android:progress="0"
/>
android:progress="5" />
<!-- 加按钮 -->
<TextView
@ -157,13 +158,13 @@
android:text="+"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<TextView
android:textSize="10sp"
android:id="@+id/tv_power"
android:text="0%"
android:text="5%"
android:textColor="#ffffff"
android:layout_width="40dp"
android:gravity="right"
@ -179,6 +180,7 @@
</LinearLayout>
<LinearLayout
android:background="@drawable/ff101010_2round_1stroke_bg"
android:gravity="center_horizontal"
android:layout_margin="6dp"
android:orientation="vertical"
@ -209,7 +211,7 @@
android:text="全部旋转"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"/>

View File

@ -15,7 +15,7 @@
<LinearLayout
android:id="@+id/ll_all_select"
android:gravity="center"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:layout_width="55dp"
android:layout_height="wrap_content">

View File

@ -76,7 +76,7 @@
android:text="-"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<!-- 滑动条 -->
<SeekBar
@ -99,7 +99,7 @@
android:text="+"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<TextView
@ -138,7 +138,7 @@
android:layout_height="wrap_content">
<TextView
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:id="@+id/tv_one_power_protect"
android:gravity="center"
android:textColor="#ffffff"
@ -201,7 +201,7 @@
android:text="-"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<!-- 滑动条 -->
<SeekBar
@ -223,7 +223,7 @@
android:text="+"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<TextView
@ -264,7 +264,7 @@
<TextView
android:id="@+id/tv_two_power_protect"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="10sp"
@ -360,7 +360,7 @@
android:text="-"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<EditText
android:id="@+id/et_link"
@ -385,7 +385,7 @@
android:text="+"
android:textColor="#ffffff"
android:textSize="10sp"
android:background="@drawable/ff029a45_2round_1stroke_bg"/>
android:background="@drawable/ff029a45_4round_1stroke_bg"/>
<TextView
@ -424,7 +424,7 @@
<TextView
android:id="@+id/tv_link_protect"
android:background="@drawable/ff029a45_2round_1stroke_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="10sp"

View File

@ -78,10 +78,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:paddingLeft="8dp"
android:paddingTop="5dp"
android:paddingRight="8dp"
android:paddingBottom="5dp"
android:text="姿态比例"
android:textColor="#2EB5F0"
android:textSize="12sp"
android:textStyle="italic" />
android:textColor="#ffffff"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
@ -115,7 +119,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -139,7 +143,7 @@
android:id="@+id/tv_attitude_roll_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -169,7 +173,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -207,7 +211,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -231,7 +235,7 @@
android:id="@+id/tv_attitude_pitch_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -261,7 +265,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -299,7 +303,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -323,7 +327,7 @@
android:id="@+id/tv_attitude_yaw_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -353,7 +357,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -383,12 +387,16 @@
android:padding="8dp">
<TextView
android:paddingLeft="8dp"
android:paddingTop="5dp"
android:paddingRight="8dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:text="位置回路"
android:textColor="#2EB5F0"
android:textSize="12sp"
android:textStyle="italic" />
android:textColor="#ffffff"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
@ -422,7 +430,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -446,7 +454,7 @@
android:id="@+id/tv_pos_xy_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -476,7 +484,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -514,7 +522,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -536,7 +544,7 @@
<TextView
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -565,7 +573,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -603,7 +611,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -627,7 +635,7 @@
android:id="@+id/tv_pos_z_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -657,7 +665,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -695,10 +703,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:paddingLeft="8dp"
android:paddingTop="5dp"
android:paddingRight="8dp"
android:paddingBottom="5dp"
android:text="滚转角速率"
android:textColor="#2EB5F0"
android:textSize="12sp"
android:textStyle="italic" />
android:textColor="#ffffff"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
@ -732,7 +744,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -756,7 +768,7 @@
android:id="@+id/tv_roll_p_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -786,7 +798,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -824,7 +836,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -848,7 +860,7 @@
android:id="@+id/tv_roll_i_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -878,7 +890,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -916,7 +928,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -940,7 +952,7 @@
android:id="@+id/tv_roll_d_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -970,7 +982,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -1001,10 +1013,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:paddingLeft="8dp"
android:paddingTop="5dp"
android:paddingRight="8dp"
android:paddingBottom="5dp"
android:text="俯仰角速率"
android:textColor="#2EB5F0"
android:textSize="12sp"
android:textStyle="italic" />
android:textColor="#ffffff"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
@ -1038,7 +1054,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1062,7 +1078,7 @@
android:id="@+id/tv_pitch_p_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1092,7 +1108,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -1130,7 +1146,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1154,7 +1170,7 @@
android:id="@+id/tv_pitch_i_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1184,7 +1200,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -1222,7 +1238,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1246,7 +1262,7 @@
android:id="@+id/tv_pitch_d_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1276,7 +1292,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -1314,10 +1330,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:paddingLeft="8dp"
android:paddingTop="5dp"
android:paddingRight="8dp"
android:paddingBottom="5dp"
android:text="偏航角速率"
android:textColor="#2EB5F0"
android:textSize="12sp"
android:textStyle="italic" />
android:textColor="#ffffff"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
@ -1351,7 +1371,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1375,7 +1395,7 @@
android:id="@+id/tv_yaw_p_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1405,7 +1425,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -1443,7 +1463,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1467,7 +1487,7 @@
android:id="@+id/tv_yaw_i_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1497,7 +1517,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -1535,7 +1555,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1559,7 +1579,7 @@
android:id="@+id/tv_yaw_d_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1589,7 +1609,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -1620,10 +1640,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:paddingLeft="8dp"
android:paddingTop="5dp"
android:paddingRight="8dp"
android:paddingBottom="5dp"
android:text="高度加速度"
android:textColor="#2EB5F0"
android:textSize="12sp"
android:textStyle="italic" />
android:textColor="#ffffff"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
@ -1657,7 +1681,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1681,7 +1705,7 @@
android:id="@+id/tv_accz_p_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1711,7 +1735,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -1749,7 +1773,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1773,7 +1797,7 @@
android:id="@+id/tv_accz_i_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1803,7 +1827,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -1841,7 +1865,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1865,7 +1889,7 @@
android:id="@+id/tv_accz_d_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -1895,7 +1919,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -1933,10 +1957,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:paddingLeft="8dp"
android:paddingTop="5dp"
android:paddingRight="8dp"
android:paddingBottom="5dp"
android:text="水平速度"
android:textColor="#2EB5F0"
android:textSize="12sp"
android:textStyle="italic" />
android:textColor="#ffffff"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
@ -1970,7 +1998,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -1994,7 +2022,7 @@
android:id="@+id/tv_velxy_p_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -2024,7 +2052,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -2062,7 +2090,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -2086,7 +2114,7 @@
android:id="@+id/tv_velxy_i_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -2116,7 +2144,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -2154,7 +2182,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -2178,7 +2206,7 @@
android:id="@+id/tv_velxy_d_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -2208,7 +2236,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -2238,10 +2266,14 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:paddingLeft="8dp"
android:paddingTop="5dp"
android:paddingRight="8dp"
android:paddingBottom="5dp"
android:text="垂直速度"
android:textColor="#2EB5F0"
android:textSize="12sp"
android:textStyle="italic" />
android:textColor="#ffffff"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
@ -2275,7 +2307,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -2299,7 +2331,7 @@
android:id="@+id/tv_velz_p_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -2329,7 +2361,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -2367,7 +2399,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -2391,7 +2423,7 @@
android:id="@+id/tv_velz_i_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -2421,7 +2453,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -2459,7 +2491,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -2483,7 +2515,7 @@
android:id="@+id/tv_velz_d_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -2513,7 +2545,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -2581,7 +2613,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -2605,7 +2637,7 @@
android:id="@+id/tv_accel_rp_max_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -2635,7 +2667,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -2673,7 +2705,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -2697,7 +2729,7 @@
android:id="@+id/tv_accel_y_max_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -2727,7 +2759,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -2765,7 +2797,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -2789,7 +2821,7 @@
android:id="@+id/tv_input_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -2819,7 +2851,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"
@ -2857,7 +2889,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="+"
android:textColor="#ffffff"
@ -2881,7 +2913,7 @@
android:id="@+id/tv_thst_minus"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="#62A7F0"
android:background="#727171"
android:gravity="center"
android:text="-"
android:textColor="#ffffff"
@ -2911,7 +2943,7 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/x94555f75_4round_bg"
android:background="@drawable/ff029a45_4round_1stroke_bg"
android:gravity="center"
android:padding="4dp"
android:text="发送"

View File

@ -24,14 +24,14 @@
<!-- 搜索框 -->
<EditText
android:textColor="#303030"
android:layout_margin="8dp"
android:textColor="#ffffff"
android:layout_margin="5dp"
android:textSize="12dp"
android:padding="5dp"
android:background="@drawable/b2303030_4round_1stroke_bg"
android:background="@drawable/ff909090_2round_1stroke_bg"
android:id="@+id/search_edit_text"
android:layout_width="110dp"
android:layout_height="wrap_content"
android:layout_width="115dp"
android:layout_height="30dp"
android:hint="搜索参数"
android:imeOptions="actionSearch"
android:inputType="text" />
@ -65,29 +65,30 @@
<LinearLayout
android:padding="1dp"
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_margin="8dp"
android:background="@drawable/b2303030_4round_1stroke_bg"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="3.5dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:background="@drawable/ff101010_2round_1stroke_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="32dp">
<TextView
android:textStyle="bold"
android:layout_margin="6dp"
android:textColor="#303030"
android:textSize="14sp"
android:textColor="#ffffff"
android:textSize="13sp"
android:text="参数列表"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_margin="4dp"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
@ -96,48 +97,84 @@
android:id="@+id/tv_updata_param"
android:layout_marginRight="5dp"
android:textColor="#ffffff"
android:background="@drawable/ff8decec_2round_bg"
android:background="@drawable/ff029b45_2round_bg"
android:gravity="center"
android:textSize="12sp"
android:textSize="11sp"
android:padding="5dp"
android:text="重新获取参数"
android:layout_width="100dp"
android:layout_height="wrap_content"/>
android:layout_width="84dp"
android:layout_height="28dp"/>
<EditText
android:textColor="#303030"
android:textColor="#ffffff"
android:textSize="12dp"
android:padding="5dp"
android:background="@drawable/b2303030_4round_1stroke_bg"
android:id="@+id/et_parame"
android:layout_weight="1"
android:layout_width="100dp"
android:layout_height="wrap_content"/>
android:layout_height="28dp"/>
<TextView
android:layout_marginRight="3dp"
android:layout_marginLeft="5dp"
android:textColor="#ffffff"
android:background="@drawable/ff8decec_2round_bg"
android:background="@drawable/ff029b45_2round_bg"
android:gravity="center"
android:padding="5dp"
android:textSize="12sp"
android:textSize="11sp"
android:id="@+id/btn_parame"
android:text="修改"
android:layout_width="55dp"
android:layout_height="wrap_content"/>
android:layout_height="28dp"/>
</LinearLayout>
</RelativeLayout>
<!-- RecyclerView -->
<androidx.recyclerview.widget.RecyclerView
android:layout_marginTop="5dp"
android:id="@+id/param_recycler_view2"
<LinearLayout
android:layout_marginTop="8dp"
android:background="@drawable/ff101010_2round_1stroke_bg"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
android:layout_height="match_parent">
<LinearLayout
android:padding="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:textColor="#ffffff"
android:text="参数名称"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="11sp" />
<TextView
android:gravity="center"
android:textColor="#ffffff"
android:text="参数值"
android:id="@+id/param_value"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="11sp" />
</LinearLayout>
<!-- RecyclerView -->
<androidx.recyclerview.widget.RecyclerView
android:layout_marginTop="5dp"
android:id="@+id/param_recycler_view2"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
</LinearLayout>
@ -145,8 +182,9 @@
<RelativeLayout
android:visibility="visible"
android:id="@+id/rl_password"
android:background="#909090"
android:background="#EB101010"
android:layout_width="match_parent"
android:layout_height="match_parent">