Commit fb13a9c4 刘韬

更新翻译

1 个父辈 95a3c3ce
......@@ -165,6 +165,7 @@
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="FrmLabelEdit.resx">
<DependentUpon>FrmLabelEdit.cs</DependentUpon>
......@@ -222,8 +223,7 @@
<None Include="resources\ja-JP.lngres">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="resources\So1164自动扫码贴标机.xlsx" />
<None Include="resources\So1164自动扫码贴标机2.xlsx" />
<None Include="resources\NS200_Res.xlsx" />
<None Include="resources\zh-CN.lngres">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
......
......@@ -38,7 +38,9 @@ namespace AutoScanAndLabel
this.chbAutoRun = new System.Windows.Forms.CheckBox();
this.btn_labelDebug = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.listEdit_pn = new AutoScanAndLabel.UC.ListEditControl();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.listEditControl1 = new AutoScanAndLabel.UC.ListEditControl();
this.txt_code = new System.Windows.Forms.TextBox();
this.btn_codetest = new System.Windows.Forms.Button();
this.label_matchdebugstring = new System.Windows.Forms.Label();
......@@ -48,8 +50,6 @@ namespace AutoScanAndLabel
this.cb_IgnoreGratingSignal = new System.Windows.Forms.CheckBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.uC_U11 = new AutoScanAndLabel.UC_U1();
this.listEditControl1 = new AutoScanAndLabel.UC.ListEditControl();
this.listEdit_pn = new AutoScanAndLabel.UC.ListEditControl();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
......@@ -149,6 +149,18 @@ namespace AutoScanAndLabel
this.groupBox2.Text = "PN匹配规则";
this.groupBox2.Visible = false;
//
// listEdit_pn
//
this.listEdit_pn.Dock = System.Windows.Forms.DockStyle.Fill;
this.listEdit_pn.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listEdit_pn.ListFile = "config/pn.list";
this.listEdit_pn.Location = new System.Drawing.Point(3, 17);
this.listEdit_pn.Margin = new System.Windows.Forms.Padding(5);
this.listEdit_pn.Name = "listEdit_pn";
this.listEdit_pn.Size = new System.Drawing.Size(354, 158);
this.listEdit_pn.TabIndex = 3;
this.listEdit_pn.DataRefresh += new System.EventHandler(this.listEdit_pn_DataRefresh);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.listEditControl1);
......@@ -160,6 +172,18 @@ namespace AutoScanAndLabel
this.groupBox3.Text = "QTY匹配规则";
this.groupBox3.Visible = false;
//
// listEditControl1
//
this.listEditControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listEditControl1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listEditControl1.ListFile = "config/qty.list";
this.listEditControl1.Location = new System.Drawing.Point(3, 17);
this.listEditControl1.Margin = new System.Windows.Forms.Padding(5);
this.listEditControl1.Name = "listEditControl1";
this.listEditControl1.Size = new System.Drawing.Size(354, 208);
this.listEditControl1.TabIndex = 3;
this.listEditControl1.DataRefresh += new System.EventHandler(this.listEdit_pn_DataRefresh);
//
// txt_code
//
this.txt_code.Location = new System.Drawing.Point(6, 24);
......@@ -245,36 +269,11 @@ namespace AutoScanAndLabel
//
this.uC_U11.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.uC_U11.Location = new System.Drawing.Point(0, 198);
this.uC_U11.Location = new System.Drawing.Point(12, 176);
this.uC_U11.Margin = new System.Windows.Forms.Padding(4);
this.uC_U11.Name = "uC_U11";
this.uC_U11.Size = new System.Drawing.Size(678, 150);
this.uC_U11.Size = new System.Drawing.Size(467, 150);
this.uC_U11.TabIndex = 9;
this.uC_U11.Visible = false;
//
// listEditControl1
//
this.listEditControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listEditControl1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listEditControl1.ListFile = "config/qty.list";
this.listEditControl1.Location = new System.Drawing.Point(3, 17);
this.listEditControl1.Margin = new System.Windows.Forms.Padding(5);
this.listEditControl1.Name = "listEditControl1";
this.listEditControl1.Size = new System.Drawing.Size(354, 208);
this.listEditControl1.TabIndex = 3;
this.listEditControl1.DataRefresh += new System.EventHandler(this.listEdit_pn_DataRefresh);
//
// listEdit_pn
//
this.listEdit_pn.Dock = System.Windows.Forms.DockStyle.Fill;
this.listEdit_pn.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.listEdit_pn.ListFile = "config/pn.list";
this.listEdit_pn.Location = new System.Drawing.Point(3, 17);
this.listEdit_pn.Margin = new System.Windows.Forms.Padding(5);
this.listEdit_pn.Name = "listEdit_pn";
this.listEdit_pn.Size = new System.Drawing.Size(354, 158);
this.listEdit_pn.TabIndex = 3;
this.listEdit_pn.DataRefresh += new System.EventHandler(this.listEdit_pn_DataRefresh);
//
// SettingControl
//
......
......@@ -111,6 +111,48 @@ namespace OnlineStore.Common
public List<EquipMsg> showLogs = new List<EquipMsg>();
public String type { get; set; } = "NS200";
/// <summary>
/// 消息集合
/// </summary>
public List<MsgInfo> msgList;
}
[Serializable]
public class MsgInfo
{
/**
* 提示消息
*/
public string msg = "";
/**
* 消息类型,INFO,WARNING,ERROR,DATA
*/
public string type;
/**
* 英文提示消息
*/
public string msgEn = "";
public string msgJp = "";
/**
* 翻译key
*/
public string msgKey = "";
/**
* 翻译参数
*/
public string[] msgParam;
/**
* 报警类型
*/
public string alarmType = "";
/**
*报警错误码
*/
public string alarmCode = "";
/**
* 模块
*/
public string moudle = "";
}
/**
* agv日志信息
......
......@@ -274,7 +274,6 @@ namespace DeviceLibrary
}
TargetIoValue = value;
TargetIoType = targetIo;
IsInProcess = false;
axisCheckTimer.Start();
return true;
}
......@@ -287,31 +286,22 @@ namespace DeviceLibrary
}
return true;
}
private bool IsInProcess = false;
private DateTime lastOkTime = DateTime.Now;
private void CheckTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
TimeSpan pan = DateTime.Now - lastOkTime;
if (IsInProcess && pan.TotalMilliseconds < 100) { return; }
{
try
{
IsInProcess = true;
lastOkTime = DateTime.Now;
if (IOManager.IOValue(TargetIoType).Equals(TargetIoValue))
{
SuddenStop();
StopAxisCheckMove();
LogUtil.info(AxisName + "上料轴,检测到 " + TargetIoType + "=" + TargetIoValue + ",停止运动");
SuddenStop();
}
}
catch (Exception ex)
{
LogUtil.error("CheckTimer_Elapsed出错:", ex);
}
finally
{
IsInProcess = false;
}
}
#endregion
......
......@@ -103,5 +103,15 @@ namespace DeviceLibrary
return "[" + WareCode + "], [" + PlateW + "x" + PlateH + "]";
}
}
bool isnglog = false;
public void LogNgInfo(ServerCommunication server)
{
if (!isnglog && IsNg)
{
isnglog = server.SendNGInfo(NgMsg);
}
}
}
}
......@@ -46,10 +46,15 @@ namespace DeviceLibrary
LabelMoveInfo.log("Label_YR转到取标点");
break;
case MoveStep.Lbl02_1:
LabelMoveInfo.NextMoveStep(MoveStep.Lbl_WaitPrintInfo);
LabelMoveInfo.NextMoveStep(MoveStep.Lbl02_2);
Label_X_Axis.AbsMove(LabelMoveInfo, Config.Label_X_P2, Config.Label_X_P2_speed);
LabelMoveInfo.log("Label_X转到取标点,等待标签打印完毕");
break;
case MoveStep.Lbl02_2:
//补一个空白流程, 防止提前检测到Lbl_WaitPrintInfo步骤
LabelMoveInfo.NextMoveStep(MoveStep.Lbl_WaitPrintInfo);
LabelMoveInfo.log("等待标签打印完毕");
break;
case MoveStep.Lbl_WaitPrintInfo:
LabelMoveInfo.log("等待打印标签信息");
break;
......@@ -111,9 +116,9 @@ namespace DeviceLibrary
break;
case MoveStep.Lbl_PrintFail:
if (labelFailReason == LabelFailReason.SuckerFailure)
Msg.add("标签打印失败,请检查打印机状态,关门后将自动重试", MsgLevel.alarm);
Msg.add(crc.GetString("Res0129.0e13d0de","标签打印失败,请检查打印机状态,关门后将自动重试"), MsgLevel.alarm);
else if (labelFailReason == LabelFailReason.SuckerFailure)
Msg.add("标签吸取失败,请标签,关门后将自动重试", MsgLevel.alarm);
Msg.add(crc.GetString("Res0130.c3836615", "标签吸取失败,请检查,关门后将自动重试"), MsgLevel.alarm);
if (IOValue(IO_Type.LeftBackDoor_Check).Equals(IO_VALUE.LOW) || IOValue(IO_Type.RightBackDoor_Check).Equals(IO_VALUE.LOW))
{
LabelMoveInfo.NextMoveStep(MoveStep.Lbl_PrintFail_02);
......@@ -122,9 +127,9 @@ namespace DeviceLibrary
break;
case MoveStep.Lbl_PrintFail_02:
if (labelFailReason == LabelFailReason.SuckerFailure)
Msg.add("标签打印失败,请检查打印机状态,关门后将自动重试", MsgLevel.alarm);
Msg.add(crc.GetString("Res0129.0e13d0de","标签打印失败,请检查打印机状态,关门后将自动重试"), MsgLevel.warning);
else if (labelFailReason == LabelFailReason.SuckerFailure)
Msg.add("标签吸取失败,请标签,关门后将自动重试", MsgLevel.alarm);
Msg.add(crc.GetString("Res0130.c3836615", "标签吸取失败,请检查,关门后将自动重试"), MsgLevel.warning);
if (IOValue(IO_Type.LeftBackDoor_Check).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.RightBackDoor_Check).Equals(IO_VALUE.LOW))
{
LabelMoveInfo.NextMoveStep(MoveStep.Lbl_PrintLabel);
......@@ -165,6 +170,7 @@ namespace DeviceLibrary
if (IsLabelLeave)
{
LabelMoveInfo.NextMoveStep(MoveStep.Lbl10);
CurrentPrintInfo = null;
LabelMoveInfo.log("标签已经被取走");
}
else
......@@ -184,7 +190,8 @@ namespace DeviceLibrary
}
if (LabelMoveInfo.MoveParam.codeInfos == null || LabelMoveInfo.MoveParam.codeInfos.Count == 0)
{
break;
LabelMoveInfo.log("没有贴标信息");
return;
}
Point p = new Point(LabelMoveInfo.MoveParam.codeInfos[0].X, LabelMoveInfo.MoveParam.codeInfos[0].X);
int labelAngle = 0;
......@@ -321,7 +328,7 @@ namespace DeviceLibrary
{
state += crc.GetString("Res0072", "标签已打印,当前ReelID:") + LabelMoveInfo.MoveParam.WareCode;
}
if (LabelMoveInfo.MoveStep == MoveStep.Lbl_WaitPrint)
if (LabelMoveInfo.MoveStep == MoveStep.Lbl_WaitPrintInfo)
{
state += crc.GetString("Res0073", "等待标签打印");
}
......
......@@ -28,11 +28,12 @@ namespace DeviceLibrary
RightLed.LedState = LedState.off;
LeftLed.LedState = LedState.off;
//无法运行,量报警灯
if (!canRunning)
if (!canRunning || IsAlarm)
{
AlarmLed.LedState = LedState.on;
}
else
AlarmLed.LedState = LedState.off;
//所有过程都在运动,闪烁运行中灯
//if (!RightMoveInfo.IsStep(MoveStep.Wait)
// || !LeftMoveInfo.IsStep(MoveStep.Wait)
......
......@@ -123,11 +123,12 @@ namespace DeviceLibrary
{
if (true || clampTool.IsClamp())
{
if (!LabelMoveInfo.IsStep(MoveStep.Lbl_WaitPrintInfo)) {
if (!LabelMoveInfo.IsStep(MoveStep.Lbl_WaitPrintInfo))
{
MiddleMoveInfo.log("等待贴标流程空闲");
return;
}
MiddleMoveInfo.NextMoveStep(MoveStep.M08);
CurrentPrintInfo = MiddleMoveInfo.MoveParam.clone();
LabelMoveInfo.NextMoveStep(MoveStep.Lbl_PrintLabel);
Take_Middle_Axis.AbsMove(MiddleMoveInfo, Config.Take_Middle_P3, Config.Take_Middle_P3_speed);
......
......@@ -88,7 +88,9 @@ namespace DeviceLibrary
{
RightMoveInfo.log($"未识别到有效二维码,转入NG箱;pointX={pointX};pointY={pointY}");
RightMoveInfo.MoveParam.IsNg = true;
ServerCM.SendNGInfo(crc.GetString("Res0128.e5d9ef10", "模版匹配失败"));
UnifiedDataHandler.RecordPrintNg(false,false,out string[] strarrys);
}
else
{
......@@ -280,15 +282,6 @@ namespace DeviceLibrary
Dictionary<string, int> newpointangle;
int plantw = GetTrayWidth();
(LastCodeList, keyword, filename, newpointangle) = CodeManager.CameraScan(new List<string> { Config.RightCameraName }, plantw);
//LabelParam labelParam = new LabelParam();
//labelParam.codeInfos = new List<CodeInfo>(LastCodeList);
//if (!Common.codeProcess(labelParam, out _))
//{
// Task.Delay(500).Wait();
// (LastCodeList2, keyword, filename) = CodeManager.CameraScan(new List<string> { Config.RightCameraName });
// LastCodeList.AddRange(LastCodeList2);
//}
//IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
return (LastCodeList, keyword, filename, newpointangle);
}));
......
......@@ -216,6 +216,7 @@ namespace DeviceLibrary
}
}
LogUtil.info("主线程已退出.");
RobotManage.isRunning = false;
}
public void Stop()
{
......@@ -254,7 +255,8 @@ namespace DeviceLibrary
ResetMoveInfo.log("正在回原");
SafeReleaseLeftShelf = false;
Label_Z_Axis.HomeMove(ResetMoveInfo);
clampTool.HomeReset();
IOMove(IO_Type.Device_Led, IO_VALUE.HIGH);
break;
case MoveStep.H02_HomeReset:
ResetMoveInfo.NextMoveStep(MoveStep.H03_HomeReset);
......@@ -325,6 +327,17 @@ namespace DeviceLibrary
MiddleMoveInfo.NewMove(MoveStep.M_Standby);
LabelMoveInfo.NewMove(MoveStep.Lbl01);
if (clampTool.IsClamp())
{
MiddleMoveInfo.NextMoveStep(MoveStep.M20_ToNgBox);
MiddleMoveInfo.log("复位时残留NG物料");
}
else
{
clampTool.HomeReset();
//clampTool.Release();
}
runStatus = RunStatus.Running;
break;
}
......@@ -350,7 +363,7 @@ namespace DeviceLibrary
bool ok = true;
if (UserPause)
{
Msg.add(crc.GetString("Res0057", "用户暂停"), MsgLevel.warning);
DeviceSuddenStop();
ok = false;
}
......@@ -363,7 +376,7 @@ namespace DeviceLibrary
ok = false;
DeviceSuddenStop();
}
Msg.add(crc.GetString("Res0058", "安全光栅被遮挡") + (ok ? crc.GetString("Res0061", "[已忽略]") : ""), MsgLevel.warning);
Msg.add(crc.GetString("Res0058", "安全光栅被遮挡") + (ok ? crc.GetString("Res0061", "[已忽略]") : ""), MsgLevel.alarm);
}
if (IOValue(IO_Type.HasNgBox).Equals(IO_VALUE.LOW))
{
......@@ -377,12 +390,12 @@ namespace DeviceLibrary
//}
if (IOValue(IO_Type.LeftBackDoor_Check).Equals(IO_VALUE.LOW))
{
if (!IgnoreSafecheck)
if (!IgnoreSafecheck && !LabelMoveInfo.IsStep(MoveStep.Lbl_PrintFail))
{
ok = false;
DeviceSuddenStop();
}
Msg.add(crc.GetString("Res0064", "左后门没有关闭") + (ok ? crc.GetString("Res0061", "[已忽略]") : ""), MsgLevel.warning);
Msg.add(crc.GetString("Res0064", "左后门没有关闭") + (ok ? crc.GetString("Res0061", "[已忽略]") : ""), MsgLevel.alarm);
}
if (Config.DIList.ContainsKey(IO_Type.RightBackDoor_Check))
{
......@@ -393,7 +406,7 @@ namespace DeviceLibrary
ok = false;
DeviceSuddenStop();
}
Msg.add(crc.GetString("Res0065", "右后门没有关闭") + (ok ? crc.GetString("Res0061", "[已忽略]") : ""), MsgLevel.warning);
Msg.add(crc.GetString("Res0065", "右后门没有关闭") + (ok ? crc.GetString("Res0061", "[已忽略]") : ""), MsgLevel.alarm);
}
}
......@@ -464,7 +477,7 @@ namespace DeviceLibrary
{
TimeSpan span = DateTime.Now - checkAlarmTime;
//在回原点,复位,出入库时,检测报警间隔减小
if ((!runStatus.Equals(RunStatus.Stop) && span.TotalSeconds > 3) || span.TotalSeconds > 1)
if (!runStatus.Equals(RunStatus.Stop))
{
foreach (ConfigMoveAxis configMoveAxis in Config.moveAxisList)
{
......
......@@ -106,6 +106,7 @@ namespace DeviceLibrary
Lbl01,
Lbl02,
Lbl02_1,
Lbl02_2,
Lbl_WaitPrintInfo,
Lbl_PrintLabel,
Lbl03,
......
......@@ -121,7 +121,7 @@ namespace DeviceLibrary
mainMachine?.ServerCM?.StopConnectServer();
mainMachine?.Stop();
mainMachine.UserPause = false;
isRunning = false;
}
}
......@@ -174,6 +174,7 @@ namespace DeviceLibrary
LogUtil.info("用户暂停");
else
LogUtil.info("系统暂停: " + msg);
Msg.add(crc.GetString("Res0057", "用户暂停"), MsgLevel.warning);
}
else
LogUtil.info("用户取消暂停:" + msg);
......

using OnlineStore.Common;
using System;
using System.Collections.Generic;
......@@ -100,12 +99,12 @@ namespace DeviceLibrary
{
Camera._cam.CloseAll();
}
string camname = "普通相机";
string camname = $"普通相机";
CameraType cameraType = CameraType.HIK;
if (iscode)
{
cameraType = CameraType.HIKIDMVS;
camname = "扫码相机";
camname = $"扫码相机";
}
Camera.Type = cameraType;
Camera._cam.Load();
......@@ -188,7 +187,9 @@ namespace DeviceLibrary
{
if (codes.Count==0)
{
throw new FileNotFoundException("扫码相机未扫描到任何条码!");
//throw new FileNotFoundException("扫码相机未扫描到任何条码!");
LogUtil.error("扫码相机未扫描到任何条码!");
return (codeList, keyword, bitmapfilename, newpointanlge);
}
LogUtil.info($"开始请求ns100服务:识别条码为:{string.Join("##", codes.Select(a=>a.CodeStr+$"@@x:{a.X};y:{a.Y};角度{a.Orientation}"))}");
......@@ -398,4 +399,4 @@ namespace DeviceLibrary
}
}
}
}
}
\ No newline at end of file
using Asa;
using Asa;
using OnlineStore;
using OnlineStore.Common;
using OnlineStore.Common.util;
......@@ -114,7 +114,7 @@ namespace DeviceLibrary
var bmp = print.PrintPreview(data);
if (!zebraManger.PrintImage(bmp, out msg))
{
if (msg == "上一个标签尚未移走")
if (msg == crc.GetString("Res0224","上一个标签尚未移走"))
{
msg = crc.GetString("Res0224", "上一个标签尚未移走");
}
......@@ -151,4 +151,4 @@ namespace DeviceLibrary
NoLabel,
HasLabel,
}
}
}
\ No newline at end of file
......@@ -16,6 +16,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Net.WebRequestMethods;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TrackBar;
namespace DeviceLibrary
......@@ -56,6 +57,10 @@ namespace DeviceLibrary
{
if (!server.StartsWith("http"))
return;
if (!RobotManage.isRunning)
return;
SendLineStatus();
}
......@@ -141,12 +146,12 @@ namespace DeviceLibrary
}
else if (!RobotManage.isRunning)
{
sendmsg = crc.GetString("Res0001", "设备未启动");
sendmsg = "I="+crc.GetString("Res0127.a5affabf","设备未启动");
}
lineOperation.msg = sendmsg;
lineOperation.msg = lineOperation.msg.Trim().Trim(',');
boxStatus.msg = lineOperation.msg;
//boxStatus.msg = lineOperation.msg;
lineOperation.msgEn = lineOperation.msg;
lineOperation.msgJp = lineOperation.msg;
......@@ -472,6 +477,52 @@ namespace DeviceLibrary
}
return equipMsgs;
}
public bool SendNGInfo(string ngmsg)
{
lock (serverclock)
{
try
{
Operation operation = getLineBoxStatus();
operation.msgList = new List<MsgInfo>
{
new MsgInfo
{
moudle = "NG",
type = "WARNING",
msg = ngmsg
}
};
//operation.boxStatus[StoreID].status = (int)storeStatus;
//LogUtil.Log.Info(JsonHelper.SerializeObject(operation));
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000);
if (resultOperation == null)
{
LogUtil.error($"SendNGInfo error,ngmsg={ngmsg}");
return false;
}
if (operation.seq != resultOperation.seq)
{
LogUtil.error($"SendNGInfo seq error,ngmsg={ngmsg},cseq={operation.seq},rseq={resultOperation.seq}");
return false;
}
LogUtil.info($"SendNGInfo success,ngmsg={ngmsg}");
ResultProcess(resultOperation);
}
catch (Exception ex)
{
LogUtil.error($"SendNGInfo error:{ngmsg}", ex);
}
}
return true;
}
}
public class ResultData
{
......@@ -549,4 +600,5 @@ namespace DeviceLibrary
InStoreError = 14,
}
}
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!