Commit 3c1ea47d LN

入料机构出入库代码

1 个父辈 148e3fdb
此文件类型无法预览
此文件类型无法预览
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -456,9 +457,9 @@ namespace OnlineStore.DeviceLibrary
//判断是否不连接服务器
if (string.IsNullOrEmpty(serverAddr))
{
LogUtil.error (deviceName + "GetPosId[" + codeStr + "][" + height + "][" + width + "]:未找到服务器地址 ");
LogUtil.error(deviceName + "GetPosId[" + codeStr + "][" + height + "][" + width + "]:未找到服务器地址 ");
result.Msg = "未找到服务器地址";
result.Param =InOutPosInfo.NewNgPos( codeStr, "", height, width,"" );
result.Param = InOutPosInfo.NewNgPos(codeStr, "", height, width, "");
return result;
}
......@@ -488,7 +489,7 @@ namespace OnlineStore.DeviceLibrary
{
result.Msg = deviceName + " 【" + codeStr + "】结果:没有收到服务器反馈,调用 cancelPutInTask ";
cancelPutInTask(deviceName, codeStr);
result.Param = InOutPosInfo.NewNgPos( codeStr, "", height, width, "没有收到服务器反馈");
result.Param = InOutPosInfo.NewNgPos(codeStr, "", height, width, "没有收到服务器反馈");
result.Param.rfid = rfid;
result.Param.IsNG = true;
return result;
......@@ -503,7 +504,7 @@ namespace OnlineStore.DeviceLibrary
int rfidloc = FormUtil.GetIntValue(serverResult.rfidLoc);
int pH = FormUtil.GetIntValue(serverResult.plateH);
int pW = FormUtil.GetIntValue(serverResult.plateW);
result.Param = new InOutPosInfo( serverResult.barcode, serverResult.posId, pW,pH, urgentReel, cutReel, smallReel, serverResult.rfid, rfidloc);
result.Param = new InOutPosInfo(serverResult.barcode, serverResult.posId, pW, pH, urgentReel, cutReel, smallReel, serverResult.rfid, rfidloc);
LogUtil.info(deviceName + "收到出库命令: " + result.Param.ToStr() + " ");
return result;
......@@ -513,7 +514,7 @@ namespace OnlineStore.DeviceLibrary
result.Result = serverResult.result;
//result.Msg = deviceName + " 【" + codeStr + "】结果:" + serverResult.msg;
result.Msg = serverResult.msg;
result.Param = InOutPosInfo.NewNgPos( codeStr, "", height, width, serverResult.msg);
result.Param = InOutPosInfo.NewNgPos(codeStr, "", height, width, serverResult.msg);
result.Param.rfid = rfid;
return result;
}
......@@ -532,28 +533,21 @@ namespace OnlineStore.DeviceLibrary
//根据库位号查找移栽
// 判断PosID是否已经在入库或者在排队列表中,如果已经存在,加入列表失败
result.Param = new InOutPosInfo( serverResult.barcode, posId,width, height);
result.Param = new InOutPosInfo(serverResult.barcode, posId, width, height);
result.Param.rfid = rfid;
//int storeId = result.Param.GetStoreId();
//if (StoreManager.XLRStore.MoveEquipMap.ContainsKey(storeId))
//{
// MoveEquip moveEquip = StoreManager.XLRStore.MoveEquipMap[storeId];
// if (StoreManager.XLRStore.IsReviceInPosId(moveEquip, posId))
// {
// result.Param.IsNG = true;
// result.Param.NgMsg = "入库库位重复";
// result.Msg = deviceName + ("收到服务器入库命令 " + "入库库位重复: " + result.Param.ToStr() + " ,入库失败!");
// return result;
// }
// LogUtil.info(deviceName + "收到入库命令: " + result.Param.ToStr() + " ");
//}
//else
//{
// result.Param.IsNG = true;
// result.Param.NgMsg = "未找到料仓[" + storeId + "]";
// result.Msg = deviceName + ("收到服务器入库命令 " + "未找到料仓[" + storeId + "]: " + result.Param.ToStr() + " ,入库失败!");
// return result;
//}
BoxPosition position = CSVPositionReader<BoxPosition>.GetPositon(posId);
if (position == null)
{
result.Param.IsNG = true;
result.Param.NgMsg = "未找到库位[" + position + "]";
result.Msg = deviceName + ("收到服务器入库命令 " + ",未找到库位: " + result.Param.ToStr() + " ,入库失败!");
return result;
}
else
{
LogUtil.info(deviceName + "收到入库命令: " + result.Param.ToStr() + " ");
return result;
}
}
}
catch (Exception ex)
......
......@@ -412,6 +412,10 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 入料机构入料 1100 开始
/// <summary>
/// 入料料串取料:判断旋转轴是否在P1,不在的话直接到P1
/// </summary>
II00_MiddleToP1=1100,
/// <summary>
/// 入库料串取料:升降轴到达P1
......
......@@ -54,8 +54,10 @@ namespace OnlineStore.DeviceLibrary
BatchMove_A = new BatchMoveBean(Config, BatchAxis_A, 1);
BatchMove_B = new BatchMoveBean(config, BatchAxis_B, 2);
runStatus = RunStatus.Wait;
}
#region 启动,复位,停止 处理
public override bool StartRun()
{
......@@ -136,7 +138,7 @@ namespace OnlineStore.DeviceLibrary
// 1,处于A,B,NG料口是,可以直接回取料升降轴。
// 2,处于A, B两个暂存区时,升降轴先运动到该暂存区的取放料高点,旋转轴再回原点或待机点。
//验证旋转轴位置 TODO
if (MiddleAxis.IsInPosition(Config.Middle_P4_AUpper) )
if (MiddleAxis.IsInPosition(Config.Middle_P4_AUpper))
{
MoveInfo.NextMoveStep(StepEnum.IR02_UpdownUpMove);
LogInfo($"复位 {MoveInfo.SLog}:当前旋转轴在 A上暂存区 {Config.Middle_P4_AUpper},升降轴先到P4:{Config.Updown_P4_AUpperH}");
......@@ -204,7 +206,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(StepEnum.IR07_ClampRelax);
LogInfo($"复位{MoveInfo.SLog}:夹爪气缸放松");
ClampRelax(MoveInfo,MoveInfo.MoveParam.PosInfo.barcode);
ClampRelax(MoveInfo, MoveInfo.MoveParam.PosInfo.barcode);
}
else if (MoveInfo.IsStep(StepEnum.IR07_ClampRelax))
{
......@@ -246,6 +248,7 @@ namespace OnlineStore.DeviceLibrary
AgvClient.SetStatus(Config.AgvName_A);
AgvClient.SetStatus(Config.AgvName_B);
runStatus = RunStatus.Wait;
MoveInfo.EndMove();
BatchMove_A.StopMove();
......@@ -264,6 +267,7 @@ namespace OnlineStore.DeviceLibrary
StopMove();
}
#endregion
protected override void BaseTimerProcess()
{
......@@ -274,63 +278,75 @@ namespace OnlineStore.DeviceLibrary
BusyMoveProcess();
IOTimeOutProcess();
//判断流水线打开了才可以运行
List<BatchMoveBean> BatchMoveList = new List<BatchMoveBean>() { BatchMove_A, BatchMove_B };
if (MoveInfo.MoveType.Equals(MoveType.None) && NoErrorAlarm())
{
//若左侧或右侧在等待扫码结束的状态,需要开始去取料
if (BatchMove_A.MoveInfo.MoveType.Equals(MoveType.InStore) && BatchMove_A.MoveInfo.IsStep(StepEnum.IB10_ScanOK))
foreach (BatchMoveBean moveBean in BatchMoveList)
{
LogInfo("A侧开始取料");
StartInstore(BatchMove_A.GetInstoreParam());
}
else if (BatchMove_B.MoveInfo.MoveType.Equals(MoveType.InStore) && BatchMove_B.MoveInfo.IsStep(StepEnum.IB10_ScanOK))
if (moveBean.MoveInfo.MoveType.Equals(MoveType.InStore) && moveBean.MoveInfo.IsStep(StepEnum.IB10_ScanOK))
{
LogInfo("B侧开始取料");
StartInstore(BatchMove_B.GetInstoreParam());
LogInfo(moveBean.Name + "开始取料");
StartInstore(moveBean.GetInstoreParam());
break;
}
}
}
//TODO 如果出料暂存区有料,且空料串准备完成,开始出料
else if (BatchMove_A.MoveInfo.MoveType.Equals(MoveType.OutStore) && BatchMove_A.MoveInfo.IsStep(StepEnum.IS11_ShelfReady))
if (MoveInfo.MoveType.Equals(MoveType.None) && NoErrorAlarm())
{
if (BufferDataManager.AOutStoreInfo != null)
if (CheckStartOutPos("A下暂存区", BufferDataManager.AOutStoreInfo, BatchMoveList))
{
InOutParam param = new InOutParam(BufferDataManager.AOutStoreInfo);
param.ShelfType = 1;
LogInfo($"A下暂存区物料{param.PosInfo.ToStr()},准备出库到料串{param.ShelfType}");
StartOutstore(param);
}
else if (BufferDataManager.BOutStoreInfo != null)
else if (CheckStartOutPos("B下暂存区", BufferDataManager.BOutStoreInfo, BatchMoveList))
{
InOutParam param = new InOutParam(BufferDataManager.AOutStoreInfo);
param.ShelfType = 1;
LogInfo($"B下暂存区物料{param.PosInfo.ToStr()},准备出库到料串{param.ShelfType}");
StartOutstore(param);
}
}
else if (BatchMove_B.MoveInfo.MoveType.Equals(MoveType.OutStore) && BatchMove_B.MoveInfo.IsStep(StepEnum.IS11_ShelfReady))
else
{
//如果有物料且不能放料,需要送一个料串离开
if (BufferDataManager.AOutStoreInfo != null)
{
InOutParam param = new InOutParam(BufferDataManager.AOutStoreInfo);
param.ShelfType = 2;
LogInfo($"A下暂存区物料{param.PosInfo.ToStr()},准备出库到料串{param.ShelfType}");
StartOutstore(param);
CheckStartOutPos("A下暂存区", BufferDataManager.AOutStoreInfo, BatchMoveList, true);
}
else if (BufferDataManager.BOutStoreInfo != null)
{
InOutParam param = new InOutParam(BufferDataManager.AOutStoreInfo);
param.ShelfType = 2;
LogInfo($"B下暂存区物料{param.PosInfo.ToStr()},准备出库到料串{param.ShelfType}");
StartOutstore(param);
CheckStartOutPos("B下暂存区", BufferDataManager.BOutStoreInfo, BatchMoveList, true);
}
}
}
foreach (BatchMoveBean moveBean in BatchMoveList)
{
moveBean.TimerProcess();
}
if (NoErrorAlarm())
{
CheckAxisAlarm();
}
}
private bool CheckStartOutPos(string posType, InOutPosInfo posInfo, List<BatchMoveBean> BatchMoveList, bool shelfAutoLeave = false)
{
if (posInfo != null)
{
foreach (BatchMoveBean moveBean in BatchMoveList)
{
if (moveBean.ShelfReadyOut(BufferDataManager.AOutStoreInfo, shelfAutoLeave))
{
InOutParam param = new InOutParam(BufferDataManager.AOutStoreInfo.ToCopy());
param.ShelfType = moveBean.ShelfType;
LogInfo($"{posType}物料{param.PosInfo.ToStr()},准备出库到料串{param.ShelfType}");
StartOutstore(param);
return true;
break;
}
}
}
return false;
}
internal bool CanStartWork()
{
......@@ -351,7 +367,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
}
return true ;
return true;
}
private DateTime checkAlarmTime = DateTime.Now;
......@@ -383,13 +399,13 @@ namespace OnlineStore.DeviceLibrary
return;
}
}
if (AxisIsAlarm(BatchMove_A.BatchAxis,false ))
if (AxisIsAlarm(BatchMove_A.BatchAxis, false))
{
BatchMove_A.WarnMsg = WarnMsg;
BatchMove_A.Alarm(AlarmType.AxisAlarm);
return;
}
if (AxisIsAlarm(BatchMove_B.BatchAxis,false ))
if (AxisIsAlarm(BatchMove_B.BatchAxis, false))
{
BatchMove_B.WarnMsg = WarnMsg;
BatchMove_B.Alarm(AlarmType.AxisAlarm);
......@@ -421,7 +437,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private void ClampWork(DeviceMoveInfo moveInfo,bool isCheck,params string[] codes)
private void ClampWork(DeviceMoveInfo moveInfo, bool isCheck, params string[] codes)
{
if (Config.UseClampJaw.Equals(1))
{
......@@ -433,7 +449,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private void ClampRelax(DeviceMoveInfo moveInfo ,params string[] codes)
private void ClampRelax(DeviceMoveInfo moveInfo, params string[] codes)
{
if (Config.UseClampJaw.Equals(1))
{
......@@ -445,6 +461,26 @@ namespace OnlineStore.DeviceLibrary
}
}
public bool IsNoReelAlarm()
{
if (runStatus.Equals(RunStatus.Busy) && alarmType.Equals(AlarmType.IoSingleTimeOut))
{
if (MoveInfo.MoveType.Equals(MoveType.InStore) && MoveInfo.MoveStep.Equals(StepEnum.II08_ClampWork))
{
return true;
}
else if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.MoveStep.Equals(StepEnum.IO05_ClampWork))
{
return true;
}
else if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.MoveStep.Equals(StepEnum.IO15_ClampWork))
{
return true;
}
}
return false;
}
}
}
......@@ -137,7 +137,7 @@
this.tabPage2.Controls.Add(this.panel1);
this.tabPage2.Location = new System.Drawing.Point(4, 29);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(192, 67);
this.tabPage2.Size = new System.Drawing.Size(988, 605);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = " 设备状态 ";
this.tabPage2.UseVisualStyleBackColor = true;
......@@ -148,7 +148,7 @@
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(192, 67);
this.panel1.Size = new System.Drawing.Size(988, 605);
this.panel1.TabIndex = 1;
//
// tableLayoutPanel1
......@@ -173,7 +173,7 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 19.04762F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 19.04762F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(192, 67);
this.tableLayoutPanel1.Size = new System.Drawing.Size(988, 605);
this.tableLayoutPanel1.TabIndex = 0;
//
// InputControl
......@@ -184,10 +184,10 @@
this.tableLayoutPanel1.SetColumnSpan(this.InputControl, 2);
this.InputControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.InputControl.EquipText = "上料机构";
this.InputControl.Location = new System.Drawing.Point(3, 43);
this.InputControl.Location = new System.Drawing.Point(3, 376);
this.InputControl.MoveInfo = "暂无出入库";
this.InputControl.Name = "InputControl";
this.InputControl.Size = new System.Drawing.Size(186, 6);
this.InputControl.Size = new System.Drawing.Size(982, 109);
this.InputControl.TabIndex = 5;
this.InputControl.WorkStatus = "暂未启动";
//
......@@ -197,10 +197,10 @@
this.ReelControlA1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.ReelControlA1.ColorStatus = System.Drawing.Color.White;
this.ReelControlA1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ReelControlA1.Location = new System.Drawing.Point(3, 25);
this.ReelControlA1.Location = new System.Drawing.Point(3, 204);
this.ReelControlA1.Name = "ReelControlA1";
this.ReelControlA1.ReelText = "暂存区物料";
this.ReelControlA1.Size = new System.Drawing.Size(90, 3);
this.ReelControlA1.Size = new System.Drawing.Size(488, 80);
this.ReelControlA1.TabIndex = 0;
//
// ReelControlA2
......@@ -209,10 +209,10 @@
this.ReelControlA2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.ReelControlA2.ColorStatus = System.Drawing.Color.White;
this.ReelControlA2.Dock = System.Windows.Forms.DockStyle.Fill;
this.ReelControlA2.Location = new System.Drawing.Point(3, 34);
this.ReelControlA2.Location = new System.Drawing.Point(3, 290);
this.ReelControlA2.Name = "ReelControlA2";
this.ReelControlA2.ReelText = "暂存区物料";
this.ReelControlA2.Size = new System.Drawing.Size(90, 3);
this.ReelControlA2.Size = new System.Drawing.Size(488, 80);
this.ReelControlA2.TabIndex = 1;
//
// ReelControlB1
......@@ -221,10 +221,10 @@
this.ReelControlB1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.ReelControlB1.ColorStatus = System.Drawing.Color.White;
this.ReelControlB1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ReelControlB1.Location = new System.Drawing.Point(99, 25);
this.ReelControlB1.Location = new System.Drawing.Point(497, 204);
this.ReelControlB1.Name = "ReelControlB1";
this.ReelControlB1.ReelText = "暂存区物料";
this.ReelControlB1.Size = new System.Drawing.Size(90, 3);
this.ReelControlB1.Size = new System.Drawing.Size(488, 80);
this.ReelControlB1.TabIndex = 2;
//
// ReelControlB2
......@@ -233,10 +233,10 @@
this.ReelControlB2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.ReelControlB2.ColorStatus = System.Drawing.Color.White;
this.ReelControlB2.Dock = System.Windows.Forms.DockStyle.Fill;
this.ReelControlB2.Location = new System.Drawing.Point(99, 34);
this.ReelControlB2.Location = new System.Drawing.Point(497, 290);
this.ReelControlB2.Name = "ReelControlB2";
this.ReelControlB2.ReelText = "暂存区物料";
this.ReelControlB2.Size = new System.Drawing.Size(90, 3);
this.ReelControlB2.Size = new System.Drawing.Size(488, 80);
this.ReelControlB2.TabIndex = 3;
//
// BoxControl
......@@ -250,7 +250,7 @@
this.BoxControl.Location = new System.Drawing.Point(3, 3);
this.BoxControl.MoveInfo = "暂无出入库";
this.BoxControl.Name = "BoxControl";
this.BoxControl.Size = new System.Drawing.Size(186, 16);
this.BoxControl.Size = new System.Drawing.Size(982, 195);
this.BoxControl.TabIndex = 4;
this.BoxControl.WorkStatus = "暂未启动";
//
......@@ -261,10 +261,10 @@
this.ShelfAControl.ColorStatus = System.Drawing.Color.White;
this.ShelfAControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.ShelfAControl.EquipText = "A料口";
this.ShelfAControl.Location = new System.Drawing.Point(3, 55);
this.ShelfAControl.Location = new System.Drawing.Point(3, 491);
this.ShelfAControl.MoveInfo = "暂无出入库";
this.ShelfAControl.Name = "ShelfAControl";
this.ShelfAControl.Size = new System.Drawing.Size(90, 9);
this.ShelfAControl.Size = new System.Drawing.Size(488, 111);
this.ShelfAControl.TabIndex = 6;
this.ShelfAControl.WorkStatus = "暂未启动";
//
......@@ -275,10 +275,10 @@
this.ShelfBControl.ColorStatus = System.Drawing.Color.White;
this.ShelfBControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.ShelfBControl.EquipText = "B料口";
this.ShelfBControl.Location = new System.Drawing.Point(99, 55);
this.ShelfBControl.Location = new System.Drawing.Point(497, 491);
this.ShelfBControl.MoveInfo = "暂无出入库";
this.ShelfBControl.Name = "ShelfBControl";
this.ShelfBControl.Size = new System.Drawing.Size(90, 9);
this.ShelfBControl.Size = new System.Drawing.Size(488, 111);
this.ShelfBControl.TabIndex = 7;
this.ShelfBControl.WorkStatus = "暂未启动";
//
......
......@@ -44,8 +44,8 @@ namespace OnlineStore.XLRStore
Application.Exit();
return;
}
LoadStoreData();
LoadStoreData();
this.Opacity = 100;
this.Visible = true;
......@@ -112,9 +112,36 @@ namespace OnlineStore.XLRStore
InputControl.InitData(StoreManager.XLRStore.inputEquip.Name);
ShelfAControl.InitData(StoreManager.XLRStore.inputEquip.BatchMove_A.Name);
ShelfBControl.InitData(StoreManager.XLRStore.inputEquip.BatchMove_B.Name);
BoxControl.DoubleClick += BoxControl_DoubleClick;
InputControl.DoubleClick += InputControl_DoubleClick;
ShelfAControl.DoubleClick += ShelfAControl_DoubleClick;
ShelfBControl.DoubleClick += ShelfBControl_DoubleClick;
LoadOk = true;
}
private void ShelfBControl_DoubleClick(object sender, EventArgs e)
{
tabControl1.SelectedIndex = 2;
inputEquip.tabControl1.SelectedIndex = 4;
}
private void ShelfAControl_DoubleClick(object sender, EventArgs e)
{
tabControl1.SelectedIndex = 2;
inputEquip.tabControl1.SelectedIndex = 3;
}
private void InputControl_DoubleClick(object sender, EventArgs e)
{
tabControl1.SelectedIndex = 2;
inputEquip.tabControl1.SelectedIndex = 0;
}
private void BoxControl_DoubleClick(object sender, EventArgs e)
{
tabControl1.SelectedIndex = 3;
}
private void LinkClear_ClickA1(object sender, EventArgs e)
{
if (BufferDataManager.AInStoreInfo == null)
......
......@@ -42,7 +42,15 @@ namespace OnlineStore.XLRStore
}
lblWarnMsg.Text = moveBean.WarnMsg;
lblCurrInfo.Text = moveBean.GetMoveStr();
lblAgvInfo.Text = "AGV " + moveBean.AgvName + " :" + AgvClient.GetAction(moveBean.AgvName);
lblAgvInfo.Text = "AGV " + moveBean.Config.AgvName + " :" + AgvClient.GetAction(moveBean.Config.AgvName);
if (StoreManager.XLRStore.inputEquip.runStatus > RunStatus.Wait)
{
btnReset.Enabled = true;
}
else
{
btnReset.Enabled = false;
}
}
catch (Exception ex)
{
......@@ -72,11 +80,11 @@ namespace OnlineStore.XLRStore
this.chbAutoOut.Checked = moveBean.ShelfAutoOut;
axisMoveControl1.LoadData(StoreManager.XLRStore.inputEquip, new AxisBean[] { moveBean.BatchAxis });
batchAxisP1.SetMoveData(moveBean.BatchAxis, StoreManager.XLRStore.inputEquip.Config.BatchAxis_P1Speed, moveBean.BatchAxisP1);
batchAxisP2.SetMoveData(moveBean.BatchAxis, StoreManager.XLRStore.inputEquip.Config.BatchAxis_P2Speed, moveBean.BatchAxisP2 );
batchAxisP1.SetMoveData(moveBean.BatchAxis, StoreManager.XLRStore.inputEquip.Config.BatchAxis_P1Speed, moveBean.Config.BatchAxisP1);
batchAxisP2.SetMoveData(moveBean.BatchAxis, StoreManager.XLRStore.inputEquip.Config.BatchAxis_P2Speed, moveBean.Config.BatchAxisP2 );
lblWarnMsg.Text = moveBean.WarnMsg;
lblCurrInfo.Text = moveBean.GetMoveStr();
lblAgvInfo.Text = "AGV " + moveBean.AgvName + " :" + AgvClient.GetAction(moveBean.AgvName);
lblAgvInfo.Text = "AGV " + moveBean.Config.AgvName + " :" + AgvClient.GetAction(moveBean.Config.AgvName);
IsLoad = true;
}
......@@ -90,7 +98,7 @@ namespace OnlineStore.XLRStore
private void btnStart_Click(object sender, EventArgs e)
{
moveBean.Reset();
LogUtil.info(moveBean.Name + "点击:" + btnStart.Text);
LogUtil.info(moveBean.Name + "点击:" + btnReset.Text);
}
......@@ -98,9 +106,9 @@ namespace OnlineStore.XLRStore
{
int p1 = batchAxisP1.PointValue;
int p2 = batchAxisP2.PointValue;
moveBean.BatchAxisP1 = p1;
moveBean.BatchAxisP2 = p2;
if (moveBean.EquipType.Equals(1))
moveBean.Config.BatchAxisP1 = p1;
moveBean.Config.BatchAxisP2 = p2;
if (moveBean.ShelfType.Equals(1))
{
StoreManager.XLRStore.inputEquip.Config.BatchAxisP1_A = p1;
StoreManager.XLRStore.inputEquip.Config.BatchAxisP2_A = p2;
......@@ -129,8 +137,8 @@ namespace OnlineStore.XLRStore
if (isServoOn && isStop)
{
//判断提升轴是否停止且到位
TargetP2 = moveBean.BatchAxisP2;
LogUtil.info(moveBean.Name + "点击:" + btnStartTest.Text + ",目标位置:" + moveBean.BatchAxisP2);
TargetP2 = moveBean.Config.BatchAxisP2;
LogUtil.info(moveBean.Name + "点击:" + btnStartTest.Text + ",目标位置:" + moveBean.Config.BatchAxisP2);
moveBean.BatchAxisToP2(true, false, true);
lblTestMsg.Text = "开始入料运动,目标位置[" + TargetP2 + "] ,开始位置[" + moveBean.StartMovePosition + "],";
StartTest = true;
......@@ -235,7 +243,7 @@ namespace OnlineStore.XLRStore
{
return;
}
string camera = moveBean.CameraName;
string camera = moveBean.Config.CameraName;
List<string> LastCodeList = CodeManager.CameraScan(camera, moveBean.Name.Trim() + "测试");
string msg = CodeManager.ProcessCode(LastCodeList);
LogUtil.info(moveBean.Name + "[" + camera + "]扫码测试结果:\r\n" + msg);
......
......@@ -202,6 +202,23 @@ namespace OnlineStore.XLRStore
}
lblThisSta.Text = inputEquip.WarnMsg;
lblMoveInfo.Text = inputEquip.GetMoveStr();
if (inputEquip.runStatus.Equals(RunStatus.Runing) && inputEquip.MoveInfo.MoveType.Equals(MoveType.None))
{
groupBox12.Enabled = true;
}
else
{
groupBox12.Enabled = false;
}
if (inputEquip.IsNoReelAlarm() && (!inputEquip.ClampEmptyMove))
{
btnHlhasReel.Visible = true;
}
else
{
btnHlhasReel.Visible = false;
}
string text = "";
}
......@@ -289,6 +306,13 @@ namespace OnlineStore.XLRStore
private void FrmInputEquip_Load(object sender, EventArgs e)
{
cmbInstoreShelf.SelectedIndex = 0;
cmbInstoreTargetP.SelectedIndex = 0;
cmbOutStartP.SelectedIndex = 0;
cmbOutShelf.SelectedIndex = 0;
LoadPosList(cmbInstorePos, 0);
LoadPosList(cmbOutstorePos, 0);
chbDebug.Checked = inputEquip.IsDebug;
chbMoveStop.Checked = inputEquip.MoveStop;
if (inputEquip.ClampJaw == null)
......@@ -618,9 +642,73 @@ namespace OnlineStore.XLRStore
chbPointEditEnable.Checked = false;
}
private void tabPage2_Click(object sender, EventArgs e)
private void BtnInStoreTest_Click(object sender, EventArgs e)
{
int startShelf = cmbInstoreShelf.SelectedIndex + 1;
string pos = cmbInstorePos.Text;
if (String.IsNullOrEmpty(pos))
{
MessageBox.Show("请选择目标库位", "提示" );
return;
}
BoxPosition posiiton = CSVPositionReader<BoxPosition>.GetPositon(pos);
InOutParam param = new InOutParam(new InOutPosInfo("InstoreTEST", pos,posiiton.BagHigh,posiiton.BagWidth));
param.ShelfType = startShelf;
LogUtil.info("点击 " + BtnInStoreTest.Text + " :料串["+ startShelf +"]->" + param.PosInfo.ToStr());
inputEquip.StartInstore(param);
}
private void btnOutStoreTest_Click(object sender, EventArgs e)
{
int startShelf = cmbOutShelf.SelectedIndex + 1;
string pos = cmbOutstorePos.Text;
if (String.IsNullOrEmpty(pos))
{
MessageBox.Show("请选择目标库位", "提示");
return;
}
BoxPosition posiiton = CSVPositionReader<BoxPosition>.GetPositon(pos);
InOutParam param = new InOutParam(new InOutPosInfo("OutstoreTEST", pos, posiiton.BagHigh, posiiton.BagWidth));
param.ShelfType = startShelf;
LogUtil.info("点击 " + btnOutStoreTest.Text + " :" + param.PosInfo.ToStr()+ "->料串[" + startShelf + "]");
inputEquip.StartOutstore(param);
}
private void cmbInstoreTargetP_SelectedIndexChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
LoadPosList(cmbInstorePos, cmbInstoreTargetP.SelectedIndex);
}
private void cmbOutShelf_SelectedIndexChanged(object sender, EventArgs e)
{
if (!IsLoad)
{
return;
}
LoadPosList(cmbOutstorePos, cmbOutStartP.SelectedIndex);
}
private void LoadPosList(ComboBox cmb, int pIndex)
{
List<string> allList = StoreManager.XLRStore.boxEquip.PositionNumList;
List<string> positions = new List<string>();
if (pIndex.Equals(0))
{
positions = (from m in StoreManager.XLRStore.boxEquip.PositionNumList where m.Contains("AA") select m).ToList<string>();
} else if (pIndex.Equals(1))
{
positions = (from m in StoreManager.XLRStore.boxEquip.PositionNumList where m.Contains("BB") select m).ToList<string>();
}
cmb.Items.Clear();
cmb.DataSource = positions;
if (positions.Count > 0)
{
cmb.SelectedIndex = 0;
}
}
}
......
......@@ -53,7 +53,7 @@
this.lblShelf.TabIndex = 0;
this.lblShelf.Text = "料架号:";
this.lblShelf.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblShelf.DoubleClick += new System.EventHandler(this.lblStatus_DoubleClick);
this.lblShelf.DoubleClick += new System.EventHandler(this.panName_DoubleClick_1);
this.lblShelf.MouseEnter += new System.EventHandler(this.lblDebug_MouseEnter);
this.lblShelf.MouseLeave += new System.EventHandler(this.lblDebug_MouseLeave);
//
......@@ -71,7 +71,7 @@
this.lblText.TabIndex = 1;
this.lblText.Text = "移栽D1-1_1";
this.lblText.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.lblText.DoubleClick += new System.EventHandler(this.lblName_DoubleClick);
this.lblText.DoubleClick += new System.EventHandler(this.panName_DoubleClick_1);
this.lblText.MouseEnter += new System.EventHandler(this.lblDebug_MouseEnter);
this.lblText.MouseLeave += new System.EventHandler(this.lblDebug_MouseLeave);
//
......@@ -89,7 +89,7 @@
this.lblStatus.TabIndex = 2;
this.lblStatus.Text = "暂未启动";
this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblStatus.DoubleClick += new System.EventHandler(this.lblStatus_DoubleClick);
this.lblStatus.DoubleClick += new System.EventHandler(this.panName_DoubleClick_1);
this.lblStatus.MouseEnter += new System.EventHandler(this.lblDebug_MouseEnter);
this.lblStatus.MouseLeave += new System.EventHandler(this.lblDebug_MouseLeave);
//
......@@ -107,7 +107,7 @@
this.lblMoveInfo.TabIndex = 3;
this.lblMoveInfo.Text = "暂无出入库";
this.lblMoveInfo.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblMoveInfo.DoubleClick += new System.EventHandler(this.lblStatus_DoubleClick);
this.lblMoveInfo.DoubleClick += new System.EventHandler(this.panName_DoubleClick_1);
this.lblMoveInfo.MouseEnter += new System.EventHandler(this.lblDebug_MouseEnter);
this.lblMoveInfo.MouseLeave += new System.EventHandler(this.lblDebug_MouseLeave);
//
......@@ -122,7 +122,7 @@
this.lblDebug.Size = new System.Drawing.Size(48, 17);
this.lblDebug.TabIndex = 5;
this.lblDebug.Text = "启用✔";
this.lblDebug.DoubleClick += new System.EventHandler(this.lblStatus_DoubleClick);
this.lblDebug.DoubleClick += new System.EventHandler(this.panName_DoubleClick_1);
this.lblDebug.MouseEnter += new System.EventHandler(this.lblDebug_MouseEnter);
this.lblDebug.MouseLeave += new System.EventHandler(this.lblDebug_MouseLeave);
//
......@@ -138,7 +138,7 @@
this.panName.Name = "panName";
this.panName.Size = new System.Drawing.Size(248, 28);
this.panName.TabIndex = 7;
this.panName.DoubleClick += new System.EventHandler(this.panName_DoubleClick);
this.panName.DoubleClick += new System.EventHandler(this.panName_DoubleClick_1);
this.panName.MouseEnter += new System.EventHandler(this.lblDebug_MouseEnter);
this.panName.MouseLeave += new System.EventHandler(this.lblDebug_MouseLeave);
//
......@@ -155,7 +155,7 @@
this.lblWarn.Size = new System.Drawing.Size(242, 42);
this.lblWarn.TabIndex = 8;
this.lblWarn.Text = "暂无报警";
this.lblWarn.DoubleClick += new System.EventHandler(this.lblStatus_DoubleClick);
this.lblWarn.DoubleClick += new System.EventHandler(this.panName_DoubleClick_1);
this.lblWarn.MouseEnter += new System.EventHandler(this.lblDebug_MouseEnter);
this.lblWarn.MouseLeave += new System.EventHandler(this.lblDebug_MouseLeave);
//
......
......@@ -109,41 +109,6 @@ namespace OnlineStore.XLRStore
{
}
private void lblName_DoubleClick(object sender, EventArgs e)
{
this.OnDoubleClick(e);
}
private void lblName_MouseEnter(object sender, EventArgs e)
{
this.OnMouseEnter(e);
}
private void panName_MouseEnter(object sender, EventArgs e)
{
this.OnMouseEnter(e);
}
private void panName_DoubleClick(object sender, EventArgs e)
{
this.OnDoubleClick(e);
}
private void lblStatus_DoubleClick(object sender, EventArgs e)
{
this.OnDoubleClick(e);
}
private void lblStatus_MouseEnter(object sender, EventArgs e)
{
this.OnMouseEnter(e);
}
private void lblBox_MouseEnter(object sender, EventArgs e)
{
this.OnMouseEnter(e);
}
private void lblDebug_MouseEnter(object sender, EventArgs e)
{
......@@ -165,5 +130,10 @@ namespace OnlineStore.XLRStore
{
SelectStyle();
}
private void panName_DoubleClick_1(object sender, EventArgs e)
{
this.OnDoubleClick(e);
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!