赵明涛 3 weeks ago
parent
commit
afb69712be
  1. 50
      app/src/main/java/com/ouxuan/oxface/DebugActivity.java
  2. 34
      app/src/main/res/layout/activity_debug.xml

50
app/src/main/java/com/ouxuan/oxface/DebugActivity.java

@ -291,6 +291,56 @@ public class DebugActivity extends Activity {
showStatusBar(); showStatusBar();
} }
}); });
// 485完整诊断按钮
Button btn485FullDiagnosis = findViewById(R.id.btn485FullDiagnosis);
btn485FullDiagnosis.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
run485FullDiagnosis();
}
});
// 485快速测试按钮
Button btn485QuickTest = findViewById(R.id.btn485QuickTest);
btn485QuickTest.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
run485QuickTest();
}
});
}
/**
* 执行485完整诊断
*/
private void run485FullDiagnosis() {
logMessage("触发485完整诊断...");
try {
com.ouxuan.oxface.debug.Ox485DebugHelper.runFullDiagnosis();
logMessage("485完整诊断已启动,请查看日志");
showToast("485完整诊断已启动");
} catch (Exception e) {
Log.e(TAG, "485完整诊断启动失败", e);
logMessage("485完整诊断启动失败: " + e.getMessage());
showToast("485完整诊断启动失败");
}
}
/**
* 执行485快速测试
*/
private void run485QuickTest() {
logMessage("触发485快速测试...");
try {
com.ouxuan.oxface.debug.Ox485DebugHelper.quickTest();
logMessage("485快速测试已启动,请查看日志");
showToast("485快速测试已启动");
} catch (Exception e) {
Log.e(TAG, "485快速测试启动失败", e);
logMessage("485快速测试启动失败: " + e.getMessage());
showToast("485快速测试启动失败");
}
} }
/** /**

34
app/src/main/res/layout/activity_debug.xml

@ -352,6 +352,40 @@
</LinearLayout> </LinearLayout>
<!-- 第十行按钮 - 新增485诊断按钮 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="8dp">
<Button
android:id="@+id/btn485FullDiagnosis"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="485完整诊断"
android:layout_marginEnd="4dp"
android:textSize="12sp" />
<Button
android:id="@+id/btn485QuickTest"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="485快速测试"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:textSize="12sp" />
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="4dp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

Loading…
Cancel
Save