| | |
| | | #define LOG_COLOR_TIME RGB(0, 0, 255) // 时间戳:蓝色 |
| | | |
| | | // 快捷命令映射表 |
| | | std::map<CString, QuickCmdFieldMask> g_quickCmdMap = { |
| | | std::map<CString, QuickCmdFieldMask> g_mapQuickCmd = { |
| | | {_T("SendHome"), {false, false, false, false, false}}, |
| | | {_T("SendTransfer"), {true, true, true, true, true }}, |
| | | {_T("SendMoveToGet"), {true, true, true, false, false}}, |
| | |
| | | |
| | | // TODO: 在此添加额外的初始化 |
| | | // 初始化命令组合列表 |
| | | for (const auto& pair : g_quickCmdMap) { |
| | | for (const auto& pair : g_mapQuickCmd) { |
| | | m_comboCmdType.AddString(pair.first); |
| | | } |
| | | m_comboCmdType.SetCurSel(0); |
| | | |
| | | // 初始化命令输入控件 |
| | | if (!g_quickCmdMap.empty()) { |
| | | UpdateCommandInputUI(g_quickCmdMap.begin()->first); |
| | | if (!g_mapQuickCmd.empty()) { |
| | | UpdateCommandInputUI(g_mapQuickCmd.begin()->first); |
| | | } |
| | | |
| | | // 初始化 Arm No(1:Arm#1,2:Arm#2) |
| | |
| | | |
| | | void CRobotCmdTestDlg::UpdateCommandInputUI(const CString& cmdName) |
| | | { |
| | | auto it = g_quickCmdMap.find(cmdName); |
| | | if (it == g_quickCmdMap.end()) { |
| | | auto it = g_mapQuickCmd.find(cmdName); |
| | | if (it == g_mapQuickCmd.end()) { |
| | | AppendLogLineRichStyled(_T("未知的命令类型"), LOG_COLOR_ERROR); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | long nStart = 0; |
| | | long nEnd = m_editLog.GetTextLength(); |
| | | CHARRANGE cr; |
| | | FINDTEXTEX ft = { 0 }; |
| | | ft.chrg.cpMin = 0; |
| | | ft.chrg.cpMax = nEnd; |