Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
This commit is contained in:
@@ -17,7 +17,7 @@ android {
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.omqs"
|
||||
// applicationId "com.navinfo.omqs"
|
||||
minSdk 21
|
||||
targetSdk 21
|
||||
versionCode 1
|
||||
@@ -26,7 +26,7 @@ android {
|
||||
multiDexEnabled true
|
||||
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "armeabi", "mips"
|
||||
abiFilters "arm64-v8a", "armeabi-v7a", "armeabi", "mips"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -390,6 +390,52 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"3007": {
|
||||
"table": "OMDB_OBJECT_WARNING_AREA",
|
||||
"code": 3007,
|
||||
"name": "警示区",
|
||||
"checkLinkId": true,
|
||||
"filterData": true,
|
||||
"zoomMin": 18,
|
||||
"catch": true,
|
||||
"zoomMax": 20
|
||||
},
|
||||
"3009": {
|
||||
"table": "OMDB_OBJECT_BARRIER",
|
||||
"code": 3009,
|
||||
"name": "护栏",
|
||||
"checkLinkId": true,
|
||||
"filterData": true,
|
||||
"zoomMin": 18,
|
||||
"catch": true,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
{
|
||||
"k": "geometry",
|
||||
"v": "~",
|
||||
"klib": "geometry",
|
||||
"vlib": "generateMulToLine()"
|
||||
}
|
||||
]
|
||||
},
|
||||
"3010": {
|
||||
"table": "OMDB_OBJECT_WALL",
|
||||
"code": 3010,
|
||||
"name": "平行墙",
|
||||
"checkLinkId": true,
|
||||
"filterData": true,
|
||||
"zoomMin": 18,
|
||||
"catch": true,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
{
|
||||
"k": "geometry",
|
||||
"v": "~",
|
||||
"klib": "geometry",
|
||||
"vlib": "generateMulToLine()"
|
||||
}
|
||||
]
|
||||
},
|
||||
"3012": {
|
||||
"table": "OMDB_FILL_AREA",
|
||||
"code": 3012,
|
||||
@@ -418,9 +464,19 @@
|
||||
"catch": true,
|
||||
"zoomMax": 20
|
||||
},
|
||||
"3027": {
|
||||
"3019": {
|
||||
"table": "OMDB_OBJECT_CURB",
|
||||
"code": 3019,
|
||||
"name": "路牙",
|
||||
"checkLinkId": true,
|
||||
"filterData": true,
|
||||
"zoomMin": 18,
|
||||
"catch": true,
|
||||
"zoomMax": 20
|
||||
},
|
||||
"3028": {
|
||||
"table": "OMDB_OBJECT_REFUGE_ISLAND",
|
||||
"code": 3027,
|
||||
"code": 3028,
|
||||
"name": "路口内交通岛",
|
||||
"catch": true,
|
||||
"checkLinkId": true,
|
||||
|
||||
@@ -286,10 +286,10 @@ class ImportPreProcess {
|
||||
startReference.properties["type"] =
|
||||
"s${if (renderEntity.properties["laneType"]!!.toInt() and (0b1000) > 0) "_dec" else "_acc"}"
|
||||
startReference.properties["geometry"] = startReference.geometry
|
||||
listResult.add(startReference)
|
||||
startReference.propertiesDb = DeflaterUtil.zipString(JSON.toJSONString(startReference.properties))
|
||||
renderEntity.referenceEntitys.add(startReference)
|
||||
|
||||
val endReference = ReferenceEntity()
|
||||
// endReference.renderEntityId = renderEntity.id
|
||||
endReference.name = "${renderEntity.name}参考点"
|
||||
endReference.code = renderEntity.code
|
||||
endReference.table = renderEntity.table
|
||||
@@ -305,9 +305,8 @@ class ImportPreProcess {
|
||||
endReference.properties["type"] =
|
||||
"e${if (renderEntity.properties["laneType"]!!.toInt() and (0b1000) > 0) "_dec" else "_acc"}"
|
||||
endReference.properties["geometry"] = endReference.geometry
|
||||
endReference.propertiesDb = DeflaterUtil.zipString(JSON.toJSONString(endReference.properties))
|
||||
renderEntity.referenceEntitys.add(endReference)
|
||||
//listResult.add(endReference)
|
||||
//insertData(listResult)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1373,4 +1372,16 @@ class ImportPreProcess {
|
||||
renderEntity.properties["text-src"] = "@text:${renderEntity.properties["maxSpeed"]}"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 多线转单线
|
||||
* */
|
||||
fun generateMulToLine(renderEntity: RenderEntity) {
|
||||
val translateGeometry = renderEntity.wkt
|
||||
if (translateGeometry != null) {
|
||||
if (translateGeometry.geometryType == Geometry.TYPENAME_MULTILINESTRING) { // 如果是多线,只取第一条线
|
||||
renderEntity.geometry = renderEntity.wkt!!.getGeometryN(0).toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,6 +177,8 @@ class TaskDownloadScope(
|
||||
override fun onComplete() {
|
||||
taskBean.status = FileDownloadStatus.DONE
|
||||
downloadData.postValue(taskBean)
|
||||
//移除当前任务,进行下一个任务下载逻辑
|
||||
downloadManager.launchNext(taskBean.id)
|
||||
//任务与当前一致,需要更新渲染图层
|
||||
if (MapParamUtils.getTaskId() == taskBean.id) {
|
||||
downloadManager.mapController.layerManagerHandler.updateOMDBVectorTileLayer()
|
||||
|
||||
@@ -127,10 +127,10 @@ class LoginViewModel @Inject constructor(
|
||||
if (userNameCache == userName && passwordCache == password) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
createUserFolder(context, userCodeCache, userRealName)
|
||||
getOfflineCityList(context)
|
||||
// getOfflineCityList(context)
|
||||
// loginStatus.postValue(LoginStatus.LOGIN_STATUS_SUCCESS)
|
||||
}
|
||||
return
|
||||
// return
|
||||
}
|
||||
}
|
||||
//不指定IO,会在主线程里运行
|
||||
|
||||
@@ -20,6 +20,7 @@ import androidx.annotation.RequiresApi
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.alibaba.fastjson.JSON
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import com.navinfo.collect.library.data.entity.*
|
||||
import com.navinfo.collect.library.enums.DataCodeEnum
|
||||
@@ -45,6 +46,8 @@ import io.realm.RealmList
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import org.locationtech.jts.geom.Geometry
|
||||
import org.oscim.core.GeoPoint
|
||||
import org.oscim.core.GeometryBuffer.GeometryType
|
||||
@@ -69,7 +72,7 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
/**
|
||||
* 车信列表
|
||||
*/
|
||||
var laneInfoList: MutableList<LaneInfoItem>? = null
|
||||
val laneInfoList = MutableLiveData<MutableList<LaneInfoItem>>()
|
||||
|
||||
var liveDataLanInfoChange = MutableLiveData<String>()
|
||||
|
||||
@@ -139,7 +142,7 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
|
||||
init {
|
||||
mapController.mMapView.addOnNIMapClickListener(TAG, object : OnGeoPointClickListener {
|
||||
override fun onMapClick(tag: String, point: GeoPoint,other:String) {
|
||||
override fun onMapClick(tag: String, point: GeoPoint, other: String) {
|
||||
if (tag == TAG) {
|
||||
liveDataQsRecordBean.value!!.geometry =
|
||||
GeometryTools.createGeometry(point).toText()
|
||||
@@ -174,7 +177,7 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
if (bean != null) {
|
||||
renderEntity = bean.renderEntity
|
||||
if (renderEntity!!.code == DataCodeEnum.OMDB_LANEINFO.code) {
|
||||
laneInfoList = SignUtil.getLineInfoIcons(renderEntity!!)
|
||||
laneInfoList.postValue(SignUtil.getLineInfoIcons(renderEntity!!))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +283,7 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
if (bean != null) {
|
||||
renderEntity = bean.renderEntity
|
||||
if (renderEntity!!.code == DataCodeEnum.OMDB_LANEINFO.code) {
|
||||
laneInfoList = SignUtil.getLineInfoIcons(renderEntity!!)
|
||||
laneInfoList.postValue(SignUtil.getLineInfoIcons(renderEntity!!))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,7 +457,42 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
liveDataToastMessage.postValue("没有绑定到任何link,请选择")
|
||||
return@launch
|
||||
}
|
||||
if (liveDataQsRecordBean.value!!.classCode == DataCodeEnum.OMDB_LANEINFO.code)
|
||||
try {
|
||||
val jsonObject: JSONObject = if (liveDataQsRecordBean.value!!.remarks != "") {
|
||||
JSONObject(liveDataQsRecordBean.value!!.remarks)
|
||||
} else {
|
||||
JSONObject()
|
||||
}
|
||||
if (!jsonObject.has("original")) {
|
||||
renderEntity?.let {
|
||||
val laneOldList = SignUtil.getLineInfoIcons(it)
|
||||
val jsonOriginalArray = JSONArray()
|
||||
for (lane in laneOldList) {
|
||||
val jsonItem = JSONObject()
|
||||
jsonItem.put("id", lane.id)
|
||||
jsonItem.put("type", lane.type)
|
||||
jsonOriginalArray.put(jsonItem)
|
||||
}
|
||||
jsonObject.put("original", jsonOriginalArray)
|
||||
}
|
||||
}
|
||||
laneInfoList.value?.let {
|
||||
val jsonOriginalArray = JSONArray()
|
||||
for (lane in it) {
|
||||
val jsonItem = JSONObject()
|
||||
jsonItem.put("id", lane.id)
|
||||
jsonItem.put("type", lane.type)
|
||||
jsonOriginalArray.put(jsonItem)
|
||||
}
|
||||
jsonObject.put("now", jsonOriginalArray)
|
||||
}
|
||||
liveDataQsRecordBean.value!!.remarks = jsonObject.toString()
|
||||
} catch (e: Exception) {
|
||||
|
||||
}
|
||||
|
||||
Log.e("jingo", "车信json ${liveDataQsRecordBean.value!!.remarks}")
|
||||
val realm = realmOperateHelper.getRealmDefaultInstance()
|
||||
liveDataQsRecordBean.value!!.taskId = liveDataTaskBean.value!!.id
|
||||
liveDataQsRecordBean.value!!.checkTime = DateTimeUtil.getDataTime()
|
||||
@@ -504,7 +542,7 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
@RequiresApi(Build.VERSION_CODES.N)
|
||||
fun initData(id: String) {
|
||||
Log.e("jingo", "捕捉到的要素 id = $id")
|
||||
viewModelScope.launch(Dispatchers.Main) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
|
||||
val realm = realmOperateHelper.getRealmDefaultInstance()
|
||||
|
||||
@@ -523,16 +561,43 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
liveDataQsRecordBean.postValue(it.copy())
|
||||
val p = GeometryTools.createGeoPoint(it.geometry)
|
||||
mapController.markerHandle.addMarker(
|
||||
GeoPoint(
|
||||
p.latitude, p.longitude
|
||||
), TAG, "", null
|
||||
)
|
||||
//定位
|
||||
val mapPosition = mapController.mMapView.vtmMap.mapPosition
|
||||
mapPosition.setPosition(p.latitude, p.longitude)
|
||||
mapController.mMapView.vtmMap.animator().animateTo(300, mapPosition)
|
||||
var hisNowLanInfo = false
|
||||
if (it.classCode == DataCodeEnum.OMDB_LANEINFO.code) {
|
||||
try {
|
||||
val jsonObject = JSONObject(it.remarks)
|
||||
if (jsonObject.has("now")) {
|
||||
val jsonArray = jsonObject.getJSONArray("now")
|
||||
val list = mutableListOf<LaneInfoItem>()
|
||||
for (i in 0 until jsonArray.length()) {
|
||||
val itemObject = jsonArray[i] as JSONObject
|
||||
if (itemObject.has("id") && itemObject.has("type")) {
|
||||
list.add(LaneInfoItem(itemObject.getInt("id"), itemObject.getInt("type")))
|
||||
}
|
||||
}
|
||||
hisNowLanInfo = true
|
||||
laneInfoList.postValue(list)
|
||||
}
|
||||
|
||||
// editLaneInfoProblem()
|
||||
} catch (e: Exception) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
launch(Dispatchers.Main) {
|
||||
val p = GeometryTools.createGeoPoint(it.geometry)
|
||||
mapController.markerHandle.addMarker(
|
||||
GeoPoint(
|
||||
p.latitude, p.longitude
|
||||
), TAG, "", null
|
||||
)
|
||||
|
||||
//定位
|
||||
val mapPosition = mapController.mMapView.vtmMap.mapPosition
|
||||
mapPosition.setPosition(p.latitude, p.longitude)
|
||||
mapController.mMapView.vtmMap.animator().animateTo(300, mapPosition)
|
||||
}
|
||||
|
||||
//获取linkid
|
||||
if (it.linkId.isNotEmpty()) {
|
||||
val link = realmOperateHelper.queryLink(it.linkId)
|
||||
@@ -548,15 +613,15 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
liveDataQsRecordBean.value?.attachmentBeanList = it.attachmentBeanList
|
||||
liveDataLanInfoChange.value = it.description
|
||||
liveDataLanInfoChange.postValue(it.description)
|
||||
// 显示语音数据到界面
|
||||
getChatMsgEntityList()
|
||||
realm.close()
|
||||
//增加要素高亮
|
||||
if(it.elementId!=null){
|
||||
if (it.elementId != null) {
|
||||
val realm2 = realmOperateHelper.getSelectTaskRealmInstance()
|
||||
val rEntity = realm2.where(RenderEntity::class.java).equalTo("id",it.elementId).findFirst()
|
||||
if(rEntity!=null){
|
||||
val rEntity = realm2.where(RenderEntity::class.java).equalTo("id", it.elementId).findFirst()
|
||||
if (rEntity != null) {
|
||||
show(rEntity!!)
|
||||
}
|
||||
if (it.classCode == DataCodeEnum.OMDB_LANEINFO.code) {
|
||||
@@ -565,7 +630,8 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
.equalTo("linkPid", it.linkId).findFirst()
|
||||
if (r != null) {
|
||||
renderEntity = realm2.copyFromRealm(r)
|
||||
laneInfoList = SignUtil.getLineInfoIcons(renderEntity!!)
|
||||
if (!hisNowLanInfo)
|
||||
laneInfoList.postValue(SignUtil.getLineInfoIcons(renderEntity!!))
|
||||
}
|
||||
}
|
||||
realm2.close()
|
||||
@@ -778,7 +844,10 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
* 增加车信
|
||||
*/
|
||||
fun updateLaneInfo(index: Int, id: Int, type: Int) {
|
||||
laneInfoList?.let {
|
||||
if (laneInfoList.value == null) {
|
||||
laneInfoList.value = mutableListOf<LaneInfoItem>()
|
||||
}
|
||||
laneInfoList.value?.let {
|
||||
val laneInfoItem = it[index]
|
||||
if (laneInfoItem.id != id || laneInfoItem.type != type) {
|
||||
laneInfoItem.id = id
|
||||
@@ -792,7 +861,10 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
* 增加车信
|
||||
*/
|
||||
fun addLaneInfo(id: Int, type: Int): Int {
|
||||
laneInfoList?.let {
|
||||
if (laneInfoList.value == null) {
|
||||
laneInfoList.value = mutableListOf<LaneInfoItem>()
|
||||
}
|
||||
laneInfoList.value?.let {
|
||||
it.add(LaneInfoItem(id, type))
|
||||
editLaneInfoProblem()
|
||||
return it.size
|
||||
@@ -804,7 +876,10 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
* 删除车信
|
||||
*/
|
||||
fun backspaceLaneInfo() {
|
||||
laneInfoList?.let {
|
||||
if (laneInfoList.value == null) {
|
||||
laneInfoList.value = mutableListOf<LaneInfoItem>()
|
||||
}
|
||||
laneInfoList.value?.let {
|
||||
if (it.isNotEmpty()) {
|
||||
it.removeLast()
|
||||
editLaneInfoProblem()
|
||||
@@ -816,20 +891,76 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
* 删除车信
|
||||
*/
|
||||
fun removeAllLaneInfo() {
|
||||
laneInfoList?.clear()
|
||||
laneInfoList.value?.clear()
|
||||
}
|
||||
|
||||
/**
|
||||
* 组织车信备注文字
|
||||
*/
|
||||
private fun editLaneInfoProblem() {
|
||||
laneInfoList?.let {
|
||||
if (laneInfoList.value == null) {
|
||||
laneInfoList.value = mutableListOf<LaneInfoItem>()
|
||||
}
|
||||
laneInfoList.value?.let {
|
||||
liveDataQsRecordBean.value?.let { bean ->
|
||||
var strBuffer = StringBuffer()
|
||||
val strBuffer = StringBuffer()
|
||||
if (bean.problemType == "遗漏")
|
||||
strBuffer.append("车信缺失,车道从左到右分别是:")
|
||||
strBuffer.append("车信缺失\n")
|
||||
else if (bean.problemType == "错误")
|
||||
strBuffer.append("车信错误,车道从左到右分别是:")
|
||||
strBuffer.append("车信错误\n")
|
||||
|
||||
renderEntity?.let {
|
||||
val oldList = SignUtil.getLineInfoIcons(it)
|
||||
strBuffer.append("原车道:")
|
||||
for (item in oldList) {
|
||||
when (item.id) {
|
||||
R.drawable.laneinfo_1 -> strBuffer.append("[直(1)")
|
||||
R.drawable.laneinfo_2 -> strBuffer.append("[左(2)")
|
||||
R.drawable.laneinfo_3 -> strBuffer.append("[右(3)")
|
||||
R.drawable.laneinfo_5 -> strBuffer.append("[左斜前(5)")
|
||||
R.drawable.laneinfo_6 -> strBuffer.append("[右斜前(6)")
|
||||
R.drawable.laneinfo_4 -> strBuffer.append("[调(4)")
|
||||
R.drawable.laneinfo_7 -> strBuffer.append("[反向调(7)")
|
||||
R.drawable.laneinfo_1_2 -> strBuffer.append("[左直(1,2)")
|
||||
R.drawable.laneinfo_1_5 -> strBuffer.append("[左斜前直(1,5)")
|
||||
R.drawable.laneinfo_2_5 -> strBuffer.append("[左左斜前(2,5)")
|
||||
R.drawable.laneinfo_2_6 -> strBuffer.append("[左右斜前(2,6)")
|
||||
R.drawable.laneinfo_1_3 -> strBuffer.append("[直右(1,3)")
|
||||
R.drawable.laneinfo_1_6 -> strBuffer.append("[右斜前直(1,6)")
|
||||
R.drawable.laneinfo_3_5 -> strBuffer.append("[左斜前右(3,5)")
|
||||
R.drawable.laneinfo_3_6 -> strBuffer.append("[右斜前右(3,6)")
|
||||
R.drawable.laneinfo_2_3 -> strBuffer.append("[左右(2,3)")
|
||||
R.drawable.laneinfo_5_6 -> strBuffer.append("[左斜前右斜前(5,6)")
|
||||
R.drawable.laneinfo_1_4 -> strBuffer.append("[直调(1,4)")
|
||||
R.drawable.laneinfo_4_5 -> strBuffer.append("[调左斜前(4,5)")
|
||||
R.drawable.laneinfo_2_4 -> strBuffer.append("[左调(2,4)")
|
||||
R.drawable.laneinfo_3_4 -> strBuffer.append("[右调(3,4)")
|
||||
R.drawable.laneinfo_4_6 -> strBuffer.append("[调右斜前(4,6)")
|
||||
R.drawable.laneinfo_1_7 -> strBuffer.append("[直反向调(1,7)")
|
||||
R.drawable.laneinfo_1_2_3 -> strBuffer.append("[左直右(1,2,3)")
|
||||
R.drawable.laneinfo_1_2_4 -> strBuffer.append("[调左直(1,2,4)")
|
||||
R.drawable.laneinfo_1_2_5 -> strBuffer.append("[左左斜前直(1,2,5)")
|
||||
R.drawable.laneinfo_1_2_6 -> strBuffer.append("[左直右斜前(1,2,6)")
|
||||
R.drawable.laneinfo_1_3_4 -> strBuffer.append("[调直右(1,3,4)")
|
||||
R.drawable.laneinfo_1_3_5 -> strBuffer.append("[左斜前直右(1,3,5)")
|
||||
R.drawable.laneinfo_1_3_6 -> strBuffer.append("[直右斜前右(1,3,6)")
|
||||
R.drawable.laneinfo_2_3_4 -> strBuffer.append("[调左右(2,3,4)")
|
||||
R.drawable.laneinfo_0 -> strBuffer.append("[不允许存在(0)")
|
||||
}
|
||||
when (item.type) {
|
||||
1 -> {
|
||||
strBuffer.append("(附加)]")
|
||||
}
|
||||
2 -> {
|
||||
strBuffer.append("(公交)]")
|
||||
}
|
||||
else -> {
|
||||
strBuffer.append("]")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
strBuffer.append("\n现车道:")
|
||||
for (item in it) {
|
||||
when (item.id) {
|
||||
R.drawable.laneinfo_1 -> strBuffer.append("[直(1)")
|
||||
@@ -865,12 +996,16 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
R.drawable.laneinfo_2_3_4 -> strBuffer.append("[调左右(2,3,4)")
|
||||
R.drawable.laneinfo_0 -> strBuffer.append("[不允许存在(0)")
|
||||
}
|
||||
if (item.type == 1) {
|
||||
strBuffer.append("(附加)]")
|
||||
} else if (item.type == 2) {
|
||||
strBuffer.append("(公交)]")
|
||||
} else {
|
||||
strBuffer.append("]")
|
||||
when (item.type) {
|
||||
1 -> {
|
||||
strBuffer.append("(附加)]")
|
||||
}
|
||||
2 -> {
|
||||
strBuffer.append("(公交)]")
|
||||
}
|
||||
else -> {
|
||||
strBuffer.append("]")
|
||||
}
|
||||
}
|
||||
}
|
||||
liveDataQsRecordBean.value!!.description = strBuffer.toString()
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.widget.AdapterView
|
||||
import android.widget.ImageView
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.databinding.FragmentLineInfoEditBinding
|
||||
import com.navinfo.omqs.ui.activity.map.LaneInfoItem
|
||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.other.shareViewModels
|
||||
|
||||
@@ -37,7 +38,10 @@ class LaneInfoEditFragment : BaseFragment() {
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
initLaneInfo()
|
||||
viewModel.laneInfoList.observe(viewLifecycleOwner){
|
||||
initLaneInfo(it)
|
||||
viewModel.laneInfoList.removeObservers(viewLifecycleOwner)
|
||||
}
|
||||
initFLowLayout()
|
||||
|
||||
binding.laneInfoBackspace.setOnClickListener {
|
||||
@@ -271,61 +275,59 @@ class LaneInfoEditFragment : BaseFragment() {
|
||||
/**
|
||||
* 初始化车道信息
|
||||
*/
|
||||
private fun initLaneInfo() {
|
||||
if (viewModel.laneInfoList != null) {
|
||||
val container = binding.laneInfoTopContainer
|
||||
container.removeAllViews()
|
||||
val lineViewS = View(context)
|
||||
lineViewS.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineViewS.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
container.addView(lineViewS, lineViewS.layoutParams)
|
||||
for (i in viewModel.laneInfoList!!.indices) {
|
||||
val laneInfo = viewModel.laneInfoList!![i]
|
||||
val imageView = ImageView(context)
|
||||
val drawable = requireContext().getDrawable(laneInfo.id)
|
||||
val color = when (laneInfo.type) {
|
||||
1 -> requireContext().resources.getColor(R.color.lane_info_1)
|
||||
2 -> requireContext().resources.getColor(R.color.lane_info_2)
|
||||
else -> requireContext().resources.getColor(R.color.white)
|
||||
}
|
||||
// 创建 PorterDuffColorFilter 对象
|
||||
val colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
// 将 PorterDuffColorFilter 设置给 Drawable
|
||||
drawable!!.colorFilter = colorFilter
|
||||
// 将 Drawable 设置给 ImageView
|
||||
imageView.scaleType = ImageView.ScaleType.FIT_XY
|
||||
imageView.setColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
imageView.setImageDrawable(drawable)
|
||||
// 将 ImageView 的颜色设置为红色
|
||||
imageView.layoutParams = ViewGroup.LayoutParams(45, 100)
|
||||
container.addView(imageView, imageView.layoutParams)
|
||||
if (i < viewModel.laneInfoList!!.size - 1) {
|
||||
val lineView = View(context)
|
||||
lineView.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineView.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
container.addView(lineView, lineView.layoutParams)
|
||||
}
|
||||
imageView.tag = i
|
||||
imageView.setOnClickListener {
|
||||
selectView = if (selectView == it) {
|
||||
private fun initLaneInfo(list:MutableList<LaneInfoItem>) {
|
||||
val container = binding.laneInfoTopContainer
|
||||
container.removeAllViews()
|
||||
val lineViewS = View(context)
|
||||
lineViewS.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineViewS.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
container.addView(lineViewS, lineViewS.layoutParams)
|
||||
for (i in list.indices) {
|
||||
val laneInfo = list[i]
|
||||
val imageView = ImageView(context)
|
||||
val drawable = requireContext().getDrawable(laneInfo.id)
|
||||
val color = when (laneInfo.type) {
|
||||
1 -> requireContext().resources.getColor(R.color.lane_info_1)
|
||||
2 -> requireContext().resources.getColor(R.color.lane_info_2)
|
||||
else -> requireContext().resources.getColor(R.color.white)
|
||||
}
|
||||
// 创建 PorterDuffColorFilter 对象
|
||||
val colorFilter = PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
// 将 PorterDuffColorFilter 设置给 Drawable
|
||||
drawable!!.colorFilter = colorFilter
|
||||
// 将 Drawable 设置给 ImageView
|
||||
imageView.scaleType = ImageView.ScaleType.FIT_XY
|
||||
imageView.setColorFilter(color, PorterDuff.Mode.SRC_IN)
|
||||
imageView.setImageDrawable(drawable)
|
||||
// 将 ImageView 的颜色设置为红色
|
||||
imageView.layoutParams = ViewGroup.LayoutParams(45, 100)
|
||||
container.addView(imageView, imageView.layoutParams)
|
||||
if (i < list.size - 1) {
|
||||
val lineView = View(context)
|
||||
lineView.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineView.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
container.addView(lineView, lineView.layoutParams)
|
||||
}
|
||||
imageView.tag = i
|
||||
imageView.setOnClickListener {
|
||||
selectView = if (selectView == it) {
|
||||
selectView!!.setBackgroundColor(requireContext().resources.getColor(R.color.gray))
|
||||
null
|
||||
} else {
|
||||
if (selectView != null) {
|
||||
selectView!!.setBackgroundColor(requireContext().resources.getColor(R.color.gray))
|
||||
null
|
||||
} else {
|
||||
if (selectView != null) {
|
||||
selectView!!.setBackgroundColor(requireContext().resources.getColor(R.color.gray))
|
||||
}
|
||||
imageView.setBackgroundColor(requireContext().resources.getColor(R.color.lane_info_0))
|
||||
it as ImageView
|
||||
}
|
||||
imageView.setBackgroundColor(requireContext().resources.getColor(R.color.lane_info_0))
|
||||
it as ImageView
|
||||
}
|
||||
}
|
||||
val lineViewE = View(context)
|
||||
lineViewE.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineViewE.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
container.addView(lineViewE, lineViewE.layoutParams)
|
||||
}
|
||||
val lineViewE = View(context)
|
||||
lineViewE.layoutParams = ViewGroup.LayoutParams(24, 110)
|
||||
lineViewE.background =
|
||||
requireContext().getDrawable(R.drawable.shape_vertical_dashed_line)
|
||||
container.addView(lineViewE, lineViewE.layoutParams)
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,9 @@ import org.locationtech.jts.geom.Point
|
||||
import org.oscim.core.GeoPoint
|
||||
import java.lang.reflect.Field
|
||||
|
||||
/*
|
||||
* 要素详情解析类及左侧提前显示内容解析说明
|
||||
* */
|
||||
class SignUtil {
|
||||
companion object {
|
||||
|
||||
@@ -82,7 +85,7 @@ class SignUtil {
|
||||
}
|
||||
//全封闭
|
||||
DataCodeEnum.OMDB_CON_ACCESS.code -> {
|
||||
if (data.properties["conAccess"] === "1") "全封闭" else ""
|
||||
if (data.properties["conAccess"] == "1") "全封闭" else ""
|
||||
}
|
||||
//匝道
|
||||
DataCodeEnum.OMDB_RAMP_1.code,
|
||||
@@ -175,9 +178,9 @@ class SignUtil {
|
||||
|
||||
DataCodeEnum.OMDB_LINK_ATTRIBUTE_MAIN_SIDE_ACCESS.code, DataCodeEnum.OMDB_LINK_ATTRIBUTE_FORNTAGE.code, DataCodeEnum.OMDB_LINK_ATTRIBUTE_SA.code, DataCodeEnum.OMDB_LINK_ATTRIBUTE_PA.code -> "道路属性"
|
||||
|
||||
DataCodeEnum.OMDB_LINK_FORM1_1.code, DataCodeEnum.OMDB_LINK_FORM1_2.code, DataCodeEnum.OMDB_LINK_FORM1_3.code, DataCodeEnum.OMDB_LINK_FORM2_1.code, DataCodeEnum.OMDB_LINK_FORM2_2.code, DataCodeEnum.OMDB_LINK_FORM2_3.code, DataCodeEnum.OMDB_LINK_FORM2_4.code, DataCodeEnum.OMDB_LINK_FORM2_5.code, DataCodeEnum.OMDB_LINK_FORM2_6.code, DataCodeEnum.OMDB_LINK_FORM2_7.code, DataCodeEnum.OMDB_LINK_FORM2_8.code, DataCodeEnum.OMDB_LINK_FORM2_9.code, DataCodeEnum.OMDB_LINK_FORM2_10.code, DataCodeEnum.OMDB_LINK_FORM2_11.code, DataCodeEnum.OMDB_LINK_FORM2_12.code, DataCodeEnum.OMDB_LINK_FORM2_13.code -> "道路形态"
|
||||
DataCodeEnum.OMDB_LINK_FORM1_1.code, DataCodeEnum.OMDB_LINK_FORM1_2.code, DataCodeEnum.OMDB_LINK_FORM1_3.code, DataCodeEnum.OMDB_LINK_FORM2_1.code, DataCodeEnum.OMDB_LINK_FORM2_2.code, DataCodeEnum.OMDB_LINK_FORM2_3.code, DataCodeEnum.OMDB_LINK_FORM2_4.code, DataCodeEnum.OMDB_LINK_FORM2_5.code, DataCodeEnum.OMDB_LINK_FORM2_6.code, DataCodeEnum.OMDB_LINK_FORM2_7.code, DataCodeEnum.OMDB_LINK_FORM2_8.code, DataCodeEnum.OMDB_LINK_FORM2_9.code, DataCodeEnum.OMDB_LINK_FORM2_10.code, DataCodeEnum.OMDB_LINK_FORM2_11.code, DataCodeEnum.OMDB_LINK_FORM2_12.code, DataCodeEnum.OMDB_LINK_FORM2_13.code -> "形态"
|
||||
|
||||
else -> DataCodeEnum.findTableNameByCode(data.code)
|
||||
else -> DataCodeEnum.findTableSubNameByCode(data.code)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -790,12 +793,88 @@ class SignUtil {
|
||||
list.add(TwoItemAdapterItem(title = "起终点标识", text = "${data.properties["startEnd"]}"))
|
||||
list.add(TwoItemAdapterItem(title = "高度层次", text = "${data.properties["zlevel"]}"))
|
||||
}
|
||||
//道路边界类型
|
||||
DataCodeEnum.OMDB_RDBOUND_BOUNDARYTYPE.code -> {
|
||||
list.add(TwoItemAdapterItem(title = "道路边界线ID", text = "${data.properties["roadBoundaryLinkPid"]}"))
|
||||
list.add(TwoItemAdapterItem(title = "道路边界类型", text = when (data.properties["boundaryType"]?.toInt()) {
|
||||
0 -> "不应用"
|
||||
1 -> "无标线无可区分边界"
|
||||
2 -> "标线"
|
||||
3 -> "路牙"
|
||||
4 -> "护栏"
|
||||
5 -> "墙"
|
||||
6 -> "铺设路面边缘"
|
||||
7 -> "虚拟三角岛"
|
||||
8 -> "障碍物"
|
||||
9 -> "杆状障碍物"
|
||||
else -> ""
|
||||
}))
|
||||
}
|
||||
//车道类型
|
||||
DataCodeEnum.OMDB_LANE_TYPE_ACCESS.code -> {
|
||||
list.add(TwoItemAdapterItem(title = "车道中心线ID", text = "${data.properties["laneLinkPid"]}"))
|
||||
|
||||
list.add(TwoItemAdapterItem(title = "车道类型", text = getLaneType(data)))
|
||||
}
|
||||
//设施分离
|
||||
DataCodeEnum.OMDB_LINK_SEPARATION.code -> {
|
||||
list.add(TwoItemAdapterItem(title = "设施分离", text = when (data.properties["separation"]) {
|
||||
"1" -> "坚固护栏"
|
||||
"2" -> "非坚固护栏"
|
||||
else -> ""
|
||||
}))
|
||||
}
|
||||
//中央隔离带
|
||||
DataCodeEnum.OMDB_LINK_MEDIAN.code -> {
|
||||
list.add(TwoItemAdapterItem(title = "设施分离", text = when (data.properties["medianSurface"]) {
|
||||
"0" -> "未铺设"
|
||||
"1" -> "铺设"
|
||||
"2" -> "混合"
|
||||
else -> ""
|
||||
}))
|
||||
}
|
||||
//路牙
|
||||
DataCodeEnum.OMDB_OBJECT_CURB.code -> {
|
||||
list.add(TwoItemAdapterItem(title = "是否符合高精地图", text = when (data.properties["compliant"]) {
|
||||
"0" -> "否"
|
||||
"1" -> "是"
|
||||
else -> ""
|
||||
}))
|
||||
}
|
||||
//平行墙
|
||||
DataCodeEnum.OMDB_OBJECT_WALL.code -> {
|
||||
list.add(TwoItemAdapterItem(title = "类型", text = when (data.properties["type"]) {
|
||||
"1" -> "隧道墙"
|
||||
"3" -> "其他墙"
|
||||
else -> ""
|
||||
}))
|
||||
}
|
||||
//警示区
|
||||
DataCodeEnum.OMDB_OBJECT_WARNING_AREA.code -> {
|
||||
list.add(TwoItemAdapterItem(title = "颜色", text = when (data.properties["color"]) {
|
||||
"0" -> "未验证"
|
||||
"1" -> "白色"
|
||||
"2" -> "黄色"
|
||||
"3" -> "红色"
|
||||
else -> ""
|
||||
}))
|
||||
list.add(TwoItemAdapterItem(title = "材质", text = when (data.properties["material"]) {
|
||||
"1" -> "有突起的材质"
|
||||
"2" -> "喷漆材质"
|
||||
else -> ""
|
||||
}))
|
||||
}
|
||||
//护栏
|
||||
DataCodeEnum.OMDB_OBJECT_BARRIER.code -> {
|
||||
list.add(TwoItemAdapterItem(title = "护栏类型", text = when (data.properties["barrierType"]) {
|
||||
"0" -> "护栏"
|
||||
"1" -> "新泽西护栏"
|
||||
"2" -> "安全护栏"
|
||||
"3" -> "围栏"
|
||||
"4" -> "其他护栏"
|
||||
else -> ""
|
||||
}))
|
||||
}
|
||||
}
|
||||
adapter.data = list
|
||||
return adapter
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<item
|
||||
android:id="@+id/personal_center_menu_version"
|
||||
android:icon="@drawable/ic_baseline_layers_24"
|
||||
android:title="版本:24QE1_V1.2.1_20231124_A" />
|
||||
android:title="版本:24QE1_V1.2.3_20231201_A" />
|
||||
</group>
|
||||
<group android:checkableBehavior="single">
|
||||
<item android:title="小标题">
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
<color name="lane_info_0" comment="车信普通道路">#FF2271FF</color>
|
||||
<color name="lane_info_1" comment="车信附加道路">#FF00C800</color>
|
||||
<color name="lane_info_2" comment="车信公交道路">#FFFFB400</color>
|
||||
|
||||
<color name="white" comment="主要按钮,背景等颜色">#FFFFFF</color> <!--白色 -->
|
||||
<color name="button_press_color" comment="默认的按钮按下去时的背景颜色">#F1EBEB</color>
|
||||
<color name="default_button_blue_color" comment="蓝色到紫色的渐变开始颜色">#4954ED</color>
|
||||
@@ -12,7 +11,6 @@
|
||||
<color name="default_blue_text_color" comment="蓝色字体的默认颜色">#2631DD</color>
|
||||
<color name="input_edit_hint_color" comment="输入框hint文字,icon的颜色">#C1C0C8</color>
|
||||
<color name="high_item_color" comment="选中高亮的颜色">#FFF5F7FE</color>
|
||||
|
||||
<color name="line_gray" comment="轻度灰色,一般用于下划线,不可点击按钮的边框">#dadade</color>
|
||||
<color name="bg_left_pannel" comment="左侧弹出框背景颜色">#f4f4fc</color>
|
||||
<color name="colorPrimary">#6c14c4</color>
|
||||
|
||||
Reference in New Issue
Block a user