Commit 6c23f80f 张东亮

aoi,获取库位时添加料盘总厚度便于分配库位

1 个父辈 919a9f63
正在显示 35 个修改的文件 包含 1144 行增加111 行删除
......@@ -65,10 +65,12 @@
<Compile Include="util\MyWebClient.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="util\ProcessUtil.cs" />
<Compile Include="util\TcpClient.cs" />
<Compile Include="util\TcpServer.cs" />
<Compile Include="util\UdpServer.cs" />
<Compile Include="util\WaitUtil.cs" />
<Compile Include="util\WindowUtil.cs" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
......
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Common
{
/// <summary>
/// 软件管理工具
/// </summary>
public class ProcessUtil
{
/// <summary>
/// 设置自动启动
/// </summary>
/// <param name="strName"></param>
/// <param name="value"></param>
public static void AutoRun(string strName, bool value)
{
try
{
//创建启动对象
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
//设置运行文件
startInfo.FileName = System.Windows.Forms.Application.StartupPath + "\\AuToRunManager.exe";
//设置启动参数
startInfo.Arguments = String.Join(" ", new string[2] { strName, value.ToString() });
//设置启动动作,确保以管理员身份运行
startInfo.Verb = "runas";
//如果不是管理员,则启动UAC
System.Diagnostics.Process.Start(startInfo);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
public static Process StartProcess(string appName, string baseDir = @".\",int waitIdle=5000)
{
try
{
Process process = new Process();
process.StartInfo = new System.Diagnostics.ProcessStartInfo();
process.StartInfo.FileName = appName+".exe";
process.StartInfo.WorkingDirectory = baseDir;
process.Start();
process.WaitForInputIdle(waitIdle);
return process;
}
catch (Exception ex)
{
}
return null;
}
public static Process IsRun(Process process)
{
Process processRun = new Process();
try
{
System.Diagnostics.Process[] processList = System.Diagnostics.Process.GetProcesses
();
foreach (System.Diagnostics.Process process2 in processList)
{
if (process2.Id == process.Id)
{
processRun = process;
}
}
}
catch { }
return processRun;
}
public static bool CloseProcess(Process process)
{
bool sc = false;
try
{
System.Diagnostics.Process[] processList = System.Diagnostics.Process.GetProcesses();
foreach (System.Diagnostics.Process process2 in processList)
{
if (process2.Id == process.Id)
{
process.Kill(); //结束进程
sc = process.WaitForExit(100000);
}
}
}
catch { sc = true; }
return sc;
}
}
}
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
namespace Common
{
public class WindowUtil
{
public const int WM_CLOSE = 0x0010;
static List<Process> SubProcesses = new List<Process>();
public static Process OpenExe(Panel panel, string appName, string titleName, string baseDir = @".\")
{
if (appName == null || appName == string.Empty) return null;
Process process = null;
IntPtr appWin = IntPtr.Zero;
try
{
process = ProcessUtil.StartProcess(appName, baseDir);
}
catch (Exception ex)
{
// MessageBox.Show(fm, ex.Message, "Error");
return process;
}
return process;
}
public static bool PutIntoForm(Panel panel, string titleName, out IntPtr appWin)
{
appWin = FindWindow(null, titleName);
if (appWin == IntPtr.Zero)
{
appWin = GetDesktopWindows($"{titleName}");
}
// Put it into this form
SetParent(appWin, panel.Handle);
// Remove border and whatnot
// SetWindowLong(appWin, GWL_STYLE, WS_VISIBLE);
// Move the window to overlay it on this window
return MoveWindow(appWin, 0, 0, panel.Width + 2, panel.Height, true);
}
public static void Resize(Panel panel, string titleName)
{
IntPtr appWin = FindWindow(null, titleName);
if (appWin != IntPtr.Zero)
WindowUtil.MoveWindow(appWin, 0, 0, panel.Width, panel.Height, true);
}
public static void RemoveFromForm(string titleName)
{
IntPtr appWin = FindWindow(null, titleName);
// Put it into this form
SetParent(appWin, IntPtr.Zero);
}
/// <summary>
/// 找到某个窗口与给出的类别名和窗口名相同窗口
/// </summary>
/// <param name="lpClassName">类别名</param>
/// <param name="lpWindowName">窗口名</param>
/// <returns>成功找到返回窗口句柄,否则返回null</returns>
[DllImport("user32.dll")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
/// <summary>
/// 切换到窗口并把窗口设入前台,类似 SetForegroundWindow方法的功能
/// </summary>
/// <param name="hWnd">窗口句柄</param>
/// <param name="fAltTab">True代表窗口正在通过Alt/Ctrl +Tab被切换</param>
[DllImport("user32.dll ", SetLastError = true)]
public static extern void SwitchToThisWindow(IntPtr hWnd, bool fAltTab);
/// <summary>
/// 设置窗口的显示状态
/// </summary>
/// <param name="hWnd">窗口句柄</param>
/// <param name="cmdShow">指示窗口如何被显示</param>
/// <returns>如果窗体之前是可见,返回值为非零;如果窗体之前被隐藏,返回值为零</returns>
[DllImport("user32.dll", EntryPoint = "ShowWindow", CharSet = CharSet.Auto)]
public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);
[DllImport("user32.dll", SetLastError = true)]
private static extern long SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
/// <summary>
/// 改变指定窗口的位置和尺寸
/// </summary>
/// <param name="hwnd">窗口句柄</param>
/// <param name="x">窗口左侧的新位置</param>
/// <param name="y">窗口顶部的新位置</param>
/// <param name="nWidth">窗口的新宽度</param>
/// <param name="nHeight">窗口的新高度</param>
/// <param name="bRepaint">指示是否重新绘制窗口。 如果此参数为 TRUE,窗口将收到消息。 如果参数为 FALSE,则不会重新绘制任何类型的参数。 这适用于工作区、非client 区域 (,包括标题栏和滚动条) ,以及由于移动子窗口而发现父窗口的任何部分</param>
/// <returns>该函数成功,则返回值为非零值</returns>
[DllImport("user32.dll", SetLastError = true)]
private static extern bool MoveWindow(IntPtr hwnd, int x, int y, int nWidth, int nHeight, bool bRepaint);
[DllImport("user32.dll")]
private static extern bool EnumWindows(WNDENUMPROC lpEnumFunc, int lParam);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, string lparam);
[DllImport("user32.dll", EntryPoint = "PostMessage")]
public static extern int PostMessage(IntPtr hwnd, int Msg, int wParam, int lParam);
[DllImport("user32.dll")]
public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
[DllImport("user32.dll")]
private static extern int GetWindowTextW(IntPtr hWnd, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpString, int nMaxCount);
[DllImport("user32.dll")]
private static extern int GetClassNameW(IntPtr hWnd, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpString, int nMaxCount);
private delegate bool WNDENUMPROC(IntPtr hWnd, int lParam);
//寻找系统的全部窗口
public static WindowInfo[] GetAllDesktopWindows()
{
List<WindowInfo> wndList = new List<WindowInfo>();
EnumWindows(delegate (IntPtr hWnd, int lParam)
{
WindowInfo wnd = new WindowInfo();
StringBuilder sb = new StringBuilder(256);
//get hwnd
wnd.hWnd = hWnd;
//get window name
GetWindowTextW(hWnd, sb, sb.Capacity);
wnd.szWindowName = sb.ToString();
//get window class
GetClassNameW(hWnd, sb, sb.Capacity);
wnd.szClassName = sb.ToString();
Console.WriteLine("Window handle=" + wnd.hWnd.ToString().PadRight(20) + " szClassName=" + wnd.szClassName.PadRight(20) + " szWindowName=" + wnd.szWindowName);
//add it into list
wndList.Add(wnd);
return true;
}, 0);
return wndList.ToArray();
}
public static IntPtr GetDesktopWindows(string windowName, StringComparison comparison = StringComparison.Ordinal)
{
WindowInfo[] allWindow = WindowUtil.GetAllDesktopWindows();
var wnd = allWindow.FirstOrDefault(s => s.szWindowName.Equals(windowName, comparison));
return wnd.hWnd;
}
}
public struct WindowInfo
{
public IntPtr hWnd;
public string szWindowName;
public string szClassName;
}
}
{"methodMap":"{\"L01\":\"{\\\"SamePercent\\\":80.0,\\\"MethodName\\\":\\\"L01\\\",\\\"FullTypeName\\\":\\\"AOI.AoiTemplateMethod\\\",\\\"PathDataStr\\\":\\\"{\\\\\\\"Points\\\\\\\":[{\\\\\\\"IsEmpty\\\\\\\":false,\\\\\\\"X\\\\\\\":317.0,\\\\\\\"Y\\\\\\\":483.666626},{\\\\\\\"IsEmpty\\\\\\\":false,\\\\\\\"X\\\\\\\":553.6666,\\\\\\\"Y\\\\\\\":483.666626},{\\\\\\\"IsEmpty\\\\\\\":false,\\\\\\\"X\\\\\\\":553.6666,\\\\\\\"Y\\\\\\\":593.666565},{\\\\\\\"IsEmpty\\\\\\\":false,\\\\\\\"X\\\\\\\":317.0,\\\\\\\"Y\\\\\\\":593.666565}],\\\\\\\"Types\\\\\\\":\\\\\\\"AAEBgQ==\\\\\\\"}\\\"}\"}"}
\ No newline at end of file
{"methodMap":"{\"R01\":\"{\\\"SamePercent\\\":80.0,\\\"MethodName\\\":\\\"R01\\\",\\\"FullTypeName\\\":\\\"AOI.AoiTemplateMethod\\\",\\\"PathDataStr\\\":\\\"{\\\\\\\"Points\\\\\\\":[{\\\\\\\"IsEmpty\\\\\\\":false,\\\\\\\"X\\\\\\\":1452.0,\\\\\\\"Y\\\\\\\":588.0},{\\\\\\\"IsEmpty\\\\\\\":false,\\\\\\\"X\\\\\\\":1692.0,\\\\\\\"Y\\\\\\\":588.0},{\\\\\\\"IsEmpty\\\\\\\":false,\\\\\\\"X\\\\\\\":1692.0,\\\\\\\"Y\\\\\\\":704.0},{\\\\\\\"IsEmpty\\\\\\\":false,\\\\\\\"X\\\\\\\":1452.0,\\\\\\\"Y\\\\\\\":704.0}],\\\\\\\"Types\\\\\\\":\\\\\\\"AAEBgQ==\\\\\\\"}\\\"}\"}"}
\ No newline at end of file
......@@ -38,6 +38,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="AOI">
<HintPath>..\XLRStoreClient\bin\Debug\AOI\AOI.dll</HintPath>
</Reference>
<Reference Include="Asa.RFID.HiStation">
<HintPath>..\..\dll\RFID\Asa.RFID.HiStation.dll</HintPath>
</Reference>
......@@ -81,6 +84,8 @@
</ItemGroup>
<ItemGroup>
<Compile Include="deviceLibrary\Msg.cs" />
<Compile Include="deviceLibrary\ReelCheckCamera.cs" />
<Compile Include="deviceLibrary\SignalMonitor.cs" />
<Compile Include="manager\agvClient\AgvClient.cs" />
<Compile Include="manager\agvClient\DoorInfo.cs" />
<Compile Include="manager\BufferDataManager.cs" />
......@@ -126,8 +131,11 @@
<Compile Include="manager\model\DeviceStep.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="WindowManager.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Config\A料口\AOI.bmp" />
<Content Include="Config\B料口\AOI.bmp" />
<Content Include="device_config.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
......@@ -219,6 +227,8 @@
<Content Include="Config\linePositions.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Config\A料口\AOI.data" />
<None Include="Config\B料口\AOI.data" />
<None Include="packages.config" />
<Content Include="SDK\MotorMaster.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
......
using Common;
using DeviceLibrary;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DeviceLibrary
{
public class WindowManager
{
public static List<WindInfo> windInfos = new List<WindInfo>();
public static bool NeedRefresh = false;
static string baseDir = Application.StartupPath + @"\Modules\";
public static void Start()
{
foreach (var item in windInfos)
{
try
{
if (ReelCheckCamera.CheckIPServiceAlive())
{
ReelCheckCamera.CloseIPService();
Thread.Sleep(3000);
}
item.ProcessInfo = ProcessUtil.StartProcess(item.Name, baseDir + $"{item.Name}\\", 60000);
}
catch (Exception ex)
{
LogUtil.error($"程序{item.Name}启动失败", ex);
}
}
NeedRefresh = true;
}
public static void Stop()
{
foreach (var item in windInfos)
{
try
{
ProcessUtil.CloseProcess(item.ProcessInfo);
if (ReelCheckCamera.CheckIPServiceAlive())
{
ReelCheckCamera.CloseIPService();
}
}
catch (Exception ex)
{
LogUtil.error($"程序{item.Name}关闭失败", ex);
}
}
NeedRefresh = true;
}
public static void InitShow()
{
foreach (var item in windInfos)
{
item.MoveWindowIsOk = WindowUtil.PutIntoForm(item.Parent, item.Name, out IntPtr intPtr);
item.WindowHandle = intPtr;
if (intPtr == IntPtr.Zero)
{
if (ReelCheckCamera.CheckIPServiceAlive())
{
ReelCheckCamera.CloseIPService();
}
}
}
}
public static void Show()
{
foreach (var item in windInfos)
{
item.Parent.Invoke(new Action(() =>
{
item.MoveWindowIsOk = WindowUtil.PutIntoForm(item.Parent, item.Name, out IntPtr intPtr);
item.WindowHandle = intPtr;
}));
}
}
}
public class WindInfo
{
public string Name { get; set; }
public IntPtr WindowHandle { get; set; }
public Panel Parent { get; set; }
public Process ProcessInfo { get; set; }
public bool MoveWindowIsOk { get; set; }
public const string IPCamera = "IPCamera";
}
}
using System;
using System.Diagnostics;
namespace OnlineStore.DeviceLibrary
{
public class SignalMonitor
{
private readonly Stopwatch _stopwatch;
private bool _lastSignalState;
private long _lastStateChangeTicks;
private long _lastOnDurationTicks;
private long _lastOffDurationTicks;
public SignalMonitor(bool initialSignalState = false)
{
_stopwatch = Stopwatch.StartNew();
_lastSignalState = initialSignalState;
_lastStateChangeTicks = _stopwatch.ElapsedTicks;
_lastOnDurationTicks = 0;
_lastOffDurationTicks = 0;
}
public void UpdateSignalState(bool currentSignalState)
{
if (currentSignalState == _lastSignalState)
return;
long currentTicks = _stopwatch.ElapsedTicks;
long durationTicks = currentTicks - _lastStateChangeTicks;
if (_lastSignalState)
{
_lastOnDurationTicks = durationTicks;
}
else
{
_lastOffDurationTicks = durationTicks;
}
_lastSignalState = currentSignalState;
_lastStateChangeTicks = currentTicks;
}
public TimeSpan GetCurrentOnDuration()
{
if (_lastSignalState)
{
long currentTicks = _stopwatch.ElapsedTicks;
return TicksToTimeSpan(currentTicks - _lastStateChangeTicks);
}
return TicksToTimeSpan(_lastOnDurationTicks);
}
public TimeSpan GetCurrentOffDuration()
{
if (!_lastSignalState)
{
long currentTicks = _stopwatch.ElapsedTicks;
return TicksToTimeSpan(currentTicks - _lastStateChangeTicks);
}
return TicksToTimeSpan(_lastOffDurationTicks);
}
private TimeSpan TicksToTimeSpan(long ticks)
{
return TimeSpan.FromTicks(ticks * TimeSpan.TicksPerSecond / Stopwatch.Frequency);
}
}
}
......@@ -107,7 +107,10 @@ namespace OnlineStore.DeviceLibrary
/// 料盘高
/// </summary>
public int PlateH { get; set; }
/// <summary>
/// 料盘总高
/// </summary>
public int PlateTotalH { get; set; }
/// <summary>
/// urgentReel: true 表示紧急料,
/// </summary>
......

using DeviceLibrary;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
......@@ -62,6 +63,15 @@ namespace OnlineStore.DeviceLibrary
Config.LoadIO(ioAdd);
MoveInfo = new DeviceMoveInfo(Name);
cames = ConfigHelper.Config.Get<string[]>($"{Name}_HeightCams");
lineInSigMonitor = new SignalMonitor(false);
}
DeviceLibrary.SignalMonitor lineInSigMonitor;
DateTime LineIn_Check_ONTime = DateTime.MaxValue;
//出料口线体料盘检测,true:有料盘
public bool CameraCheck(string deviceName, out string ngList)
{
return ReelCheckCamera.AOICheck(deviceName, $"AOI.data", Name, out ngList);
}
public void TimerProcess()
{
......@@ -70,7 +80,7 @@ namespace OnlineStore.DeviceLibrary
{
return;
}
lineInSigMonitor.UpdateSignalState(Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH));
if (!MoveStop)
{
if (MoveInfo.MoveType.Equals(MoveType.None))
......@@ -88,14 +98,19 @@ namespace OnlineStore.DeviceLibrary
}
else if (Robot.AutoInput && Robot.IOValue(Config.IO_LineIn_Check).Equals(IO_VALUE.HIGH))
{
ResetShelf = false;
LogUtil.debug($"{Name} 处理2");
StartInstore(new InOutParam());
if(lineInSigMonitor.GetCurrentOnDuration().TotalMilliseconds > 500)
{
ResetShelf = false;
LogUtil.debug($"{Name} 处理2");
WorkLog("前端信号亮,开始入库");
StartInstore(new InOutParam());
}
}
else if (Robot.AutoInput && Robot.IOValue(Config.IO_LineEnd_Check).Equals(IO_VALUE.HIGH))
{
if(!ResetShelf)
{
WorkLog("末端信号亮,开始入库");
LogUtil.debug($"{Name} 处理3");
StartInstore(new InOutParam());
}
......
......@@ -320,7 +320,9 @@ namespace OnlineStore.DeviceLibrary
{
width = 13;
}
LastHeight = GetHeight(width);
var height = GetHeight(width);
LastHeight = height.Item1;
LastTotalHeight = height.Item2;
}
else if (MoveInfo.IsStep(StepEnum.IB17_WaitReelLeave))
{
......@@ -565,13 +567,15 @@ namespace OnlineStore.DeviceLibrary
public int StartMovePosition = 0;
public int EndMovePosition = 0;
internal int LastHeight = 0;
internal int LastTotalHeight = 0;
string[] cames;
public int GetHeight(int width=7)
public (int, int) GetHeight(int width = 7)
{
CodeManager.CameraCheckHeight(cames?.ToList(), Name);
LogUtil.info($"{Name} 采集料盘抓走后的图片,开始计算高度");
int lastReelAddVal = ConfigHelper.Config.Get($"{Name}_lastReelSelfAddVal", 4);
LastHeight = 0;
LastTotalHeight = 0;
int AxisChangeValue = Robot.Config.Height_ChangeValue;
//计算高度
EndMovePosition = BatchAxis.GetAclPosition();
......@@ -583,15 +587,13 @@ namespace OnlineStore.DeviceLibrary
}
float height = (float)(1F * Math.Abs(EndMovePosition - StartMovePosition) / AxisChangeValue);//Math.Ceiling
string buchongStr = "";
if (isLast)
{
buchongStr = $"(最后一盘料)加{lastReelAddVal};";
height += lastReelAddVal;
}
LastTotalHeight = (int)Math.Ceiling(height);
//如果检测出<=15,都按照8计算
if (height <= 12)
{
......@@ -611,6 +613,7 @@ namespace OnlineStore.DeviceLibrary
if (width >= 13)
{
height = height - 2;
LastTotalHeight = LastTotalHeight - 2;
LogUtil.info($"检测为13寸高度-2={height}");
}
......@@ -631,11 +634,11 @@ namespace OnlineStore.DeviceLibrary
if (LastHeight <= 8) { LastHeight = 8; }
string code = CodeManager.ProcessCode(LastCodeList);
Thread.Sleep(500);
string msg = $"{Name} 上升前 [{StartMovePosition}]实时[{ EndMovePosition}]差值[{(EndMovePosition - StartMovePosition)}]" +
string msg = $"{Name} 上升前 [{StartMovePosition}]实时[{EndMovePosition}]差值[{(EndMovePosition - StartMovePosition)}]" +
$"系数[{AxisChangeValue}] 计算后{buchongStr}[{height}]条码【{code}】";
LogUtil.info(msg);
LogUtil.info($"{Name} 视觉计算的盘高结果:{height}mm,归类为{LastHeight}mm");
return LastHeight;
LogUtil.info($"{Name} 视觉计算的盘高结果:{height}mm,总厚度为{LastTotalHeight}mm,归类为{LastHeight}mm");
return (LastHeight, LastTotalHeight);
}
#endregion
......
......@@ -267,7 +267,22 @@ namespace OnlineStore.DeviceLibrary
{
width = 13;
}
if (ConfigHelper.Config.Get("IPCamera_EnableAOI", false))
{
var check13 = moveBean.CameraCheck(MoveInfo.Name, out string err);
if (check13)
{
width = 13;
MoveLog($"入库取料{shelf}{MoveInfo.SLog}: 检测到有料,认为13寸:{err}");
}
else
{
width = 7;
MoveLog($"入库取料{shelf}{MoveInfo.SLog}: 检测到无料,认为7寸:{err}");
}
}
MoveInfo.MoveParam.PosInfo.PlateH = Height;
MoveInfo.MoveParam.PosInfo.PlateTotalH = moveBean.LastTotalHeight;
MoveInfo.MoveParam.PosInfo.PlateW = width;
MoveLog($"入库取料{shelf}{MoveInfo.SLog}: 料盘尺寸{width}X{Height}");
......@@ -383,7 +398,6 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsStep(StepEnum.II47_MiddleToP1))
{
ClearTimeoutAlarm("扫码结束");
TimeSpan span = DateTime.Now - startInTime;
MoveLog($" 入料->A侧放料结束,更新A上暂存区物料{MoveInfo.MoveParam.PosInfo.ToStr()},耗时【{FormUtil.GetSpanStr(span)}】");
BufferDataManager.AInStoreInfo = MoveInfo.MoveParam.PosInfo;
......@@ -477,14 +491,13 @@ namespace OnlineStore.DeviceLibrary
//MoveLog($" 入料->B侧 {MoveInfo.SLog}: 旋转轴 到P1(待机点){Config.Middle_P1}");
//MiddleAxis.AbsMove(MoveInfo, Config.Middle_P1, Config.Middle_P1_Speed);
}
else if (MoveInfo.IsTimeOut(20))
else if (MoveInfo.IsTimeOut(30))
{
SetWarnMsg("等待" + BatchMove_B.Name + "扫码结束");
Msg.add("等待" + BatchMove_B.Name + "扫码结束", MsgLevel.warning);
}
}
else if (MoveInfo.IsStep(StepEnum.II67_MiddleToP1))
{
ClearTimeoutAlarm("扫码结束");
TimeSpan span = DateTime.Now - startInTime;
MoveLog($" 入料->B侧放料结束,更新B上暂存区物料{MoveInfo.MoveParam.PosInfo.ToStr()},耗时【{FormUtil.GetSpanStr(span)}】");
BufferDataManager.BInStoreInfo = MoveInfo.MoveParam.PosInfo;
......@@ -734,7 +747,7 @@ namespace OnlineStore.DeviceLibrary
}
//从服务器获取库位号
GetPosResult result = SServerManager.GetPosId(Name, codeList, pos.PlateH, pos.PlateW, pos.rfid, lastPosId);
GetPosResult result = SServerManager.GetPosId(Name, codeList, pos.PlateH, pos.PlateW, pos.rfid, lastPosId,pos.PlateTotalH);
LastResult = result.Result;
if (result.IsTimeOut)
{
......
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2BA382F5-D68E-4B03-B6E0-A75662B3938A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>ImgCheckReel</RootNamespace>
<AssemblyName>ImgCheckReel</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="ConfigHelper">
<HintPath>..\..\..\..\..\SharedRefDll\Neotel\ConfigHelper\Debug\net461\ConfigHelper.dll</HintPath>
</Reference>
<Reference Include="Cyotek.Windows.Forms.ImageBox">
<HintPath>.\Cyotek.Windows.Forms.ImageBox.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ImgCheckReel
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ImgCheckReel")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ImgCheckReel")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("2ba382f5-d68e-4b03-b6e0-a75662b3938a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ImgCheckReel.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ImgCheckReel.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ImgCheckReel.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
</packages>
\ No newline at end of file
using CodeLibrary;
using DeviceLibrary;
using log4net;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
......@@ -71,6 +72,7 @@ namespace OnlineStore.XLRStore
tabControl1.TabPages.Remove(tabPage1);
timer1.Start();
启用配置模式ToolStripMenuItem.Enabled = true;
WindowManager.Start();
}
private FrmInputEquip inputEquip = null;
private FrmBoxEquip box = null;
......@@ -302,6 +304,7 @@ namespace OnlineStore.XLRStore
{
Camera._cam.CloseAll();
}
WindowManager.Stop();
System.Environment.Exit(System.Environment.ExitCode);
}
catch (Exception ex)
......
......@@ -20,6 +20,9 @@
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.btnScan = new System.Windows.Forms.Button();
this.panel2 = new System.Windows.Forms.Panel();
this.lblCameraRes = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.LineStop_A = new System.Windows.Forms.Button();
this.LineBack_A = new System.Windows.Forms.Button();
......@@ -74,6 +77,9 @@
// panel2
//
this.panel2.AutoScroll = true;
this.panel2.Controls.Add(this.lblCameraRes);
this.panel2.Controls.Add(this.button2);
this.panel2.Controls.Add(this.button1);
this.panel2.Controls.Add(this.groupBox3);
this.panel2.Controls.Add(this.groupBox2);
this.panel2.Controls.Add(this.groupBox1);
......@@ -83,9 +89,38 @@
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(949, 506);
this.panel2.Size = new System.Drawing.Size(949, 718);
this.panel2.TabIndex = 324;
//
// lblCameraRes
//
this.lblCameraRes.AutoSize = true;
this.lblCameraRes.Location = new System.Drawing.Point(28, 611);
this.lblCameraRes.Name = "lblCameraRes";
this.lblCameraRes.Size = new System.Drawing.Size(43, 17);
this.lblCameraRes.TabIndex = 284;
this.lblCameraRes.Text = "label1";
//
// button2
//
this.button2.Location = new System.Drawing.Point(218, 545);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(139, 43);
this.button2.TabIndex = 283;
this.button2.Text = "重新加载AOI配置";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(28, 545);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(139, 43);
this.button1.TabIndex = 282;
this.button1.Text = "料盘检测";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.LineStop_A);
......@@ -309,9 +344,9 @@
this.chbMoveStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chbMoveStop.AutoSize = true;
this.chbMoveStop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbMoveStop.Location = new System.Drawing.Point(302, 86);
this.chbMoveStop.Location = new System.Drawing.Point(322, 86);
this.chbMoveStop.Name = "chbMoveStop";
this.chbMoveStop.Size = new System.Drawing.Size(104, 28);
this.chbMoveStop.Size = new System.Drawing.Size(84, 24);
this.chbMoveStop.TabIndex = 327;
this.chbMoveStop.Text = "暂停运动";
this.chbMoveStop.UseVisualStyleBackColor = true;
......@@ -350,9 +385,9 @@
this.chbDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chbDebug.AutoSize = true;
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(193, 86);
this.chbDebug.Location = new System.Drawing.Point(213, 86);
this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(104, 28);
this.chbDebug.Size = new System.Drawing.Size(84, 24);
this.chbDebug.TabIndex = 325;
this.chbDebug.Text = "调试状态";
this.chbDebug.UseVisualStyleBackColor = true;
......@@ -378,7 +413,7 @@
this.lblAgvInfo.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblAgvInfo.Location = new System.Drawing.Point(5, 62);
this.lblAgvInfo.Name = "lblAgvInfo";
this.lblAgvInfo.Size = new System.Drawing.Size(75, 20);
this.lblAgvInfo.Size = new System.Drawing.Size(61, 17);
this.lblAgvInfo.TabIndex = 282;
this.lblAgvInfo.Text = "AGV 状态";
//
......@@ -436,9 +471,9 @@
this.chbAutoOut.Checked = true;
this.chbAutoOut.CheckState = System.Windows.Forms.CheckState.Checked;
this.chbAutoOut.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbAutoOut.Location = new System.Drawing.Point(453, 510);
this.chbAutoOut.Location = new System.Drawing.Point(492, 510);
this.chbAutoOut.Name = "chbAutoOut";
this.chbAutoOut.Size = new System.Drawing.Size(212, 28);
this.chbAutoOut.Size = new System.Drawing.Size(168, 24);
this.chbAutoOut.TabIndex = 280;
this.chbAutoOut.Text = "入料完成自动开始出库";
this.chbAutoOut.UseVisualStyleBackColor = true;
......@@ -446,9 +481,9 @@
//
// FrmBatchMove
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(949, 506);
this.ClientSize = new System.Drawing.Size(949, 718);
this.Controls.Add(this.panel2);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
......@@ -501,6 +536,9 @@
protected System.Windows.Forms.Button btnResetShelf;
protected System.Windows.Forms.CheckBox chbMoveStop;
private useControl.AxisPointControl batchAxisP4;
private System.Windows.Forms.Label lblCameraRes;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
}
}
using System;
using DeviceLibrary;
using log4net;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;
using System.IO;
using System.Runtime.InteropServices;
using OnlineStore.DeviceLibrary;
using log4net;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using UserFromControl;
using OnlineStore.LoadCSVLibrary;
using OnlineStore.Common;
namespace OnlineStore.XLRStore
{
......@@ -174,63 +175,63 @@ namespace OnlineStore.XLRStore
moveBean.BatchAxis.SuddenStop();
}
private void BatchTimerPro()
{
if (moveBean.BatchAxis.IsBatchMove())
{
btnStartTest.Enabled = false;
if (moveBean.LastMoveIsTest)
{
ConfigMoveAxis moveAxis = moveBean.BatchAxis.Config;
bool countError = false;
bool isStop = false;
bool result = AxisManager.instance.AbsMoveIsEnd(moveAxis.DeviceName, moveAxis.GetAxisValue(), TargetP2, moveAxis.CanErrorCountMax, out countError);
if (result)
{
isStop = true;
LogUtil.info(moveBean.Name + "提升轴上料功能测试,发现提升轴已到达目标位置【" + TargetP2 + "】,停止上料测试 ");
}
else
{
bool axisMoveIsEnd = HuichuanLibrary.HCBoardManager.MoveIsEnd(moveBean.BatchAxis.Config.GetAxisValue());
if (axisMoveIsEnd)
{
isStop = true;
LogUtil.info(moveBean.Name + "提升轴上料功能测试,发现提升轴已停止运动,停止上料测试");
}
}
if (isStop)
{
StartTest = false;
moveBean.BatchAxis.AxisStopCheckMove();
btnStartTest.Enabled = true;
btnTestStop.Enabled = false;
int height = moveBean.GetHeight();
lblTestMsg.Text = "目标位置[" + TargetP2 + "] ,开始位置[" + moveBean.StartMovePosition + "],停止位置[" + moveBean.EndMovePosition + "],高度[" + height + "]mm";
}
else
{
btnTestStop.Enabled = true;
}
}
else
{
btnTestStop.Enabled = false;
}
}
else
{
if (StartTest)
{
StartTest = false;
int height = moveBean.GetHeight();
lblTestMsg.Text = "目标位置[" + TargetP2 + "] ,开始位置[" + moveBean.StartMovePosition + "],停止位置[" + moveBean.EndMovePosition + "],高度[" + height + "]mm";
}
btnStartTest.Enabled = true;
btnTestStop.Enabled = false;
}
}
//private void BatchTimerPro()
//{
// if (moveBean.BatchAxis.IsBatchMove())
// {
// btnStartTest.Enabled = false;
// if (moveBean.LastMoveIsTest)
// {
// ConfigMoveAxis moveAxis = moveBean.BatchAxis.Config;
// bool countError = false;
// bool isStop = false;
// bool result = AxisManager.instance.AbsMoveIsEnd(moveAxis.DeviceName, moveAxis.GetAxisValue(), TargetP2, moveAxis.CanErrorCountMax, out countError);
// if (result)
// {
// isStop = true;
// LogUtil.info(moveBean.Name + "提升轴上料功能测试,发现提升轴已到达目标位置【" + TargetP2 + "】,停止上料测试 ");
// }
// else
// {
// bool axisMoveIsEnd = HuichuanLibrary.HCBoardManager.MoveIsEnd(moveBean.BatchAxis.Config.GetAxisValue());
// if (axisMoveIsEnd)
// {
// isStop = true;
// LogUtil.info(moveBean.Name + "提升轴上料功能测试,发现提升轴已停止运动,停止上料测试");
// }
// }
// if (isStop)
// {
// StartTest = false;
// moveBean.BatchAxis.AxisStopCheckMove();
// btnStartTest.Enabled = true;
// btnTestStop.Enabled = false;
// int height = moveBean.GetHeight();
// lblTestMsg.Text = "目标位置[" + TargetP2 + "] ,开始位置[" + moveBean.StartMovePosition + "],停止位置[" + moveBean.EndMovePosition + "],高度[" + height + "]mm";
// }
// else
// {
// btnTestStop.Enabled = true;
// }
// }
// else
// {
// btnTestStop.Enabled = false;
// }
// }
// else
// {
// if (StartTest)
// {
// StartTest = false;
// int height = moveBean.GetHeight();
// lblTestMsg.Text = "目标位置[" + TargetP2 + "] ,开始位置[" + moveBean.StartMovePosition + "],停止位置[" + moveBean.EndMovePosition + "],高度[" + height + "]mm";
// }
// btnStartTest.Enabled = true;
// btnTestStop.Enabled = false;
// }
//}
private void chbAutoOut_CheckedChanged(object sender, EventArgs e)
{
......@@ -323,6 +324,20 @@ namespace OnlineStore.XLRStore
groupBox3.Visible = state;
chbAutoOut.Visible = state;
}
private void button1_Click(object sender, EventArgs e)
{
bool rtn = moveBean.CameraCheck("手动", out string res);
lblCameraRes.Invoke(new Action(() =>
{
lblCameraRes.Text = $"{(rtn ? "检测有料盘" : "检测无料盘")}\r\n{res}";
}));
}
private void button2_Click(object sender, EventArgs e)
{
ReelCheckCamera.ClearProject();
}
}
}
......
......@@ -76,9 +76,9 @@ namespace OnlineStore.XLRStore
//
this.tabPage3.Controls.Add(this.panBase);
this.tabPage3.Controls.Add(this.groupBox6);
this.tabPage3.Location = new System.Drawing.Point(4, 29);
this.tabPage3.Location = new System.Drawing.Point(4, 26);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(986, 558);
this.tabPage3.Size = new System.Drawing.Size(986, 561);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "状态信息";
this.tabPage3.UseVisualStyleBackColor = true;
......@@ -133,7 +133,7 @@ namespace OnlineStore.XLRStore
this.chbMoveStop.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbMoveStop.Location = new System.Drawing.Point(562, 11);
this.chbMoveStop.Name = "chbMoveStop";
this.chbMoveStop.Size = new System.Drawing.Size(104, 28);
this.chbMoveStop.Size = new System.Drawing.Size(84, 24);
this.chbMoveStop.TabIndex = 262;
this.chbMoveStop.Text = "暂停运动";
this.chbMoveStop.UseVisualStyleBackColor = true;
......@@ -157,7 +157,7 @@ namespace OnlineStore.XLRStore
this.chbDebug.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.chbDebug.Location = new System.Drawing.Point(465, 11);
this.chbDebug.Name = "chbDebug";
this.chbDebug.Size = new System.Drawing.Size(104, 28);
this.chbDebug.Size = new System.Drawing.Size(84, 24);
this.chbDebug.TabIndex = 247;
this.chbDebug.Text = "调试状态";
this.chbDebug.UseVisualStyleBackColor = true;
......@@ -172,7 +172,7 @@ namespace OnlineStore.XLRStore
this.lblStoreStatus.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblStoreStatus.Location = new System.Drawing.Point(664, 13);
this.lblStoreStatus.Name = "lblStoreStatus";
this.lblStoreStatus.Size = new System.Drawing.Size(82, 24);
this.lblStoreStatus.Size = new System.Drawing.Size(65, 20);
this.lblStoreStatus.TabIndex = 245;
this.lblStoreStatus.Text = "等待启动";
this.lblStoreStatus.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
......@@ -226,7 +226,7 @@ namespace OnlineStore.XLRStore
this.checkBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.checkBox1.Location = new System.Drawing.Point(10, 328);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(194, 28);
this.checkBox1.Size = new System.Drawing.Size(154, 24);
this.checkBox1.TabIndex = 291;
this.checkBox1.Text = "检测到料串自动入库";
this.checkBox1.UseVisualStyleBackColor = true;
......@@ -260,7 +260,7 @@ namespace OnlineStore.XLRStore
this.cmbOutstorePos.FormattingEnabled = true;
this.cmbOutstorePos.Location = new System.Drawing.Point(104, 70);
this.cmbOutstorePos.Name = "cmbOutstorePos";
this.cmbOutstorePos.Size = new System.Drawing.Size(142, 31);
this.cmbOutstorePos.Size = new System.Drawing.Size(142, 28);
this.cmbOutstorePos.TabIndex = 290;
//
// cmbInstorePos
......@@ -270,7 +270,7 @@ namespace OnlineStore.XLRStore
this.cmbInstorePos.FormattingEnabled = true;
this.cmbInstorePos.Location = new System.Drawing.Point(266, 28);
this.cmbInstorePos.Name = "cmbInstorePos";
this.cmbInstorePos.Size = new System.Drawing.Size(142, 31);
this.cmbInstorePos.Size = new System.Drawing.Size(142, 28);
this.cmbInstorePos.TabIndex = 289;
//
// btnOutStoreTest
......@@ -296,7 +296,7 @@ namespace OnlineStore.XLRStore
"B下暂存区"});
this.cmbOutStartP.Location = new System.Drawing.Point(9, 70);
this.cmbOutStartP.Name = "cmbOutStartP";
this.cmbOutStartP.Size = new System.Drawing.Size(90, 31);
this.cmbOutStartP.Size = new System.Drawing.Size(90, 28);
this.cmbOutStartP.TabIndex = 287;
this.cmbOutStartP.SelectedIndexChanged += new System.EventHandler(this.cmbOutShelf_SelectedIndexChanged);
//
......@@ -306,7 +306,7 @@ namespace OnlineStore.XLRStore
this.label2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(251, 74);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(39, 24);
this.label2.Size = new System.Drawing.Size(31, 20);
this.label2.TabIndex = 286;
this.label2.Text = "-->";
//
......@@ -320,7 +320,7 @@ namespace OnlineStore.XLRStore
"B料口"});
this.cmbOutShelf.Location = new System.Drawing.Point(287, 70);
this.cmbOutShelf.Name = "cmbOutShelf";
this.cmbOutShelf.Size = new System.Drawing.Size(121, 31);
this.cmbOutShelf.Size = new System.Drawing.Size(121, 28);
this.cmbOutShelf.TabIndex = 285;
//
// BtnInStoreTest
......@@ -346,7 +346,7 @@ namespace OnlineStore.XLRStore
"B上暂存区"});
this.cmbInstoreTargetP.Location = new System.Drawing.Point(171, 28);
this.cmbInstoreTargetP.Name = "cmbInstoreTargetP";
this.cmbInstoreTargetP.Size = new System.Drawing.Size(90, 31);
this.cmbInstoreTargetP.Size = new System.Drawing.Size(90, 28);
this.cmbInstoreTargetP.TabIndex = 2;
this.cmbInstoreTargetP.SelectedIndexChanged += new System.EventHandler(this.cmbInstoreTargetP_SelectedIndexChanged);
//
......@@ -356,7 +356,7 @@ namespace OnlineStore.XLRStore
this.label1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(135, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(39, 24);
this.label1.Size = new System.Drawing.Size(31, 20);
this.label1.TabIndex = 1;
this.label1.Text = "-->";
//
......@@ -370,7 +370,7 @@ namespace OnlineStore.XLRStore
"B料口"});
this.cmbInstoreShelf.Location = new System.Drawing.Point(9, 28);
this.cmbInstoreShelf.Name = "cmbInstoreShelf";
this.cmbInstoreShelf.Size = new System.Drawing.Size(121, 31);
this.cmbInstoreShelf.Size = new System.Drawing.Size(121, 28);
this.cmbInstoreShelf.TabIndex = 0;
//
// lblwidth
......@@ -392,7 +392,7 @@ namespace OnlineStore.XLRStore
this.lblMoveInfo.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblMoveInfo.Location = new System.Drawing.Point(8, 109);
this.lblMoveInfo.Name = "lblMoveInfo";
this.lblMoveInfo.Size = new System.Drawing.Size(73, 20);
this.lblMoveInfo.Size = new System.Drawing.Size(59, 17);
this.lblMoveInfo.TabIndex = 278;
this.lblMoveInfo.Text = "运动信息:";
//
......@@ -425,7 +425,7 @@ namespace OnlineStore.XLRStore
//
// FrmInputEquip
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1000, 596);
this.Controls.Add(this.tabControl1);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!