Commit ad7ff53f 刘韬

修正出库完成的状态同步问题

1 个父辈 474113dd
......@@ -52,6 +52,9 @@
<PropertyGroup>
<ApplicationIcon>box.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="CodeLibrary, Version=1.0.7874.27460, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
......@@ -204,6 +207,7 @@
<EmbeddedResource Include="useControl\uc_boxdebug.resx">
<DependentUpon>uc_boxdebug.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.manifest" />
<None Include="packages.config" />
<None Include="resource\language.resource">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
......
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。n
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素,
Windows 将自动选择最兼容的环境。 -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
......@@ -103,6 +103,10 @@ namespace OnlineStore.ACSingleStore.useControl
int PosCompare(string a, string b) {
string[] pa = a.Split('_');
string[] pb = b.Split('_');
if (pa[2].Length == 1)
pa[2] += "A";
if (pb[2].Length == 1)
pb[2] += "A";
var isa = pa[1] + (pa[2][1].Equals('A') ? "1" : "2") + pa[2][0] + pa[3].PadLeft(2, '0');
var isb = pb[1] + (pb[2][1].Equals('A') ? "1" : "2") + pb[2][0] + pb[3].PadLeft(2, '0');
......@@ -184,7 +188,9 @@ namespace OnlineStore.ACSingleStore.useControl
string posname = store.PositionNumList[ci];
string[] _posstr = posname.Split('_');
int col = int.Parse(_posstr[1]);
string ab = _posstr[2][1].ToString();
string ab = "A";
if (_posstr[2].Length>1)
ab= _posstr[2][1].ToString();
if (col != lastcol || lastAB!= ab)
currentRowIndex = 0;
......@@ -208,6 +214,20 @@ namespace OnlineStore.ACSingleStore.useControl
currentRowIndex++;
}
for (int i = 0; i < dataGridView1.Columns.Count; i++)
{
if (dataGridView1.Rows[0].Cells[i].Value==null) {
dataGridView1.Columns[i].Width = 0;
}
}
if (dataGridView1.Rows[0].Cells[dataGridView1.Columns.Count - 1].Value != null)
{
dataGridView1.Rows[0].Cells[dataGridView1.Columns.Count - 1].Selected = true;
}
else if (dataGridView1.Rows[0].Cells[dataGridView1.Columns.Count - 2].Value != null)
{
dataGridView1.Rows[0].Cells[dataGridView1.Columns.Count - 2].Selected = true;
}
dataGridView1.Rows.RemoveAt(dataGridView1.Rows.Count - 1);
}
void setData(string posid) {
......
......@@ -1606,6 +1606,7 @@ namespace OnlineStore.DeviceLibrary
#region 高度传感器处理
private int Width_7 = 7;
private int Width_13 = 13;
private int Width_15 = 15;
// 0、1对应7寸盘,2,3对应13寸盘
public int GetSize()
{
......@@ -1622,7 +1623,11 @@ namespace OnlineStore.DeviceLibrary
{
return Width_13;
}
if (GetBiglHeight() > 0)
if (GetBiglHeight(15) > 0)
{
return Width_15;
}
else if (GetBiglHeight(13) > 0)
{
return Width_13;
}
......@@ -1638,8 +1643,13 @@ namespace OnlineStore.DeviceLibrary
return GetSmallHeight();
}
else
{
int h = GetBiglHeight();
{
int h = GetBiglHeight(15);
if (h > 0)
{
return h;
}
h = GetBiglHeight(13);
if (h > 0)
{
return h;
......@@ -1673,22 +1683,29 @@ namespace OnlineStore.DeviceLibrary
return CalHeight(Value);
}
private int GetBiglHeight()
private int GetBiglHeight(int size)
{
if (Config.AIDI3_Addr < 0 || Config.AIDI4_Addr < 0)
{
return 0;
}
int result = 0;
if (Config.Default_TrayWidth.Equals(Width_13).Equals(false) && IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
if (Config.Default_TrayWidth.Equals(size).Equals(false) && IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
{
return result;
}
double Value;
double ai3Value = ConvertAI(IOManager.GetADIOValue(Config.AIDI3_Addr), Config.AIDI3_DefaultPosition);
double ai4Value = ConvertAI(IOManager.GetADIOValue(Config.AIDI4_Addr), Config.AIDI4_DefaultPosition);
double Value = Math.Round((ai3Value + ai4Value) / 2, 1);
if (size == 13)
{
Value = Math.Round(ai3Value, 1);
}
else
{
Value = Math.Round(ai4Value, 1);
}
return CalHeight(Value);
}
......@@ -2003,11 +2020,6 @@ namespace OnlineStore.DeviceLibrary
{
boxStatus.status = (int)StoreStatus.Debugging;
}
else if (storeStatus.Equals(StoreStatus.OutStoreBoxEnd) || storeStatus.Equals(StoreStatus.InStoreEnd)
|| storeStatus.Equals(StoreStatus.OutStorEnd))
{
boxStatus.data.Add(ParamDefine.posId, lastPosId);
}
else if (!lastPosId.Equals(""))
{
boxStatus.data.Add(ParamDefine.posId, lastPosId);
......@@ -2018,6 +2030,12 @@ namespace OnlineStore.DeviceLibrary
}
lastPosId = "";
}
else if (storeStatus.Equals(StoreStatus.OutStoreBoxEnd) || storeStatus.Equals(StoreStatus.InStoreEnd)
|| storeStatus.Equals(StoreStatus.OutStorEnd))
{
boxStatus.data.Add(ParamDefine.posId, lastPosId);
}
if (boxStatus.status.Equals((int)StoreStatus.StoreOnline))
{
......
......@@ -728,6 +728,14 @@ namespace OnlineStore.DeviceLibrary
OutStoreLog("出库:SO_15_WaitTake 等待拿走物品,最多等待" + OutStoreWaitSeconds + "秒");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(ms));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
if (OutStoreWaitSeconds > 120)
{
StoreMove.TimeOutSeconds = 120;
}
else
{
StoreMove.TimeOutSeconds = OutStoreWaitSeconds;
}
StoreMove.OneWaitCanEndStep = true;
}
else
......@@ -799,6 +807,7 @@ namespace OnlineStore.DeviceLibrary
lastPosId = posId;
lastPosIdStatus = StoreStatus.OutStorEnd;
storeStatus = StoreStatus.OutStorEnd;
SendLineStatus();
}
private void SO_10_DeviceToDoorPro()
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!