Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e05b34f00 | ||
|
|
6e3ed63886 | ||
|
|
8b7829bc1b | ||
|
|
c06bb2704e | ||
|
|
508647ecca | ||
|
|
a17a969f25 | ||
|
|
9550c5572b | ||
|
|
c89efa6461 | ||
|
|
8e9656a2b5 | ||
|
|
cd841a6aba |
+12
@@ -49,3 +49,15 @@ bld/
|
|||||||
/JY.DAL/obj/Release/JY.DAL.csproj.AssemblyReference.cache
|
/JY.DAL/obj/Release/JY.DAL.csproj.AssemblyReference.cache
|
||||||
/JY.Inspection/obj/Debug/JY.Inspection.csproj.AssemblyReference.cache
|
/JY.Inspection/obj/Debug/JY.Inspection.csproj.AssemblyReference.cache
|
||||||
/JY.Inspection/.vs/JY.Inspection.csproj.dtbcache.json
|
/JY.Inspection/.vs/JY.Inspection.csproj.dtbcache.json
|
||||||
|
/1440MES采集项PLC地址.xlsx
|
||||||
|
/1440外观检测机上位机与PLC通讯协议2026-3-30.xlsx
|
||||||
|
/17J 数采对接文档.xlsx
|
||||||
|
/17J化成包装接口文档.xlsx
|
||||||
|
/JY.Control/.vs
|
||||||
|
/JY.DAL/.vs
|
||||||
|
/JY.MES/.vs
|
||||||
|
/JY.Utility/.vs
|
||||||
|
/PLCCommunication/.vs
|
||||||
|
/SimpleServer/.vs
|
||||||
|
/SocketHelper/.vs
|
||||||
|
/JY.Model/.vs/JY.Model.csproj.dtbcache.json
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace JY.Inspection
|
namespace JY.DAL
|
||||||
{
|
{
|
||||||
public class ConstValue
|
public class ConstValue
|
||||||
{
|
{
|
||||||
@@ -60,5 +60,48 @@ namespace JY.Inspection
|
|||||||
{ "CCDI5", "左面凹坑数量" },
|
{ "CCDI5", "左面凹坑数量" },
|
||||||
{ "CCDI6", "右面凹坑数量" }
|
{ "CCDI6", "右面凹坑数量" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 报警地址信息: 起始地址-长度(分组数,每个分组10个寄存器)
|
||||||
|
/// </summary>
|
||||||
|
public static readonly Dictionary<int, ushort> AlarmAddressDic = new Dictionary<int, ushort>()
|
||||||
|
{
|
||||||
|
{ 10010, 15 }
|
||||||
|
};
|
||||||
|
|
||||||
|
// 展开后的平铺映射表:Key为连续的位索引(0, 1, 2...),Value为实际的物理地址
|
||||||
|
public static readonly Dictionary<int, int> FlatAddressMap = new Dictionary<int, int>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据数组索引获取对应的物理地址
|
||||||
|
/// </summary>
|
||||||
|
public static int GetAddressByIndex(int index)
|
||||||
|
{
|
||||||
|
if (FlatAddressMap.TryGetValue(index, out int address))
|
||||||
|
{
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
throw new IndexOutOfRangeException($"索引 {index} 超出了地址字典的映射范围。");
|
||||||
|
}
|
||||||
|
|
||||||
|
static ConstValue()
|
||||||
|
{
|
||||||
|
FlatAddressMap = new Dictionary<int, int>();
|
||||||
|
int bitIndex = 0;
|
||||||
|
|
||||||
|
// 按起始地址排序,确保映射顺序正确
|
||||||
|
foreach (var kvp in AlarmAddressDic.OrderBy(x => x.Key))
|
||||||
|
{
|
||||||
|
int startAddress = kvp.Key;
|
||||||
|
ushort length = kvp.Value;
|
||||||
|
|
||||||
|
// 将当前段的每一位索引映射到具体的物理地址
|
||||||
|
for (int i = 0; i < length; i++)
|
||||||
|
{
|
||||||
|
FlatAddressMap[bitIndex] = startAddress + i;
|
||||||
|
bitIndex++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -154,6 +154,7 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="ConstValue.cs" />
|
||||||
<Compile Include="IDbHelper.cs" />
|
<Compile Include="IDbHelper.cs" />
|
||||||
<Compile Include="IocConfig.cs" />
|
<Compile Include="IocConfig.cs" />
|
||||||
<Compile Include="Service\BlankingDataService.cs" />
|
<Compile Include="Service\BlankingDataService.cs" />
|
||||||
|
|||||||
+25
-21
@@ -376,34 +376,38 @@ namespace JY.DAL
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
strSql = @" SELECT [ID] ID
|
string preSql = @" SELECT [ID] ID
|
||||||
,[TD] 序号
|
,[TD] 序号
|
||||||
,[WorkShift] 班次
|
,[WorkShift] 班次
|
||||||
,[TDGroup] 主道
|
,[TDGroup] 主道
|
||||||
,[ArrivalBarCode] 入站条码
|
,[ArrivalBarCode] 入站条码
|
||||||
,[DepartureBarCode] 出站条码
|
,[DepartureBarCode] 出站条码
|
||||||
,[TMDB] 条码对比
|
,[TMDB] 条码对比
|
||||||
,CONVERT(varchar, [OutTime], 120) 出站时间
|
,CONVERT(varchar, [OutTime], 120) 出站时间 ";
|
||||||
,[CCD1] '正面(2D/3D)'
|
|
||||||
,[CCD2] '反面(2D/3D)'
|
StringBuilder sb = new StringBuilder();
|
||||||
,[CCD3] '左侧面(2D/3D)'
|
foreach (var propName in ConstValue.CCD_SDict.Keys)
|
||||||
,[CCD4] '右侧面(2D/3D)'
|
{
|
||||||
,[CCD5] '顶面(2D/3D)'
|
sb.Append($",[{propName}] '{ConstValue.CCD_SDict[propName]}'");
|
||||||
,[CCD6] '底面(2D/3D)'
|
}
|
||||||
,[CCD7] 底WE1
|
|
||||||
,[CCD8] 底WE2
|
foreach (var propName in ConstValue.CCD_FDict.Keys)
|
||||||
,[CCD9] 底WE3
|
{
|
||||||
,[CCD10] 底WE4
|
sb.Append($",[{propName}] '{ConstValue.CCD_FDict[propName]}'");
|
||||||
,[CCD11] 中ME1
|
}
|
||||||
,[CCD12] 中ME2
|
|
||||||
,[CCD13] 中ME3
|
foreach (var propName in ConstValue.CCD_IDict.Keys)
|
||||||
,[CCD14] 中ME4
|
{
|
||||||
,[CCD15] '极柱(POS/NEG)'
|
sb.Append($",[{propName}] '{ConstValue.CCD_IDict[propName]}'");
|
||||||
,[CCD16] '防爆阀(PRO)'
|
}
|
||||||
,[Result] 综合结果
|
string formatSql = sb.ToString();
|
||||||
,[Remark] 备注
|
|
||||||
,[Flag] 状态
|
string nextSql = @",[Result] 综合结果
|
||||||
|
,[Remark] 备注
|
||||||
|
,[Flag] 状态
|
||||||
FROM [dbo].[BlankingData] where OutTime >= '" + strDate1 + "' and OutTime <= '" + strDate2 + "' ";
|
FROM [dbo].[BlankingData] where OutTime >= '" + strDate1 + "' and OutTime <= '" + strDate2 + "' ";
|
||||||
|
strSql = string.Concat(preSql, formatSql, nextSql);
|
||||||
|
|
||||||
if (strBarCode != "")
|
if (strBarCode != "")
|
||||||
{
|
{
|
||||||
strSql += " and DepartureBarCode like '%" + strBarCode + "' ";
|
strSql += " and DepartureBarCode like '%" + strBarCode + "' ";
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using JY.DAL.Repository;
|
using JY.DAL.Repository;
|
||||||
using JY.Model;
|
using JY.Model;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace JY.DAL.Service
|
namespace JY.DAL.Service
|
||||||
@@ -19,7 +21,8 @@ namespace JY.DAL.Service
|
|||||||
|
|
||||||
public List<FeedingData> GetFeedingData(string barCode)
|
public List<FeedingData> GetFeedingData(string barCode)
|
||||||
{
|
{
|
||||||
return _repository.GetList(x => x.BarCode == barCode);
|
return _repository.Db.Queryable<FeedingData>().Where(x => x.BarCode == barCode)
|
||||||
|
.OrderByDescending(x => x.CreateTime).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int AddFeedingData(FeedingData data)
|
public int AddFeedingData(FeedingData data)
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ namespace JY.Inspection
|
|||||||
{
|
{
|
||||||
internal class Log4Helper
|
internal class Log4Helper
|
||||||
{
|
{
|
||||||
|
// 通过名称获取专属的 PLC Logger
|
||||||
|
private static readonly ILog plcLog = LogManager.GetLogger("PlcDataLogger");
|
||||||
|
|
||||||
public static void WriteLog(Type t, Exception ex)
|
public static void WriteLog(Type t, Exception ex)
|
||||||
{
|
{
|
||||||
ILog log = LogManager.GetLogger(t);
|
ILog log = LogManager.GetLogger(t);
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
using JY.Inspection.Entity;
|
using JY.DAL;
|
||||||
|
using JY.Inspection.Entity;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@@ -47,6 +50,53 @@ namespace JY.Inspection.Common
|
|||||||
return listAlarmStatus;
|
return listAlarmStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 欧姆龙NX系列Ethernet/IP通讯时将报警地址值转成报警List {直接读取标签地址/无需高低位互换}
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="plcAddrSuffix">PLC地址值,如100</param>
|
||||||
|
/// <param name="byteData">PLC读取出来的值</param>
|
||||||
|
/// <param name="plcAddrPrefix">PLC地址类型,默认值R</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static List<AlarmStatus> OmronEIPByte2Status(List<byte> byteData, char plcAddrPrefix = 'D')
|
||||||
|
{
|
||||||
|
var listAlarmStatus = new List<AlarmStatus>();
|
||||||
|
// byte[]转为二进制字符串表示
|
||||||
|
string strResult = "";
|
||||||
|
byte[] revBytes = SWAPbyte(byteData.ToArray()); //字节高低位互换
|
||||||
|
for (int i = 0; i < revBytes.Length; i++)
|
||||||
|
{
|
||||||
|
string strTemp = System.Convert.ToString(revBytes[i], 2);
|
||||||
|
strTemp = strTemp.PadLeft(8, '0').StrReverse();
|
||||||
|
strResult += strTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
int groupIndex = -1;
|
||||||
|
for (int i = 0; i < strResult.Length; i++)
|
||||||
|
{
|
||||||
|
var plcByte = i % 160;
|
||||||
|
|
||||||
|
//如果是16的倍数地址+1
|
||||||
|
if (groupIndex == -1 || (plcByte % 160 == 0 && i != 0))
|
||||||
|
{
|
||||||
|
groupIndex += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int address = ConstValue.GetAddressByIndex(groupIndex);
|
||||||
|
|
||||||
|
//将地址和状态添加到结果集
|
||||||
|
listAlarmStatus.Add(new AlarmStatus()
|
||||||
|
{
|
||||||
|
PLCAdress = $"{plcAddrPrefix}{address}.{plcByte.ToString()}",
|
||||||
|
Status = strResult[i] == '1'
|
||||||
|
});
|
||||||
|
|
||||||
|
//if (strResult[i] == '1')
|
||||||
|
// Console.WriteLine($"{plcAddrPrefix}{plcAddrSuffix}.{plcByte.ToString("X")}:{strResult[i]}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return listAlarmStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 欧姆龙NX系列Ethernet/IP通讯时将报警地址值转成报警List {直接读取标签地址/无需高低位互换}
|
/// 欧姆龙NX系列Ethernet/IP通讯时将报警地址值转成报警List {直接读取标签地址/无需高低位互换}
|
||||||
@@ -55,7 +105,7 @@ namespace JY.Inspection.Common
|
|||||||
/// <param name="byteData">PLC读取出来的值</param>
|
/// <param name="byteData">PLC读取出来的值</param>
|
||||||
/// <param name="plcAddrPrefix">PLC地址类型,默认值R</param>
|
/// <param name="plcAddrPrefix">PLC地址类型,默认值R</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static List<AlarmStatus> OmronEIPByte2Status(int plcAddrSuffix, List<byte> byteData, char plcAddrPrefix = 'W')
|
public static List<AlarmStatus> OmronEIPByte2Status(int plcAddrSuffix, List<byte> byteData, char plcAddrPrefix = 'D')
|
||||||
{
|
{
|
||||||
var listAlarmStatus = new List<AlarmStatus>();
|
var listAlarmStatus = new List<AlarmStatus>();
|
||||||
// byte[]转为二进制字符串表示
|
// byte[]转为二进制字符串表示
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ StartNGFL=0
|
|||||||
Grading=0
|
Grading=0
|
||||||
MesRequestTime=2
|
MesRequestTime=2
|
||||||
LoginTime=10
|
LoginTime=10
|
||||||
|
TaskInterval=1
|
||||||
|
|
||||||
[统计计数]
|
[统计计数]
|
||||||
ProdAllQty=0
|
ProdAllQty=0
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ Solt=0
|
|||||||
2#IsRead=True
|
2#IsRead=True
|
||||||
2#ReadAddr=W3010
|
2#ReadAddr=W3010
|
||||||
2#ReadType=Byte
|
2#ReadType=Byte
|
||||||
2#ReadLength=118
|
2#ReadLength=700
|
||||||
|
|
||||||
3#ThreadName=±¨¾¯
|
3#ThreadName=±¨¾¯
|
||||||
3#RecvAddr=W6000
|
3#RecvAddr=W6000
|
||||||
|
|||||||
Binary file not shown.
@@ -38,6 +38,8 @@ namespace JY.Inspection.Frm
|
|||||||
tb_loginMes.DataBindings.Add(new Binding("Text", bindingSource1, "LoginMesUrl", true, DataSourceUpdateMode.OnPropertyChanged));
|
tb_loginMes.DataBindings.Add(new Binding("Text", bindingSource1, "LoginMesUrl", true, DataSourceUpdateMode.OnPropertyChanged));
|
||||||
tb_euipAlarm.DataBindings.Add(new Binding("Text", bindingSource1, "EquipAlarmUrl", true, DataSourceUpdateMode.OnPropertyChanged));
|
tb_euipAlarm.DataBindings.Add(new Binding("Text", bindingSource1, "EquipAlarmUrl", true, DataSourceUpdateMode.OnPropertyChanged));
|
||||||
tb_euipStatus.DataBindings.Add(new Binding("Text", bindingSource1, "EquipStatusUrl", true, DataSourceUpdateMode.OnPropertyChanged));
|
tb_euipStatus.DataBindings.Add(new Binding("Text", bindingSource1, "EquipStatusUrl", true, DataSourceUpdateMode.OnPropertyChanged));
|
||||||
|
num_taskInterval.DataBindings.Add(new Binding("Value", bindingSource1, "TaskInterval", true,
|
||||||
|
DataSourceUpdateMode.OnPropertyChanged));
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -62,6 +64,8 @@ namespace JY.Inspection.Frm
|
|||||||
_viewModel.LoginMesUrl = IniFileHelper.ReadIniData("MES配置", "LoginMesUrl");
|
_viewModel.LoginMesUrl = IniFileHelper.ReadIniData("MES配置", "LoginMesUrl");
|
||||||
_viewModel.EquipAlarmUrl = IniFileHelper.ReadIniData("MES配置", "EquipAlarmUrl");
|
_viewModel.EquipAlarmUrl = IniFileHelper.ReadIniData("MES配置", "EquipAlarmUrl");
|
||||||
_viewModel.EquipStatusUrl = IniFileHelper.ReadIniData("MES配置", "EquipStatusUrl");
|
_viewModel.EquipStatusUrl = IniFileHelper.ReadIniData("MES配置", "EquipStatusUrl");
|
||||||
|
int.TryParse(IniFileHelper.ReadIniData("MES配置", "TaskInterval"), out int taskInterval);
|
||||||
|
_viewModel.TaskInterval = taskInterval;
|
||||||
|
|
||||||
LoginTime.Text = IniFileHelper.ReadIniData("MES配置", "LoginTime");
|
LoginTime.Text = IniFileHelper.ReadIniData("MES配置", "LoginTime");
|
||||||
txtMesRequestTime.Text = IniFileHelper.ReadIniData("MES配置", "MesRequestTime");
|
txtMesRequestTime.Text = IniFileHelper.ReadIniData("MES配置", "MesRequestTime");
|
||||||
@@ -90,6 +94,7 @@ namespace JY.Inspection.Frm
|
|||||||
IniFileHelper.WriteIniData("MES配置", "LoginMesUrl", _viewModel.LoginMesUrl.Trim());
|
IniFileHelper.WriteIniData("MES配置", "LoginMesUrl", _viewModel.LoginMesUrl.Trim());
|
||||||
IniFileHelper.WriteIniData("MES配置", "EquipAlarmUrl", _viewModel.EquipAlarmUrl.Trim());
|
IniFileHelper.WriteIniData("MES配置", "EquipAlarmUrl", _viewModel.EquipAlarmUrl.Trim());
|
||||||
IniFileHelper.WriteIniData("MES配置", "EquipStatusUrl", _viewModel.EquipStatusUrl.Trim());
|
IniFileHelper.WriteIniData("MES配置", "EquipStatusUrl", _viewModel.EquipStatusUrl.Trim());
|
||||||
|
IniFileHelper.WriteIniData("MES配置", "TaskInterval", _viewModel.TaskInterval.ToString());
|
||||||
|
|
||||||
IniFileHelper.WriteIniData("MES配置", "LoginTime", LoginTime.Text.Trim());
|
IniFileHelper.WriteIniData("MES配置", "LoginTime", LoginTime.Text.Trim());
|
||||||
LogManagerControl.AddLog($"用户[{Global.systemConfig.userName}]设置权限超时时间[{LoginTime.Text.Trim()}]", LogAddtype.local, Logtype.Warning);
|
LogManagerControl.AddLog($"用户[{Global.systemConfig.userName}]设置权限超时时间[{LoginTime.Text.Trim()}]", LogAddtype.local, Logtype.Warning);
|
||||||
|
|||||||
+100
-38
@@ -48,6 +48,8 @@ namespace JY.Inspection.Frm
|
|||||||
this.metroLabel6 = new MetroFramework.Controls.MetroLabel();
|
this.metroLabel6 = new MetroFramework.Controls.MetroLabel();
|
||||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
this.metroPanel_mid = new MetroFramework.Controls.MetroPanel();
|
this.metroPanel_mid = new MetroFramework.Controls.MetroPanel();
|
||||||
|
this.tb_euipStatus = new MetroFramework.Controls.MetroTextBox();
|
||||||
|
this.metroLabel12 = new MetroFramework.Controls.MetroLabel();
|
||||||
this.tb_euipAlarm = new MetroFramework.Controls.MetroTextBox();
|
this.tb_euipAlarm = new MetroFramework.Controls.MetroTextBox();
|
||||||
this.metroLabel11 = new MetroFramework.Controls.MetroLabel();
|
this.metroLabel11 = new MetroFramework.Controls.MetroLabel();
|
||||||
this.tb_loginMes = new MetroFramework.Controls.MetroTextBox();
|
this.tb_loginMes = new MetroFramework.Controls.MetroTextBox();
|
||||||
@@ -69,8 +71,9 @@ namespace JY.Inspection.Frm
|
|||||||
this.linkLabel_editCollectItemCfg = new System.Windows.Forms.LinkLabel();
|
this.linkLabel_editCollectItemCfg = new System.Windows.Forms.LinkLabel();
|
||||||
this.chkIsMesUP = new System.Windows.Forms.CheckBox();
|
this.chkIsMesUP = new System.Windows.Forms.CheckBox();
|
||||||
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
|
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
|
||||||
this.metroLabel12 = new MetroFramework.Controls.MetroLabel();
|
this.metroLabel13 = new MetroFramework.Controls.MetroLabel();
|
||||||
this.tb_euipStatus = new MetroFramework.Controls.MetroTextBox();
|
this.num_taskInterval = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.metroLabel14 = new MetroFramework.Controls.MetroLabel();
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
this.metroPanel_mid.SuspendLayout();
|
this.metroPanel_mid.SuspendLayout();
|
||||||
this.metroPanel_top.SuspendLayout();
|
this.metroPanel_top.SuspendLayout();
|
||||||
@@ -78,6 +81,7 @@ namespace JY.Inspection.Frm
|
|||||||
((System.ComponentModel.ISupportInitialize)(this.txtMesRequestTime)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.txtMesRequestTime)).BeginInit();
|
||||||
this.metroPanel_bottom.SuspendLayout();
|
this.metroPanel_bottom.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.num_taskInterval)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// btnExit
|
// btnExit
|
||||||
@@ -410,6 +414,48 @@ namespace JY.Inspection.Frm
|
|||||||
this.metroPanel_mid.VerticalScrollbarHighlightOnWheel = false;
|
this.metroPanel_mid.VerticalScrollbarHighlightOnWheel = false;
|
||||||
this.metroPanel_mid.VerticalScrollbarSize = 13;
|
this.metroPanel_mid.VerticalScrollbarSize = 13;
|
||||||
//
|
//
|
||||||
|
// tb_euipStatus
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
this.tb_euipStatus.CustomButton.Image = null;
|
||||||
|
this.tb_euipStatus.CustomButton.Location = new System.Drawing.Point(671, 1);
|
||||||
|
this.tb_euipStatus.CustomButton.Margin = new System.Windows.Forms.Padding(4);
|
||||||
|
this.tb_euipStatus.CustomButton.Name = "";
|
||||||
|
this.tb_euipStatus.CustomButton.Size = new System.Drawing.Size(27, 27);
|
||||||
|
this.tb_euipStatus.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
|
||||||
|
this.tb_euipStatus.CustomButton.TabIndex = 1;
|
||||||
|
this.tb_euipStatus.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
|
||||||
|
this.tb_euipStatus.CustomButton.UseSelectable = true;
|
||||||
|
this.tb_euipStatus.CustomButton.Visible = false;
|
||||||
|
this.tb_euipStatus.Lines = new string[0];
|
||||||
|
this.tb_euipStatus.Location = new System.Drawing.Point(235, 260);
|
||||||
|
this.tb_euipStatus.Margin = new System.Windows.Forms.Padding(4);
|
||||||
|
this.tb_euipStatus.MaxLength = 32767;
|
||||||
|
this.tb_euipStatus.Name = "tb_euipStatus";
|
||||||
|
this.tb_euipStatus.PasswordChar = '\0';
|
||||||
|
this.tb_euipStatus.ScrollBars = System.Windows.Forms.ScrollBars.None;
|
||||||
|
this.tb_euipStatus.SelectedText = "";
|
||||||
|
this.tb_euipStatus.SelectionLength = 0;
|
||||||
|
this.tb_euipStatus.SelectionStart = 0;
|
||||||
|
this.tb_euipStatus.ShortcutsEnabled = true;
|
||||||
|
this.tb_euipStatus.Size = new System.Drawing.Size(699, 29);
|
||||||
|
this.tb_euipStatus.TabIndex = 45;
|
||||||
|
this.tb_euipStatus.UseSelectable = true;
|
||||||
|
this.tb_euipStatus.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
|
||||||
|
this.tb_euipStatus.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
|
||||||
|
//
|
||||||
|
// metroLabel12
|
||||||
|
//
|
||||||
|
this.metroLabel12.AutoSize = true;
|
||||||
|
this.metroLabel12.Location = new System.Drawing.Point(41, 269);
|
||||||
|
this.metroLabel12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
|
this.metroLabel12.Name = "metroLabel12";
|
||||||
|
this.metroLabel12.Size = new System.Drawing.Size(144, 20);
|
||||||
|
this.metroLabel12.TabIndex = 44;
|
||||||
|
this.metroLabel12.Text = "设备状态接口地址:";
|
||||||
|
//
|
||||||
// tb_euipAlarm
|
// tb_euipAlarm
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
@@ -580,6 +626,9 @@ namespace JY.Inspection.Frm
|
|||||||
//
|
//
|
||||||
// metroPanel_top
|
// metroPanel_top
|
||||||
//
|
//
|
||||||
|
this.metroPanel_top.Controls.Add(this.metroLabel14);
|
||||||
|
this.metroPanel_top.Controls.Add(this.num_taskInterval);
|
||||||
|
this.metroPanel_top.Controls.Add(this.metroLabel13);
|
||||||
this.metroPanel_top.Controls.Add(this.tb_productType);
|
this.metroPanel_top.Controls.Add(this.tb_productType);
|
||||||
this.metroPanel_top.Controls.Add(this.metroLabel18);
|
this.metroPanel_top.Controls.Add(this.metroLabel18);
|
||||||
this.metroPanel_top.Controls.Add(this.metroLabel21);
|
this.metroPanel_top.Controls.Add(this.metroLabel21);
|
||||||
@@ -786,47 +835,56 @@ namespace JY.Inspection.Frm
|
|||||||
this.chkIsMesUP.Text = "开启MES模式";
|
this.chkIsMesUP.Text = "开启MES模式";
|
||||||
this.chkIsMesUP.UseVisualStyleBackColor = true;
|
this.chkIsMesUP.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// metroLabel12
|
// metroLabel13
|
||||||
//
|
//
|
||||||
this.metroLabel12.AutoSize = true;
|
this.metroLabel13.AutoSize = true;
|
||||||
this.metroLabel12.Location = new System.Drawing.Point(41, 269);
|
this.metroLabel13.Location = new System.Drawing.Point(484, 110);
|
||||||
this.metroLabel12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
this.metroLabel13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
this.metroLabel12.Name = "metroLabel12";
|
this.metroLabel13.Name = "metroLabel13";
|
||||||
this.metroLabel12.Size = new System.Drawing.Size(144, 20);
|
this.metroLabel13.Size = new System.Drawing.Size(114, 20);
|
||||||
this.metroLabel12.TabIndex = 44;
|
this.metroLabel13.TabIndex = 185;
|
||||||
this.metroLabel12.Text = "设备状态接口地址:";
|
this.metroLabel13.Text = "定时任务间隔:";
|
||||||
//
|
//
|
||||||
// tb_euipStatus
|
// num_taskInterval
|
||||||
//
|
//
|
||||||
|
this.num_taskInterval.DecimalPlaces = 1;
|
||||||
|
this.num_taskInterval.Increment = new decimal(new int[] {
|
||||||
|
5,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
65536});
|
||||||
|
this.num_taskInterval.Location = new System.Drawing.Point(655, 110);
|
||||||
|
this.num_taskInterval.Margin = new System.Windows.Forms.Padding(4);
|
||||||
|
this.num_taskInterval.Maximum = new decimal(new int[] {
|
||||||
|
1000,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.num_taskInterval.Minimum = new decimal(new int[] {
|
||||||
|
5,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
65536});
|
||||||
|
this.num_taskInterval.Name = "num_taskInterval";
|
||||||
|
this.num_taskInterval.Size = new System.Drawing.Size(101, 25);
|
||||||
|
this.num_taskInterval.TabIndex = 186;
|
||||||
|
this.num_taskInterval.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||||
|
this.num_taskInterval.Value = new decimal(new int[] {
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
//
|
//
|
||||||
|
// metroLabel14
|
||||||
//
|
//
|
||||||
//
|
this.metroLabel14.AutoSize = true;
|
||||||
this.tb_euipStatus.CustomButton.Image = null;
|
this.metroLabel14.Location = new System.Drawing.Point(764, 110);
|
||||||
this.tb_euipStatus.CustomButton.Location = new System.Drawing.Point(671, 1);
|
this.metroLabel14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||||
this.tb_euipStatus.CustomButton.Margin = new System.Windows.Forms.Padding(4);
|
this.metroLabel14.Name = "metroLabel14";
|
||||||
this.tb_euipStatus.CustomButton.Name = "";
|
this.metroLabel14.Size = new System.Drawing.Size(32, 20);
|
||||||
this.tb_euipStatus.CustomButton.Size = new System.Drawing.Size(27, 27);
|
this.metroLabel14.TabIndex = 187;
|
||||||
this.tb_euipStatus.CustomButton.Style = MetroFramework.MetroColorStyle.Blue;
|
this.metroLabel14.Text = "min";
|
||||||
this.tb_euipStatus.CustomButton.TabIndex = 1;
|
this.metroLabel14.Visible = false;
|
||||||
this.tb_euipStatus.CustomButton.Theme = MetroFramework.MetroThemeStyle.Light;
|
|
||||||
this.tb_euipStatus.CustomButton.UseSelectable = true;
|
|
||||||
this.tb_euipStatus.CustomButton.Visible = false;
|
|
||||||
this.tb_euipStatus.Lines = new string[0];
|
|
||||||
this.tb_euipStatus.Location = new System.Drawing.Point(235, 260);
|
|
||||||
this.tb_euipStatus.Margin = new System.Windows.Forms.Padding(4);
|
|
||||||
this.tb_euipStatus.MaxLength = 32767;
|
|
||||||
this.tb_euipStatus.Name = "tb_euipStatus";
|
|
||||||
this.tb_euipStatus.PasswordChar = '\0';
|
|
||||||
this.tb_euipStatus.ScrollBars = System.Windows.Forms.ScrollBars.None;
|
|
||||||
this.tb_euipStatus.SelectedText = "";
|
|
||||||
this.tb_euipStatus.SelectionLength = 0;
|
|
||||||
this.tb_euipStatus.SelectionStart = 0;
|
|
||||||
this.tb_euipStatus.ShortcutsEnabled = true;
|
|
||||||
this.tb_euipStatus.Size = new System.Drawing.Size(699, 29);
|
|
||||||
this.tb_euipStatus.TabIndex = 45;
|
|
||||||
this.tb_euipStatus.UseSelectable = true;
|
|
||||||
this.tb_euipStatus.WaterMarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
|
|
||||||
this.tb_euipStatus.WaterMarkFont = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
|
|
||||||
//
|
//
|
||||||
// FormMesDataSet
|
// FormMesDataSet
|
||||||
//
|
//
|
||||||
@@ -853,6 +911,7 @@ namespace JY.Inspection.Frm
|
|||||||
this.metroPanel_bottom.ResumeLayout(false);
|
this.metroPanel_bottom.ResumeLayout(false);
|
||||||
this.metroPanel_bottom.PerformLayout();
|
this.metroPanel_bottom.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.num_taskInterval)).EndInit();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -898,5 +957,8 @@ namespace JY.Inspection.Frm
|
|||||||
private MetroFramework.Controls.MetroLabel metroLabel11;
|
private MetroFramework.Controls.MetroLabel metroLabel11;
|
||||||
private MetroFramework.Controls.MetroTextBox tb_euipStatus;
|
private MetroFramework.Controls.MetroTextBox tb_euipStatus;
|
||||||
private MetroFramework.Controls.MetroLabel metroLabel12;
|
private MetroFramework.Controls.MetroLabel metroLabel12;
|
||||||
|
private System.Windows.Forms.NumericUpDown num_taskInterval;
|
||||||
|
private MetroFramework.Controls.MetroLabel metroLabel13;
|
||||||
|
private MetroFramework.Controls.MetroLabel metroLabel14;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
+26
@@ -32,6 +32,8 @@
|
|||||||
this.btn_stationExit = new MetroFramework.Controls.MetroButton();
|
this.btn_stationExit = new MetroFramework.Controls.MetroButton();
|
||||||
this.btn_stationArrival = new MetroFramework.Controls.MetroButton();
|
this.btn_stationArrival = new MetroFramework.Controls.MetroButton();
|
||||||
this.btn_sendMQTTClient = new MetroFramework.Controls.MetroButton();
|
this.btn_sendMQTTClient = new MetroFramework.Controls.MetroButton();
|
||||||
|
this.btn_logPLCData = new MetroFramework.Controls.MetroButton();
|
||||||
|
this.btn_testAlarm = new MetroFramework.Controls.MetroButton();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// btn_readCollectItemCfg
|
// btn_readCollectItemCfg
|
||||||
@@ -74,11 +76,33 @@
|
|||||||
this.btn_sendMQTTClient.UseSelectable = true;
|
this.btn_sendMQTTClient.UseSelectable = true;
|
||||||
this.btn_sendMQTTClient.Click += new System.EventHandler(this.btn_sendMQTTClient_Click);
|
this.btn_sendMQTTClient.Click += new System.EventHandler(this.btn_sendMQTTClient_Click);
|
||||||
//
|
//
|
||||||
|
// btn_logPLCData
|
||||||
|
//
|
||||||
|
this.btn_logPLCData.Location = new System.Drawing.Point(263, 220);
|
||||||
|
this.btn_logPLCData.Name = "btn_logPLCData";
|
||||||
|
this.btn_logPLCData.Size = new System.Drawing.Size(125, 53);
|
||||||
|
this.btn_logPLCData.TabIndex = 4;
|
||||||
|
this.btn_logPLCData.Text = "记录PLC数据";
|
||||||
|
this.btn_logPLCData.UseSelectable = true;
|
||||||
|
this.btn_logPLCData.Click += new System.EventHandler(this.btn_logPLCData_Click);
|
||||||
|
//
|
||||||
|
// btn_testAlarm
|
||||||
|
//
|
||||||
|
this.btn_testAlarm.Location = new System.Drawing.Point(426, 229);
|
||||||
|
this.btn_testAlarm.Name = "btn_testAlarm";
|
||||||
|
this.btn_testAlarm.Size = new System.Drawing.Size(125, 53);
|
||||||
|
this.btn_testAlarm.TabIndex = 5;
|
||||||
|
this.btn_testAlarm.Text = "报警测试";
|
||||||
|
this.btn_testAlarm.UseSelectable = true;
|
||||||
|
this.btn_testAlarm.Click += new System.EventHandler(this.btn_testAlarm_Click);
|
||||||
|
//
|
||||||
// FrmTest
|
// FrmTest
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(998, 586);
|
this.ClientSize = new System.Drawing.Size(998, 586);
|
||||||
|
this.Controls.Add(this.btn_testAlarm);
|
||||||
|
this.Controls.Add(this.btn_logPLCData);
|
||||||
this.Controls.Add(this.btn_sendMQTTClient);
|
this.Controls.Add(this.btn_sendMQTTClient);
|
||||||
this.Controls.Add(this.btn_stationArrival);
|
this.Controls.Add(this.btn_stationArrival);
|
||||||
this.Controls.Add(this.btn_stationExit);
|
this.Controls.Add(this.btn_stationExit);
|
||||||
@@ -95,5 +119,7 @@
|
|||||||
private MetroFramework.Controls.MetroButton btn_stationExit;
|
private MetroFramework.Controls.MetroButton btn_stationExit;
|
||||||
private MetroFramework.Controls.MetroButton btn_stationArrival;
|
private MetroFramework.Controls.MetroButton btn_stationArrival;
|
||||||
private MetroFramework.Controls.MetroButton btn_sendMQTTClient;
|
private MetroFramework.Controls.MetroButton btn_sendMQTTClient;
|
||||||
|
private MetroFramework.Controls.MetroButton btn_logPLCData;
|
||||||
|
private MetroFramework.Controls.MetroButton btn_testAlarm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,16 @@
|
|||||||
using JY.Inspection.Common;
|
using HslCommunication;
|
||||||
|
using HslCommunication.Core;
|
||||||
|
using HslCommunication.Profinet.Omron;
|
||||||
|
using JY.Inspection.Common;
|
||||||
using JY.Model.Excel;
|
using JY.Model.Excel;
|
||||||
using JY.Utility;
|
using JY.Utility;
|
||||||
using MetroFramework.Forms;
|
using MetroFramework.Forms;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -65,5 +70,44 @@ namespace JY.Inspection.Frm
|
|||||||
string payload = "测试数据";
|
string payload = "测试数据";
|
||||||
await MqttSingleton.Instance.SendAsync(topic, payload);
|
await MqttSingleton.Instance.SendAsync(topic, payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void btn_logPLCData_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
byte[] bytes = new byte[] { 0x01, 0x02, 0x03, 0x04 };
|
||||||
|
|
||||||
|
LogHelper.LogPLCData("电池出站数据", bytes);
|
||||||
|
|
||||||
|
LogHelper.WriteErrorLine("错误日志");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btn_testAlarm_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string address = "192.168.2.50";
|
||||||
|
|
||||||
|
OmronFinsNet omronFinsNet = new OmronFinsNet();
|
||||||
|
omronFinsNet.IpAddress = address.ToString();
|
||||||
|
omronFinsNet.Port = 9600;
|
||||||
|
omronFinsNet.DA2 = 0;
|
||||||
|
omronFinsNet.ByteTransform.DataFormat = DataFormat.CDAB;
|
||||||
|
omronFinsNet.ByteTransform.IsStringReverseByteWord = true;
|
||||||
|
omronFinsNet.ConnectTimeOut = 2000;
|
||||||
|
omronFinsNet.ReceiveTimeOut = 2000;
|
||||||
|
|
||||||
|
var result = omronFinsNet.ConnectServer();
|
||||||
|
|
||||||
|
if (result != null && result.IsSuccess)
|
||||||
|
{
|
||||||
|
Debug.WriteLine("FinsTcp连接成功");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.WriteLine("FinsTcp连接失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
string addr = "D10010";
|
||||||
|
ushort length = 150;
|
||||||
|
byte[] byteResult = omronFinsNet.Read(addr, length).Content;
|
||||||
|
OperateResult barray = omronFinsNet.ReadBool(addr, length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+108
-183
@@ -150,7 +150,7 @@ namespace JY.Inspection
|
|||||||
public CancellationTokenSource mCOMState = new CancellationTokenSource();
|
public CancellationTokenSource mCOMState = new CancellationTokenSource();
|
||||||
private ManualResetEvent resetEventRecv = new ManualResetEvent(true);
|
private ManualResetEvent resetEventRecv = new ManualResetEvent(true);
|
||||||
|
|
||||||
private ByteTransformBase TransformBase = new ByteTransformBase();
|
//private ByteTransformBase TransformBase = new ByteTransformBase();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 用于电芯出站时向FMS上报出站及生产数据
|
/// 用于电芯出站时向FMS上报出站及生产数据
|
||||||
@@ -173,14 +173,15 @@ namespace JY.Inspection
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
List<ChartDataType> NGList = new List<ChartDataType>();
|
List<ChartDataType> NGList = new List<ChartDataType>();
|
||||||
|
|
||||||
|
//private readonly object lockObject = new object();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 报警原始数据
|
/// 报警原始数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
List<byte> listAlamByte = new List<byte>();
|
//List<byte> listAlamByte = new List<byte>();
|
||||||
//报警表单数据
|
//报警表单数据
|
||||||
List<AlarmForm> listAlarmForm = null;
|
List<AlarmForm> listAlarmForm = null;
|
||||||
//PLC报警状态值
|
//PLC报警状态值
|
||||||
List<AlarmStatus> listAlarmStatus = null;
|
//List<AlarmStatus> listAlarmStatus = null;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -278,10 +279,13 @@ namespace JY.Inspection
|
|||||||
this.ControlBox = true;
|
this.ControlBox = true;
|
||||||
// 或设置窗口可调整大小
|
// 或设置窗口可调整大小
|
||||||
this.Resizable = true;
|
this.Resizable = true;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitDgvBColumns()
|
private void InitDgvBColumns()
|
||||||
{
|
{
|
||||||
|
List<DataGridViewColumn> colDefList = new List<DataGridViewColumn>();
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column6 = new DataGridViewTextBoxColumn();
|
DataGridViewTextBoxColumn Column6 = new DataGridViewTextBoxColumn();
|
||||||
Column6.DataPropertyName = "TD";
|
Column6.DataPropertyName = "TD";
|
||||||
@@ -290,6 +294,7 @@ namespace JY.Inspection
|
|||||||
Column6.Name = "Column6";
|
Column6.Name = "Column6";
|
||||||
Column6.ReadOnly = true;
|
Column6.ReadOnly = true;
|
||||||
Column6.Width = 52;
|
Column6.Width = 52;
|
||||||
|
colDefList.Add(Column6);
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column8 = new DataGridViewTextBoxColumn();
|
DataGridViewTextBoxColumn Column8 = new DataGridViewTextBoxColumn();
|
||||||
Column8.DataPropertyName = "WorkShift";
|
Column8.DataPropertyName = "WorkShift";
|
||||||
@@ -298,6 +303,7 @@ namespace JY.Inspection
|
|||||||
Column8.Name = "Column8";
|
Column8.Name = "Column8";
|
||||||
Column8.ReadOnly = true;
|
Column8.ReadOnly = true;
|
||||||
Column8.Width = 52;
|
Column8.Width = 52;
|
||||||
|
colDefList.Add(Column8);
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column31 = new DataGridViewTextBoxColumn();
|
DataGridViewTextBoxColumn Column31 = new DataGridViewTextBoxColumn();
|
||||||
Column31 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
Column31 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
@@ -307,6 +313,7 @@ namespace JY.Inspection
|
|||||||
Column31.Name = "Column31";
|
Column31.Name = "Column31";
|
||||||
Column31.ReadOnly = true;
|
Column31.ReadOnly = true;
|
||||||
Column31.Width = 52;
|
Column31.Width = 52;
|
||||||
|
colDefList.Add(Column31);
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column26 = new DataGridViewTextBoxColumn();
|
DataGridViewTextBoxColumn Column26 = new DataGridViewTextBoxColumn();
|
||||||
Column26.DataPropertyName = "ArrivalBarCode";
|
Column26.DataPropertyName = "ArrivalBarCode";
|
||||||
@@ -315,6 +322,7 @@ namespace JY.Inspection
|
|||||||
Column26.Name = "Column26";
|
Column26.Name = "Column26";
|
||||||
Column26.ReadOnly = true;
|
Column26.ReadOnly = true;
|
||||||
Column26.Width = 64;
|
Column26.Width = 64;
|
||||||
|
colDefList.Add(Column26);
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
DataGridViewTextBoxColumn Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
Column7.DataPropertyName = "DepartureBarCode";
|
Column7.DataPropertyName = "DepartureBarCode";
|
||||||
@@ -323,6 +331,7 @@ namespace JY.Inspection
|
|||||||
Column7.Name = "Column7";
|
Column7.Name = "Column7";
|
||||||
Column7.ReadOnly = true;
|
Column7.ReadOnly = true;
|
||||||
Column7.Width = 64;
|
Column7.Width = 64;
|
||||||
|
colDefList.Add(Column7);
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column27 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
DataGridViewTextBoxColumn Column27 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
Column27.DataPropertyName = "TMDB";
|
Column27.DataPropertyName = "TMDB";
|
||||||
@@ -331,6 +340,7 @@ namespace JY.Inspection
|
|||||||
Column27.Name = "Column27";
|
Column27.Name = "Column27";
|
||||||
Column27.ReadOnly = true;
|
Column27.ReadOnly = true;
|
||||||
Column27.Width = 64;
|
Column27.Width = 64;
|
||||||
|
colDefList.Add(Column27);
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column25 = new DataGridViewTextBoxColumn();
|
DataGridViewTextBoxColumn Column25 = new DataGridViewTextBoxColumn();
|
||||||
Column25.DataPropertyName = "OutTime";
|
Column25.DataPropertyName = "OutTime";
|
||||||
@@ -339,133 +349,46 @@ namespace JY.Inspection
|
|||||||
Column25.Name = "Column25";
|
Column25.Name = "Column25";
|
||||||
Column25.ReadOnly = true;
|
Column25.ReadOnly = true;
|
||||||
Column25.Width = 64;
|
Column25.Width = 64;
|
||||||
|
colDefList.Add(Column25);
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
#region CCD结果
|
||||||
Column9.DataPropertyName = "CCD1";
|
|
||||||
Column9.HeaderText = "正面(2D/3D)";
|
|
||||||
Column9.MinimumWidth = 6;
|
|
||||||
Column9.Name = "Column9";
|
|
||||||
Column9.ReadOnly = true;
|
|
||||||
Column9.Width = 86;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column10= new System.Windows.Forms.DataGridViewTextBoxColumn();
|
foreach (var propName in ConstValue.CCD_SDict.Keys)
|
||||||
Column10.DataPropertyName = "CCD2";
|
{
|
||||||
Column10.HeaderText = "反面(2D/3D)";
|
DataGridViewColumn col = new DataGridViewTextBoxColumn();
|
||||||
Column10.MinimumWidth = 6;
|
col.DataPropertyName = propName;
|
||||||
Column10.Name = "Column10";
|
col.HeaderText = ConstValue.CCD_SDict[propName];
|
||||||
Column10.ReadOnly = true;
|
col.MinimumWidth = 6;
|
||||||
Column10.Width = 86;
|
col.Name = $"Col_ccd_{propName}";
|
||||||
|
col.ReadOnly = true;
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
colDefList.Add(col);
|
||||||
Column11.DataPropertyName = "CCD3";
|
}
|
||||||
Column11.HeaderText = "左侧面(2D/3D)";
|
|
||||||
Column11.MinimumWidth = 6;
|
|
||||||
Column11.Name = "Column11";
|
|
||||||
Column11.ReadOnly = true;
|
|
||||||
Column11.Width = 98;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
foreach (var propName in ConstValue.CCD_FDict.Keys)
|
||||||
Column12.DataPropertyName = "CCD4";
|
{
|
||||||
Column12.HeaderText = "右侧面(2D/3D)";
|
DataGridViewColumn col = new DataGridViewTextBoxColumn();
|
||||||
Column12.MinimumWidth = 6;
|
col.DataPropertyName = propName;
|
||||||
Column12.Name = "Column12";
|
col.HeaderText = ConstValue.CCD_FDict[propName];
|
||||||
Column12.ReadOnly = true;
|
col.MinimumWidth = 6;
|
||||||
Column12.Width = 98;
|
col.Name = $"Col_ccd_{propName}";
|
||||||
|
col.ReadOnly = true;
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
colDefList.Add(col);
|
||||||
Column13.DataPropertyName = "CCD5";
|
}
|
||||||
Column13.HeaderText = "顶面(2D/3D)";
|
|
||||||
Column13.MinimumWidth = 6;
|
|
||||||
Column13.Name = "Column13";
|
|
||||||
Column13.ReadOnly = true;
|
|
||||||
Column13.Width = 86;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column14 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
foreach (var propName in ConstValue.CCD_IDict.Keys)
|
||||||
Column14.DataPropertyName = "CCD6";
|
{
|
||||||
Column14.HeaderText = "底面(2D/3D)";
|
DataGridViewColumn col = new DataGridViewTextBoxColumn();
|
||||||
Column14.MinimumWidth = 6;
|
col.DataPropertyName = propName;
|
||||||
Column14.Name = "Column14";
|
col.HeaderText = ConstValue.CCD_IDict[propName];
|
||||||
Column14.ReadOnly = true;
|
col.MinimumWidth = 6;
|
||||||
Column14.Width = 86;
|
col.Name = $"Col_ccd_{propName}";
|
||||||
|
col.ReadOnly = true;
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column15 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
colDefList.Add(col);
|
||||||
Column15.DataPropertyName = "CCD7";
|
}
|
||||||
Column15.HeaderText = "底棱边WE1";
|
#endregion
|
||||||
Column15.MinimumWidth = 6;
|
|
||||||
Column15.Name = "Column15";
|
|
||||||
Column15.ReadOnly = true;
|
|
||||||
Column15.Width = 85;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column16 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
|
||||||
Column16.DataPropertyName = "CCD8";
|
|
||||||
Column16.HeaderText = "底棱边WE2";
|
|
||||||
Column16.MinimumWidth = 6;
|
|
||||||
Column16.Name = "Column16";
|
|
||||||
Column16.ReadOnly = true;
|
|
||||||
Column16.Width = 85;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column17 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
|
||||||
Column17.DataPropertyName = "CCD9";
|
|
||||||
Column17.HeaderText = "底棱边WE3";
|
|
||||||
Column17.MinimumWidth = 6;
|
|
||||||
Column17.Name = "Column17";
|
|
||||||
Column17.ReadOnly = true;
|
|
||||||
Column17.Width = 85;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column18 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
|
||||||
Column18.DataPropertyName = "CCD10";
|
|
||||||
Column18.HeaderText = "底棱边WE4";
|
|
||||||
Column18.MinimumWidth = 6;
|
|
||||||
Column18.Name = "Column18";
|
|
||||||
Column18.ReadOnly = true;
|
|
||||||
Column18.Width = 85;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column19 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
|
||||||
Column19.DataPropertyName = "CCD11";
|
|
||||||
Column19.HeaderText = "中棱边ME1";
|
|
||||||
Column19.MinimumWidth = 6;
|
|
||||||
Column19.Name = "Column19";
|
|
||||||
Column19.ReadOnly = true;
|
|
||||||
Column19.Width = 84;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column20 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
|
||||||
Column20.DataPropertyName = "CCD12";
|
|
||||||
Column20.HeaderText = "中棱边ME2";
|
|
||||||
Column20.MinimumWidth = 6;
|
|
||||||
Column20.Name = "Column20";
|
|
||||||
Column20.ReadOnly = true;
|
|
||||||
Column20.Width = 84;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column21 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
|
||||||
Column21.DataPropertyName = "CCD13";
|
|
||||||
Column21.HeaderText = "中棱边ME3";
|
|
||||||
Column21.MinimumWidth = 6;
|
|
||||||
Column21.Name = "Column21";
|
|
||||||
Column21.ReadOnly = true;
|
|
||||||
Column21.Width = 84;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column23 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
|
||||||
Column23.DataPropertyName = "CCD14";
|
|
||||||
Column23.HeaderText = "中棱边ME4";
|
|
||||||
Column23.MinimumWidth = 6;
|
|
||||||
Column23.Name = "Column23";
|
|
||||||
Column23.ReadOnly = true;
|
|
||||||
Column23.Width = 84;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column28 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
|
||||||
Column28.DataPropertyName = "CCD15";
|
|
||||||
Column28.HeaderText = "极柱(POS/NEG)";
|
|
||||||
Column28.MinimumWidth = 8;
|
|
||||||
Column28.Name = "Column28";
|
|
||||||
Column28.ReadOnly = true;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column29 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
|
||||||
Column29.DataPropertyName = "CCD16";
|
|
||||||
Column29.HeaderText = "防爆阀(PRO)";
|
|
||||||
Column29.MinimumWidth = 8;
|
|
||||||
Column29.Name = "Column29";
|
|
||||||
Column29.ReadOnly = true;
|
|
||||||
Column29.Width = 89;
|
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column22 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
DataGridViewTextBoxColumn Column22 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
Column22.DataPropertyName = "Result";
|
Column22.DataPropertyName = "Result";
|
||||||
@@ -474,6 +397,7 @@ namespace JY.Inspection
|
|||||||
Column22.Name = "Column22";
|
Column22.Name = "Column22";
|
||||||
Column22.ReadOnly = true;
|
Column22.ReadOnly = true;
|
||||||
Column22.Width = 64;
|
Column22.Width = 64;
|
||||||
|
colDefList.Add(Column22);
|
||||||
|
|
||||||
DataGridViewTextBoxColumn Column24 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
DataGridViewTextBoxColumn Column24 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||||
Column24.DataPropertyName = "Remark";
|
Column24.DataPropertyName = "Remark";
|
||||||
@@ -482,33 +406,9 @@ namespace JY.Inspection
|
|||||||
Column24.Name = "Column24";
|
Column24.Name = "Column24";
|
||||||
Column24.ReadOnly = true;
|
Column24.ReadOnly = true;
|
||||||
Column24.Width = 52;
|
Column24.Width = 52;
|
||||||
|
colDefList.Add(Column24);
|
||||||
|
|
||||||
this.dgvDataShow_B.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
this.dgvDataShow_B.Columns.AddRange(colDefList.ToArray());
|
||||||
Column6,
|
|
||||||
Column8,
|
|
||||||
Column31,
|
|
||||||
Column26,
|
|
||||||
Column7,
|
|
||||||
Column27,
|
|
||||||
Column25,
|
|
||||||
Column9,
|
|
||||||
Column10,
|
|
||||||
Column11,
|
|
||||||
Column12,
|
|
||||||
Column13,
|
|
||||||
Column14,
|
|
||||||
Column15,
|
|
||||||
Column16,
|
|
||||||
Column17,
|
|
||||||
Column18,
|
|
||||||
Column19,
|
|
||||||
Column20,
|
|
||||||
Column21,
|
|
||||||
Column23,
|
|
||||||
Column28,
|
|
||||||
Column29,
|
|
||||||
Column22,
|
|
||||||
Column24});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -663,6 +563,8 @@ namespace JY.Inspection
|
|||||||
CheckClassShift();
|
CheckClassShift();
|
||||||
InitOmronCom();
|
InitOmronCom();
|
||||||
|
|
||||||
|
string strFileName = Environment.CurrentDirectory + "\\欧姆龙报警寄存器对应表.csv";
|
||||||
|
listAlarmForm = CSVHelper<AlarmForm>.ReadCSV(strFileName,",");
|
||||||
|
|
||||||
CancellationToken token1 = mctsA1.Token;
|
CancellationToken token1 = mctsA1.Token;
|
||||||
CancellationToken token2 = mctsA2.Token;
|
CancellationToken token2 = mctsA2.Token;
|
||||||
@@ -738,6 +640,9 @@ namespace JY.Inspection
|
|||||||
Global.systemConfig.StationArrivalUrl = IniFileHelper.ReadIniData("MES配置", "StationArrivalUrl");
|
Global.systemConfig.StationArrivalUrl = IniFileHelper.ReadIniData("MES配置", "StationArrivalUrl");
|
||||||
Global.systemConfig.StationExitUrl = IniFileHelper.ReadIniData("MES配置", "StationExitUrl");
|
Global.systemConfig.StationExitUrl = IniFileHelper.ReadIniData("MES配置", "StationExitUrl");
|
||||||
Global.systemConfig.LoginMesUrl = IniFileHelper.ReadIniData("MES配置", "LoginMesUrl");
|
Global.systemConfig.LoginMesUrl = IniFileHelper.ReadIniData("MES配置", "LoginMesUrl");
|
||||||
|
Global.systemConfig.EquipAlarmUrl = IniFileHelper.ReadIniData("MES配置", "EquipAlarmUrl");
|
||||||
|
Global.systemConfig.EquipStatusUrl = IniFileHelper.ReadIniData("MES配置", "EquipStatusUrl");
|
||||||
|
Global.systemConfig.TaskInterval = Convert.ToInt32(IniFileHelper.ReadIniData("MES配置", "TaskInterval"));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -839,7 +744,7 @@ namespace JY.Inspection
|
|||||||
IsStartNGFL = IniFileHelper.ReadIniData("MES配置", "StartNGFL") == "1" ? true : false;
|
IsStartNGFL = IniFileHelper.ReadIniData("MES配置", "StartNGFL") == "1" ? true : false;
|
||||||
chkStartNGFL.Checked = IsStartNGFL;
|
chkStartNGFL.Checked = IsStartNGFL;
|
||||||
|
|
||||||
listAlamByte = GetListByte(200);
|
//listAlamByte = GetListByte(200);
|
||||||
|
|
||||||
|
|
||||||
Global.systemConfig.isUpMes = IniFileHelper.ReadIniData("SYSTEM_CONFIGURE", "IsMesUP") == "1" ? true : false;
|
Global.systemConfig.isUpMes = IniFileHelper.ReadIniData("SYSTEM_CONFIGURE", "IsMesUP") == "1" ? true : false;
|
||||||
@@ -2119,8 +2024,8 @@ namespace JY.Inspection
|
|||||||
byte[] bytes = resByte.Content.ByteReverse();
|
byte[] bytes = resByte.Content.ByteReverse();
|
||||||
//前面有\03\00 标识 占2个字节
|
//前面有\03\00 标识 占2个字节
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
listBar[0] = TransformBase.TransString(bytes, 0+ offset, 20*2, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();//1# 条码
|
listBar[0] = omronPLCCom.lstMcUI[0].omronCipNet.ByteTransform.TransString(bytes, 0+ offset, 20*2, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();//1# 条码
|
||||||
listBar[1] = TransformBase.TransString(bytes, 40+ offset, 20*2, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();//2# 条码
|
listBar[1] = omronPLCCom.lstMcUI[0].omronCipNet.ByteTransform.TransString(bytes, 40+ offset, 20*2, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();//2# 条码
|
||||||
// listBar[2] = TransformBase.TransString(bytes, 80+ offset, 20 * 2, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();//3# 条码
|
// listBar[2] = TransformBase.TransString(bytes, 80+ offset, 20 * 2, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();//3# 条码
|
||||||
//新增 左右通道
|
//新增 左右通道
|
||||||
var dtGroup = 0;
|
var dtGroup = 0;
|
||||||
@@ -2158,7 +2063,7 @@ namespace JY.Inspection
|
|||||||
#region 947 MES
|
#region 947 MES
|
||||||
if (Global.systemConfig.isUpMes)
|
if (Global.systemConfig.isUpMes)
|
||||||
{
|
{
|
||||||
// TODO 进站数据上传
|
// 进站数据上传
|
||||||
ReqArrivalStation req = new ReqArrivalStation()
|
ReqArrivalStation req = new ReqArrivalStation()
|
||||||
{
|
{
|
||||||
SiteCode = Global.systemConfig.siteCode,
|
SiteCode = Global.systemConfig.siteCode,
|
||||||
@@ -2364,17 +2269,17 @@ namespace JY.Inspection
|
|||||||
{
|
{
|
||||||
CollectionUtil.GetListUShort(ConstValue.CCD_SDict.Count),
|
CollectionUtil.GetListUShort(ConstValue.CCD_SDict.Count),
|
||||||
CollectionUtil.GetListUShort(ConstValue.CCD_SDict.Count),
|
CollectionUtil.GetListUShort(ConstValue.CCD_SDict.Count),
|
||||||
CollectionUtil.GetListUShort(ConstValue.CCD_SDict.Count)
|
//CollectionUtil.GetListUShort(ConstValue.CCD_SDict.Count)
|
||||||
},
|
},
|
||||||
ListCCDFResult = new List<List<float>> {
|
ListCCDFResult = new List<List<float>> {
|
||||||
CollectionUtil.GetListFloat(ConstValue.CCD_FDict.Count),
|
CollectionUtil.GetListFloat(ConstValue.CCD_FDict.Count),
|
||||||
CollectionUtil.GetListFloat(ConstValue.CCD_FDict.Count),
|
CollectionUtil.GetListFloat(ConstValue.CCD_FDict.Count),
|
||||||
CollectionUtil.GetListFloat(ConstValue.CCD_FDict.Count)
|
//CollectionUtil.GetListFloat(ConstValue.CCD_FDict.Count)
|
||||||
},
|
},
|
||||||
ListCCDIResult = new List<List<int>> {
|
ListCCDIResult = new List<List<int>> {
|
||||||
CollectionUtil.GetListInt(ConstValue.CCD_IDict.Count),
|
CollectionUtil.GetListInt(ConstValue.CCD_IDict.Count),
|
||||||
CollectionUtil.GetListInt(ConstValue.CCD_IDict.Count),
|
CollectionUtil.GetListInt(ConstValue.CCD_IDict.Count),
|
||||||
CollectionUtil.GetListInt(ConstValue.CCD_IDict.Count)
|
//CollectionUtil.GetListInt(ConstValue.CCD_IDict.Count)
|
||||||
},
|
},
|
||||||
ListResult = CollectionUtil.GetListUShort(2)
|
ListResult = CollectionUtil.GetListUShort(2)
|
||||||
};
|
};
|
||||||
@@ -2386,11 +2291,16 @@ namespace JY.Inspection
|
|||||||
private void ParsePlcOutgoingData(byte[] content, OutgoingContainers containers)
|
private void ParsePlcOutgoingData(byte[] content, OutgoingContainers containers)
|
||||||
{
|
{
|
||||||
var bytes = content.ByteReverse();
|
var bytes = content.ByteReverse();
|
||||||
|
JY.Utility.LogHelper.LogPLCData("电池出站数据", bytes);
|
||||||
|
|
||||||
|
byte[] sByteArr = omronPLCCom.lstMcUI[0].Readbyte("W3400", 200)?.ByteReverse();
|
||||||
|
byte[] fByteArr = omronPLCCom.lstMcUI[0].Readbyte("W3500", 400)?.ByteReverse();
|
||||||
|
byte[] iByteArr = omronPLCCom.lstMcUI[0].Readbyte("W3600", 200)?.ByteReverse();
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
// 出站条码: 偏移0, 每通道40字节(20字符)
|
// 出站条码: 偏移0, 每通道40字节(20字符)
|
||||||
containers.ListBarOut[i] = TransformBase.TransString(
|
containers.ListBarOut[i] = omronPLCCom.lstMcUI[0].omronCipNet.ByteTransform.TransString(
|
||||||
bytes, 0 + (i * 40 * 2), 20 * 2, System.Text.Encoding.ASCII)
|
bytes, 0 + (i * 40 * 2), 20 * 2, System.Text.Encoding.ASCII)
|
||||||
.Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();
|
.Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();
|
||||||
|
|
||||||
@@ -2399,26 +2309,26 @@ namespace JY.Inspection
|
|||||||
// OK/NG结果: 3400-3415, 每通道偏移100字节/3450-3465
|
// OK/NG结果: 3400-3415, 每通道偏移100字节/3450-3465
|
||||||
for (int j = 0; j < ConstValue.CCD_SDict.Count; j++)
|
for (int j = 0; j < ConstValue.CCD_SDict.Count; j++)
|
||||||
{
|
{
|
||||||
int index = 390 * 2 + (i * 50 * 2) + j * 2;
|
int index = (i * 50 * 2) + j * 2;
|
||||||
lstBarResult[j] = (short)TransformBase.TransInt16(content, index);
|
lstBarResult[j] = (short)omronPLCCom.lstMcUI[0].omronCipNet.ByteTransform.TransInt16(sByteArr, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 浮点型结果: 3500起/3550
|
// 浮点型结果: 3500起/3550
|
||||||
for (int k = 0; k < ConstValue.CCD_FDict.Count; k++)
|
for (int k = 0; k < ConstValue.CCD_FDict.Count; k++)
|
||||||
{
|
{
|
||||||
int index = 490 * 2 + (i * 50 * 2) + k * 2 * 2;
|
int index = (i * 50 * 2) + k * 2 * 2;
|
||||||
containers.ListCCDFResult[i][k] = TransformBase.TransSingle(content, index);
|
containers.ListCCDFResult[i][k] = omronPLCCom.lstMcUI[0].omronCipNet.ByteTransform.TransSingle(fByteArr, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 整型结果: 3600起/3650
|
// 整型结果: 3600起/3650
|
||||||
for (int k = 0; k < ConstValue.CCD_IDict.Count; k++)
|
for (int k = 0; k < ConstValue.CCD_IDict.Count; k++)
|
||||||
{
|
{
|
||||||
int index = 590 * 2 + (i * 50 * 2) + k * 2;
|
int index = (i * 50 * 2) + k * 2;
|
||||||
containers.ListCCDIResult[i][k] = TransformBase.TransInt16(content, index);
|
containers.ListCCDIResult[i][k] = omronPLCCom.lstMcUI[0].omronCipNet.ByteTransform.TransInt16(iByteArr, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 进站条码: 偏移280(140*2), 每通道40字节
|
// 进站条码: 偏移280(140*2), 每通道40字节
|
||||||
containers.ListBarIn[i] = TransformBase.TransString(
|
containers.ListBarIn[i] = omronPLCCom.lstMcUI[0].omronCipNet.ByteTransform.TransString(
|
||||||
bytes, 140 * 2 + (i * 20 * 2), 20 * 2, System.Text.Encoding.ASCII)
|
bytes, 140 * 2 + (i * 20 * 2), 20 * 2, System.Text.Encoding.ASCII)
|
||||||
.Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();
|
.Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();
|
||||||
}
|
}
|
||||||
@@ -2449,7 +2359,7 @@ namespace JY.Inspection
|
|||||||
var lstError = new List<short>();
|
var lstError = new List<short>();
|
||||||
containers.ListResult[index] = GetResult(m, ref strErr, ref lstError);
|
containers.ListResult[index] = GetResult(m, ref strErr, ref lstError);
|
||||||
|
|
||||||
m.Result = containers.ListResult[index] == 1 ? "OK" : "NG";
|
m.Result = containers.ListResult[index] == 1 ? ConstValue.CCD_OK : ConstValue.CCD_NG;
|
||||||
m.Remark = strErr;
|
m.Remark = strErr;
|
||||||
|
|
||||||
// 4. 判断扫码NG与CCD NG
|
// 4. 判断扫码NG与CCD NG
|
||||||
@@ -2504,6 +2414,8 @@ namespace JY.Inspection
|
|||||||
if (listEntity.Count() > 0)
|
if (listEntity.Count() > 0)
|
||||||
{
|
{
|
||||||
m.TDGroup = listEntity.First().TDGroup;
|
m.TDGroup = listEntity.First().TDGroup;
|
||||||
|
m.InTime = listEntity.First().CreateTime;
|
||||||
|
m.IsRepeat = listEntity.Count > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理空条码
|
// 处理空条码
|
||||||
@@ -2546,7 +2458,7 @@ namespace JY.Inspection
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var propName in ConstValue.CCD_SDict.Keys)
|
foreach (var propName in ConstValue.CCD_IDict.Keys)
|
||||||
{
|
{
|
||||||
if (BlankingDataProps.TryGetValue(propName, out var prop))
|
if (BlankingDataProps.TryGetValue(propName, out var prop))
|
||||||
{
|
{
|
||||||
@@ -2816,7 +2728,7 @@ namespace JY.Inspection
|
|||||||
AssembleLineList = new List<AssembleLine>() {
|
AssembleLineList = new List<AssembleLine>() {
|
||||||
new AssembleLine() {
|
new AssembleLine() {
|
||||||
Identification = m.ArrivalBarCode,
|
Identification = m.ArrivalBarCode,
|
||||||
QualityStatus = m.Result,
|
QualityStatus = m.Result == ConstValue.CCD_OK ? ConstValue.CCD_OK : ConstValue.CCD_NG,
|
||||||
// TODO NG编码
|
// TODO NG编码
|
||||||
QrCode = string.Empty,
|
QrCode = string.Empty,
|
||||||
NgCode = new string[] { string.Empty },
|
NgCode = new string[] { string.Empty },
|
||||||
@@ -3216,30 +3128,43 @@ namespace JY.Inspection
|
|||||||
if (!mt.IsCancellationRequested)
|
if (!mt.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
sw.Restart();
|
sw.Restart();
|
||||||
byte[] res = new byte[2];
|
//byte[] res = new byte[2];
|
||||||
for (int i = 0; i < 30; i++)
|
//for (int i = 0; i < 30; i++)
|
||||||
|
//{
|
||||||
|
// res = omronPLCCom.lstMcUI[0].Readbyte("W6100[" + i + "].Word区", 1);
|
||||||
|
// if (res != null)
|
||||||
|
// {
|
||||||
|
// for (int j = i; j < res.Length + i; j++)
|
||||||
|
// {
|
||||||
|
// listAlamByte[i + j] = res[j - i];
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
byte[] res = null;
|
||||||
|
List<byte> listAlamByte = new List<byte>();
|
||||||
|
foreach (var address in ConstValue.AlarmAddressDic.Keys)
|
||||||
{
|
{
|
||||||
res = omronPLCCom.lstMcUI[0].Readbyte("W6100[" + i + "].Word区", 1);
|
ushort byteLen = (ushort)(ConstValue.AlarmAddressDic[address] * 10);
|
||||||
if (res != null)
|
res = omronPLCCom.lstMcUI[0].ReadByteFins($"D{address}", byteLen);
|
||||||
|
|
||||||
|
if (res == null)
|
||||||
{
|
{
|
||||||
for (int j = i; j < res.Length + i; j++)
|
continue;
|
||||||
{
|
|
||||||
listAlamByte[i + j] = res[j - i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
listAlamByte.AddRange(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
//AddLog(0, "读取报警耗时:" + sw.ElapsedMilliseconds + "ms");
|
//AddLog(0, "读取报警耗时:" + sw.ElapsedMilliseconds + "ms");
|
||||||
if (listAlamByte == null) { return; }
|
if (listAlamByte == null || listAlamByte.Count == 0) { return; }
|
||||||
string strFileName = Environment.CurrentDirectory + "\\欧姆龙报警寄存器对应表.csv";
|
|
||||||
listAlarmForm = CSVHelper<AlarmForm>.ReadCSV(strFileName);
|
//string strFileName = Environment.CurrentDirectory + "\\欧姆龙报警寄存器对应表.csv";
|
||||||
|
//listAlarmForm = CSVHelper<AlarmForm>.ReadCSV(strFileName);
|
||||||
//如果未配置报警地址信息返回 TODO
|
//如果未配置报警地址信息返回 TODO
|
||||||
if (listAlarmForm == null) { return; }
|
if (listAlarmForm == null) { return; }
|
||||||
int startPlcAddr = 0;//TODO 读取起始地址
|
|
||||||
//3.公用方法解析byte[]数据 => List<AlarmStatus>
|
|
||||||
if (listAlamByte == null) { return; } //如果未配置报警地址信息返回
|
|
||||||
//TODO 切换三菱和欧姆龙
|
//TODO 切换三菱和欧姆龙
|
||||||
listAlarmStatus = PLCAlarmParse.OmronEIPByte2Status(startPlcAddr, listAlamByte);
|
List<AlarmStatus> listAlarmStatus = PLCAlarmParse.OmronEIPByte2Status(listAlamByte);
|
||||||
//4.判定有不良后,关联AlarmStatus 和AlarmForm
|
//4.判定有不良后,关联AlarmStatus 和AlarmForm
|
||||||
if (listAlarmStatus == null) { return; } //状态信息为空返回
|
if (listAlarmStatus == null) { return; } //状态信息为空返回
|
||||||
|
|
||||||
@@ -3477,7 +3402,7 @@ namespace JY.Inspection
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
sw.Restart();
|
sw.Restart();
|
||||||
string code = Convert.ToString(TransformBase.TransInt16(resByte.Content, 0));//读取工位编码,W7010
|
string code = Convert.ToString(omronPLCCom.lstMcUI[0].omronCipNet.ByteTransform.TransInt16(resByte.Content, 0));//读取工位编码,W7010
|
||||||
omronPLCCom.lstMcUI[0].WriteDReg(omronPLCCom.lstMcUI[0].lstTrgUI[3].TrgParams.ResultAddr, 1);//结果返回PLC,W7100
|
omronPLCCom.lstMcUI[0].WriteDReg(omronPLCCom.lstMcUI[0].lstTrgUI[3].TrgParams.ResultAddr, 1);//结果返回PLC,W7100
|
||||||
omronPLCCom.lstMcUI[0].ClearReg(omronPLCCom.lstMcUI[0].lstTrgUI[3].TrgParams.TriggerAddr, VarType.Short);//复位PLC信号,W7000
|
omronPLCCom.lstMcUI[0].ClearReg(omronPLCCom.lstMcUI[0].lstTrgUI[3].TrgParams.TriggerAddr, VarType.Short);//复位PLC信号,W7000
|
||||||
sw.Stop();
|
sw.Stop();
|
||||||
|
|||||||
Generated
+135
-135
File diff suppressed because it is too large
Load Diff
@@ -331,7 +331,7 @@
|
|||||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAE
|
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAE
|
||||||
CgAAAk1TRnQBSQFMAgEBAwEAAaABCAGgAQgBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
CgAAAk1TRnQBSQFMAgEBAwEAASgBCQEoAQkBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||||
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||||
@@ -382,81 +382,6 @@
|
|||||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>137, 17</value>
|
<value>137, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column8.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column31.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column26.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column27.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column25.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column9.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column10.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column11.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column12.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column13.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column14.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column15.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column16.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column17.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column18.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column19.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column20.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column21.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column23.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column28.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column29.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column22.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column24.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using JY.Model;
|
using JY.Inspection.Mes;
|
||||||
|
using JY.Model;
|
||||||
using JY.Model.Common;
|
using JY.Model.Common;
|
||||||
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.Formula.Functions;
|
||||||
using System;
|
using System;
|
||||||
@@ -21,8 +22,53 @@ namespace JY.Inspection
|
|||||||
}
|
}
|
||||||
|
|
||||||
scheduler.AddTask(state => {
|
scheduler.AddTask(state => {
|
||||||
Debug.WriteLine("Hello");
|
//Debug.WriteLine("Hello");
|
||||||
}, interval: 1000 * 60);
|
List<string> data = this.Invoke(new Func<List<string>>(() => {
|
||||||
|
List<string> list = new List<string>();
|
||||||
|
|
||||||
|
#region 添加电表数据
|
||||||
|
//相电压UA
|
||||||
|
list.Add(txtPhaseVolUA.Text);
|
||||||
|
//相电压UB
|
||||||
|
list.Add(txtPhaseVolUB.Text);
|
||||||
|
//相电压UC
|
||||||
|
list.Add(txtPhaseVolUC.Text);
|
||||||
|
//线电压UAB
|
||||||
|
list.Add(txtLineVolUAB.Text);
|
||||||
|
//线电压UBC
|
||||||
|
list.Add(txtLineVolUBC.Text);
|
||||||
|
//线电压UAC
|
||||||
|
list.Add(txtLineVolUAC.Text);
|
||||||
|
|
||||||
|
//电流IA
|
||||||
|
list.Add(txtIA.Text);
|
||||||
|
//电流IB
|
||||||
|
list.Add(txtIB.Text);
|
||||||
|
//电流IC
|
||||||
|
list.Add(txtIC.Text);
|
||||||
|
|
||||||
|
//A相有功功率
|
||||||
|
list.Add(txtPowerA.Text);
|
||||||
|
//B相有功功率
|
||||||
|
list.Add(txtPowerB.Text);
|
||||||
|
//C相有功功率
|
||||||
|
list.Add(txtPowerC.Text);
|
||||||
|
//总有功功率
|
||||||
|
list.Add(txtTotalPower.Text);
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
return list;
|
||||||
|
})) as List<string>;
|
||||||
|
|
||||||
|
if (data == null || data.Count == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.WriteLine($"定时任务执行中, 时间: {DateTime.Now}");
|
||||||
|
|
||||||
|
new MESDataCombin().UpEnergyDataMqtt(data);
|
||||||
|
}, interval: 1000 * 60 * Global.systemConfig.TaskInterval);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>..\..\..\..\JY.Inspection\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
@@ -194,7 +194,6 @@
|
|||||||
<Compile Include="Common\ConnectionClient.cs" />
|
<Compile Include="Common\ConnectionClient.cs" />
|
||||||
<Compile Include="Common\DGShowMsg.cs" />
|
<Compile Include="Common\DGShowMsg.cs" />
|
||||||
<Compile Include="Common\DateTimeSynchronization.cs" />
|
<Compile Include="Common\DateTimeSynchronization.cs" />
|
||||||
<Compile Include="ConstValue.cs" />
|
|
||||||
<Compile Include="Entity\AlarmStatus.cs" />
|
<Compile Include="Entity\AlarmStatus.cs" />
|
||||||
<Compile Include="Frm\FormMesGradingSet.cs">
|
<Compile Include="Frm\FormMesGradingSet.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
|
|||||||
Binary file not shown.
@@ -13,11 +13,30 @@
|
|||||||
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
|
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
|
||||||
</layout>
|
</layout>
|
||||||
</appender>
|
</appender>
|
||||||
|
<!-- 2. PLC 数据专属 Appender(只记录 PLC 数据,按天生成) -->
|
||||||
|
<appender name="PlcDataAppender" type="log4net.Appender.RollingFileAppender">
|
||||||
|
<file value="Logs/" />
|
||||||
|
<appendToFile value="true" />
|
||||||
|
<rollingStyle value="Date" />
|
||||||
|
<datePattern value="yyyyMMdd'_PlcData.log'" />
|
||||||
|
<staticLogFileName value="false" />
|
||||||
|
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
|
||||||
|
<layout type="log4net.Layout.PatternLayout">
|
||||||
|
<!-- PLC 日志通常不需要复杂的线程或级别信息,保持简洁即可 -->
|
||||||
|
<conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.fff} | %message%newline" />
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
|
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
|
||||||
<layout type="log4net.Layout.PatternLayout">
|
<layout type="log4net.Layout.PatternLayout">
|
||||||
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
|
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
|
||||||
</layout>
|
</layout>
|
||||||
</appender>
|
</appender>
|
||||||
|
<!-- 3. 定义专属的 PLC Logger -->
|
||||||
|
<!-- additivity="false" 是关键:防止 PLC 日志同时被写入到 root 的系统日志文件中 -->
|
||||||
|
<logger name="PlcDataLogger">
|
||||||
|
<level value="INFO" />
|
||||||
|
<appender-ref ref="PlcDataAppender" />
|
||||||
|
</logger>
|
||||||
<logger name="Test">
|
<logger name="Test">
|
||||||
<level value="ALL" />
|
<level value="ALL" />
|
||||||
<appender-ref ref="RollingFileAppender" />
|
<appender-ref ref="RollingFileAppender" />
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace JY.Inspection.Mes
|
|||||||
MesCallResult<RespAlarm> UpAlarmData(ReqAlarm req);
|
MesCallResult<RespAlarm> UpAlarmData(ReqAlarm req);
|
||||||
|
|
||||||
// TODO 能耗
|
// TODO 能耗
|
||||||
void UpEnergyDataMqtt(List<double> dataList);
|
void UpEnergyDataMqtt(List<string> dataList);
|
||||||
|
|
||||||
// TODO 设备打标
|
// TODO 设备打标
|
||||||
}
|
}
|
||||||
@@ -196,7 +196,7 @@ namespace JY.Inspection.Mes
|
|||||||
{
|
{
|
||||||
tdvls.Add(new TagDataVOListItem() {
|
tdvls.Add(new TagDataVOListItem() {
|
||||||
tagCode = item.MesItemCode,
|
tagCode = item.MesItemCode,
|
||||||
tagValue = prop.GetValue(m).ToString(),
|
tagValue = prop.GetValue(m)?.ToString(),
|
||||||
tagTime = m.OutTime,
|
tagTime = m.OutTime,
|
||||||
tagCalculateResult = "Y",
|
tagCalculateResult = "Y",
|
||||||
tagRemark = item.MesItemName
|
tagRemark = item.MesItemName
|
||||||
@@ -204,43 +204,41 @@ namespace JY.Inspection.Mes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//tag1 = new TagDataVOListItem() { tagCode = "WGJA001", tagValue = m.ArrivalBarCode, tagTime = m.OutTime, tagCalculateResult = "Y", tagRemark = "入站条码" }; tdvls.Add(tag1);
|
#region 手动赋值
|
||||||
//tag1 = new TagDataVOListItem() { tagCode = "WGJA002", tagValue = m.DepartureBarCode, tagTime = m.OutTime, tagCalculateResult = "Y", tagRemark = "出站条码" }; tdvls.Add(tag1);
|
tdvls.Add(new TagDataVOListItem()
|
||||||
//tag1 = new TagDataVOListItem() { tagCode = "WGJA003", tagValue = m.WorkShift, tagTime = m.OutTime, tagCalculateResult = "Y", tagRemark = "班次" }; tdvls.Add(tag1);
|
{
|
||||||
//tag1 = new TagDataVOListItem() { tagCode = "WGJA004", tagValue = m.OutTime, tagTime = m.OutTime, tagCalculateResult = "Y", tagRemark = "出站时间" }; tdvls.Add(tag1);
|
tagCode = "VIM_OPERATION_PROCESS",
|
||||||
|
tagValue = "外观检",
|
||||||
|
tagTime = m.OutTime,
|
||||||
|
tagCalculateResult = "Y",
|
||||||
|
tagRemark = "工艺流程"
|
||||||
|
});
|
||||||
|
|
||||||
//foreach (var item in m.PLCValDic)
|
tdvls.Add(new TagDataVOListItem() {
|
||||||
//{
|
tagCode = "VIM_MODEL",
|
||||||
// // TODO 获取采集项配置
|
tagValue = Global.systemConfig.productType,
|
||||||
// var cfgItem = Global.systemConfig.CollectItemCfgList
|
tagTime = m.OutTime,
|
||||||
// .Where(it => it.IsEnable && it.PLCRelAddress == item.Key)
|
tagCalculateResult = "Y",
|
||||||
// .FirstOrDefault();
|
tagRemark = "型号"
|
||||||
|
});
|
||||||
|
|
||||||
// if (cfgItem == null)
|
tdvls.Add(new TagDataVOListItem() {
|
||||||
// {
|
tagCode = "VIM_RETEST_MARK",
|
||||||
// continue;
|
tagValue = m.IsRepeat ? "1" : "0",
|
||||||
// }
|
tagTime = m.OutTime,
|
||||||
|
tagCalculateResult = "Y",
|
||||||
|
tagRemark = "复测标记"
|
||||||
|
});
|
||||||
|
|
||||||
// // 生成TagDataVoListItem
|
tdvls.Add(new TagDataVOListItem()
|
||||||
// tdvls.Add(new TagDataVOListItem()
|
{
|
||||||
// {
|
tagCode = "VIM_RETEST_TIME",
|
||||||
// tagCode = cfgItem.MesItemCode,
|
tagValue = m.OutTime,
|
||||||
// tagValue = item.Value,
|
tagTime = m.OutTime,
|
||||||
// tagTime = m.OutTime,
|
tagCalculateResult = "Y",
|
||||||
// tagCalculateResult = "Y",
|
tagRemark = "复测时间"
|
||||||
// tagRemark = cfgItem.MesItemName
|
});
|
||||||
// });
|
#endregion
|
||||||
//}
|
|
||||||
|
|
||||||
//tdvls.Add(new TagDataVOListItem()
|
|
||||||
//{
|
|
||||||
// tagCode = "WGJA021",
|
|
||||||
// tagValue = m.Result,
|
|
||||||
// tagTime = m.OutTime,
|
|
||||||
// tagCalculateResult = "Y",
|
|
||||||
// tagRemark = "电池总结果"
|
|
||||||
//});
|
|
||||||
//多个
|
|
||||||
|
|
||||||
pl.tagDataVOList = tdvls;
|
pl.tagDataVOList = tdvls;
|
||||||
prp.payload = JsonHelper.Serialize(pl);
|
prp.payload = JsonHelper.Serialize(pl);
|
||||||
@@ -387,7 +385,7 @@ namespace JY.Inspection.Mes
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO 能耗定时上传
|
// TODO 能耗定时上传
|
||||||
public void UpEnergyDataMqtt(List<double> dataList)
|
public void UpEnergyDataMqtt(List<string> dataList)
|
||||||
{
|
{
|
||||||
if (dataList == null || dataList.Count == 0)
|
if (dataList == null || dataList.Count == 0)
|
||||||
{
|
{
|
||||||
@@ -418,7 +416,7 @@ namespace JY.Inspection.Mes
|
|||||||
cmd.Taglist.Add(new CollectionItem() {
|
cmd.Taglist.Add(new CollectionItem() {
|
||||||
Equipment_Code = Global.systemConfig.equipCode,
|
Equipment_Code = Global.systemConfig.equipCode,
|
||||||
EMeter_Name = dataNameArr[i],
|
EMeter_Name = dataNameArr[i],
|
||||||
EMeter_Value = dataList[i].ToString()
|
EMeter_Value = dataList[i]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,5 +89,14 @@ namespace JY.Inspection.ViewModel
|
|||||||
get { return productType; }
|
get { return productType; }
|
||||||
set { productType = value; OnPropertyChanged(); }
|
set { productType = value; OnPropertyChanged(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int taskInterval;
|
||||||
|
|
||||||
|
public int TaskInterval
|
||||||
|
{
|
||||||
|
get { return taskInterval; }
|
||||||
|
set { taskInterval = value; OnPropertyChanged(); }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ namespace JY.MES.MES
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 采集数组
|
/// 采集数组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<CollectionItem> Taglist { get; set; }
|
public List<CollectionItem> Taglist { get; set; } = new List<CollectionItem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CollectionItem
|
public class CollectionItem
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -52,6 +52,12 @@ namespace JY.Model
|
|||||||
[Name("条码对比")]
|
[Name("条码对比")]
|
||||||
public string TMDB { get; set; }
|
public string TMDB { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 进站时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "InTime")]
|
||||||
|
public string InTime { set; get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 出站时间
|
/// 出站时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -59,6 +65,12 @@ namespace JY.Model
|
|||||||
[Name("出站时间")]
|
[Name("出站时间")]
|
||||||
public string OutTime { set; get; }
|
public string OutTime { set; get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否复投
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "IsRepeat")]
|
||||||
|
public bool IsRepeat { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 正面(2W/3W)
|
/// 正面(2W/3W)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -176,11 +188,11 @@ namespace JY.Model
|
|||||||
|
|
||||||
public int CCDI3 { get; set; }
|
public int CCDI3 { get; set; }
|
||||||
|
|
||||||
public string CCDI4 { get; set; }
|
public int CCDI4 { get; set; }
|
||||||
|
|
||||||
public string CCDI5 { get; set; }
|
public int CCDI5 { get; set; }
|
||||||
|
|
||||||
public string CCDI6 { get; set; }
|
public int CCDI6 { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -112,14 +112,9 @@ namespace JY.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string userName = "";
|
public string userName = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 定时任务间隔时间
|
||||||
|
/// </summary>
|
||||||
|
public int TaskInterval { get; set; } = 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ namespace JY.Model.Excel
|
|||||||
{
|
{
|
||||||
public class CollectItemCfg
|
public class CollectItemCfg
|
||||||
{
|
{
|
||||||
[Description("PLC相对地址")]
|
//[Description("PLC相对地址")]
|
||||||
public int? PLCRelAddress { get; set; }
|
//public int? PLCRelAddress { get; set; }
|
||||||
|
|
||||||
[Description("PLC采集数据含义")]
|
[Description("PLC采集数据含义")]
|
||||||
public string PLCItemName { get; set; }
|
public string PLCItemName { get; set; }
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ namespace JY.Utility
|
|||||||
{
|
{
|
||||||
private static readonly ILog log;
|
private static readonly ILog log;
|
||||||
|
|
||||||
|
private static readonly ILog plcLog;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool DebugMode = false;
|
public static bool DebugMode = false;
|
||||||
@@ -46,6 +48,8 @@ namespace JY.Utility
|
|||||||
Console.WriteLine("Log4net.config 文件未找到,日志将无法正常写入");
|
Console.WriteLine("Log4net.config 文件未找到,日志将无法正常写入");
|
||||||
}
|
}
|
||||||
log = LogManager.GetLogger(repository.Name, "Test");
|
log = LogManager.GetLogger(repository.Name, "Test");
|
||||||
|
|
||||||
|
plcLog = LogManager.GetLogger(repository.Name, "PlcDataLogger");
|
||||||
RunClearJob();
|
RunClearJob();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,6 +376,17 @@ namespace JY.Utility
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public static void LogPLCData(string name, byte[] data)
|
||||||
|
{
|
||||||
|
if (data == null || data.Length == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string hexString = BitConverter.ToString(data).Replace("-", " ");
|
||||||
|
|
||||||
|
plcLog.Info($"{name} : {hexString}");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 错误日志带异常
|
/// 错误日志带异常
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using HslCommunication;
|
using HslCommunication;
|
||||||
|
using HslCommunication.Core;
|
||||||
using HslCommunication.Profinet.Omron;
|
using HslCommunication.Profinet.Omron;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -64,6 +65,8 @@ namespace PLCCommunication
|
|||||||
/// 欧姆龙Fins协议
|
/// 欧姆龙Fins协议
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HslCommunication.Profinet.Omron.OmronCipNet omronCipNet = null;
|
public HslCommunication.Profinet.Omron.OmronCipNet omronCipNet = null;
|
||||||
|
|
||||||
|
public HslCommunication.Profinet.Omron.OmronFinsNet omronFinsNet = null;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否链接PLC
|
/// 是否链接PLC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -198,6 +201,10 @@ namespace PLCCommunication
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
omronCipNet = new OmronCipNet();
|
omronCipNet = new OmronCipNet();
|
||||||
omronCipNet.ConnectTimeOut = 2000;
|
omronCipNet.ConnectTimeOut = 2000;
|
||||||
|
|
||||||
|
omronFinsNet = new OmronFinsNet();
|
||||||
|
omronFinsNet.ConnectTimeOut = 2000;
|
||||||
|
|
||||||
PanelTest.Enabled = false;
|
PanelTest.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,6 +343,16 @@ namespace PLCCommunication
|
|||||||
omronCipNet.Port = port;
|
omronCipNet.Port = port;
|
||||||
omronCipNet.Slot = solt;
|
omronCipNet.Slot = solt;
|
||||||
omronCipNet.ConnectClose();
|
omronCipNet.ConnectClose();
|
||||||
|
|
||||||
|
omronFinsNet.IpAddress = address.ToString();
|
||||||
|
omronFinsNet.Port = 9600;
|
||||||
|
omronFinsNet.DA2 = 0;
|
||||||
|
omronFinsNet.ByteTransform.DataFormat = DataFormat.CDAB;
|
||||||
|
omronFinsNet.ByteTransform.IsStringReverseByteWord = true;
|
||||||
|
omronFinsNet.ConnectTimeOut = 2000;
|
||||||
|
omronFinsNet.ReceiveTimeOut = 2000;
|
||||||
|
omronFinsNet.ConnectClose();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
omronCipNet.ConnectTimeOut = 2000;
|
omronCipNet.ConnectTimeOut = 2000;
|
||||||
@@ -347,6 +364,10 @@ namespace PLCCommunication
|
|||||||
BtnConnect.Enabled = false;
|
BtnConnect.Enabled = false;
|
||||||
str = StringResources.Language.ConnectedSuccess;
|
str = StringResources.Language.ConnectedSuccess;
|
||||||
AddLog(lstRecv, 0, StringResources.Language.ConnectedSuccess);
|
AddLog(lstRecv, 0, StringResources.Language.ConnectedSuccess);
|
||||||
|
|
||||||
|
omronFinsNet.ConnectTimeOut = 2000;
|
||||||
|
OperateResult connectFins = omronFinsNet.ConnectServer();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -355,7 +376,6 @@ namespace PLCCommunication
|
|||||||
str = StringResources.Language.ConnectedFailed;
|
str = StringResources.Language.ConnectedFailed;
|
||||||
AddLog(lstRecv,1, StringResources.Language.ConnectedFailed);
|
AddLog(lstRecv,1, StringResources.Language.ConnectedFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -928,7 +948,32 @@ namespace PLCCommunication
|
|||||||
if (IsConnected)
|
if (IsConnected)
|
||||||
{
|
{
|
||||||
result = omronCipNet.Read(iAddr, lenght).Content;
|
result = omronCipNet.Read(iAddr, lenght).Content;
|
||||||
AddLog(lstResWrite, 0, $"{iAddr} --> {result.ToString()}");
|
AddLog(lstResWrite, 0, $"{iAddr} --> {result?.ToString()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
AddLog(lstResWrite, 2, $"{iAddr} --> {ex.Message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] ReadByteFins(string iAddr, ushort length)
|
||||||
|
{
|
||||||
|
byte[] result = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//string type = iAddr.Substring(0, 1);
|
||||||
|
//if (type != "D" && type != "R")
|
||||||
|
//{
|
||||||
|
// AddLog(lstSend, 2, "暂只支持D,R存储区");
|
||||||
|
//}
|
||||||
|
if (IsConnected)
|
||||||
|
{
|
||||||
|
result = omronFinsNet.Read(iAddr, length).Content;
|
||||||
|
OperateResult barray = omronFinsNet.ReadBool(iAddr, length);
|
||||||
|
AddLog(lstResWrite, 0, $"{iAddr} --> {result?.ToString()}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
ALTER TABLE S1270.dbo.BlankingData ADD CCDF1 float NULL;
|
||||||
|
ALTER TABLE S1270.dbo.BlankingData ADD CCDF2 float NULL;
|
||||||
|
ALTER TABLE S1270.dbo.BlankingData ADD CCDF3 float NULL;
|
||||||
|
ALTER TABLE S1270.dbo.BlankingData ADD CCDI1 int NULL;
|
||||||
|
ALTER TABLE S1270.dbo.BlankingData ADD CCDI2 int NULL;
|
||||||
|
ALTER TABLE S1270.dbo.BlankingData ADD CCDI3 int NULL;
|
||||||
|
ALTER TABLE S1270.dbo.BlankingData ADD CCDI4 int NULL;
|
||||||
|
ALTER TABLE S1270.dbo.BlankingData ADD CCDI5 int NULL;
|
||||||
|
ALTER TABLE S1270.dbo.BlankingData ADD CCDI6 int NULL;
|
||||||
|
|
||||||
|
ALTER TABLE S1270.dbo.BlankingData ADD InTime datetime NULL;
|
||||||
|
ALTER TABLE S1270.dbo.BlankingData ADD IsRepeat int NULL;
|
||||||
|
|
||||||
Binary file not shown.
+2402
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user