import { ELocalStorageKey } from "../types";

export const getTextByModeCode = (code: number) => {
    let text = '';
    switch (code) {
        case 0:
            text = '待机';
            break;
        case 1:
            text = '起飞准备';
            break;
        case 2:
            text = '起飞准备完毕';
            break;
        case 3:
            text = '手动飞行';
            break;
        case 4:
            text = '自动起飞';
            break;
        case 5:
            text = '航线飞行';
            break;
        case 6:
            text = '全景拍照';
            break;
        case 7:
            text = '智能跟随';
            break;
        case 8:
            text = 'ADS-B 躲避';
            break;
        case 9:
            text = '自动返航';
            break;
        case 10:
            text = '自动降落';
            break;
        case 11:
            text = '强制降落';
            break;
        case 12:
            text = '三桨叶降落';
            break;
        case 13:
            text = '升级中';
            break;
        case 14:
            text = '未连接';
            break;
        case 15:
            text = 'APAS';
            break;
        case 16:
            text = '虚拟摇杆状态';
            break;
        case 17:
            text = '指令飞行';
            break;
        case 18:
            text = '空中 RTK 收敛模式';
            break;
        default:
            break;
    }
    return text;
}

// 获取项目ID
export const getWorkspaceId = () => {
    return localStorage.getItem(ELocalStorageKey.WorkspaceId) || '';
}