|
@@ -154,7 +154,7 @@ class FragmentSimulator:CrNavigationFragment(), View.OnClickListener {
|
|
|
R.id.btn_start->{
|
|
|
// todo: 2023/8/15 启动模拟器
|
|
|
if(SimulatorManager.getInstance().isSimulatorEnabled){
|
|
|
- showInformation("模拟器已开启")
|
|
|
+ showToast("模拟飞行已启动")
|
|
|
}else{
|
|
|
var longitude = txtLongitude?.getContent()?.toDouble()?:0.0
|
|
|
var latitude = txtLatitude?.getContent()?.toDouble()?:0.0
|
|
@@ -163,13 +163,13 @@ class FragmentSimulator:CrNavigationFragment(), View.OnClickListener {
|
|
|
SimulatorManager.getInstance().enableSimulator(settings,object:CommonCallbacks.CompletionCallback{
|
|
|
// todo: 2023/8/15 成功
|
|
|
override fun onSuccess() {
|
|
|
- showInformation("模拟器已开启")
|
|
|
+ showToast("模拟飞行启动")
|
|
|
}
|
|
|
|
|
|
// todo: 2023/8/15 失败
|
|
|
override fun onFailure(error: IDJIError) {
|
|
|
CrUtil.print(error.toString())
|
|
|
- showError("模拟器开启失败:${error.description()}")
|
|
|
+ showError("模拟飞行启动失败:${error.description()}")
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -177,18 +177,18 @@ class FragmentSimulator:CrNavigationFragment(), View.OnClickListener {
|
|
|
R.id.btn_end->{
|
|
|
// todo: 2023/8/15 关闭模拟器
|
|
|
if(!SimulatorManager.getInstance().isSimulatorEnabled){
|
|
|
- showWarning("模拟器尚未开启")
|
|
|
+ showWarning("模拟飞行尚未开启")
|
|
|
}else{
|
|
|
SimulatorManager.getInstance().disableSimulator(object:CommonCallbacks.CompletionCallback{
|
|
|
// todo: 2023/8/15 成功
|
|
|
override fun onSuccess() {
|
|
|
- showInformation("模拟器已停止")
|
|
|
+ showToast("模拟飞行停止")
|
|
|
updateInfo(null)
|
|
|
}
|
|
|
|
|
|
// todo: 2023/8/15 失败
|
|
|
override fun onFailure(error: IDJIError) {
|
|
|
- showError("模拟器停止失败:${error.description()}")
|
|
|
+ showError("模拟飞行停止失败:${error.description()}")
|
|
|
}
|
|
|
})
|
|
|
}
|