修改判断
This commit is contained in:
parent
7fd0f7e7dd
commit
7f4135a191
|
|
@ -42,33 +42,34 @@ public class TuohengVendorConfig implements VendorConfig {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canExecuteCommand(MachineStates currentStates, CommandType commandType) {
|
public boolean canExecuteCommand(MachineStates currentStates, CommandType commandType) {
|
||||||
DroneState droneState = currentStates.getDroneState();
|
|
||||||
AirportState airportState = currentStates.getAirportState();
|
|
||||||
DebugModeState debugModeState = currentStates.getDebugModeState();
|
|
||||||
|
|
||||||
switch (commandType) {
|
|
||||||
case POWER_ON:
|
|
||||||
// 开机前置条件:机场在线、无人机关机
|
|
||||||
// 注:拓恒无人机没有调试模式概念
|
|
||||||
return airportState == AirportState.ONLINE
|
|
||||||
&& droneState == DroneState.POWER_OFF;
|
|
||||||
|
|
||||||
case POWER_OFF:
|
|
||||||
// 关机前置条件:机场在线、无人机在线(未飞行)
|
|
||||||
return airportState == AirportState.ONLINE
|
|
||||||
&& droneState == DroneState.ONLINE;
|
|
||||||
|
|
||||||
case TAKE_OFF:
|
|
||||||
// 起飞前置条件:机场在线
|
|
||||||
return airportState == AirportState.ONLINE;
|
|
||||||
|
|
||||||
case RETURN_HOME:
|
|
||||||
// 返航前置条件:无人机飞行中
|
|
||||||
return true;
|
return true;
|
||||||
|
// DroneState droneState = currentStates.getDroneState();
|
||||||
|
// AirportState airportState = currentStates.getAirportState();
|
||||||
|
// DebugModeState debugModeState = currentStates.getDebugModeState();
|
||||||
|
|
||||||
default:
|
// switch (commandType) {
|
||||||
return true;
|
// case POWER_ON:
|
||||||
}
|
// // 开机前置条件:机场在线、无人机关机
|
||||||
|
// // 注:拓恒无人机没有调试模式概念
|
||||||
|
// return airportState == AirportState.ONLINE
|
||||||
|
// && droneState == DroneState.POWER_OFF;
|
||||||
|
//
|
||||||
|
// case POWER_OFF:
|
||||||
|
// // 关机前置条件:机场在线、无人机在线(未飞行)
|
||||||
|
// return airportState == AirportState.ONLINE
|
||||||
|
// && droneState == DroneState.ONLINE;
|
||||||
|
//
|
||||||
|
// case TAKE_OFF:
|
||||||
|
// // 起飞前置条件:机场在线
|
||||||
|
// return airportState == AirportState.ONLINE;
|
||||||
|
//
|
||||||
|
// case RETURN_HOME:
|
||||||
|
// // 返航前置条件:无人机飞行中
|
||||||
|
// return true;
|
||||||
|
//
|
||||||
|
// default:
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue