Commit 999549ba 张东亮

存储机构-添加抓手检测功能-手动

1 个父辈 c7f1deb8
正在显示 30 个修改的文件 包含 1000 行增加54 行删除
...@@ -34,6 +34,7 @@ namespace OnlineStore.Common ...@@ -34,6 +34,7 @@ namespace OnlineStore.Common
public static string ConfigPath_BoxPosition = "ConfigPath_BoxPosition"; public static string ConfigPath_BoxPosition = "ConfigPath_BoxPosition";
public static string ConfigPath_DrawerPosition = "ConfigPath_DrawerPosition"; public static string ConfigPath_DrawerPosition = "ConfigPath_DrawerPosition";
public static string CloseCamDetect = "CloseCamDetect"; public static string CloseCamDetect = "CloseCamDetect";
public static string ConfigPath_PosDebugInfo = "ConfigPath_PosDebugInfo";
/// <summary> /// <summary>
/// 需要识别的二维码类型,多个中间使用#分割 /// 需要识别的二维码类型,多个中间使用#分割
/// </summary> /// </summary>
......
...@@ -267,6 +267,9 @@ namespace OnlineStore.Common ...@@ -267,6 +267,9 @@ namespace OnlineStore.Common
/// 上次入库的库位号 /// 上次入库的库位号
/// </summary> /// </summary>
public static string lastPosId = "lastPosId"; public static string lastPosId = "lastPosId";
/// <summary>
/// 执行时间
/// </summary>
public static string executeTime = "executeTime ";
} }
} }
...@@ -35,6 +35,17 @@ PRO,0,抽屉列数,Drawer_Columns,6,,,,,,,,,,,, ...@@ -35,6 +35,17 @@ PRO,0,抽屉列数,Drawer_Columns,6,,,,,,,,,,,,
PRO,0,抽屉内行数,Rows_In_Drawer,4,,,,,,,,,,,, PRO,0,抽屉内行数,Rows_In_Drawer,4,,,,,,,,,,,,
PRO,0,抽屉内列数,Cols_In_Drawer,20,,,,,,,,,,,, PRO,0,抽屉内列数,Cols_In_Drawer,20,,,,,,,,,,,,
,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,
PRO,0,行走机构视觉对位速度,MoveAxis_FindPosSpeed,20,,,,,,,,,,,,
PRO,0,行走机构正极限位置,MoveAxis_PosLimit,20,,,,,,,,,,,,
PRO,0,行走机构负极限位置,MoveAxis_NegLimit,20,,,,,,,,,,,,
PRO,0,升降轴视觉对位速度,UpdownAxis_FindPosSpeed,20,,,,,,,,,,,,
PRO,0,升降轴正极限位置,UpdownAxis_PosLimit,20,,,,,,,,,,,,
PRO,0,升降轴负极限位置,UpdownAxis_NegLimit,20,,,,,,,,,,,,
PRO,0,拉取升降轴视觉对位速度,PullAxis_Updown_FindPosSpeed,20,,,,,,,,,,,,
PRO,0,拉取升降轴正极限位置,PullAxis_Updown_PosLimit,20,,,,,,,,,,,,
PRO,0,拉取升降轴负极限位置,PullAxis_Updown_NegLimit,20,,,,,,,,,,,,
PRO,0,抓手检测得分阈值,TongsDetectThreshold,20,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,0,行走机构_待机点P1,MoveAxis_P1,80000,,,,,,,,,,,, PRO,0,行走机构_待机点P1,MoveAxis_P1,80000,,,,,,,,,,,,
PRO,0,行走机构_进出料机构取放点P2,MoveAxis_P2,-18000,,,,,,,,,,,, PRO,0,行走机构_进出料机构取放点P2,MoveAxis_P2,-18000,,,,,,,,,,,,
PRO,0,行走机构_安全位置,MoveAxis_SafePos,80000,,,,,,,,,,,, PRO,0,行走机构_安全位置,MoveAxis_SafePos,80000,,,,,,,,,,,,
......
...@@ -86,15 +86,19 @@ ...@@ -86,15 +86,19 @@
<Compile Include="manager\StoreManager.cs" /> <Compile Include="manager\StoreManager.cs" />
<Compile Include="deviceLibrary\RFID\RFIDManagercs.cs" /> <Compile Include="deviceLibrary\RFID\RFIDManagercs.cs" />
<Compile Include="manager\SServerManager.cs" /> <Compile Include="manager\SServerManager.cs" />
<Compile Include="storeBean\boxBean\BoxEqiup_Tongs.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_Camera.cs" /> <Compile Include="storeBean\boxBean\BoxEquip_Camera.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_ConnectServerTimer.cs" /> <Compile Include="storeBean\boxBean\BoxEquip_ConnectServerTimer.cs" />
<Compile Include="storeBean\boxBean\AutoInoutInfo.cs" /> <Compile Include="storeBean\boxBean\AutoInoutInfo.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_InExecute.cs" /> <Compile Include="storeBean\boxBean\BoxEquip_InExecute.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_OutExecute.cs" /> <Compile Include="storeBean\boxBean\BoxEquip_OutExecute.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_AutoFindPos.cs" /> <Compile Include="storeBean\boxBean\BoxEquip_AutoFindPos.cs" />
<Compile Include="storeBean\boxBean\BoxEquip_PosDebug.cs" />
<Compile Include="storeBean\boxBean\EyemLibDemo.cs" /> <Compile Include="storeBean\boxBean\EyemLibDemo.cs" />
<Compile Include="storeBean\boxBean\Humiture\HumitureBean.cs" /> <Compile Include="storeBean\boxBean\Humiture\HumitureBean.cs" />
<Compile Include="storeBean\boxBean\Humiture\HumitureController.cs" /> <Compile Include="storeBean\boxBean\Humiture\HumitureController.cs" />
<Compile Include="storeBean\boxBean\positionDebug\PositionDebugManager.cs" />
<Compile Include="storeBean\boxBean\positionDebug\PositionDebugResult.cs" />
<Compile Include="storeBean\inputBean\BatchMoveBean.cs" /> <Compile Include="storeBean\inputBean\BatchMoveBean.cs" />
<Compile Include="storeBean\inputBean\BatchMoveBean_Partial.cs" /> <Compile Include="storeBean\inputBean\BatchMoveBean_Partial.cs" />
<Compile Include="storeBean\EquipBase.cs" /> <Compile Include="storeBean\EquipBase.cs" />
......
...@@ -459,6 +459,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -459,6 +459,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
SA_03_Pos_AcqImg, SA_03_Pos_AcqImg,
/// <summary> /// <summary>
/// 存储机构自动对位:获取Mark(正向)
/// </summary>
SA_03_Pos_GetMark,
/// <summary>
/// 存储机构自动对位:对位(正向) /// 存储机构自动对位:对位(正向)
/// </summary> /// </summary>
SA_04_Pos_AdjPos, SA_04_Pos_AdjPos,
...@@ -479,6 +483,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -479,6 +483,10 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
SA_08_Neg_AcqImg, SA_08_Neg_AcqImg,
/// <summary> /// <summary>
/// 存储机构自动对位:获取mark(反向)
/// </summary>
SA_08_Neg_GetMark,
/// <summary>
/// 存储机构自动对位:对位(反向) /// 存储机构自动对位:对位(反向)
/// </summary> /// </summary>
SA_09_Neg_AdjPos, SA_09_Neg_AdjPos,
......
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public partial class BoxEquip
{
/// <summary>
/// 图像信息
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct EyemImage
{
/// <summary>
/// 地址
/// </summary>
public IntPtr ucpImage;
/// <summary>
/// 图像内存 x 方向大小
/// </summary>
public int iWidth;
/// <summary>
/// 图像内存 y 方向大小
/// </summary>
public int iHeight;
/// <summary>
/// iDepth:
/// uint8_t 取值范围[0, 255], iDepth = 0(常用,解码图像一般为此种格式)
/// int8_t 取值范围[-128, 127], iDepth = 1
/// uint16_t 取值范围[0, 56635], iDepth = 2(常用,点料机图像一般为此种格式)
/// int16_t 取值范围[-32768, 32767], iDepth = 3
/// int32_t 取值范围[-2147483648, 2147483647], iDepth = 4
/// float_t 取值范围[-3.4028235E38, 3.4028235E38], iDepth = 5
/// double_t 取值范围[-1.7E-308, 1.7E+308], iDepth = 6
/// </summary>
public int iDepth;
/// <summary>
/// 彩色图 iChannels=3或4(比RGB多了Alpha通道),一般为3
/// 灰度图 iChannels = 1
/// </summary>
public int iChannels; // 图像通道数
}
[DllImport("libresnet.dll", CharSet = CharSet.None)]
unsafe internal static extern int match_feature(string output_path, EyemImage tpImage, char* partnumber, bool is_enroll, out float score);
[DllImport("libresnet.dll", CharSet = CharSet.None, CallingConvention = CallingConvention.Cdecl)]
internal static extern int enroll_feature(string input_path, string output_path);
string input_path = "./Tongs/test_huanhong";
string output_path = "./Tongs/feature/";
string temp_path = "./Tongs/temp/";
//学习范围
Rectangle rectangle = new Rectangle(564, 953, 379, 107);
/// <summary>
/// 匹配抓手外观类型
/// </summary>
/// <param name="filename">x光图像文件名</param>
/// <param name="pn">返回标识</param>
/// <returns>匹配分值 -1:匹配失败 >=0:匹配成功</returns>
unsafe float match(string filename, out string pn, out Bitmap bitmap)
{
Directory.CreateDirectory(input_path);
Directory.CreateDirectory(output_path);
Directory.CreateDirectory(temp_path);
bitmap = null;
pn = "";
Bitmap a = new Bitmap(filename);
Bitmap b = new Bitmap(224, 224, PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(b);
g.DrawImage(a, new Rectangle(0, 0, 224, 224), rectangle, GraphicsUnit.Pixel);
g.Save();
EyemImage eyemImage1 = new EyemImage();
eyemImage1.iWidth = 224;
eyemImage1.iHeight = 224;
eyemImage1.iChannels = 4;
eyemImage1.iDepth = 0;
BitmapData bitmapData = b.LockBits(new Rectangle(0, 0, 224, 224), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
eyemImage1.ucpImage = bitmapData.Scan0;
char* p = (char*)Marshal.AllocHGlobal(100);
match_feature(output_path, eyemImage1, (char*)p, false, out float score);
b.UnlockBits(bitmapData);
pn = Marshal.PtrToStringAnsi((IntPtr)p);
Marshal.FreeHGlobal((IntPtr)p);
bitmap = b;
score = score * 100;
return score;
}
public bool MatchAndSaveImg(Bitmap bitmap,string imgname)
{
var score = match(bitmap, out string pn, out Bitmap bitmap1);
var pnpath = Path.Combine(temp_path, score > Config.TongsDetectThreshold ? "OK" : "NG");
Directory.CreateDirectory(pnpath);
var simpletemp = Path.Combine(pnpath, $"{imgname}-{score.ToString("##.##")}-{pn}.png");
bitmap.Save(simpletemp, ImageFormat.Png);
bitmap.Dispose();
return false;
}
/// <summary>
/// 匹配抓手外观类型
/// </summary>
/// <param name="filename">x光图像文件名</param>
/// <param name="pn">返回标识</param>
/// <returns>匹配分值 -1:匹配失败 >=0:匹配成功</returns>
public unsafe float match(Bitmap inputImg, out string pn, out Bitmap bitmap)
{
Directory.CreateDirectory(input_path);
Directory.CreateDirectory(output_path);
Directory.CreateDirectory(temp_path);
bitmap = null;
pn = "";
Bitmap b = new Bitmap(224, 224, PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(b);
g.DrawImage(inputImg, new Rectangle(0, 0, 224, 224), rectangle, GraphicsUnit.Pixel);
g.Save();
EyemImage eyemImage1 = new EyemImage();
eyemImage1.iWidth = 224;
eyemImage1.iHeight = 224;
eyemImage1.iChannels = 4;
eyemImage1.iDepth = 0;
BitmapData bitmapData = b.LockBits(new Rectangle(0, 0, 224, 224), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
eyemImage1.ucpImage = bitmapData.Scan0;
char* p = (char*)Marshal.AllocHGlobal(100);
match_feature(output_path, eyemImage1, (char*)p, false, out float score);
b.UnlockBits(bitmapData);
pn = Marshal.PtrToStringAnsi((IntPtr)p);
Marshal.FreeHGlobal((IntPtr)p);
bitmap = b;
score = score * 100;
return score;
}
/// <summary>
/// 学习抓手外观
/// </summary>
/// <param name="filename">x光图像</param>
/// <param name="pn">标识符</param>
public unsafe void learn(string filename, string pn)
{
Directory.CreateDirectory(input_path);
Directory.CreateDirectory(output_path);
Directory.CreateDirectory(temp_path);
Bitmap a = new Bitmap(filename);
Bitmap b = new Bitmap(224, 224, PixelFormat.Format32bppRgb);
Graphics g = Graphics.FromImage(b);
g.DrawImage(a, new Rectangle(0, 0, 224, 224), rectangle, GraphicsUnit.Pixel);
g.Save();
EyemImage eyemImage1 = new EyemImage();
eyemImage1.iWidth = 224;
eyemImage1.iHeight = 224;
eyemImage1.iChannels = 3;
eyemImage1.iDepth = 0;
BitmapData bitmapData = b.LockBits(new Rectangle(0, 0, 224, 224), ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb);
eyemImage1.ucpImage = bitmapData.Scan0;
char* p = (char*)Marshal.StringToHGlobalAnsi(pn).ToPointer();
match_feature(output_path, eyemImage1, (char*)p, true, out _);
b.UnlockBits(bitmapData);
b.Dispose();
}
/// <summary>
/// 学习抓手外观
/// </summary>
/// <param name="filename">x光图像</param>
/// <param name="pn">标识符</param>
public unsafe void learn(Bitmap inputimg, string pn)
{
Directory.CreateDirectory(input_path);
Directory.CreateDirectory(output_path);
Directory.CreateDirectory(temp_path);
Bitmap b = new Bitmap(224, 224, PixelFormat.Format32bppRgb);
Graphics g = Graphics.FromImage(b);
g.DrawImage(inputimg, new Rectangle(0, 0, 224, 224), rectangle, GraphicsUnit.Pixel);
g.Save();
EyemImage eyemImage1 = new EyemImage();
eyemImage1.iWidth = 224;
eyemImage1.iHeight = 224;
eyemImage1.iChannels = 3;
eyemImage1.iDepth = 0;
BitmapData bitmapData = b.LockBits(new Rectangle(0, 0, 224, 224), ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb);
eyemImage1.ucpImage = bitmapData.Scan0;
char* p = (char*)Marshal.StringToHGlobalAnsi(pn).ToPointer();
match_feature(output_path, eyemImage1, (char*)p, true, out _);
b.UnlockBits(bitmapData);
b.Dispose();
}
}
}
...@@ -68,6 +68,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -68,6 +68,7 @@ namespace OnlineStore.DeviceLibrary
//温湿度 //温湿度
public HumitureBean humBean = null; public HumitureBean humBean = null;
public string lastPosId = ""; public string lastPosId = "";
public string executeTime = "";
public DeviceStatus deviceStatus = DeviceStatus.ResetMove; public DeviceStatus deviceStatus = DeviceStatus.ResetMove;
public string CID = ""; public string CID = "";
/// <summary> /// <summary>
...@@ -740,6 +741,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -740,6 +741,10 @@ namespace OnlineStore.DeviceLibrary
{ {
AutoFindPosProcess(); AutoFindPosProcess();
} }
else if(isInitPosDebugInfo)
{
PosDebugProcess();
}
BusyMoveProcess(); BusyMoveProcess();
IOTimeOutProcess(); IOTimeOutProcess();
if (NoErrorAlarm()) if (NoErrorAlarm())
......
...@@ -64,22 +64,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -64,22 +64,22 @@ namespace OnlineStore.DeviceLibrary
{ {
camera_event?.Invoke(new CameraArgs(name, bmp)); camera_event?.Invoke(new CameraArgs(name, bmp));
} }
if (MoveInfo != null) //if (MoveInfo != null)
{ //{
if (MoveInfo.MoveType.Equals(MoveType.InStore) || MoveInfo.MoveType.Equals(MoveType.OutStore)) // if (MoveInfo.MoveType.Equals(MoveType.InStore) || MoveInfo.MoveType.Equals(MoveType.OutStore))
{ // {
if (CheckASide() && name.Equals("box_A")) // if (CheckASide() && name.Equals("box_A"))
{ // {
SaveImage(name); // SaveImage(name);
} // }
else // else
{ // {
SaveImage("box_B"); // SaveImage("box_B");
} // }
} // }
} //}
Thread.Sleep(500); Thread.Sleep(300);
} }
} }
void StopCamera() void StopCamera()
...@@ -93,9 +93,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -93,9 +93,10 @@ namespace OnlineStore.DeviceLibrary
Bitmap bitmap = camera.GetImage(camName); Bitmap bitmap = camera.GetImage(camName);
return bitmap; return bitmap;
} }
string imgPath = ConfigAppSettings.GetValue(Setting_Init.ImagePath);
public void SaveImage(string camName) public void SaveImage(string camName)
{ {
string path = Application.StartupPath + ConfigAppSettings.GetValue(Setting_Init.ImagePath) + camName + "\\" + DateTime.Now.ToString("yyyyMMdd"); string path = Application.StartupPath + imgPath + camName + "\\" + DateTime.Now.ToString("yyyyMMdd");
if (AutoSaveImage) if (AutoSaveImage)
{ {
if (!System.IO.Directory.Exists(path)) if (!System.IO.Directory.Exists(path))
......
...@@ -103,10 +103,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -103,10 +103,12 @@ namespace OnlineStore.DeviceLibrary
else if (runStatus.Equals(DeviceStatus.OutStoreBoxEnd) || runStatus.Equals(DeviceStatus.InStoreEnd)) else if (runStatus.Equals(DeviceStatus.OutStoreBoxEnd) || runStatus.Equals(DeviceStatus.InStoreEnd))
{ {
boxStatus.data.Add(ParamDefine.posId, lastPosId); boxStatus.data.Add(ParamDefine.posId, lastPosId);
boxStatus.data.Add(ParamDefine.executeTime, executeTime);
} }
else if (!lastPosId.Equals("")) else if (!lastPosId.Equals(""))
{ {
boxStatus.data.Add(ParamDefine.posId, lastPosId); boxStatus.data.Add(ParamDefine.posId, lastPosId);
boxStatus.data.Add(ParamDefine.executeTime,executeTime);
boxStatus.status = (int)deviceStatus; boxStatus.status = (int)deviceStatus;
if (lastPosId != "") if (lastPosId != "")
{ {
......
...@@ -275,46 +275,55 @@ namespace OnlineStore.DeviceLibrary ...@@ -275,46 +275,55 @@ namespace OnlineStore.DeviceLibrary
case StepEnum.SI_09_ToTray: case StepEnum.SI_09_ToTray:
MoveInfo.NextMoveStep(StepEnum.SI_10_LiftTray); MoveInfo.NextMoveStep(StepEnum.SI_10_LiftTray);
LogInfo($"入库 {MoveInfo.SLog}:提升抽屉,料斗拉取升降轴到料屉提取高点P3[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:提升抽屉,料斗拉取升降轴到料屉提取高点P3[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
SaveSpecifiedImage();
PullAxis_UpdownToHighP3(); PullAxis_UpdownToHighP3();
break; break;
case StepEnum.SI_10_LiftTray: case StepEnum.SI_10_LiftTray:
MoveInfo.NextMoveStep(StepEnum.SI_11_PullTray); MoveInfo.NextMoveStep(StepEnum.SI_11_PullTray);
LogInfo($"入库 {MoveInfo.SLog}:拉抽屉到库位点,料斗拉取进出轴到料屉库位点P3/P5[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:拉抽屉到库位点,料斗拉取进出轴到料屉库位点P3/P5[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_P3_P5(); PullAxis_Inout_To_P3_P5();
SaveSpecifiedImage();
break; break;
case StepEnum.SI_11_PullTray: case StepEnum.SI_11_PullTray:
MoveInfo.NextMoveStep(StepEnum.SI_12_DropTrayToPos); MoveInfo.NextMoveStep(StepEnum.SI_12_DropTrayToPos);
LogInfo($"入库 {MoveInfo.SLog}:将抽屉降到库位提取点,料斗拉取升降轴到P2料屉提取水平点P2,到位后检测{trayRows[GetPosRow()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:将抽屉降到库位提取点,料斗拉取升降轴到P2料屉提取水平点P2,到位后检测{trayRows[GetPosRow()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_UpdownToMiddleP2(); PullAxis_UpdownToMiddleP2();
SaveSpecifiedImage();
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayRows[GetPosRow()], IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayRows[GetPosRow()], IO_VALUE.HIGH));
break; break;
case StepEnum.SI_12_DropTrayToPos: case StepEnum.SI_12_DropTrayToPos:
MoveInfo.NextMoveStep(StepEnum.SI_13_GetReel); MoveInfo.NextMoveStep(StepEnum.SI_13_GetReel);
LogInfo($"入库 {MoveInfo.SLog}:进入库位中,移栽升降轴到料屉取放点P7/P13[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:进入库位中,移栽升降轴到料屉取放点P7/P13[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
UpdownAxisToP7_P13(); UpdownAxisToP7_P13();
SaveSpecifiedImage();
break; break;
case StepEnum.SI_13_GetReel: case StepEnum.SI_13_GetReel:
MoveInfo.NextMoveStep(StepEnum.SI_14_ReleaseCompress); MoveInfo.NextMoveStep(StepEnum.SI_14_ReleaseCompress);
LogInfo($"入库 {MoveInfo.SLog}:压紧轴开始缓慢释放,移栽压紧轴到压紧前点P2[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:压紧轴开始缓慢释放,移栽压紧轴到压紧前点P2[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
ComAxis_To_P2(); ComAxis_To_P2();
SaveSpecifiedImage();
break; break;
case StepEnum.SI_14_ReleaseCompress: case StepEnum.SI_14_ReleaseCompress:
MoveInfo.NextMoveStep(StepEnum.SI_15_UpDownBack); MoveInfo.NextMoveStep(StepEnum.SI_15_UpDownBack);
LogInfo($"入库 {MoveInfo.SLog}:叉子从库位返回,[{MoveInfo.MoveParam.PosInfo.ToStr()}]入库完成,移栽升降轴到料屉上方过度点P6/P12[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:叉子从库位返回,[{MoveInfo.MoveParam.PosInfo.ToStr()}]入库完成,移栽升降轴到料屉上方过度点P6/P12[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
//入库完成 //入库完成
SetBoxStatus(DeviceStatus.InStoreEnd, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId); SetBoxStatus(DeviceStatus.InStoreEnd, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId);
executeTime = (DateTime.Now - startTime).TotalSeconds.ToString("f2");
UpdownAxisTo_P6_P12(); UpdownAxisTo_P6_P12();
SaveSpecifiedImage();
break; break;
case StepEnum.SI_15_UpDownBack: case StepEnum.SI_15_UpDownBack:
MoveInfo.NextMoveStep(StepEnum.SI_16_LiftTray); MoveInfo.NextMoveStep(StepEnum.SI_16_LiftTray);
LogInfo($"入库 {MoveInfo.SLog}:提升抽屉,料斗拉取升降轴到料屉提取高点P3[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:提升抽屉,料斗拉取升降轴到料屉提取高点P3[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_UpdownToHighP3(); PullAxis_UpdownToHighP3();
SaveSpecifiedImage();
break; break;
case StepEnum.SI_16_LiftTray: case StepEnum.SI_16_LiftTray:
//MoveInfo.NextMoveStep(StepEnum.SI_17_PushTray); //MoveInfo.NextMoveStep(StepEnum.SI_17_PushTray);
MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayMiddle); MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayMiddle);
LogInfo($"入库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_P2_P4(); PullAxis_Inout_To_P2_P4();
SaveSpecifiedImage();
break; break;
//case StepEnum.SI_17_PushTray: //case StepEnum.SI_17_PushTray:
// MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayMiddle); // MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayMiddle);
...@@ -336,6 +345,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -336,6 +345,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayDown); MoveInfo.NextMoveStep(StepEnum.SI_18_PutTrayDown);
//LogInfo($"入库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); //LogInfo($"入库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_UpdownToLowP4(); PullAxis_UpdownToLowP4();
SaveSpecifiedImage();
if (CheckASide()) if (CheckASide())
{ {
LogInfo($"入库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4,同时检测{trayAColumns[GetPosColumn()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4,同时检测{trayAColumns[GetPosColumn()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
...@@ -353,9 +363,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -353,9 +363,10 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.SI_19_InoutBack); MoveInfo.NextMoveStep(StepEnum.SI_19_InoutBack);
LogInfo($"入库 {MoveInfo.SLog}:料斗拉取进出轴到拍照点[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"入库 {MoveInfo.SLog}:料斗拉取进出轴到拍照点[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_Cam(); PullAxis_Inout_To_Cam();
SaveSpecifiedImage();
break; break;
case StepEnum.SI_19_InoutBack: case StepEnum.SI_19_InoutBack:
SaveSpecifiedImage();
if (!CheckInStoreOtherSideInfo()) if (!CheckInStoreOtherSideInfo())
{ {
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing); SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
......
...@@ -75,37 +75,44 @@ namespace OnlineStore.DeviceLibrary ...@@ -75,37 +75,44 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.SO_04_LiftTray); MoveInfo.NextMoveStep(StepEnum.SO_04_LiftTray);
LogInfo($"出库 {MoveInfo.SLog}:提升抽屉,料斗拉取升降轴到料屉提取高点P3[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:提升抽屉,料斗拉取升降轴到料屉提取高点P3[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_UpdownToHighP3(); PullAxis_UpdownToHighP3();
SaveSpecifiedImage();
break; break;
case StepEnum.SO_04_LiftTray: case StepEnum.SO_04_LiftTray:
MoveInfo.NextMoveStep(StepEnum.SO_05_PullTray); MoveInfo.NextMoveStep(StepEnum.SO_05_PullTray);
LogInfo($"出库 {MoveInfo.SLog}:拉抽屉到库位点,料斗拉取进出轴到料屉库位点P3/P5[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:拉抽屉到库位点,料斗拉取进出轴到料屉库位点P3/P5[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_P3_P5(); PullAxis_Inout_To_P3_P5();
SaveSpecifiedImage();
break; break;
case StepEnum.SO_05_PullTray: case StepEnum.SO_05_PullTray:
MoveInfo.NextMoveStep(StepEnum.SO_06_DropTrayToPos); MoveInfo.NextMoveStep(StepEnum.SO_06_DropTrayToPos);
LogInfo($"出库 {MoveInfo.SLog}:将抽屉降到库位提取点,料斗拉取升降轴到P2料屉提取水平点P2,到位后检测{trayRows[GetPosRow()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:将抽屉降到库位提取点,料斗拉取升降轴到P2料屉提取水平点P2,到位后检测{trayRows[GetPosRow()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_UpdownToMiddleP2(); PullAxis_UpdownToMiddleP2();
SaveSpecifiedImage();
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayRows[GetPosRow()], IO_VALUE.HIGH)); MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(trayRows[GetPosRow()], IO_VALUE.HIGH));
break; break;
case StepEnum.SO_06_DropTrayToPos: case StepEnum.SO_06_DropTrayToPos:
MoveInfo.NextMoveStep(StepEnum.SO_07_GetReel); MoveInfo.NextMoveStep(StepEnum.SO_07_GetReel);
LogInfo($"出库 {MoveInfo.SLog}:进入库位中,移栽升降轴到料屉取放点P7/P13[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:进入库位中,移栽升降轴到料屉取放点P7/P13[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
UpdownAxisToP7_P13(); UpdownAxisToP7_P13();
SaveSpecifiedImage();
break; break;
case StepEnum.SO_07_GetReel: case StepEnum.SO_07_GetReel:
MoveInfo.NextMoveStep(StepEnum.SO_08_StartCompress); MoveInfo.NextMoveStep(StepEnum.SO_08_StartCompress);
LogInfo($"出库 {MoveInfo.SLog}:压紧轴开始缓慢夹取,移栽压紧轴到压紧点P3[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:压紧轴开始缓慢夹取,移栽压紧轴到压紧点P3[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
ComAxis_To_P3(); ComAxis_To_P3();
SaveSpecifiedImage();
break; break;
case StepEnum.SO_08_StartCompress: case StepEnum.SO_08_StartCompress:
MoveInfo.NextMoveStep(StepEnum.SO_09_UpDownBack); MoveInfo.NextMoveStep(StepEnum.SO_09_UpDownBack);
LogInfo($"出库 {MoveInfo.SLog}:叉子从库位返回,移栽升降轴到料屉上方过度点P6/P12[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:叉子从库位返回,移栽升降轴到料屉上方过度点P6/P12[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
UpdownAxisTo_P6_P12(); UpdownAxisTo_P6_P12();
SaveSpecifiedImage();
break; break;
case StepEnum.SO_09_UpDownBack: case StepEnum.SO_09_UpDownBack:
MoveInfo.NextMoveStep(StepEnum.SO_10_LiftTray); MoveInfo.NextMoveStep(StepEnum.SO_10_LiftTray);
LogInfo($"出库 {MoveInfo.SLog}:提升抽屉,料斗拉取升降轴到料屉提取高点P3[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:提升抽屉,料斗拉取升降轴到料屉提取高点P3[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_UpdownToHighP3(); PullAxis_UpdownToHighP3();
SaveSpecifiedImage();
break; break;
case StepEnum.SO_10_LiftTray: case StepEnum.SO_10_LiftTray:
//MoveInfo.NextMoveStep(StepEnum.SO_11_PushTray); //MoveInfo.NextMoveStep(StepEnum.SO_11_PushTray);
...@@ -114,6 +121,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -114,6 +121,7 @@ namespace OnlineStore.DeviceLibrary
PullAxis_Inout_To_P2_P4(); PullAxis_Inout_To_P2_P4();
MiddleAxis_To_P2(); MiddleAxis_To_P2();
XAxis_To_P1(); XAxis_To_P1();
SaveSpecifiedImage();
break; break;
//case StepEnum.SO_11_PushTray: //case StepEnum.SO_11_PushTray:
// MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayMiddle); // MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayMiddle);
...@@ -135,6 +143,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -135,6 +143,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayDown); MoveInfo.NextMoveStep(StepEnum.SO_12_PutTrayDown);
//LogInfo($"出库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); //LogInfo($"出库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_UpdownToLowP4(); PullAxis_UpdownToLowP4();
SaveSpecifiedImage();
if (CheckASide()) if (CheckASide())
{ {
LogInfo($"出库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4,同时检测{trayAColumns[GetPosColumn()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:放下料屉,料斗拉取升降轴到料屉提取低点P4,同时检测{trayAColumns[GetPosColumn()]}=1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
...@@ -152,6 +161,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -152,6 +161,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.SO_13_InoutBack); MoveInfo.NextMoveStep(StepEnum.SO_13_InoutBack);
LogInfo($"出库 {MoveInfo.SLog}:料斗拉取进出轴到拍照点[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:料斗拉取进出轴到拍照点[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
PullAxis_Inout_To_Cam(); PullAxis_Inout_To_Cam();
SaveSpecifiedImage();
break; break;
case StepEnum.SO_13_InoutBack: case StepEnum.SO_13_InoutBack:
//检查另一面是否有出库任务 //检查另一面是否有出库任务
...@@ -235,6 +245,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -235,6 +245,7 @@ namespace OnlineStore.DeviceLibrary
case StepEnum.SO_17_InOutToBuff: case StepEnum.SO_17_InOutToBuff:
MoveInfo.NextMoveStep(StepEnum.SO_18_PutReel); MoveInfo.NextMoveStep(StepEnum.SO_18_PutReel);
LogInfo($"出库 {MoveInfo.SLog}:放料盘,移栽升降轴到下暂存区放料低点P5/P11,移栽压紧轴到压紧前点P2"); LogInfo($"出库 {MoveInfo.SLog}:放料盘,移栽升降轴到下暂存区放料低点P5/P11,移栽压紧轴到压紧前点P2");
executeTime = (DateTime.Now - startTime).TotalSeconds.ToString("f2");
SetBoxStatus(DeviceStatus.OutStoreBoxEnd, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId); SetBoxStatus(DeviceStatus.OutStoreBoxEnd, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId);
UpdownAxisTo_P5_P11(); UpdownAxisTo_P5_P11();
ComAxis_To_P2(); ComAxis_To_P2();
......
...@@ -943,6 +943,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -943,6 +943,16 @@ namespace OnlineStore.DeviceLibrary
OutstoreExecute(); OutstoreExecute();
} }
#endregion #endregion
private void SaveSpecifiedImage()
{
if (CheckASide())
{
SaveImage("box_A");
}
else
{
SaveImage("box_B");
}
}
} }
} }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
partial class BoxEquip
{
public bool isInitPosDebugInfo = false;
public void InitPosDebugInfo()
{
PosDebugResultManager.Init(PositionNumList);
isInitPosDebugInfo = PosDebugResultManager.isInit;
}
public void PosDebugProcess()
{
if (MoveInfo.IsInWait)
{
CheckWait(MoveInfo);
}
if (MoveInfo.IsInWait)
{
return;
}
}
}
public class PosDebugInfo
{
public string PosSide { get; set; }
public int StartDrawerRow { get; set; }
public int StartDrawerCol { get; set; }
public int StartRowInDrawer { get; set; }
public int StartColInDrawer { get; set; }
public int EndDrawerRow { get; set; }
public int EndDrawerCol { get; set; }
public int EndRowInDrawer { get; set; }
public int EndColInDrawer { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class PosDebugResultManager
{
public static List<PosDebugResult> posResultList;
public static bool isInit = false;
static string filePath = Common.ConfigAppSettings.GetValue(Common.Setting_Init.ConfigPath_PosDebugInfo);
public static void Init(List<string> posNumList)
{
if (!System.IO.File.Exists(filePath))
{
posResultList = new List<PosDebugResult>();
foreach (var item in posNumList)
{
posResultList.Add(new PosDebugResult() { Name = item });
}
}
else
{
string txt = System.IO.File.ReadAllText(filePath);
posResultList = Common.JsonHelper.DeserializeJsonToList<PosDebugResult>(txt);
}
isInit = true;
}
public static int GetResult(string name)
{
if (!isInit)
return -1;
PosDebugResult debugResult = posResultList.Find(s => s.Name.Equals(name));
return debugResult.ResCode;
}
public static void SetResult(string name,int code)
{
if (!isInit)
return;
PosDebugResult debugResult = posResultList.Find(s => s.Name.Equals(name));
debugResult.ResCode = code;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class PosDebugResult
{
/// <summary>
/// 位置名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 调试结果:-1表示未运行过,0表示NG,1表示OK
/// </summary>
public int ResCode { get; set; } = -1;
}
}
...@@ -85,34 +85,38 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -85,34 +85,38 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary> /// <summary>
/// 把数据写入csv中 /// 把数据写入csv中
/// </summary> /// </summary>
protected static bool WriteCSVFile(string filePath, string[] lines) protected static bool WriteCSVFile(string filePath, string[] lines,bool isbackup=true)
{ {
try try
{ {
//备份保存 if(isbackup)
try
{ {
FileInfo file = new FileInfo(filePath); //备份保存
string date = DateTime.Now.ToString("yyyy-MM-dd"); try
string targetBackPath = @"C:\configBack\" + date + @"\";
if (!Directory.Exists(targetBackPath))
{ {
Directory.CreateDirectory(targetBackPath); FileInfo file = new FileInfo(filePath);
string date = DateTime.Now.ToString("yyyy-MM-dd");
string targetBackPath = @"C:\configBack\" + date + @"\";
if (!Directory.Exists(targetBackPath))
{
Directory.CreateDirectory(targetBackPath);
}
string fileName = file.Name;
string backFile = targetBackPath + fileName;
if (File.Exists(backFile))
{
File.Delete(backFile);
}
File.Copy(filePath, backFile, true);
// File.WriteAllLines(backFile, lines, Encoding.UTF8);
} }
string fileName = file.Name; catch (Exception e)
string backFile = targetBackPath + fileName;
if (File.Exists(backFile))
{ {
File.Delete(backFile); LogUtil.error("出错:", e);
} }
File.Copy(filePath, backFile, true );
// File.WriteAllLines(backFile, lines, Encoding.UTF8);
}
catch (Exception e)
{
LogUtil.error("出错:", e);
} }
if (File.Exists(filePath)) if (File.Exists(filePath))
{ {
File.Delete(filePath); File.Delete(filePath);
......
...@@ -149,7 +149,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -149,7 +149,7 @@ namespace OnlineStore.LoadCSVLibrary
} }
} }
public static bool SavePostion(string filePath, T position) public static bool SavePostion(string filePath, T position,bool isbackup=true)
{ {
Type type = typeof(T); Type type = typeof(T);
...@@ -189,7 +189,7 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -189,7 +189,7 @@ namespace OnlineStore.LoadCSVLibrary
allPositionMap.Add(position.PositionNum, position); allPositionMap.Add(position.PositionNum, position);
string newValue = PostionToString(position, titleIndex, proTitleMap); string newValue = PostionToString(position, titleIndex, proTitleMap);
lines[index] = newValue; lines[index] = newValue;
return WriteCSVFile(filePath, lines); return WriteCSVFile(filePath, lines, isbackup);
} }
} }
} }
......
...@@ -191,8 +191,57 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -191,8 +191,57 @@ namespace OnlineStore.LoadCSVLibrary
[ConfigProAttribute("Cols_In_Drawer")] [ConfigProAttribute("Cols_In_Drawer")]
public int Cols_In_Drawer { get; set; } public int Cols_In_Drawer { get; set; }
/// <summary>
/// 行走机构视觉对位速度
/// </summary>
[ConfigProAttribute("MoveAxis_FindPosSpeed")]
public int MoveAxis_FindPosSpeed { get; set; }
/// <summary>
/// 行走机构正极限位置
/// </summary>
[ConfigProAttribute("MoveAxis_PosLimit")]
public int MoveAxis_PosLimit { get; set; }
/// <summary>
/// 行走机构负极限位置
/// </summary>
[ConfigProAttribute("MoveAxis_NegLimit")]
public int MoveAxis_NegLimit { get; set; }
/// <summary>
/// 升降轴视觉对位速度
/// </summary>
[ConfigProAttribute("UpdownAxis_FindPosSpeed")]
public int UpdownAxis_FindPosSpeed { get; set; }
/// <summary>
/// 升降轴正极限位置
/// </summary>
[ConfigProAttribute("UpdownAxis_PosLimit")]
public int UpdownAxis_PosLimit { get; set; }
/// <summary>
/// 升降轴负极限位置
/// </summary>
[ConfigProAttribute("UpdownAxis_NegLimit")]
public int UpdownAxis_NegLimit { get; set; }
/// <summary>
/// 拉取升降轴视觉对位速度
/// </summary>
[ConfigProAttribute("PullAxis_Updown_FindPosSpeed")]
public int PullAxis_Updown_FindPosSpeed { get; set; }
/// <summary>
/// 拉取升降轴正极限位置
/// </summary>
[ConfigProAttribute("PullAxis_Updown_PosLimit")]
public int PullAxis_Updown_PosLimit { get; set; }
/// <summary>
/// 拉取升降轴负极限位置
/// </summary>
[ConfigProAttribute("PullAxis_Updown_NegLimit")]
public int PullAxis_Updown_NegLimit { get; set; }
/// <summary>
/// 抓手检测得分阈值
/// </summary>
[ConfigProAttribute("TongsDetectThreshold")]
public float TongsDetectThreshold { get; set; }
/// <summary> /// <summary>
/// PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,0,,,,,,,,,,,, /// PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,0,,,,,,,,,,,,
/// </summary> /// </summary>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<add key="ConfigPath_BoxPosition" value="\Config\linePositions.csv" /> <add key="ConfigPath_BoxPosition" value="\Config\linePositions.csv" />
<add key="ConfigPath_DrawerPosition" value="\Config\DrawerPosition.csv" /> <add key="ConfigPath_DrawerPosition" value="\Config\DrawerPosition.csv" />
<add key="ConfigPath_TrayList" value="\LineConfig\TrayList.data" /> <add key="ConfigPath_TrayList" value="\LineConfig\TrayList.data" />
<add key="ConfigPath_PosDebugInfo" value="\Config\PosDebugInfo.json" />
<add key="ImagePath" value="\Images\" /> <add key="ImagePath" value="\Images\" />
<add key="Line_CID" value="05" /> <add key="Line_CID" value="05" />
<!--end one store config--> <!--end one store config-->
......
...@@ -103,6 +103,18 @@ ...@@ -103,6 +103,18 @@
<Compile Include="boxForm\FrmAxisMove.Designer.cs"> <Compile Include="boxForm\FrmAxisMove.Designer.cs">
<DependentUpon>FrmAxisMove.cs</DependentUpon> <DependentUpon>FrmAxisMove.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="boxForm\FrmTongsLearn.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="boxForm\FrmTongsLearn.Designer.cs">
<DependentUpon>FrmTongsLearn.cs</DependentUpon>
</Compile>
<Compile Include="boxForm\userControl\UCStatusPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="boxForm\userControl\UCStatusPanel.Designer.cs">
<DependentUpon>UCStatusPanel.cs</DependentUpon>
</Compile>
<Compile Include="FrmBase.cs"> <Compile Include="FrmBase.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -196,6 +208,12 @@ ...@@ -196,6 +208,12 @@
<EmbeddedResource Include="boxForm\FrmAxisMove.resx"> <EmbeddedResource Include="boxForm\FrmAxisMove.resx">
<DependentUpon>FrmAxisMove.cs</DependentUpon> <DependentUpon>FrmAxisMove.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="boxForm\FrmTongsLearn.resx">
<DependentUpon>FrmTongsLearn.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="boxForm\userControl\UCStatusPanel.resx">
<DependentUpon>UCStatusPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmBase.resx"> <EmbeddedResource Include="FrmBase.resx">
<DependentUpon>FrmBase.cs</DependentUpon> <DependentUpon>FrmBase.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
this.txtStartCol.Name = "txtStartCol"; this.txtStartCol.Name = "txtStartCol";
this.txtStartCol.Size = new System.Drawing.Size(100, 23); this.txtStartCol.Size = new System.Drawing.Size(100, 23);
this.txtStartCol.TabIndex = 22; this.txtStartCol.TabIndex = 22;
this.txtStartCol.Text = "1"; this.txtStartCol.Text = "2";
this.txtStartCol.TextChanged += new System.EventHandler(this.txtChanged); this.txtStartCol.TextChanged += new System.EventHandler(this.txtChanged);
// //
// txtCoffX // txtCoffX
...@@ -486,7 +486,7 @@ ...@@ -486,7 +486,7 @@
this.tabPage2.Location = new System.Drawing.Point(4, 26); this.tabPage2.Location = new System.Drawing.Point(4, 26);
this.tabPage2.Name = "tabPage2"; this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3); this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(786, 214); this.tabPage2.Size = new System.Drawing.Size(786, 314);
this.tabPage2.TabIndex = 1; this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "配置对位抽屉模板[相机在中间位置]"; this.tabPage2.Text = "配置对位抽屉模板[相机在中间位置]";
this.tabPage2.UseVisualStyleBackColor = true; this.tabPage2.UseVisualStyleBackColor = true;
...@@ -521,6 +521,7 @@ ...@@ -521,6 +521,7 @@
this.btnPullUpdwnToPos1.TabIndex = 17; this.btnPullUpdwnToPos1.TabIndex = 17;
this.btnPullUpdwnToPos1.Text = "抽屉升降轴到位"; this.btnPullUpdwnToPos1.Text = "抽屉升降轴到位";
this.btnPullUpdwnToPos1.UseVisualStyleBackColor = true; this.btnPullUpdwnToPos1.UseVisualStyleBackColor = true;
this.btnPullUpdwnToPos1.Click += new System.EventHandler(this.btnPullUpdwnToPos1_Click);
// //
// btnMoveAxisToPos1 // btnMoveAxisToPos1
// //
...@@ -530,6 +531,7 @@ ...@@ -530,6 +531,7 @@
this.btnMoveAxisToPos1.TabIndex = 16; this.btnMoveAxisToPos1.TabIndex = 16;
this.btnMoveAxisToPos1.Text = "行走机构到位"; this.btnMoveAxisToPos1.Text = "行走机构到位";
this.btnMoveAxisToPos1.UseVisualStyleBackColor = true; this.btnMoveAxisToPos1.UseVisualStyleBackColor = true;
this.btnMoveAxisToPos1.Click += new System.EventHandler(this.btnMoveAxisToPos1_Click);
// //
// btnUndwnToPos1 // btnUndwnToPos1
// //
...@@ -539,6 +541,7 @@ ...@@ -539,6 +541,7 @@
this.btnUndwnToPos1.TabIndex = 15; this.btnUndwnToPos1.TabIndex = 15;
this.btnUndwnToPos1.Text = "移栽升降轴到位"; this.btnUndwnToPos1.Text = "移栽升降轴到位";
this.btnUndwnToPos1.UseVisualStyleBackColor = true; this.btnUndwnToPos1.UseVisualStyleBackColor = true;
this.btnUndwnToPos1.Click += new System.EventHandler(this.btnUndwnToPos1_Click);
// //
// btnInoutToPosition1 // btnInoutToPosition1
// //
...@@ -548,6 +551,7 @@ ...@@ -548,6 +551,7 @@
this.btnInoutToPosition1.TabIndex = 14; this.btnInoutToPosition1.TabIndex = 14;
this.btnInoutToPosition1.Text = "进出轴到位"; this.btnInoutToPosition1.Text = "进出轴到位";
this.btnInoutToPosition1.UseVisualStyleBackColor = true; this.btnInoutToPosition1.UseVisualStyleBackColor = true;
this.btnInoutToPosition1.Click += new System.EventHandler(this.btnInoutToPosition1_Click);
// //
// label17 // label17
// //
...@@ -642,7 +646,7 @@ ...@@ -642,7 +646,7 @@
this.tabPage3.Controls.Add(this.pictureBox2); this.tabPage3.Controls.Add(this.pictureBox2);
this.tabPage3.Location = new System.Drawing.Point(4, 26); this.tabPage3.Location = new System.Drawing.Point(4, 26);
this.tabPage3.Name = "tabPage3"; this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(786, 214); this.tabPage3.Size = new System.Drawing.Size(786, 314);
this.tabPage3.TabIndex = 4; this.tabPage3.TabIndex = 4;
this.tabPage3.Text = "配置验证抽屉模板[相机在两边位置]"; this.tabPage3.Text = "配置验证抽屉模板[相机在两边位置]";
this.tabPage3.UseVisualStyleBackColor = true; this.tabPage3.UseVisualStyleBackColor = true;
...@@ -677,6 +681,7 @@ ...@@ -677,6 +681,7 @@
this.button1.TabIndex = 17; this.button1.TabIndex = 17;
this.button1.Text = "抽屉升降轴到位"; this.button1.Text = "抽屉升降轴到位";
this.button1.UseVisualStyleBackColor = true; this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.btnPullUpdwnToPos1_Click);
// //
// button2 // button2
// //
...@@ -686,6 +691,7 @@ ...@@ -686,6 +691,7 @@
this.button2.TabIndex = 16; this.button2.TabIndex = 16;
this.button2.Text = "行走机构到位"; this.button2.Text = "行走机构到位";
this.button2.UseVisualStyleBackColor = true; this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.btnMoveAxisToPos1_Click);
// //
// button3 // button3
// //
...@@ -695,6 +701,7 @@ ...@@ -695,6 +701,7 @@
this.button3.TabIndex = 15; this.button3.TabIndex = 15;
this.button3.Text = "移栽升降轴到位"; this.button3.Text = "移栽升降轴到位";
this.button3.UseVisualStyleBackColor = true; this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.btnUndwnToPos1_Click);
// //
// button4 // button4
// //
...@@ -704,6 +711,7 @@ ...@@ -704,6 +711,7 @@
this.button4.TabIndex = 14; this.button4.TabIndex = 14;
this.button4.Text = "进出轴到位"; this.button4.Text = "进出轴到位";
this.button4.UseVisualStyleBackColor = true; this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
// //
// label3 // label3
// //
...@@ -802,7 +810,7 @@ ...@@ -802,7 +810,7 @@
this.tabPage4.Controls.Add(this.btnStartVision); this.tabPage4.Controls.Add(this.btnStartVision);
this.tabPage4.Location = new System.Drawing.Point(4, 26); this.tabPage4.Location = new System.Drawing.Point(4, 26);
this.tabPage4.Name = "tabPage4"; this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(786, 214); this.tabPage4.Size = new System.Drawing.Size(786, 314);
this.tabPage4.TabIndex = 3; this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "视觉对位"; this.tabPage4.Text = "视觉对位";
this.tabPage4.UseVisualStyleBackColor = true; this.tabPage4.UseVisualStyleBackColor = true;
......
...@@ -45,14 +45,16 @@ namespace OnlineStore.XLRStore ...@@ -45,14 +45,16 @@ namespace OnlineStore.XLRStore
boxEquip.Config.Column_Spacing = int.Parse(txtColumnSpacing.Text); boxEquip.Config.Column_Spacing = int.Parse(txtColumnSpacing.Text);
boxEquip.Config.Row_Spacing = int.Parse(txtRowSpacing.Text); boxEquip.Config.Row_Spacing = int.Parse(txtRowSpacing.Text);
boxEquip.Config.FindPos_Drawer_X_Error = int.Parse(txtMark_X_err.Text); boxEquip.Config.FindPos_Drawer_X_Error = float.Parse(txtMark_X_err.Text);
boxEquip.Config.FindPos_Drawer_Y_Error = int.Parse(txtMark_Y_err.Text); boxEquip.Config.FindPos_Drawer_Y_Error = float.Parse(txtMark_Y_err.Text);
boxEquip.Config.Validate_Drawer_X_Error = int.Parse(txtMarkX_err_Validate.Text); boxEquip.Config.Validate_Drawer_X_Error = float.Parse(txtMarkX_err_Validate.Text);
boxEquip.Config.Validate_Drawer_Y_Error = int.Parse(txtMarkY_err_Validate.Text); boxEquip.Config.Validate_Drawer_Y_Error = float.Parse(txtMarkY_err_Validate.Text);
boxEquip.autoFindPos.XCoeffOfCoorToPulse = float.Parse(txtCoffX.Text);
boxEquip.autoFindPos.YCoeffOfCoorToPulse = float.Parse(txtCoofY.Text);
if (posSide.Equals("AA")) if (posSide.Equals("AA"))
{ {
boxEquip.Config.PixelToPulse_A_X = int.Parse(txtCoffX.Text); boxEquip.Config.PixelToPulse_A_X = float.Parse(txtCoffX.Text);
boxEquip.Config.PixelToPulse_A_Y = int.Parse(txtCoofY.Text); boxEquip.Config.PixelToPulse_A_Y = float.Parse(txtCoofY.Text);
boxEquip.Config.FindPos_Drawer_A_X = float.Parse(txtMark_X.Text); boxEquip.Config.FindPos_Drawer_A_X = float.Parse(txtMark_X.Text);
boxEquip.Config.FindPos_Drawer_A_Y = float.Parse(txtMark_Y.Text); boxEquip.Config.FindPos_Drawer_A_Y = float.Parse(txtMark_Y.Text);
boxEquip.Config.Validate_Drawer_A_X = float.Parse(txtMarkX_Validate.Text); boxEquip.Config.Validate_Drawer_A_X = float.Parse(txtMarkX_Validate.Text);
...@@ -60,8 +62,8 @@ namespace OnlineStore.XLRStore ...@@ -60,8 +62,8 @@ namespace OnlineStore.XLRStore
} }
else else
{ {
boxEquip.Config.PixelToPulse_B_X = int.Parse(txtCoffX.Text); boxEquip.Config.PixelToPulse_B_X = float.Parse(txtCoffX.Text);
boxEquip.Config.PixelToPulse_B_Y = int.Parse(txtCoofY.Text); boxEquip.Config.PixelToPulse_B_Y = float.Parse(txtCoofY.Text);
boxEquip.Config.FindPos_Drawer_B_X = float.Parse(txtMark_X.Text); boxEquip.Config.FindPos_Drawer_B_X = float.Parse(txtMark_X.Text);
boxEquip.Config.FindPos_Drawer_B_Y = float.Parse(txtMark_Y.Text); boxEquip.Config.FindPos_Drawer_B_Y = float.Parse(txtMark_Y.Text);
boxEquip.Config.Validate_Drawer_B_X = float.Parse(txtMarkX_Validate.Text); boxEquip.Config.Validate_Drawer_B_X = float.Parse(txtMarkX_Validate.Text);
...@@ -184,7 +186,13 @@ namespace OnlineStore.XLRStore ...@@ -184,7 +186,13 @@ namespace OnlineStore.XLRStore
private void button12_Click(object sender, EventArgs e) private void button12_Click(object sender, EventArgs e)
{ {
boxEquip.FindPosEnd(); if (listBox1.Items.Count > 0)
listBox1.Items.Clear();
foreach (string item in boxEquip.autoFindPos.FailedDrawers)
{
listBox1.Items.Add(item);
}
boxEquip.FindPosEnd();
btnPauseVision.Enabled = false; btnPauseVision.Enabled = false;
btnStopVision.Enabled = false; btnStopVision.Enabled = false;
} }
...@@ -389,9 +397,48 @@ namespace OnlineStore.XLRStore ...@@ -389,9 +397,48 @@ namespace OnlineStore.XLRStore
} }
} }
private void btnSaveMarkInfo2_Click(object sender, EventArgs e) private void btnInoutToPosition1_Click(object sender, EventArgs e)
{ {
boxEquip.PullAxis_Inout.AbsMove(null, boxEquip.Config.PullAxis_Inout_P1, boxEquip.Config.PullAxis_Inout_P1_Speed);
}
private void button4_Click(object sender, EventArgs e)
{
if(posSide.Equals("AA"))
{
boxEquip.PullAxis_Inout.AbsMove(null, boxEquip.Config.PullAxis_Inout_CamA, boxEquip.Config.PullAxis_Inout_P1_Speed);
}
else
{
boxEquip.PullAxis_Inout.AbsMove(null, boxEquip.Config.PullAxis_Inout_CamB, boxEquip.Config.PullAxis_Inout_P1_Speed);
}
}
private void btnMoveAxisToPos1_Click(object sender, EventArgs e)
{
StringBuilder head2 = new StringBuilder(boxEquip.CID + posSide + txtCurRow.Text.PadLeft(2, '0') + txtCurCol.Text.PadLeft(2, '0'));
head2.Append("0101");
LineMoveP lineMoveP = new LineMoveP();
lineMoveP.UpdatePosById(head2.ToString());
boxEquip.MoveAxis.AbsMove(null, lineMoveP.MoveAxis_P3, boxEquip.Config.MoveAxis_FindPosSpeed);
}
private void btnUndwnToPos1_Click(object sender, EventArgs e)
{
StringBuilder head2 = new StringBuilder(boxEquip.CID + posSide + txtCurRow.Text.PadLeft(2, '0') + txtCurCol.Text.PadLeft(2, '0'));
head2.Append("0101");
LineMoveP lineMoveP = new LineMoveP();
lineMoveP.UpdatePosById(head2.ToString());
boxEquip.UpdownAxis.AbsMove(null, lineMoveP.Updown_P6_P12, boxEquip.Config.UpdownAxis_FindPosSpeed);
}
private void btnPullUpdwnToPos1_Click(object sender, EventArgs e)
{
StringBuilder head2 = new StringBuilder(boxEquip.CID + posSide + txtCurRow.Text.PadLeft(2, '0') + txtCurCol.Text.PadLeft(2, '0'));
head2.Append("0101");
LineMoveP lineMoveP = new LineMoveP();
lineMoveP.UpdatePosById(head2.ToString());
boxEquip.PullAxis_Updown.AbsMove(null, lineMoveP.PullAxis_Updown_P4, boxEquip.Config.PullAxis_Updown_FindPosSpeed);
} }
} }
} }
...@@ -43,6 +43,8 @@ namespace OnlineStore.XLRStore ...@@ -43,6 +43,8 @@ namespace OnlineStore.XLRStore
chbDebug.Checked = boxBean.IsDebug; chbDebug.Checked = boxBean.IsDebug;
FrmAutoFindPos frmAutoFindPos = new FrmAutoFindPos(); FrmAutoFindPos frmAutoFindPos = new FrmAutoFindPos();
AddForm(tabControl1, " 视觉对位 ", frmAutoFindPos); AddForm(tabControl1, " 视觉对位 ", frmAutoFindPos);
FrmTongsLearn learn = new FrmTongsLearn();
AddForm(tabControl1, " 抓手图片训练 ", learn);
boxBean.camera_event += BoxBean_camera_event; boxBean.camera_event += BoxBean_camera_event;
IsLoad = true; IsLoad = true;
} }
......
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.XLRStore
{
public partial class FrmTongsLearn : Form
{
public FrmTongsLearn()
{
InitializeComponent();
boxEquip = StoreManager.XLRStore.boxEquip;
txtScoreThreshold.Text = boxEquip.Config.TongsDetectThreshold.ToString();
}
Bitmap srcBitmap = null;
BoxEquip boxEquip;
string camName = "box_A";
private void btnSelect_Click(object sender, EventArgs e)
{
OpenFileDialog fileDialog = new OpenFileDialog();
fileDialog.InitialDirectory = Application.StartupPath+Common.ConfigAppSettings.GetValue(Common.Setting_Init.ImagePath);
fileDialog.Filter = "图片|*.bmp";
fileDialog.RestoreDirectory = true;
if(fileDialog.ShowDialog()==DialogResult.OK)
{
txtImagePath.Text = System.IO.Path.GetFullPath(fileDialog.FileName);
srcBitmap = new Bitmap(txtImagePath.Text);
picSrc.Image = srcBitmap;
}
}
private void btnAcquire_Click(object sender, EventArgs e)
{
srcBitmap = boxEquip.AcqImage(camName);
picSrc.Image = srcBitmap;
}
private void SideCheckedChanged(object sender, EventArgs e)
{
if(rdoAside.Checked)
{
camName = "box_A";
}
else if(rdoBside.Checked)
{
camName = "box_B";
}
}
private void btnSave_Click(object sender, EventArgs e)
{
boxEquip.Config.TongsDetectThreshold = float.Parse(txtScoreThreshold.Text);
StoreManager.SaveBoxConfig(boxEquip.Config);
}
private void btnMatch_Click(object sender, EventArgs e)
{
if(srcBitmap !=null)
{
float score= boxEquip.match(srcBitmap, out string pn, out Bitmap bitmap);
picResult.Image = bitmap;
updateResult(score);
}
}
private void updateResult(float score)
{
lblResult.Text = score.ToString("f2");
if (score<boxEquip.Config.TongsDetectThreshold)
{
lblResult.BackColor = Color.Red;
}
else
{
lblResult.BackColor = Color.GreenYellow;
}
}
private void btnLearn_Click(object sender, EventArgs e)
{
if (srcBitmap != null)
boxEquip.learn(srcBitmap, Guid.NewGuid().ToString());
}
private void btnSelectPatch_Click(object sender, EventArgs e)
{
FolderBrowserDialog folderDialog = new FolderBrowserDialog();
folderDialog.Description = "请选择需要训练图像的路径";
if (folderDialog.ShowDialog() == DialogResult.OK)
{
txtImagePath.Text = folderDialog.SelectedPath+@"\";
string[] files = System.IO.Directory.GetFiles(txtImagePath.Text);
lblResult.Text = "开始学习...";
System.Threading.Tasks.Task task = System.Threading.Tasks.Task.Factory.StartNew(delegate {
foreach (var item in files)
{
boxEquip.learn(item, Guid.NewGuid().ToString());
}
});
task.Wait();
lblResult.Text = "学习完成";
lblResult.BackColor = Color.AliceBlue;
}
}
}
}
<?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 \ No newline at end of file

namespace OnlineStore.XLRStore.boxForm.userControl
{
partial class UCStatusPanel
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.lblStatus = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// lblStatus
//
this.lblStatus.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblStatus.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblStatus.Location = new System.Drawing.Point(0, 0);
this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new System.Drawing.Size(150, 38);
this.lblStatus.TabIndex = 0;
this.lblStatus.Text = "05BB01010101";
this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// UCStatusPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.lblStatus);
this.Name = "UCStatusPanel";
this.Size = new System.Drawing.Size(150, 38);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label lblStatus;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OnlineStore.XLRStore.boxForm.userControl
{
public partial class UCStatusPanel : UserControl
{
public UCStatusPanel()
{
InitializeComponent();
}
}
}
<?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 \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!