| | |
| | | key: string, |
| | | icon: string, |
| | | title: string, |
| | | distinguish?: string, |
| | | param: popoverParamType[], |
| | | event: Function, |
| | | selected?: boolean |
| | |
| | | // 云台偏航角 |
| | | { |
| | | key: 'gimbalRotate', |
| | | distinguish: 'yaw', |
| | | icon: getResource('waylinetool/holderyaw.png'), |
| | | title: '云台偏航角', |
| | | param: [ |
| | |
| | | // 云台俯仰角 |
| | | { |
| | | key: 'gimbalRotate', |
| | | distinguish: 'pitch', |
| | | icon: getResource('waylinetool/holdertilt.png'), |
| | | title: '云台俯仰角', |
| | | param: [ |
| | |
| | | const funcRegx = /<wpml:actionActuatorFunc>([\s\S]*?)<\/wpml:actionActuatorFunc>/g |
| | | const funcs = (points[currentPosition.value] || '').match(funcRegx) |
| | | const funcNameRegx = /<wpml:actionActuatorFunc>(.*?)<\/wpml:actionActuatorFunc>/ |
| | | |
| | | const shootTypeRegx = /<wpml:shootType>([\s\S]*?)<\/wpml:shootType>/g |
| | | const shootType = (points[currentPosition.value] || '').match(shootTypeRegx) |
| | | const shootTypeValueRegx = /<wpml:shootType>(.*?)<\/wpml:shootType>/ |
| | | |
| | | // 云台正则 |
| | | const actionRegx = /<wpml:action>([\s\S]*?)<\/wpml:action>/g |
| | | const actions = (points[currentPosition.value] || '').match(actionRegx) |
| | | const gimbalPitchRotateAngleRegx = /<wpml:gimbalPitchRotateAngle>(.*?)<\/wpml:gimbalPitchRotateAngle>/ |
| | | const gimbalYawRotateAngleRegx = /<wpml:gimbalYawRotateAngle>(.*?)<\/wpml:gimbalYawRotateAngle>/ |
| | | |
| | | btnList.value.forEach(sBtn => { |
| | | funcs?.forEach((func: string) => { |
| | | const funcName = func.match(funcNameRegx) || [] |
| | | if (funcName[1] === sBtn.key) { |
| | | if (funcName[1] === sBtn.key && !sBtn.distinguish) { |
| | | sBtn.selected = true |
| | | } |
| | | }) |
| | |
| | | sBtn.selected = true |
| | | } |
| | | }) |
| | | if (sBtn.distinguish) { |
| | | const action = actions?.find((action: string) => action.includes('<wpml:actionActuatorFunc>gimbalRotate</wpml:actionActuatorFunc>')) |
| | | const pitchAngle = action?.match(gimbalPitchRotateAngleRegx) || [] |
| | | const yawAngle = action?.match(gimbalYawRotateAngleRegx) || [] |
| | | if (!!Number(pitchAngle[1]) && sBtn.distinguish === 'pitch') { |
| | | sBtn.selected = true |
| | | } |
| | | if (!!Number(yawAngle[1]) && sBtn.distinguish === 'yaw') { |
| | | sBtn.selected = true |
| | | } |
| | | } |
| | | }) |
| | | settingDefaultValue(content) |
| | | }) |