|
|
|
@ -629,19 +629,26 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
//设置中文模式
|
|
|
|
//设置中文模式
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1C, 0x21, 0x00});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1C, 0x21, 0x00});
|
|
|
|
//设置居中
|
|
|
|
//设置居中
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x61, 0x01});
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x1B, 0x61, 0x01});
|
|
|
|
//设置1号字
|
|
|
|
//设置1号字
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1D, 0x21, 0x11});
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x1D, 0x21, 0x11});
|
|
|
|
|
|
|
|
|
|
|
|
//打印转煤单
|
|
|
|
//打印转煤单
|
|
|
|
it = msg.find("TitleCorp");
|
|
|
|
// it = msg.find("TitleCorp");
|
|
|
|
if(it != msg.end())
|
|
|
|
// if(it != msg.end())
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
szTemp = ot::UTF8ToGB2312(it->second.c_str()) + ot::UTF8ToGB2312("磅单"); //过衡单
|
|
|
|
// szTemp = ot::UTF8ToGB2312(it->second.c_str()) + ot::UTF8ToGB2312("磅单"); //过衡单
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
// szTemp = ot::UTF8ToGB2312("中电投新疆能源化工集团");
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), szTemp.begin(), szTemp.end());
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
// szTemp = ot::UTF8ToGB2312("五彩湾发电有限责任公司");
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), szTemp.begin(), szTemp.end());
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
// szTemp = ot::UTF8ToGB2312("计量单");
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), szTemp.begin(), szTemp.end());
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A, 0x0A});
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A, 0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), szTemp.begin(), szTemp.end());
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A, 0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设置0号字
|
|
|
|
//设置0号字
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1D, 0x21, 0x00});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1D, 0x21, 0x00});
|
|
|
|
@ -661,23 +668,51 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
//加顶框
|
|
|
|
//加顶框
|
|
|
|
m_newObj[1] = ("┌");
|
|
|
|
m_newObj[1] = ("┌");
|
|
|
|
m_newObj[7] = ("┬");
|
|
|
|
|
|
|
|
m_newObj[23] = ("┐");
|
|
|
|
m_newObj[23] = ("┐");
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//====抬头=====================
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
|
|
|
|
m_newObj[26] = (" 中电投新疆能源化工集团");
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
|
|
|
|
m_newObj[26] = (" 五彩湾发电有限责任公司");
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
|
|
|
|
m_newObj[26] = (" 计量单");
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
|
|
|
|
m_newObj[8] = ("┬");
|
|
|
|
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
//====票据号=====================
|
|
|
|
//====票据号=====================
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("票据号");
|
|
|
|
m_newObj[26] = (" 票据号");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
it = msg.find("CoalNumber");
|
|
|
|
it = msg.find("CoalNumber");
|
|
|
|
if(it != msg.end())
|
|
|
|
if(it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
@ -687,7 +722,7 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┼");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
@ -697,12 +732,12 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("车牌号");
|
|
|
|
m_newObj[26] = (" 车牌号");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
it = msg.find("CarNumber");
|
|
|
|
it = msg.find("CarNumber");
|
|
|
|
if(it != msg.end())
|
|
|
|
if(it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
@ -711,7 +746,7 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┼");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
@ -721,12 +756,12 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("往来单位");
|
|
|
|
m_newObj[26] = (" 往来单位");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
it = msg.find("Supplier");
|
|
|
|
it = msg.find("Supplier");
|
|
|
|
if(it != msg.end())
|
|
|
|
if(it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
@ -735,7 +770,7 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┼");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
@ -745,12 +780,12 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("品 种");
|
|
|
|
m_newObj[26] = (" 品种");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
it = msg.find("GoodsType");
|
|
|
|
it = msg.find("GoodsType");
|
|
|
|
if(it != msg.end())
|
|
|
|
if(it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
@ -760,7 +795,7 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┼");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
@ -771,12 +806,12 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("批次号");
|
|
|
|
m_newObj[26] = (" 批次号");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
it = msg.find("BatchNumber");
|
|
|
|
it = msg.find("BatchNumber");
|
|
|
|
if(it != msg.end())
|
|
|
|
if(it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
@ -785,23 +820,16 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┴");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
//====磅称名称=====================
|
|
|
|
//====称重类型=====================
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("汽车衡名称");
|
|
|
|
m_newObj[26] = " 一次称重";
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
|
|
|
|
it = msg.find("GrossDeviceName");
|
|
|
|
|
|
|
|
if(it != msg.end())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
@ -809,9 +837,9 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┬");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
@ -819,12 +847,12 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("汽车衡编号");
|
|
|
|
m_newObj[26] = (" 汽车衡编号");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
it = msg.find("GrossDeviceID");
|
|
|
|
it = msg.find("GrossDeviceID");
|
|
|
|
if(it != msg.end())
|
|
|
|
if (it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
@ -833,27 +861,25 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┼");
|
|
|
|
m_newObj[17] = ("┬");
|
|
|
|
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24,m_newObj);
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
//=========毛重======================
|
|
|
|
//=========一次称重时间======================
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("毛重");
|
|
|
|
m_newObj[26] = ("一次称重时间");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
it = msg.find("GrossWeight");
|
|
|
|
|
|
|
|
|
|
|
|
it = msg.find("GrossTime");
|
|
|
|
if (it != msg.end())
|
|
|
|
if (it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj[384] = ("│");
|
|
|
|
|
|
|
|
m_newObj[404] = ("吨");
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
@ -861,26 +887,16 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┴");
|
|
|
|
m_newObj[17] = ("┴");
|
|
|
|
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
//=========毛重时间======================
|
|
|
|
//====称重类型=====================
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("毛重时间");
|
|
|
|
m_newObj[26] = " 二次称重";
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it = msg.find("GrossTime");
|
|
|
|
|
|
|
|
if (it != msg.end())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
@ -888,22 +904,22 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┬");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
//====磅称名称=====================
|
|
|
|
//====磅称编号=====================
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("汽车衡名称");
|
|
|
|
m_newObj[26] = (" 汽车衡编号");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
it = msg.find("TareDeviceName");
|
|
|
|
it = msg.find("TareDeviceID");
|
|
|
|
if (it != msg.end())
|
|
|
|
if (it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
@ -912,23 +928,25 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┼");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
//====磅称编号=====================
|
|
|
|
//=========二次称重时间======================
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("汽车衡编号");
|
|
|
|
m_newObj[26] = ("二次称重时间");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
it = msg.find("TareDeviceID");
|
|
|
|
|
|
|
|
|
|
|
|
it = msg.find("TareTime");
|
|
|
|
if (it != msg.end())
|
|
|
|
if (it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
@ -936,29 +954,27 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┼");
|
|
|
|
m_newObj[17] = ("┬");
|
|
|
|
m_newObj[17] = ("┬");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
//=========皮重======================
|
|
|
|
//=========毛重======================
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("皮重");
|
|
|
|
m_newObj[26] = (" 毛重");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
|
|
|
|
it = msg.find("GrossWeight");
|
|
|
|
it = msg.find("TareWeight");
|
|
|
|
|
|
|
|
if (it != msg.end())
|
|
|
|
if (it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj[384] = ("│");
|
|
|
|
m_newObj[384] = ("│");
|
|
|
|
m_newObj[404] = ("吨");
|
|
|
|
m_newObj[404] = ("kg");
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
@ -966,26 +982,28 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┼");
|
|
|
|
m_newObj[17] = ("┴");
|
|
|
|
m_newObj[17] = ("┼");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
//=========皮重时间======================
|
|
|
|
//=========皮重======================
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("皮重时间");
|
|
|
|
m_newObj[26] = (" 皮重");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
|
|
|
|
|
|
|
|
it = msg.find("TareTime");
|
|
|
|
it = msg.find("TareWeight");
|
|
|
|
if (it != msg.end())
|
|
|
|
if (it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj[384] = ("│");
|
|
|
|
|
|
|
|
m_newObj[404] = ("kg");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
@ -993,8 +1011,8 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┼");
|
|
|
|
m_newObj[8] = ("┼");
|
|
|
|
m_newObj[17] = ("┬");
|
|
|
|
m_newObj[17] = ("┼");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
@ -1004,17 +1022,17 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("净重");
|
|
|
|
m_newObj[26] = (" 净重");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
|
|
|
|
|
|
|
|
it = msg.find("SuttleWeight");
|
|
|
|
it = msg.find("SuttleWeight");
|
|
|
|
if (it != msg.end())
|
|
|
|
if (it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj[384] = ("│");
|
|
|
|
m_newObj[384] = ("│");
|
|
|
|
m_newObj[404] = ("吨");
|
|
|
|
m_newObj[404] = ("kg");
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
@ -1023,7 +1041,7 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┴");
|
|
|
|
m_newObj[8] = ("┼");
|
|
|
|
m_newObj[17] = ("┴");
|
|
|
|
m_newObj[17] = ("┴");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
@ -1031,97 +1049,121 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
// 操作员
|
|
|
|
// 操作员
|
|
|
|
m_newObj.clear();
|
|
|
|
// m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
// m_newObj[0] = ("│");
|
|
|
|
it = msg.find("GrossOperater");
|
|
|
|
// it = msg.find("GrossOperater");
|
|
|
|
if (it != msg.end())
|
|
|
|
// if (it != msg.end())
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
m_newObj[26] = " " + it->second;
|
|
|
|
// m_newObj[26] = " " + it->second;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
// m_newObj[528] = ("│");
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
// blTemp = BuildStringLine(m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
// m_newObj.clear();
|
|
|
|
m_newObj[1] = ("├");
|
|
|
|
// m_newObj[1] = ("├");
|
|
|
|
m_newObj[7] = ("┬");
|
|
|
|
// m_newObj[7] = ("┬");
|
|
|
|
m_newObj[23] = ("┤");
|
|
|
|
// m_newObj[23] = ("┤");
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
// blTemp = BuildLine(24, m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
//=========备注=====================
|
|
|
|
//=========备注=====================
|
|
|
|
|
|
|
|
|
|
|
|
const size_t MAX_DISPLAY_WIDTH = 30; // 每行最多32个显示位置
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
m_newObj[26] = ("提示");
|
|
|
|
m_newObj[26] = (" 备注");
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
m_newObj[168] = ("│");
|
|
|
|
|
|
|
|
|
|
|
|
it = msg.find("Tips");
|
|
|
|
it = msg.find("Tips");
|
|
|
|
if (it != msg.end())
|
|
|
|
if (it != msg.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// 检查显示宽度是否超过限制
|
|
|
|
m_newObj[190] = it->second;
|
|
|
|
size_t display_width = get_utf8_display_width(it->second);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (display_width > MAX_DISPLAY_WIDTH)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// 需要分割成多行显示
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 第一行:显示前32个宽度的内容
|
|
|
|
|
|
|
|
std::vector<std::string> lines = split_utf8_by_width(it->second, MAX_DISPLAY_WIDTH);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 输出第一行(包含前缀)
|
|
|
|
|
|
|
|
m_newObj[170] = lines[0];
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 输出剩余行(不包含前缀,但有边框)
|
|
|
|
|
|
|
|
for (size_t i = 1; i < lines.size(); i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
|
|
|
|
m_newObj[0] = ("│");
|
|
|
|
|
|
|
|
m_newObj[144] = ("│");
|
|
|
|
|
|
|
|
m_newObj[170] = lines[i];
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// 宽度不超过限制,正常显示
|
|
|
|
|
|
|
|
m_newObj[170] = it->second;
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// 没有找到Warning,显示空内容
|
|
|
|
|
|
|
|
m_newObj[170] = "";
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj.clear();
|
|
|
|
m_newObj[1] = ("└");
|
|
|
|
m_newObj[1] = ("└");
|
|
|
|
m_newObj[7] = ("┴");
|
|
|
|
m_newObj[8] = ("┴");
|
|
|
|
m_newObj[23] = ("┘");
|
|
|
|
m_newObj[23] = ("┘");
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
blTemp = BuildLine(24, m_newObj);
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const size_t MAX_DISPLAY_WIDTH = 30; // 每行最多32个显示位置
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// m_newObj.clear();
|
|
|
|
|
|
|
|
// m_newObj[0] = ("│");
|
|
|
|
|
|
|
|
// m_newObj[26] = ("提示");
|
|
|
|
|
|
|
|
// m_newObj[144] = ("│");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// it = msg.find("Tips");
|
|
|
|
|
|
|
|
// if (it != msg.end())
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// // 检查显示宽度是否超过限制
|
|
|
|
|
|
|
|
// size_t display_width = get_utf8_display_width(it->second);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (display_width > MAX_DISPLAY_WIDTH)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// // 需要分割成多行显示
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // 第一行:显示前32个宽度的内容
|
|
|
|
|
|
|
|
// std::vector<std::string> lines = split_utf8_by_width(it->second, MAX_DISPLAY_WIDTH);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // 输出第一行(包含前缀)
|
|
|
|
|
|
|
|
// m_newObj[170] = lines[0];
|
|
|
|
|
|
|
|
// m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
// blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // 输出剩余行(不包含前缀,但有边框)
|
|
|
|
|
|
|
|
// for (size_t i = 1; i < lines.size(); i++)
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// m_newObj.clear();
|
|
|
|
|
|
|
|
// m_newObj[0] = ("│");
|
|
|
|
|
|
|
|
// m_newObj[144] = ("│");
|
|
|
|
|
|
|
|
// m_newObj[170] = lines[i];
|
|
|
|
|
|
|
|
// m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// // 宽度不超过限制,正常显示
|
|
|
|
|
|
|
|
// m_newObj[170] = it->second;
|
|
|
|
|
|
|
|
// m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
// blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// // 没有找到Warning,显示空内容
|
|
|
|
|
|
|
|
// m_newObj[170] = "";
|
|
|
|
|
|
|
|
// m_newObj[528] = ("│");
|
|
|
|
|
|
|
|
// blTemp = BuildStringLine(m_newObj);
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// m_newObj.clear();
|
|
|
|
|
|
|
|
// m_newObj[1] = ("└");
|
|
|
|
|
|
|
|
// m_newObj[7] = ("┴");
|
|
|
|
|
|
|
|
// m_newObj[23] = ("┘");
|
|
|
|
|
|
|
|
// blTemp = BuildLine(24, m_newObj);
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), blTemp.begin(), blTemp.end());
|
|
|
|
|
|
|
|
// m_PrintData.insert(m_PrintData.end(), {0x0A});
|
|
|
|
|
|
|
|
|
|
|
|
//打印页
|
|
|
|
//打印页
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x11, 0x0C});
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x11, 0x0C});
|
|
|
|
//退出页模式
|
|
|
|
//退出页模式
|
|
|
|
@ -1132,9 +1174,8 @@ void MsgHandler::Print1_3(const std::map<std::string, std::string>& msg)
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x4B, 0x60});//向上调整位置
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x4B, 0x60});//向上调整位置
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x4B, 0x60});//向上调整位置
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x4B, 0x60});//向上调整位置
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x4B, 0x60});//向上调整位置
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x4B, 0x60});//向上调整位置
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x4B, 0x60});//向上调整位置
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1C, 0x70, 0x01, 0x00});//打印下载NV位图
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1C, 0x70, 0x01, 0x00});//打印下载NV位图
|
|
|
|
|
|
|
|
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x64, 0x0A});//空行并打印
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x64, 0x06});//空行并打印
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x69});//切纸
|
|
|
|
m_PrintData.insert(m_PrintData.end(), {0x1B, 0x69});//切纸
|
|
|
|
}
|
|
|
|
}
|