[8.1.0]OTA升级+自动驾驶检测
This commit is contained in:
@@ -58,6 +58,8 @@ import kotlinx.coroutines.DelicateCoroutinesApi
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import system_master.SsmInfo
|
||||
import system_master.SystemStatusInfo
|
||||
|
||||
@@ -363,7 +365,20 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
if(OTAUpgradeConfig.coldStartCompleted && !OTAUpgradeConfig.autopilotStatus
|
||||
&& !OTAUpgradeConfig.inOrder){
|
||||
//触发强提示升级
|
||||
CallerHmiManager.showOTAUpgradeDialog(true)
|
||||
val productArray = JSONArray(request.productName)
|
||||
var upgradeReason = ""
|
||||
var leftTime = 0
|
||||
if(productArray.length() > 0){
|
||||
val productInfo = productArray[0] as JSONObject
|
||||
upgradeReason = productInfo.optString("upgrade_reason")//升级原因
|
||||
leftTime = productInfo.optInt("left_time")//剩余时间,单位秒
|
||||
}
|
||||
val upgradeTime = if(leftTime > 60){
|
||||
"${leftTime/60}分钟${leftTime%60}秒"
|
||||
}else{
|
||||
"${leftTime%60}秒"
|
||||
}
|
||||
CallerHmiManager.showOTAUpgradeDialog(true,upgradeReason+upgradeTime)
|
||||
}else{
|
||||
ToastUtils.showLong("请结束订单后触发升级")
|
||||
}
|
||||
|
||||
@@ -673,8 +673,9 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
/**
|
||||
* 展示OTA升级弹窗
|
||||
* @param isShow 设置是否展示
|
||||
* @param content 升级内容
|
||||
*/
|
||||
override fun showOTAUpgradeDialog(isShow: Boolean) {
|
||||
override fun showOTAUpgradeDialog(isShow: Boolean,content: String) {
|
||||
ThreadUtils.runOnUiThread{
|
||||
context?.let {
|
||||
if(isShow){
|
||||
@@ -684,6 +685,7 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
if(otaUpgradeDialog?.isShowing == false){
|
||||
otaUpgradeDialog?.show()
|
||||
}
|
||||
otaUpgradeDialog?.showUpgradeContent(content)
|
||||
}else{
|
||||
if(otaUpgradeDialog?.isShowing == true){
|
||||
otaUpgradeDialog?.dismiss()
|
||||
@@ -758,6 +760,7 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
if(otaPowerOffFinishDialog?.isShowing == false){
|
||||
otaPowerOffFinishDialog?.show()
|
||||
}
|
||||
otaPowerOffFinishDialog?.speakTTS()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ import kotlinx.android.synthetic.main.view_debug_setting.view.appVersionInfoLayo
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.brakeThresholdDivider
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.btChangeEnv
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.btnAppReboot
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.btnAutoCheck
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.btnBrakeThreshold
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.btnConnectServerIp
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.btnDeleteDB
|
||||
@@ -834,6 +835,14 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
ChangeDefaultConfigDialog(ActivityUtils.getTopActivity()).show()
|
||||
true
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶检测
|
||||
*/
|
||||
btnAutoCheck.onClick {
|
||||
ToastUtils.showShort("自动驾驶检测")
|
||||
}
|
||||
|
||||
/**
|
||||
* 日志中心
|
||||
*/
|
||||
|
||||
@@ -24,6 +24,9 @@ class OTAPowerOffFinishDialog(context: Context) :
|
||||
tvPowerOffClose.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
fun speakTTS(){
|
||||
//语音提示下电重启
|
||||
AIAssist.getInstance(context).speakTTSVoice("优雅停服完成,请操作车辆下电重启")
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.zhjt.mogo_core_function_devatools.ota.OTAUpgradeConfig
|
||||
import kotlinx.android.synthetic.main.dialog_ota_upgrade.tvUpgradeContent
|
||||
import kotlinx.android.synthetic.main.dialog_ota_upgrade.tv_upgrade_later
|
||||
import kotlinx.android.synthetic.main.dialog_ota_upgrade.tv_upgrade_now
|
||||
import system_master.SsmInfo
|
||||
@@ -79,6 +80,12 @@ class OTAUpgradeDialog(context: Context) :
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
fun showUpgradeContent(content: String){
|
||||
if(content.isNotEmpty()){
|
||||
tvUpgradeContent.text = content
|
||||
}
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
//立即升级
|
||||
fun upgradeNow()
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUpgradeContent"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ota_upgrade_tip_one"
|
||||
android:textSize="@dimen/sp_36"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
@@ -44,40 +44,44 @@
|
||||
android:layout_marginTop="@dimen/dp_206"
|
||||
android:layout_marginStart="@dimen/dp_103"
|
||||
android:layout_marginEnd="@dimen/dp_66"
|
||||
android:text="@string/ota_upgrade_tip_one"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivTipLogoTwo"
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:src="@drawable/icon_ota_upgrade_tip"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_272"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvUpgradeContent"
|
||||
android:layout_marginStart="@dimen/dp_65"
|
||||
android:contentDescription="@string/ota_upgrade_tip_two"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTipContentTwo"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/ota_upgrade_tip_two"
|
||||
android:textSize="@dimen/sp_36"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/ivTipLogoTwo"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_256"
|
||||
android:layout_marginStart="@dimen/dp_103"
|
||||
android:layout_marginEnd="@dimen/dp_66"
|
||||
android:layout_marginTop="@dimen/dp_m_17"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivTipLogoThree"
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:src="@drawable/icon_ota_upgrade_tip"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvTipContentTwo"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_372"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginStart="@dimen/dp_65"
|
||||
android:contentDescription="@string/ota_upgrade_tip_three"
|
||||
/>
|
||||
@@ -88,12 +92,12 @@
|
||||
android:text="@string/ota_upgrade_tip_three"
|
||||
android:textSize="@dimen/sp_36"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_356"
|
||||
app:layout_constraintTop_toTopOf="@id/ivTipLogoThree"
|
||||
android:layout_marginStart="@dimen/dp_103"
|
||||
android:layout_marginEnd="@dimen/dp_66"
|
||||
android:layout_marginTop="@dimen/dp_m_17"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -2176,7 +2176,7 @@
|
||||
android:id="@+id/debugCenterLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
<Button
|
||||
@@ -2187,10 +2187,17 @@
|
||||
android:padding="@dimen/dp_20"
|
||||
android:text="故障诊断"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toTopOf="@id/etTTSContent"
|
||||
app:layout_constraintBottom_toBottomOf="@id/etTTSContent"
|
||||
app:layout_constraintLeft_toRightOf="@id/etTTSContent"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
/>
|
||||
<Button
|
||||
android:id="@+id/btnAutoCheck"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:text="自动驾驶检测"
|
||||
android:textSize="@dimen/dp_24"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<ToggleButton
|
||||
android:id="@+id/tbLogcatCenter"
|
||||
|
||||
Reference in New Issue
Block a user