Merge branch 'refs/heads/dev_robotaxi-d_240912_6.7.0' into dev_robotaxi-d_240912_6.7.2_local

This commit is contained in:
donghongyu-pc
2024-10-25 14:58:17 +08:00

View File

@@ -98,8 +98,6 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
private var xPosition: Int = 0
private var yPosition: Int = 0
private var shouldRecord: Boolean = false //是否需要记录接管
private var address: String = "" //故障地点
private var level1Id: Int = 0 //一级分类ID
private var level2Id: Int = 0 //二级分类ID
@@ -406,7 +404,7 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
super.onAutopilotRecordResult(recordPanel)
CallerLogger.d("$M_DEVA$TAG", "recordKey=${recordPanel.key},stat=${recordPanel.stat}")
CallerLogger.d("$M_DEVA$TAG", "recordKey=${recordPanel.key},stat=${recordPanel.stat},type=${recordPanel.type}")
if(BadCaseConfig.notDisplayBagWindow){
//此时点击主动录包按钮,不能展示上报弹窗,需要在此处做主动录包弹窗中的一些逻辑
//开始录制
@@ -424,6 +422,48 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
BadCaseConfig.notDisplayBagWindow = false
}
}
//接管记录
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
if(!BadCaseConfig.recordKeyList.contains(recordPanel.key)){
//目前type == 3包括接管被动录包和其他一些故障录包
if(recordPanel.type == 3){
//录包成功
if(recordPanel.stat == 100 || recordPanel.stat == 101){
if(BadCaseConfig.lineName.isNotEmpty()){
val activity = AppStateManager.currentActivity()
if (activity !is AppCompatActivity) {
return
}
val geocodeSearch = GeocodeSearch(activity)
geocodeSearch.setOnGeocodeSearchListener(object: GeocodeSearch.OnGeocodeSearchListener {
override fun onRegeocodeSearched(regeocodeResult: RegeocodeResult?, p1: Int) {
regeocodeResult?.regeocodeAddress?.formatAddress?.let {
address = it
}
val takeOverRecordInfo = TakeOverRecordInfo(System.currentTimeMillis(),
address,level1Id,level2Id,level3Id,
level1Name, level2Name, level3Name,
BadCaseConfig.lineName,reportNote,
reportStatus = false,
selectStatus = false
)
CallerTakeOverManager.insertRecord(activity,takeOverRecordInfo)
}
override fun onGeocodeSearched(p0: GeocodeResult?, p1: Int) {
}
})
val latLon = LatLonPoint(CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude, CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude)
val q = RegeocodeQuery(latLon,200f,GeocodeSearch.AMAP)
geocodeSearch.getFromLocationAsyn(q)
}
}
}
}
}
if (BadCaseConfig.recordKeyList.contains(recordPanel.key)) {
if (recordPanel.stat == 100 || recordPanel.stat == 101) {
//成功结束录制
@@ -606,42 +646,7 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
* 6:硬件开关接管,7:软件接管,8:云端计算机接管,9:其他接管方式,255:缺省(鹰眼中表示数据异常)
*/
override fun onTakeoverState(state: Int) {
Log.i(TAG, "onTakeoverState state=$state")
if(state == 0 && !shouldRecord){
shouldRecord = true
}
if(shouldRecord){
if(state == 1 || state == 2 || state == 3){
val activity = AppStateManager.currentActivity()
if (activity !is AppCompatActivity) {
return
}
val geocodeSearch = GeocodeSearch(activity)
geocodeSearch.setOnGeocodeSearchListener(object: GeocodeSearch.OnGeocodeSearchListener {
override fun onRegeocodeSearched(regeocodeResult: RegeocodeResult?, p1: Int) {
regeocodeResult?.regeocodeAddress?.formatAddress?.let {
address = it
}
val takeOverRecordInfo = TakeOverRecordInfo(System.currentTimeMillis(),
address,level1Id,level2Id,level3Id,
level1Name, level2Name, level3Name,
BadCaseConfig.lineName,reportNote,
reportStatus = false,
selectStatus = false
)
CallerTakeOverManager.insertRecord(activity,takeOverRecordInfo)
}
override fun onGeocodeSearched(p0: GeocodeResult?, p1: Int) {
}
})
val latLon = LatLonPoint(CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude, CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude)
val q = RegeocodeQuery(latLon,200f,GeocodeSearch.AMAP)
geocodeSearch.getFromLocationAsyn(q)
shouldRecord = false
}
}
}
}