添加部分设计模型和更新文档(未完成)

pull/2/head
CYZ 2 years ago
parent 3eb3af5e46
commit 928d78086f

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,30 +1,32 @@
C C
java:S1604:"(Make this anonymous inner class a lambda(ƒø…Òÿÿÿÿÿ java:S1604;"(Make this anonymous inner class a lambda(ƒø…Òÿÿÿÿÿ
= >
java:S1604A"(Make this anonymous inner class a lambda(Ú‰˜ java:S1604D"(Make this anonymous inner class a lambda(›³äª
o java:S115!"ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(áƒðÊ o java:S115!"ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(××ðè
t java:S115""ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(Ó<><C393>ïùÿÿÿÿ
t java:S1160"ZRename this field "Trans_to_Detect" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¾¥Âöûÿÿÿÿ
y
java:S14500"^Remove the "Trans_to_Detect" field and declare it as a local variable in the relevant methods.(¾¥Âöûÿÿÿÿ
m m
java:S14501"RRemove the "btn" field and declare it as a local variable in the relevant methods.(ãȧ<C388>üÿÿÿÿ java:S14502"RRemove the "btn" field and declare it as a local variable in the relevant methods.(ãȧ<C388>üÿÿÿÿ
m
java:S1450/"RRemove the "trs" field and declare it as a local variable in the relevant methods.(§±Ü”ûÿÿÿÿ
`
java:S1124 "EReorder the modifiers to comply with the Java Language Specification.(ÔºíÌþÿÿÿÿ
[ [
java:S1124!"EReorder the modifiers to comply with the Java Language Specification.(áƒðÊ java:S1124!"EReorder the modifiers to comply with the Java Language Specification.(××ðè
`
java:S1124""EReorder the modifiers to comply with the Java Language Specification.(Ó<><C393>ïùÿÿÿÿ
[ [
java:S1124""EReorder the modifiers to comply with the Java Language Specification.(ß×á java:S1124#"EReorder the modifiers to comply with the Java Language Specification.(ß×á
[ [
java:S1124#"EReorder the modifiers to comply with the Java Language Specification.(Ó¾þá java:S1124$"EReorder the modifiers to comply with the Java Language Specification.(Ó¾þá
V java:S125>"<This block of commented-out lines of code should be removed.(è·¿¯ùÿÿÿÿ
C C
java:S1185\"(Remove this method to simply inherit it.(ñ‰ÿÜýÿÿÿÿ java:S1185_"(Remove this method to simply inherit it.(ñ‰ÿÜýÿÿÿÿ
V java:S125o"<This block of commented-out lines of code should be removed.(<28>­éäøÿÿÿÿ V java:S125r"<This block of commented-out lines of code should be removed.(<28>­éäøÿÿÿÿ
V java:S125t"<This block of commented-out lines of code should be removed.(çéŸþÿÿÿÿ V java:S125w"<This block of commented-out lines of code should be removed.(çéŸþÿÿÿÿ
E E
java:S2093k"*Change this "try" to a try-with-resources.(ç£ê<C2A3>úÿÿÿÿ java:S2093n"*Change this "try" to a try-with-resources.(ç£ê<C2A3>úÿÿÿÿ
W java:S125®"<This block of commented-out lines of code should be removed.(òœô˜úÿÿÿÿ
9 9
java:S1128"Remove this duplicated import.(°þÊóøÿÿÿÿ java:S1128"Remove this duplicated import.(°þÊóøÿÿÿÿ
F
java:S1068 "+Remove this unused "SEND_IP" private field.(ÔºíÌþÿÿÿÿ
L L
java:S1068)"1Remove this unused "receiveSocket" private field.(ÜÁ‰Óúÿÿÿÿ java:S1068*"1Remove this unused "receiveSocket" private field.(ÜÁ‰Óúÿÿÿÿ

@ -1,46 +1,51 @@
p p
java:S11045"[Make mLocationClient a static final constant or non-public and provide accessors if needed.(òó•L java:S11047"[Make mLocationClient a static final constant or non-public and provide accessors if needed.(òó•L
q q
java:S11047"[Make mLocationOption a static final constant or non-public and provide accessors if needed.(ÈÀ‚§ java:S11049"[Make mLocationOption a static final constant or non-public and provide accessors if needed.(ÈÀ‚§
d k
java:S2259Ü"MA "NullPointerException" could be thrown; "mLocationClient" is nullable here.(Ô¹¤<C2B9> java:S2259ã"MA "NullPointerException" could be thrown; "mLocationClient" is nullable here.(Ô¹¤<C2B9>8˜¡ØÑö0
o java:S116K"ZRename this field "ClearMarker_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ëþ¥È o java:S116M"ZRename this field "ClearMarker_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ëþ¥È
y java:S116O"XRename this field "ChangeAct_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÂîœÃúÿÿÿÿ8…ÚÑö0
Ÿ Ÿ
java:S1186ø"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(±€¿ë8óᡌõ0 java:S1186"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(±€¿ë8 ¡ØÑö0
~
java:S1450O"\Remove the "ChangeAct_btn" field and declare it as a local variable in the relevant methods.(ÂîœÃúÿÿÿÿ8ÏýÚÑö0
i i
java:S14509"SRemove the "city" field and declare it as a local variable in the relevant methods.(“øÌà java:S1450;"SRemove the "city" field and declare it as a local variable in the relevant methods.(“øÌà
m m
java:S1450G"WRemove the "cityCode" field and declare it as a local variable in the relevant methods.(êýð† java:S1450I"WRemove the "cityCode" field and declare it as a local variable in the relevant methods.(êýð†
G G
java:S1874C"1Remove this use of "PoiSearch"; it is deprecated.(–ƒëÖ java:S1874E"1Remove this use of "PoiSearch"; it is deprecated.(–ƒëÖ
L L
java:S1874E"1Remove this use of "PoiSearch"; it is deprecated.(²¹·‘ÿÿÿÿÿ java:S1874G"1Remove this use of "PoiSearch"; it is deprecated.(²¹·‘ÿÿÿÿÿ
V java:S125["<This block of commented-out lines of code should be removed.(¤¯¿Îúÿÿÿÿ ] java:S125b"<This block of commented-out lines of code should be removed.(¤¯¿Îúÿÿÿÿ8°¡ØÑö0
f m
java:S1874"JDon't override a deprecated method or explicitly mark it as "@Deprecated".(Ó»×¶þÿÿÿÿ java:S1874<EFBFBD>"JDon't override a deprecated method or explicitly mark it as "@Deprecated".(Ó»×¶þÿÿÿÿ8¸¡ØÑö0
R java:S125È"<This block of commented-out lines of code should be removed.(©áèè Y java:S125Ï"<This block of commented-out lines of code should be removed.(©áèè8À¡ØÑö0
Y `
java:S1854ù"=Remove this useless assignment to local variable "longitude".(ËàÅ€ûÿÿÿÿ java:S1854"=Remove this useless assignment to local variable "longitude".(ËàÅ€ûÿÿÿÿ8È¡ØÑö0
X _
java:S1854÷"<Remove this useless assignment to local variable "latitude".(û‘áäùÿÿÿÿ java:S1854þ"<Remove this useless assignment to local variable "latitude".(û‘áäùÿÿÿÿ8È¡ØÑö0
I P
java:S1481÷"-Remove this unused "latitude" local variable.(û‘áäùÿÿÿÿ java:S1481þ"-Remove this unused "latitude" local variable.(û‘áäùÿÿÿÿ8È¡ØÑö0
J Q
java:S1481ù".Remove this unused "longitude" local variable.(ËàÅ€ûÿÿÿÿ java:S1481".Remove this unused "longitude" local variable.(ËàÅ€ûÿÿÿÿ8È¡ØÑö0
N N
java:S1172Ò"+Remove this unused method parameter "view".(çÑ¢‰ýÿÿÿÿ8 ã¡Œõ0 java:S1172Ù"+Remove this unused method parameter "view".(çÑ¢‰ýÿÿÿÿ8СØÑö0
\ \
java:S1155Ó">Use isEmpty() to check whether the collection is empty or not.(”ó±’8¡ã¡Œõ0 java:S1155Ú">Use isEmpty() to check whether the collection is empty or not.(”ó±’8СØÑö0
N
java:S1172â"+Remove this unused method parameter "view".(•É‘ÎûÿÿÿÿèÑö0
\ \
java:S1117ä"9Rename "query" which hides the field declared at line 67.(˜Ž“áûÿÿÿÿ8¤ã¡Œõ0 java:S1117ñ"9Rename "query" which hides the field declared at line 69.(˜Ž“áûÿÿÿÿ8Ø¡ØÑö0
^ java:S125ý"<This block of commented-out lines of code should be removed.(±<>öîýÿÿÿÿ8§ã¡Œõ0 ^ java:S125Š"<This block of commented-out lines of code should be removed.(±<>öîýÿÿÿÿ8Ø¡ØÑö0
Y java:S125ˆ"<This block of commented-out lines of code should be removed.(ÎÞ<C38E>û8§ã¡Œõ0 Y java:S125"<This block of commented-out lines of code should be removed.(ÎÞ<C38E>û8Ø¡ØÑö0
> >
java:S10689"(Remove this unused "city" private field.(“øÌà java:S1068;"(Remove this unused "city" private field.(“øÌà
? ?
java:S1068C")Remove this unused "query" private field.(–ƒëÖ java:S1068E")Remove this unused "query" private field.(–ƒëÖ
H H
java:S1068E"-Remove this unused "poiSearch" private field.(²¹·‘ÿÿÿÿÿ java:S1068G"-Remove this unused "poiSearch" private field.(²¹·‘ÿÿÿÿÿ
B B
java:S1068G",Remove this unused "cityCode" private field.(êýð† java:S1068I",Remove this unused "cityCode" private field.(êýð†

@ -0,0 +1,33 @@
o
java:S2293Z"YReplace the type specification in this constructor call with the diamond operator ("<>").(œœÕ¼
K
java:S1066<18>"/Merge this if statement with the enclosing one.(¦­Üˆûÿÿÿÿ
K
java:S1066"/Merge this if statement with the enclosing one.(þÆÅ÷üÿÿÿÿ
>
java:S1604"(Make this anonymous inner class a lambda(ô§ê
i
java:S1104%"SMake TV_show a static final constant or non-public and provide accessors if needed.(úÀŸõ
>
java:S2189""Add an end condition to this loop.(˜ïˆžÿÿÿÿÿ
>
java:S2189±""Add an end condition to this loop.(˜ïˆžÿÿÿÿÿ
k java:S116!"VRename this field "receive_Msg" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ŒßÙú
g java:S116%"RRename this field "TV_show" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(úÀŸõ
^
java:S1659#"CDeclare "total1" and all following declarations on a separate line.(Æ‘ç¡üÿÿÿÿ
c java:S100<"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Íš“è
h
java:S3776~"RRefactor this method to reduce its Cognitive Complexity from 50 to the 15 allowed.(“–ýþ
u
java:S2142Œ"^Either re-interrupt this method or rethrow the "InterruptedException" that can be caught here.(<>í†
W java:S125"<This block of commented-out lines of code should be removed.(‹ãà‘úÿÿÿÿ
R java:S125"<This block of commented-out lines of code should be removed.(çÓ®Ë
U
java:S1155·">Use isEmpty() to check whether the collection is empty or not.(†”“”
u
java:S2142È"^Either re-interrupt this method or rethrow the "InterruptedException" that can be caught here.(ä ¹€
O java:S106×"9Replace this use of System.out or System.err by a logger.(ŒŸÍÞ
A
java:S1068$"+Remove this unused "button0" private field.(Îÿæ¡

@ -15,11 +15,13 @@ j
:app/src/main/java/com/example/sixaunyi/SecondFragment.java,1\2\12963d86ac5c2888cc2a9ae459de5665bc06b01f :app/src/main/java/com/example/sixaunyi/SecondFragment.java,1\2\12963d86ac5c2888cc2a9ae459de5665bc06b01f
? ?
settings.gradle,0\5\05efc8b1657769a27696d478ded1e95f38737233 settings.gradle,0\5\05efc8b1657769a27696d478ded1e95f38737233
i
9app/src/main/java/com/example/sixaunyi/VideoActivity.java,7\1\71fd1993763df2214bbdad8cfee650733993fe44
P P
app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e
@ @
app/build.gradle,f\4\f4a01d6a4fcb971362ec00a83903fd3902f52164 app/build.gradle,f\4\f4a01d6a4fcb971362ec00a83903fd3902f52164
h h
8app/src/main/java/com/example/sixaunyi/MainActivity.java,7\c\7c120b7216f76ce98d1573d90803ab36f481640c 8app/src/main/java/com/example/sixaunyi/MainActivity.java,7\c\7c120b7216f76ce98d1573d90803ab36f481640c
i
9app/src/main/java/com/example/sixaunyi/VideoActivity.java,7\1\71fd1993763df2214bbdad8cfee650733993fe44
j
:app/src/main/java/com/example/sixaunyi/DetectActivity.java,9\6\9668392b13e33166876f2a7d3f10eb5405e757ad

@ -27,7 +27,7 @@ import java.util.ArrayList;
public class DetectActivity extends AppCompatActivity { public class DetectActivity extends AppCompatActivity {
/*接收发送定义的常量*/ /*接收发送定义的常量*/
private String mIp= "192.168.0.11"; //这里是NodeMCU的IP Address我们可以通过打开Arduino的串口监视器获取IP Address private String mIp= "192.168.79.46"; //这里是NodeMCU的IP Address我们可以通过打开Arduino的串口监视器获取IP Address
private int mPort = 80; //WiFiServer server(80);建立网络服务器对象监听端口80这里的80是自定义的只要与Android中的socket一致就好。 private int mPort = 80; //WiFiServer server(80);建立网络服务器对象监听端口80这里的80是自定义的只要与Android中的socket一致就好。
private SendThread sendthread; private SendThread sendthread;
String receive_Msg; String receive_Msg;

@ -6,6 +6,8 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.Manifest; import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.nfc.Tag; import android.nfc.Tag;
import android.os.Build; import android.os.Build;
@ -73,6 +75,8 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
private FloatingActionButton fabPOI; private FloatingActionButton fabPOI;
//浮动按钮 清空地图标点 //浮动按钮 清空地图标点
private FloatingActionButton ClearMarker_btn; private FloatingActionButton ClearMarker_btn;
//浮动按钮 更换活动
private FloatingActionButton ChangeAct_btn;
//标点列表 //标点列表
private List<Marker> markerList = new ArrayList<>(); private List<Marker> markerList = new ArrayList<>();
//标识参数类 //标识参数类
@ -82,12 +86,15 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
@SuppressLint("MissingInflatedId")
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
fabPOI = findViewById(R.id.fab_poi); fabPOI = findViewById(R.id.fab_poi);
ClearMarker_btn = findViewById(R.id.clearMarker_btn); ClearMarker_btn = findViewById(R.id.clearMarker_btn);
ChangeAct_btn = findViewById(R.id.change_btn);
ChangeAct_btn.show();
//tvContent = findViewById(R.id.tv_content); //tvContent = findViewById(R.id.tv_content);
/*, /*,
* *
@ -344,6 +351,12 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
ClearMarker_btn.hide(); ClearMarker_btn.hide();
} }
public void changeAct(View view) {
Intent intent = new Intent(MainActivity.this, VideoActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);
}
/* * * * * * /* * * * * *
* *

@ -23,14 +23,15 @@ import java.io.IOException;
import java.net.DatagramPacket; import java.net.DatagramPacket;
import java.net.DatagramSocket; import java.net.DatagramSocket;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.*;
import android.os.Bundle; import android.os.Bundle;
public class VideoActivity extends AppCompatActivity { public class VideoActivity extends AppCompatActivity {
private final static String SEND_IP = "192.168.43.206"; //填写接收方IP private final static String SEND_to_IP = "192.168.10.2"; //填写接收方IP
private final static String Fasong_mudi_IP = "192.168.43.41"; private final static String Recieve_IP = "192.168.10.2";//填服务器IP
private final static int SEND_PORT = 8888; //发送端口号 private final static int SEND_PORT = 8888; //发送端口号
private final static int RECEIVE_PORT = 9999; //接收端口号 private final static int RECEIVE_PORT = 9999; //接收端口号
@ -44,7 +45,7 @@ public class VideoActivity extends AppCompatActivity {
private InetAddress serverAddr; private InetAddress serverAddr;
private SendHandler sendHandler = new SendHandler(); private SendHandler sendHandler = new SendHandler();
private ReceiveHandler receiveHandler = new ReceiveHandler(); private ReceiveHandler receiveHandler = new ReceiveHandler();
private Button trs; private Button Trans_to_Detect;
private ImageView imgShow; private ImageView imgShow;
private Button btn; private Button btn;
@ -54,15 +55,17 @@ public class VideoActivity extends AppCompatActivity {
setContentView(R.layout.activity_video); setContentView(R.layout.activity_video);
imgShow = findViewById(R.id.img_show); imgShow = findViewById(R.id.img_show);
btn = findViewById(R.id.btn_send); btn = findViewById(R.id.btn_send);
trs = findViewById(R.id.transfer_to_detect); Trans_to_Detect = findViewById(R.id.transfer_to_detect);
btn.setOnClickListener(new View.OnClickListener() { btn.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
new UdpSendThread().start(); //new UdpSendThread().start();
new UdpReceiveThread().start();//会导致闪退
new UdpReceiveThread().start();
Log.i(TAG, "onClick: 2222222222222222222222222");
} }
}); });
trs.setOnClickListener(new View.OnClickListener() { Trans_to_Detect.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
Intent intent = new Intent(VideoActivity.this, DetectActivity.class); Intent intent = new Intent(VideoActivity.this, DetectActivity.class);
@ -107,7 +110,7 @@ public class VideoActivity extends AppCompatActivity {
try try
{ {
reveSocket = new DatagramSocket(RECEIVE_PORT); reveSocket = new DatagramSocket(RECEIVE_PORT);
serverAddr = InetAddress.getByName(Fasong_mudi_IP); serverAddr = InetAddress.getByName(Recieve_IP);
//ByteArrayOutputStream out = new ByteArrayOutputStream(); //ByteArrayOutputStream out = new ByteArrayOutputStream();
while(listenStatus) while(listenStatus)
{ {
@ -148,13 +151,14 @@ public class VideoActivity extends AppCompatActivity {
// 创建DatagramSocket对象使用端口8888 // 创建DatagramSocket对象使用端口8888
sendSocket = new DatagramSocket(8888); sendSocket = new DatagramSocket(8888);
serverAddr = InetAddress.getByName(Fasong_mudi_IP); serverAddr = InetAddress.getByName(SEND_to_IP);
DatagramPacket outPacket = new DatagramPacket(buf, buf.length, serverAddr, SEND_PORT); DatagramPacket outPacket = new DatagramPacket(buf, buf.length, serverAddr, SEND_PORT);
sendSocket.send(outPacket); sendSocket.send(outPacket);
sendSocket.close(); sendSocket.close();
sendHandler.sendEmptyMessage(1); sendHandler.sendEmptyMessage(1);
Log.i(TAG, "run: 111111111111111111111111111111111111111111111111");
} catch (Exception e) { } catch (Exception e) {
@ -163,6 +167,81 @@ public class VideoActivity extends AppCompatActivity {
} }
} }
//*************************************************************************************************
/*public class TelloControlDemo {
private DatagramSocket socket;
private InetAddress telloAddress;
private int port = 8889;
public void main(String[] args) throws IOException {
TelloControlDemo demo = new TelloControlDemo();
demo.start();
}
public void start() throws IOException {
// Create a UDP socket
socket = new DatagramSocket(9000);
telloAddress = InetAddress.getByName("192.168.10.1");
// Start the receiver thread
Thread receiverThread = new Thread(new Receiver());
receiverThread.start();
System.out.println("\r\n\r\nTello Java Demo.\r\n");
System.out.println("Tello: command takeoff land flip forward back left right \r\n" +
" up down cw ccw speed speed?\r\n");
System.out.println("end -- quit demo.\r\n");
while (true) {
try {
// Read user input from console
byte[] buffer = new byte[1024];
System.in.read(buffer);
String message = new String(buffer).trim();
if (message.equalsIgnoreCase("end")) {
System.out.println("...");
socket.close();
break;
}
// Send command to Tello drone
byte[] sendData = message.getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, telloAddress, port);
socket.send(sendPacket);
} catch (IOException e) {
e.printStackTrace();
}
}
}
private class Receiver implements Runnable {
@Override
public void run() {
byte[] receiveData = new byte[1024];
DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
while (true) {
try {
// Receive data from Tello drone
socket.receive(receivePacket);
String message = new String(receivePacket.getData(), 0, receivePacket.getLength());
System.out.println(message);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}*/
} }

@ -11,7 +11,7 @@
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/design_default_color_primary"> android:background="@color/white">
<TextView <TextView
android:layout_width="226dp" android:layout_width="226dp"

@ -48,4 +48,20 @@
app:hoveredFocusedTranslationZ="18dp" app:hoveredFocusedTranslationZ="18dp"
app:pressedTranslationZ="18dp" /> app:pressedTranslationZ="18dp" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/change_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginEnd="20dp"
android:clickable="true"
android:onClick="changeAct"
app:fabSize="normal"
android:src="@drawable/img"
app:backgroundTint="#FFF"
android:visibility="invisible"
app:backgroundTintMode="screen"
app:hoveredFocusedTranslationZ="18dp"
app:pressedTranslationZ="18dp" />
</RelativeLayout> </RelativeLayout>

Loading…
Cancel
Save