diff --git a/doc/~$兵”软件系统软件设计规格说明书.doc b/doc/~$兵”软件系统软件设计规格说明书.doc new file mode 100644 index 0000000..5d5e642 Binary files /dev/null and b/doc/~$兵”软件系统软件设计规格说明书.doc differ diff --git a/doc/“哨兵”软件系统软件设计规格说明书.doc b/doc/“哨兵”软件系统软件设计规格说明书.doc index 6a94d4a..79fc44b 100644 Binary files a/doc/“哨兵”软件系统软件设计规格说明书.doc and b/doc/“哨兵”软件系统软件设计规格说明书.doc differ diff --git a/src/sixaunyi/.idea/deploymentTargetDropDown.xml b/src/sixaunyi/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index 20d74ab..0000000 --- a/src/sixaunyi/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/7/1/71fd1993763df2214bbdad8cfee650733993fe44 b/src/sixaunyi/.idea/sonarlint/issuestore/7/1/71fd1993763df2214bbdad8cfee650733993fe44 new file mode 100644 index 0000000..d6cf065 --- /dev/null +++ b/src/sixaunyi/.idea/sonarlint/issuestore/7/1/71fd1993763df2214bbdad8cfee650733993fe44 @@ -0,0 +1,137 @@ + +` 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: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( +D +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( +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".( +] +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: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]*$'.(Ο +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]*$'.(ԓ +u +java:S1450G"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.( +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: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.(Ӿ +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"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"Use isEmpty() to check whether the collection is empty or not.( +G +java:S1172"+Remove this unused method parameter "view".(ɑ +Q java:S125" +java:S1068H"(Remove this unused "city" private field.( +? +java:S1068S")Remove this unused "query" private field.( +H +java:S1068U"-Remove this unused "poiSearch" private field.( +B +java:S1068W",Remove this unused "cityCode" private field.( +I +java:S1068c".Remove this unused "reveSocket" private field.( +K +java:S1068e"0Remove this unused "RECEIVE_PORT" private field.( +K +java:S1068f"0Remove this unused "listenStatus" private field.(㋸ +I +java:S1068g".Remove this unused "serverAddr" private field.( +E +java:S1068".Remove this unused "mReceiveIp" private field.( \ No newline at end of file diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/8/c/8c55c3ccc257e5907959013f99656e4c8ec3903e b/src/sixaunyi/.idea/sonarlint/issuestore/8/c/8c55c3ccc257e5907959013f99656e4c8ec3903e new file mode 100644 index 0000000..e69de29 diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/9/6/9668392b13e33166876f2a7d3f10eb5405e757ad b/src/sixaunyi/.idea/sonarlint/issuestore/9/6/9668392b13e33166876f2a7d3f10eb5405e757ad new file mode 100644 index 0000000..1a7779d --- /dev/null +++ b/src/sixaunyi/.idea/sonarlint/issuestore/9/6/9668392b13e33166876f2a7d3f10eb5405e757ad @@ -0,0 +1,33 @@ + +o +java:S2293Z"YReplace the type specification in this constructor call with the diamond operator ("<>").(ռ +K +java:S1066"/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"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.(䠹 +V java:S106"9Replace this use of System.out or System.err by a logger.(81 +A +java:S1068$"+Remove this unused "button0" private field.( \ No newline at end of file diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/index.pb b/src/sixaunyi/.idea/sonarlint/issuestore/index.pb index 15a33ca..8976264 100644 --- a/src/sixaunyi/.idea/sonarlint/issuestore/index.pb +++ b/src/sixaunyi/.idea/sonarlint/issuestore/index.pb @@ -18,4 +18,14 @@ i 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 \ No newline at end of file +: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 +P + app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e +h +8app/src/main/java/com/example/sixaunyi/MainActivity.java,7\c\7c120b7216f76ce98d1573d90803ab36f481640c \ No newline at end of file diff --git a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java index eeb5145..c6fe042 100644 --- a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java +++ b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/VideoActivity.java @@ -51,11 +51,11 @@ public class VideoActivity extends AppCompatActivity { private byte[] buf; static Bitmap bp; private DatagramSocket receiveSocket; + private DatagramSocket reveSocket; private DatagramSocket sendSocket; - private static DatagramSocket reveSocket; 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; @@ -194,7 +194,7 @@ public class VideoActivity extends AppCompatActivity { @Override public void handleMessage(Message msg) { super.handleMessage(msg); - imgShow.setImageBitmap(bp); + } } @@ -208,7 +208,7 @@ public class VideoActivity extends AppCompatActivity { /* * UDP数据接受线程 * */ - public static class UdpReceiveThread extends Thread + public class UdpReceiveThread extends Thread { @Override public void run() @@ -216,13 +216,11 @@ public class VideoActivity extends AppCompatActivity { try { reveSocket = new DatagramSocket(RECEIVE_PORT); - serverAddr = InetAddress.getByName(Recieve_IP); - //ByteArrayOutputStream out = new ByteArrayOutputStream(); + InetAddress serverAddr = InetAddress.getByName(Recieve_IP); 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("未知名的报文"); @@ -230,12 +228,13 @@ 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(); } } } @@ -285,13 +284,13 @@ public class VideoActivity extends AppCompatActivity { @Override public void onUnlock() { // 在用户滑动解锁后执行操作 - try { - InitUdpSend("TAKEOFF"+"___"+angle+"___"+String.valueOf(distance)); - } catch (UnknownHostException e) { - throw new RuntimeException(e); - } - UdpReceiveThread udpReceiveThread = new UdpReceiveThread(); - udpReceiveThread.start(); +// try { +// InitUdpSend("TAKEOFF"+"___"+angle+"___"+String.valueOf(distance)); +// } catch (UnknownHostException e) { +// throw new RuntimeException(e); +// } + new UdpReceiveThread().start(); + dialog.dismiss(); Log.i(TAG, "onClick: 2222222222222222222222222"); }