Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
Conflicts: app/src/main/java/com/navinfo/omqs/ui/activity/map/MainActivity.kt app/src/main/java/com/navinfo/omqs/ui/activity/map/MainViewModel.kt
@ -55,7 +55,7 @@ class Constant {
|
|||||||
/**
|
/**
|
||||||
* 室内整理工具IP
|
* 室内整理工具IP
|
||||||
*/
|
*/
|
||||||
lateinit var INDOOR_IP: String
|
var INDOOR_IP: String = ""
|
||||||
|
|
||||||
const val DEBUG = true
|
const val DEBUG = true
|
||||||
|
|
||||||
|
@ -2,5 +2,5 @@ package com.navinfo.omqs.bean
|
|||||||
|
|
||||||
data class QRCodeBean(
|
data class QRCodeBean(
|
||||||
var errcode: Int = -1,
|
var errcode: Int = -1,
|
||||||
var msg: String = ""
|
var errmsg: String = ""
|
||||||
)
|
)
|
@ -101,7 +101,16 @@ class NetworkServiceImpl @Inject constructor(
|
|||||||
//在IO线程中运行
|
//在IO线程中运行
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
return@withContext try {
|
return@withContext try {
|
||||||
val result = netApi.retrofitUpdateServerInfo(url,indoorConnectionInfoBean)
|
val map: MutableMap<String, String> = HashMap()
|
||||||
|
map["username"] = indoorConnectionInfoBean.username
|
||||||
|
map["uname"] = indoorConnectionInfoBean.uname
|
||||||
|
map["userid"] = indoorConnectionInfoBean.userid
|
||||||
|
map["plate"] = indoorConnectionInfoBean.plate
|
||||||
|
map["token"] = indoorConnectionInfoBean.token
|
||||||
|
map["baseurl"] = indoorConnectionInfoBean.baseurl
|
||||||
|
map["platform"] = indoorConnectionInfoBean.platform
|
||||||
|
|
||||||
|
val result = netApi.retrofitUpdateServerInfo(url,map)
|
||||||
if (result.isSuccessful) {
|
if (result.isSuccessful) {
|
||||||
if (result.code() == 200) {
|
if (result.code() == 200) {
|
||||||
NetResult.Success(result.body())
|
NetResult.Success(result.body())
|
||||||
|
@ -78,9 +78,9 @@ interface RetrofitNetworkServiceAPI {
|
|||||||
/**
|
/**
|
||||||
* 登录接口
|
* 登录接口
|
||||||
*/
|
*/
|
||||||
@Headers("Content-Type: application/json")
|
@FormUrlEncoded
|
||||||
@POST
|
@POST
|
||||||
suspend fun retrofitUpdateServerInfo(@Url url: String,@Body indoorConnectionInfoBean: IndoorConnectionInfoBean): Response<QRCodeBean>
|
suspend fun retrofitUpdateServerInfo(@Url url: String,@FieldMap map: Map<String,String>): Response<QRCodeBean>
|
||||||
|
|
||||||
@Headers("Content-Type: application/json")
|
@Headers("Content-Type: application/json")
|
||||||
@POST("/devcp/uploadSceneProblem")
|
@POST("/devcp/uploadSceneProblem")
|
||||||
|
@ -176,6 +176,19 @@ class TaskUploadScope(
|
|||||||
} else if (it.problemType == "遗漏") {
|
} else if (it.problemType == "遗漏") {
|
||||||
problemType = 2
|
problemType = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var roadClassfcation = 0
|
||||||
|
|
||||||
|
var roadFunctionGrade = 0
|
||||||
|
|
||||||
|
var dataLevel = 0
|
||||||
|
|
||||||
|
if(hadLinkDvoBean.linkInfo!=null){
|
||||||
|
roadClassfcation = hadLinkDvoBean.linkInfo!!.kind
|
||||||
|
roadFunctionGrade = hadLinkDvoBean.linkInfo!!.functionLevel
|
||||||
|
dataLevel = hadLinkDvoBean.linkInfo!!.dataLevel
|
||||||
|
}
|
||||||
|
|
||||||
var evaluationWay = 2
|
var evaluationWay = 2
|
||||||
val evaluationInfo = EvaluationInfo(
|
val evaluationInfo = EvaluationInfo(
|
||||||
evaluationTaskId = taskBean.id.toString(),
|
evaluationTaskId = taskBean.id.toString(),
|
||||||
@ -193,11 +206,11 @@ class TaskUploadScope(
|
|||||||
evaluatorName = it.checkUserId,
|
evaluatorName = it.checkUserId,
|
||||||
evaluationDate = it.checkTime,
|
evaluationDate = it.checkTime,
|
||||||
evaluationWay = evaluationWay,
|
evaluationWay = evaluationWay,
|
||||||
roadClassfcation = 1,
|
roadClassfcation = roadClassfcation,
|
||||||
roadFunctionGrade = 3,
|
roadFunctionGrade = roadFunctionGrade,
|
||||||
noEvaluationreason = "",
|
noEvaluationreason = "",
|
||||||
linkLength = s.toDouble(),
|
linkLength = s.toDouble(),
|
||||||
dataLevel = 3,
|
dataLevel = dataLevel,
|
||||||
linstringLength = 0.0,
|
linstringLength = 0.0,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -106,6 +106,7 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//点击详细信息
|
//点击详细信息
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
override fun onMoreInfoClick(selectTag: String, tag: String, signBean: SignBean) {
|
override fun onMoreInfoClick(selectTag: String, tag: String, signBean: SignBean) {
|
||||||
viewModel.showSignMoreInfo(signBean.renderEntity)
|
viewModel.showSignMoreInfo(signBean.renderEntity)
|
||||||
val fragment =
|
val fragment =
|
||||||
@ -146,7 +147,7 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.M)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
@ -175,7 +176,7 @@ class MainActivity : BaseActivity() {
|
|||||||
//给xml传递viewModel对象
|
//给xml传递viewModel对象
|
||||||
binding.viewModel = viewModel
|
binding.viewModel = viewModel
|
||||||
|
|
||||||
binding.mainActivityVoice.setOnTouchListener { v, event ->
|
binding.mainActivityVoice.setOnTouchListener { v, event ->
|
||||||
when (event?.action) {
|
when (event?.action) {
|
||||||
MotionEvent.ACTION_DOWN -> {
|
MotionEvent.ACTION_DOWN -> {
|
||||||
voiceOnTouchStart()//Do Something
|
voiceOnTouchStart()//Do Something
|
||||||
@ -234,7 +235,9 @@ class MainActivity : BaseActivity() {
|
|||||||
|
|
||||||
//捕捉列表变化回调
|
//捕捉列表变化回调
|
||||||
viewModel.liveDataNILocationList.observe(this) {
|
viewModel.liveDataNILocationList.observe(this) {
|
||||||
Toast.makeText(this, "轨迹被点击了", Toast.LENGTH_LONG).show()
|
if(viewModel.isSelectTrace()){
|
||||||
|
Toast.makeText(this,"轨迹被点击了",Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//右上角菜单是否被点击
|
//右上角菜单是否被点击
|
||||||
@ -381,7 +384,7 @@ class MainActivity : BaseActivity() {
|
|||||||
mapController.mMapView.onPause()
|
mapController.mMapView.onPause()
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.M)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
viewModel.speakMode?.shutdown()
|
viewModel.speakMode?.shutdown()
|
||||||
@ -412,7 +415,7 @@ class MainActivity : BaseActivity() {
|
|||||||
/**
|
/**
|
||||||
* 打开相机预览
|
* 打开相机预览
|
||||||
*/
|
*/
|
||||||
@RequiresApi(Build.VERSION_CODES.M)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
fun openCamera() {
|
fun openCamera() {
|
||||||
//显示轨迹图层
|
//显示轨迹图层
|
||||||
viewModel.onClickCameraButton(this)
|
viewModel.onClickCameraButton(this)
|
||||||
@ -421,7 +424,7 @@ class MainActivity : BaseActivity() {
|
|||||||
/**
|
/**
|
||||||
* 开关菜单
|
* 开关菜单
|
||||||
*/
|
*/
|
||||||
@RequiresApi(Build.VERSION_CODES.M)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
fun onClickMenu() {
|
fun onClickMenu() {
|
||||||
//显示菜单图层
|
//显示菜单图层
|
||||||
viewModel.onClickMenu()
|
viewModel.onClickMenu()
|
||||||
@ -529,11 +532,82 @@ class MainActivity : BaseActivity() {
|
|||||||
/**
|
/**
|
||||||
* 点击线选择
|
* 点击线选择
|
||||||
*/
|
*/
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
fun selectLineOnclick() {
|
fun selectLineOnclick() {
|
||||||
viewModel.setSelectRoad(!viewModel.isSelectRoad())
|
viewModel.setSelectRoad(!viewModel.isSelectRoad())
|
||||||
binding.mainActivitySelectLine.isSelected = viewModel.isSelectRoad()
|
binding.mainActivitySelectLine.isSelected = viewModel.isSelectRoad()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击线选择
|
||||||
|
*/
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
|
fun tracePointsOnclick() {
|
||||||
|
viewModel.setSelectTrace(!viewModel.isSelectTrace())
|
||||||
|
if(viewModel.isSelectTrace()){
|
||||||
|
Toast.makeText(this,"请选择轨迹点!",Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
|
binding.mainActivityTraceSnapshotPoints.isSelected = viewModel.isSelectTrace()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击结束轨迹操作
|
||||||
|
*/
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
|
fun finishTraceOnclick() {
|
||||||
|
setIndoorGroupEnable(false)
|
||||||
|
viewModel.setSelectTrace(false)
|
||||||
|
viewModel.setMediaFlag(false)
|
||||||
|
viewModel.setSelectPauseTrace(false)
|
||||||
|
binding.mainActivityTraceSnapshotPoints.isSelected = viewModel.isSelectTrace()
|
||||||
|
binding.mainActivitySnapshotMediaFlag.isSelected = viewModel.isMediaFlag()
|
||||||
|
binding.mainActivitySnapshotPause.isSelected = viewModel.isSelectPauseTrace()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击结束轨迹操作
|
||||||
|
*/
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
|
fun mediaFlagOnclick() {
|
||||||
|
viewModel.setMediaFlag(!viewModel.isMediaFlag())
|
||||||
|
binding.mainActivitySnapshotMediaFlag.isSelected = viewModel.isMediaFlag()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击上一个轨迹点播放操作
|
||||||
|
*/
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
|
fun rewindTraceOnclick() {
|
||||||
|
pasePlayTrace()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击暂停播放轨迹操作
|
||||||
|
*/
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
|
fun pauseTraceOnclick() {
|
||||||
|
viewModel.setSelectPauseTrace(!viewModel.isSelectPauseTrace())
|
||||||
|
binding.mainActivitySnapshotPause.isSelected = viewModel.isSelectPauseTrace()
|
||||||
|
viewModel.setSelectTrace(false)
|
||||||
|
binding.mainActivityTraceSnapshotPoints.isSelected = viewModel.isSelectTrace()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击下一个轨迹点
|
||||||
|
*/
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
|
fun nextTraceOnclick() {
|
||||||
|
pasePlayTrace()
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
|
fun pasePlayTrace() {
|
||||||
|
viewModel.setSelectTrace(false)
|
||||||
|
binding.mainActivityTraceSnapshotPoints.isSelected = viewModel.isSelectTrace()
|
||||||
|
viewModel.setSelectPauseTrace(false)
|
||||||
|
binding.mainActivitySnapshotPause.isSelected = viewModel.isSelectPauseTrace()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打开或关闭底部导航栏
|
* 打开或关闭底部导航栏
|
||||||
@ -554,15 +628,10 @@ class MainActivity : BaseActivity() {
|
|||||||
mapController.mMapView.setScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, 128, 65)
|
mapController.mMapView.setScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, 128, 65)
|
||||||
}
|
}
|
||||||
mapController.mMapView.vtmMap.animator()
|
mapController.mMapView.vtmMap.animator()
|
||||||
.animateTo(
|
.animateTo(GeoPoint( mapController.mMapView.vtmMap.mapPosition.geoPoint.latitude,mapController.mMapView.vtmMap.mapPosition.geoPoint.longitude))
|
||||||
GeoPoint(
|
|
||||||
mapController.mMapView.vtmMap.mapPosition.geoPoint.latitude,
|
|
||||||
mapController.mMapView.vtmMap.mapPosition.geoPoint.longitude
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.M)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
private fun voiceOnTouchStart() {
|
private fun voiceOnTouchStart() {
|
||||||
viewModel.startSoundMetter(this, binding.mainActivityVoice)
|
viewModel.startSoundMetter(this, binding.mainActivityVoice)
|
||||||
}
|
}
|
||||||
@ -615,6 +684,27 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示轨迹回放布局
|
||||||
|
*/
|
||||||
|
fun showIndoorDataLayout() {
|
||||||
|
binding.mainActivityMenuIndoorGroup.visibility = View.VISIBLE
|
||||||
|
if(Constant.INDOOR_IP.isNotEmpty()){
|
||||||
|
setIndoorGroupEnable(true)
|
||||||
|
}else{
|
||||||
|
setIndoorGroupEnable(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setIndoorGroupEnable(enable: Boolean){
|
||||||
|
binding.mainActivitySnapshotFinish.isEnabled = enable
|
||||||
|
binding.mainActivityTraceSnapshotPoints.isEnabled = enable
|
||||||
|
binding.mainActivitySnapshotMediaFlag.isEnabled = enable
|
||||||
|
binding.mainActivitySnapshotRewind.isEnabled = enable
|
||||||
|
binding.mainActivitySnapshotPause.isEnabled = enable
|
||||||
|
binding.mainActivitySnapshotNext.isEnabled = enable
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路径规划
|
* 路径规划
|
||||||
*/
|
*/
|
||||||
@ -645,7 +735,7 @@ class MainActivity : BaseActivity() {
|
|||||||
/**
|
/**
|
||||||
* 打开道路名称属性看板,选择的道路在viewmodel里记录,不用
|
* 打开道路名称属性看板,选择的道路在viewmodel里记录,不用
|
||||||
*/
|
*/
|
||||||
@RequiresApi(Build.VERSION_CODES.M)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
fun openRoadNameFragment() {
|
fun openRoadNameFragment() {
|
||||||
if (viewModel.liveDataRoadName.value != null) {
|
if (viewModel.liveDataRoadName.value != null) {
|
||||||
viewModel.showSignMoreInfo(viewModel.liveDataRoadName.value!!)
|
viewModel.showSignMoreInfo(viewModel.liveDataRoadName.value!!)
|
||||||
|
@ -60,6 +60,7 @@ import javax.inject.Inject
|
|||||||
* 创建Activity全局viewmode
|
* 创建Activity全局viewmode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
class MainViewModel @Inject constructor(
|
class MainViewModel @Inject constructor(
|
||||||
private val mapController: NIMapController,
|
private val mapController: NIMapController,
|
||||||
@ -77,7 +78,7 @@ class MainViewModel @Inject constructor(
|
|||||||
val liveDataNoteIdList = MutableLiveData<List<String>>()
|
val liveDataNoteIdList = MutableLiveData<List<String>>()
|
||||||
|
|
||||||
//地图点击捕捉到的轨迹列表
|
//地图点击捕捉到的轨迹列表
|
||||||
val liveDataNILocationList = MutableLiveData<List<NiLocation>>()
|
val liveDataNILocationList = MutableLiveData<NiLocation>()
|
||||||
|
|
||||||
//左侧看板数据
|
//左侧看板数据
|
||||||
val liveDataSignList = MutableLiveData<List<SignBean>>()
|
val liveDataSignList = MutableLiveData<List<SignBean>>()
|
||||||
@ -113,6 +114,7 @@ class MainViewModel @Inject constructor(
|
|||||||
|
|
||||||
var menuState: Boolean = false
|
var menuState: Boolean = false
|
||||||
|
|
||||||
|
var captureLinkState: Boolean = false
|
||||||
|
|
||||||
val liveDataMenuState = MutableLiveData<Boolean>()
|
val liveDataMenuState = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
@ -123,6 +125,21 @@ class MainViewModel @Inject constructor(
|
|||||||
*/
|
*/
|
||||||
private var bSelectRoad = false
|
private var bSelectRoad = false
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是不是选择轨迹点
|
||||||
|
*/
|
||||||
|
private var bSelectTrace = false
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是不是选择标题标识
|
||||||
|
*/
|
||||||
|
private var isMediaFlag = false
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是不是暂停
|
||||||
|
*/
|
||||||
|
private var bSelectPauseTrace = false
|
||||||
|
|
||||||
private var linkIdCache = ""
|
private var linkIdCache = ""
|
||||||
|
|
||||||
private var lastNiLocaion: NiLocation? = null
|
private var lastNiLocaion: NiLocation? = null
|
||||||
@ -146,8 +163,8 @@ class MainViewModel @Inject constructor(
|
|||||||
liveDataNoteIdList.value = list
|
liveDataNoteIdList.value = list
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNiLocationList(list: MutableList<NiLocation>) {
|
override fun onNiLocation(item: NiLocation) {
|
||||||
liveDataNILocationList.value = list
|
liveDataNILocationList.value = item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
mapController.lineHandler.setOnTaskLinkItemClickListener(object :
|
mapController.lineHandler.setOnTaskLinkItemClickListener(object :
|
||||||
@ -177,7 +194,7 @@ class MainViewModel @Inject constructor(
|
|||||||
initTaskData()
|
initTaskData()
|
||||||
initQsRecordData()
|
initQsRecordData()
|
||||||
initNoteData()
|
initNoteData()
|
||||||
// initNILocationData()
|
initNILocationData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,12 +262,13 @@ class MainViewModel @Inject constructor(
|
|||||||
/**
|
/**
|
||||||
* 初始化定位信息
|
* 初始化定位信息
|
||||||
*/
|
*/
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
private fun initLocation() {
|
private fun initLocation() {
|
||||||
//用于定位点存储到数据库
|
//用于定位点存储到数据库
|
||||||
viewModelScope.launch(Dispatchers.Default) {
|
viewModelScope.launch(Dispatchers.Default) {
|
||||||
//用于定位点捕捉道路
|
//用于定位点捕捉道路
|
||||||
mapController.locationLayerHandler.niLocationFlow.collectLatest { location ->
|
mapController.locationLayerHandler.niLocationFlow.collectLatest { location ->
|
||||||
if (!isSelectRoad()) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (!isSelectRoad()&&!GeometryTools.isCheckError(location.longitude,location.latitude)) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
captureLink(
|
captureLink(
|
||||||
GeoPoint(
|
GeoPoint(
|
||||||
location.latitude,
|
location.latitude,
|
||||||
@ -260,50 +278,53 @@ class MainViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mapController.locationLayerHandler.niLocationFlow.collect { location ->
|
mapController.locationLayerHandler.niLocationFlow.collect { location ->
|
||||||
val geometry = GeometryTools.createGeometry(
|
|
||||||
GeoPoint(
|
|
||||||
location.latitude, location.longitude
|
|
||||||
)
|
|
||||||
)
|
|
||||||
val tileX = RealmSet<Int>()
|
|
||||||
GeometryToolsKt.getTileXByGeometry(geometry.toString(), tileX)
|
|
||||||
val tileY = RealmSet<Int>()
|
|
||||||
GeometryToolsKt.getTileYByGeometry(geometry.toString(), tileY)
|
|
||||||
|
|
||||||
//遍历存储tile对应的x与y的值
|
//过滤掉无效点
|
||||||
tileX.forEach { x ->
|
if(!GeometryTools.isCheckError(location.longitude,location.latitude)){
|
||||||
tileY.forEach { y ->
|
val geometry = GeometryTools.createGeometry(
|
||||||
location.tilex = x
|
GeoPoint(
|
||||||
location.tiley = y
|
location.latitude, location.longitude
|
||||||
}
|
|
||||||
}
|
|
||||||
location.groupId = uuid
|
|
||||||
try {
|
|
||||||
location.timeStamp = DateTimeUtil.getTime(location.time).toString()
|
|
||||||
} catch (e: Exception) {
|
|
||||||
|
|
||||||
}
|
|
||||||
val id = sharedPreferences.getInt(Constant.SELECT_TASK_ID, -1)
|
|
||||||
location.taskId = id.toString()
|
|
||||||
//增加间距判断
|
|
||||||
if (lastNiLocaion != null) {
|
|
||||||
val disance = GeometryTools.distanceToDouble(
|
|
||||||
GeoPoint(location.latitude, location.longitude), GeoPoint(
|
|
||||||
lastNiLocaion!!.latitude, lastNiLocaion!!.longitude
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
//相距差距大于0.5米以上进行存储
|
val tileX = RealmSet<Int>()
|
||||||
if (disance > 0.5) {
|
GeometryToolsKt.getTileXByGeometry(geometry.toString(), tileX)
|
||||||
traceDataBase.niLocationDao.insert(location)
|
val tileY = RealmSet<Int>()
|
||||||
mapController.markerHandle.addNiLocationMarkerItem(location)
|
GeometryToolsKt.getTileYByGeometry(geometry.toString(), tileY)
|
||||||
}
|
|
||||||
} else {
|
|
||||||
traceDataBase.niLocationDao.insert(location)
|
|
||||||
mapController.markerHandle.addNiLocationMarkerItem(location)
|
|
||||||
}
|
|
||||||
|
|
||||||
lastNiLocaion = location
|
//遍历存储tile对应的x与y的值
|
||||||
//mapController.mMapView.vtmMap.updateMap(true)
|
tileX.forEach { x ->
|
||||||
|
tileY.forEach { y ->
|
||||||
|
location.tilex = x
|
||||||
|
location.tiley = y
|
||||||
|
}
|
||||||
|
}
|
||||||
|
location.groupId = uuid
|
||||||
|
try {
|
||||||
|
location.timeStamp = DateTimeUtil.getTime(location.time).toString()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
|
||||||
|
}
|
||||||
|
val id = sharedPreferences.getInt(Constant.SELECT_TASK_ID, -1)
|
||||||
|
location.taskId = id.toString()
|
||||||
|
//增加间距判断
|
||||||
|
if (lastNiLocaion != null) {
|
||||||
|
val disance = GeometryTools.getDistance(
|
||||||
|
location.latitude, location.longitude,
|
||||||
|
lastNiLocaion!!.latitude, lastNiLocaion!!.longitude)
|
||||||
|
//相距差距大于2.5米以上进行存储
|
||||||
|
if (disance > 2.5) {
|
||||||
|
traceDataBase.niLocationDao.insert(location)
|
||||||
|
mapController.markerHandle.addNiLocationMarkerItem(location)
|
||||||
|
mapController.mMapView.vtmMap.updateMap(true)
|
||||||
|
lastNiLocaion = location
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
traceDataBase.niLocationDao.insert(location)
|
||||||
|
/* mapController.markerHandle.addNiLocationMarkerItem(location)
|
||||||
|
mapController.mMapView.vtmMap.updateMap(true)*/
|
||||||
|
lastNiLocaion = location
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,100 +345,112 @@ class MainViewModel @Inject constructor(
|
|||||||
*/
|
*/
|
||||||
@RequiresApi(Build.VERSION_CODES.N)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
private suspend fun captureLink(point: GeoPoint) {
|
private suspend fun captureLink(point: GeoPoint) {
|
||||||
|
if(captureLinkState){
|
||||||
val linkList = realmOperateHelper.queryLink(
|
return
|
||||||
point = point,
|
|
||||||
)
|
|
||||||
var hisRoadName = false
|
|
||||||
if (linkList.isNotEmpty()) {
|
|
||||||
//看板数据
|
|
||||||
val signList = mutableListOf<SignBean>()
|
|
||||||
val topSignList = mutableListOf<SignBean>()
|
|
||||||
mapController.lineHandler.linksLayer.clear()
|
|
||||||
|
|
||||||
val link = linkList[0]
|
|
||||||
|
|
||||||
val linkId = link.properties[RenderEntity.Companion.LinkTable.linkPid]
|
|
||||||
|
|
||||||
if (linkIdCache != linkId) {
|
|
||||||
|
|
||||||
mapController.lineHandler.showLine(link.geometry)
|
|
||||||
linkId?.let {
|
|
||||||
var elementList = realmOperateHelper.queryLinkByLinkPid(it)
|
|
||||||
for (element in elementList) {
|
|
||||||
|
|
||||||
if (element.code == 2011) {
|
|
||||||
hisRoadName = true
|
|
||||||
liveDataRoadName.postValue(element)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
val distance = GeometryTools.distanceToDouble(
|
|
||||||
point, GeometryTools.createGeoPoint(element.geometry)
|
|
||||||
)
|
|
||||||
|
|
||||||
val signBean = SignBean(
|
|
||||||
iconId = SignUtil.getSignIcon(element),
|
|
||||||
iconText = SignUtil.getSignIconText(element),
|
|
||||||
distance = distance.toInt(),
|
|
||||||
linkId = linkId,
|
|
||||||
name = SignUtil.getSignNameText(element),
|
|
||||||
bottomRightText = SignUtil.getSignBottomRightText(element),
|
|
||||||
renderEntity = element,
|
|
||||||
isMoreInfo = SignUtil.isMoreInfo(element),
|
|
||||||
index = SignUtil.getRoadInfoIndex(element)
|
|
||||||
)
|
|
||||||
Log.e("jingo", "捕捉到的数据code ${element.code}")
|
|
||||||
when (element.code) {
|
|
||||||
//车道数,种别,功能等级,线限速,道路方向
|
|
||||||
2041, 2008, 2002, 2019, 2010 -> topSignList.add(
|
|
||||||
signBean
|
|
||||||
)
|
|
||||||
|
|
||||||
4002, 4003, 4004, 4010, 4022, 4601 -> signList.add(
|
|
||||||
signBean
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
val realm = Realm.getDefaultInstance()
|
|
||||||
val entity = realm.where(RenderEntity::class.java)
|
|
||||||
.equalTo("table", "OMDB_RESTRICTION").and().equalTo(
|
|
||||||
"properties['linkIn']", it
|
|
||||||
).findFirst()
|
|
||||||
if (entity != null) {
|
|
||||||
val outLink = entity.properties["linkOut"]
|
|
||||||
val linkOutEntity = realm.where(RenderEntity::class.java)
|
|
||||||
.equalTo("table", "OMDB_RD_LINK").and().equalTo(
|
|
||||||
"properties['${RenderEntity.Companion.LinkTable.linkPid}']",
|
|
||||||
outLink
|
|
||||||
).findFirst()
|
|
||||||
if (linkOutEntity != null) {
|
|
||||||
mapController.lineHandler.linksLayer.addLine(
|
|
||||||
linkOutEntity.geometry, 0x7DFF0000
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
liveDataTopSignList.postValue(topSignList.distinctBy { it.name }
|
|
||||||
.sortedBy { it.index })
|
|
||||||
|
|
||||||
liveDataSignList.postValue(signList.sortedBy { it.distance })
|
|
||||||
val speechText = SignUtil.getRoadSpeechText(topSignList)
|
|
||||||
withContext(Dispatchers.Main) {
|
|
||||||
speakMode?.speakText(speechText)
|
|
||||||
}
|
|
||||||
linkIdCache = linkId ?: ""
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mapController.lineHandler.removeLine()
|
|
||||||
linkIdCache = ""
|
|
||||||
}
|
}
|
||||||
//如果没有捕捉到道路名
|
|
||||||
if (!hisRoadName) {
|
try{
|
||||||
liveDataRoadName.postValue(null)
|
captureLinkState = true
|
||||||
|
|
||||||
|
val linkList = realmOperateHelper.queryLink(
|
||||||
|
point = point,
|
||||||
|
)
|
||||||
|
var hisRoadName = false
|
||||||
|
if (linkList.isNotEmpty()) {
|
||||||
|
//看板数据
|
||||||
|
val signList = mutableListOf<SignBean>()
|
||||||
|
val topSignList = mutableListOf<SignBean>()
|
||||||
|
mapController.lineHandler.linksLayer.clear()
|
||||||
|
|
||||||
|
val link = linkList[0]
|
||||||
|
|
||||||
|
val linkId = link.properties[RenderEntity.Companion.LinkTable.linkPid]
|
||||||
|
|
||||||
|
if (linkIdCache != linkId) {
|
||||||
|
|
||||||
|
mapController.lineHandler.showLine(link.geometry)
|
||||||
|
linkId?.let {
|
||||||
|
var elementList = realmOperateHelper.queryLinkByLinkPid(it)
|
||||||
|
for (element in elementList) {
|
||||||
|
|
||||||
|
if (element.code == 2011) {
|
||||||
|
hisRoadName = true
|
||||||
|
liveDataRoadName.postValue(element)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
val distance = GeometryTools.distanceToDouble(
|
||||||
|
point, GeometryTools.createGeoPoint(element.geometry)
|
||||||
|
)
|
||||||
|
|
||||||
|
val signBean = SignBean(
|
||||||
|
iconId = SignUtil.getSignIcon(element),
|
||||||
|
iconText = SignUtil.getSignIconText(element),
|
||||||
|
distance = distance.toInt(),
|
||||||
|
linkId = linkId,
|
||||||
|
name = SignUtil.getSignNameText(element),
|
||||||
|
bottomRightText = SignUtil.getSignBottomRightText(element),
|
||||||
|
renderEntity = element,
|
||||||
|
isMoreInfo = SignUtil.isMoreInfo(element),
|
||||||
|
index = SignUtil.getRoadInfoIndex(element)
|
||||||
|
)
|
||||||
|
Log.e("jingo", "捕捉到的数据code ${element.code}")
|
||||||
|
when (element.code) {
|
||||||
|
//车道数,种别,功能等级,线限速,道路方向
|
||||||
|
2041, 2008, 2002, 2019, 2010 -> topSignList.add(
|
||||||
|
signBean
|
||||||
|
)
|
||||||
|
|
||||||
|
4002, 4003, 4004, 4010, 4022, 4601 -> signList.add(
|
||||||
|
signBean
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
val realm = Realm.getDefaultInstance()
|
||||||
|
val entity = realm.where(RenderEntity::class.java)
|
||||||
|
.equalTo("table", "OMDB_RESTRICTION").and().equalTo(
|
||||||
|
"properties['linkIn']", it
|
||||||
|
).findFirst()
|
||||||
|
if (entity != null) {
|
||||||
|
val outLink = entity.properties["linkOut"]
|
||||||
|
val linkOutEntity = realm.where(RenderEntity::class.java)
|
||||||
|
.equalTo("table", "OMDB_RD_LINK").and().equalTo(
|
||||||
|
"properties['${RenderEntity.Companion.LinkTable.linkPid}']",
|
||||||
|
outLink
|
||||||
|
).findFirst()
|
||||||
|
if (linkOutEntity != null) {
|
||||||
|
mapController.lineHandler.linksLayer.addLine(
|
||||||
|
linkOutEntity.geometry, 0x7DFF0000
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
liveDataTopSignList.postValue(topSignList.distinctBy { it.name }
|
||||||
|
.sortedBy { it.index })
|
||||||
|
|
||||||
|
liveDataSignList.postValue(signList.sortedBy { it.distance })
|
||||||
|
val speechText = SignUtil.getRoadSpeechText(topSignList)
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
speakMode?.speakText(speechText)
|
||||||
|
}
|
||||||
|
linkIdCache = linkId ?: ""
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mapController.lineHandler.removeLine()
|
||||||
|
linkIdCache = ""
|
||||||
|
}
|
||||||
|
//如果没有捕捉到道路名
|
||||||
|
if (!hisRoadName) {
|
||||||
|
liveDataRoadName.postValue(null)
|
||||||
|
}
|
||||||
|
|
||||||
|
}catch (e:Exception){
|
||||||
|
|
||||||
|
}finally {
|
||||||
|
captureLinkState = false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -600,6 +633,48 @@ class MainViewModel @Inject constructor(
|
|||||||
return bSelectRoad
|
return bSelectRoad
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启轨迹选择
|
||||||
|
*/
|
||||||
|
fun setSelectTrace(select: Boolean) {
|
||||||
|
bSelectTrace = select
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否开启了轨迹选择
|
||||||
|
*/
|
||||||
|
fun isSelectTrace(): Boolean {
|
||||||
|
return bSelectTrace
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启媒体标识
|
||||||
|
*/
|
||||||
|
fun setMediaFlag(select: Boolean) {
|
||||||
|
isMediaFlag = select
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否开启了媒体标识
|
||||||
|
*/
|
||||||
|
fun isMediaFlag(): Boolean {
|
||||||
|
return isMediaFlag
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启轨迹选择
|
||||||
|
*/
|
||||||
|
fun setSelectPauseTrace(select: Boolean) {
|
||||||
|
bSelectPauseTrace = select
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否开启了轨迹选择
|
||||||
|
*/
|
||||||
|
fun isSelectPauseTrace(): Boolean {
|
||||||
|
return bSelectPauseTrace
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 要展示的要素详细信息
|
* 要展示的要素详细信息
|
||||||
*/
|
*/
|
||||||
|
@ -9,14 +9,10 @@ import androidx.lifecycle.viewModelScope
|
|||||||
import com.navinfo.omqs.Constant
|
import com.navinfo.omqs.Constant
|
||||||
import com.navinfo.omqs.bean.IndoorConnectionInfoBean
|
import com.navinfo.omqs.bean.IndoorConnectionInfoBean
|
||||||
import com.navinfo.omqs.bean.QRCodeBean
|
import com.navinfo.omqs.bean.QRCodeBean
|
||||||
import com.navinfo.omqs.bean.SysUserBean
|
|
||||||
import com.navinfo.omqs.http.DefaultResponse
|
|
||||||
import com.navinfo.omqs.http.NetResult
|
import com.navinfo.omqs.http.NetResult
|
||||||
import com.navinfo.omqs.http.NetworkService
|
import com.navinfo.omqs.http.NetworkService
|
||||||
import com.navinfo.omqs.ui.activity.login.LoginStatus
|
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
@ -99,11 +95,14 @@ class QrCodeViewModel @Inject constructor(
|
|||||||
Toast.LENGTH_LONG
|
Toast.LENGTH_LONG
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateServerInfo(context)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
context,
|
context,
|
||||||
"${defaultUserResponse.msg}",
|
"${defaultUserResponse.errmsg}",
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
)
|
)
|
||||||
.show()
|
.show()
|
||||||
@ -165,17 +164,20 @@ class QrCodeViewModel @Inject constructor(
|
|||||||
|
|
||||||
viewModelScope.launch(Dispatchers.Default) {
|
viewModelScope.launch(Dispatchers.Default) {
|
||||||
val url = "http://${Constant.INDOOR_IP}:8080/sensor/service/connection"
|
val url = "http://${Constant.INDOOR_IP}:8080/sensor/service/connection"
|
||||||
|
|
||||||
|
|
||||||
|
val indoorConnectionInfoBean = IndoorConnectionInfoBean(
|
||||||
|
Constant.USER_ID,
|
||||||
|
Constant.USER_ID,
|
||||||
|
Constant.USER_ID,
|
||||||
|
"eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2ODk2MjI5MjQsInVzZXJJZCI6IjEwNCIsImlhdCI6MTY4OTU3MjUyNCwidXNlcm5hbWUiOiJ3ZWl3ZWlsaW4wMDEwNCJ9.9WUqOhme8Yi_2xRBKMMe0ihb_yR1uwTqWTdZfZ7dMtE",
|
||||||
|
"http://fastmap.navinfo.com/onemap",
|
||||||
|
Constant.USER_ID,
|
||||||
|
"Android"
|
||||||
|
)
|
||||||
when (val result = networkService.updateServerInfo(
|
when (val result = networkService.updateServerInfo(
|
||||||
url = url,
|
url = url,
|
||||||
indoorConnectionInfoBean = IndoorConnectionInfoBean(
|
indoorConnectionInfoBean = indoorConnectionInfoBean
|
||||||
Constant.USER_ID,
|
|
||||||
Constant.USER_ID,
|
|
||||||
Constant.USER_ID,
|
|
||||||
Constant.USER_ID,
|
|
||||||
com.navinfo.collect.library.system.Constant.SERVER_ADDRESS,
|
|
||||||
Constant.USER_ID,
|
|
||||||
"Android"
|
|
||||||
)
|
|
||||||
)) {
|
)) {
|
||||||
is NetResult.Success<*> -> {
|
is NetResult.Success<*> -> {
|
||||||
|
|
||||||
@ -198,7 +200,7 @@ class QrCodeViewModel @Inject constructor(
|
|||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
context,
|
context,
|
||||||
"${defaultUserResponse.msg}",
|
"${defaultUserResponse.errmsg}",
|
||||||
Toast.LENGTH_SHORT
|
Toast.LENGTH_SHORT
|
||||||
)
|
)
|
||||||
.show()
|
.show()
|
||||||
|
@ -193,14 +193,29 @@ class ConsoleFragment : BaseFragment(), OnClickListener {
|
|||||||
R.id.console_personal_center_bg, R.id.console_personal_center_icon_bg -> {
|
R.id.console_personal_center_bg, R.id.console_personal_center_icon_bg -> {
|
||||||
if (sceneFlag) {
|
if (sceneFlag) {
|
||||||
mFragment = PersonalCenterFragment {
|
mFragment = PersonalCenterFragment {
|
||||||
TransitionManager.go(aScene, aTransition)
|
if(it){
|
||||||
|
activity?.let { a ->
|
||||||
|
a.supportFragmentManager.beginTransaction().remove(this).commit()
|
||||||
|
(a as MainActivity).showIndoorDataLayout()
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
TransitionManager.go(aScene, aTransition)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
sceneFlag = false
|
sceneFlag = false
|
||||||
TransitionManager.go(bScene, bTransition)
|
TransitionManager.go(bScene, bTransition)
|
||||||
} else {
|
} else {
|
||||||
if (mFragment !is PersonalCenterFragment) {
|
if (mFragment !is PersonalCenterFragment) {
|
||||||
mFragment = PersonalCenterFragment {
|
mFragment = PersonalCenterFragment {
|
||||||
TransitionManager.go(aScene, aTransition)
|
if(it){
|
||||||
|
activity?.let { a ->
|
||||||
|
a.supportFragmentManager.beginTransaction().remove(this).commit()
|
||||||
|
(a as MainActivity).showIndoorDataLayout()
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
TransitionManager.go(aScene, aTransition)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
childFragmentManager.beginTransaction().replace(fragmentId, mFragment!!)
|
childFragmentManager.beginTransaction().replace(fragmentId, mFragment!!)
|
||||||
.commit()
|
.commit()
|
||||||
|
@ -15,14 +15,17 @@ import com.blankj.utilcode.util.UriUtils
|
|||||||
import com.github.k1rakishou.fsaf.FileChooser
|
import com.github.k1rakishou.fsaf.FileChooser
|
||||||
import com.github.k1rakishou.fsaf.callback.FSAFActivityCallbacks
|
import com.github.k1rakishou.fsaf.callback.FSAFActivityCallbacks
|
||||||
import com.github.k1rakishou.fsaf.callback.FileChooserCallback
|
import com.github.k1rakishou.fsaf.callback.FileChooserCallback
|
||||||
|
import com.navinfo.collect.library.data.entity.TaskBean
|
||||||
import com.navinfo.collect.library.map.NIMapController
|
import com.navinfo.collect.library.map.NIMapController
|
||||||
import com.navinfo.omqs.R
|
import com.navinfo.omqs.R
|
||||||
import com.navinfo.omqs.databinding.FragmentPersonalCenterBinding
|
import com.navinfo.omqs.databinding.FragmentPersonalCenterBinding
|
||||||
import com.navinfo.omqs.db.ImportOMDBHelper
|
import com.navinfo.omqs.db.ImportOMDBHelper
|
||||||
import com.navinfo.omqs.hilt.ImportOMDBHiltFactory
|
import com.navinfo.omqs.hilt.ImportOMDBHiltFactory
|
||||||
import com.navinfo.omqs.tools.CoroutineUtils
|
import com.navinfo.omqs.tools.CoroutineUtils
|
||||||
|
import com.navinfo.omqs.ui.activity.map.MainActivity
|
||||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||||
import com.navinfo.omqs.ui.activity.scan.QrCodeActivity
|
import com.navinfo.omqs.ui.activity.scan.QrCodeActivity
|
||||||
|
import com.navinfo.omqs.ui.fragment.console.ConsoleFragment
|
||||||
import com.permissionx.guolindev.PermissionX
|
import com.permissionx.guolindev.PermissionX
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import org.oscim.core.GeoPoint
|
import org.oscim.core.GeoPoint
|
||||||
@ -32,7 +35,7 @@ import javax.inject.Inject
|
|||||||
* 个人中心
|
* 个人中心
|
||||||
*/
|
*/
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
class PersonalCenterFragment(private var backListener: (() -> Unit?)? = null) : BaseFragment(),
|
class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?)? = null) : BaseFragment(),
|
||||||
FSAFActivityCallbacks {
|
FSAFActivityCallbacks {
|
||||||
|
|
||||||
private var _binding: FragmentPersonalCenterBinding? = null
|
private var _binding: FragmentPersonalCenterBinding? = null
|
||||||
@ -137,6 +140,9 @@ class PersonalCenterFragment(private var backListener: (() -> Unit?)? = null) :
|
|||||||
//跳转二维码扫描界面
|
//跳转二维码扫描界面
|
||||||
checkPermission()
|
checkPermission()
|
||||||
}
|
}
|
||||||
|
R.id.personal_center_menu_scan_indoor_data -> {
|
||||||
|
indoorDataListener?.invoke(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
@ -241,8 +241,9 @@ class TaskListAdapter(
|
|||||||
FileUploadStatus.DONE -> {
|
FileUploadStatus.DONE -> {
|
||||||
binding.taskUploadBtn.stopAnimator()
|
binding.taskUploadBtn.stopAnimator()
|
||||||
binding.taskUploadBtn.setText("已上传")
|
binding.taskUploadBtn.setText("已上传")
|
||||||
|
binding.taskUploadBtn.isEnabled = false
|
||||||
binding.taskUploadBtn.setProgress(0)
|
binding.taskUploadBtn.setProgress(0)
|
||||||
binding.taskUploadBtn.setBackgroundColor(binding.root.resources.getColor(R.color.ripple_end_color))
|
binding.taskUploadBtn.setBackgroundColor(binding.root.resources.getColor(R.color.gray_121))
|
||||||
}
|
}
|
||||||
|
|
||||||
FileUploadStatus.ERROR -> {
|
FileUploadStatus.ERROR -> {
|
||||||
|
@ -165,72 +165,6 @@
|
|||||||
android:onClick="@{()->mainActivity.onClickMenu()}" />
|
android:onClick="@{()->mainActivity.onClickMenu()}" />
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.helper.widget.Flow
|
|
||||||
android:id="@+id/main_activity_flow_indoor"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginRight="@dimen/top_right_drawer_btns_mr"
|
|
||||||
app:constraint_referenced_ids="main_activity_snapshot_finish,main_activity_trace_snapshot_points,main_activity_snapshot_media_flag,main_activity_snapshot_rewind,main_activity_snapshot_pause,main_activity_snapshot_next,main_activity_menu_indoor_group"
|
|
||||||
app:flow_horizontalGap="6dp"
|
|
||||||
app:flow_wrapMode="aligned"
|
|
||||||
app:layout_constraintRight_toLeftOf="@id/main_activity_right_fragment"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Group
|
|
||||||
android:id="@+id/main_activity_menu_indoor_group"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:constraint_referenced_ids="main_activity_snapshot_finish,main_activity_trace_snapshot_points,main_activity_snapshot_media_flag,main_activity_snapshot_rewind,main_activity_snapshot_pause,main_activity_snapshot_next" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/main_activity_snapshot_finish"
|
|
||||||
style="@style/top_right_drawer_btns_style"
|
|
||||||
android:clickable="true"
|
|
||||||
android:enabled="false"
|
|
||||||
android:focusable="true"
|
|
||||||
android:src="@drawable/map_trace_finish"
|
|
||||||
tools:ignore="MissingConstraints" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/main_activity_trace_snapshot_points"
|
|
||||||
style="@style/top_right_drawer_btns_style"
|
|
||||||
android:focusable="true"
|
|
||||||
android:src="@drawable/map_trace_select_point"
|
|
||||||
tools:ignore="MissingConstraints" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/main_activity_snapshot_media_flag"
|
|
||||||
style="@style/top_right_drawer_btns_style"
|
|
||||||
android:enabled="false"
|
|
||||||
android:focusable="true"
|
|
||||||
android:src="@drawable/map_trace_mediaflag"
|
|
||||||
tools:ignore="MissingConstraints" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/main_activity_snapshot_rewind"
|
|
||||||
style="@style/top_right_drawer_btns_style"
|
|
||||||
android:enabled="false"
|
|
||||||
android:focusable="true"
|
|
||||||
android:src="@drawable/map_trace_forward"
|
|
||||||
tools:ignore="MissingConstraints" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/main_activity_snapshot_pause"
|
|
||||||
style="@style/top_right_drawer_btns_style"
|
|
||||||
android:enabled="false"
|
|
||||||
android:focusable="true"
|
|
||||||
android:src="@drawable/map_trace_pause"
|
|
||||||
tools:ignore="DuplicateIds,MissingConstraints" />
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/main_activity_snapshot_next"
|
|
||||||
style="@style/top_right_drawer_btns_style"
|
|
||||||
android:enabled="false"
|
|
||||||
android:focusable="true"
|
|
||||||
android:src="@drawable/map_trace_next"
|
|
||||||
tools:ignore="DuplicateIds,MissingConstraints" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Barrier
|
<androidx.constraintlayout.widget.Barrier
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -394,6 +328,60 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:constraint_referenced_ids="main_activity_right_fragment,main_activity_middle_fragment" />
|
app:constraint_referenced_ids="main_activity_right_fragment,main_activity_middle_fragment" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.helper.widget.Flow
|
||||||
|
android:id="@+id/main_activity_flow_indoor"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/five"
|
||||||
|
app:constraint_referenced_ids="main_activity_snapshot_finish,main_activity_trace_snapshot_points,main_activity_snapshot_media_flag,main_activity_snapshot_rewind,main_activity_snapshot_pause,main_activity_snapshot_next,main_activity_menu_indoor_group"
|
||||||
|
app:flow_horizontalGap="6dp"
|
||||||
|
app:flow_wrapMode="aligned"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/main_activity_bottom_sheet" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Group
|
||||||
|
android:id="@+id/main_activity_menu_indoor_group"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:constraint_referenced_ids="main_activity_snapshot_finish,main_activity_trace_snapshot_points,main_activity_snapshot_media_flag,main_activity_snapshot_rewind,main_activity_snapshot_pause,main_activity_snapshot_next" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/main_activity_snapshot_finish"
|
||||||
|
style="@style/top_right_drawer_btns_style"
|
||||||
|
android:onClick="@{()->mainActivity.finishTraceOnclick()}"
|
||||||
|
android:src="@drawable/map_trace_finish" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/main_activity_trace_snapshot_points"
|
||||||
|
style="@style/top_right_drawer_btns_style"
|
||||||
|
android:onClick="@{()->mainActivity.tracePointsOnclick()}"
|
||||||
|
android:src="@drawable/map_trace_select_point" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/main_activity_snapshot_media_flag"
|
||||||
|
style="@style/top_right_drawer_btns_style"
|
||||||
|
android:onClick="@{()->mainActivity.mediaFlagOnclick()}"
|
||||||
|
android:src="@drawable/map_trace_mediaflag" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/main_activity_snapshot_rewind"
|
||||||
|
style="@style/top_right_drawer_btns_style"
|
||||||
|
android:onClick="@{()->mainActivity.rewindTraceOnclick()}"
|
||||||
|
android:src="@drawable/map_trace_forward" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/main_activity_snapshot_pause"
|
||||||
|
style="@style/top_right_drawer_btns_style"
|
||||||
|
android:onClick="@{()->mainActivity.pauseTraceOnclick()}"
|
||||||
|
android:src="@drawable/map_trace_pause" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/main_activity_snapshot_next"
|
||||||
|
style="@style/top_right_drawer_btns_style"
|
||||||
|
android:src="@drawable/map_trace_next" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/main_activity_bottom_sheet"
|
android:id="@+id/main_activity_bottom_sheet"
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
@ -536,6 +524,7 @@
|
|||||||
main_activity_bottom_sheet_bg,
|
main_activity_bottom_sheet_bg,
|
||||||
main_bottom_task,main_bottom_home" />
|
main_bottom_task,main_bottom_home" />
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/console_fragment_layout"
|
android:id="@+id/console_fragment_layout"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -150,6 +150,7 @@
|
|||||||
android:layout_gravity="right|bottom"
|
android:layout_gravity="right|bottom"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:paddingLeft="@dimen/five"
|
android:paddingLeft="@dimen/five"
|
||||||
|
android:visibility="invisible"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:text="录像"
|
android:text="录像"
|
||||||
android:button="@drawable/chk_icon_camera_record_or_takephoto_xml"
|
android:button="@drawable/chk_icon_camera_record_or_takephoto_xml"
|
||||||
|
@ -278,7 +278,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="轨迹回放"
|
android:text="室内整理"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/console_track_icon_bg"
|
app:layout_constraintLeft_toLeftOf="@id/console_track_icon_bg"
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
<item
|
<item
|
||||||
android:id="@+id/personal_center_menu_offline_map"
|
android:id="@+id/personal_center_menu_offline_map"
|
||||||
android:icon="@drawable/baseline_map_24"
|
android:icon="@drawable/baseline_map_24"
|
||||||
|
android:visible="false"
|
||||||
android:title="离线地图" />
|
android:title="离线地图" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/personal_center_menu_obtain_data"
|
android:id="@+id/personal_center_menu_obtain_data"
|
||||||
@ -16,7 +17,7 @@
|
|||||||
<item
|
<item
|
||||||
android:id="@+id/personal_center_menu_import_data"
|
android:id="@+id/personal_center_menu_import_data"
|
||||||
android:icon="@drawable/ic_baseline_import_export_24"
|
android:icon="@drawable/ic_baseline_import_export_24"
|
||||||
android:visible="true"
|
android:visible="false"
|
||||||
android:title="导入数据" />
|
android:title="导入数据" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/personal_center_menu_import_yuan_data"
|
android:id="@+id/personal_center_menu_import_yuan_data"
|
||||||
@ -25,14 +26,19 @@
|
|||||||
<item
|
<item
|
||||||
android:id="@+id/personal_center_menu_scan_qr_code"
|
android:id="@+id/personal_center_menu_scan_qr_code"
|
||||||
android:icon="@drawable/ic_baseline_scatter_plot_24"
|
android:icon="@drawable/ic_baseline_scatter_plot_24"
|
||||||
android:title="扫一扫" />
|
android:title="扫码连电脑" />
|
||||||
<item
|
<item
|
||||||
|
android:id="@+id/personal_center_menu_scan_indoor_data"
|
||||||
|
android:icon="@drawable/ic_baseline_scatter_plot_24"
|
||||||
|
android:title="室内整理" />
|
||||||
|
<item
|
||||||
|
android:visible="false"
|
||||||
android:icon="@drawable/ic_baseline_sim_card_download_24"
|
android:icon="@drawable/ic_baseline_sim_card_download_24"
|
||||||
android:title="备份数据" />
|
android:title="备份数据" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/personal_center_menu_version"
|
android:id="@+id/personal_center_menu_version"
|
||||||
android:icon="@drawable/ic_baseline_layers_24"
|
android:icon="@drawable/ic_baseline_layers_24"
|
||||||
android:title="版本:ONE_QE_V1.1.0_20230630_A" />
|
android:title="版本:ONE_QE_V1.2.0_20230707_A" />
|
||||||
</group>
|
</group>
|
||||||
<group android:checkableBehavior="single">
|
<group android:checkableBehavior="single">
|
||||||
<item android:title="小标题">
|
<item android:title="小标题">
|
||||||
|
@ -158,7 +158,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
/**
|
/**
|
||||||
* 评测数据marker 图层
|
* 评测数据marker 图层
|
||||||
*/
|
*/
|
||||||
private val niLocationItemizedLayer: MyItemizedLayer by lazy {
|
private val niLocationItemizedLayer: ItemizedLayer by lazy {
|
||||||
|
|
||||||
niLocationBitmap =
|
niLocationBitmap =
|
||||||
AndroidBitmap(BitmapFactory.decodeResource(context.resources, R.mipmap.icon_gps))
|
AndroidBitmap(BitmapFactory.decodeResource(context.resources, R.mipmap.icon_gps))
|
||||||
@ -173,39 +173,24 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
val layer = MyItemizedLayer(
|
val layer = ItemizedLayer(
|
||||||
mMapView.vtmMap,
|
mapView.vtmMap,
|
||||||
mutableListOf(),
|
mutableListOf(),
|
||||||
markerRendererFactory,
|
markerRendererFactory,
|
||||||
object : MyItemizedLayer.OnItemGestureListener {
|
object : OnItemGestureListener<MarkerInterface> {
|
||||||
override fun onItemSingleTapUp(
|
override fun onItemSingleTapUp(index: Int, item: MarkerInterface?): Boolean {
|
||||||
list: MutableList<Int>,
|
|
||||||
nearest: Int
|
|
||||||
): Boolean {
|
|
||||||
itemListener?.let {
|
itemListener?.let {
|
||||||
val idList = mutableListOf<NiLocation>()
|
it.onNiLocation((niLocationItemizedLayer.itemList[index] as MarkerItem).uid as NiLocation)
|
||||||
if (list.size == 0) {
|
|
||||||
} else {
|
|
||||||
for (i in list) {
|
|
||||||
val markerInterface: MarkerInterface =
|
|
||||||
niLocationItemizedLayer.itemList[i]
|
|
||||||
if (markerInterface is MarkerItem) {
|
|
||||||
idList.add(markerInterface.uid as NiLocation)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
it.onNiLocationList(idList.distinct().toMutableList())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onItemLongPress(
|
override fun onItemLongPress(index: Int, item: MarkerInterface?): Boolean {
|
||||||
list: MutableList<Int>?,
|
|
||||||
nearest: Int
|
|
||||||
): Boolean {
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
addLayer(layer, NIMapView.LAYER_GROUPS.OPERATE_MARKER)
|
addLayer(layer, NIMapView.LAYER_GROUPS.OPERATE_MARKER)
|
||||||
layer
|
layer
|
||||||
}
|
}
|
||||||
@ -824,5 +809,5 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
interface OnQsRecordItemClickListener {
|
interface OnQsRecordItemClickListener {
|
||||||
fun onQsRecordList(list: MutableList<String>)
|
fun onQsRecordList(list: MutableList<String>)
|
||||||
fun onNoteList(list: MutableList<String>)
|
fun onNoteList(list: MutableList<String>)
|
||||||
fun onNiLocationList(list: MutableList<NiLocation>)
|
fun onNiLocation(it: NiLocation)
|
||||||
}
|
}
|
||||||
|
@ -1329,9 +1329,9 @@ public class GeometryTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isCheckError(double lon, double lat) {
|
public static boolean isCheckError(double lon, double lat) {
|
||||||
/* if(lon==0&&lat==0){
|
if(lon==0||lat==0){
|
||||||
return true;
|
return true;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
if (lon > 180 || lon < -180 || lat > 90 || lat < -90) {
|
if (lon > 180 || lon < -180 || lat > 90 || lat < -90) {
|
||||||
return true;
|
return true;
|
||||||
|
Before Width: | Height: | Size: 401 B After Width: | Height: | Size: 401 B |
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 377 B |
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 492 B |
Before Width: | Height: | Size: 611 B After Width: | Height: | Size: 611 B |
2
vtm
@ -1 +1 @@
|
|||||||
Subproject commit 1ee201a41f78f169873848209a3f3bdac36f185a
|
Subproject commit dd13e533c38b5738ab404c2737d7ccadeff01323
|