Commit 73b57b24 LN

1

1 个父辈 da1049af
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.listView1 = new System.Windows.Forms.ListView(); this.listView1 = new System.Windows.Forms.ListView();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.tabControl1.SuspendLayout(); this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
...@@ -418,7 +419,7 @@ ...@@ -418,7 +419,7 @@
// 扫码测试ToolStripMenuItem // 扫码测试ToolStripMenuItem
// //
this.扫码测试ToolStripMenuItem.Name = "扫码测试ToolStripMenuItem"; this.扫码测试ToolStripMenuItem.Name = "扫码测试ToolStripMenuItem";
this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.扫码测试ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.扫码测试ToolStripMenuItem.Text = "扫码测试"; this.扫码测试ToolStripMenuItem.Text = "扫码测试";
this.扫码测试ToolStripMenuItem.Visible = false; this.扫码测试ToolStripMenuItem.Visible = false;
this.扫码测试ToolStripMenuItem.Click += new System.EventHandler(this.扫码测试ToolStripMenuItem_Click); this.扫码测试ToolStripMenuItem.Click += new System.EventHandler(this.扫码测试ToolStripMenuItem_Click);
...@@ -426,25 +427,25 @@ ...@@ -426,25 +427,25 @@
// toolStripSeparator6 // toolStripSeparator6
// //
this.toolStripSeparator6.Name = "toolStripSeparator6"; this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator6.Size = new System.Drawing.Size(157, 6);
this.toolStripSeparator6.Visible = false; this.toolStripSeparator6.Visible = false;
// //
// 二维码学习ToolStripMenuItem // 二维码学习ToolStripMenuItem
// //
this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem"; this.二维码学习ToolStripMenuItem.Name = "二维码学习ToolStripMenuItem";
this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.二维码学习ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.二维码学习ToolStripMenuItem.Text = "二维码学习"; this.二维码学习ToolStripMenuItem.Text = "二维码学习";
this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click); this.二维码学习ToolStripMenuItem.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click);
// //
// toolStripSeparator7 // toolStripSeparator7
// //
this.toolStripSeparator7.Name = "toolStripSeparator7"; this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6); this.toolStripSeparator7.Size = new System.Drawing.Size(157, 6);
// //
// 托盘初始化ToolStripMenuItem // 托盘初始化ToolStripMenuItem
// //
this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem"; this.托盘初始化ToolStripMenuItem.Name = "托盘初始化ToolStripMenuItem";
this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(180, 26); this.托盘初始化ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
this.托盘初始化ToolStripMenuItem.Text = "托盘编码"; this.托盘初始化ToolStripMenuItem.Text = "托盘编码";
this.托盘初始化ToolStripMenuItem.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click); this.托盘初始化ToolStripMenuItem.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click);
// //
...@@ -476,21 +477,22 @@ ...@@ -476,21 +477,22 @@
this.contextMenuStrip1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.contextMenuStrip1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.显示ToolStripMenuItem, this.显示ToolStripMenuItem,
this.toolStripSeparator8,
this.toolStripMenuItem1}); this.toolStripMenuItem1});
this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(113, 56); this.contextMenuStrip1.Size = new System.Drawing.Size(181, 84);
// //
// 显示ToolStripMenuItem // 显示ToolStripMenuItem
// //
this.显示ToolStripMenuItem.Name = "显示ToolStripMenuItem"; this.显示ToolStripMenuItem.Name = "显示ToolStripMenuItem";
this.显示ToolStripMenuItem.Size = new System.Drawing.Size(112, 26); this.显示ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.显示ToolStripMenuItem.Text = "显示"; this.显示ToolStripMenuItem.Text = "显示";
this.显示ToolStripMenuItem.Click += new System.EventHandler(this.显示ToolStripMenuItem_Click); this.显示ToolStripMenuItem.Click += new System.EventHandler(this.显示ToolStripMenuItem_Click);
// //
// toolStripMenuItem1 // toolStripMenuItem1
// //
this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(112, 26); this.toolStripMenuItem1.Size = new System.Drawing.Size(180, 26);
this.toolStripMenuItem1.Text = "退出"; this.toolStripMenuItem1.Text = "退出";
this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click); this.toolStripMenuItem1.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
// //
...@@ -516,6 +518,11 @@ ...@@ -516,6 +518,11 @@
this.listView1.View = System.Windows.Forms.View.Details; this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
// //
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";
this.toolStripSeparator8.Size = new System.Drawing.Size(177, 6);
//
// FrmLineStore // FrmLineStore
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
...@@ -599,6 +606,7 @@ ...@@ -599,6 +606,7 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7; private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
private System.Windows.Forms.ToolStripMenuItem 托盘初始化ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 托盘初始化ToolStripMenuItem;
private System.Windows.Forms.Button btnUpdateStatus; private System.Windows.Forms.Button btnUpdateStatus;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
} }
} }
...@@ -106,14 +106,17 @@ namespace OnlineStore.AssemblyLine ...@@ -106,14 +106,17 @@ namespace OnlineStore.AssemblyLine
LogUtil.error("加载配置失败,直接退出程序"); LogUtil.error("加载配置失败,直接退出程序");
Application.Exit(); Application.Exit();
} }
LoadStoreData();
formLineStatus(false); formLineStatus(false);
string title = ConfigAppSettings.GetValue(Setting_Init.App_Title); string title = ConfigAppSettings.GetValue(Setting_Init.App_Title);
this.Text = title; this.Text = title;
this.notifyIcon1.Text = title; this.notifyIcon1.Text = title;
int autoValue = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun); int autoValue = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
chbAutoRun.Checked = autoValue.Equals(1); chbAutoRun.Checked = autoValue.Equals(1);
LoadStoreData();
LoadListView(); LoadListView();
托盘初始化ToolStripMenuItem.Visible = ConfigAppSettings.GetIntValue(Setting_Init.OpenRFIDWrite).Equals(1); 托盘初始化ToolStripMenuItem.Visible = ConfigAppSettings.GetIntValue(Setting_Init.OpenRFIDWrite).Equals(1);
LoadOk = true; LoadOk = true;
HideForm(); HideForm();
...@@ -255,6 +258,8 @@ namespace OnlineStore.AssemblyLine ...@@ -255,6 +258,8 @@ namespace OnlineStore.AssemblyLine
IOManager.instance.CloseAllConnection(); IOManager.instance.CloseAllConnection();
//AIManager.CloseConnect(); //AIManager.CloseConnect();
ACServerManager.CloseAllPort(); ACServerManager.CloseAllPort();
CodeManager.CloseAllCamera();
RFIDManager.CloseAllConnection();
//this.Close(); //this.Close();
System.Environment.Exit(System.Environment.ExitCode); System.Environment.Exit(System.Environment.ExitCode);
} }
......
...@@ -11,7 +11,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -11,7 +11,7 @@ namespace OnlineStore.DeviceLibrary
{ {
public abstract class EquipBase : KTK_Store public abstract class EquipBase : KTK_Store
{ {
private bool IsIntSlvBlock = false;
public bool IsDebug = false; public bool IsDebug = false;
internal AxisAlarmInfo AxisAlarm = new AxisAlarmInfo(); internal AxisAlarmInfo AxisAlarm = new AxisAlarmInfo();
public bool UseAxis = false; public bool UseAxis = false;
......
...@@ -130,7 +130,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -130,7 +130,7 @@ namespace OnlineStore.DeviceLibrary
{ {
//此处先对托盘号进行验证 //此处先对托盘号进行验证
preTrayNum = currTrayNum; preTrayNum = currTrayNum;
currTrayNum = TrayManager.GetTrayNum(DeviceID); currTrayNum = TrayManager.GetTrayNum(DeviceID);
if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false)) if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false))
{ {
if (TrayManager.ErrorStoreId.Equals(DeviceID)) if (TrayManager.ErrorStoreId.Equals(DeviceID))
...@@ -138,10 +138,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -138,10 +138,10 @@ namespace OnlineStore.DeviceLibrary
TrayManager.UpdateTrayNumError(-1, ""); TrayManager.UpdateTrayNumError(-1, "");
} }
//出料中,需要拦盘 //出料中,需要拦盘
if (NeedCurrTray(true )) if (NeedCurrTray(true))
{ {
//preTrayNum = currMoveTrayNum; //preTrayNum = currMoveTrayNum;
// SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum); // SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime);
SecondMoveInfo.EndStepWait(); SecondMoveInfo.EndStepWait();
return; return;
...@@ -183,16 +183,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -183,16 +183,16 @@ namespace OnlineStore.DeviceLibrary
//判断盘是空盘,空盘并且编号正确才需要放料盘过去 //判断盘是空盘,空盘并且编号正确才需要放料盘过去
if (MoveInfo.MoveType.Equals(LineMoveType.InStore)) if (MoveInfo.MoveType.Equals(LineMoveType.InStore))
{ {
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】 ,需要入料,移栽料盘"); LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】 ,需要入料,移栽料盘");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait(); SecondMoveInfo.EndStepWait();
} }
else if (MoveInfo.MoveType.Equals(LineMoveType.OutStore)) else if (MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{ {
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】 ,需要出库,开始出库处理,升降伺服到P1点"); LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】 ,需要出库,开始出库处理,升降伺服到P1点");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_UpDownToP1); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_UpDownToP1);
InStoreLog(" MO_201_UpDownToP1 紧急出料移栽:升降伺服到P1点" ); InStoreLog(" MO_201_UpDownToP1 紧急出料移栽:升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed); UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
} }
...@@ -217,10 +217,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -217,10 +217,19 @@ namespace OnlineStore.DeviceLibrary
{ {
//更新托盘条码信息 //更新托盘条码信息
string code = CodeManager.ProcessCode(LastCodeList); string code = CodeManager.ProcessCode(LastCodeList);
TrayManager.UpdateTrayCode(currTrayNum, code); TrayManager.UpdateTrayCode(currTrayNum, code);
if (code.Equals(""))
{
TrayManager.UpdateInStoreNG(currTrayNum, true);
}
//从服务器获取库位号 //从服务器获取库位号
string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth); string result = StoreServerManager.CodeReceived(Name, currTrayNum, LastCodeList, LastHeight, LastWidth);
if (!result.Equals("")) { LogUtil.error(result); } if (!result.Equals(""))
{
TrayManager.UpdateInStoreNG(currTrayNum, true);
LogUtil.error(result);
}
InStoreLog(" SecondStoreMove=MO_13_LoactionCylinder_Down 上料横移机构上升,托盘开始放行,定位气缸下降"); InStoreLog(" SecondStoreMove=MO_13_LoactionCylinder_Down 上料横移机构上升,托盘开始放行,定位气缸下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down);
...@@ -230,7 +239,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -230,7 +239,8 @@ namespace OnlineStore.DeviceLibrary
{ {
CheckLog("托盘检测 SecondStoreMove:(MO_14_TopCylinder_Down ,托盘号【" + currTrayNum + "】,直接放盘通过,顶升气缸下降)"); CheckLog("托盘检测 SecondStoreMove:(MO_14_TopCylinder_Down ,托盘号【" + currTrayNum + "】,直接放盘通过,顶升气缸下降)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopCylinder_Down);
if (Config.SidesWayNum > 0) //只有2号横移不需要下降
if (Config.SidesWayNum.Equals(2))
{ {
CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down); CylinderMove(SecondMoveInfo, IO_Type.SW_TopCylinder_Up, IO_Type.SW_TopCylinder_Down);
} }
...@@ -288,7 +298,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -288,7 +298,7 @@ namespace OnlineStore.DeviceLibrary
#region 紧急出料,先移载料盘 #region 紧急出料,先移载料盘
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_201_UpDownToP1)&& MoveInfo.MoveStep>=(LineMoveStep.FO_07_LocationCylinder_Up)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_201_UpDownToP1) && MoveInfo.MoveStep >= (LineMoveStep.FO_07_LocationCylinder_Up))
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_202_MoveCylinder_Give); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_202_MoveCylinder_Give);
InStoreLog(" MO_202_MoveCylinder_Give 紧急出料移栽:上料横移机构到放料端"); InStoreLog(" MO_202_MoveCylinder_Give 紧急出料移栽:上料横移机构到放料端");
...@@ -304,7 +314,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -304,7 +314,7 @@ namespace OnlineStore.DeviceLibrary
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_204_UpdownAxisToP2); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_204_UpdownAxisToP2);
int targetP = Config.GetUpdownPositionP2(SecondMoveInfo.MoveParam.PlateH); int targetP = Config.GetUpdownPositionP2(SecondMoveInfo.MoveParam.PlateH);
InStoreLog(" MO_204_UpdownAxisToP2 紧急出料移栽:升降伺服下降到指定位置"+targetP); InStoreLog(" MO_204_UpdownAxisToP2 紧急出料移栽:升降伺服下降到指定位置" + targetP);
UpdownAxis.AbsMove(MoveInfo, targetP, Config.UpdownAxis_P2Speed); UpdownAxis.AbsMove(MoveInfo, targetP, Config.UpdownAxis_P2Speed);
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_204_UpdownAxisToP2)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_204_UpdownAxisToP2))
...@@ -322,7 +332,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -322,7 +332,7 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_206_UpdownAxisToP1)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_206_UpdownAxisToP1))
{ {
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_207_MoveCylinder_Up); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_207_MoveCylinder_Up);
InStoreLog(" MO_207_MoveCylinder_Up 紧急出料移栽:上料横移机构上升,更新【"+currTrayNum+"】为空托盘"); InStoreLog(" MO_207_MoveCylinder_Up 紧急出料移栽:上料横移机构上升,更新【" + currTrayNum + "】为空托盘");
CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); CylinderMove(SecondMoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
//更新此托盘为空托盘 //更新此托盘为空托盘
......
...@@ -42,10 +42,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -42,10 +42,8 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error(Name + " 启动出库【" + posId + "】失败,当前状态,storeStatus=" + runStatus); LogUtil.error(Name + " 启动出库【" + posId + "】失败,当前状态,storeStatus=" + runStatus);
return false; return false;
} }
}
}
protected override void OutStoreProcess() protected override void OutStoreProcess()
{ {
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : ""; string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
...@@ -346,7 +344,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -346,7 +344,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (isFull.Equals(false)) if (isFull.Equals(false))
{ {
LogInfo(" 托盘号【" + preTrayNum + "】,当前托盘号【(isFull=" + isFull + "):" + currTrayNum + "】需要出库,不顶升直接让移栽放盘~"); LogInfo(" 托盘号【" + preTrayNum + "】,当前托盘号【(isFull=" + isFull + "):" + currTrayNum + "】出库中,拦截 托盘~");
return true; return true;
} }
//去掉直接丢料盘处理 //去掉直接丢料盘处理
...@@ -491,18 +489,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -491,18 +489,14 @@ namespace OnlineStore.DeviceLibrary
bool isNeed = false; bool isNeed = false;
//此处先对托盘号进行验证 //此处先对托盘号进行验证
preTrayNum = currTrayNum; preTrayNum = currTrayNum;
currTrayNum = TrayManager.GetTrayNum(DeviceID); currTrayNum = TrayManager.GetTrayNum(DeviceID);
bool isFull = TrayManager.TrayIsFull(currTrayNum); bool isFull = TrayManager.TrayIsFull(currTrayNum);
if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false)) if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false))
{ {
//出库中,需要拦盘 //出库中,需要拦盘
if (CheckIsNeedOutStore()) if (CheckIsNeedOutStore())
{ {
//preTrayNum = currMoveTrayNum; isNeed = true;
SecondMoveInfo.MoveParam = new InOutParam(currTrayNum);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
return;
} }
else if (isFull && IsInStoreNeed()) else if (isFull && IsInStoreNeed())
{ {
...@@ -552,7 +546,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -552,7 +546,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP); CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP);
} }
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_06_TopCylinderUp)) else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_06_TopCylinderUp))
{ {
CheckLog("托盘检测(流水线阻挡)*************** 托盘号【" + currTrayNum + "】"); CheckLog("托盘检测(流水线阻挡)*************** 托盘号【" + currTrayNum + "】");
//托盘号正确 //托盘号正确
...@@ -567,19 +561,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -567,19 +561,17 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait(); SecondMoveInfo.EndStepWait();
} }
else if (CheckIsNeedInStore())
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不是空盘,有对应的入库任务,等待移栽");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_08_WaitInStore);
isNeedMove = true;
}
else else
{ {
if (CheckIsNeedInStore()) LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不需要出入库, 放盘通过");
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不是空盘,有对应的入库任务,等待移栽");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_08_WaitInStore);
isNeedMove = true;
}
else
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不是空盘, 放盘通过");
}
} }
if (!isNeedMove) if (!isNeedMove)
{ {
//preTrayNum = num; //preTrayNum = num;
......
...@@ -171,6 +171,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -171,6 +171,7 @@ namespace OnlineStore.DeviceLibrary
CheckLog("托盘放行 SecondMove:(MO_14_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)"); CheckLog("托盘放行 SecondMove:(MO_14_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_WaitCanGo); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_WaitCanGo);
//更新横移托盘已处理完成 //更新横移托盘已处理完成
//TODO 阻挡气缸是否需要处理
TrayManager.UpdateSWState(Config.SidesWayNum, 1); TrayManager.UpdateSWState(Config.SidesWayNum, 1);
} }
......
...@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
string codeStr = ""; string codeStr = "";
foreach(string str in codeList) foreach (string str in codeList)
{ {
if (codeStr.Equals("")) if (codeStr.Equals(""))
{ {
...@@ -39,14 +39,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -39,14 +39,10 @@ namespace OnlineStore.DeviceLibrary
//http://localhost/myproject/service/store/emptyPosForPutin //http://localhost/myproject/service/store/emptyPosForPutin
// 参数:cids: 多个 cid // 参数:cids: 多个 cid
//code: 条码内容 //code: 条码内容
string server = ConfigAppSettings.GetValue(Setting_Init.http_server) + "?cids=" + LineServer.GetAllCID() + "&code=%3D" + codeStr; string server = ConfigAppSettings.GetValue(Setting_Init.http_server) + "?cids=" + LineServer.GetAllCID() + "&code=%3D" + codeStr;
LogUtil.info(deviceName + "托盘【" + trayNum + "】 收到条码<< " + codeStr + ",获取入库PosID:" + server); LogUtil.info(deviceName + "托盘【" + trayNum + "】 收到条码<< " + codeStr + ",获取入库PosID:" + server);
//发送扫码内容到服务器进行入库操作
// Operation operation =LineServer.GetInStoreOperation(codeStr);
// LineGetPosOp op = new LineGetPosOp(LineServer.GetAllCID(), codeStr);
string resultStr = HttpHelper.Post(server, ""); string resultStr = HttpHelper.Post(server, "");
LineOperation serverResult = JsonHelper.DeserializeJsonToObject<LineOperation>(resultStr); LineOperation serverResult = JsonHelper.DeserializeJsonToObject<LineOperation>(resultStr);
if (serverResult == null) if (serverResult == null)
...@@ -68,33 +64,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -68,33 +64,25 @@ namespace OnlineStore.DeviceLibrary
{ {
return msg = deviceName + "托盘【" + trayNum + "】 入库库位格式错误:条码【" + codeStr + "】库位【" + posId + "】"; return msg = deviceName + "托盘【" + trayNum + "】 入库库位格式错误:条码【" + codeStr + "】库位【" + posId + "】";
} }
//判断盘是否过高(7*8的盘需要判断,如果盘过高,不让盘通过,直接显示报警信息)
int storeId = int.Parse(posArray[0]); int storeId = int.Parse(posArray[0]);
string wareNum = serverResult.barcode;
//根据库位号查找移栽 //根据库位号查找移栽
MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId]; MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId];
// 判断PosID是否已经在入库或者在排队列表中,如果已经存在,加入列表失败
//取盘号 InOutParam param = new InOutParam(trayNum, wareNum, posId, plateH, plateW);
string wareNum = serverResult.barcode; if (LineManager.Line.IsReviceInPosId(moveEquip, posId))
int trayCode = TrayManager.GetTrayNum(0); {
LogUtil.info("更新盘空满信息,托盘号【" + trayCode + "】,是否有料盘【" + true + "】,出库入库【" + 1 + "】"); LineManager.Line.WarnMsg = "入库库位重复: " + param.ToStr() + " ,入库失败!";
TrayManager.UpdateTrayInfo(trayCode, true, ReelType.InStore, wareNum, posId, plateH, plateW); moveEquip.WarnMsg = "入库库位重复: " + param.ToStr() + " ,入库失败!";
return msg = ("收到服务器入库命令 " + "入库库位重复: " + param.ToStr() + " ,入库失败!");
}
LogUtil.info("更新盘空满信息,托盘号【" + trayNum + "】,是否有料盘【" + true + "】,出库入库【" + 1 + "】");
TrayManager.UpdateTrayInfo(trayNum, true, ReelType.InStore, wareNum, posId, plateH, plateW);
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器; //TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if (LineServer.BoxCanInStore(moveEquip.DeviceID)) if (LineServer.BoxCanInStore(moveEquip.DeviceID))
{ {
InOutParam param = new InOutParam(trayCode, wareNum, posId, plateH, plateW);
// 判断PosID是否已经在入库或者在排队列表中,如果已经存在,加入列表失败
if (LineManager.Line.IsReviceInPosId(moveEquip, posId))
{
LineManager.Line.WarnMsg = "入库库位重复: " + param.ToStr() + " ,入库失败!";
moveEquip.WarnMsg = "入库库位重复: " + param.ToStr() + " ,入库失败!";
return msg = ("收到服务器入库命令 " + "入库库位重复: " + param.ToStr() + " ,入库失败!");
}
LineServer.CheckInStorePos(storeId, param); LineServer.CheckInStorePos(storeId, param);
//StartInStoreMove(param);
TrayManager.UpdateTrayInfo(trayCode, true, 1, codeStr, posId, plateH, plateW);
} }
} }
} }
...@@ -103,81 +91,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -103,81 +91,6 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(deviceName + " " + ex.ToString()); LogUtil.error(deviceName + " " + ex.ToString());
} }
return ""; return "";
} }
///// <summary>
///// 是否已经扫码
///// </summary>
//private bool IsScanCode = false;
//private string CodeMsg = "";
//private static string ACCode = "";
//public void GetCameraCode()
//{
// if (IsInScan())
// {
// LogUtil.info("上次扫码还未执行完毕,请稍后!");
// return;
// }
// Task.Factory.StartNew(delegate
// {
// IsScanCode = true;
// LastScanTime = DateTime.Now;
// DateTime date = DateTime.Now;
// // IOMove(IO_Type.CameraLight_Power, IO_VALUE.HIGH);
// List<string> codeList = CodeManager.CameraScan();
// if (codeList.Count <= 0)
// {
// codeList = CodeManager.CameraScan();
// }
// List<string> list = new List<string>();
// string outMsg = "";
// string message = "";
// int height = GetHeight();
// int width = GetWidth();
// //= 1 + 123.4x100.5 - 7x12 = CODE
// foreach (string str in codeList)
// {
// if (list.Contains(str.Trim()))
// {
// continue;
// }
// list.Add(str.Trim());
// //string code = "=1+0x0-" + width + "x" + height + "=" + str.Trim();
// string code = width + "x" + height + "%3D" + str.Trim();
// message = message + code + spiltStr;
// }
// if (!outMsg.Equals(""))
// {
// CodeMsg = "盘尺寸错误,清理二维码【" + message + "】";
// LogUtil.error("盘尺寸错误,清理二维码【" + message + "】");
// message = "";
// }
// // KNDIOMove(IO_Type.CameraLight_Power, IO_VALUE.LOW);
// onCodeReceived(message, height, width);
// IsScanCode = false;
// });
//}
//
//private DateTime LastScanTime = DateTime.Now;
//private bool IsInScan()
//{
// if (!IsScanCode)
// {
// return false;
// }
// TimeSpan span = DateTime.Now - LastScanTime;
// if (span.TotalSeconds > 60)
// {
// //大于60秒表示超时了,可以重新开始扫码
// return false;
// }
// return true;
//}
} }
} }
...@@ -105,7 +105,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -105,7 +105,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
internal static void UpdateTrayCode(int trayNum, string wareCode = "") internal static void UpdateTrayCode(int trayNum, string wareCode = "" )
{ {
LogUtil.info( "更新托盘【" + trayNum + "】的条码为【" + wareCode + "】"); LogUtil.info( "更新托盘【" + trayNum + "】的条码为【" + wareCode + "】");
lock (fixtureMapLock) lock (fixtureMapLock)
...@@ -113,6 +113,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -113,6 +113,19 @@ namespace OnlineStore.DeviceLibrary
if (fixtureCodeFullMap.ContainsKey(trayNum)) if (fixtureCodeFullMap.ContainsKey(trayNum))
{ {
fixtureCodeFullMap[trayNum].WareCode = wareCode; fixtureCodeFullMap[trayNum].WareCode = wareCode;
}
}
}
internal static void UpdateInStoreNG(int trayNum, bool isNg = false)
{
LogUtil.info("更新托盘【" + trayNum + "】InStoreNG=【" + isNg + "】");
lock (fixtureMapLock)
{
if (fixtureCodeFullMap.ContainsKey(trayNum))
{
fixtureCodeFullMap[trayNum].InStoreNG = isNg;
} }
} }
} }
...@@ -245,7 +258,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -245,7 +258,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return true; return true;
} }
else if (swNum.Equals(1) || swNum.Equals(2)) else if (swNum.Equals(1) || swNum.Equals(3))
{ {
if (SidesWayStateMap[swNum].Equals(0)) if (SidesWayStateMap[swNum].Equals(0))
{ {
...@@ -259,7 +272,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -259,7 +272,7 @@ namespace OnlineStore.DeviceLibrary
/// 更新横移托盘的处理状态 /// 更新横移托盘的处理状态
/// </summary> /// </summary>
/// <param name="swNum">横移编号</param> /// <param name="swNum">横移编号</param>
/// <param name="value">0=未处理等待中,1=托盘处理完成,可处理横移,2=托盘正在处理中</param> /// <param name="value">0=未处理等待中,1=托盘处理完成,可处理横移,2=托盘检测处理中</param>
internal static void UpdateSWState(int swNum,int value) internal static void UpdateSWState(int swNum,int value)
{ {
if (swNum <= 0) if (swNum <= 0)
......
...@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary
private static List<string> RfIPList = new List<string>(); private static List<string> RfIPList = new List<string>();
private static System.Timers.Timer conTimer = null; private static System.Timers.Timer conTimer = null;
internal static void ConnectRFIOList(List<string> rfioNameList) public static void ConnectRFIOList(List<string> rfioNameList)
{ {
try { try {
if (conTimer == null) if (conTimer == null)
...@@ -122,7 +122,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -122,7 +122,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("连接RFIP模块 " + logName + " 出错:" + error.ToString()); LogUtil.error("连接RFIP模块 " + logName + " 出错:" + error.ToString());
} }
} }
internal static void CloseAllConnection() public static void CloseAllConnection()
{ {
foreach (Reader reader in RFReaderMap.Values) foreach (Reader reader in RFReaderMap.Values)
{ {
......
...@@ -193,11 +193,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -193,11 +193,12 @@ namespace OnlineStore.DeviceLibrary
List<CodeInfo> cc = new List<CodeInfo>(); List<CodeInfo> cc = new List<CodeInfo>();
foreach (string codeType in codeTypeList) foreach (string codeType in codeTypeList)
{ {
Task<List<CodeInfo>> typeDeCode = Task.Factory.StartNew(delegate () Task<List<CodeInfo>> typeDeCode = new Task<List<CodeInfo>>(delegate ()
{ {
return DeCode(ho_Image, codeType); return DeCode(ho_Image, codeType);
}); });
taskList.Add(typeDeCode); taskList.Add(typeDeCode);
typeDeCode.Start();
} }
} }
}); });
...@@ -205,7 +206,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -205,7 +206,7 @@ namespace OnlineStore.DeviceLibrary
Task.WaitAll(taskList.ToArray()); Task.WaitAll(taskList.ToArray());
foreach (Task<List<CodeInfo>> t in taskList) foreach (Task<List<CodeInfo>> t in taskList)
{ {
List<CodeInfo> cc = t.Result; List<CodeInfo> cc = t.Result;
if (cc.Count > 0) if (cc.Count > 0)
{ {
......
...@@ -57,6 +57,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -57,6 +57,10 @@ namespace OnlineStore.DeviceLibrary
/// 料盘宽度 /// 料盘宽度
/// </summary> /// </summary>
public int PlateW { get; set; } public int PlateW { get; set; }
/// <summary>
/// 入库失败料盘,未扫到码或获取库位号失败
/// </summary>
public bool InStoreNG = false;
public bool EmergencyOut = false; public bool EmergencyOut = false;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!