diff --git a/doc/“哨兵”软件系统软件设计规格说明书.doc b/doc/“哨兵”软件系统软件设计规格说明书.doc new file mode 100644 index 0000000..6a94d4a Binary files /dev/null and b/doc/“哨兵”软件系统软件设计规格说明书.doc differ diff --git a/doc/软件设计约束.doc b/doc/软件设计约束.doc deleted file mode 100644 index 4043a13..0000000 Binary files a/doc/软件设计约束.doc and /dev/null differ diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/7/1/71fd1993763df2214bbdad8cfee650733993fe44 b/src/sixaunyi/.idea/sonarlint/issuestore/7/1/71fd1993763df2214bbdad8cfee650733993fe44 index 344e932..d9db8f9 100644 --- a/src/sixaunyi/.idea/sonarlint/issuestore/7/1/71fd1993763df2214bbdad8cfee650733993fe44 +++ b/src/sixaunyi/.idea/sonarlint/issuestore/7/1/71fd1993763df2214bbdad8cfee650733993fe44 @@ -1,31 +1,31 @@ C -java:S1604;"(Make this anonymous inner class a lambda( +java:S1604Z"(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]+)*$'.( -t java:S115""ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(Ӂ -t java:S1160"ZRename this field "Trans_to_Detect" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.( +java:S1604c"(Make this anonymous inner class a lambda( +t 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:S116O"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.( +java:S1450O"^Remove the "Trans_to_Detect" field and declare it as a local variable in the relevant methods.( m -java:S14502"RRemove the "btn" 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:S1450Q"RRemove the "btn" 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.(ß [ java:S1124$"EReorder the modifiers to comply with the Java Language Specification.(Ӿ -V java:S125>""YRename this field "Current_latlng" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(81 +v java:S116P"ZRename this field "ClearMarker_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(81 +y java:S116R"XRename this field "ChangeAct_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(81  -java:S1186"Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(80 +java:S1186"Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(81 ~ -java:S1450O"\Remove the "ChangeAct_btn" field and declare it as a local variable in the relevant methods.(80 +java:S1450R"\Remove the "ChangeAct_btn" field and declare it as a local variable in the relevant methods.(81 i -java:S1450;"SRemove the "city" field and declare it as a local variable in the relevant methods.( -m -java:S1450I"WRemove the "cityCode" field and declare it as a local variable in the relevant methods.( -G -java:S1874E"1Remove this use of "PoiSearch"; it is deprecated.( -L -java:S1874G"1Remove this use of "PoiSearch"; it is deprecated.( -] java:S125b"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.(81 N -java:S1172"+Remove this unused method parameter "view".(ɑ80 +java:S1172"+Remove this unused method parameter "view".(ɑ81 +X java:S125" -java:S1068;"(Remove this unused "city" private field.( -? -java:S1068E")Remove this unused "query" private field.( -H -java:S1068G"-Remove this unused "poiSearch" private field.( -B -java:S1068I",Remove this unused "cityCode" private field.( \ No newline at end of file +java:S1068="(Remove this unused "city" private field.( +F +java:S1068H")Remove this unused "query" private field.(81 +O +java:S1068J"-Remove this unused "poiSearch" private field.(81 +I +java:S1068L",Remove this unused "cityCode" private field.(81 \ No newline at end of file diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/9/6/9668392b13e33166876f2a7d3f10eb5405e757ad b/src/sixaunyi/.idea/sonarlint/issuestore/9/6/9668392b13e33166876f2a7d3f10eb5405e757ad index 016bce6..c0f8e8b 100644 --- a/src/sixaunyi/.idea/sonarlint/issuestore/9/6/9668392b13e33166876f2a7d3f10eb5405e757ad +++ b/src/sixaunyi/.idea/sonarlint/issuestore/9/6/9668392b13e33166876f2a7d3f10eb5405e757ad @@ -10,9 +10,9 @@ java:S1604 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.( +> +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]*$'.( ^ diff --git a/src/sixaunyi/.idea/sonarlint/issuestore/index.pb b/src/sixaunyi/.idea/sonarlint/issuestore/index.pb index 319cfcd..b574ac0 100644 --- a/src/sixaunyi/.idea/sonarlint/issuestore/index.pb +++ b/src/sixaunyi/.idea/sonarlint/issuestore/index.pb @@ -17,11 +17,11 @@ j settings.gradle,0\5\05efc8b1657769a27696d478ded1e95f38737233 P app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e -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 @ app/build.gradle,f\4\f4a01d6a4fcb971362ec00a83903fd3902f52164 j -:app/src/main/java/com/example/sixaunyi/DetectActivity.java,9\6\9668392b13e33166876f2a7d3f10eb5405e757ad \ No newline at end of file +:app/src/main/java/com/example/sixaunyi/DetectActivity.java,9\6\9668392b13e33166876f2a7d3f10eb5405e757ad +h +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 \ No newline at end of file diff --git a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java index 7ae8a7f..cd02c0e 100644 --- a/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java +++ b/src/sixaunyi/app/src/main/java/com/example/sixaunyi/MainActivity.java @@ -22,6 +22,7 @@ import com.amap.api.location.AMapLocationClient; import com.amap.api.location.AMapLocationClientOption; import com.amap.api.location.AMapLocationListener; import com.amap.api.maps.AMap; +import com.amap.api.maps.AMapUtils; import com.amap.api.maps.LocationSource; import com.amap.api.maps.MapView; import com.amap.api.maps.model.BitmapDescriptorFactory; @@ -47,7 +48,8 @@ import pub.devrel.easypermissions.AfterPermissionGranted; import pub.devrel.easypermissions.EasyPermissions; public class MainActivity extends AppCompatActivity implements AMapLocationListener, LocationSource, - AMap.OnMapLongClickListener, GeocodeSearch.OnGeocodeSearchListener { + AMap.OnMapLongClickListener, GeocodeSearch.OnGeocodeSearchListener, AMap.OnMarkerDragListener, + AMap.OnMarkerClickListener{ //请求权限码 private static final int REQUEST_PERMISSIONS = 9527; @@ -57,6 +59,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe public AMapLocationClientOption mLocationOption = null; private MapView mapView = null; private String city; + private LatLng Current_latlng; //地图控制器*********非常重要!!!!!! private AMap aMap = null; //位置更改监听 @@ -203,6 +206,10 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe aMap.setLocationSource(this); // 设置为true表示显示定位层并可触发定位,false表示隐藏定位层并不可触发定位,默认是false aMap.setMyLocationEnabled(true); + //设置地图标志点击事件 + aMap.setOnMarkerClickListener(this); + //设置地图标志拖拽事件 + aMap.setOnMarkerDragListener(this); //开启室内地图 //aMap.showIndoorMap(true); //设置地图长按事件 @@ -250,6 +257,8 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe String address = aMapLocation.getAddress(); //城市赋值 city = aMapLocation.getCity(); + //当前位置经纬度坐标 + Current_latlng = new LatLng(aMapLocation.getLatitude(), aMapLocation.getLongitude()); //获取纬度 double latitude = aMapLocation.getLatitude(); //获取经度 @@ -311,7 +320,9 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe //LatLng 为高德地图包自带的存储坐标对象 @Override public void onMapLongClick(LatLng latLng) { - showMsg("长按了地图,经度:"+latLng.longitude+",纬度:"+latLng.latitude); + float distance = AMapUtils.calculateLineDistance(Current_latlng,latLng); + //showMsg("长按了地图,经度:"+latLng.longitude+",纬度:"+latLng.latitude); + showMsg("直线距离:"+distance+"米"); //坐标转地址 latlonToAddress(latLng); //添加标点 @@ -329,13 +340,16 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe //添加标点 Marker marker = aMap.addMarker(markerOption .position(latLng) + .draggable(true) //标点图标 .icon(BitmapDescriptorFactory. fromBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.img))) //备注 - .snippet("路径点") + .title("路径点") + .snippet("距离:") ); + marker.showInfoWindow(); markerList.add(marker); } /** @@ -358,6 +372,56 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe } + /** + * Marker点击事件 + * + * @param marker + * @return + */ + @Override + public boolean onMarkerClick(Marker marker) { + Log.d(TAG,"点击了标点"); + //显示InfoWindow + /* + if (!marker.isInfoWindowShown()) { + //显示 + marker.showInfoWindow(); + } else { + //隐藏 + marker.hideInfoWindow(); + } + */ + return true; + } + + /** + * 开始拖动 + * @param marker + */ + @Override + public void onMarkerDragStart(Marker marker) { + Log.d(TAG,"开始拖动"); + } + + /** + * 拖动中 + * @param marker + */ + @Override + public void onMarkerDrag(Marker marker) { + Log.d(TAG,"拖动中"); + } + + /** + * 拖动完成 + * @param marker + */ + @Override + public void onMarkerDragEnd(Marker marker) { + Log.d(TAG,"拖动完成"); + } + + /* * * 通过坐标获取地址 * * * * * @param latLng 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 edd2898..a292373 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 @@ -30,8 +30,8 @@ import android.os.Bundle; public class VideoActivity extends AppCompatActivity { - private final static String SEND_to_IP = "192.168.10.2"; //填写接收方IP - private final static String Recieve_IP = "192.168.10.2";//填服务器IP + private final static String SEND_to_IP = "192.168.43.165"; //填写接收方IP + private final static String Recieve_IP = "192.168.43.165";//填服务器IP private final static int SEND_PORT = 8888; //发送端口号 private final static int RECEIVE_PORT = 9999; //接收端口号 @@ -44,6 +44,37 @@ public class VideoActivity extends AppCompatActivity { private DatagramSocket reveSocket; private InetAddress serverAddr; private SendHandler sendHandler = new SendHandler(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + private ReceiveHandler receiveHandler = new ReceiveHandler(); private Button Trans_to_Detect; private ImageView imgShow; diff --git a/src/sixaunyi/app/src/main/res/layout/custom_info_contents.xml b/src/sixaunyi/app/src/main/res/layout/custom_info_contents.xml new file mode 100644 index 0000000..b0f6f79 --- /dev/null +++ b/src/sixaunyi/app/src/main/res/layout/custom_info_contents.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + diff --git a/src/sixaunyi/app/src/main/res/layout/custom_info_window.xml b/src/sixaunyi/app/src/main/res/layout/custom_info_window.xml new file mode 100644 index 0000000..35e03cd --- /dev/null +++ b/src/sixaunyi/app/src/main/res/layout/custom_info_window.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + +