修复冲突

This commit is contained in:
qiji4215
2023-09-11 17:17:32 +08:00
parent c61599bcc8
commit 33d17eea0d

View File

@@ -382,7 +382,7 @@ class MainViewModel @Inject constructor(
naviMutex.lock() naviMutex.lock()
naviEngine = NaviEngine() naviEngine = NaviEngine()
val pathList = mutableListOf<Route>() val pathList = mutableListOf<Route>()
val realm = Realm.getDefaultInstance() val realm = realmOperateHelper.getSelectTaskRealmInstance()
for (link in taskBean.hadLinkDvoList) { for (link in taskBean.hadLinkDvoList) {
//测线不参与导航 //测线不参与导航
if (link.linkStatus == 3) { if (link.linkStatus == 3) {
@@ -426,6 +426,7 @@ class MainViewModel @Inject constructor(
} }
pathList.add(route) pathList.add(route)
} }
realm.close()
//用来存储最终的导航路径 //用来存储最终的导航路径
val newRouteList = mutableListOf<Route>() val newRouteList = mutableListOf<Route>()
//比对路径排序用的 //比对路径排序用的
@@ -510,7 +511,6 @@ class MainViewModel @Inject constructor(
} else { } else {
// Toast.makeText(context, "数据未安装,无法计算导航路径", Toast.LENGTH_SHORT).show() // Toast.makeText(context, "数据未安装,无法计算导航路径", Toast.LENGTH_SHORT).show()
} }
realm.close()
} }
@@ -812,7 +812,7 @@ class MainViewModel @Inject constructor(
.and() .and()
.equalTo( .equalTo(
"properties['linkIn']", it "properties['linkIn']", it
).findFirst() ).findAll()
if (entityList.isNotEmpty()) { if (entityList.isNotEmpty()) {
val outList = entityList.distinct() val outList = entityList.distinct()
for (i in outList.indices) { for (i in outList.indices) {