Commit 0e439129 by wuyang.zou

fix bug:修复 星巴克多家门店 pos 插件 点击按钮位置 不一样问题

parent 80399af3
......@@ -182,11 +182,16 @@ void FlowControl::_AddOrderPull(const QString &orderId, const QString &channel,
void FlowControl::_ClickOMSAssignArea()
{
QPoint point=ConfigManger::GetInstance().GetOMSBtnPostion();
SetCursorPos(point.x(),point.y());
// 由于星巴克POS存在两种屏幕[①大屏:1366*768 ②小屏:1024*768] 因此采用获取系统屏幕底部坐标减去一个相对距离来实现正确的点击事件(2018-08-13 初步设定:x-10,y-30);
// QPoint point=ConfigManger::GetInstance().GetOMSBtnPostion();
int nWidth = GetSystemMetrics(SM_CXSCREEN) - ConfigManger::GetInstance().GetOMSBtnWidthOffset();
int nHeight = GetSystemMetrics(SM_CYSCREEN) - ConfigManger::GetInstance().GetOMSBtnHeightOffset();
QLOG_INFO()<<QString::fromLocal8Bit("(x%1:,y:%2)").arg(nWidth).arg(nHeight);
SetCursorPos(nWidth,nHeight);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---触发按钮点击事件:Simphony获取订单请求->坐标(x%1:,y:%2):--->>>>]").arg(point.x()).arg(point.y());
//QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---触发按钮点击事件:Simphony获取订单请求->坐标(x%1:,y:%2):--->>>>]").arg(point.x()).arg(point.y());
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---触发按钮点击事件:Simphony获取订单请求->坐标(x%1:,y:%2):--->>>>]").arg(nWidth).arg(nHeight);
}
void FlowControl::_ClickToLogin()
......
......@@ -149,6 +149,17 @@ QPoint ConfigManger::GetOMSBtnPostion()
return m_userConfig->value(INI_OMSBTNPOSTION).toPoint();
}
int ConfigManger::GetOMSBtnWidthOffset()
{
return m_userConfig->value(INI_OMSBTNWIDTHOFFSET).toInt();
}
int ConfigManger::GetOMSBtnHeightOffset()
{
return m_userConfig->value(INI_OMSBTNHEIGHTOFFSET).toInt();
}
int ConfigManger::GetLoginSslConfig()
{
return m_config->value("SSLConfig/login").toInt();
......
......@@ -127,6 +127,10 @@ public:
QString GetIpAddress();
QPoint GetOMSBtnPostion();
// 获取Simphony 为OMS所做button 相对系统屏幕最右下角的偏移位置;
int ConfigManger::GetOMSBtnWidthOffset();
int ConfigManger::GetOMSBtnHeightOffset();
int GetLoginSslConfig();
int GetOrderSslConfig();
......
......@@ -24,6 +24,8 @@
#define INI_STORESERVER "FmServer/storeUrl"
#define INI_PRINTERNAME "Printer/name"
#define INI_OMSBTNPOSTION "OmsBtn/postion"
#define INI_OMSBTNWIDTHOFFSET "OmsBtn/widthoffset"
#define INI_OMSBTNHEIGHTOFFSET "OmsBtn/heightoffset"
#define INI_FLOATPOSTION "Float/postion"
#define INI_FLOATOPACITY "Float/opacity"
#define INI_BLINKINTERVAL "Float/blinkInterval"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment