Commit 5f69a391 LN

测高3.4都为大料盘改为13寸

1 个父辈 8aa8a5fe
......@@ -173,7 +173,7 @@ namespace OnlineStore.ACSingleStore
tabControl1.TabPages.Remove(tabPage2);
bool showLog = true;
bool showLog = true ;
if (showLog)
{
richTextBox1.Visible = true;
......
......@@ -136,4 +136,4 @@ PRO,特殊二维码尺寸配置,CodeSizeConfig,XA=13x48#XB=13x32,,,,,,,
PRO,扫码枪IP,Scanner_Ip,192.168.201.21,,,,,,,
PRO,扫码枪端口号,Scanner_Port,51236,,,,,,,
,,,,,,,,, ,
PRO,大盘宽度(13寸或15寸),Big_TrayWidth,15,,,,,,,
PRO,大盘宽度(13寸或15寸),Big_TrayWidth,13,,,,,,,
......@@ -1605,7 +1605,8 @@ namespace OnlineStore.DeviceLibrary
#region 高度传感器处理
private int smallWidth = 7;
// 0、1对应7寸盘,2对应13寸,3对应15
private int bigWidth = 13;
// 0、1对应7寸盘,2,3对应13寸盘
public int GetSize()
{
if (Config.Default_TrayWidth > 0)
......@@ -1619,26 +1620,17 @@ namespace OnlineStore.DeviceLibrary
}
else if (Config.AIDI1_Addr < 0 || Config.AIDI2_Addr < 0)
{
if (Get15Height() > 0)
{
return 15;
}
else if (Get13Height() > 0)
{
return 13;
}
}
if (Get15Height() > 0)
{
return 15;
return bigWidth;
}
else if (Get13Height() > 0)
if (GetBiglHeight() > 0)
{
return 13;
return bigWidth;
}
else
{
return 7;
return smallWidth;
}
}
public int GetHeight()
......@@ -1648,16 +1640,11 @@ namespace OnlineStore.DeviceLibrary
return GetSmallHeight();
}
else
{
int h15 = Get15Height();
if (h15 > 0)
{
return h15;
}
int h13 = Get13Height();
if (h13 > 0)
{
int h = GetBiglHeight();
if (h > 0)
{
return h13;
return h;
}
return GetSmallHeight();
}
......@@ -1680,38 +1667,55 @@ namespace OnlineStore.DeviceLibrary
return CalHeight(Value);
}
private int Get13Height()
private int GetBiglHeight()
{
if (Config.AIDI3_Addr < 0)
if (Config.AIDI3_Addr < 0 || Config.AIDI4_Addr < 0)
{
return 0;
}
int result = 0;
if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
if (Config.Default_TrayWidth.Equals(bigWidth).Equals(false) && IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
{
return result;
}
double ai1Value = AIManager.ConvertAI(AIManager.Instance.GetAIValue(Config.AIDevice_IP, Config.AIDI3_Addr), Config.AIDI3_DefaultPosition);
double Value = Math.Round((ai1Value) / 1, 1);
return CalHeight(Value);
}
private int Get15Height()
{
if (Config.AIDI4_Addr < 0)
{
return 0;
}
int result = 0;
if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
{
return result;
}
double ai1Value = AIManager.ConvertAI(AIManager.Instance.GetAIValue(Config.AIDevice_IP, Config.AIDI4_Addr), Config.AIDI4_DefaultPosition);
double Value = Math.Round((ai1Value) / 1, 1);
double ai3Value = AIManager.ConvertAI(AIManager.Instance.GetAIValue(Config.AIDevice_IP, Config.AIDI3_Addr), Config.AIDI3_DefaultPosition);
double ai4Value = AIManager.ConvertAI(AIManager.Instance.GetAIValue(Config.AIDevice_IP, Config.AIDI4_Addr), Config.AIDI4_DefaultPosition);
double Value = Math.Round((ai3Value + ai4Value) / 2, 1);
return CalHeight(Value);
}
//private int Get13Height()
//{
// if (Config.AIDI3_Addr < 0)
// {
// return 0;
// }
// int result = 0;
// if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
// {
// return result;
// }
// double ai1Value = AIManager.ConvertAI(AIManager.Instance.GetAIValue(Config.AIDevice_IP, Config.AIDI3_Addr), Config.AIDI3_DefaultPosition);
// double Value = Math.Round((ai1Value) / 1, 1);
// return CalHeight(Value);
//}
//private int Get15Height()
//{
// if (Config.AIDI4_Addr < 0)
// {
// return 0;
// }
// int result = 0;
// if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
// {
// return result;
// }
// double ai1Value = AIManager.ConvertAI(AIManager.Instance.GetAIValue(Config.AIDevice_IP, Config.AIDI4_Addr), Config.AIDI4_DefaultPosition);
// double Value = Math.Round((ai1Value) / 1, 1);
// return CalHeight(Value);
//}
private int CalHeight(double Value)
{
int result = 0;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!