Commit 73b57b24 LN

1

1 个父辈 da1049af
......@@ -75,6 +75,7 @@
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.listView1 = new System.Windows.Forms.ListView();
this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox1.SuspendLayout();
......@@ -418,7 +419,7 @@
// 扫码测试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.Visible = false;
this.扫码测试ToolStripMenuItem.Click += new System.EventHandler(this.扫码测试ToolStripMenuItem_Click);
......@@ -426,25 +427,25 @@
// 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;
//
// 二维码学习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.Click += new System.EventHandler(this.二维码学习ToolStripMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(157, 6);
//
// 托盘初始化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.Click += new System.EventHandler(this.托盘初始化ToolStripMenuItem_Click);
//
......@@ -476,21 +477,22 @@
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.显示ToolStripMenuItem,
this.toolStripSeparator8,
this.toolStripMenuItem1});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(113, 56);
this.contextMenuStrip1.Size = new System.Drawing.Size(181, 84);
//
// 显示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.Click += new System.EventHandler(this.显示ToolStripMenuItem_Click);
//
// 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.Click += new System.EventHandler(this.toolStripMenuItem1_Click);
//
......@@ -516,6 +518,11 @@
this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
//
// toolStripSeparator8
//
this.toolStripSeparator8.Name = "toolStripSeparator8";
this.toolStripSeparator8.Size = new System.Drawing.Size(177, 6);
//
// FrmLineStore
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
......@@ -599,6 +606,7 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
private System.Windows.Forms.ToolStripMenuItem 托盘初始化ToolStripMenuItem;
private System.Windows.Forms.Button btnUpdateStatus;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
}
}
......@@ -106,14 +106,17 @@ namespace OnlineStore.AssemblyLine
LogUtil.error("加载配置失败,直接退出程序");
Application.Exit();
}
LoadStoreData();
formLineStatus(false);
string title = ConfigAppSettings.GetValue(Setting_Init.App_Title);
this.Text = title;
this.notifyIcon1.Text = title;
int autoValue = ConfigAppSettings.GetIntValue(Setting_Init.App_AutoRun);
chbAutoRun.Checked = autoValue.Equals(1);
LoadStoreData();
LoadListView();
托盘初始化ToolStripMenuItem.Visible = ConfigAppSettings.GetIntValue(Setting_Init.OpenRFIDWrite).Equals(1);
LoadOk = true;
HideForm();
......@@ -255,6 +258,8 @@ namespace OnlineStore.AssemblyLine
IOManager.instance.CloseAllConnection();
//AIManager.CloseConnect();
ACServerManager.CloseAllPort();
CodeManager.CloseAllCamera();
RFIDManager.CloseAllConnection();
//this.Close();
System.Environment.Exit(System.Environment.ExitCode);
}
......
......@@ -11,7 +11,7 @@ namespace OnlineStore.DeviceLibrary
{
public abstract class EquipBase : KTK_Store
{
private bool IsIntSlvBlock = false;
public bool IsDebug = false;
internal AxisAlarmInfo AxisAlarm = new AxisAlarmInfo();
public bool UseAxis = false;
......
......@@ -130,7 +130,7 @@ namespace OnlineStore.DeviceLibrary
{
//此处先对托盘号进行验证
preTrayNum = currTrayNum;
currTrayNum = TrayManager.GetTrayNum(DeviceID);
currTrayNum = TrayManager.GetTrayNum(DeviceID);
if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false))
{
if (TrayManager.ErrorStoreId.Equals(DeviceID))
......@@ -138,10 +138,10 @@ namespace OnlineStore.DeviceLibrary
TrayManager.UpdateTrayNumError(-1, "");
}
//出料中,需要拦盘
if (NeedCurrTray(true ))
if (NeedCurrTray(true))
{
//preTrayNum = currMoveTrayNum;
// SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
// SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime);
SecondMoveInfo.EndStepWait();
return;
......@@ -183,16 +183,16 @@ namespace OnlineStore.DeviceLibrary
//判断盘是空盘,空盘并且编号正确才需要放料盘过去
if (MoveInfo.MoveType.Equals(LineMoveType.InStore))
{
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】 ,需要入料,移栽料盘");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
}
else if (MoveInfo.MoveType.Equals(LineMoveType.OutStore))
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】 ,需要出库,开始出库处理,升降伺服到P1点");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_UpDownToP1);
InStoreLog(" MO_201_UpDownToP1 紧急出料移栽:升降伺服到P1点" );
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】 ,需要出库,开始出库处理,升降伺服到P1点");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_UpDownToP1);
InStoreLog(" MO_201_UpDownToP1 紧急出料移栽:升降伺服到P1点");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
......@@ -217,10 +217,19 @@ namespace OnlineStore.DeviceLibrary
{
//更新托盘条码信息
string code = CodeManager.ProcessCode(LastCodeList);
TrayManager.UpdateTrayCode(currTrayNum, code);
if (code.Equals(""))
{
TrayManager.UpdateInStoreNG(currTrayNum, true);
}
//从服务器获取库位号
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 上料横移机构上升,托盘开始放行,定位气缸下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_13_LoactionCylinder_Down);
......@@ -230,7 +239,8 @@ namespace OnlineStore.DeviceLibrary
{
CheckLog("托盘检测 SecondStoreMove:(MO_14_TopCylinder_Down ,托盘号【" + currTrayNum + "】,直接放盘通过,顶升气缸下降)");
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);
}
......@@ -288,7 +298,7 @@ namespace OnlineStore.DeviceLibrary
#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);
InStoreLog(" MO_202_MoveCylinder_Give 紧急出料移栽:上料横移机构到放料端");
......@@ -304,7 +314,7 @@ namespace OnlineStore.DeviceLibrary
{
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_204_UpdownAxisToP2);
int targetP = Config.GetUpdownPositionP2(SecondMoveInfo.MoveParam.PlateH);
InStoreLog(" MO_204_UpdownAxisToP2 紧急出料移栽:升降伺服下降到指定位置"+targetP);
InStoreLog(" MO_204_UpdownAxisToP2 紧急出料移栽:升降伺服下降到指定位置" + targetP);
UpdownAxis.AbsMove(MoveInfo, targetP, Config.UpdownAxis_P2Speed);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_204_UpdownAxisToP2))
......@@ -322,7 +332,7 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_206_UpdownAxisToP1))
{
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);
//更新此托盘为空托盘
......
......@@ -105,137 +105,8 @@ namespace OnlineStore.DeviceLibrary
// isInprocess = false;
// return;
//}
//if (IOValue(IO_Type.Fixture_Check_4).Equals(IO_VALUE.LOW))
//{
// IsWaitToScan = false;
// IsWaitEmptyGo = false;
// //出料口有空托盘才可以放行,StopCylinder_Check=出料是否有托盘。OutStore_TrayCheck=出料托盘是否有料盘
// if (IOValue(IO_Type.StopCylinder_Check).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.OutStore_TrayCheck).Equals(IO_VALUE.LOW))
// {
// //延迟一秒钟放行
// if (!isWaitOutGo)
// {
// WaitOutGoTime = DateTime.Now.AddMilliseconds(500);
// isWaitOutGo = true;
// }
// else if (DateTime.Now > WaitOutGoTime)
// {
// LogUtil.debug(Name + "检测到出料口有空托盘, 且入料口没有托盘,,等待500后下降阻挡气缸1(出料口阻挡)");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
// isWaitOutGo = false;
// }
// }
// else
// {
// isWaitOutGo = false;
// }
//}
//else
//{
// isWaitOutGo = false;
// //上料工位有盘,阻挡1需要上升
// if (IOValue(IO_Type.StopCylinder_Down1).Equals(IO_VALUE.HIGH))
// {
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
// }
// int trayNum = TrayManager.GetNum(0);
// if (trayNum > 0)
// {
// //先判断是空盘还是有料盘
// if ((IOValue(IO_Type.InStore_TrayCheck1).Equals(IO_VALUE.HIGH)) || (IOValue(IO_Type.InStore_TrayCheck2).Equals(IO_VALUE.HIGH)))
// {
// //有料盘,直接扫码通过 。如果移栽在出库过程中,不能扫码
// IsWaitEmptyGo = false;
// if (!IsScanCode && CanScanCode())
// {
// if (!IsWaitToScan)
// {
// UpdateSleep(false);
// IsWaitToScan = true;
// NextScanTime = DateTime.Now.AddMilliseconds(1500);
// LogUtil.debug(Name + "有料托盘【" + trayNum + "】等待1.5秒后开始扫码");
// }
// else if (DateTime.Now > NextScanTime)
// {
// UpdateSleep(false);
// IsWaitToScan = false;
// //进入忙碌状态,开始扫码枪
// LogUtil.debug(Name + "有料托盘【" + trayNum + "】,已经等待1.5秒,开始扫码");
// //判断盘号是否正确
// if (TrayManager.RightTrayCode(trayNum, preTrayNum, true))
// {
// GetCameraCode();
// }
// else
// {
// string msg = Name + " 托盘顺序错乱,上个托盘号【" + preTrayNum + "】当前有料托盘【" + trayNum + "】最大盘号【" + TrayManager.MaxTrayNum + "】";
// TrayManager.UpdateTrayNumError(0, msg);
// LogUtil.error(msg);
// }
// }
// }
// }
// else
// { //无料盘,若需要空盘,放行通过
// IsWaitToScan = false;
// IsScanCode = false;
// if (!IsWaitEmptyGo)
// {
// IsWaitEmptyGo = true;
// NextEmptyGo = DateTime.Now.AddMilliseconds(500);
// }
// else if (DateTime.Now > NextEmptyGo)
// {
// trayNum = TrayManager.GetNum(0);
// IsWaitEmptyGo = false;
// isNotScanCode = false;
// TrayManager.UpdateFixtureValue(trayNum, false, 0);
// //判断盘号是否正确
// if (TrayManager.RightTrayCode(trayNum, preTrayNum, true))
// {
// bool isNeedGo = false;
// //判断是否需要空盘 或者还有有 料盘 的托盘,一直走
// if (TrayManager.isNeedEmptyTray())
// {
// isNeedGo = true;
// LogUtil.info(Name + " 检测到空托盘【" + trayNum + "】并等待500, 放盘通过");
// }
// else if (TrayManager.IsHasFullOutFixture())
// {
// isNeedGo = true;
// LogUtil.info(Name + " 检测到空托盘【" + trayNum + "】并等待500 ,还有没有出库完成的,放盘通过");
// }
// if (isNeedGo)
// {
// UpdateSleep(false);
// //放行操作
// preTrayNum = trayNum;
// StartOutStoreMove(null);
// }
// }
// else
// {
// string msg = Name + " 托盘顺序错乱,上个托盘号【" + preTrayNum + "】当前空托盘【" + trayNum + "】最大盘号【" + TrayManager.MaxTrayNum + "】";
// TrayManager.UpdateTrayNumError(0, msg);
// LogUtil.error(msg);
// }
// }
// }
// }
// else
// {
// IsWaitToScan = false;
// IsWaitEmptyGo = false;
// LogUtil.debug(Name + "检测到Fixture_Check_4亮,但是托盘号为0,不处理托盘~");
// }
//}
//TODO 需要处理NG料盘推出
}
catch (Exception ex)
......@@ -421,39 +292,7 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.IsInWait)
{
return;
}
//switch (MoveInfo.MoveStep)
//{
// //if (StoreMove.MoveStep == StoreMoveStep.LO_00_Wait100)
// case LineMoveStep.LO_00_Wait100:
// MoveInfo.NextMoveStep(LineMoveStep.LO_01_StopCylinder2Down);
// InOutLog("出库处理:(LO_01_StopCylinder2Down 流水线出库,阻挡气缸0-1上升,阻挡气缸0-2下降, ) 开始");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
// IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH);
// MoveInfo.EndStepWait();
// break;
// case LineMoveStep.LO_01_StopCylinder2Down:
// MoveInfo.NextMoveStep(LineMoveStep.LO_02_FixtureCheck);
// InOutLog("出库处理:(LO_02_FixtureCheck 检测夹具检测4=0 ) 开始");
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check_4, IO_VALUE.LOW));
// break;
// case LineMoveStep.LO_02_FixtureCheck:
// MoveInfo.NextMoveStep(LineMoveStep.LO_03_StopCylinder2Up);
// InOutLog("出库处理:(LO_03_StopCylinder2Up1Down , 阻挡气缸0-2上升 ) 开始 ");
// // IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
// IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); break;
// case LineMoveStep.LO_03_StopCylinder2Up:
// IsScanCode = false;
// MoveInfo.EndMove();
// runStatus = LineRunStatus.Runing;
// lineStatus = LineStatus.StoreOnline;
// InOutLog("出库处理:放行完成! ");
// break;
// default:
// break;
//}
}
}
#endregion
......@@ -490,61 +329,7 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.IsInWait)
{
return;
}
//switch (MoveInfo.MoveStep)
//{
// case LineMoveStep.LI_00_Wait100:
// //判断是否可以入库
// string posId = MoveInfo.MoveParam.PosId;
// int id = MoveInfo.MoveParam.GetStoreId();
// bool result = LineServer.RightInPosId(id, posId);
// MoveEquip moveEquip = null;
// MoveEquipMap.TryGetValue(id, out moveEquip);
// if (!result || moveEquip == null)
// {
// LogUtil.error("入库处理:入库验证失败【" + id + "】【" + posId + "】,结束入库");
// IsScanCode = false;
// MoveInfo.EndMove();
// runStatus = LineRunStatus.Runing;
// lineStatus = LineStatus.StoreOnline;
// }
// else
// {
// preTrayNum = MoveInfo.MoveParam.TrayNumber;
// lock (moveEquip.waitInListLock)
// {
// //如果当前正在出入库中,需要记录下来,等待空闲时执行
// LogUtil.info(moveEquip.Name + " 入库命令: " + MoveInfo.MoveParam.ToStr() + "已验证完成 ,写入排队列表中等待!");
// moveEquip.waitInStoreList.Add(MoveInfo.MoveParam);
// }
// MoveInfo.NextMoveStep(LineMoveStep.LI_01_StopCylinder2Down);
// InOutLog("入库处理:(LI_01_StopCylinder2Down ,阻挡气缸0-1上升,阻挡气缸0-2下降 ) 开始");
// IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.LOW);
// IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.HIGH);
// }
// break;
// case LineMoveStep.LI_01_StopCylinder2Down:
// MoveInfo.NextMoveStep(LineMoveStep.LI_02_FixtureCheck);
// InOutLog("入库处理:(LI_02_CheckX3X4 等待夹具检测4=0 ) 开始");
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check_4, IO_VALUE.LOW));
// break;
// case LineMoveStep.LI_02_FixtureCheck:
// MoveInfo.NextMoveStep(LineMoveStep.LI_03_StopCylinder2Up);
// InOutLog("入库处理:(LI_03_StopCylinder2Up1Down 阻挡气缸0-2上升) 开始 ");
// // IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
// IOMove(IO_Type.StopCylinder_Down2, IO_VALUE.LOW);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(200));
// break;
// case LineMoveStep.LI_03_StopCylinder2Up:
// IsScanCode = false;
// MoveInfo.EndMove();
// runStatus = LineRunStatus.Runing;
// lineStatus = LineStatus.StoreOnline;
// InOutLog(Name + "入库处理:放行完成! ");
// break;
// default: break;
//}
}
}
#endregion
......@@ -660,17 +445,12 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span12 = DateTime.Now - SideWay41Ntime;
if (SideWay41IsWait && span12.TotalSeconds > 1)
{
SWLog("横移轨道4检测到托盘,定位气缸下降");
SW41_MoveInfo.NewMove(LineMoveType.InStore);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW01_LocationCylinderDown);
//IOMove(IO_Type.SW1_StopCylinderDown, IO_VALUE.LOW);
// SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
//CylinderMove(SW41_MoveInfo, IO_Type.SW1_TopCylinder_Up, IO_Type.SW1_TopCylinder_Down);
//CylinderMove(SW41_MoveInfo, IO_Type.SW4_TopCylinder_Up, IO_Type.SW4_TopCylinder_Down);
CylinderMove(SW41_MoveInfo, IO_Type.SW1_LocationCylinder_Up, IO_Type.SW1_LocationCylinder_Down);
CylinderMove(SW41_MoveInfo, IO_Type.SW4_LocationCylinder_Up, IO_Type.SW4_LocationCylinder_Down);
// TrayManager.UpdateSWState(4, 2);
// TrayManager.UpdateSWState(1, 2);
SW41_MoveInfo.NewMove(LineMoveType.InStore);
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck);
SWLog("横移轨道41: 等待横移4托盘检测信号 ");
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
}
else if (!SideWay41IsWait)
{
......@@ -700,17 +480,12 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span34 = DateTime.Now - SideWay23Ntime;
if (SideWay23IsWait && span34.TotalSeconds > 1)
{
SWLog("横移轨道2检测到托盘,定位气缸下降");
// TrayManager.UpdateSWState(2, 2);
//TrayManager.UpdateSWState(3, 2);
SW23_MoveInfo.NewMove(LineMoveType.InStore);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW01_LocationCylinderDown);
//IOMove(IO_Type.SW3_StopCylinderDown, IO_VALUE.HIGH);
//SideWay23TopCylinderMove(IO_VALUE.HIGH, IO_VALUE.LOW, SW23_MoveInfo);
// SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
//CylinderMove(SW23_MoveInfo, IO_Type.SW2_TopCylinder_Up, IO_Type.SW2_TopCylinder_Down);
//CylinderMove(SW23_MoveInfo, IO_Type.SW3_TopCylinder_Up, IO_Type.SW3_TopCylinder_Down);
CylinderMove(SW23_MoveInfo, IO_Type.SW2_LocationCylinder_Up, IO_Type.SW2_LocationCylinder_Down);
CylinderMove(SW23_MoveInfo, IO_Type.SW3_LocationCylinder_Up, IO_Type.SW3_LocationCylinder_Down);
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW02_WaitFixtureCheck);
SWLog("横移轨道23: 等待横移4托盘检测信号 ");
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
}
else if (!SideWay23IsWait)
{
......
......@@ -42,10 +42,8 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error(Name + " 启动出库【" + posId + "】失败,当前状态,storeStatus=" + runStatus);
return false;
}
}
}
}
protected override void OutStoreProcess()
{
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosId : "";
......@@ -346,7 +344,7 @@ namespace OnlineStore.DeviceLibrary
{
if (isFull.Equals(false))
{
LogInfo(" 托盘号【" + preTrayNum + "】,当前托盘号【(isFull=" + isFull + "):" + currTrayNum + "】需要出库,不顶升直接让移栽放盘~");
LogInfo(" 托盘号【" + preTrayNum + "】,当前托盘号【(isFull=" + isFull + "):" + currTrayNum + "】出库中,拦截 托盘~");
return true;
}
//去掉直接丢料盘处理
......@@ -491,18 +489,14 @@ namespace OnlineStore.DeviceLibrary
bool isNeed = false;
//此处先对托盘号进行验证
preTrayNum = currTrayNum;
currTrayNum = TrayManager.GetTrayNum(DeviceID);
currTrayNum = TrayManager.GetTrayNum(DeviceID);
bool isFull = TrayManager.TrayIsFull(currTrayNum);
if (TrayManager.RightTrayCode(currTrayNum, preTrayNum, false))
{
//出库中,需要拦盘
if (CheckIsNeedOutStore())
{
//preTrayNum = currMoveTrayNum;
SecondMoveInfo.MoveParam = new InOutParam(currTrayNum);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
return;
isNeed = true;
}
else if (isFull && IsInStoreNeed())
{
......@@ -552,7 +546,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP);
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MIO_06_TopCylinderUp))
{
{
CheckLog("托盘检测(流水线阻挡)*************** 托盘号【" + currTrayNum + "】");
//托盘号正确
......@@ -567,19 +561,17 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
}
else if (CheckIsNeedInStore())
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不是空盘,有对应的入库任务,等待移栽");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_08_WaitInStore);
isNeedMove = true;
}
else
{
if (CheckIsNeedInStore())
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不是空盘,有对应的入库任务,等待移栽");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_08_WaitInStore);
isNeedMove = true;
}
else
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不是空盘, 放盘通过");
}
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不需要出入库, 放盘通过");
}
if (!isNeedMove)
{
//preTrayNum = num;
......
......@@ -171,6 +171,7 @@ namespace OnlineStore.DeviceLibrary
CheckLog("托盘放行 SecondMove:(MO_14_WaitCanGo ,移栽2,需要判断是否可以放盘通过,最多等待10000)");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_15_WaitCanGo);
//更新横移托盘已处理完成
//TODO 阻挡气缸是否需要处理
TrayManager.UpdateSWState(Config.SidesWayNum, 1);
}
......
......@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary
try
{
string codeStr = "";
foreach(string str in codeList)
foreach (string str in codeList)
{
if (codeStr.Equals(""))
{
......@@ -39,14 +39,10 @@ namespace OnlineStore.DeviceLibrary
//http://localhost/myproject/service/store/emptyPosForPutin
// 参数:cids: 多个 cid
//code: 条码内容
string server = ConfigAppSettings.GetValue(Setting_Init.http_server) + "?cids=" + LineServer.GetAllCID() + "&code=%3D" + codeStr;
LogUtil.info(deviceName + "托盘【" + trayNum + "】 收到条码<< " + codeStr + ",获取入库PosID:" + server);
//发送扫码内容到服务器进行入库操作
// Operation operation =LineServer.GetInStoreOperation(codeStr);
// LineGetPosOp op = new LineGetPosOp(LineServer.GetAllCID(), codeStr);
string resultStr = HttpHelper.Post(server, "");
LineOperation serverResult = JsonHelper.DeserializeJsonToObject<LineOperation>(resultStr);
if (serverResult == null)
......@@ -68,33 +64,25 @@ namespace OnlineStore.DeviceLibrary
{
return msg = deviceName + "托盘【" + trayNum + "】 入库库位格式错误:条码【" + codeStr + "】库位【" + posId + "】";
}
//判断盘是否过高(7*8的盘需要判断,如果盘过高,不让盘通过,直接显示报警信息)
int storeId = int.Parse(posArray[0]);
string wareNum = serverResult.barcode;
//根据库位号查找移栽
MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId];
//取盘号
string wareNum = serverResult.barcode;
int trayCode = TrayManager.GetTrayNum(0);
LogUtil.info("更新盘空满信息,托盘号【" + trayCode + "】,是否有料盘【" + true + "】,出库入库【" + 1 + "】");
TrayManager.UpdateTrayInfo(trayCode, true, ReelType.InStore, wareNum, posId, plateH, plateW);
// 判断PosID是否已经在入库或者在排队列表中,如果已经存在,加入列表失败
InOutParam param = new InOutParam(trayNum, wareNum, posId, plateH, plateW);
if (LineManager.Line.IsReviceInPosId(moveEquip, posId))
{
LineManager.Line.WarnMsg = "入库库位重复: " + param.ToStr() + " ,入库失败!";
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是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
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);
//StartInStoreMove(param);
TrayManager.UpdateTrayInfo(trayCode, true, 1, codeStr, posId, plateH, plateW);
}
}
}
......@@ -103,81 +91,6 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(deviceName + " " + ex.ToString());
}
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
}
}
internal static void UpdateTrayCode(int trayNum, string wareCode = "")
internal static void UpdateTrayCode(int trayNum, string wareCode = "" )
{
LogUtil.info( "更新托盘【" + trayNum + "】的条码为【" + wareCode + "】");
lock (fixtureMapLock)
......@@ -113,6 +113,19 @@ namespace OnlineStore.DeviceLibrary
if (fixtureCodeFullMap.ContainsKey(trayNum))
{
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
{
return true;
}
else if (swNum.Equals(1) || swNum.Equals(2))
else if (swNum.Equals(1) || swNum.Equals(3))
{
if (SidesWayStateMap[swNum].Equals(0))
{
......@@ -259,7 +272,7 @@ namespace OnlineStore.DeviceLibrary
/// 更新横移托盘的处理状态
/// </summary>
/// <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)
{
if (swNum <= 0)
......
......@@ -16,7 +16,7 @@ namespace OnlineStore.DeviceLibrary
private static List<string> RfIPList = new List<string>();
private static System.Timers.Timer conTimer = null;
internal static void ConnectRFIOList(List<string> rfioNameList)
public static void ConnectRFIOList(List<string> rfioNameList)
{
try {
if (conTimer == null)
......@@ -122,7 +122,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("连接RFIP模块 " + logName + " 出错:" + error.ToString());
}
}
internal static void CloseAllConnection()
public static void CloseAllConnection()
{
foreach (Reader reader in RFReaderMap.Values)
{
......
......@@ -193,11 +193,12 @@ namespace OnlineStore.DeviceLibrary
List<CodeInfo> cc = new List<CodeInfo>();
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);
});
taskList.Add(typeDeCode);
typeDeCode.Start();
}
}
});
......@@ -205,7 +206,7 @@ namespace OnlineStore.DeviceLibrary
Task.WaitAll(taskList.ToArray());
foreach (Task<List<CodeInfo>> t in taskList)
{
{
List<CodeInfo> cc = t.Result;
if (cc.Count > 0)
{
......
......@@ -57,6 +57,10 @@ namespace OnlineStore.DeviceLibrary
/// 料盘宽度
/// </summary>
public int PlateW { get; set; }
/// <summary>
/// 入库失败料盘,未扫到码或获取库位号失败
/// </summary>
public bool InStoreNG = false;
public bool EmergencyOut = false;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!