增加了设置连接工控机IP的调用

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2021-12-21 18:03:55 +08:00
parent 9bbb5ede54
commit cee45c4fb4
21 changed files with 145 additions and 317 deletions

View File

@@ -165,6 +165,24 @@ class DebugSettingView @JvmOverloads constructor(
}
}
// 初始化工控机 IP信息
val autoPilotIpAddress =
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.AUTOPILOT_IP, "192.168.1.102")
etAutopilotIP.setText(autoPilotIpAddress)
etAutopilotIP.text?.let { etAutopilotIP.setSelection(it.length) }
btnSetAutopilotIP.setOnClickListener {
val autoPilotIp = etAutopilotIP.text.toString()
if (autoPilotIp.isNotEmpty()) {
CallerAutoPilotManager.resetIpAddress(autoPilotIp)
// 保存本地 AutoPilot IP地址
SharedPrefsMgr.getInstance(context).putString(MoGoConfig.AUTOPILOT_IP, autoPilotIp)
} else {
ToastUtils.showShort("请输入正确的IP地址")
}
}
// 域控制器
btnRecordPackage.setOnClickListener {
CallerAutoPilotManager.recordPackage()

View File

@@ -409,6 +409,25 @@
android:textColor="#000"
android:textSize="@dimen/dp_34"
android:textStyle="bold" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etAutopilotIP"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#32009688"
android:gravity="center"
android:minHeight="48dp"
android:padding="@dimen/dp_5"
android:text="192.168.1.102"
android:textSize="@dimen/dp_34" />
<Button
android:id="@+id/btnSetAutopilotIP"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_5"
android:text="设置IP"
android:textSize="@dimen/dp_34" />
<Button
android:id="@+id/btnRecordPackage"