迟颜禛、钱杨修改文档

master
CYZ 2 years ago
parent 831239724d
commit daaf077019

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="SERIAL_NUMBER" />
<value value="W3VBB21918206146" />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-06-06T18:29:59.885437200Z" />
</component>
</project>

@ -1,60 +1,57 @@
` java:S112f"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
` java:S112q"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
` java:S112|"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112<18>"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112¨"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112³"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112¡"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
n java:S117<18>"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(×àÿÅ8ú½Í<C2BD>‰1
` java:S112m"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
` java:S112x"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112ƒ"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112Ž"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112¤"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112¯"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
a java:S112º"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
g java:S117˜"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(×àÿÅ
>
java:S1604`"(Make this anonymous inner class a lambda(êáÇñ
java:S1604Y"(Make this anonymous inner class a lambda(Æ·»°
>
java:S1604g"(Make this anonymous inner class a lambda(êáÇñ
C
java:S1604k"(Make this anonymous inner class a lambda(Ëݳ­ûÿÿÿÿ
java:S1604r"(Make this anonymous inner class a lambda(Ëݳ­ûÿÿÿÿ
C
java:S1604v"(Make this anonymous inner class a lambda(ßó¤—ùÿÿÿÿ
java:S1604}"(Make this anonymous inner class a lambda(ßó¤—ùÿÿÿÿ
D
java:S1604<EFBFBD>"(Make this anonymous inner class a lambda(‰‘¼“ÿÿÿÿÿ
java:S1604ˆ"(Make this anonymous inner class a lambda(‰‘¼“ÿÿÿÿÿ
D
java:S1604Œ"(Make this anonymous inner class a lambda(÷³¿­úÿÿÿÿ
java:S1604"(Make this anonymous inner class a lambda(÷³¿­úÿÿÿÿ
?
java:S1604"(Make this anonymous inner class a lambda(Ÿ…³Á
java:S1604ž"(Make this anonymous inner class a lambda(Ÿ…³Á
?
java:S1604¢"(Make this anonymous inner class a lambda(ÚŠõ¨
java:S1604©"(Make this anonymous inner class a lambda(ÚŠõ¨
?
java:S1604­"(Make this anonymous inner class a lambda(¶±»ù
java:S1604´"(Make this anonymous inner class a lambda(¶±»ù
?
java:S1604¸"(Make this anonymous inner class a lambda(±ë¦þ
T
java:S1153Ÿ"1Directly append the argument of String.valueOf().(Ÿà¯Üûÿÿÿÿ8ÿ½Í<C2BD>‰1
java:S1604¿"(Make this anonymous inner class a lambda(±ë¦þ
V
java:S2184"@Cast one of the operands of this integer division to a "double".(—­½[
X
java:S2184œ"ACast one of the operands of this division operation to a "float".(ÒÏ“×
]
java:S2184¢"ACast one of the operands of this division operation to a "float".(‹öÚÈùÿÿÿÿ
[
java:S2184£"DCast one of the operands of this subtraction operation to a "float".(¸õÀ½
]
java:S2184Š"@Cast one of the operands of this integer division to a "double".(—­½[8ÿ½Í<C2BD>‰1
_
java:S2184"ACast one of the operands of this division operation to a "float".(ÒÏ“×8€¾Í<C2BE>‰1
d
java:S2184"ACast one of the operands of this division operation to a "float".(‹öÚÈùÿÿÿÿ8€¾Í<C2BE>‰1
b
java:S2184"DCast one of the operands of this subtraction operation to a "float".(¸õÀ½8€¾Í<C2BE>‰1
d
java:S2184ž"ACast one of the operands of this division operation to a "float".(‹öÚÈùÿÿÿÿ8€¾Í<C2BE>‰1
b
java:S2184Ÿ"DCast one of the operands of this subtraction operation to a "float".(¸õÀ½8€¾Í<C2BE>‰1
java:S2184¯"ACast one of the operands of this division operation to a "float".(‹öÚÈùÿÿÿÿ
[
java:S2184°"DCast one of the operands of this subtraction operation to a "float".(¸õÀ½
[
java:S2184 "DCast one of the operands of this subtraction operation to a "float".(¬Óé<C393>
d
java:S2184¯"ACast one of the operands of this addition operation to a "float".(•‹öƒýÿÿÿÿ8<>¾Í<C2BE>‰1
g
java:S2184¯"DCast one of the operands of this subtraction operation to a "float".(•‹öƒýÿÿÿÿ8<>¾Í<C2BE>‰1
d
java:S2184°"ACast one of the operands of this division operation to a "float".(ÝÒŒÑþÿÿÿÿ8<>¾Í<C2BE>‰1
java:S2184±"DCast one of the operands of this subtraction operation to a "float".(¬Óé<C393>
]
java:S2184À"ACast one of the operands of this addition operation to a "float".(•‹öƒýÿÿÿÿ
`
java:S2184À"DCast one of the operands of this subtraction operation to a "float".(•‹öƒýÿÿÿÿ
]
java:S2184Á"ACast one of the operands of this division operation to a "float".(ÝÒŒÑþÿÿÿÿ
\
java:S2184×"@Cast one of the operands of this integer division to a "double".(ÂÀ‰öùÿÿÿÿ
c
java:S2184Æ"@Cast one of the operands of this integer division to a "double".(ÂÀ‰öùÿÿÿÿ8<>¾Í<C2BE>‰1
j
java:S2095Ù"LUse try-with-resources or close this "DatagramSocket" in a "finally" clause.(³Âв8ìõÌ<C3B5>‰1
j
java:S2095ƒ"LUse try-with-resources or close this "DatagramSocket" in a "finally" clause.(©Áá‚8±¾Í<C2BE>‰1
java:S2095Ž"LUse try-with-resources or close this "DatagramSocket" in a "finally" clause.(©Áá‚
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]+)*$'.(¨Öܶüÿÿÿÿ
t java:S116:"ZRename this field "Trans_to_Detect" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¾¥Âöûÿÿÿÿ
@ -71,6 +68,10 @@ p java:S116F"VRename this field "TakeOff_btn" to match the regular expression
p java:S116G"VRename this field "Landing_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÅÔ““þÿÿÿÿ
u
java:S1450F"ZRemove the "TakeOff_btn" field and declare it as a local variable in the relevant methods.(€‚òœüÿÿÿÿ
o
java:S1450H"TRemove the "angle" field and declare it as a local variable in the relevant methods.(§úþóþÿÿÿÿ
r
java:S1450I"WRemove the "distance" field and declare it as a local variable in the relevant methods.(×¾¶Ðøÿÿÿÿ
[
java:S1124-"EReorder the modifiers to comply with the Java Language Specification.(ƴư
`
@ -79,35 +80,35 @@ java:S1124."EReorder the modifiers to comply with the Java Language Specificati
java:S1124/"EReorder the modifiers to comply with the Java Language Specification.(ß×á
[
java:S11240"EReorder the modifiers to comply with the Java Language Specification.(Ó¾þá
h java:S100_"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ü™âîùÿÿÿÿ
h java:S100f"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ü™âîùÿÿÿÿ
m
java:S3776_"RRefactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.(ü™âîùÿÿÿÿ
java:S3776f"RRefactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.(ü™âîùÿÿÿÿ
D
java:S1185Ê"(Remove this method to simply inherit it.(ñ‰ÿÜýÿÿÿÿ
java:S1185Ñ"(Remove this method to simply inherit it.(ñ‰ÿÜýÿÿÿÿ
L
java:S2696Ú"6Make the enclosing method "static" or remove this set.(èª
W java:S125Û"<This block of commented-out lines of code should be removed.(<28>­éäøÿÿÿÿ
W java:S125à"<This block of commented-out lines of code should be removed.(çéŸþÿÿÿÿ
java:S2696á"6Make the enclosing method "static" or remove this set.(èª
W java:S125â"<This block of commented-out lines of code should be removed.(<28>­éäøÿÿÿÿ
W java:S125ç"<This block of commented-out lines of code should be removed.(çéŸþÿÿÿÿ
R
java:S2696ç"6Make the enclosing method "static" or remove this set.(Ôø±üûÿÿÿÿ
k java:S100<18>"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(×àÿÅ8Ú¾Í<C2BE>‰1
N
java:S1172"+Remove this unused method parameter "view".(àï’†üÿÿÿÿ8Û¾Í<C2BE>‰1
p java:S116®"SRename this field "BG_COLOR" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(þ¨ò‘8Þ¾Í<C2BE>‰1
r
java:S1450¼"TRemove the "mPath" field and declare it as a local variable in the relevant methods.(ä“<C3A4>Â8á¾Í<C2BE>‰1
c
java:S1610Ç"@Convert the abstract class "OnUnlockListener" into an interface.(׋›Îøÿÿÿÿ8â¾Í<C2BE>‰1
D java:S131ñ""Add a default case to this switch.(<28>äÃùÿÿÿÿÿ8ç¾Í<C2BE>‰1
D java:S131º""Add a default case to this switch.(ãÁð™øÿÿÿÿ8ì¾Í<C2BE>‰1
java:S2696ï"6Make the enclosing method "static" or remove this set.(Ôø±üûÿÿÿÿ
W java:S125÷"<This block of commented-out lines of code should be removed.(ÏúˆÃýÿÿÿÿ
F
java:S2093Þ"*Change this "try" to a try-with-resources.(ç£ê<C2A3>úÿÿÿÿ
d java:S100˜"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(×àÿÅ
i java:S116¿"SRename this field "BG_COLOR" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(þ¨ò‘
k
java:S1450Í"TRemove the "mPath" field and declare it as a local variable in the relevant methods.(ä“<C3A4>Â
R java:S125¥"<This block of commented-out lines of code should be removed.(Ê蘋
\
java:S1610Ø"@Convert the abstract class "OnUnlockListener" into an interface.(׋›Îøÿÿÿÿ
= java:S131""Add a default case to this switch.(<28>äÃùÿÿÿÿÿ
= java:S131Ë""Add a default case to this switch.(ãÁð™øÿÿÿÿ
9
java:S1128*"Remove this duplicated import.(°þÊóøÿÿÿÿ
C
java:S1068/"-Remove this unused "SEND_PORT" private field.(ß×á
B
java:S10683"'Remove this unused "buf" private field.(ÅØè<C398>þÿÿÿÿ
L
java:S10685"1Remove this unused "receiveSocket" private field.(ÜÁ‰Óúÿÿÿÿ
D
java:S10686".Remove this unused "sendSocket" private field.(éêÖé
J
@ -117,10 +118,12 @@ java:S1068:"3Remove this unused "Trans_to_Detect" private field.(
B
java:S1068<"'Remove this unused "btn" private field.(ãȧ<C388>üÿÿÿÿ
J
java:S1068F"/Remove this unused "TakeOff_btn" private field.(€‚òœüÿÿÿÿ
J
java:S1068G"/Remove this unused "Landing_btn" private field.(ÅÔ““þÿÿÿÿ
D
java:S1068H")Remove this unused "angle" private field.(§úþóþÿÿÿÿ
G
java:S1068¼")Remove this unused "mPath" private field.(ä“<C3A4>Â8î¾Í<C2BE>‰1
M
java:S1068Â"/Remove this unused "mIsUnlocked" private field.(ˆø•ö8î¾Í<C2BE>‰1
java:S1068I",Remove this unused "distance" private field.(×¾¶Ðøÿÿÿÿ
@
java:S1068Í")Remove this unused "mPath" private field.(ä“<C3A4>Â
F
java:S1068Ó"/Remove this unused "mIsUnlocked" private field.(ˆø•ö

@ -19,11 +19,11 @@ k
;app/src/main/java/com/example/sixaunyi/ControlActivity.java,c\9\c99a584c2117ed2df42496451bb97ac1147f5ea0
j
:app/src/main/java/com/example/sixaunyi/SecondFragment.java,1\2\12963d86ac5c2888cc2a9ae459de5665bc06b01f
k
;app/src/main/java/com/example/sixaunyi/SettingActivity.java,2\a\2ab0711d9aa5839cecbb6cf0ed96f5a3f6470de5
i
9app/src/main/java/com/example/sixaunyi/VideoActivity.java,7\1\71fd1993763df2214bbdad8cfee650733993fe44
h
8app/src/main/java/com/example/sixaunyi/MainActivity.java,7\c\7c120b7216f76ce98d1573d90803ab36f481640c
P
app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e
k
;app/src/main/java/com/example/sixaunyi/SettingActivity.java,2\a\2ab0711d9aa5839cecbb6cf0ed96f5a3f6470de5
h
8app/src/main/java/com/example/sixaunyi/MainActivity.java,7\c\7c120b7216f76ce98d1573d90803ab36f481640c

@ -50,11 +50,11 @@ public class VideoActivity extends AppCompatActivity {
private static boolean listenStatus = true; //接收线程的循环标识
private byte[] buf;
static Bitmap bp;
private DatagramSocket receiveSocket;
private DatagramSocket reveSocket;
private DatagramSocket sendSocket;
private static InetAddress serverAddr;
private SendHandler sendHandler = new SendHandler();
private static ReceiveHandler receiveHandler;
private ReceiveHandler receiveHandler = new ReceiveHandler();
private Button Trans_to_Detect;
private ImageView imgShow;
private Button btn;
@ -86,6 +86,13 @@ public class VideoActivity extends AppCompatActivity {
TurnLeft_btn = findViewById(R.id.rotate_left_button);
TurnRight_btn = findViewById(R.id.rotate_right_button);
TakeOff_btn = findViewById(R.id.takeoff_button);
TakeOff_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new UdpReceiveThread().start();
Log.i(TAG, "onClick: BBBBBBBBackward");
}
});
Setting_btn = findViewById(R.id.setting_button);
Button_Init();
Intent i = getIntent();
@ -207,14 +214,14 @@ public class VideoActivity extends AppCompatActivity {
/*
* UDP线
* */
public static class UdpReceiveThread extends Thread
public class UdpReceiveThread extends Thread
{
@Override
public void run()
{
try
{
DatagramSocket reveSocket = new DatagramSocket(RECEIVE_PORT);
reveSocket = new DatagramSocket(RECEIVE_PORT);
serverAddr = InetAddress.getByName(Recieve_IP);
//ByteArrayOutputStream out = new ByteArrayOutputStream();
while(listenStatus)
@ -226,14 +233,18 @@ public class VideoActivity extends AppCompatActivity {
if(!inPacket.getAddress().equals(serverAddr)){
throw new IOException("未知名的报文");
}
ByteArrayInputStream in = new ByteArrayInputStream(inPacket.getData());
receiveHandler.sendEmptyMessage(1);
bp = BitmapFactory.decodeStream(in);
}
reveSocket.close();
} catch (Exception e)
{
e.printStackTrace();
}finally {
// reveSocket.close();
}
}
}
@ -273,29 +284,35 @@ public class VideoActivity extends AppCompatActivity {
UdpSendThread sendThread = new UdpSendThread(sendIP, sendPort, sendData); // 创建新的线程对象
sendThread.start(); // 启动线程发送数据
}
//设置按钮
public void showDialog(View view) {
Dialog dialog = new Dialog(VideoActivity.this);
dialog.setContentView(R.layout.dialog_takeoff);
SlideUnlockView slideUnlockView = (SlideUnlockView) dialog.findViewById(R.id.slide_unlock_view);
slideUnlockView.setOnUnlockListener(new SlideUnlockView.OnUnlockListener() {
@Override
public void onUnlock() {
// 在用户滑动解锁后执行操作
try {
InitUdpSend("TAKEOFF"+"___"+angle+"___"+String.valueOf(distance));
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
UdpReceiveThread udpReceiveThread = new UdpReceiveThread();
udpReceiveThread.start();
Log.i(TAG, "onClick: 2222222222222222222222222");
}
});
dialog.show();
}
//设置按钮
// public void showDialog(View view) {
// Dialog dialog = new Dialog(VideoActivity.this);
// dialog.setContentView(R.layout.dialog_takeoff);
//
// SlideUnlockView slideUnlockView = (SlideUnlockView) dialog.findViewById(R.id.slide_unlock_view);
// slideUnlockView.setOnUnlockListener(new SlideUnlockView.OnUnlockListener() {
// @Override
// public void onUnlock() {
// // 在用户滑动解锁后执行操作
//// try {
//// InitUdpSend("TAKEOFF"+"___"+angle+"___"+String.valueOf(distance));
//// } catch (UnknownHostException e) {
//// throw new RuntimeException(e);
//// }
// UdpReceiveThread udpReceiveThread = new UdpReceiveThread();
// udpReceiveThread.start();
//
// Log.i(TAG, "onClick: 2222222222222222222222222");
//
// }
// });
// dialog.show();
// }
//////////////////////////////滑动开关//////////////////////////////
public static class SlideUnlockView extends View{

@ -180,9 +180,9 @@
android:scaleType="centerCrop"
android:src="@drawable/takeoff"
android:text="起飞"
android:onClick="showDialog"
android:contentDescription="@string/takeoff_button"
/>
<!-- android:onClick="showDialog"-->
</LinearLayout>

Loading…
Cancel
Save