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;
......
......@@ -138,7 +138,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager.UpdateTrayNumError(-1, "");
}
//出料中,需要拦盘
if (NeedCurrTray(true ))
if (NeedCurrTray(true))
{
//preTrayNum = currMoveTrayNum;
// SecondMoveInfo.MoveParam = new InOutParam(currMoveTrayNum);
......@@ -192,7 +192,7 @@ namespace OnlineStore.DeviceLibrary
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】 ,需要出库,开始出库处理,升降伺服到P1点");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_201_UpDownToP1);
InStoreLog(" MO_201_UpDownToP1 紧急出料移栽:升降伺服到P1点" );
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);
//更新此托盘为空托盘
......
......@@ -43,9 +43,7 @@ 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;
}
//去掉直接丢料盘处理
......@@ -498,11 +496,7 @@ namespace OnlineStore.DeviceLibrary
//出库中,需要拦盘
if (CheckIsNeedOutStore())
{
//preTrayNum = currMoveTrayNum;
SecondMoveInfo.MoveParam = new InOutParam(currTrayNum);
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
return;
isNeed = true;
}
else if (isFull && IsInStoreNeed())
{
......@@ -567,9 +561,7 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
SecondMoveInfo.EndStepWait();
}
else
{
if (CheckIsNeedInStore())
else if (CheckIsNeedInStore())
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘号【" + currTrayNum + "】不是空盘,有对应的入库任务,等待移栽");
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_08_WaitInStore);
......@@ -577,9 +569,9 @@ namespace OnlineStore.DeviceLibrary
}
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(""))
{
......@@ -43,10 +43,6 @@ namespace OnlineStore.DeviceLibrary
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);
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if (LineServer.BoxCanInStore(moveEquip.DeviceID))
{
InOutParam param = new InOutParam(trayCode, 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() + " ,入库失败!");
}
LineServer.CheckInStorePos(storeId, param);
LogUtil.info("更新盘空满信息,托盘号【" + trayNum + "】,是否有料盘【" + true + "】,出库入库【" + 1 + "】");
TrayManager.UpdateTrayInfo(trayNum, true, ReelType.InStore, wareNum, posId, plateH, plateW);
//StartInStoreMove(param);
TrayManager.UpdateTrayInfo(trayCode, true, 1, codeStr, posId, plateH, plateW);
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if (LineServer.BoxCanInStore(moveEquip.DeviceID))
{
LineServer.CheckInStorePos(storeId, param);
}
}
}
......@@ -104,80 +92,5 @@ namespace OnlineStore.DeviceLibrary
}
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();
}
}
});
......
......@@ -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!