Commit 8d9109e8 刘韬

修改IB04_LineStart不在等待信号

1 个父辈 51bf90bb
......@@ -43,8 +43,8 @@
<add key ="InoutDefaultPosition" value ="1000"/>
<!--标签文件名称-->
<add key ="LabelName" value ="test2"/>
<!--打印机名称-->
<add key ="PrinterName" value ="ZDesigner GT800-300dpi EPL"/>
<!--打印机名称ZDesigner GT800-300dpi EPL-->
<add key ="PrinterName" value ="Microsoft Print to PDF"/>
<!--是否启用打印标签-->
<add key ="NeedPrintLabel" value ="0"/>
<add key ="StickingPosJudgment" value ="0"/>
......
......@@ -763,7 +763,7 @@ namespace OnlineStore.AutoCountClient
string reelId = txtReelId.Text;
string pn = txtPN.Text;
int p = 0;
string msg = SServerManager.Return_Material("测试按钮", pn + ";" + reelId, qty);
string msg = SServerManager.Return_Material("测试按钮", pn + ";" + reelId, qty,out _);
}
}
......
......@@ -776,7 +776,7 @@ namespace OnlineStore.AutoCountClient
LogUtil.error("点击:PrintLabel 打印标签 StartPrintLabel");
string code = txtPrintCode.Text;
string num = txtPringNum.Text;
equipBean.StartPrintLabel(code, num);
equipBean.StartPrintLabel(code, num,"test");
}
catch (Exception ex)
{
......
......@@ -666,7 +666,10 @@ namespace CodeLibrary
//HDCodeHelper.DecodeCode(hoImage, "QR Code", GetCodeParamFilePath("QR Code"), 0, 2500);
//HDCodeHelper.DecodeCode(hoImage, "Data Matrix ECC 200", GetCodeParamFilePath("Data Matrix ECC 200"), 0, 2500);
Console.WriteLine(t);
foreach (CodeInfo c in tlci)
{
Console.WriteLine($"{t},{c.CodeType},{c.CodeStr}");
}
}
catch { }
finally
......
......@@ -79,9 +79,9 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StepEnum.IB04_LineStart);
WorkLog(" 入口检测到料串,流水线转动 3000,等待料串完全进入轨道");
LineRun(MoveInfo);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_LineIn_Check, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_LineEnd_Check, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_LineIn_Check, IO_VALUE.HIGH));
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_LineEnd_Check, IO_VALUE.HIGH));
}
private void IB05_WaitTime()
......
......@@ -596,7 +596,8 @@ namespace OnlineStore.DeviceLibrary
{
printTask = Task.Factory.StartNew(delegate
{
StartPrintLabel(SecMoveInfo.MoveParam.WareCode, SecMoveInfo.MoveParam.WareCount.ToString());
string reelid = SecMoveInfo.MoveParam.WareCode;
StartPrintLabel(reelid, SecMoveInfo.MoveParam.WareCount.ToString(), SecMoveInfo.MoveParam.FactoryCode);
});
IOMove(IO_Type.Nozzle_Work, IO_VALUE.HIGH);
}
......@@ -836,8 +837,6 @@ namespace OnlineStore.DeviceLibrary
LabelYAxis.AbsMove(SecMoveInfo, Config.LabelY_P1, Config.LabelY_P1Speed);
LabelRAxis.AbsMove(SecMoveInfo, Config.LabelR_P2, Config.LabelR_P2Speed);
SecTickLog("贴标撤销");
}
else if (SecMoveInfo.IsStep(StepEnum.OL21_LableCancel2))
{
......@@ -846,15 +845,17 @@ namespace OnlineStore.DeviceLibrary
}
}
public void StartPrintLabel(string wareCode, string wareCount)
public void StartPrintLabel(string wareCode, string wareCount,string FactoryCode="")
{
try
{
LogUtil.info("调用 PrintLabel 打印标签 StartPrintLabel ,[" + wareCode + "] [" + wareCount + "] 开始");
Dictionary<string, string> text = new Dictionary<string, string>();
text.Add("aa", wareCode);
text.Add("bb", wareCount );
text.Add("cc", DateTime.Now.ToLongTimeString());
text.Add("Code", wareCode);
text.Add("Count", wareCount );
text.Add("DateTime", System.DateTime.Now.ToString("F"));
text.Add("FactoryCode", FactoryCode);
RobotManager.PrintBean.Print(text);
LogUtil.info(" PrintLabel 打印标签 StartPrintLabel 结束 ");
}
......
......@@ -450,7 +450,10 @@ namespace OnlineStore.DeviceLibrary
if (!isNg && SServerManager.CanConnect())
{
// string msg = "暂不上传";
string msg = SServerManager.Return_Material(Name, Work_ReelInfo.WareCode, Work_ReelInfo.WareCount);
string factoryCode;
string msg = SServerManager.Return_Material(Name, Work_ReelInfo.WareCode, Work_ReelInfo.WareCount,out factoryCode);
MoveInfo.MoveParam.FactoryCode = factoryCode;
Work_ReelInfo.FactoryCode = factoryCode;
if (!String.IsNullOrEmpty(msg))
{
LogUtil.error(Name + "上传【" + Work_ReelInfo.ToStr() + "】点料结果失败:" + msg + ",更新状态为NG");
......@@ -470,6 +473,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.MoveParam.IsNgReel = true;
Work_ReelInfo.IsNgReel = true;
//Work_ReelInfo.FactoryCode = MoveInfo.MoveParam.FactoryCode;
MoveInfo.MoveParam.NgMsg = NgMsg;
Work_ReelInfo.NgMsg = NgMsg;
outF = NgMsg;
......
......@@ -186,7 +186,7 @@ namespace OnlineStore.DeviceLibrary
if (findRightCode)
{
ccall.Add(c);
if (codeType == "QR Code")
//if (codeType == "QR Code")
nosave = false;
}
}
......
......@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
......@@ -88,12 +89,13 @@ namespace OnlineStore.DeviceLibrary
}
public static string Return_Material(string deviceName, string codeStr, int count)
public static string Return_Material(string deviceName, string codeStr, int count, out string FactoryCode)
{
// Parameter Value
//txtQty:
// txtReelId:
string msg = "";
FactoryCode = "";
try
{
string[] codeArray = codeStr.Split(';');
......@@ -122,6 +124,11 @@ namespace OnlineStore.DeviceLibrary
msg = resultStr.Substring(index, resultStr.Length - index).Replace("</ string >", "");
}
var m = Regex.Match(resultStr, "厂别[::\\s]*(.*?)<");
if (m.Success)
{
FactoryCode = m.Groups[1].Value.Trim();
}
}
catch (Exception ex)
{
......
......@@ -45,6 +45,11 @@ namespace OnlineStore.DeviceLibrary
public int WareCount = 0;
/// <summary>
/// 厂别
/// </summary>
public string FactoryCode = "";
/// <summary>
/// 入口位置:1=左侧入口,2=右侧入口
/// </summary>
public int InPosType = 0;
......@@ -77,11 +82,11 @@ namespace OnlineStore.DeviceLibrary
{
tP = "电阻测值";
}
return " [" + WareCode + "] " + "[" + PlateW + " X " + PlateH + "] " + "[" + (InPosType.Equals(1) ? "左侧入口" : "右侧入口") + "-->" + tP + "]";
return " [" + WareCode + "][" + FactoryCode + "][" + PlateW + " X " + PlateH + "] " + "[" + (InPosType.Equals(1) ? "左侧入口" : "右侧入口") + "-->" + tP + "]";
}
public string OutStr()
{
return "[" + WareCode + "] [ " + PlateW + "X" + PlateH + " ] [" + WareCount + "]" + (IsNgReel ? "[NG料:" + NgMsg + "]" : "") + "";
return "[" + WareCode + "] [" +FactoryCode + "] [ " + PlateW + "X" + PlateH + " ] [" + WareCount + "]" + (IsNgReel ? "[NG料:" + NgMsg + "]" : "") + "";
}
public int Get_Inout_P2(InputEquip_Config config)
{
......@@ -151,10 +156,11 @@ namespace OnlineStore.DeviceLibrary
this.WareCount = reel.WareCount;
this.IsNgReel = reel.IsNgReel;
this.NgMsg = reel.NgMsg;
this.FactoryCode = reel.FactoryCode;
}
public ReelInfo GetReelInfo()
{
ReelInfo reel = new ReelInfo(WareCode, PlateW, PlateH, WareCount, IsNgReel, NgMsg);
ReelInfo reel = new ReelInfo(WareCode, PlateW, PlateH, WareCount, FactoryCode, IsNgReel, NgMsg);
return reel;
}
}
......@@ -163,7 +169,7 @@ namespace OnlineStore.DeviceLibrary
public class ReelInfo
{
public ReelInfo(string code = "", int plateW = 0, int plateH = 0, int count = 0, bool IsNg = false, string msg = "")
public ReelInfo(string code = "", int plateW = 0, int plateH = 0, int count = 0, string factoryCode="", bool IsNg = false, string msg = "")
{
this.WareCode = code;
this.PlateH = plateH;
......@@ -171,6 +177,7 @@ namespace OnlineStore.DeviceLibrary
this.WareCount = count;
this.IsNgReel = IsNg;
this.NgMsg = msg;
this.FactoryCode = factoryCode;
}
/// <summary>
/// 物品二维码信息
......@@ -189,19 +196,19 @@ namespace OnlineStore.DeviceLibrary
public int WareCount = 0;
public string FactoryCode ="";
public bool IsNgReel = false;
public string NgMsg = "";
public string ToStr()
{
return "[" + WareCode + "] [" + PlateW + "X" + PlateH + "] [数量:" + WareCount + "]" + (IsNgReel ? "[NG料:" + NgMsg + "]" : "") + "";
return "[" + WareCode + "] [" + PlateW + "X" + PlateH + "] [数量:" + WareCount + "] [厂别:" + FactoryCode + "]" + (IsNgReel ? "[NG料:" + NgMsg + "]" : "") + "";
}
public ReelInfo GetReelInfo()
{
ReelInfo reel = new ReelInfo(WareCode, PlateW, PlateH, WareCount, IsNgReel, NgMsg);
ReelInfo reel = new ReelInfo(WareCode, PlateW, PlateH, WareCount, FactoryCode, IsNgReel, NgMsg);
return reel;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!