[Update]升级数据库并展示摄像头信息

This commit is contained in:
chenfufeng
2022-07-26 20:13:27 +08:00
parent 9d4f0db965
commit 7e326a06e5
5 changed files with 22 additions and 6 deletions

View File

@@ -87,6 +87,7 @@ class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObs
private fun playVideo(ip: String) {
roadVideoPB.visibility = View.VISIBLE
tvCameraDesc.visibility = View.GONE
CallerMonitorManager.openCameraStream(ip, { flvUrl ->
gsyVideoPlay(flvUrl)
}) {
@@ -120,8 +121,13 @@ class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObs
}
SimpleVideoPlayer.PLAY_EVT_PLAY_BEGIN -> {
if (!isShowing) return
roadVideoPB.visibility = View.GONE
roadVideoPlayer.visibility = View.VISIBLE
if (curPlayIndex >= 0 && curPlayIndex < infList.size) {
tvCameraDesc.visibility = View.VISIBLE
tvCameraDesc.text = infList[curPlayIndex].headingDesc
}
}
else -> {
CallerLogger.w("${SceneConstant.M_HMI}$TAG", "播放视频异常,event is:$event")

View File

@@ -4,9 +4,11 @@ import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
import com.mogo.eagle.core.data.map.Infrastructure
@Database(entities = [Infrastructure::class], version = 1, exportSchema = false)
@Database(entities = [Infrastructure::class], version = 2, exportSchema = false)
abstract class OverviewDb: RoomDatabase() {
abstract fun overviewDao(): OverviewDao
@@ -14,12 +16,18 @@ abstract class OverviewDb: RoomDatabase() {
private const val DB_PATH = "database/t_device.db"
private const val INTERNAL_DB_NAME = "t_device.db"
private val MIGRATION_1_2 = object : Migration(1, 2) {
override fun migrate(database: SupportSQLiteDatabase) {
}
}
private var db: OverviewDb? = null
fun getDb(context: Context): OverviewDb {
if (db == null) {
db = Room.databaseBuilder(context.applicationContext, OverviewDb::class.java, INTERNAL_DB_NAME)
.createFromAsset(DB_PATH)
.addMigrations(MIGRATION_1_2)
.fallbackToDestructiveMigration()
.build()
}

View File

@@ -106,10 +106,6 @@ public class OverviewMapFragment extends BaseFragment
if (mAMapCustomView != null) {
mAMapCustomView.onResume();
}
Map<String, ArrayList<Infrastructure>> map = InfStructureManager.INSTANCE.getPathData();
if (!map.isEmpty()) {
mAMapCustomView.drawInfMarkers(map);
}
}
@Override