1 Star 0 Fork 0

小喻同学i/TouchTest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mainmenu.cpp 14.41 KB
一键复制 编辑 原始数据 按行查看 历史
yuxj 提交于 2024-08-29 15:33 . update
#include "mainmenu.h"
#include "ui_imenupage.h"
//#include "customconfig.h"
MainMenu::MainMenu(QWidget *parent) : IMenuPage(parent)
{
if (m_root != nullptr)
{
initScreenBRI();
initImageSetting();
initCompensateMethod();
initReticleZeroing();
initPowerSetting();
initRecordSetting();
}
this->ui->mainNavigation->setNavigationInfo(m_root->childLst);
}
void MainMenu::initScreenBRI()
{
//根节点 -> 屏幕亮度
MenuItemNode_S* screenBRI = new MenuItemNode_S();
screenBRI->type = MenuNodeType_E::TYPE_SETTING;
screenBRI->index = 0;
screenBRI->itemText = LanguageStr_NS::SCREEN_BRIGHTNESS;
screenBRI->cmdKey = ns_command_key::screenBrightness;
screenBRI->parentNode = m_root;
screenBRI->normalImgPath = ":/icon/mainMenu/0n.png";
screenBRI->selectImagePath = ":/icon/mainMenu/0s.png";
screenBRI->supportPreview = true;
screenBRI->settingMap = {
{0, "1"}, {1, "2"}, {2, "3"}, {3, "4"}, {4, "5"}
};
m_root->childLst.append(screenBRI);
}
void MainMenu::initImageSetting()
{
//根节点 -> 画面设置
MenuItemNode_S* imageSetting = new MenuItemNode_S();
imageSetting->type = MenuNodeType_E::TYPE_EXPAND;
imageSetting->index = 1;
imageSetting->itemText = LanguageStr_NS::IMAGE_SETTING;
imageSetting->cmdKey = "";
imageSetting->parentNode = m_root;
imageSetting->normalImgPath = ":/icon/mainMenu/1n.png";
imageSetting->selectImagePath = ":/icon/mainMenu/1s.png";
m_root->childLst.append(imageSetting);
//画面设置 -> 场景模式
MenuItemNode_S* sceneMode = new MenuItemNode_S();
sceneMode->type = MenuNodeType_E::TYPE_SETTING;
sceneMode->index = 0;
sceneMode->itemText = LanguageStr_NS::SCENE_MODE;
sceneMode->cmdKey = ns_command_key::irSceneMode;
sceneMode->parentNode = imageSetting;
sceneMode->normalImgPath = ":/icon/mainMenu/imageSetting/0n.png";
sceneMode->selectImagePath = ":/icon/mainMenu/imageSetting/0s.png";
sceneMode->settingMap = {
{SCENE_MODE_NORMAL, LanguageStr_NS::SCENE_MODE_NORMAL},
{SCENE_MODE_ENHANCE, LanguageStr_NS::SCENE_MODE_ENHANCE},
{SCENE_MODE_LIGHT, LanguageStr_NS::SCENE_MODE_LIGHT}
};
imageSetting->childLst.append(sceneMode);
//画面设置 -> 亮度
MenuItemNode_S* bri = new MenuItemNode_S();
bri->type = MenuNodeType_E::TYPE_SETTING;
bri->index = 1;
bri->itemText = LanguageStr_NS::IR_BRIGHTNESS;
bri->cmdKey = ns_command_key::brightness;
bri->parentNode = imageSetting;
bri->normalImgPath = ":/icon/mainMenu/imageSetting/1n.png";
bri->selectImagePath = ":/icon/mainMenu/imageSetting/1s.png";
bri->settingMap = {
{0, "1"}, {1, "2"}, {2, "3"}, {3, "4"}, {4, "5"}
};
imageSetting->childLst.append(bri);
//画面设置 -> 对比度
MenuItemNode_S* contrast = new MenuItemNode_S();
contrast->type = MenuNodeType_E::TYPE_SETTING;
contrast->index = 2;
contrast->itemText = LanguageStr_NS::IR_CONTRAST;
contrast->cmdKey = ns_command_key::contrast;
contrast->parentNode = imageSetting;
contrast->normalImgPath = ":/icon/mainMenu/imageSetting/2n.png";
contrast->selectImagePath = ":/icon/mainMenu/imageSetting/2s.png";
contrast->settingMap = {
{0, "1"}, {1, "2"}, {2, "3"}, {3, "4"}, {4, "5"}
};
imageSetting->childLst.append(contrast);
//画面设置 -> 超分辨率
MenuItemNode_S* superResolution = new MenuItemNode_S();
superResolution->type = MenuNodeType_E::TYPE_SWITCH;
superResolution->index = 3;
superResolution->itemText = LanguageStr_NS::SUPER_RESOLUTION;
superResolution->cmdKey = "" /*ns_customCommand_key::superResolution*/;
superResolution->parentNode = imageSetting;
superResolution->normalImgPath = ":/icon/mainMenu/imageSetting/3n.png";
superResolution->selectImagePath = ":/icon/mainMenu/imageSetting/3s.png";
imageSetting->childLst.append(superResolution);
//画面设置 -> 色调
MenuItemNode_S* tone = new MenuItemNode_S();
tone->type = MenuNodeType_E::TYPE_SETTING;
tone->index = 4;
tone->itemText = LanguageStr_NS::TONE;
tone->cmdKey = ns_command_key::hue;
tone->parentNode = imageSetting;
tone->normalImgPath = ":/icon/mainMenu/imageSetting/4n.png";
tone->selectImagePath = ":/icon/mainMenu/imageSetting/4s.png";
tone->settingMap = {
{0, LanguageStr_NS::TONE_COLD},
{1, LanguageStr_NS::TONE_WARM},
};
imageSetting->childLst.append(tone);
}
void MainMenu::initCompensateMethod()
{
//根节点 -> 补偿模式
MenuItemNode_S* compensateMode = new MenuItemNode_S();
compensateMode->type = MenuNodeType_E::TYPE_SETTING;
compensateMode->index = 2;
compensateMode->itemText = LanguageStr_NS::COMPENSATION_MODE;
compensateMode->cmdKey = ns_command_key::compensationMethod;
compensateMode->parentNode = m_root;
compensateMode->normalImgPath = ":/icon/mainMenu/2n.png";
compensateMode->selectImagePath = ":/icon/mainMenu/2s.png";
compensateMode->settingMap = {
{COMPENSATION_SETTING_AUTO, LanguageStr_NS::AUTO_COMPENSATION},
{COMPENSATION_SETTING_MANUAL, LanguageStr_NS::MANUAL_COMPENSATION}
};
m_root->childLst.append(compensateMode);
}
void MainMenu::initReticleZeroing()
{
//根节点 -> 分化线与校零
MenuItemNode_S* reticleZero = new MenuItemNode_S();
reticleZero->type = MenuNodeType_E::TYPE_EXPAND;
reticleZero->index = 3;
reticleZero->cmdKey = "";
reticleZero->parentNode = m_root;
reticleZero->normalImgPath = ":/icon/mainMenu/3n.png";
reticleZero->selectImagePath = ":/icon/mainMenu/3s.png";
m_root->childLst.append(reticleZero);
//分化线与校零 -> 分化线配置
MenuItemNode_S* reticleCfg = new MenuItemNode_S();
reticleCfg->type = MenuNodeType_E::TYPE_SETTING;
reticleCfg->index = 0;
reticleCfg->cmdKey = ns_command_key::reticleConfig;
reticleCfg->parentNode = reticleZero;
reticleCfg->normalImgPath = "";
reticleCfg->selectImagePath = "";
reticleCfg->settingMap = {
{0, "A"}, {1, "B"}, {2, "C"}, {3, "D"}, {4, "E"},
{5, "F"}, {6, "G"}, {7, "H"}, {8, "I"}, {9, "J"}
};
reticleZero->childLst.append(reticleCfg);
}
void MainMenu::initPowerSetting()
{
//根节点 -> 电源设置
MenuItemNode_S* powerSetting = new MenuItemNode_S();
powerSetting->type = MenuNodeType_E::TYPE_EXPAND;
powerSetting->index = 4;
powerSetting->cmdKey = "";
powerSetting->parentNode = m_root;
powerSetting->normalImgPath = ":/icon/mainMenu/4n.png";
powerSetting->selectImagePath = ":/icon/mainMenu/4s.png";
m_root->childLst.append(powerSetting);
//电源设置 -> 智能休眠
MenuItemNode_S* smartSleep = new MenuItemNode_S();
smartSleep->type = MenuNodeType_E::TYPE_SWITCH;
smartSleep->index = 0;
smartSleep->cmdKey = ns_command_key::smartSleep;
smartSleep->parentNode = powerSetting;
smartSleep->normalImgPath = ":/icon/mainMenu/Pow Setting/0n.png";
smartSleep->selectImagePath = ":/icon/mainMenu/Pow Setting/0s.png";
powerSetting->childLst.append(smartSleep);
//电源设置 -> 定时关机
MenuItemNode_S* autoShutdown = new MenuItemNode_S();
autoShutdown->type = MenuNodeType_E::TYPE_SETTING;
autoShutdown->index = 1;
autoShutdown->cmdKey = ns_command_key::autoShutdown;
autoShutdown->parentNode = powerSetting;
autoShutdown->normalImgPath = ":/icon/mainMenu/Pow Setting/1n.png";
autoShutdown->selectImagePath = ":/icon/mainMenu/Pow Setting/1s.png";
autoShutdown->settingMap = {
{0, LanguageStr_NS::COMMON_OFF},
{1, LanguageStr_NS::TIME_SET_15MIN},
{2, LanguageStr_NS::TIME_SET_30MIN},
{3, LanguageStr_NS::TIME_SET_60MIN}
};
powerSetting->childLst.append(autoShutdown);
//电源设置 -> 定时关菜单
MenuItemNode_S* autoCloseMenu = new MenuItemNode_S();
autoCloseMenu->type = MenuNodeType_E::TYPE_SETTING;
autoCloseMenu->index = 2;
autoCloseMenu->cmdKey = ns_command_key::autoCloseMenu;
autoCloseMenu->parentNode = powerSetting;
autoCloseMenu->normalImgPath = ":/icon/mainMenu/Pow Setting/2n.png";
autoCloseMenu->selectImagePath = ":/icon/mainMenu/Pow Setting/2s.png";
autoCloseMenu->settingMap = {
{TIMEDMENU_CLOSE, LanguageStr_NS::COMMON_OFF},
{TIMEDMENU_10, LanguageStr_NS::TIME_SET_10SEC},
{TIMEDMENU_20, LanguageStr_NS::TIME_SET_20SEC},
{TIMEDMENU_60, LanguageStr_NS::TIME_SET_60SEC}
};
powerSetting->childLst.append(autoCloseMenu);
}
void MainMenu::initRecordSetting()
{
//根节点 -> 记录设置
MenuItemNode_S* recordSetting = new MenuItemNode_S();
recordSetting->type = MenuNodeType_E::TYPE_EXPAND;
recordSetting->itemText == LanguageStr_NS::RECORD_SETTING;
recordSetting->index = 5;
recordSetting->cmdKey = "";
recordSetting->parentNode = m_root;
recordSetting->normalImgPath = ":/icon/mainMenu/5n.png";
recordSetting->selectImagePath = ":/icon/mainMenu/5s.png";
m_root->childLst.append(recordSetting);
//记录设置 -> 音频
MenuItemNode_S* audio = new MenuItemNode_S();
audio->type = MenuNodeType_E::TYPE_SWITCH;
audio->itemText == LanguageStr_NS::AUDIO;
audio->index = 0;
audio->cmdKey = ns_command_key::audioSwitch;
audio->parentNode = recordSetting;
audio->normalImgPath = ":/icon/mainMenu/Record Setting/0n.png";
audio->selectImagePath = ":/icon/mainMenu/Record Setting/0s.png";
recordSetting->childLst.append(audio);
//记录设置 -> 智能录像
MenuItemNode_S* smartRecord = new MenuItemNode_S();
smartRecord->type = MenuNodeType_E::TYPE_EXPAND;
smartRecord->itemText = LanguageStr_NS::SMART_RECORD;
smartRecord->index = 1;
smartRecord->cmdKey = "";
smartRecord->parentNode = recordSetting;
smartRecord->normalImgPath = ":/icon/mainMenu/Record Setting/1n.png";
smartRecord->selectImagePath = ":/icon/mainMenu/Record Setting/1s.png";
recordSetting->childLst.append(smartRecord);
{
//智能录像 -> 开关
MenuItemNode_S* smartRecordSwitch = new MenuItemNode_S();
smartRecordSwitch->type = MenuNodeType_E::TYPE_SWITCH;
smartRecordSwitch->index = 0;
smartRecordSwitch->cmdKey = ns_command_key::smartRecord;
smartRecordSwitch->parentNode = smartRecord;
smartRecordSwitch->normalImgPath = ":/icon/mainMenu/Record Setting/smartRecord/0n.png";
smartRecordSwitch->selectImagePath = ":/icon/mainMenu/Record Setting/smartRecord/0s.png";
smartRecord->childLst.append(smartRecordSwitch);
//智能录像 -> 灵敏度
MenuItemNode_S* sensitive = new MenuItemNode_S();
sensitive->type = MenuNodeType_E::TYPE_SETTING;
sensitive->itemText = LanguageStr_NS::SENSITIVE;
sensitive->index = 1;
sensitive->cmdKey = ns_command_key::sensitivity;
sensitive->parentNode = smartRecord;
sensitive->normalImgPath = ":/icon/mainMenu/Record Setting/smartRecord/1n.png";
sensitive->selectImagePath = ":/icon/mainMenu/Record Setting/smartRecord/1s.png";
sensitive->settingMap = {
{0, "1"}, {1, "2"}, {2, "3"}
};
smartRecord->childLst.append(sensitive);
//智能录像 -> 回放
MenuItemNode_S* playback = new MenuItemNode_S();
playback->type = MenuNodeType_E::TYPE_JUMP;
playback->itemText = LanguageStr_NS::PLAY_BACK;
playback->index = 2;
playback->cmdKey = "";
playback->parentNode = smartRecord;
playback->normalImgPath = ":/icon/mainMenu/Record Setting/smartRecord/2n.png";
playback->selectImagePath = ":/icon/mainMenu/Record Setting/smartRecord/2s.png";
smartRecord->childLst.append(playback);
}
//记录设置 -> 限时录像
MenuItemNode_S* limitRecord = new MenuItemNode_S();
limitRecord->type = MenuNodeType_E::TYPE_EXPAND;
limitRecord->index = 2;
limitRecord->cmdKey = ns_command_key::timeLimitedRecord;
limitRecord->parentNode = recordSetting;
limitRecord->normalImgPath = ":/icon/mainMenu/Record Setting/2n.png";
limitRecord->selectImagePath = ":/icon/mainMenu/Record Setting/2s.png";
limitRecord->settingMap = {
{0, LanguageStr_NS::COMMON_OFF},
{1, LanguageStr_NS::TIME_SET_15SEC},
{2, LanguageStr_NS::TIME_SET_60SEC}
};
recordSetting->childLst.append(limitRecord);
//记录设置 -> OSD
MenuItemNode_S* osd = new MenuItemNode_S();
osd->type = MenuNodeType_E::TYPE_SWITCH;
osd->index = 3;
osd->cmdKey = ns_command_key::osdSwitch;
osd->parentNode = recordSetting;
osd->normalImgPath = ":/icon/mainMenu/Record Setting/3n.png";
osd->selectImagePath = ":/icon/mainMenu/Record Setting/3s.png";
recordSetting->childLst.append(osd);
//记录设置 -> 水印
MenuItemNode_S* waterMark = new MenuItemNode_S();
waterMark->type = MenuNodeType_E::TYPE_EXPAND;
waterMark->index = 4;
waterMark->cmdKey = "";
waterMark->parentNode = recordSetting;
waterMark->normalImgPath = ":/icon/mainMenu/Record Setting/4n.png";
waterMark->selectImagePath = ":/icon/mainMenu/Record Setting/4s.png";
recordSetting->childLst.append(waterMark);
{
//水印 -> 时间开关
MenuItemNode_S* time = new MenuItemNode_S();
time->type = MenuNodeType_E::TYPE_SWITCH;
time->index = 0;
time->cmdKey = ns_command_key::timeWatermark;
time->parentNode = waterMark;
time->normalImgPath = ":/icon/mainMenu/Record Setting/watermark/0n.png";
time->selectImagePath = ":/icon/mainMenu/Record Setting/watermark/0s.png";
waterMark->childLst.append(time);
//水印 -> 日期开关
MenuItemNode_S* date = new MenuItemNode_S();
date->type = MenuNodeType_E::TYPE_SWITCH;
date->index = 1;
date->cmdKey = ns_command_key::dateWatermark;
date->parentNode = waterMark;
date->normalImgPath = ":/icon/mainMenu/Record Setting/watermark/1n.png";
date->selectImagePath = ":/icon/mainMenu/Record Setting/watermark/1s.png";
waterMark->childLst.append(date);
//水印 -> logo 开关
MenuItemNode_S* logo = new MenuItemNode_S();
logo->type = MenuNodeType_E::TYPE_SWITCH;
logo->index = 2;
logo->cmdKey = ns_command_key::logoWatermark;
logo->parentNode = waterMark;
logo->normalImgPath = ":/icon/mainMenu/Record Setting/watermark/2n.png";
logo->selectImagePath = ":/icon/mainMenu/Record Setting/watermark/2s.png";
waterMark->childLst.append(logo);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/oweni/touch-test.git
git@gitee.com:oweni/touch-test.git
oweni
touch-test
TouchTest
master

搜索帮助