Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
This commit is contained in:
commit
af9dcca34f
@ -7,9 +7,16 @@ import kotlinx.parcelize.Parcelize
|
|||||||
data class SignBean(
|
data class SignBean(
|
||||||
//图标ID
|
//图标ID
|
||||||
val iconId: Int,
|
val iconId: Int,
|
||||||
|
//定位点到目标距离
|
||||||
val distance: Int = 0,
|
val distance: Int = 0,
|
||||||
|
//图表中的问题
|
||||||
val iconText: String = "",
|
val iconText: String = "",
|
||||||
|
//绑定的要素id
|
||||||
val elementId: String = "",
|
val elementId: String = "",
|
||||||
|
//绑定的linkid
|
||||||
val linkId: String,
|
val linkId: String,
|
||||||
|
//坐标
|
||||||
val geometry: String,
|
val geometry: String,
|
||||||
|
//底部文字
|
||||||
|
val bottomText: String,
|
||||||
) : Parcelable
|
) : Parcelable
|
@ -64,9 +64,11 @@ open class TaskBean @JvmOverloads constructor(
|
|||||||
var syncStatus: Int = FileManager.Companion.FileUploadStatus.NONE,
|
var syncStatus: Int = FileManager.Companion.FileUploadStatus.NONE,
|
||||||
|
|
||||||
@Ignore
|
@Ignore
|
||||||
var message: String = ""
|
var message: String = "",
|
||||||
|
var color: Int = 0xFF00AA
|
||||||
) : RealmObject() {
|
) : RealmObject() {
|
||||||
fun getDownLoadUrl(): String {
|
fun getDownLoadUrl(): String {
|
||||||
return "${Constant.SERVER_ADDRESS}devcp/download?fileStr=$id"
|
return "${Constant.SERVER_ADDRESS}devcp/download?fileStr=$id"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -66,7 +66,7 @@ class GlobalModule {
|
|||||||
}.apply {
|
}.apply {
|
||||||
level = if (Constant.DEBUG) {
|
level = if (Constant.DEBUG) {
|
||||||
//坑 !!!! 下载文件时打印log 内存不足
|
//坑 !!!! 下载文件时打印log 内存不足
|
||||||
HttpLoggingInterceptor.Level.HEADERS
|
HttpLoggingInterceptor.Level.BASIC
|
||||||
} else {
|
} else {
|
||||||
HttpLoggingInterceptor.Level.NONE
|
HttpLoggingInterceptor.Level.NONE
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ interface RetrofitNetworkServiceAPI {
|
|||||||
|
|
||||||
@Headers("Content-Type: application/json")
|
@Headers("Content-Type: application/json")
|
||||||
@POST("/devcp/upload")
|
@POST("/devcp/upload")
|
||||||
fun postRequest(@Body listEvaluationInfo: List<EvaluationInfo>?): Call<ResponseBody>
|
suspend fun postRequest(@Body listEvaluationInfo: List<EvaluationInfo>?): Call<ResponseBody>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @FormUrlEncoded 请求格式注解,请求实体是一个From表单,每个键值对需要使用@Field注解
|
* @FormUrlEncoded 请求格式注解,请求实体是一个From表单,每个键值对需要使用@Field注解
|
||||||
|
@ -91,7 +91,6 @@ class TaskDownloadScope(
|
|||||||
* @param status [OfflineMapCityBean.Status]
|
* @param status [OfflineMapCityBean.Status]
|
||||||
*/
|
*/
|
||||||
private suspend fun change(status: Int, message: String = "") {
|
private suspend fun change(status: Int, message: String = "") {
|
||||||
Log.e("jingo", "我被挂起 S")
|
|
||||||
if (taskBean.status != status || status == FileDownloadStatus.LOADING || status == FileDownloadStatus.IMPORTING) {
|
if (taskBean.status != status || status == FileDownloadStatus.LOADING || status == FileDownloadStatus.IMPORTING) {
|
||||||
taskBean.status = status
|
taskBean.status = status
|
||||||
taskBean.message = message
|
taskBean.message = message
|
||||||
@ -103,7 +102,6 @@ class TaskDownloadScope(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log.e("jingo", "我被挂起 E")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,7 +10,7 @@ import com.navinfo.collect.library.data.entity.QsRecordBean
|
|||||||
import com.navinfo.omqs.bean.EvaluationInfo
|
import com.navinfo.omqs.bean.EvaluationInfo
|
||||||
import com.navinfo.omqs.bean.TaskBean
|
import com.navinfo.omqs.bean.TaskBean
|
||||||
import com.navinfo.omqs.tools.FileManager
|
import com.navinfo.omqs.tools.FileManager
|
||||||
import com.navinfo.omqs.tools.FileManager.Companion.FileDownloadStatus
|
import com.navinfo.omqs.tools.FileManager.Companion.FileUploadStatus
|
||||||
import io.realm.Realm
|
import io.realm.Realm
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import okhttp3.ResponseBody
|
import okhttp3.ResponseBody
|
||||||
@ -48,7 +48,7 @@ class TaskUploadScope(
|
|||||||
|
|
||||||
//改进的代码
|
//改进的代码
|
||||||
fun start() {
|
fun start() {
|
||||||
change(FileDownloadStatus.WAITING)
|
change(FileUploadStatus.WAITING)
|
||||||
uploadManager.launchScope(this@TaskUploadScope)
|
uploadManager.launchScope(this@TaskUploadScope)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +59,9 @@ class TaskUploadScope(
|
|||||||
*/
|
*/
|
||||||
fun launch() {
|
fun launch() {
|
||||||
uploadJob = launch() {
|
uploadJob = launch() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
upload()
|
upload()
|
||||||
|
}
|
||||||
uploadManager.launchNext(taskBean.id)
|
uploadManager.launchNext(taskBean.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,7 +88,7 @@ class TaskUploadScope(
|
|||||||
* 是否未上传
|
* 是否未上传
|
||||||
*/
|
*/
|
||||||
fun isWaiting(): Boolean {
|
fun isWaiting(): Boolean {
|
||||||
return taskBean.syncStatus == FileManager.Companion.FileUploadStatus.WAITING
|
return taskBean.syncStatus == FileUploadStatus.WAITING
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -104,24 +106,17 @@ class TaskUploadScope(
|
|||||||
private suspend fun upload() {
|
private suspend fun upload() {
|
||||||
try {
|
try {
|
||||||
//如果已上传则返回
|
//如果已上传则返回
|
||||||
if (taskBean.syncStatus == FileManager.Companion.FileUploadStatus.DONE) {
|
if (taskBean.syncStatus == FileUploadStatus.DONE) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val realm = Realm.getDefaultInstance()
|
val realm = Realm.getDefaultInstance()
|
||||||
taskBean.hadLinkDvoList.forEach {
|
taskBean.hadLinkDvoList.forEach { hadLinkDvoBean ->
|
||||||
val hadLinkDvoBean = it
|
|
||||||
val liveDataQSList = MutableLiveData<List<QsRecordBean>>()
|
|
||||||
val objects = realm.where(QsRecordBean::class.java)
|
val objects = realm.where(QsRecordBean::class.java)
|
||||||
.equalTo("linkId", /*"84207223282277331"*/hadLinkDvoBean.linkPid).findAll()
|
.equalTo("linkId", /*"84207223282277331"*/hadLinkDvoBean.linkPid).findAll()
|
||||||
val bodyList: MutableList<EvaluationInfo> = ArrayList()
|
val bodyList: MutableList<EvaluationInfo> = ArrayList()
|
||||||
if (objects != null) {
|
if (objects != null) {
|
||||||
|
objects.forEach{
|
||||||
liveDataQSList.postValue(realm.copyFromRealm(objects))
|
|
||||||
|
|
||||||
if (liveDataQSList.value!!.isNotEmpty()) {
|
|
||||||
|
|
||||||
liveDataQSList.value?.forEach {
|
|
||||||
val evaluationInfo = EvaluationInfo(
|
val evaluationInfo = EvaluationInfo(
|
||||||
taskBean.id.toString(),
|
taskBean.id.toString(),
|
||||||
hadLinkDvoBean.linkPid,//"84207223282277331"
|
hadLinkDvoBean.linkPid,//"84207223282277331"
|
||||||
@ -149,25 +144,24 @@ class TaskUploadScope(
|
|||||||
response: Response<ResponseBody>
|
response: Response<ResponseBody>
|
||||||
) {
|
) {
|
||||||
if (response.code() == 200) {
|
if (response.code() == 200) {
|
||||||
taskBean.syncStatus = FileManager.Companion.FileUploadStatus.DONE
|
taskBean.syncStatus = FileUploadStatus.DONE
|
||||||
// handle the response
|
// handle the response
|
||||||
Log.e("qj", "")
|
Log.e("qj", "")
|
||||||
change(FileManager.Companion.FileUploadStatus.DONE)
|
change(FileUploadStatus.DONE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFailure(call: Call<ResponseBody>, t: Throwable) {
|
override fun onFailure(call: Call<ResponseBody>, t: Throwable) {
|
||||||
// handle the failure
|
// handle the failure
|
||||||
Log.e("qj", "")
|
Log.e("qj", "")
|
||||||
change(FileManager.Companion.FileUploadStatus.ERROR)
|
change(FileUploadStatus.ERROR)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
change(FileManager.Companion.FileUploadStatus.ERROR)
|
change(FileUploadStatus.ERROR)
|
||||||
Log.e("jingo", "数据上传出错 ${e.message}")
|
Log.e("jingo", "数据上传出错 ${e.message}")
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ package com.navinfo.omqs.ui.activity.map
|
|||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.DialogInterface
|
import android.content.DialogInterface
|
||||||
|
import android.graphics.Color
|
||||||
import android.graphics.drawable.AnimationDrawable
|
import android.graphics.drawable.AnimationDrawable
|
||||||
import android.graphics.drawable.BitmapDrawable
|
import android.graphics.drawable.BitmapDrawable
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
@ -30,6 +31,7 @@ import com.navinfo.omqs.Constant
|
|||||||
import com.navinfo.omqs.R
|
import com.navinfo.omqs.R
|
||||||
import com.navinfo.omqs.bean.ImportConfig
|
import com.navinfo.omqs.bean.ImportConfig
|
||||||
import com.navinfo.omqs.bean.SignBean
|
import com.navinfo.omqs.bean.SignBean
|
||||||
|
import com.navinfo.omqs.bean.TaskBean
|
||||||
import com.navinfo.omqs.db.RealmOperateHelper
|
import com.navinfo.omqs.db.RealmOperateHelper
|
||||||
import com.navinfo.omqs.ui.dialog.CommonDialog
|
import com.navinfo.omqs.ui.dialog.CommonDialog
|
||||||
import com.navinfo.omqs.ui.manager.TakePhotoManager
|
import com.navinfo.omqs.ui.manager.TakePhotoManager
|
||||||
@ -39,6 +41,7 @@ import com.navinfo.omqs.util.FlowEventBus
|
|||||||
import com.navinfo.omqs.util.SoundMeter
|
import com.navinfo.omqs.util.SoundMeter
|
||||||
import com.navinfo.omqs.util.SpeakMode
|
import com.navinfo.omqs.util.SpeakMode
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
|
import io.realm.Realm
|
||||||
import io.realm.RealmSet
|
import io.realm.RealmSet
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.flow.collect
|
import kotlinx.coroutines.flow.collect
|
||||||
@ -93,6 +96,36 @@ class MainViewModel @Inject constructor(
|
|||||||
testPoint = it
|
testPoint = it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initTaskData()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始话任务高亮高亮
|
||||||
|
*/
|
||||||
|
private fun initTaskData() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
viewModelScope.launch {
|
||||||
|
val realm = Realm.getDefaultInstance()
|
||||||
|
val results = realm.where(TaskBean::class.java).findAll()
|
||||||
|
val list = realm.copyFromRealm(results)
|
||||||
|
results.addChangeListener { changes ->
|
||||||
|
val list2 = realm.copyFromRealm(changes)
|
||||||
|
mapController.lineHandler.omdbTaskLinkLayer.removeAll()
|
||||||
|
for (item in list2) {
|
||||||
|
mapController.lineHandler.omdbTaskLinkLayer.addLineList(item.hadLinkDvoList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mapController.lineHandler.omdbTaskLinkLayer.removeAll()
|
||||||
|
for (item in list) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
mapController.lineHandler.omdbTaskLinkLayer.setLineColor(Color.valueOf(item.color))
|
||||||
|
}
|
||||||
|
mapController.lineHandler.omdbTaskLinkLayer.addLineList(item.hadLinkDvoList)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// realm.close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initLocation() {
|
private fun initLocation() {
|
||||||
@ -159,11 +192,12 @@ class MainViewModel @Inject constructor(
|
|||||||
signList.add(
|
signList.add(
|
||||||
SignBean(
|
SignBean(
|
||||||
iconId = SignUtil.getSignIcon(element),
|
iconId = SignUtil.getSignIcon(element),
|
||||||
iconText = SignUtil.getSignText(element),
|
iconText = SignUtil.getSignIconText(element),
|
||||||
distance = distance.toInt(),
|
distance = distance.toInt(),
|
||||||
elementId = element.id,
|
elementId = element.id,
|
||||||
linkId = linkId,
|
linkId = linkId,
|
||||||
geometry = element.geometry
|
geometry = element.geometry,
|
||||||
|
bottomText = SignUtil.getSignBottomText(element)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.navinfo.omqs.ui.fragment.tasklist
|
package com.navinfo.omqs.ui.fragment.tasklist
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.graphics.Color
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@ -13,9 +14,11 @@ import com.navinfo.omqs.http.taskdownload.TaskDownloadManager
|
|||||||
import com.navinfo.omqs.http.taskupload.TaskUploadManager
|
import com.navinfo.omqs.http.taskupload.TaskUploadManager
|
||||||
import com.navinfo.omqs.tools.FileManager
|
import com.navinfo.omqs.tools.FileManager
|
||||||
import com.navinfo.omqs.tools.FileManager.Companion.FileDownloadStatus
|
import com.navinfo.omqs.tools.FileManager.Companion.FileDownloadStatus
|
||||||
|
import com.navinfo.omqs.tools.FileManager.Companion.FileUploadStatus
|
||||||
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
||||||
import com.navinfo.omqs.ui.other.BaseViewHolder
|
import com.navinfo.omqs.ui.other.BaseViewHolder
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.util.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -56,7 +59,7 @@ class TaskListAdapter(
|
|||||||
val taskBean = data[it.tag as Int]
|
val taskBean = data[it.tag as Int]
|
||||||
Log.e("jingo", "开始上传 ${taskBean.syncStatus}")
|
Log.e("jingo", "开始上传 ${taskBean.syncStatus}")
|
||||||
when (taskBean.syncStatus) {
|
when (taskBean.syncStatus) {
|
||||||
FileManager.Companion.FileUploadStatus.NONE->{
|
FileUploadStatus.NONE, FileUploadStatus.ERROR -> {
|
||||||
uploadManager.start(taskBean.id)
|
uploadManager.start(taskBean.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,6 +96,7 @@ class TaskListAdapter(
|
|||||||
binding.taskName.text = taskBean.evaluationTaskName
|
binding.taskName.text = taskBean.evaluationTaskName
|
||||||
binding.taskCityName.text = taskBean.cityName
|
binding.taskCityName.text = taskBean.cityName
|
||||||
binding.taskDataVersion.text = "版本号:${taskBean.dataVersion}"
|
binding.taskDataVersion.text = "版本号:${taskBean.dataVersion}"
|
||||||
|
binding.taskColor.setTextColor(taskBean.color)
|
||||||
// binding.offlineMapCitySize.text = cityBean.getFileSizeText()
|
// binding.offlineMapCitySize.text = cityBean.getFileSizeText()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,16 +118,16 @@ class TaskListAdapter(
|
|||||||
|
|
||||||
private fun changeUploadTxtViews(binding: AdapterTaskListBinding, taskBean: TaskBean) {
|
private fun changeUploadTxtViews(binding: AdapterTaskListBinding, taskBean: TaskBean) {
|
||||||
when (taskBean.syncStatus) {
|
when (taskBean.syncStatus) {
|
||||||
FileManager.Companion.FileUploadStatus.DONE -> {
|
FileUploadStatus.DONE -> {
|
||||||
binding.taskUploadBtn.text = "已上传"
|
binding.taskUploadBtn.text = "已上传"
|
||||||
}
|
}
|
||||||
FileManager.Companion.FileUploadStatus.ERROR -> {
|
FileUploadStatus.ERROR -> {
|
||||||
binding.taskUploadBtn.text = "重新同步"
|
binding.taskUploadBtn.text = "重新同步"
|
||||||
}
|
}
|
||||||
FileManager.Companion.FileUploadStatus.NONE -> {
|
FileUploadStatus.NONE -> {
|
||||||
binding.taskUploadBtn.text = "同步"
|
binding.taskUploadBtn.text = "同步"
|
||||||
}
|
}
|
||||||
FileManager.Companion.FileUploadStatus.WAITING -> {
|
FileUploadStatus.WAITING -> {
|
||||||
binding.taskUploadBtn.text = "等待同步"
|
binding.taskUploadBtn.text = "等待同步"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,8 @@ package com.navinfo.omqs.ui.fragment.tasklist
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.os.Build
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import androidx.core.graphics.toColor
|
|
||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
@ -20,6 +17,7 @@ import io.realm.Realm
|
|||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
|
import java.util.*
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
@ -30,6 +28,9 @@ class TaskListViewModel @Inject constructor(
|
|||||||
|
|
||||||
val liveDataTaskList = MutableLiveData<List<TaskBean>>()
|
val liveDataTaskList = MutableLiveData<List<TaskBean>>()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载任务列表
|
||||||
|
*/
|
||||||
fun getTaskList(context: Context) {
|
fun getTaskList(context: Context) {
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
|
||||||
@ -49,6 +50,16 @@ class TaskListViewModel @Inject constructor(
|
|||||||
Log.e("jingo", "当前文件大小 ${task.fileSize}")
|
Log.e("jingo", "当前文件大小 ${task.fileSize}")
|
||||||
task.status = item.status
|
task.status = item.status
|
||||||
task.currentSize = item.currentSize
|
task.currentSize = item.currentSize
|
||||||
|
task.color = item.color
|
||||||
|
} else {
|
||||||
|
val random = Random()
|
||||||
|
task.color = Color.argb(
|
||||||
|
255,
|
||||||
|
random.nextInt(256),
|
||||||
|
random.nextInt(256),
|
||||||
|
random.nextInt(256)
|
||||||
|
)
|
||||||
|
Log.e("jingo", "任务颜色 ${task.color}")
|
||||||
}
|
}
|
||||||
realm.copyToRealmOrUpdate(task)
|
realm.copyToRealmOrUpdate(task)
|
||||||
}
|
}
|
||||||
@ -76,7 +87,9 @@ class TaskListViewModel @Inject constructor(
|
|||||||
for (item in taskList) {
|
for (item in taskList) {
|
||||||
FileManager.checkOMDBFileInfo(item)
|
FileManager.checkOMDBFileInfo(item)
|
||||||
}
|
}
|
||||||
// niMapController.lineHandler.omdbTaskLinkLayer.setLineColor(Color.rgb(0, 255, 0).toColor())
|
// niMapController.lineHandler.omdbTaskLinkLayer.setLineColor(
|
||||||
|
// Color.rgb(0, 255, 0).toColor()
|
||||||
|
// )
|
||||||
// taskList.forEach {
|
// taskList.forEach {
|
||||||
// niMapController.lineHandler.omdbTaskLinkLayer.addLineList(it.hadLinkDvoList)
|
// niMapController.lineHandler.omdbTaskLinkLayer.addLineList(it.hadLinkDvoList)
|
||||||
// }
|
// }
|
||||||
|
@ -10,7 +10,7 @@ class SignUtil {
|
|||||||
/**
|
/**
|
||||||
* 获取面板上的文字
|
* 获取面板上的文字
|
||||||
*/
|
*/
|
||||||
fun getSignText(data: RenderEntity): String {
|
fun getSignIconText(data: RenderEntity): String {
|
||||||
return when (data.code) {
|
return when (data.code) {
|
||||||
//常规点限速
|
//常规点限速
|
||||||
4002 -> getSpeedLimitText(data)
|
4002 -> getSpeedLimitText(data)
|
||||||
@ -24,14 +24,28 @@ class SignUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getSignBottomText(data: RenderEntity): String {
|
||||||
|
return when (data.code) {
|
||||||
|
//常规点限速
|
||||||
|
4002 -> "常规点限速"
|
||||||
|
//道路种别
|
||||||
|
2008 -> "道路种别"
|
||||||
|
//道路方向
|
||||||
|
2010 -> "道路方向"
|
||||||
|
//车道数
|
||||||
|
2041 -> "车道数"
|
||||||
|
else -> ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取限速值文字
|
* 获取限速值文字
|
||||||
*/
|
*/
|
||||||
private fun getSpeedLimitText(data: RenderEntity): String {
|
private fun getSpeedLimitText(data: RenderEntity): String {
|
||||||
try {
|
try {
|
||||||
//限速标志 0 限速开始 1 限速解除
|
//限速标志 0 限速开始 1 限速解除
|
||||||
val maxSpeed = data.properties["max_speed"]
|
val maxSpeed = data.properties["maxSpeed"]
|
||||||
val minSpeed = data.properties["min_speed"]
|
val minSpeed = data.properties["minSpeed"]
|
||||||
return if (maxSpeed != "0")
|
return if (maxSpeed != "0")
|
||||||
maxSpeed.toString()
|
maxSpeed.toString()
|
||||||
else
|
else
|
||||||
@ -48,8 +62,7 @@ class SignUtil {
|
|||||||
fun getSpeedLimitIcon(data: RenderEntity): Int {
|
fun getSpeedLimitIcon(data: RenderEntity): Int {
|
||||||
try {
|
try {
|
||||||
//限速标志 0 限速开始 1 限速解除
|
//限速标志 0 限速开始 1 限速解除
|
||||||
val speedFlag = data.properties["speed_flag"]
|
return when (data.properties["speed_flag"]) {
|
||||||
return when (speedFlag) {
|
|
||||||
"1" -> return R.drawable.icon_speed_limit_off
|
"1" -> return R.drawable.icon_speed_limit_off
|
||||||
else -> return R.drawable.icon_speed_limit
|
else -> return R.drawable.icon_speed_limit
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ public class FileUtils {
|
|||||||
while ((byteread = inStream.read(buffer)) != -1) {
|
while ((byteread = inStream.read(buffer)) != -1) {
|
||||||
|
|
||||||
bytesum += byteread; // 字节数 文件大小
|
bytesum += byteread; // 字节数 文件大小
|
||||||
System.out.println(bytesum);
|
// System.out.println(bytesum);
|
||||||
fs.write(buffer, 0, byteread);
|
fs.write(buffer, 0, byteread);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -398,7 +398,7 @@ public class FileUtils {
|
|||||||
for (String str : suffix) {
|
for (String str : suffix) {
|
||||||
if (fileName.endsWith(str)) { // 判断文件名是否以
|
if (fileName.endsWith(str)) { // 判断文件名是否以
|
||||||
String strFileName = files[i].getAbsolutePath();
|
String strFileName = files[i].getAbsolutePath();
|
||||||
System.out.println("---" + strFileName);
|
// System.out.println("---" + strFileName);
|
||||||
filelist.add(files[i]);
|
filelist.add(files[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/main_activity_sign_recyclerview"
|
android:id="@+id/main_activity_sign_recyclerview"
|
||||||
android:layout_width="150dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="350dp"
|
android:layout_height="350dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
app:layout_constraintLeft_toLeftOf="@id/main_activity_person_center"
|
app:layout_constraintLeft_toLeftOf="@id/main_activity_person_center"
|
||||||
|
@ -42,14 +42,14 @@
|
|||||||
android:textSize="@dimen/card_title_font_3size" />
|
android:textSize="@dimen/card_title_font_3size" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/task_size"
|
android:id="@+id/task_color"
|
||||||
style="@style/map_size_font_style"
|
style="@style/map_size_font_style"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/task_city_name"
|
android:layout_below="@id/task_city_name"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:drawableLeft="@mipmap/point_blue"
|
android:drawableLeft="@mipmap/point_blue"
|
||||||
android:text="文件大小"
|
android:text="路线颜色"
|
||||||
android:textSize="@dimen/card_title_font_3size" />
|
android:textSize="@dimen/card_title_font_3size" />
|
||||||
|
|
||||||
|
|
||||||
@ -68,7 +68,8 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/task_upload_btn"
|
android:id="@+id/task_upload_btn"
|
||||||
style="@style/map_download_style_btn"
|
style="@style/map_download_style_btn"
|
||||||
android:layout_width="60dp"
|
android:layout_width="wrap_content"
|
||||||
|
android:minWidth="60dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginRight="5dp"
|
android:layout_marginRight="5dp"
|
||||||
android:layout_toLeftOf="@id/task_download_btn"
|
android:layout_toLeftOf="@id/task_download_btn"
|
||||||
@ -96,7 +97,7 @@
|
|||||||
style="?android:attr/progressBarStyleHorizontal"
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="16dp"
|
android:layout_height="16dp"
|
||||||
android:layout_below="@id/task_size"
|
android:layout_below="@id/task_color"
|
||||||
android:paddingTop="10dp"
|
android:paddingTop="10dp"
|
||||||
android:progressDrawable="@drawable/progress_bg"
|
android:progressDrawable="@drawable/progress_bg"
|
||||||
android:visibility="invisible" />
|
android:visibility="invisible" />
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package com.navinfo.collect.library.map.layers
|
package com.navinfo.collect.library.map.layers
|
||||||
|
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
import android.os.Build
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
import com.navinfo.collect.library.R
|
import com.navinfo.collect.library.R
|
||||||
import com.navinfo.collect.library.data.entity.HadLinkDvoBean
|
import com.navinfo.collect.library.data.entity.HadLinkDvoBean
|
||||||
import com.navinfo.collect.library.utils.GeometryTools
|
import com.navinfo.collect.library.utils.GeometryTools
|
||||||
@ -43,6 +45,7 @@ class OmdbTaskLinkLayer(map: Map, private var style: Style) : VectorLayer(map) {
|
|||||||
super.remove(geometry)
|
super.remove(geometry)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
fun setLineColor(color: Color) {
|
fun setLineColor(color: Color) {
|
||||||
this.style = Style.builder()
|
this.style = Style.builder()
|
||||||
.fillColor(color.toArgb())
|
.fillColor(color.toArgb())
|
||||||
@ -51,4 +54,11 @@ class OmdbTaskLinkLayer(map: Map, private var style: Style) : VectorLayer(map) {
|
|||||||
.strokeWidth(4f)
|
.strokeWidth(4f)
|
||||||
.fixed(true).build()
|
.fixed(true).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun removeAll() {
|
||||||
|
for ((key, value) in lineMap) {
|
||||||
|
super.remove(value)
|
||||||
|
}
|
||||||
|
lineMap.clear()
|
||||||
|
}
|
||||||
}
|
}
|
@ -57,7 +57,7 @@ public class MapLifeNiLocationTileDataSource implements ITileDataSource {
|
|||||||
list = TraceDataBase.getDatabase(mCon, dbName).getNiLocationDao().findAll();
|
list = TraceDataBase.getDatabase(mCon, dbName).getNiLocationDao().findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.e("qj","query"+(list==null?0:list.size())+"==="+xStart+"==="+xEnd+"==="+yStart+"==="+yEnd);
|
// Log.e("qj","query"+(list==null?0:list.size())+"==="+xStart+"==="+xEnd+"==="+yStart+"==="+yEnd);
|
||||||
mThreadLocalDecoders.get().decode(tile, mapDataSink, "MapLifeNiLocationTile", list);
|
mThreadLocalDecoders.get().decode(tile, mapDataSink, "MapLifeNiLocationTile", list);
|
||||||
|
|
||||||
mapDataSink.completed(QueryResult.SUCCESS);
|
mapDataSink.completed(QueryResult.SUCCESS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user