Commit 757ca089 LN

增加异常列表。托盘禁用修改。

1 个父辈 0c4269a3
...@@ -97,6 +97,12 @@ ...@@ -97,6 +97,12 @@
<Compile Include="FrmDisableTray.Designer.cs"> <Compile Include="FrmDisableTray.Designer.cs">
<DependentUpon>FrmDisableTray.cs</DependentUpon> <DependentUpon>FrmDisableTray.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FrmExceptionMsg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmExceptionMsg.Designer.cs">
<DependentUpon>FrmExceptionMsg.cs</DependentUpon>
</Compile>
<Compile Include="FrmTrayInfo.cs"> <Compile Include="FrmTrayInfo.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -191,6 +197,9 @@ ...@@ -191,6 +197,9 @@
<DependentUpon>FrmDisableTray.cs</DependentUpon> <DependentUpon>FrmDisableTray.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmExceptionMsg.resx">
<DependentUpon>FrmExceptionMsg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmTrayInfo.resx"> <EmbeddedResource Include="FrmTrayInfo.resx">
<DependentUpon>FrmTrayInfo.cs</DependentUpon> <DependentUpon>FrmTrayInfo.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
namespace OnlineStore.AssemblyLine
{
partial class FrmExceptionMsg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnUpdate = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.Column_Module = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Time = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Msg = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// btnUpdate
//
this.btnUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnUpdate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnUpdate.Location = new System.Drawing.Point(936, 623);
this.btnUpdate.Name = "btnUpdate";
this.btnUpdate.Size = new System.Drawing.Size(115, 33);
this.btnUpdate.TabIndex = 4;
this.btnUpdate.Text = "刷新";
this.btnUpdate.UseVisualStyleBackColor = true;
this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click);
//
// btnExit
//
this.btnExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnExit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnExit.Location = new System.Drawing.Point(1057, 623);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(115, 33);
this.btnExit.TabIndex = 5;
this.btnExit.Text = "确定";
this.btnExit.UseVisualStyleBackColor = true;
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column_Module,
this.Column_Time,
this.Column_Name,
this.Column_Msg});
this.dataGridView1.Location = new System.Drawing.Point(13, 13);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(1159, 589);
this.dataGridView1.TabIndex = 6;
//
// Column_Module
//
this.Column_Module.HeaderText = "模块";
this.Column_Module.Name = "Column_Module";
this.Column_Module.Width = 140;
//
// Column_Time
//
this.Column_Time.HeaderText = "时间";
this.Column_Time.Name = "Column_Time";
this.Column_Time.Width = 140;
//
// Column_Name
//
this.Column_Name.HeaderText = "名称";
this.Column_Name.Name = "Column_Name";
this.Column_Name.Width = 150;
//
// Column_Msg
//
this.Column_Msg.HeaderText = "消息";
this.Column_Msg.Name = "Column_Msg";
this.Column_Msg.Width = 650;
//
// FrmExceptionMsg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(1191, 666);
this.Controls.Add(this.dataGridView1);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnUpdate);
this.Name = "FrmExceptionMsg";
this.Text = "异常信息列表";
this.Load += new System.EventHandler(this.FrmTrayInfo_Load);
this.SizeChanged += new System.EventHandler(this.FrmTrayInfo_SizeChanged);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnUpdate;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_Module;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_Time;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_Msg;
}
}
\ No newline at end of file \ No newline at end of file

using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace OnlineStore.AssemblyLine
{
internal partial class FrmExceptionMsg : FrmBase
{
public FrmExceptionMsg()
{
InitializeComponent();
}
private void FrmTrayInfo_Load(object sender, EventArgs e)
{
loadMsg();
}
private void loadMsg()
{
try
{
List<ExceptionMsg> msgList = ExceptionMsgManager.getList();
dataGridView1.Rows.Clear();
foreach (ExceptionMsg msg in msgList)
{
try
{
if (msg == null)
{
continue;
}
DataGridViewRow row = new DataGridViewRow();
row.CreateCells(dataGridView1);
row.Cells[Column_Module.Index].Value = msg.module;
row.Cells[Column_Name.Index].Value = msg.name;
row.Cells[Column_Time.Index].Value = msg.updateTime.ToString("yyyy-MM-dd HH:mm:ss");
row.Cells[Column_Msg.Index].Value = msg.message;
dataGridView1.Rows.Add(row);
}
catch (Exception ex) { LogUtil.error("FrmExceptionMsg loadMsg error:" + ex.ToString()); }
}
}
catch (Exception ex) { LogUtil.error("FrmExceptionMsg loadMsg error:" + ex.ToString()); }
}
private void btnUpdate_Click(object sender, EventArgs e)
{
loadMsg();
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
private void FrmTrayInfo_SizeChanged(object sender, EventArgs e)
{
this.Left = Screen.PrimaryScreen.Bounds.Width / 2 - this.Width / 2;//桌面的宽度的一半减去自身宽的的一半
this.Top = Screen.PrimaryScreen.Bounds.Height / 2 - this.Height / 2;//桌面的高度的一半减去自身高度的一半
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="Column_Module.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Time.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Msg.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -1462,5 +1462,11 @@ namespace OnlineStore.AssemblyLine ...@@ -1462,5 +1462,11 @@ namespace OnlineStore.AssemblyLine
} }
LogUtil.info(Name + " 点击:" + 新托盘检测逻辑ToolStripMenuItem.Text); LogUtil.info(Name + " 点击:" + 新托盘检测逻辑ToolStripMenuItem.Text);
} }
private void toolStripMenuItem2_Click_1(object sender, EventArgs e)
{
FrmExceptionMsg frm = new FrmExceptionMsg();
frm.ShowDialog();
}
} }
} }
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
<Compile Include="assemblyLine\FeedingEquip_InStore.cs" /> <Compile Include="assemblyLine\FeedingEquip_InStore.cs" />
<Compile Include="assemblyLine\ProvidingEquip.cs" /> <Compile Include="assemblyLine\ProvidingEquip.cs" />
<Compile Include="assemblyLine\FeedingEquip.cs" /> <Compile Include="assemblyLine\FeedingEquip.cs" />
<Compile Include="assemblymanager\ExceptionMsgManager.cs" />
<Compile Include="assemblymanager\RFIDManagercs.cs" /> <Compile Include="assemblymanager\RFIDManagercs.cs" />
<Compile Include="assemblymanager\SServerManager.cs" /> <Compile Include="assemblymanager\SServerManager.cs" />
<Compile Include="assemblymanager\TrayManager.cs" /> <Compile Include="assemblymanager\TrayManager.cs" />
......
...@@ -181,7 +181,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -181,7 +181,7 @@ namespace OnlineStore.DeviceLibrary
if(resCode==-1) if(resCode==-1)
{ {
TrayDisableManager.AddDisableTray(trayNum); TrayDisableManager.AddDisableTray(trayNum,Name, "【屏蔽料盘二次判断】【-1】");
LogUtil.info($"【屏蔽料盘二次判断】【-1】【需要禁用该托盘】【{tray.ToStr()}】"); LogUtil.info($"【屏蔽料盘二次判断】【-1】【需要禁用该托盘】【{tray.ToStr()}】");
} }
else if (resCode==100) else if (resCode==100)
...@@ -239,7 +239,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -239,7 +239,7 @@ namespace OnlineStore.DeviceLibrary
(int resCode, taskInfo task) = SServerManager.getTaskInfo(barcode); (int resCode, taskInfo task) = SServerManager.getTaskInfo(barcode);
if (resCode == -1) if (resCode == -1)
{ {
TrayDisableManager.AddDisableTray(trayNum); TrayDisableManager.AddDisableTray(trayNum,Name, "【屏蔽料盘二次判断】【-1】【初次无料,第二次有料】");
LogUtil.info($"【屏蔽料盘二次判断】【-1】【初次无料,第二次有料】 【禁用该托盘】【{tray.ToStr()}】"); LogUtil.info($"【屏蔽料盘二次判断】【-1】【初次无料,第二次有料】 【禁用该托盘】【{tray.ToStr()}】");
} }
else if (resCode == 100) else if (resCode == 100)
......
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 异常信息管理
/// </summary>
public class ExceptionMsgManager
{
public static Dictionary<string, ExceptionMsg> msgMap = new Dictionary<string, ExceptionMsg>();
public static void updateMsg(string module, string name, string msg = "")
{
try
{
string key = module + "-" + name;
if (msgMap.ContainsKey(key))
{
if (!string.IsNullOrEmpty(msg))
{
ExceptionMsg obj = new ExceptionMsg(module, name, msg);
msgMap[key] = obj;
}
else
{
msgMap.Remove(key);
}
}
else
{
if (!string.IsNullOrEmpty(msg))
{
ExceptionMsg obj = new ExceptionMsg(module, name, msg);
msgMap.Add(key, obj);
}
}
}
catch (Exception ex)
{
LogUtil.error($"updateMsg[{module}][{name}][{msg}] error :" + ex.ToString());
}
}
public static List<ExceptionMsg> getList()
{
return new List<ExceptionMsg>(msgMap.Values);
}
}
public class ExceptionMsg
{
public ExceptionMsg()
{
updateTime = DateTime.Now;
}
public ExceptionMsg(string module,string name,string msg)
{
this.module = module;
this.name = name;
this.message = msg;
updateTime = DateTime.Now;
}
public string module { get; set; }
public string name { get; set; }
public DateTime updateTime { get; set; }
public string message { get; set; }
}
}
...@@ -153,6 +153,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -153,6 +153,7 @@ namespace OnlineStore.DeviceLibrary
string ip = GetRFIP(subType); string ip = GetRFIP(subType);
//获取盘号 //获取盘号
RFIDData data = ReadRFID(ip, isClear); RFIDData data = ReadRFID(ip, isClear);
string rfidT = DeviceConfig.RFIP_Str + "_" + subType.ToString().PadLeft(3, '0');
if (data != null) if (data != null)
{ {
if (data.RFType.Equals('E')) if (data.RFType.Equals('E'))
...@@ -162,10 +163,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -162,10 +163,12 @@ namespace OnlineStore.DeviceLibrary
if (!result) if (!result)
{ {
LogUtil.error("RFID [ " + ip + " ] 读到数据 " + data.NumStr() + " 缓存验证失败,返回盘号 0"); LogUtil.error("RFID [ " + ip + " ] 读到数据 " + data.NumStr() + " 缓存验证失败,返回盘号 0");
ExceptionMsgManager.updateMsg(rfidT, ip, "读到数据 " + data.NumStr() + " 缓存验证失败,返回盘号 0");
return 0; return 0;
} }
else else
{ {
ExceptionMsgManager.updateMsg(rfidT, ip);
return data.Num; return data.Num;
} }
} }
...@@ -177,9 +180,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -177,9 +180,14 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.debug("RFID [ " + ip + " ] 读到数据 " + data.NumStr() + " 返回盘号 0"); LogUtil.debug("RFID [ " + ip + " ] 读到数据 " + data.NumStr() + " 返回盘号 0");
} }
ExceptionMsgManager.updateMsg(rfidT, ip, "读到数据 " + data.NumStr() + " 返回盘号 0");
return 0; return 0;
} }
else
{
ExceptionMsgManager.updateMsg(rfidT, ip, "读到数据为空,返回盘号 0");
}
return 0; return 0;
} }
......
...@@ -108,10 +108,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -108,10 +108,12 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public static void AddDisableTray(int trayNum) public static void AddDisableTray(int trayNum,string deviceName,string describe )
{ {
TrayDisableInfo t = new TrayDisableInfo(); TrayDisableInfo t = new TrayDisableInfo();
t.TrayCode = trayNum; t.TrayCode = trayNum;
t.DDescribe = describe;
t.DDeviceName = deviceName;
if (TrayDisableMap.ContainsKey(trayNum)) if (TrayDisableMap.ContainsKey(trayNum))
{ {
TrayDisableMap[trayNum] = t; TrayDisableMap[trayNum] = t;
......
...@@ -67,6 +67,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -67,6 +67,7 @@ namespace OnlineStore.DeviceLibrary
//判断轴是否正常 //判断轴是否正常
string portName = Config.DeviceName; string portName = Config.DeviceName;
int slvAddr = Config.GetAxisValue(); int slvAddr = Config.GetAxisValue();
ExceptionMsgManager.updateMsg(AxisName, portName + "_" + slvAddr);
if (ACServerManager.ServerOnStatus(portName, slvAddr)) if (ACServerManager.ServerOnStatus(portName, slvAddr))
{ {
LogUtil.info(AxisName + "成功打开"); LogUtil.info(AxisName + "成功打开");
...@@ -88,6 +89,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -88,6 +89,8 @@ namespace OnlineStore.DeviceLibrary
ACServerManager.ServoOff(portName, slvAddr); ACServerManager.ServoOff(portName, slvAddr);
msg = "打开轴" + Config.Explain + "失败 "; msg = "打开轴" + Config.Explain + "失败 ";
LogUtil.info(AxisName + msg); LogUtil.info(AxisName + msg);
ExceptionMsgManager.updateMsg(AxisName, portName+"_"+slvAddr, msg);
return false; return false;
} }
} }
......
...@@ -49,6 +49,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -49,6 +49,11 @@ namespace OnlineStore.DeviceLibrary
if (!aio.IsConn) if (!aio.IsConn)
{ {
msg += $"[{aio.IP}]"; msg += $"[{aio.IP}]";
ExceptionMsgManager.updateMsg("IO模块", aio.IP, "IO模块" + aio.IP + "未连接");
}
else
{
ExceptionMsgManager.updateMsg("IO模块", aio.IP );
} }
} }
if (!String.IsNullOrEmpty(msg)) if (!String.IsNullOrEmpty(msg))
......
...@@ -134,9 +134,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -134,9 +134,14 @@ namespace OnlineStore.DeviceLibrary
if (ho_Image == null) if (ho_Image == null)
{ {
LogUtil.error(deviceName + " 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机"); LogUtil.error(deviceName + " 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机");
ExceptionMsgManager.updateMsg(deviceName, cameraName, "取图片失败,关闭相机");
CloseCamera(cameraName); CloseCamera(cameraName);
continue; continue;
} }
else
{
ExceptionMsgManager.updateMsg(deviceName, cameraName, "");
}
LogUtil.debug(deviceName + " 【" + cameraName + "】取图片完成,开始扫码"); LogUtil.debug(deviceName + " 【" + cameraName + "】取图片完成,开始扫码");
...@@ -166,6 +171,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -166,6 +171,11 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error(deviceName + " 【" + cameraName + "】eyem扫码超时"); LogUtil.error(deviceName + " 【" + cameraName + "】eyem扫码超时");
eyemNoCode = true; eyemNoCode = true;
ExceptionMsgManager.updateMsg(deviceName, cameraName, "eyem扫码超时");
}
else
{
ExceptionMsgManager.updateMsg(deviceName, cameraName );
} }
if (!isPreScan) if (!isPreScan)
{ {
...@@ -293,8 +303,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -293,8 +303,13 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error(deviceName + " 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机"); LogUtil.error(deviceName + " 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机");
CloseCamera(cameraName); CloseCamera(cameraName);
ExceptionMsgManager.updateMsg(deviceName, cameraName, "取图片失败,关闭相机");
continue; continue;
} }
else
{
ExceptionMsgManager.updateMsg(deviceName, cameraName, "");
}
LogUtil.debug(deviceName + " 【" + cameraName + "】取图片完成,开始扫码"); LogUtil.debug(deviceName + " 【" + cameraName + "】取图片完成,开始扫码");
...@@ -321,8 +336,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -321,8 +336,13 @@ namespace OnlineStore.DeviceLibrary
if (!taskResult) if (!taskResult)
{ {
LogUtil.error(deviceName + " 【" + cameraName + "】eyem扫码超时"); LogUtil.error(deviceName + " 【" + cameraName + "】eyem扫码超时");
ExceptionMsgManager.updateMsg(deviceName, cameraName, "eyem扫码超时");
//eyemNoCode = true; //eyemNoCode = true;
} }
else
{
ExceptionMsgManager.updateMsg(deviceName, cameraName );
}
code = ProcessCode(codeList); code = ProcessCode(codeList);
findCode = string.IsNullOrEmpty(code) ? false : true; findCode = string.IsNullOrEmpty(code) ? false : true;
...@@ -585,8 +605,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -585,8 +605,13 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error(deviceName + " 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机"); LogUtil.error(deviceName + " 【" + cameraName + "】取图片失败[" + Camera._cam.ErrInfo + "],关闭相机");
CloseCamera(cameraName); CloseCamera(cameraName);
ExceptionMsgManager.updateMsg(deviceName, cameraName, "取图片失败,关闭相机");
continue; continue;
} }
else
{
ExceptionMsgManager.updateMsg(deviceName, cameraName);
}
//取照片完成,先检测是否有料,有料才需要扫码,否则直接返回 //取照片完成,先检测是否有料,有料才需要扫码,否则直接返回
hasReel = EyemManager.ReelCheck(bmp); hasReel = EyemManager.ReelCheck(bmp);
...@@ -621,8 +646,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -621,8 +646,13 @@ namespace OnlineStore.DeviceLibrary
if (!taskResult) if (!taskResult)
{ {
LogUtil.error(deviceName + " 【" + cameraName + "】eyem扫码超时"); LogUtil.error(deviceName + " 【" + cameraName + "】eyem扫码超时");
ExceptionMsgManager.updateMsg(deviceName, cameraName, "eyem扫码超时");
eyemNoCode = true; eyemNoCode = true;
} }
else
{
ExceptionMsgManager.updateMsg(deviceName, cameraName );
}
if (!findRightCode) if (!findRightCode)
{ {
......
...@@ -71,7 +71,7 @@ dMinorStep 步进,默认1.0。 ...@@ -71,7 +71,7 @@ dMinorStep 步进,默认1.0。
///////////////////使用/////////////////// ///////////////////使用///////////////////
public static int[] ReelCheck(int deviceID, string cameraName ,out string imgName) public static int[] ReelCheck(int deviceID, string cameraName, out string imgName)
{ {
imgName = ""; imgName = "";
if (String.IsNullOrEmpty(cameraName)) if (String.IsNullOrEmpty(cameraName))
...@@ -81,7 +81,7 @@ dMinorStep 步进,默认1.0。 ...@@ -81,7 +81,7 @@ dMinorStep 步进,默认1.0。
Bitmap bitmap = MyCamera.AcqImage(cameraName); Bitmap bitmap = MyCamera.AcqImage(cameraName);
if (bitmap == null) if (bitmap == null)
{ {
string file =ConfigAppSettings.GetValue("TESTFILE", @"D:\皮带线料盘识别\128\r-camera-1-20220128-13134651.bmp"); string file = ConfigAppSettings.GetValue("TESTFILE", @"D:\皮带线料盘识别\128\r-camera-1-20220128-13134651.bmp");
if (File.Exists(file)) if (File.Exists(file))
{ {
bitmap = new Bitmap(file); bitmap = new Bitmap(file);
...@@ -90,8 +90,13 @@ dMinorStep 步进,默认1.0。 ...@@ -90,8 +90,13 @@ dMinorStep 步进,默认1.0。
if (bitmap == null) if (bitmap == null)
{ {
LogUtil.error("ReelCheckUtil :ReelCheck [" + cameraName + "] 获取图片失败 "); LogUtil.error("ReelCheckUtil :ReelCheck [" + cameraName + "] 获取图片失败 ");
ExceptionMsgManager.updateMsg("ReelCheck", cameraName, "ReelCheck [" + cameraName + "] 获取图片失败");
return null; return null;
} }
else
{
ExceptionMsgManager.updateMsg("ReelCheck", cameraName );
}
//if (SaveImage) //if (SaveImage)
//{ //{
// string path = "D:\\image\\"+ cameraName + "\\SourceImg\\"; // string path = "D:\\image\\"+ cameraName + "\\SourceImg\\";
......
...@@ -612,6 +612,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -612,6 +612,11 @@ namespace OnlineStore.DeviceLibrary
} }
} }
ExceptionMsgManager.updateMsg(Name,"",msg);
}
else
{
ExceptionMsgManager.updateMsg(Name, "");
} }
if (!warnParam.AlarmType.Equals(alarmType)) if (!warnParam.AlarmType.Equals(alarmType))
......
...@@ -106,6 +106,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -106,6 +106,7 @@ namespace OnlineStore.DeviceLibrary
{ {
public TrayDisableInfo() public TrayDisableInfo()
{ {
DisableTime = DateTime.Now;
} }
public TrayDisableInfo(int trayNum,string deviceName,string describle) public TrayDisableInfo(int trayNum,string deviceName,string describle)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!