修改文档、代功能完善

chiyanzhen_branch
CYZ 2 years ago
parent 8890fa72e6
commit 0f44c4ccb5

@ -1,137 +1,133 @@
` java:S112g"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ
` java:S112r"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ž"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:S112h"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.(Ò‚Òéüÿÿÿÿ
h java:S112Â"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ8á̇á<E280A1>1
h java:S112Í"FDefine and throw a dedicated exception instead of using a generic one.(Ò‚Òéüÿÿÿÿ8á̇á<E280A1>1
s java:S117©"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¦á®¾ÿÿÿÿÿ8ý̇á<E280A1>1
>
java:S1604a"(Make this anonymous inner class a lambda(êáÇñ
C
java:S1604l"(Make this anonymous inner class a lambda(Ëݳ­ûÿÿÿÿ
C
java:S1604w"(Make this anonymous inner class a lambda(ßó¤—ùÿÿÿÿ
java:S1604b"(Make this anonymous inner class a lambda(Æ·»°
>
java:S1604m"(Make this anonymous inner class a lambda(í×ó€
>
java:S1604z"(Make this anonymous inner class a lambda(êáÇñ
K
java:S1604"(Make this anonymous inner class a lambda(Ëݳ­ûÿÿÿÿ8þ̇á<E280A1>1
D
java:S1604"(Make this anonymous inner class a lambda(‰‘¼“ÿÿÿÿÿ
java:S1604<EFBFBD>"(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(Ÿ…³Á
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(±ë¦þ
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Ÿ"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>
]
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:S1604Ç"(Make this anonymous inner class a lambda(¶±»ù
F
java:S1604Ò"(Make this anonymous inner class a lambda(±ë¦þ8ÿ̇á<E280A1>1
]
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".(ÂÀ‰öùÿÿÿÿ
java:S2184¬"@Cast one of the operands of this integer division to a "double".(—­½[8„͇á<E280A1>1
_
java:S2184­"ACast one of the operands of this division operation to a "float".(ÒÏ“×8„͇á<E280A1>1
d
java:S2184³"ACast one of the operands of this division operation to a "float".(‹öÚÈùÿÿÿÿ8…͇á<E280A1>1
b
java:S2184´"DCast one of the operands of this subtraction operation to a "float".(¸õÀ½8…͇á<E280A1>1
d
java:S2184À"ACast one of the operands of this division operation to a "float".(‹öÚÈùÿÿÿÿ8†Í‡á<E280A1>1
b
java:S2184Á"DCast one of the operands of this subtraction operation to a "float".(¸õÀ½8†Í‡á<E280A1>1
b
java:S2184Â"DCast one of the operands of this subtraction operation to a "float".(¬Óé<C393>8‡Í‡á<E280A1>1
d
java:S2184Ñ"ACast one of the operands of this addition operation to a "float".(•‹öƒýÿÿÿÿ8‡Í‡á<E280A1>1
g
java:S2184Ñ"DCast one of the operands of this subtraction operation to a "float".(•‹öƒýÿÿÿÿ8ˆÍ‡á<E280A1>1
d
java:S2184Ò"ACast one of the operands of this division operation to a "float".(ÝÒŒÑþÿÿÿÿ8ˆÍ‡á<E280A1>1
c
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]*$'.(¾¥Âöûÿÿÿÿ
k java:S116>"VRename this field "Forward_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¸ÂÑ•
m java:S116?"SRename this field "Back_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÛÇãôþÿÿÿÿ
h java:S116@"SRename this field "Left_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¥÷œë
i java:S116A"TRename this field "Right_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28>Οƒ
m java:S116B"SRename this field "Down_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ß缎øÿÿÿÿ
k java:S116C"QRename this field "Up_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ŒÑ„›ùÿÿÿÿ
q java:S116D"WRename this field "TurnLeft_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ëÝŽ–þÿÿÿÿ
l java:S116E"XRename this field "TurnRight_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(€‡p
k java:S116F"VRename this field "Setting_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(à°úö
p java:S116G"VRename this field "TakeOff_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(€‚òœüÿÿÿÿ
p java:S116H"VRename this field "Landing_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÅÔ““þÿÿÿÿ
java:S2184è"@Cast one of the operands of this integer division to a "double".(ÂÀ‰öùÿÿÿÿ8‰Í‡á<E280A1>1
j
java:S2095ž"LUse try-with-resources or close this "DatagramSocket" in a "finally" clause.(©Áá‚8Ð͇á<E280A1>1
o java:S115/"ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(ƴư
t java:S1150"ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(¨Öܶüÿÿÿÿ
k java:S1163"WRename this field "TimeInterval" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(öÿãn
t java:S116<"ZRename this field "Trans_to_Detect" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¾¥Âöûÿÿÿÿ
k java:S116?"VRename this field "Forward_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¸ÂÑ•
m java:S116@"SRename this field "Back_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÛÇãôþÿÿÿÿ
h java:S116A"SRename this field "Left_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¥÷œë
i java:S116B"TRename this field "Right_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(<28>Οƒ
m java:S116C"SRename this field "Down_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ß缎øÿÿÿÿ
k java:S116D"QRename this field "Up_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ŒÑ„›ùÿÿÿÿ
q java:S116E"WRename this field "TurnLeft_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ëÝŽ–þÿÿÿÿ
l java:S116F"XRename this field "TurnRight_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(€‡p
k java:S116G"VRename this field "Setting_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(à°úö
p java:S116H"VRename this field "TakeOff_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(€‚òœüÿÿÿÿ
p java:S116I"VRename this field "Landing_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(µÀç‹úÿÿÿÿ
u
java:S1450G"ZRemove the "TakeOff_btn" field and declare it as a local variable in the relevant methods.(€‚òœüÿÿÿÿ
java:S1450I"ZRemove the "Landing_btn" field and declare it as a local variable in the relevant methods.(µÀç‹úÿÿÿÿ
u
java:S1450H"ZRemove the "TakeOff_btn" field and declare it as a local variable in the relevant methods.(€‚òœüÿÿÿÿ
o
java:S1450I"TRemove the "angle" field and declare it as a local variable in the relevant methods.(§úþóþÿÿÿÿ
java:S1450J"TRemove the "angle" field and declare it as a local variable in the relevant methods.(§úþóþÿÿÿÿ
r
java:S1450J"WRemove the "distance" field and declare it as a local variable in the relevant methods.(×¾¶Ðøÿÿÿÿ
q
java:S1450<"VRemove the "imgShow" field and declare it as a local variable in the relevant methods.(–©ýûûÿÿÿÿ
java:S1450K"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.(ƴư
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:S11240"EReorder the modifiers to comply with the Java Language Specification.(¨Öܶüÿÿÿÿ
[
java:S1124/"EReorder the modifiers to comply with the Java Language Specification.(ß×á
java:S11241"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]*$'.(ü™âîùÿÿÿÿ
m
java:S3776`"RRefactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.(ü™âîùÿÿÿÿ
R java:S125¼"<This block of commented-out lines of code should be removed.(é婊
D
java:S1185Ã"(Remove this method to simply inherit it.(ñ‰ÿÜýÿÿÿÿ
D
java:S1185Ë"(Remove this method to simply inherit it.(ñ‰ÿÜýÿÿÿÿ
Z
java:S1117Û">Rename "serverAddr" which hides the field declared at line 56.(ŠÜãËûÿÿÿÿ
R
java:S2696æ"6Make the enclosing method "static" or remove this set.(Ôø±üûÿÿÿÿ
d java:S100Ž"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(×àÿÅ
G
java:S1172"+Remove this unused method parameter "view".(àï’†üÿÿÿÿ
W java:S125Ÿ"<This block of commented-out lines of code should be removed.(ñ¥ùšøÿÿÿÿ
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>Â
\
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.(ãÁð™øÿÿÿÿ
java:S11242"EReorder the modifiers to comply with the Java Language Specification.(Ó¾þá
o java:S100y"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ü™âîùÿÿÿÿ8þ͇á<E280A1>1
t
java:S3776y"RRefactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed.(ü™âîùÿÿÿÿ8ÿ͇á<E280A1>1
K
java:S1185ä"(Remove this method to simply inherit it.(ñ‰ÿÜýÿÿÿÿ8ŽÎ‡á<E280A1>1
S
java:S2696ô"6Make the enclosing method "static" or remove this set.(èª8“·á<E280A1>1
^ java:S125õ"<This block of commented-out lines of code should be removed.(<28>­éäøÿÿÿÿ8“·á<E280A1>1
^ java:S125ú"<This block of commented-out lines of code should be removed.(çéŸþÿÿÿÿ8·á<E280A1>1
Y
java:S2696<18>"6Make the enclosing method "static" or remove this set.(Ôø±üûÿÿÿÿ8—·á<E280A1>1
M
java:S2093ñ"*Change this "try" to a try-with-resources.(ç£ê<C2A3>úÿÿÿÿ8˜Î‡á<E280A1>1
p java:S116Ð"SRename this field "BG_COLOR" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(þ¨ò‘8œÎ‡á<E280A1>1
r
java:S1450Þ"TRemove the "mPath" field and declare it as a local variable in the relevant methods.(ä“<C3A4>Â8 Î‡á<E280A1>1
Y java:S125"<This block of commented-out lines of code should be removed.(Ê蘋8¡Î‡á<E280A1>1
c
java:S1610é"@Convert the abstract class "OnUnlockListener" into an interface.(׋›Îøÿÿÿÿ8¢Î‡á<E280A1>1
D java:S131""Add a default case to this switch.(<28>äÃùÿÿÿÿÿ8©Î‡á<E280A1>1
D java:S131Ü""Add a default case to this switch.(ãÁð™øÿÿÿÿ8²Î‡á<E280A1>1
9
java:S1128*"Remove this duplicated import.(°þÊóøÿÿÿÿ
java:S1128,"Remove this duplicated import.(°þÊóøÿÿÿÿ
C
java:S1068/"-Remove this unused "SEND_PORT" private field.(ß×á
java:S10681"-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:S10687".Remove this unused "sendSocket" private field.(éêÖé
java:S10685"'Remove this unused "buf" private field.(ÅØè<C398>þÿÿÿÿ
D
java:S10688".Remove this unused "serverAddr" private field.(·¡þë
java:S10688".Remove this unused "sendSocket" private field.(éêÖé
J
java:S10689"/Remove this unused "sendHandler" private field.(ã¹Ð«þÿÿÿÿ
java:S1068:"/Remove this unused "sendHandler" private field.(ã¹Ð«þÿÿÿÿ
N
java:S1068;"3Remove this unused "Trans_to_Detect" private field.(¾¥Âöûÿÿÿÿ
F
java:S1068<"+Remove this unused "imgShow" private field.(–©ýûûÿÿÿÿ
java:S1068<"3Remove this unused "Trans_to_Detect" private field.(¾¥Âöûÿÿÿÿ
B
java:S1068="'Remove this unused "btn" private field.(ãȧ<C388>üÿÿÿÿ
J
java:S1068G"/Remove this unused "TakeOff_btn" private field.(€‚òœüÿÿÿÿ
J
java:S1068H"/Remove this unused "Landing_btn" private field.(ÅÔ““þÿÿÿÿ
java:S1068>"'Remove this unused "btn" private field.(ãȧ<C388>üÿÿÿÿ
D
java:S1068I")Remove this unused "angle" private field.(§úþóþÿÿÿÿ
java:S1068J")Remove this unused "angle" private field.(§úþóþÿÿÿÿ
G
java:S1068J",Remove this unused "distance" private field.(×¾¶Ðøÿÿÿÿ
@
java:S1068½")Remove this unused "mPath" private field.(ä“<C3A4>Â
F
java:S1068Ã"/Remove this unused "mIsUnlocked" private field.(ˆø•ö
java:S1068K",Remove this unused "distance" private field.(×¾¶Ðøÿÿÿÿ
J
java:S1068M"/Remove this unused "mThreadPool" private field.(ÄÐâµúÿÿÿÿ
G
java:S1068Þ")Remove this unused "mPath" private field.(ä“<C3A4>Â8µÎ‡á<E280A1>1
M
java:S1068ä"/Remove this unused "mIsUnlocked" private field.(ˆø•ö8µÎ‡á<E280A1>1

@ -1,13 +1,13 @@
l java:S117Ú"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÓÔÒÞùÿÿÿÿ
l java:S117Û"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÓÔÒÞùÿÿÿÿ
p
java:S1104D"[Make mLocationClient a static final constant or non-public and provide accessors if needed.(òó•L
q
java:S1104F"[Make mLocationOption a static final constant or non-public and provide accessors if needed.(ÈÀ‚§
d
java:S2259"MA "NullPointerException" could be thrown; "mLocationClient" is nullable here.(Ô¹¤<C2B9>
java:S2259<EFBFBD>"MA "NullPointerException" could be thrown; "mLocationClient" is nullable here.(Ô¹¤<C2B9>
c
java:S2095ñ"LUse try-with-resources or close this "DatagramSocket" in a "finally" clause.(ù<>Èö
java:S2095ó"LUse try-with-resources or close this "DatagramSocket" in a "finally" clause.(ù<>Èö
o java:S115d"ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(ë¿§Ï
s java:S116I"YRename this field "Current_latlng" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(æàÁÆÿÿÿÿÿ
o java:S116["ZRename this field "ClearMarker_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ëþ¥È
@ -16,7 +16,7 @@ d java:S116i"PRename this field "Angle" to match the regular expression '^[a-z
q java:S116j"WRename this field "MonitorAngle" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(þ‰Ô€ûÿÿÿÿ
o java:S116l"ZRename this field "MonitorDistance" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ƒæ¬Ê
˜
java:S1186á"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(±€¿ë
java:S1186ã"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(±€¿ë
i
java:S1450i"TRemove the "Angle" field and declare it as a local variable in the relevant methods.(ÒáÒD
w
@ -36,34 +36,34 @@ java:S1124d"EReorder the modifiers to comply with the Java Language Specificati
`
java:S1124e"EReorder the modifiers to comply with the Java Language Specification.(<28>”µÆüÿÿÿÿ
Q java:S125h"<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.(¤¯¿Îúÿÿÿÿ
V java:S125x"<This block of commented-out lines of code should be removed.(¤¯¿Îúÿÿÿÿ
f
java:S1874"JDon't override a deprecated method or explicitly mark it as "@Deprecated".(Ó»×¶þÿÿÿÿ
R java:S125ì"<This block of commented-out lines of code should be removed.(©áèè
java:S1874·"JDon't override a deprecated method or explicitly mark it as "@Deprecated".(Ó»×¶þÿÿÿÿ
R java:S125í"<This block of commented-out lines of code should be removed.(©áèè
Y
java:S1854Ÿ"=Remove this useless assignment to local variable "longitude".(ËàÅ€ûÿÿÿÿ
java:S1854 "=Remove this useless assignment to local variable "longitude".(ËàÅ€ûÿÿÿÿ
X
java:S1854<EFBFBD>"<Remove this useless assignment to local variable "latitude".(û‘áäùÿÿÿÿ
java:S1854ž"<Remove this useless assignment to local variable "latitude".(û‘áäùÿÿÿÿ
I
java:S1481<EFBFBD>"-Remove this unused "latitude" local variable.(û‘áäùÿÿÿÿ
java:S1481ž"-Remove this unused "latitude" local variable.(û‘áäùÿÿÿÿ
J
java:S1481Ÿ".Remove this unused "longitude" local variable.(ËàÅ€ûÿÿÿÿ
R java:S125Þ"<This block of commented-out lines of code should be removed.(É–Ö­
java:S1481 ".Remove this unused "longitude" local variable.(ËàÅ€ûÿÿÿÿ
R java:S125ß"<This block of commented-out lines of code should be removed.(É–Ö­
G
java:S1172ƒ"+Remove this unused method parameter "view".(çÑ¢‰ýÿÿÿÿ
java:S1172"+Remove this unused method parameter "view".(çÑ¢‰ýÿÿÿÿ
U
java:S1155">Use isEmpty() to check whether the collection is empty or not.(”ó±’
java:S1155">Use isEmpty() to check whether the collection is empty or not.(”ó±’
G
java:S1172Œ"+Remove this unused method parameter "view".(•É‘Îûÿÿÿÿ
Q java:S125ž"<This block of commented-out lines of code should be removed.(Ÿ…¦Q
java:S1172<EFBFBD>"+Remove this unused method parameter "view".(•É‘Îûÿÿÿÿ
Q java:S125 "<This block of commented-out lines of code should be removed.(Ÿ…¦Q
U
java:S1117Í"9Rename "query" which hides the field declared at line 83.(˜Ž“áûÿÿÿÿ
java:S1117Ï"9Rename "query" which hides the field declared at line 83.(˜Ž“áûÿÿÿÿ
\
java:S2147ˆ"ECombine this catch with the one at line 518, which has the same body.(<28>”ý¾
java:S2147Š"ECombine this catch with the one at line 520, which has the same body.(<28>”ý¾
n
java:S3776˜"RRefactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed.(—´¸…øÿÿÿÿ
O java:S106µ"9Replace this use of System.out or System.err by a logger.(éÃÇâ
W java:S125·"<This block of commented-out lines of code should be removed.(×ûÂÚÿÿÿÿÿ
java:S3776š"RRefactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed.(—´¸…øÿÿÿÿ
O java:S106·"9Replace this use of System.out or System.err by a logger.(éÃÇâ
W java:S125¹"<This block of commented-out lines of code should be removed.(×ûÂÚÿÿÿÿÿ
>
java:S1068H"(Remove this unused "city" private field.(“øÌà
?
@ -81,4 +81,4 @@ java:S1068f"0Remove this unused "listenStatus" private field.(
I
java:S1068g".Remove this unused "serverAddr" private field.(<28>§±ùÿÿÿÿ
E
java:S1068é".Remove this unused "mReceiveIp" private field.(úúÛò
java:S1068ë".Remove this unused "mReceiveIp" private field.(úúÛò

@ -0,0 +1,2 @@
R xml:S55943"1Implement permissions on this exported component.(ˆ©…»ùÿÿÿÿ8…îö“<C3B6>1

@ -0,0 +1,10 @@
k java:S117'"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ß<>±÷üÿÿÿÿ
q
java:S1450"[Remove the "mLoginButton" field and declare it as a local variable in the relevant methods.(žÉÕ<C389>
t
java:S1171"YMove the contents of this initializer to a standard constructor or to field initializers.(ÒÌâ–øÿÿÿÿ
G
java:S1602 ",Remove useless curly braces around statement(òã‘õúÿÿÿÿ
V
java:S11263"AReplace this if-then-else statement by a single return statement.(Ö<>¼z

@ -15,17 +15,21 @@ i
settings.gradle,0\5\05efc8b1657769a27696d478ded1e95f38737233
@
app/build.gradle,f\4\f4a01d6a4fcb971362ec00a83903fd3902f52164
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
j
:app/src/main/java/com/example/sixaunyi/MapApplication.java,7\7\776a4b5f215e52628a4164ac15ef90fa338360ce
j
:app/src/main/java/com/example/sixaunyi/DetectActivity.java,9\6\9668392b13e33166876f2a7d3f10eb5405e757ad
i
9app/src/main/java/com/example/sixaunyi/VideoActivity.java,7\1\71fd1993763df2214bbdad8cfee650733993fe44
k
;app/src/main/java/com/example/sixaunyi/ControlActivity.java,c\9\c99a584c2117ed2df42496451bb97ac1147f5ea0
P
app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e
k
;app/src/main/java/com/example/sixaunyi/SettingActivity.java,2\a\2ab0711d9aa5839cecbb6cf0ed96f5a3f6470de5
i
9app/src/main/java/com/example/sixaunyi/LoginActivity.java,f\7\f7730cde41931660f06cfc32899edf44acf4d104
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

@ -25,10 +25,14 @@
android:theme="@style/Theme.Sixaunyi"
tools:targetApi="31">
<activity
android:name=".ControlActivity"
android:name=".SettingActivity"
android:exported="false"
android:screenOrientation="landscape"
android:exported="false" />
<!-- 定位service -->
android:theme="@style/TransparentTheme"/>
<activity
android:name=".ControlActivity"
android:exported="false"
android:screenOrientation="landscape" /> <!-- 定位service -->
<service android:name="com.amap.api.location.APSService" /> <!-- 设置高德Key -->
<meta-data
android:name="com.amap.api.v2.apikey"
@ -36,8 +40,9 @@
<activity
android:name=".VideoActivity"
android:exported="false"
android:screenOrientation="landscape"
android:exported="false" />
/>
<activity
android:name=".DetectActivity"
android:exported="false"
@ -48,6 +53,11 @@
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat">
</activity>
<activity
android:name=".LoginActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -55,4 +65,5 @@
</intent-filter>
</activity>
</application>
</manifest>

@ -0,0 +1,57 @@
package com.example.sixaunyi;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import java.util.HashMap;
import java.util.Map;
public class LoginActivity extends AppCompatActivity {
private EditText mUsername;
private EditText mPassword;
private Button mLoginButton;
private Map<String, String> mUsers = new HashMap<>();
{
mUsers.put("admin", "123456");
mUsers.put("tiequan", "8731");
mUsers.put("zhenghaoyuan", "6666");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
// 获取输入框和按钮的实例
mUsername = findViewById(R.id.username);
mPassword = findViewById(R.id.password);
mLoginButton = findViewById(R.id.login);
// 设置登录按钮的点击事件
mLoginButton.setOnClickListener(v -> {
attemptLogin();
});
}
private void attemptLogin() {
String username = mUsername.getText().toString();
String password = mPassword.getText().toString();
boolean if_correct = verifyUser(username,password);
if (if_correct) {
Toast.makeText(this, "登录成功", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
startActivity(intent);
finish(); // 关闭登录界面
} else {
Toast.makeText(this, "用户名或密码错误", Toast.LENGTH_SHORT).show();
}
}
private boolean verifyUser(String username, String password){
if (mUsers.containsKey(username) && mUsers.get(username).equals(password)) {
return true;
} else {
return false;
}
}
}

@ -106,6 +106,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
private String MonitorAngle;
private float distance;
private float MonitorDistance;
private UdpReceiveThread udpReceiveThread;
@SuppressLint("MissingInflatedId")
@Override
@ -126,7 +127,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
//检查安卓版本
checkingAndroidVersion();
UdpReceiveThread udpReceiveThread = new UdpReceiveThread();
udpReceiveThread = new UdpReceiveThread();
udpReceiveThread.startListening();
}
@ -394,6 +395,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
}
public void changeAct(View view) {
udpReceiveThread.stopListening();
Intent intent = new Intent(MainActivity.this, VideoActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);
@ -472,7 +474,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
RegeocodeAddress regeocodeAddress = regeocodeResult.getRegeocodeAddress();
//显示解析后的地址
showMsg("地址:"+regeocodeAddress.getFormatAddress());
}else {
} else {
showMsg("获取地址失败");
}
}
@ -583,7 +585,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
angle = 90-angle;
} else if (subLat < 0) {
// 此时的点在中心点的左下角
angle += 180;
angle = 270-angle;
}
}
}

@ -0,0 +1,14 @@
package com.example.sixaunyi;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class SettingActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_setting);
}
}

@ -38,6 +38,8 @@ import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import android.os.Bundle;
@ -46,11 +48,10 @@ public class VideoActivity extends AppCompatActivity {
private final static String Recieve_IP = "192.168.39.47";//填服务器IP与send_to_IP为同一个
private final static int SEND_PORT = 8888; //发送端口号
private final static int RECEIVE_PORT = 9999; //接收端口号
int TimeInterval = 5;
private static boolean listenStatus = true; //接收线程的循环标识
private byte[] buf;
static Bitmap bp;
private DatagramSocket receiveSocket;
private DatagramSocket reveSocket;
private DatagramSocket sendSocket;
private static InetAddress serverAddr;
@ -69,9 +70,14 @@ public class VideoActivity extends AppCompatActivity {
private ImageButton TurnRight_btn;
private ImageButton Setting_btn;
private ImageButton TakeOff_btn;
private Button Landing_btn;
private ImageButton Landing_btn;
private String angle;
private float distance;
// 创建一个可缓存的线程池
private ExecutorService mThreadPool = Executors.newCachedThreadPool();
//ReceiveData()显示到imageView
//manager部分打开线程接收
//model部分发送视频流
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -79,14 +85,33 @@ public class VideoActivity extends AppCompatActivity {
setContentView(R.layout.activity_control);
imgShow = findViewById(R.id.imageView);
Forward_btn = findViewById(R.id.forward_button);
Back_btn = findViewById(R.id.backward_button);
Left_btn = findViewById(R.id.left_button);
Right_btn = findViewById(R.id.right_button);
Down_btn = findViewById(R.id.down_button);
Up_btn = findViewById(R.id.up_button);
TurnLeft_btn = findViewById(R.id.rotate_left_button);
Landing_btn = findViewById(R.id.landing_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) {
try {
sendOrder("TAKEOFF");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
Log.i(TAG, "onClick: BBBBBBBBackward");
}
});
Landing_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new UdpReceiveThread().start();
}
});
Setting_btn = findViewById(R.id.setting_button);
Button_Init();
Intent i = getIntent();
@ -98,7 +123,7 @@ public class VideoActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
try {
InitUdpSend("FORWARD");
sendOrder("FORWARD");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
@ -109,7 +134,7 @@ public class VideoActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
try {
InitUdpSend("BACKWORD");
sendOrder("BACKWORD");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
@ -120,7 +145,7 @@ public class VideoActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
try {
InitUdpSend("LEFT");
sendOrder("LEFT");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
@ -131,7 +156,7 @@ public class VideoActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
try {
InitUdpSend("RIGHT");
sendOrder("RIGHT");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
@ -142,7 +167,7 @@ public class VideoActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
try {
InitUdpSend("DOWN");
sendOrder("DOWN");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
@ -153,7 +178,7 @@ public class VideoActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
try {
InitUdpSend("UP");
sendOrder("UP");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
@ -164,7 +189,7 @@ public class VideoActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
try {
InitUdpSend("TURN_LEFT");
sendOrder("TURN_LEFT");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
@ -175,7 +200,7 @@ public class VideoActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
try {
InitUdpSend("TURN_RIGHT");
sendOrder("TURN_RIGHT");
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
@ -185,8 +210,8 @@ public class VideoActivity extends AppCompatActivity {
Setting_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//Intent intent = new Intent(VideoActivity.this, SpeedActivity.class);
//startActivity(intent);
Intent intent = new Intent(VideoActivity.this, SettingActivity.class);
startActivity(intent);
}
});
}
@ -194,7 +219,7 @@ public class VideoActivity extends AppCompatActivity {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
imgShow.setImageBitmap(bp);
}
}
@ -216,11 +241,13 @@ public class VideoActivity extends AppCompatActivity {
try
{
reveSocket = new DatagramSocket(RECEIVE_PORT);
InetAddress serverAddr = InetAddress.getByName(Recieve_IP);
serverAddr = InetAddress.getByName(Recieve_IP);
//ByteArrayOutputStream out = new ByteArrayOutputStream();
while(listenStatus)
{
byte[] inBuf= new byte[1024*1024];
DatagramPacket inPacket=new DatagramPacket(inBuf,inBuf.length);
//out.write(inPacket.getData());
reveSocket.receive(inPacket);
if(!inPacket.getAddress().equals(serverAddr)){
throw new IOException("未知名的报文");
@ -228,13 +255,12 @@ public class VideoActivity extends AppCompatActivity {
ByteArrayInputStream in = new ByteArrayInputStream(inPacket.getData());
receiveHandler.sendEmptyMessage(1);
bp = BitmapFactory.decodeStream(in);
}
}
catch (Exception e)
} catch (Exception e)
{
e.printStackTrace();
}finally {
reveSocket.close();
}
}
}
@ -265,38 +291,45 @@ public class VideoActivity extends AppCompatActivity {
e.printStackTrace();
}
}
}
//初始化UDP发送线程
private static void InitUdpSend(String Sendstr) throws UnknownHostException {
private static void sendOrder(String Sendstr) throws UnknownHostException {
InetAddress sendIP = InetAddress.getByName(SEND_to_IP); // 目标 IP 地址
int sendPort = 8888; // 目标端口号
byte[] sendData = Sendstr.getBytes(); // 要发送的数据
UdpSendThread sendThread = new UdpSendThread(sendIP, sendPort, sendData); // 创建新的线程对象
sendThread.start(); // 启动线程发送数据
UdpSendThread sendOrderThread = new UdpSendThread(sendIP, sendPort, sendData); // 创建新的线程对象
sendOrderThread.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);
// }
new UdpReceiveThread().start();
dialog.dismiss();
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 {
//// sendOrder("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{

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 KiB

@ -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>

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/bg"
tools:context=".MainActivity">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@drawable/android"
android:layout_marginTop="200dp"
android:layout_gravity="center"/>
<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="账号:"
android:layout_marginTop="30dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"/>
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="密码:"
android:layout_marginTop="10dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="记住密码"
android:layout_marginLeft="280dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/login"
android:layout_width="100dp"
android:layout_height="57dp"
android:gravity="center"
android:layout_gravity="center_horizontal"
android:text="登录" />
</LinearLayout>
</LinearLayout>

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#80000000" />
<!-- 这里是其他控件 -->
<LinearLayout
android:layout_width="414dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:background="#80FFFFFF"
android:orientation="vertical"
android:padding="16dp">
<Switch
android:id="@+id/switch1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="飞行速度(高)"
android:textSize="28dp" />
<Switch
android:id="@+id/switch2"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="20dp"
android:text="图像高画质"
android:textSize="28dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="低电量预警"
android:textSize="28dp" />
<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="16dp"
android:thumbTint='@color/teal_200' />
</LinearLayout>
</FrameLayout>

@ -13,4 +13,12 @@
<item name="android:windowExitAnimation">@android:anim/fade_out</item>
</style>
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">true</item>
</style>
</resources>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="TransparentTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">#00000000</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
</style>
</resources>
Loading…
Cancel
Save