[Merge]修正冲突
This commit is contained in:
@@ -114,7 +114,7 @@ ext {
|
||||
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
|
||||
mogoobu : 'com.zhidao.support.obu:mogoobu:1.0.0.19',
|
||||
mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.10',
|
||||
adasHigh : 'com.zhidao.support.adas:high:1.2.1.2_bate6',
|
||||
adasHigh : 'com.zhidao.support.adas:high:1.2.1.2_bate11',
|
||||
|
||||
// google
|
||||
googlezxing : "com.google.zxing:core:3.3.3",
|
||||
|
||||
@@ -105,7 +105,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
val entrance = autoPilotBadCaseEntrance
|
||||
val old = entrance?.getTag(R.id.autopilot_badcase_record) as? AutoPilotRecordResult
|
||||
if (entrance == null || old == null || old.consumed) {
|
||||
Logger.d(TAG, "-- step -- 1 --")
|
||||
Logger.d("QQQ", "-- step -- 1 --")
|
||||
var oldT = try {
|
||||
old?.timestamp?.takeIf { it.isNotBlank() }?.let {
|
||||
SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.getDefault()).parse(it)?.time ?: 0L
|
||||
@@ -126,16 +126,16 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
}
|
||||
|
||||
if (oldT == 0L || (newT > 0L && (newT - oldT > 0L) && (newT - oldT) < DURATION_FOR_DISMISS)) {
|
||||
Logger.d(TAG, "-- step -- 2 --")
|
||||
Logger.d("QQQ", "-- step -- 2 --")
|
||||
record?.takeIf { it.key != old?.key && it.timestamp != old?.timestamp }?.also {
|
||||
Logger.d(TAG, "record: [$record] is displaying and consuming ~~~" )
|
||||
Logger.d("QQQ", "record: [$record] is displaying and consuming ~~~" )
|
||||
showBadCaseEntrance(it)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
while (oldT != 0L && newT != 0L && (newT - oldT) >= DURATION_FOR_DISMISS) {
|
||||
Logger.d(TAG, "record: [$record] has been discarded, because it has been timeout." )
|
||||
Logger.d("QQQ", "record: [$record] has been discarded, because it has been timeout." )
|
||||
oldT = newT
|
||||
newT = try {
|
||||
it.receive()?.also {
|
||||
@@ -149,11 +149,11 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
}
|
||||
}
|
||||
record?.takeIf { it.key != old?.key && it.timestamp != old?.timestamp }?.also {
|
||||
Logger.d(TAG, "record: [$record] is displaying for rest ..." )
|
||||
Logger.d("QQQ", "record: [$record] is displaying for rest ..." )
|
||||
showBadCaseEntrance(it)
|
||||
}
|
||||
} else {
|
||||
Logger.d(TAG, "record: [$old] hasn't been consumed~~~~" )
|
||||
Logger.d("QQQ", "record: [$old] hasn't been consumed~~~~" )
|
||||
}
|
||||
} finally {
|
||||
delay(1000)
|
||||
@@ -220,7 +220,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
@ExperimentalCoroutinesApi
|
||||
override fun onAutopilotRecordResult(record: AutoPilotRecordResult?) {
|
||||
record ?: return
|
||||
Logger.d(TAG, "onAutopilotRecordResult:$record")
|
||||
Logger.d("QQQ", "onAutopilotRecordResult:$record")
|
||||
if (record.type == 1 && record.stat == 100) {
|
||||
lifecycleScope.launchWhenResumed {
|
||||
channel.send(record)
|
||||
@@ -235,7 +235,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
|
||||
@VisibleForTesting
|
||||
fun showBadCaseEntrance(record: AutoPilotRecordResult) {
|
||||
Logger.d(TAG, "showBadCaseEntrance:$record")
|
||||
Logger.d("QQQ", "showBadCaseEntrance:$record")
|
||||
lifecycleScope.launch {
|
||||
if (vs_bad_case_entrance?.parent != null) {
|
||||
val inflateView = vs_bad_case_entrance.inflate()
|
||||
@@ -258,14 +258,12 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
}
|
||||
|
||||
private fun showBadCasesFloat(dismiss: (() -> Unit)?) {
|
||||
Logger.d(TAG, "showBadCaseToolsFloat")
|
||||
Logger.d("QQQ", "showBadCaseToolsFloat")
|
||||
context?.let { it ->
|
||||
if (autoPilotToolsFloat == null) {
|
||||
if (autoPilotBadCaseView == null) {
|
||||
autoPilotBadCaseView = AutoPilotBadCaseView(it).also { itx ->
|
||||
itx.onDismiss {
|
||||
val record =
|
||||
autoPilotBadCaseEntrance?.getTag(R.id.autopilot_badcase_record) as? AutoPilotRecordResult
|
||||
dismissBadCaseFloatView()
|
||||
}
|
||||
itx.onSelect {
|
||||
@@ -281,13 +279,14 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
params["filesize"] = record?.total.toString()
|
||||
params["key"] = record?.key ?: ""
|
||||
params["reason"] = it.reason ?: ""
|
||||
params["timestamp"] = System.currentTimeMillis().toString()
|
||||
params["duration"] = record?.duration?.toInt()?.toString() ?: ""
|
||||
params["timestamp"] = record?.timestamp ?: ""
|
||||
}
|
||||
val response = post(params)
|
||||
if (response.isSuccessful) {
|
||||
val body = response.body()
|
||||
if (body == null) {
|
||||
Logger.e(TAG, "返回的body是空的~~~")
|
||||
Logger.e("QQQ", "返回的body是空的~~~")
|
||||
return@launch
|
||||
}
|
||||
if (body.code == 200) {
|
||||
@@ -302,12 +301,12 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
record?.consumed = true
|
||||
return@launch
|
||||
}
|
||||
Logger.e(TAG, "fail:${body}")
|
||||
Logger.e("QQQ", "fail:${body}")
|
||||
}
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
ToastUtils.showShort("网络请求失败,请尝试联网~")
|
||||
Logger.e(TAG, "exception:${t.message}")
|
||||
Logger.e("QQQ", "exception:${t.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ class AutoPilotRecordResult {
|
||||
/**
|
||||
* 磁盘可用空间(M)
|
||||
*/
|
||||
var diskFree: Int = 0
|
||||
var diskFree: Long = 0
|
||||
|
||||
/**
|
||||
* 采集时长
|
||||
@@ -63,7 +63,7 @@ class AutoPilotRecordResult {
|
||||
/**
|
||||
* 此次采集数据总大小(M)
|
||||
*/
|
||||
var total: Int? = 0
|
||||
var total: Long? = 0
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user