Compare commits

..
10 Commits
Author SHA1 Message Date
liming 蔡 8feb0164a4 整理本地提交 2026-09-03 08:45:04 +08:00
liming 蔡 3ea4e4fd7b 限制NG为98 2026-08-11 18:57:20 +08:00
liming 蔡 25f2ae3d44 增加通道配置界面 2026-08-10 16:05:17 +08:00
liming 蔡 45c39f738b 忽略文件 2026-08-10 14:47:03 +08:00
Administrator f51db3f130 通道配置修改 2026-07-17 09:49:00 +08:00
Administrator 9a31174049 使用json存储通道信息 2026-07-16 19:00:09 +08:00
Administrator 3b276376e8 临时 2026-07-16 18:34:11 +08:00
Administrator 311fea3978 扫码NG由97改为98 2026-07-08 11:30:21 +08:00
Administrator e29dc75796 1. 写入分档增加起始默认值31(以G结尾、不包括NG、扫码NG)
2. 将mes异常为99的情况改为97
2026-07-06 10:32:29 +08:00
Administrator 3eed43af5d 分档类型变更 2026-07-02 17:22:02 +08:00
74 changed files with 7004 additions and 1804 deletions
+23
View File
@@ -27,3 +27,26 @@
/LargeSquareOne/bin/Debug /LargeSquareOne/bin/Debug
/LargeSquareOne/obj/Debug /LargeSquareOne/obj/Debug
/packages /packages
.vs/
[Dd]ebug/
/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db-shm
/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db-wal
/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/SemanticSymbols.db
/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db-wal
/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db-shm
/.vs/LargeSquareOne/CopilotIndices/17.14.1431.25910/CodeChunks.db
/LargeSquareOne/bin/Debug/Config/Configure.ini
/JinYuan.ControlCenter/.vs/JinYuan.ControlCenters.csproj.dtbcache.json
/JinYuan.DAL/.vs/JinYuan.DAL.csproj.dtbcache.json
/JinYuan.Helper/.vs/JinYuan.Helper.csproj.dtbcache.json
/JinYuan.MES/.vs/JinYuan.MES.csproj.dtbcache.json
/JinYuan.Models/.vs/JinYuan.Models.csproj.dtbcache.json
/JinYuan.VirtualDataLibrary/.vs/JinYuan.VirtualDataLibrary.csproj.dtbcache.json
/LargeSquareOne/.vs/LargeSquareOne.csproj.dtbcache.json
/LargeSquareOne/bin/Debug - 副本
/LargeSquareOne/bin/Debug -22/Config/表格
/LargeSquareOne/bin/Debug -22/Log
/LargeSquareOne/bin/Debug -22/Logs
/LargeSquareOne/bin/Debug -22/设备状态改变日志
/LargeSquareOne/bin/Debug -22
File diff suppressed because one or more lines are too long
+91 -1
View File
@@ -106,6 +106,7 @@ namespace JinYuan.ControlCenters
{ {
GetAlarmData(); GetAlarmData();
GetSafeEqptData();
InitFunc(); InitFunc();
IntiDevice(); IntiDevice();
Timer_RefreshData = new System.Timers.Timer(1000); Timer_RefreshData = new System.Timers.Timer(1000);
@@ -896,10 +897,18 @@ namespace JinYuan.ControlCenters
Task.Run(() => Task.Run(() =>
{ {
UploadEquEnergy();//电表 UploadEquEnergy();//电表
//UPloadAnemograph();//风速仪 //UPloadAnemograph();//风速仪
ShowSafeEqptEven_Run(); //安全装置状态
}); });
Regular = 0; Regular = 0;
} }
//if (Regular % 30==1)
//{
// Task.Run(() =>
// {
// ShowSafeEqptEven_Run();//安全装置状态
// });
//}
if (TotalNum > 4) if (TotalNum > 4)
{ {
GetEnergyData(); GetEnergyData();
@@ -1499,6 +1508,22 @@ namespace JinYuan.ControlCenters
} }
} }
List<AlarmForm> listSafeEqptForm = null;
public void GetSafeEqptData()
{
//加载PLC安全装置状态文件
try
{
string strFileName = System.Environment.CurrentDirectory + "\\安全装置报警寄存器对应表.csv";
listSafeEqptForm = CSVHelper<AlarmForm>.ReadCSV(strFileName);
}
catch (Exception ex)
{
MessageBox.Show("加载安装装置报警文件失败!");
}
}
/// <summary> /// <summary>
/// 报警信息读取 /// 报警信息读取
@@ -1656,6 +1681,71 @@ namespace JinYuan.ControlCenters
} }
List<AlarmData> safeEqptStatus = new List<AlarmData>();
List<AlarmStatus> listSafeEqptStatus = null;
private void ShowSafeEqptEven_Run()
{
if (CommonMethods.IsRun && CommonMethods.plcDevice.IsConnected)
{
string Date = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
JYResult<byte[]> resByte = CommonMethods.PlcLink.ReadValue<JYResult<byte[]>>("D1000", Data_Type.ArrByte, 8);
if (resByte.IsSuccess && resByte != null)
{
if (resByte == null) { return; }
//如果未配置报警地址信息返回 TODO
if (listSafeEqptForm == null) { return; }
int startPlcAddr = 1000;
listSafeEqptStatus = PLCAlarmParseHelper.OmronFinsByte2Status(startPlcAddr, resByte.Content);
//4.判定有不良后,关联AlarmStatus 和AlarmForm
if (listSafeEqptStatus == null) { return; } //状态信息为空返回
//如果有报警,获取报警信息
var josnTxtMsg = $"{Date}:获取PLC安全设备运行状态:\r\n";
for (int i = 0; i < listSafeEqptStatus.Count; i++)
{
josnTxtMsg += $"plc_addr={listSafeEqptStatus[i].PLCAdress},status={listSafeEqptStatus[i].Status}\r\n";
}
TxtHelper.WriteTxt($@"{CommonMethods.strMesLogspath}\{DateTime.Now.ToString("yyyyMMdd")}\设备运行状态\{DateTime.Now.ToString("HH")}.txt", josnTxtMsg);
//关联表单数据和报警记录,获取报警信息
safeEqptStatus = listSafeEqptStatus
.Join(listSafeEqptForm
, s => s.PLCAdress
, f => f.PLCAdress
, (s, f) => new AlarmData()
{
PLCAdress = s.PLCAdress,
AlarmCode = f.AlarmCode,
AlarmContent = f.AlarmContent == "" ? s.PLCAdress : f.AlarmContent,
AlarmDesc = f.AlarmContent == "" ? s.PLCAdress : f.AlarmContent,
AlarmType = "安全装置",
AlarmState = s.Status ? "0" : "1", //mes 要求0是异常,1是正常
StartTime = Date,
EndTime = Date,
Flag = 0
}).ToList();
if (safeEqptStatus.Count > 0)
{
List<SafeEqptCode> safeEqptCodeLists = new List<SafeEqptCode>();
safeEqptStatus.ForEach(r =>
{
if (CommonMethods.sysConfig.MesModeSwitching)
{
var item = new SafeEqptCode();
item.equipNum = r.AlarmCode;
item.status = r.AlarmState;
safeEqptCodeLists.Add(item);
}
});
MESDataCombin.SafeEqptAlarm(Date, safeEqptCodeLists);
}
}
}
}
/// <summary> /// <summary>
/// 报警保存 /// 报警保存
/// </summary> /// </summary>
+257 -316
View File
@@ -10,6 +10,7 @@ using PLCCommunication;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.Eventing.Reader;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -40,115 +41,7 @@ namespace JinYuan.ControlCenters
string NG_Type = ""; // 用于备注 string NG_Type = ""; // 用于备注
string OK_NG = ""; // OK或NG string OK_NG = ""; // OK或NG
#region 判断总结果 #region 判断总结果
/// <summary>
/// 判断总结果
/// </summary>
//private int JudgmentResult(int A, int B, int C, int D, int E, int F, int G, int H, int I, int J, int K, int L, int M, int N)
//{
// //条码,芯包重量,芯包侧厚,芯包CCD极性检测,电芯裁切粘连,电芯裁切毛刺,芯包铜焊印位置,
// //芯包正面极耳撕裂H,芯包背面极耳撕裂,芯包正面极耳翻折J,芯包背面极耳翻折,测厚压力结果,
// //焊前CCD检测结果,铝焊印位置判定结果
// //目前先判断条码,芯包重量,芯包侧厚,芯包CCD极性检测,芯包正面极耳撕裂,芯包正面极耳翻折
// int Result = 0;
// OK_NG = "OK";
// if (A == 2 || B == 2 || C == 2 || D == 2 || H == 2 || J == 2)
// {
// //ed
// Result = 2;
// OK_NG = "NG";
// }
// else if (A == 1 && B == 1 && C == 1 && D == 1 && H == 1 && J == 1)
// {
// Result = 1;
// OK_NG = "OK";
// }
// else
// {
// Result = 1;
// OK_NG = "OK";
// }
// if (A == 2)
// {
// NG_Type += "无条码_";
// Result = 2;
// }
// if (B == 2)
// {
// NG_Type += "芯包重量1NG_";
// //return 2;
// Result = 2;
// }
// if (C == 2)
// {
// NG_Type += "芯包侧厚NG_";
// //return 2;
// Result = 2;
// }
// if (D == 2)
// {
// NG_Type += "芯包CCD极性检测NG_";
// //return 2;
// Result = 2;
// }
// //if (E == 2)
// //{
// // NG_Type += "电芯裁切粘连NG_";
// // //return 2;
// //}
// //if (F == 2)
// //{
// // NG_Type += "电芯裁切毛刺NG_";
// // //return 2;
// //}
// //if (G == 2)
// //{
// // NG_Type += "芯包铜焊印位置判定NG_";
// // //return 2;
// //}
// if (H == 2)
// {
// NG_Type += "芯包正面极耳撕裂NG_";
// //return 2;
// }
// //if (I == 2)
// //{
// // NG_Type += "芯包背面极耳撕裂NG_";
// // //return 2;
// //}
// if (J == 2)
// {
// NG_Type += "芯包正面极耳翻折NG_";
// //return 2;
// }
// //if (K == 2)
// //{
// // NG_Type += "芯包背面极耳翻折NG_";
// // //return 2;
// //}
// if (L == 2)
// {
// NG_Type += "测厚压力NG_";
// //return 2;
// }
// if (M == 2)
// {
// NG_Type += "焊前CCD检测NG_";
// //return 2;
// }
// if (N == 2)
// {
// NG_Type += "铝焊印位置判定NG_";
// //return 2;
// }
// if (Result == 1)
// {
// NG_Type += "OK_";
// }
// return Result;
//}
/// <summary> /// <summary>
/// 判断总结果 /// 判断总结果
/// </summary> /// </summary>
@@ -318,6 +211,8 @@ namespace JinYuan.ControlCenters
return Result; return Result;
} }
#endregion
#region 上料工位(数据处理) #region 上料工位(数据处理)
/// <summary> /// <summary>
/// 上料工位 /// 上料工位
@@ -402,73 +297,75 @@ namespace JinYuan.ControlCenters
{ {
List<string> MesMessage = new List<string>(); List<string> MesMessage = new List<string>();
List<MesResType> mesResType = new List<MesResType>(); List<MesResType> mesResType = new List<MesResType>();
if (CommonMethods.mesConfig.isUpMes) //if (CommonMethods.mesConfig.isUpMes)
{ //{
string url = CommonMethods.mesConfig.InPutStationMesUrl; // string url = CommonMethods.mesConfig.InPutStationMesUrl;
string siteCode = CommonMethods.mesConfig.siteCode; // string siteCode = CommonMethods.mesConfig.siteCode;
string lineCode = CommonMethods.mesConfig.lineCode; // string lineCode = CommonMethods.mesConfig.lineCode;
string equipNum = CommonMethods.mesConfig.equipNum; // string equipNum = CommonMethods.mesConfig.equipNum;
string materialCode = CommonMethods.mesConfig.MaterialCode; // string materialCode = CommonMethods.mesConfig.MaterialCode;
string userName = CommonMethods.mesConfig.mesUserName; // string userName = CommonMethods.mesConfig.mesUserName;
string MesMessage1 = ""; // string MesMessage1 = "";
MesResType mesResType1 = MesResType.A; // MesResType mesResType1 = MesResType.A;
bool Res = CommonMethods.hbgMes.SingleCellInStation(url, siteCode, lineCode, equipNum, materialCode, userName, listBarCode[i], ref MesMessage1, ref mesResType1); // bool Res = CommonMethods.hbgMes.SingleCellInStation(url, siteCode, lineCode, equipNum, materialCode, userName, listBarCode[i], ref MesMessage1, ref mesResType1);
if (MesMessage1.Contains("发生一个或多个错误")) // if (MesMessage1.Contains("发生一个或多个错误"))
{ // {
MesMessage1 = "上传失败"; // MesMessage1 = "上传失败";
} // }
else // else
{ // {
m.Flag = 1; // m.Flag = 1;
} // }
if (Res) // if (Res)
{ // {
m.Result = "OK"; // m.Result = "OK";
listRes[i] = 1; // listRes[i] = 1;
m.Remark += MesMessage1; // m.Remark += MesMessage1;
} // }
else // else
{ // {
m.Result = "NG"; // m.Result = "NG";
switch (mesResType1) // switch (mesResType1)
{ // {
case MesResType.A:// 停线,设备报警停机 // case MesResType.A:// 停线,设备报警停机
//listRes[i] = 10; // //listRes[i] = 10;
listRes[i] = 3; // listRes[i] = 3;
m.Remark += "MES NG"; // m.Remark += "MES NG";
break; // break;
case MesResType.B: // case MesResType.B:
//listRes[i] = 9; // //listRes[i] = 9;
listRes[i] = 3; // listRes[i] = 3;
m.Remark += "MES NG"; // m.Remark += "MES NG";
break; // break;
case MesResType.C: // case MesResType.C:
//listRes[i] = 1; // //listRes[i] = 1;
listRes[i] = 3; // listRes[i] = 3;
m.Remark += "MES NG"; // m.Remark += "MES NG";
break; // break;
case MesResType.D: // case MesResType.D:
listRes[i] = 1; // listRes[i] = 1;
m.Remark += "MES OK"; // m.Remark += "MES OK";
break; // break;
default: // default:
listRes[i] = 3; // listRes[i] = 3;
m.Remark += "MES NG"; // m.Remark += "MES NG";
break; // break;
} // }
if (CommonMethods.sysConfig.OKSwitching) // if (CommonMethods.sysConfig.OKSwitching)
{ // {
//调试发OK // //调试发OK
listRes[i] = 1; // listRes[i] = 1;
//m.Result = "OK"; // //m.Result = "OK";
} // }
m.Remark += MesMessage1; // m.Remark += MesMessage1;
} // }
} // m.ID = i + 1;
else // m.CNum = m.ID.ToString();
//}
//else
{ {
m.Flag = 0; m.Flag = 0;
m.ID = i + 1; m.ID = i + 1;
@@ -542,11 +439,14 @@ namespace JinYuan.ControlCenters
JYResult result = CommonMethods.PlcLink.WriteValue("D2100", listRes[0], Data_Type.Short);//调试结果写入PLC JYResult result = CommonMethods.PlcLink.WriteValue("D2100", listRes[0], Data_Type.Short);//调试结果写入PLC
CommonMethods.PlcLink.WriteValue("D2101", listRes[1], Data_Type.Short);//调试结果写入PLC CommonMethods.PlcLink.WriteValue("D2101", listRes[1], Data_Type.Short);//调试结果写入PLC
CommonMethods.PlcLink.WriteValue("D2102", listRes[2], Data_Type.Short);//调试结果写入PLC CommonMethods.PlcLink.WriteValue("D2102", listRes[2], Data_Type.Short);//调试结果写入PLC
//CommonMethods.PlcLink.WriteValue("D2103", listRes[3], Data_Type.Short);//调试结果写入PLC CommonMethods.PlcLink.WriteValue("D2103", listRes[3], Data_Type.Short);//调试结果写入PLC
CommonMethods.PlcLink.WriteValue("D2104", listRes[4], Data_Type.Short);//调试结果写入PLC
CommonMethods.PlcLink.WriteValue("D2105", listRes[5], Data_Type.Short);//调试结果写入PLC
//CommonMethods.PlcLink.WriteInt16("D2100", listRes[0]);//调试结果OK写入PLC //CommonMethods.PlcLink.WriteInt16("D2100", listRes[0]);//调试结果OK写入PLC
if (result != null) if (result != null)
{ {
string strres = $"分档工位发送给PLC: D2100={listRes[0]},D2101={listRes[1]},D2102={listRes[2]},"; string strres = $"分档工位发送给PLC: D2100={listRes[0]},D2101={listRes[1]},D2102={listRes[2]},D2103={listRes[3]},D2104={listRes[4]},D2105 ={listRes[5]}";
CommonMethods.AddDataMonitorLog(0, strres); CommonMethods.AddDataMonitorLog(0, strres);
} }
@@ -1789,7 +1689,7 @@ namespace JinYuan.ControlCenters
List<string> listBarCode = GetList<string>(6, "");//电芯条码 List<string> listBarCode = GetList<string>(6, "");//电芯条码
//List<string> listNum = GetList<string>(1, "");//进站磁悬浮动子编号 //List<string> listNum = GetList<string>(1, "");//进站磁悬浮动子编号
List<short> listRes = GetList<short>(6, 0);//出站电芯反馈结果 List<short> listRes = GetList<short>(6, 0);//出站电芯反馈结果
List<short> listGradeResult = GetList<short>(6, 0);//grading plc 数字结果 List<short> listGradeResult = GetList<short>(6, 99);//grading plc 数字结果
//反馈结果 //反馈结果
#region 电芯解析 #region 电芯解析
//电芯解析 从3200 开始 //电芯解析 从3200 开始
@@ -1799,6 +1699,8 @@ namespace JinYuan.ControlCenters
listBarCode[3] = StringLib.GetStringFromByteArrayByEncoding(bytes, 120, 40, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim(); listBarCode[3] = StringLib.GetStringFromByteArrayByEncoding(bytes, 120, 40, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();
listBarCode[4] = StringLib.GetStringFromByteArrayByEncoding(bytes, 160, 40, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim(); listBarCode[4] = StringLib.GetStringFromByteArrayByEncoding(bytes, 160, 40, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();
listBarCode[5] = StringLib.GetStringFromByteArrayByEncoding(bytes, 200, 40, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim(); listBarCode[5] = StringLib.GetStringFromByteArrayByEncoding(bytes, 200, 40, System.Text.Encoding.ASCII).Replace('\0', ' ').Replace('\r', ' ').Replace(" ", "").Trim();
#endregion
#region 上传MES #region 上传MES
var lstBGearEntity = GetBlankingData(listBarCode); var lstBGearEntity = GetBlankingData(listBarCode);
//D3200起 //D3200起
@@ -1906,98 +1808,104 @@ namespace JinYuan.ControlCenters
#region 发送结果MES ,本地存储 #region 发送结果MES ,本地存储
if (Code_NG == 1) if (Code_NG == 1)
{ {
//if (i >= 4)
//{
// var bar = list[i].BarCode;
//}
string MesMessage = ""; string MesMessage = "";
MesResType mesResType = MesResType.C; MesResType mesResType = MesResType.C;
if (CommonMethods.mesConfig.isUpMes) //if (CommonMethods.mesConfig.isUpMes)
{ //{
#region 出站 分档取消出站 // // 2025/12/25 打开出站
////{ // #region 出站 分档取消出站
//// string url = CommonMethods.mesConfig.OutStationMesUrl; // {
//// string siteCode = CommonMethods.mesConfig.siteCode; // string url = CommonMethods.mesConfig.OutStationMesUrl;
//// string lineCode = CommonMethods.mesConfig.lineCode; // string siteCode = CommonMethods.mesConfig.siteCode;
//// string equipNum = CommonMethods.mesConfig.equipNum; // string lineCode = CommonMethods.mesConfig.lineCode;
//// string materialCode = CommonMethods.mesConfig.MaterialCode; // string equipNum = CommonMethods.mesConfig.equipNum;
//// string userName = CommonMethods.mesConfig.mesUserName; // string materialCode = CommonMethods.mesConfig.MaterialCode;
//// int type = 1; // string userName = CommonMethods.mesConfig.mesUserName;
//// //int type = 1; // int type = 1;
//// //string materialLotCodeLocator = ""; // //int type = 1;
//// var (NGcodeList, NGmessage) = NGWGJcode(m.CCD_NgNo, i); // //string materialLotCodeLocator = "";
//// bool Res = CommonMethods.hbgMes.OutboundInformations(url, siteCode, lineCode, equipNum, materialCode, userName, m, ref MesMessage, ref mesResType, NGcodeList, NGmessage); // var (NGcodeList, NGmessage) = NGWGJcode(m.CCD_NgNo, i);
//// //bool Res = CommonMethods.hbgMes.SingleCellOutStation(url, siteCode, lineCode, equipNum, materialCode, userName, m,) // bool Res = CommonMethods.hbgMes.OutboundInformations(url, siteCode, lineCode, equipNum, materialCode, userName, m, ref MesMessage, ref mesResType, NGcodeList, NGmessage);
//// if (MesMessage.Contains("发生一个或多个错误")) // //bool Res = CommonMethods.hbgMes.SingleCellOutStation(url, siteCode, lineCode, equipNum, materialCode, userName, m,)
//// { // if (MesMessage.Contains("发生一个或多个错误"))
//// MesMessage = "上传失败,"; // {
//// } // MesMessage = "上传失败,";
//// else // }
//// { // else
//// m.Flag = 1; // {
//// } // m.Flag = 1;
//// if (Res) // }
//// { // if (Res)
//// //MES出站判定结果 // {
//// m.Result = MyRes[i]; // //MES出站判定结果
//// ////芯包重量1判定结果 // m.Result = MyRes[i];
//// //if (m.list_Data1[i, 10] == 2) { m.Remark += "芯包重量NG,"; } // ////芯包重量1判定结果
//// ////芯包侧厚判定结果 // //if (m.list_Data1[i, 10] == 2) { m.Remark += "芯包重量NG,"; }
//// //if (m.list_Data1[i, 11] == 2) { m.Remark += "芯包侧厚NG,"; } // ////芯包侧厚判定结果
//// ////芯包CCD极性检测结果 // //if (m.list_Data1[i, 11] == 2) { m.Remark += "芯包侧厚NG,"; }
//// //if (m.list_Data1[i, 12] == 2) { m.Remark += "芯包CCD极性检测NG,"; } // ////芯包CCD极性检测结果
//// m.Remark += MesMessage; // //if (m.list_Data1[i, 12] == 2) { m.Remark += "芯包CCD极性检测NG,"; }
//// } // m.Remark += MesMessage;
//// else // }
//// { // else
//// switch (mesResType) // {
//// { // switch (mesResType)
//// case MesResType.A:// 停线,设备报警停机 // {
//// //m.listRes[i] = 10; // case MesResType.A:// 停线,设备报警停机
//// // m.Result = MyRes[i] = 2; // //m.listRes[i] = 10;
//// m.Result = MyRes[i] = 3; // // m.Result = MyRes[i] = 2;
//// m.Remark += "MES NG"; // m.Result = MyRes[i] = 3;
//// break; // m.Remark += "MES NG";
//// case MesResType.B://不停机,MEs NG品要排出,要给PLC发NG信号 // break;
//// //m.listRes[i] = 9; // case MesResType.B://不停机,MEs NG品要排出,要给PLC发NG信号
//// // m.Result = MyRes[i] = 2; // //m.listRes[i] = 9;
//// m.Result = MyRes[i] = 3; // // m.Result = MyRes[i] = 2;
//// m.Remark += "MES NG"; // m.Result = MyRes[i] = 3;
//// break; // m.Remark += "MES NG";
//// case MesResType.C://可忽略 // break;
//// //m.listRes[i] = 1; // case MesResType.C://可忽略
//// // m.Result = MyRes[i] = 2; // //m.listRes[i] = 1;
//// m.Result = MyRes[i] = 1; // // m.Result = MyRes[i] = 2;
//// m.Remark += "MES Alerm OK"; // m.Result = MyRes[i] = 1;
//// break; // m.Remark += "MES Alerm OK";
//// case MesResType.D://可忽略 // break;
//// //m.listRes[i] = 1; // case MesResType.D://可忽略
//// // m.Result = MyRes[i] = 2; // //m.listRes[i] = 1;
//// m.Result = MyRes[i] = 1; // // m.Result = MyRes[i] = 2;
//// m.Remark += "MES OK"; // m.Result = MyRes[i] = 1;
//// break; // m.Remark += "MES OK";
//// default: // break;
//// m.Remark += "MES NG"; // default:
//// m.Result = MyRes[i] = 3; // m.Remark += "MES NG";
//// break; // m.Result = MyRes[i] = 3;
//// } // break;
//// ////芯包重量1判定结果 // }
//// //if (m.list_Data1[i, 10] == 2) { m.Remark += "芯包重量NG,"; } // ////芯包重量1判定结果
//// ////芯包侧厚判定结果 // //if (m.list_Data1[i, 10] == 2) { m.Remark += "芯包重量NG,"; }
//// //if (m.list_Data1[i, 11] == 2) { m.Remark += "芯包侧厚NG,"; } // ////芯包侧厚判定结果
//// ////芯包CCD极性检测结果 // //if (m.list_Data1[i, 11] == 2) { m.Remark += "芯包侧厚NG,"; }
//// //if (m.list_Data1[i, 12] == 2) { m.Remark += "芯包CCD极性检测NG,"; } // ////芯包CCD极性检测结果
//// m.Remark += MesMessage; // //if (m.list_Data1[i, 12] == 2) { m.Remark += "芯包CCD极性检测NG,"; }
//// } // m.Remark += MesMessage;
////} // }
#endregion // }
//发送产品结果参数给MES // #endregion
//bool Res1 = CommonMethods.hbgMes.ProducResultParam(ur2, siteCode1, lineCode1, equipNum1, materialCode1, userName1, m, unloadType, ref Mesage); // //发送产品结果参数给MES
// //bool Res1 = CommonMethods.hbgMes.ProducResultParam(ur2, siteCode1, lineCode1, equipNum1, materialCode1, userName1, m, unloadType, ref Mesage);
if (m.Flag == 1) // if (m.Flag == 1)
m.UpState = "已上传"; // m.UpState = "已上传";
else // else
m.UpState = "未上传"; // m.UpState = "未上传";
} //}
else //else
{ {
m.Result = MyRes[i]; m.Result = MyRes[i];
m.Remark += "本地存储"; m.Remark += "本地存储";
@@ -2027,11 +1935,15 @@ namespace JinYuan.ControlCenters
#region OK分档查询 #region OK分档查询
//if (CommonMethods.sysConfig.MesModeSwitching && CommonMethods.mesConfig.isConnected) //if (CommonMethods.sysConfig.MesModeSwitching && CommonMethods.mesConfig.isConnected)
{ //1 分选测厚度NG ,2 分选外观不良 21分选一档,22分选二档,23分选三档、24分选四档,25分档5 26 ==6 { //1 分选测厚度NG ,2 分选外观不良 21分选一档,22分选二档,23分选三档、24分选四档,25分档5 26 ==6
// 99 外观检NG 98 性能NG 97 其它NG
if (list[i].Result == 1) //2025/12/25 ok
if (Code_NG == 1)
{ {
if (CommonMethods.mesConfig.isUpMes) if (CommonMethods.mesConfig.isUpMes)
{ {
//分档接口
//分档接口 //分档接口
//21~26 OK挡位 //21~26 OK挡位
var (success, mesage, mesResType, mesResFangAnType) = CommonMethods.hbgMes.MesGrading( var (success, mesage, mesResType, mesResFangAnType) = CommonMethods.hbgMes.MesGrading(
@@ -2043,59 +1955,87 @@ namespace JinYuan.ControlCenters
CommonMethods.mesConfig.equipNum, CommonMethods.mesConfig.equipNum,
CommonMethods.mesConfig.MaterialCode);//分档查询 CommonMethods.mesConfig.MaterialCode);//分档查询
var channels = CommonMethods.mesConfig.ChannelConfig.Channels;
var ngChanel = channels.FirstOrDefault(x => x.Gears.Contains("NG"));
int ngVal = ngChanel == null ? 98 : ngChanel.DefaultValue;
try try
{ {
//listGradeResult[i] = (short)26;//默认分档OK //listGradeResult[i] = (short)26;//默认分档OK
list[i].Remark = "外观检OK分档"; list[i].Remark = "外观检OK分档";
list[i].Mes_battery_Grade = mesResType[0]; list[i].Mes_battery_Grade = mesResType[0];
list[i].Mes_sorting_scheme = mesResFangAnType[0]; list[i].Mes_sorting_scheme = mesResFangAnType[0];
if (success && mesResType[0] != "NULL") if (success && mesResType[0] != "NULL")
{ {
#region 注释代码
//if (mesResType[0].Equals(CommonMethods.mesConfig.Grading1))
//{
// listGradeResult[i] = (short)(CommonMethods.MESGradingSet[0]);
// list[i].Remark = $"出站条码[{list[i].BarCode}],MES反馈档位:{mesResType[0]},{listGradeResult[i]}";
//}
//else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading2))
//{
// listGradeResult[i] = (short)(CommonMethods.MESGradingSet[1]);
// list[i].Remark = $"出站条码[{list[i].BarCode}],MES反馈档位:{mesResType[0]},{listGradeResult[i]}";
//}
//else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading3))
//{
// listGradeResult[i] = (short)(CommonMethods.MESGradingSet[2]);
// list[i].Remark = $"出站条码[{list[i].BarCode}],MES反馈档位:{mesResType[0]},{listGradeResult[i]}";
//}
//else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading4))
//{
// listGradeResult[i] = (short)(CommonMethods.MESGradingSet[3]);
// list[i].Remark = $"出站条码[{list[i].BarCode}],MES反馈档位:{mesResType[0]},{listGradeResult[i]}";
//}
//else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading5))
//{
// listGradeResult[i] = (short)(CommonMethods.MESGradingSet[4]);
// list[i].Remark = $"出站条码[{list[i].BarCode}],MES反馈档位:{mesResType[0]},{listGradeResult[i]}";
//}
//else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading6))
//{
// listGradeResult[i] = (short)(CommonMethods.MESGradingSet[5]);
// list[i].Remark = $"出站条码[{list[i].BarCode}],MES反馈档位:{mesResType[0]},{listGradeResult[i]}";
//}
//else
//{
// listGradeResult[i] = (short)(97);// 走分档NG
// list[i].Remark = $"出站条码[{list[i].BarCode}],MES反馈档位:{mesResType[0]},MES未反馈正确档位";
// throw new Exception("MES未反馈正确档位");
//}
#endregion
if (mesResType[0].Equals(CommonMethods.mesConfig.Grading1)) // MES分档查询
string[] mesChannels = mesResType[0].Split(',');
var channel = channels.FirstOrDefault(it => StrUtil.IsExist(it.Gears, mesChannels));
if (channel != null)
{ {
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[0] + 20); listGradeResult[i] = (short)channel.DefaultValue;
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}"; list[i].Remark = $"出站条码[{list[i].BarCode}],MES反馈档位:{mesResType[0]},{listGradeResult[i]}";
}
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading2))
{
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[1] + 20);
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
}
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading3))
{
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[2] + 20);
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
}
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading4))
{
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[3] + 20);
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
}
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading5))
{
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[4] + 20);
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
}
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading6))
{
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[5] + 20);
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
} }
else else
{ {
listGradeResult[i] = (short)(ngVal);// 走分档NG
list[i].Remark = $"出站条码[{list[i].BarCode}],MES反馈档位:{mesResType[0]},MES未反馈正确档位";
throw new Exception("MES未反馈正确档位"); throw new Exception("MES未反馈正确档位");
} }
} }
else else
{
listGradeResult[i] = (short)(ngVal);// 走分档NG
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]},MES未反馈正确档位";
throw new Exception("MES未反馈正确档位"); throw new Exception("MES未反馈正确档位");
}
} }
catch (Exception ex) catch (Exception ex)
{ {
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[5] + 20); //(short)26; //listGradeResult[i] = (short)(CommonMethods.MESGradingSet[5] + 20); //(short)26;
listGradeResult[i] = (short)(ngVal);// 走分档NG
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OK分档NG,MES未反馈正确档位"; list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OK分档NG,MES未反馈正确档位";
LoggerHelp.WriteLog("解析出站MES分档数据异常:{ex.Message}", "SysErrorLog"); LoggerHelp.WriteLog("解析出站MES分档数据异常:{ex.Message}", "SysErrorLog");
@@ -2104,33 +2044,27 @@ namespace JinYuan.ControlCenters
else else
{ {
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OK分档,MES断连"; list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OK分档,MES断连";
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[5] + 20); //(short)26; listGradeResult[i] = 98; //(short)26;
// list[i].Result = "MES NG"; // list[i].Result = "MES NG";
CommonMethods.PlcLink.WriteValue("D80", 1, Data_Type.Short); CommonMethods.PlcLink.WriteValue("D80", 1, Data_Type.Short);
//反馈MES结果 //反馈MES结果
} }
} }
else else
{ {
//厚度不良分档 1 测厚不良 2 外观不良 listGradeResult[i] = 98;
if (list[i].CCD19 != 1)
{ list[i].Remark = $"出站条码[{list[i].BarCode}]扫码NG";
listGradeResult[i] = 1;
list[i].Remark = $"出站条码[{list[i].BarCode}]测厚度NG";
}
else
{
//外观不良分档
listGradeResult[i] = 2;
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检NG不分类";
}
} }
listRes[i] = listGradeResult[i]; listRes[i] = listGradeResult[i];
list[i].Result = listGradeResult[i]; list[i].Result = listGradeResult[i];
MyRes[i] = listGradeResult[i]; MyRes[i] = listGradeResult[i];
} }
@@ -2167,6 +2101,9 @@ namespace JinYuan.ControlCenters
JYResult result1 = null; JYResult result1 = null;
JYResult result2 = null; JYResult result2 = null;
JYResult result3 = null; JYResult result3 = null;
JYResult result4 = null;
JYResult result5 = null;
JYResult result6 = null;
if (pf.IsFeedbackPlc) if (pf.IsFeedbackPlc)
{ {
//result1 = CommonMethods.PlcLink.WriteValue(pf.VarList[2].VarAddress, MyRes[0], Data_Type.Short);//判断结果写入PLC //result1 = CommonMethods.PlcLink.WriteValue(pf.VarList[2].VarAddress, MyRes[0], Data_Type.Short);//判断结果写入PLC
@@ -2180,6 +2117,9 @@ namespace JinYuan.ControlCenters
result1 = CommonMethods.PlcLink.WriteValue(pf.VarList[2].VarAddress, MyRes[0], Data_Type.Short);//判断结果写入PLC result1 = CommonMethods.PlcLink.WriteValue(pf.VarList[2].VarAddress, MyRes[0], Data_Type.Short);//判断结果写入PLC
result2 = CommonMethods.PlcLink.WriteValue(pf.VarList[3].VarAddress, MyRes[1], Data_Type.Short);//判断结果写入PLC result2 = CommonMethods.PlcLink.WriteValue(pf.VarList[3].VarAddress, MyRes[1], Data_Type.Short);//判断结果写入PLC
result3 = CommonMethods.PlcLink.WriteValue(pf.VarList[4].VarAddress, MyRes[2], Data_Type.Short);//判断结果写入PLC result3 = CommonMethods.PlcLink.WriteValue(pf.VarList[4].VarAddress, MyRes[2], Data_Type.Short);//判断结果写入PLC
result4 = CommonMethods.PlcLink.WriteValue(pf.VarList[5].VarAddress, MyRes[3], Data_Type.Short);//判断结果写入PLC
result5 = CommonMethods.PlcLink.WriteValue(pf.VarList[6].VarAddress, MyRes[4], Data_Type.Short);//判断结果写入PLC
result6 = CommonMethods.PlcLink.WriteValue(pf.VarList[7].VarAddress, MyRes[5], Data_Type.Short);//判断结果写入PLC
} }
//else //else
//{ //{
@@ -2189,9 +2129,9 @@ namespace JinYuan.ControlCenters
// result2 = CommonMethods.PlcLink.WriteValue(pf.VarList[3].VarAddress, MyRes[1], Data_Type.Short);//判断结果写入PLC // result2 = CommonMethods.PlcLink.WriteValue(pf.VarList[3].VarAddress, MyRes[1], Data_Type.Short);//判断结果写入PLC
//} //}
} }
JYResult result4 = CommonMethods.PlcLink.WriteValue(pf.VarList[0].VarAddress, 0);//置位0 JYResult result_zw = CommonMethods.PlcLink.WriteValue(pf.VarList[0].VarAddress, 0);//置位0
CommonMethods.AddDataMonitorLog(0, $"发送信息给PLC:{result1.IsSuccess},{MyRes[0]},{MyRes[1]},{MyRes[2]}"); CommonMethods.AddDataMonitorLog(0, $"发送信息给PLC:{result1.IsSuccess},{MyRes[0]},{MyRes[1]},{MyRes[2]},{MyRes[3]},{MyRes[4]},{MyRes[5]}");
LoggerHelp.WriteLog($"发送信息给PLC:{result1.IsSuccess},{MyRes[0]},{MyRes[1]},{MyRes[2]}"); LoggerHelp.WriteLog($"发送信息给PLC:{result1.IsSuccess},{MyRes[0]},{MyRes[1]},{MyRes[2]},{MyRes[3]},{MyRes[4]},{MyRes[5]}");
//Task.Run(() => { SendDateMQTT.Instance.EnterandExitSendMessge(1); }); //Task.Run(() => { SendDateMQTT.Instance.EnterandExitSendMessge(1); });
//数据存储 - 异步处理 //数据存储 - 异步处理
@@ -2357,7 +2297,7 @@ namespace JinYuan.ControlCenters
List<string> NGcodelist = new List<string>(); List<string> NGcodelist = new List<string>();
List<string> NGmessagelist = new List<string>(); List<string> NGmessagelist = new List<string>();
for (int i = 0; i < 16; i++) for (int i = 0; i < 27; i++)
{ {
if (lstResult[index, i] != 0) if (lstResult[index, i] != 0)
{ {
@@ -2392,6 +2332,7 @@ namespace JinYuan.ControlCenters
return NGcodelist; return NGcodelist;
} }
#endregion #endregion
#region 读取下料数据 sql数据库 #region 读取下料数据 sql数据库
private List<BGearEntity> GetBlankingData(List<string> listBarCode) private List<BGearEntity> GetBlankingData(List<string> listBarCode)
{ {
@@ -2477,5 +2418,5 @@ namespace JinYuan.ControlCenters
#endregion #endregion
} }
} }
#endregion
#endregion
File diff suppressed because it is too large Load Diff
+49 -1
View File
@@ -108,6 +108,54 @@ namespace JinYuan.ControlCenters
#endregion #endregion
#region 11、安全装置状态
/// <summary>
/// 安全装置状态
/// </summary>
/// <param name="strStatus"></param>
/// <returns></returns>
public static string SafeEqptAlarm(string StartDate, List<SafeEqptCode> safeEqptCodeLists = null)
{
var nowTime = DateTime.Now;
string resJson = "";
string josnTxtMsg = string.Empty;
string Date = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
try
{
//SafeEqptStatusParam statusParam = new SafeEqptStatusParam();
//statusParam.siteCode = CommonMethods.mesConfig.siteCode;
//statusParam.lineCode = CommonMethods.mesConfig.lineCode;
//statusParam.equipNum = CommonMethods.mesConfig.equipNum;
//statusParam.userName = CommonMethods.mesConfig.mesUserName;
//statusParam.seatId = "";
//statusParam.recordDate = StartDate;
//statusParam.uploadTime = Date;
//statusParam.safeEqptCodeList = safeEqptCodeLists;
//string SendJosn = JsonConvert.SerializeObject(statusParam);
var sw = new Stopwatch();
for (int i = 0; i < safeEqptCodeLists.Count; i++)
{
string SendJosn = JsonConvert.SerializeObject(safeEqptCodeLists[i]);
sw.Start();
resJson = MESApiHelper.HttpPostJsonAPI(CommonMethods.mesConfig.SafeEqptStatusMesUrl, SendJosn);
sw.Stop();
josnTxtMsg = $"{nowTime.ToString("yyyy-MM-dd HH:mm:ss.fff")}:调用MES安全设备运行状态接口:{CommonMethods.mesConfig.SafeEqptStatusMesUrl},请求数据为:{SendJosn},\n{nowTime.AddMilliseconds(sw.ElapsedMilliseconds).ToString("yyyy-MM-dd HH:mm:ss.fff")}:接口耗时:{sw.ElapsedMilliseconds}ms,返回结果:{resJson}";
TxtHelper.WriteTxt($@"{CommonMethods.strMesLogspath}\{nowTime.ToString("yyyyMMdd")}\设备运行状态\{nowTime.ToString("HH")}.txt", josnTxtMsg);
}
}
catch (Exception ex)
{
LoggerHelp.WriteEX("调用MES安全设备运行状态接口", ex);
}
return resJson;
}
#endregion
} }
} }
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -158,6 +158,7 @@
<Compile Include="SendDateMQTT.cs" /> <Compile Include="SendDateMQTT.cs" />
<Compile Include="StreamIOHelper.cs" /> <Compile Include="StreamIOHelper.cs" />
<Compile Include="StringSecurityHelper.cs" /> <Compile Include="StringSecurityHelper.cs" />
<Compile Include="StrUtil.cs" />
<Compile Include="TimerReset.cs" /> <Compile Include="TimerReset.cs" />
<Compile Include="TxtHelper.cs" /> <Compile Include="TxtHelper.cs" />
<Compile Include="XmlHelper.cs" /> <Compile Include="XmlHelper.cs" />
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView> <ProjectView>ProjectFiles</ProjectView>
</PropertyGroup> </PropertyGroup>
</Project> </Project>
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JinYuan.Helper
{
public class StrUtil
{
public static bool IsExist(List<string> searchList, string[] desArr)
{
bool result = false;
foreach (string str in searchList)
{
if (desArr.Contains(str))
{
result = true;
break;
}
}
return result;
}
}
}
@@ -1 +0,0 @@
{"RootPath":"E:\\JY_项目\\1086大方形\\1086-1\\LargeSquareOne\\JinYuan.MES","ProjectFileName":"JinYuan.MES.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Enums\\MesResType.cs"},{"SourceFile":"Enums\\MesUploadType.cs"},{"SourceFile":"IMes.cs"},{"SourceFile":"MESApiHelper.cs"},{"SourceFile":"MesDataProcess.cs"},{"SourceFile":"Models\\EqpStatusParam.cs"},{"SourceFile":"Models\\ParamReturnData.cs"},{"SourceFile":"Models\\SingleCellOutStation.cs"},{"SourceFile":"Models\\SingleCellInStation.cs"},{"SourceFile":"Models\\ManyCellInStation.cs"},{"SourceFile":"Models\\ManyCellOutStation.cs"},{"SourceFile":"Models\\LoginEnyity.cs"},{"SourceFile":"Models\\ParamChange.cs"},{"SourceFile":"Models\\ProductProcessParam.cs"},{"SourceFile":"Models\\ProductResultParameters.cs"},{"SourceFile":"Models\\MesResponse.cs"},{"SourceFile":"Models\\UploadAlarmParam.cs"},{"SourceFile":"Models\\UploadDeviceCollectData.cs"},{"SourceFile":"Models\\WattrMeter.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"E:\\JY_项目\\1086大方形\\1086-1\\LargeSquareOne\\JinYuan.Helper\\bin\\Debug\\JinYuan.Helper.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":true,"ProjectPath":""},{"Reference":"E:\\JY_项目\\1086大方形\\1086-1\\LargeSquareOne\\JinYuan.Models\\bin\\Debug\\JinYuan.Models.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":true,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\JY_项目\\1086大方形\\1086-1\\LargeSquareOne\\packages\\Newtonsoft.Json.13.0.3\\lib\\net45\\Newtonsoft.Json.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"E:\\JY_项目\\1086大方形\\1086-1\\LargeSquareOne\\JinYuan.MES\\bin\\Debug\\JinYuan.MES.dll","OutputItemRelativePath":"JinYuan.MES.dll"},{"OutputItemFullPath":"E:\\JY_项目\\1086大方形\\1086-1\\LargeSquareOne\\JinYuan.MES\\bin\\Debug\\JinYuan.MES.pdb","OutputItemRelativePath":"JinYuan.MES.pdb"}],"CopyToOutputEntries":[]}
+5 -3
View File
@@ -1934,13 +1934,15 @@ namespace JinYuan.MES
} }
if (row != null) if (row != null)
{ {
MesMessage = row.message.ToString(); MesMessage = "返回为空!";
// MesMessage = row.message.ToString();
MesGrading = row.rank; MesGrading = row.rank;
MesGradingFangAn = row.sortingScheme; MesGradingFangAn = row.sortingScheme;
} }
else else
{ {
MesMessage = "返回为空!"; MesMessage = row.message.ToString();
// MesMessage = "返回为空!";
MesGrading = "NULL"; MesGrading = "NULL";
MesGradingFangAn = "NULL"; MesGradingFangAn = "NULL";
} }
+57
View File
@@ -60,4 +60,61 @@ namespace JinYuan.MES.Models
/// </summary> /// </summary>
public string faultCode { get; set; } public string faultCode { get; set; }
} }
public class SafeEqptStatusParam
{
/// <summary>
/// 工厂代码
/// </summary>
public string siteCode { get; set; }
/// <summary>
/// 产线编号
/// </summary>
public string lineCode { get; set; }
/// <summary>
/// 设备编号
/// </summary>
public string equipNum { get; set; }
/// <summary>
///
/// </summary>
public string materialCode { get; set; }
/// <summary>
/// 员工账号
/// </summary>
public string userName { get; set; }
/// <summary>
/// 库位ID
/// </summary>
public string seatId { get; set; }
/// <summary>
/// 采集时间
/// </summary>
public string recordDate { get; set; }
/// <summary>
/// 设备状态 。Run:(正常运行)、Alert:(故障调试)、Idle:(闲置待机)、Maintain(停止运行)
/// </summary>
public string statusCode { get; set; }
/// <summary>
/// 状态变更时间
/// </summary>
public string uploadTime { get; set; }
/// <summary>
/// 唯一标识符号
/// </summary>
public string guid { get; set; }
public List<SafeEqptCode> safeEqptCodeList { get; set; }
}
public class SafeEqptCode
{
/// <summary>
/// 安全装置编码
/// </summary>
public string equipNum { get; set; }
/// <summary>
/// 设备状态
/// </summary>
public string status { get; set; }
}
} }
File diff suppressed because one or more lines are too long
+43 -18
View File
@@ -7,23 +7,23 @@ namespace JinYuan.Models
/// </summary> /// </summary>
public class BGearEntity public class BGearEntity
{ {
public int[] MyNo = new int[3];//AB序号 public int[] MyNo = new int[6];//AB序号
public short[] listRes = new short[3];//AB反馈结果 public short[] listRes = new short[6];//AB反馈结果
public string[] ScanTime = new string[3];//AB芯包扫码时间 public string[] ScanTime = new string[6];//AB芯包扫码时间
public string[] listBatCode = new string[3];//芯包条码 public string[] listBatCode = new string[6];//芯包条码
public string[] judgment_result = new string[3];//AB芯包出站判定结果 public string[] judgment_result = new string[6];//AB芯包出站判定结果
public short[,] list_Data1 = new short[3, 28];//芯包信息1 public short[,] list_Data1 = new short[6, 28];//芯包信息1
public int[,] list_Data2 = new int[3, 19];//芯包信息2(焊机相关次数) public int[,] list_Data2 = new int[6, 19];//芯包信息2(焊机相关次数)
public float[,] list_Data3 = new float[3, 54];//芯包信息3(设定值) public float[,] list_Data3 = new float[6, 54];//芯包信息3(设定值)
public float[,] list_Data4 = new float[3, 47];//芯包信息4(实际值) public float[,] list_Data4 = new float[6, 47];//芯包信息4(实际值)
public short[,] list_pan = new short[3, 1];//物流线托盘码 public short[,] list_pan = new short[6, 1];//物流线托盘码
// //
public int[,] CCD_Data = new int[3, 16];//芯包CCD信息1,2,3 public int[,] CCD_Data = new int[6,27];//芯包CCD信息1,2,3
public int[,] CCD_NgNo = new int[3, 16];//芯包不良编码信息1,2,3 public int[,] CCD_NgNo = new int[6, 27];//芯包不良编码信息1,2,3
public float[,] Thickness_Data = new float[3, 3];//电芯3_厚度数据信息1,2,3 public float[,] Thickness_Data = new float[6, 3];//电芯3_厚度数据信息1,2,3
public int[,] Thickness_PLCData = new int[3, 3];//电芯3_厚度数据OKNG1,2,3 与ccd一样 1 OK,0 NG,2 缺图 public int[,] Thickness_PLCData = new int[6, 3];//电芯3_厚度数据OKNG1,2,3 与ccd一样 1 OK,0 NG,2 缺图
/// <summary> /// <summary>
/// 通道 /// 通道
/// </summary> /// </summary>
@@ -69,7 +69,14 @@ namespace JinYuan.Models
public int CCD18 { get; set; } public int CCD18 { get; set; }
public int CCD19 { get; set; } public int CCD19 { get; set; }
public int CCD20 { get; set; } public int CCD20 { get; set; }
public int CCD21 { get; set; }
public int CCD22 { get; set; }
public int CCD23 { get; set; }
public int CCD24 { get; set; }
public int CCD25 { get; set; }
public int CCD26 { get; set; }
public int CCD27 { get; set; }
/// <summary> /// <summary>
/// 电芯1_厚度数据1 /// 电芯1_厚度数据1
/// </summary> /// </summary>
@@ -111,8 +118,15 @@ namespace JinYuan.Models
public string CCDResult18 { get; set; } public string CCDResult18 { get; set; }
public string CCDResult19 { get; set; } public string CCDResult19 { get; set; }
public string CCDResult20 { get; set; } public string CCDResult20 { get; set; }
public string CCDResult21 { get; set; }
public string CCDResult22 { get; set; }
public string CCDResult23 { get; set; }
public string CCDResult24 { get; set; }
public string CCDResult25 { get; set; }
public string CCDResult26 { get; set; }
public string CCDResult27 { get; set; }
public string CSBYHCODEA { get; set; }
/// <summary> /// <summary>
/// 芯包条码 /// 芯包条码
/// </summary> /// </summary>
@@ -191,10 +205,21 @@ namespace JinYuan.Models
public string CCD15NgCode { get; set; } public string CCD15NgCode { get; set; }
public string CCD16NgCode { get; set; } public string CCD16NgCode { get; set; }
public string CCD17NgCode { get; set; } public string CCD17NgCode { get; set; }
public string CCD18NgCode { get; set; }
public string CCD19NgCode { get; set; }
public string CCD20NgCode { get; set; }
public string CCD21NgCode { get; set; }
public string CCD22NgCode { get; set; }
public string CCD23NgCode { get; set; }
public string CCD24NgCode { get; set; }
public string CCD25NgCode { get; set; }
public string CCD26NgCode { get; set; }
public string CCD27NgCode { get; set; }
/// <summary> /// <summary>
/// 二维码ng 不良编号 /// 二维码ng 不良编号
/// </summary> /// </summary>
public string CCD18NgCode { get; set; }
public string BarCodeResult { get; set; } public string BarCodeResult { get; set; }
/// <summary> /// <summary>
/// 进出站条码匹配结果 /// 进出站条码匹配结果
@@ -238,7 +263,7 @@ namespace JinYuan.Models
public string SM_cutting_speed { get; set; } public string SM_cutting_speed { get; set; }
public string SM_dust_removal_wind_speed { get; set; } public string SM_dust_removal_wind_speed { get; set; }
} }
+13 -12
View File
@@ -93,21 +93,22 @@
<Compile Include="ElectricEnergy.cs" /> <Compile Include="ElectricEnergy.cs" />
<Compile Include="Hourprod.cs" /> <Compile Include="Hourprod.cs" />
<Compile Include="BGearEntity.cs" /> <Compile Include="BGearEntity.cs" />
<Compile Include="SysConfig\ChallengeCode.cs" /> <Compile Include="SysCfg\ChallengeCode.cs" />
<Compile Include="SysConfig\Device.cs" /> <Compile Include="SysCfg\ChannelConfig.cs" />
<Compile Include="SysCfg\Device.cs" />
<Compile Include="CPKModel.cs" /> <Compile Include="CPKModel.cs" />
<Compile Include="DeviceOEE.cs" /> <Compile Include="DeviceOEE.cs" />
<Compile Include="SysConfig\Enum.cs" /> <Compile Include="SysCfg\Enum.cs" />
<Compile Include="SysConfig\Group.cs" /> <Compile Include="SysCfg\Group.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SysConfig\ParamBase.cs" /> <Compile Include="SysCfg\ParamBase.cs" />
<Compile Include="SysConfig\ParamList.cs" /> <Compile Include="SysCfg\ParamList.cs" />
<Compile Include="SysConfig\ProductModel.cs" /> <Compile Include="SysCfg\ProductModel.cs" />
<Compile Include="SysConfig\ProductModelParam.cs" /> <Compile Include="SysCfg\ProductModelParam.cs" />
<Compile Include="SysConfig\Variable.cs" /> <Compile Include="SysCfg\Variable.cs" />
<Compile Include="SysConfig\SysAdmin.cs" /> <Compile Include="SysCfg\SysAdmin.cs" />
<Compile Include="SysConfig\SysConfig.cs" /> <Compile Include="SysCfg\SysConfig.cs" />
<Compile Include="SysConfig\SysLog.cs" /> <Compile Include="SysCfg\SysLog.cs" />
<Compile Include="DataTurnover.cs" /> <Compile Include="DataTurnover.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
+21
View File
@@ -0,0 +1,21 @@
using System;
namespace JinYuan.Models
{
public class Challenge
{
/// <summary>
/// 挑战件条码
/// </summary>
public String ChallengeBarCode { get; set; }
/// <summary>
/// 电芯信息
/// </summary>
public String CodeMessage { get; set; }
/// <summary>
/// 焊前/焊后CCD
/// </summary>
public String WeldingCCD { get; set; }
}
}
+30
View File
@@ -0,0 +1,30 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JinYuan.Models
{
public class ChannelConfig
{
public List<Channel> Channels { get; set; } = new List<Channel>();
}
public class Channel
{
public int ChannelId { get; set; }
public int DefaultValue { get; set; }
public List<string> Gears { get; set; } = new List<string>();
[JsonIgnore]
public string AllContent
{
get
{
return $"{ChannelId} {DefaultValue} {string.Join(",", Gears)}";
}
}
}
}
+317
View File
@@ -0,0 +1,317 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
namespace JinYuan.Models
{
/// <summary>
/// 通信设备实体类
/// </summary>
public class Device
{
/// <summary>
/// IP地址
/// </summary>
public string IPAddress { get; set; }
/// <summary>
/// 端口
/// </summary>
public int Port { get; set; }
/// <summary>
/// PLC类型
/// </summary>
public string PLCType { get; set; }
/// <summary>
/// 当前设备的连接状态
/// </summary>
public bool IsConnected { get; set; }
/// <summary>
/// 是否是首次连接
/// </summary>
public bool IsFirstConnect { get; set; } = true;
/// <summary>
/// 重连周期
/// </summary>
public int ReConnectTime { get; set; } = 2000;
/// <summary>
/// 休眠时间
/// </summary>
public int SleepTime { get; set; } = 10;
/// <summary>
/// 大小端
/// </summary>
[JsonIgnore]
public int DataFormat { get; set; } = 0;
/// <summary>
/// 出错次数
/// </summary>
public int ErrorTimes { get; set; }
/// <summary>
/// 容错次数
/// </summary>
public int AllowErrorTimes { get; set; } = 3;
/// <summary>
/// 多线程取消源标志位
/// </summary>
public CancellationTokenSource Cts { get; set; }
/// <summary>
/// 计时器
/// </summary>
public Stopwatch Stopwatch { get; set; }
/// <summary>
/// 所有归档变量的集合
/// </summary>
public List<Variable> StoreVarList { get; set; } = new List<Variable>();
/// <summary>
/// 按工位读取
/// </summary>
public List<Group> WorkVarList { get; set; } = new List<Group>();
/// <summary>
/// 通信组集合
/// </summary>
public List<Group> GroupList { get; set; } = new List<Group>();
/// <summary>
/// 所有变量的集合
/// </summary>
public List<Variable> VarList { get; set; } = new List<Variable>();
/// <summary>
/// 所有变量名称与值的集合
/// </summary>
public Dictionary<string, object> CurrentValue { get; set; } = new Dictionary<string, object>();
/// <summary>
/// 定义报警触发和消除事件
/// </summary>
public event Action<bool, Variable> AlarmTrigEvent;
/// <summary>
/// 变量初始化
/// </summary>
public void Init()
{
foreach (var gp in GroupList)
{
if (gp.IsTiggerRead)
{
WorkVarList.Add(gp);
}
foreach (var variable in gp.VarList)
{
if (!gp.IsTiggerRead)
{
VarList.Add(variable);
if (CurrentValue.ContainsKey(variable.VarName))
{
CurrentValue[variable.VarName] = "NA";
}
else
{
CurrentValue.Add(variable.VarName, "NA");
}
}
}
}
}
/// <summary>
/// 索引器,通过键名获取到数据
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
[JsonIgnore]
public object this[string key]
{
get
{
if (CurrentValue.ContainsKey(key))
{
return CurrentValue[key];
}
else
{
return null;
}
}
}
/// <summary>
/// 实时更新
/// </summary>
/// <param name="variable"></param>
public void Update(Variable variable)
{
//更新处理
if (CurrentValue.ContainsKey(variable.VarName))
{
CurrentValue[variable.VarName] = variable.VarValue;
}
else
{
CurrentValue.Add(variable.VarName, variable.VarValue);
}
//报警处理
if (variable.HighAlarmEnable || variable.LowAlarmEnable)
{
float compareValue = 0.0f;
if (variable.DataType.ToLower() == "bool")
{
compareValue = Convert.ToBoolean(variable.VarValue) ? 1.0f : 0.0f;
}
else
{
compareValue = Convert.ToSingle(variable.VarValue);
}
int compareResult = 0;
//高报警时,触发事件
if (variable.HighAlarmEnable)
{
compareResult = Compare(compareValue, variable.HighAlarmValue, variable.HighAlarmCacheValue, true);
if (compareResult != 0)
{
//通过事件做通知
OnAlarmAckEvent(variable, new AlarmEventArgs()
{
Name = variable.VarName,
CurrentValue = variable.VarValue.ToString(),
SetValue = variable.HighAlarmValue.ToString(),
AlarmNote = variable.HighAlarmNote,
IsTrigger = compareResult == 1
});
}
variable.HighAlarmCacheValue = compareValue;
}
else
{
compareResult = Compare(compareValue, variable.LowAlarmValue, variable.LowAlarmCacheValue, false);
if (compareResult != 0)
{
//通过事件做通知
OnAlarmAckEvent(variable, new AlarmEventArgs()
{
Name = variable.VarName,
CurrentValue = variable.VarValue.ToString(),
SetValue = variable.LowAlarmValue.ToString(),
AlarmNote = variable.LowAlarmNote,
IsTrigger = compareResult == 1
});
}
variable.LowAlarmCacheValue = compareValue;
}
}
}
/// <summary>
/// 报警触发的事件
/// </summary>
//public event AlarmTriggerEventDelegate AlarmTriggerEvent;
/// <summary>
/// 触发事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OnAlarmAckEvent(object sender, AlarmEventArgs e)
{
//AlarmTriggerEvent?.Invoke(sender, e);
}
/// <summary>
/// 报警比较
/// </summary>
/// <param name="current">当前值</param>
/// <param name="set">设置值</param>
/// <param name="last">缓存值</param>
/// <param name="isPositive">上升沿还是下降沿</param>
/// <returns>比较结果,1表示触发,-1表示消除,0表示无变化</returns>
private int Compare(float current, float set, float last, bool isPositive)
{
if (isPositive)
{
if (current >= set && last < set)
{
return 1;
}
if (current < set && last >= set)
{
return -1;
}
}
else
{
if (current <= set && last > set)
{
return 1;
}
if (current > set && last <= set)
{
return -1;
}
}
return 0;
}
}
public class AlarmEventArgs : EventArgs
{
/// <summary>
/// 变量名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 当前值
/// </summary>
public string CurrentValue { get; set; }
/// <summary>
/// 报警说明
/// </summary>
public string AlarmNote { get; set; }
/// <summary>
/// 报警设定值
/// </summary>
public string SetValue { get; set; }
/// <summary>
/// 是否为触发
/// </summary>
public bool IsTrigger { get; set; }
}
}
+18
View File
@@ -0,0 +1,18 @@
namespace JinYuan.Models
{
/// <summary>
/// 所有窗体枚举,小于临界窗体的为固定窗体,不执行关闭
/// </summary>
public enum FormNames
{
集中监控,
数据监控,
日志报警,
临界窗体,
数据分析,
数据追溯,
参数设置,
系统设置,
用户管理
}
}
+47
View File
@@ -0,0 +1,47 @@
using MiniExcelLibs.Attributes;
using System.Collections.Generic;
namespace JinYuan.Models
{
/// <summary>
/// 通信组实体类
/// </summary>
public class Group
{
/// <summary>
///通信组名称
/// </summary>
public string GroupName { get; set; }
/// <summary>
/// 起始地址
/// </summary>
public string Start { get; set; }
/// <summary>
/// 长度
/// </summary>
public ushort Length { get; set; }
/// <summary>
/// 是否为触发读取
/// </summary>
public bool IsTiggerRead { get; set; }
/// <summary>
/// 是否需要反馈结果到PLC
/// </summary>
public bool IsFeedbackPlc { get; set; }
/// <summary>
/// 是否启用
/// </summary>
public bool IsActive { get; set; }
/// <summary>
/// 备注说明
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 变量集合
/// </summary>
[ExcelIgnore]
public List<Variable> VarList { get; set; }
}
}
+33
View File
@@ -0,0 +1,33 @@
using SqlSugar;
namespace JinYuan.Models
{
/// <summary>
///
/// </summary>
public class ParamBase
{
/// <summary>
///
/// </summary>
public ParamBase()
{
}
/// <summary>
/// 序号
/// </summary>
public System.Int32? fNo { get; set; }
/// <summary>
/// 参数名称
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public System.String ParaName { get; set; }
/// <summary>
/// 备注
/// </summary>
public System.String Remark { get; set; }
}
}
+42
View File
@@ -0,0 +1,42 @@
using SqlSugar;
namespace JinYuan.Models
{
public class ParamList
{
/// <summary>
///
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public System.String ModelName { get; set; }
/// <summary>
///
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public System.String ParaName { get; set; }
/// <summary>
///
/// </summary>
public System.String ParaValueMin { get; set; }
/// <summary>
///
/// </summary>
public System.String ParaValueMax { get; set; }
/// <summary>
///
/// </summary>
public System.String Uint { get; set; }
/// <summary>
///
/// </summary>
public System.String Remark { get; set; }
/// <summary>
///
/// </summary>
public System.DateTime? UpdateTime { get; set; } = System.DateTime.Now;
}
}
+21
View File
@@ -0,0 +1,21 @@
using SqlSugar;
namespace JinYuan.Models
{
public class ProductModel
{
/// <summary>
///
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public System.String ModelName { get; set; }
/// <summary>
/// 物料编码
/// </summary>
public System.String MaterialCode { get; set; }
/// <summary>
///
/// </summary>
public System.String Remark { get; set; }
}
}
@@ -0,0 +1,25 @@
namespace JinYuan.Models
{
/// <summary>
/// 产品型号参数范围
/// </summary>
public class ProductModelParam
{
/// <summary>
/// 入壳压力1MAX
/// </summary>
public decimal PrePressure1Max { set; get; }
/// <summary>
/// 入壳压力2MAX
/// </summary>
public decimal PrePressure2Max { set; get; }
/// <summary>
/// 入壳压力3MAX
/// </summary>
public decimal PrePressure3Max { set; get; }
/// <summary>
/// 入壳压力下限
/// </summary>
}
}
+24
View File
@@ -0,0 +1,24 @@
using SqlSugar;
namespace JinYuan.Models
{
/// <summary>
/// 登录实体类型
/// </summary>
public class SysAdmin
{
[SugarColumn(IsPrimaryKey = true, IsIgnore = true)]
public int LoginId { get; set; }
public string LoginName { get; set; }
public string LoginPwd { get; set; }
public string LoginUid { get; set; }
public string LoginLevel { get; set; }
public bool SystemLog { get; set; }
public bool CpkData { get; set; }
public bool HistoryData { get; set; }
public bool ParamSet { get; set; }
public bool SystemSet { get; set; }
public bool UserManage { get; set; }
}
}
+63
View File
@@ -0,0 +1,63 @@
namespace JinYuan.Models.SysCfg
{
public class SysConfig
{
/// <summary>
/// 开机自动启动
/// </summary>
public bool AutoStart { get; set; }
/// <summary>
///启动自动登录
/// </summary>
public bool AutoLogin { get; set; }
/// <summary>
///无操作自动锁屏
/// </summary>
public bool AutoLock { get; set; }
/// <summary>
///锁屏间隙时间,单位是分钟
/// </summary>
public int LockPeriod { get; set; }
/// <summary>
///无操作自动锁屏
/// </summary>
public bool AutoQieHuanM { get; set; }
/// <summary>
///锁屏间隙时间,单位是分钟
/// </summary>
public int QieHuanMPeriod { get; set; }
/// <summary>
///曲线显示数量
/// </summary>
public int ShowSeriesCount { get; set; }
/// <summary>
/// 开启刷卡模式
/// </summary>
public bool SwipeCardMode { get; set; }
/// <summary>
/// MES/非MES模式切换
/// </summary>
public bool MesModeSwitching { get; set; }
/// <summary>
/// 切屏
/// </summary>
public bool ScreenCutting { get; set; }
/// <summary>
/// 获取MES参数
/// </summary>
public bool GetMesParam { get; set; }
/// <summary>
/// 切换强制OK模式
/// </summary>
public bool OKSwitching { get; set; }
/// <summary>
/// 线程耗时日志保存
/// </summary>
public bool SaveThreadTime { get; set; }
}
}
+38
View File
@@ -0,0 +1,38 @@
namespace JinYuan.Models
{
public class SysLog
{
/// <summary>
/// 插入时间
/// </summary>
public string InsertTime { get; set; }
/// <summary>
/// 报警类型
/// </summary>
public string LogType { get; set; }
/// <summary>
/// 日志信息
/// </summary>
public string Note { get; set; }
/// <summary>
/// 操作人员
/// </summary>
public string Operater { get; set; }
/// <summary>
/// 变量名称
/// </summary>
public string VarName { get; set; }
/// <summary>
/// 报警设置值
/// </summary>
public string AlarmSet { get; set; }
/// <summary>
/// 报警值
/// </summary>
public string AlarmValue { get; set; }
/// <summary>
/// 报警类型
/// </summary>
public string AlarmType { get; set; }
}
}
+103
View File
@@ -0,0 +1,103 @@
using MiniExcelLibs.Attributes;
namespace JinYuan.Models
{
/// <summary>
/// 变量属性类
/// </summary>
public class Variable
{
/// <summary>
/// 变量名称
/// </summary>
public string VarName { get; set; }
/// <summary>
/// 变量地址
/// </summary>
public string VarAddress { get; set; }
/// <summary>
/// 起始索引
/// </summary>
public string Start { get; set; }
/// <summary>
/// 数据类型
/// </summary>
public string DataType { get; set; }
/// <summary>
/// 偏移或长度
/// </summary>
public int OffsetOrLenght { get; set; }
/// <summary>
/// 所属通信组名称
/// </summary>
public string GroupName { get; set; }
/// <summary>
/// 备注说明
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 是否上升沿报警
/// </summary>
public bool PosAlarm { get; set; }
/// <summary>
/// 是否下降沿报警
/// </summary>
public bool NegAlarm { get; set; }
/// <summary>
/// 转换系数
/// </summary>
public float Scale { get; set; } = 1.0f;
/// <summary>
/// 偏移值
/// </summary>
public float Offset { get; set; } = 0.0f;
/// <summary>
/// 变量的值
/// </summary>
[ExcelIgnore]
public object VarValue { get; set; }
/// <summary>
/// 高报警启用
/// </summary>
public bool HighAlarmEnable { get; set; }
/// <summary>
/// 高报警设定值
/// </summary>
public float HighAlarmValue { get; set; }
/// <summary>
/// 高报警说明
/// </summary>
public string HighAlarmNote { get; set; }
/// <summary>
/// 高报警缓存值
/// </summary>
[ExcelIgnore]
public float HighAlarmCacheValue { get; set; }
/// <summary>
/// 低报警启用
/// </summary>
public bool LowAlarmEnable { get; set; }
/// <summary>
/// 低报警设定值
/// </summary>
public float LowAlarmValue { get; set; }
/// <summary>
/// 低报警说明
/// </summary>
public string LowAlarmNote { get; set; }
/// <summary>
/// 低报警缓存值
/// </summary>
[ExcelIgnore]
public float LowAlarmCacheValue { get; set; }
}
}
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JinYuan.Models.SysConfig
{
public class ChannelConfig
{
public List<Channel> Channels { get; set; } = new List<Channel>();
}
public class Channel
{
public int ChannelId { get; set; }
public int DefaultValue { get; set; }
public List<string> Gears { get; set; } = new List<string>();
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
namespace JinYuan.Models namespace JinYuan.Models.SysConfig
{ {
public class SysConfig public class SysConfig
{ {
File diff suppressed because one or more lines are too long
+128 -100
View File
@@ -5,9 +5,12 @@ using JinYuan.DAL;
using JinYuan.Helper; using JinYuan.Helper;
using JinYuan.MES; using JinYuan.MES;
using JinYuan.Models; using JinYuan.Models;
using JinYuan.Models.SysCfg;
using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Threading; using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
@@ -72,7 +75,6 @@ namespace JinYuan.VirtualDataLibrary
public static List<NgCodeEntity> listNgCodeEntity = new List<NgCodeEntity>(); public static List<NgCodeEntity> listNgCodeEntity = new List<NgCodeEntity>();
public static int InvadTime; public static int InvadTime;
/// <summary> /// <summary>
@@ -90,7 +92,6 @@ namespace JinYuan.VirtualDataLibrary
/// </summary> /// </summary>
public static DBSQL dBSQL { get; } = new DBSQL(); public static DBSQL dBSQL { get; } = new DBSQL();
/// <summary> /// <summary>
/// MES配置文件类 /// MES配置文件类
/// </summary> /// </summary>
@@ -99,7 +100,6 @@ namespace JinYuan.VirtualDataLibrary
///创建一个全局的连接状态 ///创建一个全局的连接状态
public static bool connectState = false; public static bool connectState = false;
/// <summary> /// <summary>
/// 滴答次数 /// 滴答次数
/// </summary> /// </summary>
@@ -309,105 +309,117 @@ namespace JinYuan.VirtualDataLibrary
var res = false; var res = false;
try try
{ {
if (plcDevice != null && plcDevice.IsConnected)
if (plcDevice != null && plcDevice.IsConnected) {
DateTime Date = DateTime.Now;
MESGradingSet = new short[6];
#region 档位写入
//var gradingMap = new Dictionary<string, short>();
//var gGradingMap = new Dictionary<string, short>();
//short normalStart = 21;
//short gStart = 31;
//string[] specialGrading = new string[] { "NG", "扫码NG" };
//var gradings = new[] {
// mesConfig.Grading1.Trim(),
// mesConfig.Grading2.Trim(),
// mesConfig.Grading3.Trim(),
// mesConfig.Grading4.Trim(),
// mesConfig.Grading5.Trim(),
// mesConfig.Grading6.Trim()
//};
//for (int i = 0; i < gradings.Length; i++)
//{
// string grading = gradings[i];
// if (!specialGrading.Contains(grading) && grading.EndsWith("G"))
// {
// if (gGradingMap.TryGetValue(grading, out short value))
// MESGradingSet[i] = value;
// else
// {
// MESGradingSet[i] = gStart;
// gGradingMap.Add(grading, gStart);
// gStart++;
// }
// }
// else
// {
// if (gradingMap.TryGetValue(grading, out short value))
// MESGradingSet[i] = value;
// else
// {
// MESGradingSet[i] = normalStart;
// gradingMap.Add(grading, normalStart);
// normalStart++;
// }
// }
//}
//#region 更新默认档位
//for (int i = 0; i < gradings.Length; i++)
//{
// switch (gradings[i])
// {
// /* 性能NG */
// case "NG":
// MESGradingSet[i] = 98;
// break;
// /* 外观检NG
// case "E63yG":
// MESGradingSet[i] = 31;
// break;
// case "F63yG":
// MESGradingSet[i] = 32;
// break;
// */
// /* 其它NG */
// case "拦截":
// case "扫码NG":
// case "其它":
// MESGradingSet[i] = 97;
// break;
// /* 性能NG */
// case "不设置":
// MESGradingSet[i] = 0;
// break;
// }
//}
//#endregion
#endregion
// 读取Chanel列表的默认值写入PLC
if (mesConfig.ChannelConfig?.Channels == null || mesConfig.ChannelConfig.Channels.Count != 6)
{ {
DateTime Date = DateTime.Now; throw new ArgumentOutOfRangeException("Channel.json 不满足要求,文件不存在或没有6个通道");
#region 档位写入 }
// short[] MESGradingSet = new short[] { 0, 0, 0, 0, 0, 0 };
//1
MESGradingSet[0] = (short)21; // 21 22 23 24 25 26
//2
if (mesConfig.Grading2.Trim().Equals(mesConfig.Grading1.Trim()))
MESGradingSet[1] = MESGradingSet[0];
else
MESGradingSet[1] = (short)(MESGradingSet[0] + 1);
//3
if (mesConfig.Grading3.Trim().Equals(CommonMethods.mesConfig.Grading1.Trim()))
MESGradingSet[2] = MESGradingSet[0];
else
{
if (CommonMethods.mesConfig.Grading3.Trim().Equals(CommonMethods.mesConfig.Grading2.Trim()))
MESGradingSet[2] = MESGradingSet[1];
else
MESGradingSet[2] = (short)(MESGradingSet[1] + 1);
}
//4
if (CommonMethods.mesConfig.Grading4.Trim().Equals(CommonMethods.mesConfig.Grading1.Trim()))
MESGradingSet[3] = MESGradingSet[0];
else
{
if (CommonMethods.mesConfig.Grading4.Trim().Equals(CommonMethods.mesConfig.Grading2.Trim()))
MESGradingSet[3] = MESGradingSet[1];
else
{
if (CommonMethods.mesConfig.Grading4.Trim().Equals(CommonMethods.mesConfig.Grading3.Trim()))
MESGradingSet[3] = MESGradingSet[2];
else
MESGradingSet[3] = (short)(MESGradingSet[2] + 1);
}
}
//5 var channels = mesConfig.ChannelConfig.Channels;
if (CommonMethods.mesConfig.Grading5.Trim().Equals(CommonMethods.mesConfig.Grading1.Trim())) for (int i = 0; i < channels.Count; i++)
MESGradingSet[4] = MESGradingSet[0]; {
else MESGradingSet[i] = (short)channels[i].DefaultValue;
{ }
if (CommonMethods.mesConfig.Grading5.Trim().Equals(CommonMethods.mesConfig.Grading2.Trim()))
MESGradingSet[4] = MESGradingSet[1];
else
{
if (CommonMethods.mesConfig.Grading5.Trim().Equals(CommonMethods.mesConfig.Grading3.Trim()))
MESGradingSet[4] = MESGradingSet[2];
else
{
if (CommonMethods.mesConfig.Grading5.Trim().Equals(CommonMethods.mesConfig.Grading4.Trim()))
MESGradingSet[4] = MESGradingSet[3];
else
MESGradingSet[4] = (short)(MESGradingSet[3] + 1);
}
}
}
//6
if (CommonMethods.mesConfig.Grading6.Trim().Equals(CommonMethods.mesConfig.Grading1.Trim()))
MESGradingSet[5] = MESGradingSet[0];
else
{
if (CommonMethods.mesConfig.Grading6.Trim().Equals(CommonMethods.mesConfig.Grading2.Trim()))
MESGradingSet[5] = MESGradingSet[1];
else
{
if (CommonMethods.mesConfig.Grading6.Trim().Equals(CommonMethods.mesConfig.Grading3.Trim()))
MESGradingSet[5] = MESGradingSet[2];
else
{
if (CommonMethods.mesConfig.Grading6.Trim().Equals(CommonMethods.mesConfig.Grading4.Trim()))
MESGradingSet[5] = MESGradingSet[3];
else
{
if (CommonMethods.mesConfig.Grading6.Trim().Equals(CommonMethods.mesConfig.Grading5.Trim()))
MESGradingSet[5] = MESGradingSet[4];
else
MESGradingSet[5] = (short)(MESGradingSet[4] + 1);
}
}
}
}
#endregion
var isWrite1 = PlcLink.WriteValue("D2600", MESGradingSet[0], Data_Type.Short);
var isWrite2 = PlcLink.WriteValue("D2601", MESGradingSet[1], Data_Type.Short);
var isWrite3 = PlcLink.WriteValue("D2602", MESGradingSet[2], Data_Type.Short);
var isWrite4 = PlcLink.WriteValue("D2603", MESGradingSet[3], Data_Type.Short);
var isWrite5 = PlcLink.WriteValue("D2604", MESGradingSet[4], Data_Type.Short);
var isWrite6 = PlcLink.WriteValue("D2605", MESGradingSet[5], Data_Type.Short);
if (isWrite1.IsSuccess && isWrite2.IsSuccess && isWrite3.IsSuccess && isWrite4.IsSuccess && isWrite5.IsSuccess && isWrite6.IsSuccess)
{
AddDataMonitorLog(0, $"OK分档档位写入PLC成功![2600~2605]{string.Join(",", MESGradingSet)}");
return true; // For Test
//string testStr = "E63y,F63y";
//string[] mesChannels = testStr.Split(',');
//var channel = channels.FirstOrDefault(it => StrUtil.IsExist(it.Gears, mesChannels));
} var isWrite1 = PlcLink.WriteValue("D2600", MESGradingSet[0], Data_Type.Short);
var isWrite2 = PlcLink.WriteValue("D2601", MESGradingSet[1], Data_Type.Short);
var isWrite3 = PlcLink.WriteValue("D2602", MESGradingSet[2], Data_Type.Short);
var isWrite4 = PlcLink.WriteValue("D2603", MESGradingSet[3], Data_Type.Short);
var isWrite5 = PlcLink.WriteValue("D2604", MESGradingSet[4], Data_Type.Short);
var isWrite6 = PlcLink.WriteValue("D2605", MESGradingSet[5], Data_Type.Short);
if (isWrite1.IsSuccess && isWrite2.IsSuccess && isWrite3.IsSuccess && isWrite4.IsSuccess && isWrite5.IsSuccess && isWrite6.IsSuccess)
{
AddDataMonitorLog(0, $"OK分档档位写入PLC成功![2600~2605]{string.Join(",", MESGradingSet)}");
return true;
}
} }
} }
catch (Exception ex) catch (Exception ex)
@@ -415,7 +427,6 @@ namespace JinYuan.VirtualDataLibrary
AddLog(true, ex.ToString()); AddLog(true, ex.ToString());
} }
return false; return false;
} }
#endregion #endregion
@@ -528,6 +539,23 @@ namespace JinYuan.VirtualDataLibrary
public static string iniFilePath = Path.Combine(System.Windows.Forms.Application.StartupPath, "ini\\Configure.ini"); public static string iniFilePath = Path.Combine(System.Windows.Forms.Application.StartupPath, "ini\\Configure.ini");
public static string ChannelPath = Path.Combine(System.Windows.Forms.Application.StartupPath, "Config\\Channel.json");
#region 读取json配置
public static Models.ChannelConfig LoadFromJson(string filePath)
{
var json = File.ReadAllText(filePath);
return JsonConvert.DeserializeObject<ChannelConfig>(json);
}
// 保存
public static void SaveToJson(string filePath, ChannelConfig config)
{
var json = JsonConvert.SerializeObject(config, Newtonsoft.Json.Formatting.Indented);
File.WriteAllText(filePath, json);
}
#endregion
#region 读取配置文件 #region 读取配置文件
/// <summary> /// <summary>
@@ -558,7 +586,7 @@ namespace JinYuan.VirtualDataLibrary
mesConfig.Grading4 = IniConfigHelper.ReadIniData("MES配置", "Grading4", "false"); mesConfig.Grading4 = IniConfigHelper.ReadIniData("MES配置", "Grading4", "false");
mesConfig.Grading5 = IniConfigHelper.ReadIniData("MES配置", "Grading5", "false"); mesConfig.Grading5 = IniConfigHelper.ReadIniData("MES配置", "Grading5", "false");
mesConfig.Grading6 = IniConfigHelper.ReadIniData("MES配置", "Grading6", "false"); mesConfig.Grading6 = IniConfigHelper.ReadIniData("MES配置", "Grading6", "false");
mesConfig.ChannelConfig = LoadFromJson(ChannelPath);
} }
catch (Exception) catch (Exception)
{ {
@@ -0,0 +1,801 @@
using JinYuan.CommunicationLib;
using JinYuan.CommunicationLib.Base;
using JinYuan.CommunicationLib.Enum;
using JinYuan.DAL;
using JinYuan.Helper;
using JinYuan.MES;
using JinYuan.Models;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Windows.Forms;
namespace JinYuan.VirtualDataLibrary
{
public class CommonMethods
{
/// <summary>
/// 本地数据库
/// </summary>
public static ISugarHepler db = new SQLSugarService();
/// <summary>
/// 远程服务段数据库
/// </summary>
public static ISugarHepler dbServer = new SQLSugarService();
/// <summary>
/// MES接口
/// </summary>
public static IMes hbgMes = new MesDataProcess();
/// <summary>
/// 参数
/// </summary>
public static ProductModelParam parRange = new ProductModelParam();
/// <summary>
/// 全局钩子
/// </summary>
public static ScanerHook listener = new ScanerHook();
/// <summary>
/// 创建个全局焊接功率队列数据存储
/// </summary>
public static List<Queue<double>> QWeldingPowerData = new List<Queue<double>>();
/// <summary>
/// 创建个全局入壳推力队列数据存储
/// </summary>
public static List<Queue<double>> QPlanenessData = new List<Queue<double>>();
/// <summary>
/// 创建全局的登录对象
/// </summary>
public static SysAdmin currentAdmin = null;
/// <summary>
/// 登录是否成功
/// </summary>
public static bool IsLoginOk = false;
/// <summary>
/// 创建一个设备对象
/// </summary>
public static Device plcDevice;
/// <summary>
/// ModbusTCP通信对象
/// </summary>
//public static OmronFinsTCP plc = new OmronFinsTCP();
//创建一个全局的配置对象
public static SysConfig sysConfig = new SysConfig();
/// <summary>
/// 创建全局的登录对象
/// </summary>
public static List<NgCodeEntity> listNgCodeEntity = new List<NgCodeEntity>();
public static int InvadTime;
/// <summary>
/// 智能电表
/// </summary>
public static List<ElectricEnergy> listElectricEnergy = new List<ElectricEnergy>();
/// <summary>
///是否开启刷新
/// </summary>
public static bool isRefreshTimerWeeding = false;
/// <summary>
/// SQL语句
/// </summary>
public static DBSQL dBSQL { get; } = new DBSQL();
/// <summary>
/// MES配置文件类
/// </summary>
public static MesConfig mesConfig = new MesConfig();
public static short[] MESGradingSet = new short[] { 0,0,0,0,0,0};
///创建一个全局的连接状态
public static bool connectState = false;
/// <summary>
/// 滴答次数
/// </summary>
public static int tickCount = 0;
/// <summary>
/// QIEHUAN
/// </summary>
public static int tickHomeCount = 0;
/// <summary>
/// 报警信息
/// </summary>
public static string SlideAlarmText = "当前无报警";
/// <summary>
/// 退出
/// </summary>
public static bool IsExit = false;
/// <summary>
/// 是否登出账户
/// </summary>
public static bool LoginOut = false;
/// <summary>
/// 是否上传MES
/// </summary>
public static bool IsUpMes { get; set; }
/// <summary>
/// 是否运行
/// </summary>
public static bool IsRun { get; set; } = false;
/// <summary>
///第一次读取
/// </summary>
public static bool IsFirst = false;
/// <summary>
/// 焊接功率波形图显示条数
/// </summary>
public static int ChatLineCount = 3;
/// <summary>
/// 员工号
/// </summary>
public static string strWorker { get; set; }
/// <summary>
/// 是否开启智能电表
/// </summary>
public static bool IsStartZNDB { get; set; } = false;
/// <summary>
/// 白夜班
/// </summary>
public static string strClass { get; set; } = "白班";
/// <summary>
/// 时间变更
/// </summary>
public static string ChangeClassTime { get; set; } = "20:30:00";
/// <summary>
/// 设备状态
/// </summary>
public static List<bool> Statues { get; set; }
/// <summary>
/// 服务器链接状态
/// </summary>
public static bool EMCStatues { get; set; }
#region 小时产能
/// <summary>
/// 上个时间点的总数
/// </summary>
public static int LastTotalNum { get; set; } = 0;
/// <summary>
/// 上个时间点良品数
/// </summary>
public static int LastOkNum { get; set; } = 0;
/// <summary>
/// 上一次重置计数的时间
/// </summary>
public static string LastResetTime { get; set; }
/// <summary>
/// 上一次的小时
/// </summary>
public static int LastHour { get; set; }
#endregion
/// <summary>
///
/// </summary>
public static List<Group> ListOmronGroups { get; set; }
/// <summary>
/// 12小时产能
/// </summary>
public static List<Chart12HourData> Lst_Prod12HourData = new List<Chart12HourData>();
/// <summary>
/// 不良选项(检测项不良)
/// </summary>
public static List<ChartDataType> Lst_DefectTypeQty = new List<ChartDataType>();
/// <summary>
/// PLC报警前10项
/// </summary>
public static List<ChartDataType> Lst_AlarmTop10_Qty = new List<ChartDataType>();
/// <summary>
/// 参数项设置
/// </summary>
public static List<ParamList> paramlists { get; set; }
/// <summary>
/// 线程控制
/// </summary>
public static ManualResetEvent ResetEventRecv = new ManualResetEvent(true);
#region 计数项
/// <summary>
/// 生产总数
/// </summary>
public static int TotalQty = 0;
public static int ProOKQty = 0;
public static int Ppm = 0;
public static double JiaDL = 0.0;
public static List<float> AntiDustAirSpeed = new List<float>();
/// <summary>
/// PLC开机/运行时间
/// </summary>
public static List<int> PlcOpenAndRunTime = new List<int>();
/// <summary>
/// PLC开机/运行时间地址
/// </summary>
public static List<string> PlcOpenAndRunTimeAdress = new List<string> { "D50", "D52", "D54", "D56", "D58", "D60" };
public static int ProdDRFIDNgQty = 0;//低托杯
public static int ProdDXNgQty = 0;//卷心码
public static int ProdGRFIDNgQty = 0;//高托杯
public static int ProdYLZNgQty = 0;//压力
#endregion
private static PlcReadWriteBase _PlcLink;
/// <summary>
/// PLC客户端
/// </summary>
public static PlcReadWriteBase PlcLink
{
get
{
if (_PlcLink == null)
{
_PlcLink = PlcNewClass.GetPLC(CommonMethods.plcDevice.IPAddress, CommonMethods.plcDevice.Port, (PLCType)Enum.Parse(typeof(PLCType), (string)CommonMethods.plcDevice.PLCType, false));
}
return _PlcLink;
}
}
#region 首次连接PLC
public static bool ConnectPLC()
{
try
{
if (CommonMethods.plcDevice != null)
{
//判断是否为第一次连接
if (!CommonMethods.plcDevice.IsFirstConnect)
{
Thread.Sleep(CommonMethods.plcDevice.ReConnectTime);
CommonMethods.PlcLink.Disconnect();
}
string msg = "";
var result = CommonMethods.PlcLink.Connect(ref msg);
if (result)
{
CommonMethods.plcDevice.IsConnected = true;
CommonMethods.AddLog(false, CommonMethods.plcDevice.IsFirstConnect ? $"PLC初次连接成功:{msg}" : $"PLC重新连接成功:{msg}");
return true;
}
else
{
CommonMethods.plcDevice.IsConnected = false;
CommonMethods.AddLog(true, CommonMethods.plcDevice.IsFirstConnect ? "PLC初次连接失败" : "PLC重新连接失败");
}
//如果是第一次连接,将标志位复位
if (CommonMethods.plcDevice.IsFirstConnect)
{
CommonMethods.plcDevice.IsFirstConnect = false;
}
}
}
catch (Exception)
{
new MsgshowTip("与PLC链接断开,请检查通讯线路!").ShowDialog();
}
return false;
}
#endregion
#region 写入分档
public static bool WriteGrading()
{
var res = false;
try
{
if (plcDevice != null && plcDevice.IsConnected)
{
DateTime Date = DateTime.Now;
#region 档位写入
// short[] MESGradingSet = new short[] { 0, 0, 0, 0, 0, 0 };
//1
MESGradingSet[0] = (short)21; // 21 22 23 24 25 26
//2
if (mesConfig.Grading2.Trim().Equals(mesConfig.Grading1.Trim()))
MESGradingSet[1] = MESGradingSet[0];
else
MESGradingSet[1] = (short)(MESGradingSet[0] + 1);
//3
if (mesConfig.Grading3.Trim().Equals(CommonMethods.mesConfig.Grading1.Trim()))
MESGradingSet[2] = MESGradingSet[0];
else
{
if (CommonMethods.mesConfig.Grading3.Trim().Equals(CommonMethods.mesConfig.Grading2.Trim()))
MESGradingSet[2] = MESGradingSet[1];
else
MESGradingSet[2] = (short)(MESGradingSet[1] + 1);
}
//4
if (CommonMethods.mesConfig.Grading4.Trim().Equals(CommonMethods.mesConfig.Grading1.Trim()))
MESGradingSet[3] = MESGradingSet[0];
else
{
if (CommonMethods.mesConfig.Grading4.Trim().Equals(CommonMethods.mesConfig.Grading2.Trim()))
MESGradingSet[3] = MESGradingSet[1];
else
{
if (CommonMethods.mesConfig.Grading4.Trim().Equals(CommonMethods.mesConfig.Grading3.Trim()))
MESGradingSet[3] = MESGradingSet[2];
else
MESGradingSet[3] = (short)(MESGradingSet[2] + 1);
}
}
//5
if (CommonMethods.mesConfig.Grading5.Trim().Equals(CommonMethods.mesConfig.Grading1.Trim()))
MESGradingSet[4] = MESGradingSet[0];
else
{
if (CommonMethods.mesConfig.Grading5.Trim().Equals(CommonMethods.mesConfig.Grading2.Trim()))
MESGradingSet[4] = MESGradingSet[1];
else
{
if (CommonMethods.mesConfig.Grading5.Trim().Equals(CommonMethods.mesConfig.Grading3.Trim()))
MESGradingSet[4] = MESGradingSet[2];
else
{
if (CommonMethods.mesConfig.Grading5.Trim().Equals(CommonMethods.mesConfig.Grading4.Trim()))
MESGradingSet[4] = MESGradingSet[3];
else
MESGradingSet[4] = (short)(MESGradingSet[3] + 1);
}
}
}
//6
if (CommonMethods.mesConfig.Grading6.Trim().Equals(CommonMethods.mesConfig.Grading1.Trim()))
MESGradingSet[5] = MESGradingSet[0];
else
{
if (CommonMethods.mesConfig.Grading6.Trim().Equals(CommonMethods.mesConfig.Grading2.Trim()))
MESGradingSet[5] = MESGradingSet[1];
else
{
if (CommonMethods.mesConfig.Grading6.Trim().Equals(CommonMethods.mesConfig.Grading3.Trim()))
MESGradingSet[5] = MESGradingSet[2];
else
{
if (CommonMethods.mesConfig.Grading6.Trim().Equals(CommonMethods.mesConfig.Grading4.Trim()))
MESGradingSet[5] = MESGradingSet[3];
else
{
if (CommonMethods.mesConfig.Grading6.Trim().Equals(CommonMethods.mesConfig.Grading5.Trim()))
MESGradingSet[5] = MESGradingSet[4];
else
MESGradingSet[5] = (short)(MESGradingSet[4] + 1);
}
}
}
}
#endregion
var isWrite1 = PlcLink.WriteValue("D2600", MESGradingSet[0], Data_Type.Short);
var isWrite2 = PlcLink.WriteValue("D2601", MESGradingSet[1], Data_Type.Short);
var isWrite3 = PlcLink.WriteValue("D2602", MESGradingSet[2], Data_Type.Short);
var isWrite4 = PlcLink.WriteValue("D2603", MESGradingSet[3], Data_Type.Short);
var isWrite5 = PlcLink.WriteValue("D2604", MESGradingSet[4], Data_Type.Short);
var isWrite6 = PlcLink.WriteValue("D2605", MESGradingSet[5], Data_Type.Short);
if (isWrite1.IsSuccess && isWrite2.IsSuccess && isWrite3.IsSuccess && isWrite4.IsSuccess && isWrite5.IsSuccess && isWrite6.IsSuccess)
{
AddDataMonitorLog(0, $"OK分档档位写入PLC成功![2600~2605]{string.Join(",", MESGradingSet)}");
return true;
}
}
}
catch (Exception ex)
{
AddLog(true, ex.ToString());
}
return false;
}
#endregion
#region 写入PLC信息
//public static OperateResult CommonWrite(string varName, string varValue)
//{
// //先通过变量名称找到对象
// var variable = plcDevice.VarList.Find(c => c.VarName == varName);
// if (variable != null)
// {
// DataConvertLib.DataType dataType = (DataConvertLib.DataType)Enum.Parse(typeof(DataConvertLib.DataType), variable.DataType, true);
// var result = MigrationLib.SetMigrationValue(varValue, dataType, variable.Scale.ToString(), variable.Offset.ToString());
// if (result.IsSuccess)
// {
// try
// {
// switch (dataType)
// {
// case DataConvertLib.DataType.Bool:
// return plc.WriteBool(variable.VarAddress, result.Content == "1" || result.Content.ToUpper() == "TRUE");
// case DataConvertLib.DataType.Byte:
// return plc.WriteByte(variable.VarAddress, Convert.ToByte(result.Content));
// case DataConvertLib.DataType.Short:
// return plc.WriteShort(variable.VarAddress, Convert.ToInt16(result.Content));
// case DataConvertLib.DataType.UShort:
// return plc.WriteUShort(variable.VarAddress, Convert.ToUInt16(result.Content));
// case DataConvertLib.DataType.Int:
// return plc.WriteInt(variable.VarAddress, Convert.ToInt32(result.Content));
// case DataConvertLib.DataType.UInt:
// return plc.WriteUInt(variable.VarAddress, Convert.ToUInt32(result.Content));
// case DataConvertLib.DataType.Float:
// return plc.WriteFloat(variable.VarAddress, Convert.ToSingle(result.Content));
// case DataConvertLib.DataType.Double:
// return plc.WriteDouble(variable.VarAddress, Convert.ToDouble(result.Content));
// case DataConvertLib.DataType.Long:
// return plc.WriteLong(variable.VarAddress, Convert.ToInt64(result.Content));
// case DataConvertLib.DataType.ULong:
// return plc.WriteULong(variable.VarAddress, Convert.ToUInt64(result.Content));
// case DataConvertLib.DataType.String:
// return plc.WriteByteArray(variable.VarAddress, ByteArrayLib.GetByteArrayFromString(result.Content, Encoding.ASCII));
// default:
// return OperateResult.CreateFailResult("暂不支持此数据类型");
// }
// }
// catch (Exception ex)
// {
// return OperateResult.CreateFailResult("数据转换出错:" + ex.Message);
// }
// }
// else
// {
// return OperateResult.CreateFailResult(result.Message);
// }
// }
// else
// {
// return OperateResult.CreateFailResult("请检查变量名称是否存在");
// }
//}
#endregion
#region 配置信息
public static string devPath = Application.StartupPath + "\\Config\\Device.ini";
public static string groupPath = Application.StartupPath + "\\Config\\Group.xlsx";
public static string variablePath = Application.StartupPath + "\\Config\\Variable.xlsx";
public static string settingPath = Application.StartupPath + "\\Config\\settings.json";
/// <summary>
/// 错误日志路径
/// </summary>
public static string strErrorLogspath = System.Windows.Forms.Application.StartupPath + "\\Logs\\ErrorLogs";
public static string strSystemLogspath = System.Windows.Forms.Application.StartupPath + "\\Logs\\SystemLogs";
public static string strAlarmLogspath = System.Windows.Forms.Application.StartupPath + "\\Logs\\AlarmLogs";
public static string strsqlLogspath = "";
/// <summary>
/// 删除路径
/// </summary>
public static string strDeletepath = "";
/// <summary>
/// 能耗保存路径
/// </summary>
public static string strWattrMeterpath = System.Windows.Forms.Application.StartupPath + "\\智能电表数据";
/// 风速仪保存路径
/// </summary>
///
public static string strAnemographpath = System.Windows.Forms.Application.StartupPath + "\\风速仪数据";
/// <summary>
/// MES路径日志
/// </summary>
public static string strMesLogspath = System.Windows.Forms.Application.StartupPath + "\\Logs\\MesLogs";
/// <summary>
/// PLC读取寄存器配置文件路径
/// </summary>
public static string ConfigPath = Path.Combine(System.Windows.Forms.Application.StartupPath, "ini\\PlcConfig.ini");
/// <summary>
/// 系统程序配置文件路径
/// </summary>
public static string iniFilePath = Path.Combine(System.Windows.Forms.Application.StartupPath, "ini\\Configure.ini");
#region 读取配置文件
/// <summary>
///读取配置文件
/// </summary>
public static void GetSysConfig()
{
try
{
sysConfig.AutoStart = Convert.ToBoolean(IniConfigHelper.ReadIniData("配置信息", "开机自动启动", "false"));
sysConfig.AutoLogin = Convert.ToBoolean(IniConfigHelper.ReadIniData("配置信息", "启动自动登录", "false"));
sysConfig.AutoLock = Convert.ToBoolean(IniConfigHelper.ReadIniData("配置信息", "无操作自动锁屏", "false"));
sysConfig.LockPeriod = Convert.ToInt32(IniConfigHelper.ReadIniData("配置信息", "锁屏间隔时间", "false"));
sysConfig.AutoQieHuanM = Convert.ToBoolean(IniConfigHelper.ReadIniData("配置信息", "无操作自动切换监控界面", "false"));
sysConfig.QieHuanMPeriod = Convert.ToInt32(IniConfigHelper.ReadIniData("配置信息", "切换监控界面间隔时间", "false"));
sysConfig.ShowSeriesCount = Convert.ToInt32(IniConfigHelper.ReadIniData("配置信息", "曲线显示数量", "false"));
sysConfig.SwipeCardMode = Convert.ToBoolean(IniConfigHelper.ReadIniData("配置信息", "开启刷卡模式", "false"));
sysConfig.MesModeSwitching = Convert.ToBoolean(IniConfigHelper.ReadIniData("配置信息", "MES/非MES模式切换", "false"));
sysConfig.GetMesParam = Convert.ToBoolean(IniConfigHelper.ReadIniData("配置信息", "获取MES参数", "false"));
sysConfig.OKSwitching = Convert.ToBoolean(IniConfigHelper.ReadIniData("配置信息", "强制OK/正常NG模式切换", "false"));
sysConfig.SaveThreadTime = Convert.ToBoolean(IniConfigHelper.ReadIniData("配置信息", "线程耗时日志保存", "false"));
sysConfig.SaveThreadTime = Convert.ToBoolean(IniConfigHelper.ReadIniData("配置信息", "线程耗时日志保存", "false"));
mesConfig.Grading1 = IniConfigHelper.ReadIniData("MES配置", "Grading1", "false");
mesConfig.Grading2 = IniConfigHelper.ReadIniData("MES配置", "Grading2", "false");
mesConfig.Grading3 = IniConfigHelper.ReadIniData("MES配置", "Grading3", "false");
mesConfig.Grading4 = IniConfigHelper.ReadIniData("MES配置", "Grading4", "false");
mesConfig.Grading5 = IniConfigHelper.ReadIniData("MES配置", "Grading5", "false");
mesConfig.Grading6 = IniConfigHelper.ReadIniData("MES配置", "Grading6", "false");
}
catch (Exception)
{
sysConfig = null;
}
}
#endregion
#region 保存配置文件
/// <summary>
/// 保存启动自动登录
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveAutoStart(bool value)
{
return IniConfigHelper.WriteIniData("配置信息", "开机自动启动", value.ToString());
}
/// <summary>
/// 保存开机自动启动
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveAutoLogin(bool value)
{
return IniConfigHelper.WriteIniData("配置信息", "启动自动登录", value.ToString());
}
/// <summary>
/// 保存无操作自动锁屏
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveAutoLock(bool value)
{
return IniConfigHelper.WriteIniData("配置信息", "无操作自动锁屏", value.ToString());
}
/// <summary>
/// 保存锁屏间隔时间
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveLockPeriod(int value)
{
return IniConfigHelper.WriteIniData("配置信息", "锁屏间隔时间", value.ToString());
}
/// <summary>
/// 保存无操作自动切换监控界面
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveAutoQieHuanM(bool value)
{
return IniConfigHelper.WriteIniData("配置信息", "无操作自动切换监控界面", value.ToString());
}
/// <summary>
/// 保存切换监控界面间隔时间
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveQieHuanMPeriod(int value)
{
return IniConfigHelper.WriteIniData("配置信息", "切换监控界面间隔时间", value.ToString());
}
/// <summary>
/// 保存曲线显示数量
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveShowSeriesCount(int value)
{
return IniConfigHelper.WriteIniData("配置信息", "曲线显示数量", value.ToString());
}
/// <summary>
/// 开启刷卡模式
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveSwipeCardMode(bool value)
{
return IniConfigHelper.WriteIniData("配置信息", "开启刷卡模式", value.ToString());
}
/// <summary>
/// MES/非MES模式
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveOpenMesModel(bool value)
{
return IniConfigHelper.WriteIniData("配置信息", "MES/非MES模式切换", value.ToString());
}
/// <summary>
/// 强制OK/正常NG模式切换
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveOpenOKModel(bool value)
{
return IniConfigHelper.WriteIniData("配置信息", "强制OK/正常NG模式切换", value.ToString());
}
/// <summary>
/// 获取MES参数
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveGetMesParam(bool value)
{
return IniConfigHelper.WriteIniData("配置信息", "获取MES参数", value.ToString());
}
/// <summary>
/// 保存线程耗时操作
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static bool SaveSaveThreadTime(bool value)
{
return IniConfigHelper.WriteIniData("配置信息", "线程耗时日志保存", value.ToString());
}
#endregion
#endregion
#region 委托信息
//创建委托
// 数据监视委托
public static Action<int, string> AddDataMonitorDelegate;
/// <summary>
/// 系统日志
/// </summary>
public static Action<bool, string> AddLogDelegate;
/// <summary>
/// 操作日志
/// </summary>
public static Action<bool, string> AddOPLogDelegate;
/// <summary>
/// 报警日志
/// </summary>
public static Action<SysLog> AddAlarmDelegate;
/// <summary>
/// 显示报警信息
/// </summary>
public static Action<string> ShowAlarmDelegate;
/// <summary>
/// 参数更新
/// </summary>
public static Action ChangeParamDelegate;
/// <summary>
/// 显示上料信息
/// </summary>
public static Action<List<AGearEntity>> ShowFeedingDelegate;
/// <summary>
/// 显示下料数据
/// </summary>
public static Action<List<BGearEntity>> ShowBlankingDelegate;
/// <summary>
/// 数据监视委托
/// </summary>
/// <param name="type"></param>
/// <param name="info"></param>
public static void AddDataMonitorLog(int type, string info)
{
//调用委托
if (AddDataMonitorDelegate != null)
{
AddDataMonitorDelegate(type, info);
}
}
/// <summary>
/// 写入系统日志
/// </summary>
/// <param name="isError">是否为错误信息</param>
/// <param name="info">日志信息</param>
public static void AddLog(bool isError, string info)
{
//调用委托
if (AddLogDelegate != null)
{
AddLogDelegate(isError, info);
}
}
/// <summary>
/// 写入操作日志
/// </summary>
/// <param name="isError"></param>
/// <param name="info"></param>
public static void AddOPLog(bool isError, string info)
{
//调用委托
if (AddLogDelegate != null)
{
AddOPLogDelegate(isError, info);
}
}
public static void AddAlarmLog(SysLog sysLog)
{
//调用委托
if (AddAlarmDelegate != null)
{
AddAlarmDelegate(sysLog);
}
}
/// <summary>
/// 显示报警日志
/// </summary>
/// <param name="info"></param>
public static void ShowAlarmLog(string info)
{
//调用委托
if (ShowAlarmDelegate != null)
{
ShowAlarmDelegate(info);
}
}
public static void ChangeParamData()
{
//调用委托
if (ChangeParamDelegate != null)
{
ChangeParamDelegate();
}
}
#endregion
}
}
+8 -8
View File
@@ -236,12 +236,12 @@ namespace JinYuan.VirtualDataLibrary
public string GetStaticByDay(string startDateTime, string endDateTime) public string GetStaticByDay(string startDateTime, string endDateTime)
{ {
string strSql = $@" SELECT CONVERT(varchar(13),TestTime,120) 时间, ProdIn 总数, ProdOut OK总数,Ppm PPM均值, string strSql = $@" SELECT CONVERT(varchar(13),TestTime,120) 时间, ProdIn 总数, ProdOut OK总数,Ppm PPM均值,
cast(ROUND(JiaDL*100,1)as nvarchar(10))+'%' 稼动率均值, cast(ROUND(JiaDL*100,1)as nvarchar(20))+'%' 稼动率均值,
cast(case when ProdIn>0 then (ROUND(cast(isnull(ProdOut,0) as float)/cast(isnull(ProdIn,0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率 cast(case when ProdIn>0 then (ROUND(cast(isnull(ProdOut,0) as float)/cast(isnull(ProdIn,0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率
FROM Hourprod WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}' GROUP BY TestTime,ProdOut,ProdIn,Ppm,JiaDL FROM Hourprod WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}' GROUP BY TestTime,ProdOut,ProdIn,Ppm,JiaDL
UNION ALL UNION ALL
SELECT '合计' as '时间', ProdIn '总数', ProdOut 'OK总数',Ppm 'PPM均值' ,JiaDL '稼动率均值',优率 as '优率' FROM (SELECT FDate,sum(ProdIn) ProdIn, SUM(ProdOut) ProdOut,AVG(PPM) Ppm, SELECT '合计' as '时间', ProdIn '总数', ProdOut 'OK总数',Ppm 'PPM均值' ,JiaDL '稼动率均值',优率 as '优率' FROM (SELECT FDate,sum(ProdIn) ProdIn, SUM(ProdOut) ProdOut,AVG(PPM) Ppm,
cast(ROUND(AVG(JiaDL)*100,1) as nvarchar(10))+'%' JiaDL, cast(ROUND(AVG(JiaDL)*100,1) as nvarchar(20))+'%' JiaDL,
cast(case when (sum(ProdIn))>0 then (ROUND(cast(isnull(sum(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率 FROM Hourprod cast(case when (sum(ProdIn))>0 then (ROUND(cast(isnull(sum(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率 FROM Hourprod
WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}' GROUP BY FDate) as t "; WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}' GROUP BY FDate) as t ";
@@ -257,12 +257,12 @@ namespace JinYuan.VirtualDataLibrary
public string GetStaticByWeek(string startDateTime, string endDateTime) public string GetStaticByWeek(string startDateTime, string endDateTime)
{ {
string strSql = $@" SELECT convert(char(10), TestTime, 120) 月份, sum(ProdIn) 总数, sum(ProdOut) OK总数,AVG(Ppm) PPM均值, string strSql = $@" SELECT convert(char(10), TestTime, 120) 月份, sum(ProdIn) 总数, sum(ProdOut) OK总数,AVG(Ppm) PPM均值,
cast(ROUND(JiaDL*100,1)as nvarchar(10))+'%' 稼动率均值, cast(ROUND(JiaDL*100,1)as nvarchar(20))+'%' 稼动率均值,
cast(case when sum(ProdIn)>0 then (ROUND(cast(isnull(SUM(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率 cast(case when sum(ProdIn)>0 then (ROUND(cast(isnull(SUM(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率
FROM Hourprod WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}' GROUP BY convert(char(10), TestTime, 120),JiaDL FROM Hourprod WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}' GROUP BY convert(char(10), TestTime, 120),JiaDL
UNION ALL UNION ALL
SELECT '合计' as '月份', ProdIn '总数', ProdOut 'OK总数',Ppm 'PPM均值' ,JiaDL '稼动率均值',优率 as '优率' FROM (SELECT sum(ProdIn) ProdIn, SUM(ProdOut) ProdOut,AVG(Ppm) Ppm, SELECT '合计' as '月份', ProdIn '总数', ProdOut 'OK总数',Ppm 'PPM均值' ,JiaDL '稼动率均值',优率 as '优率' FROM (SELECT sum(ProdIn) ProdIn, SUM(ProdOut) ProdOut,AVG(Ppm) Ppm,
cast(ROUND(AVG(JiaDL)*100,1) as nvarchar(10))+'%' JiaDL, cast(ROUND(AVG(JiaDL)*100,1) as nvarchar(20))+'%' JiaDL,
cast(case when (sum(ProdIn))>0 then (ROUND(cast(isnull(sum(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10))+'%' 优率 FROM Hourprod cast(case when (sum(ProdIn))>0 then (ROUND(cast(isnull(sum(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10))+'%' 优率 FROM Hourprod
WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}') as t "; WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}') as t ";
return strSql; return strSql;
@@ -278,12 +278,12 @@ namespace JinYuan.VirtualDataLibrary
public string GetStaticByMonth(string startDateTime, string endDateTime) public string GetStaticByMonth(string startDateTime, string endDateTime)
{ {
string strSql = $@" SELECT convert(char(7), TestTime, 120) 月份, sum(ProdIn) 总数, sum(ProdOut) OK总数,AVG(Ppm) PPM均值, string strSql = $@" SELECT convert(char(7), TestTime, 120) 月份, sum(ProdIn) 总数, sum(ProdOut) OK总数,AVG(Ppm) PPM均值,
cast(ROUND(JiaDL*100,1)as nvarchar(10))+'%' 稼动率均值, cast(ROUND(JiaDL*100,1)as nvarchar(20))+'%' 稼动率均值,
cast(case when sum(ProdIn)>0 then (ROUND(cast(isnull(SUM(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率 cast(case when sum(ProdIn)>0 then (ROUND(cast(isnull(SUM(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率
FROM Hourprod WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}' GROUP BY convert(char(7), TestTime, 120),JiaDL FROM Hourprod WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}' GROUP BY convert(char(7), TestTime, 120),JiaDL
UNION ALL UNION ALL
SELECT '合计' as '月份', ProdIn '总数', ProdOut 'OK总数',Ppm 'PPM均值' ,JiaDL '稼动率均值',优率 as '优率' FROM (SELECT sum(ProdIn) ProdIn, SUM(ProdOut) ProdOut,AVG(Ppm) Ppm, SELECT '合计' as '月份', ProdIn '总数', ProdOut 'OK总数',Ppm 'PPM均值' ,JiaDL '稼动率均值',优率 as '优率' FROM (SELECT sum(ProdIn) ProdIn, SUM(ProdOut) ProdOut,AVG(Ppm) Ppm,
cast(ROUND(AVG(JiaDL)*100,1) as nvarchar(10))+'%' JiaDL, cast(ROUND(AVG(JiaDL)*100,1) as nvarchar(20))+'%' JiaDL,
cast(case when (sum(ProdIn))>0 then (ROUND(cast(isnull(sum(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10))+'%' 优率 FROM Hourprod cast(case when (sum(ProdIn))>0 then (ROUND(cast(isnull(sum(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10))+'%' 优率 FROM Hourprod
WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}') as t "; WHERE TestTime BETWEEN '{startDateTime}' AND '{endDateTime}') as t ";
return strSql; return strSql;
@@ -315,12 +315,12 @@ namespace JinYuan.VirtualDataLibrary
} }
string strsql = $@" SELECT CONVERT(varchar(13),TestTime,120) 时间, ProdIn 总数, ProdOut OK总数,Ppm PPM均值, string strsql = $@" SELECT CONVERT(varchar(13),TestTime,120) 时间, ProdIn 总数, ProdOut OK总数,Ppm PPM均值,
cast(ROUND(JiaDL*100,1)as nvarchar(10))+'%' 稼动率均值, cast(ROUND(JiaDL*100,1)as nvarchar(20))+'%' 稼动率均值,
cast(case when ProdIn>0 then (ROUND(cast(isnull(ProdOut,0) as float)/cast(isnull(ProdIn,0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率 cast(case when ProdIn>0 then (ROUND(cast(isnull(ProdOut,0) as float)/cast(isnull(ProdIn,0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率
FROM Hourprod WHERE TestTime BETWEEN '{sDateTime1}' AND '{sDateTime2}' GROUP BY TestTime,ProdOut,ProdIn,Ppm,JiaDL FROM Hourprod WHERE TestTime BETWEEN '{sDateTime1}' AND '{sDateTime2}' GROUP BY TestTime,ProdOut,ProdIn,Ppm,JiaDL
UNION ALL UNION ALL
SELECT '合计' as '时间', ProdIn '总数', ProdOut 'OK总数',Ppm 'PPM均值' ,JiaDL '稼动率均值',优率 as '优率' FROM (SELECT FDate,sum(ProdIn) ProdIn, SUM(ProdOut) ProdOut,AVG(Ppm) Ppm, SELECT '合计' as '时间', ProdIn '总数', ProdOut 'OK总数',Ppm 'PPM均值' ,JiaDL '稼动率均值',优率 as '优率' FROM (SELECT FDate,sum(ProdIn) ProdIn, SUM(ProdOut) ProdOut,AVG(Ppm) Ppm,
cast(ROUND(AVG(JiaDL)*100,1) as nvarchar(10))+'%' JiaDL, cast(ROUND(AVG(JiaDL)*100,1) as nvarchar(20))+'%' JiaDL,
cast(case when (sum(ProdIn))>0 then (ROUND(cast(isnull(sum(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率 FROM Hourprod cast(case when (sum(ProdIn))>0 then (ROUND(cast(isnull(sum(ProdOut),0) as float)/cast(isnull(sum(ProdIn),0) as float)*100,2)) else 0 end as nvarchar(10) )+'%' 优率 FROM Hourprod
WHERE TestTime BETWEEN '{sDateTime1}' AND '{sDateTime2}' GROUP BY FDate) as t "; WHERE TestTime BETWEEN '{sDateTime1}' AND '{sDateTime2}' GROUP BY FDate) as t ";
return strsql; return strsql;
@@ -40,6 +40,9 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\LargeSquareOne\Lib\JinYuan.CommunicationLib.dll</HintPath> <HintPath>..\LargeSquareOne\Lib\JinYuan.CommunicationLib.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PLCCommunication, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="PLCCommunication, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\HBG_NegativeElectrodeWeld\Lib\PLCCommunication.dll</HintPath> <HintPath>..\HBG_NegativeElectrodeWeld\Lib\PLCCommunication.dll</HintPath>
@@ -104,6 +107,7 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" />
<None Include="Resources\感叹号提示-块红色.png" /> <None Include="Resources\感叹号提示-块红色.png" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+17 -7
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic; using JinYuan.Models.SysCfg;
using System.Collections.Generic;
namespace JinYuan.VirtualDataLibrary namespace JinYuan.VirtualDataLibrary
{ {
@@ -117,27 +118,32 @@ namespace JinYuan.VirtualDataLibrary
/// <summary> /// <summary>
/// OK1分档 /// OK1分档
/// </summary> /// </summary>
public string Grading1 = "K77"; public string Grading1 = "E63y";
/// <summary> /// <summary>
/// OK2分档 /// OK2分档
/// </summary> /// </summary>
public string Grading2 = "K77"; public string Grading2 = "F63y";
/// <summary> /// <summary>
/// OK3分档 /// OK3分档
/// </summary> /// </summary>
public string Grading3 = "K77"; public string Grading3 = "NG";
/// <summary> /// <summary>
/// OK4分档 /// OK4分档
/// </summary> /// </summary>
public string Grading4 = "K77"; public string Grading4 = "E63yG";
/// <summary> /// <summary>
/// OK5分档 /// OK5分档
/// </summary> /// </summary>
public string Grading5 = "K77"; public string Grading5 = "F63yG";
/// <summary> /// <summary>
/// OK6分档 /// OK6分档
/// </summary> /// </summary>
public string Grading6 = "K77"; public string Grading6 = "拦截";
/// <summary>
/// 通道档位设置
/// </summary>
public Models.ChannelConfig ChannelConfig = new Models.ChannelConfig();
/// <summary> /// <summary>
/// 设备状态 /// 设备状态
@@ -216,6 +222,10 @@ namespace JinYuan.VirtualDataLibrary
/// 分档 /// 分档
/// </summary> /// </summary>
public string GradingMesUrl = "http://10.54.50.1:8082/core/api/public/eve/pm/eqm/new/grading"; public string GradingMesUrl = "http://10.54.50.1:8082/core/api/public/eve/pm/eqm/new/grading";
/// <summary>
/// 安全设备运行状态
/// </summary>
public string SafeEqptStatusMesUrl = "http://10.22.161.62:804/device-status";
} }
} }
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
</packages>
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -5,8 +5,8 @@
</startup> </startup>
<connectionStrings> <connectionStrings>
<add name="connDbType" connectionString="SqlServer" /> <add name="connDbType" connectionString="SqlServer" />
<add name="connString" connectionString="Server=192.168.133.180,43852\MSSQLSERVER01;DataBase=LargeSquareOne;Uid=sa;Pwd=123" /> <add name="connString" connectionString="Server=localhost;DataBase=LargeSquareOne;Uid=sa;Pwd=123456" />
<add name="connString2" connectionString="Server=192.168.133.180,43852\MSSQLSERVER01;DataBase=LargeSquareOne;Uid=sa;Pwd=123" /> <add name="connString2" connectionString="Server=192.168.1.149;DataBase=LargeSquareOne;Uid=sa;Pwd=123456" />
<!--<add name="connString" connectionString="Server=ZCDEEPSEAI;DataBase=LargeSquareOne;Uid=sa;Pwd=123" />--> <!--<add name="connString" connectionString="Server=ZCDEEPSEAI;DataBase=LargeSquareOne;Uid=sa;Pwd=123" />-->
<!--<add name="connString2" connectionString="Server=192.168.133.180;DataBase=HBG_CupDataTurnover;Uid=jyzdh;Pwd=eve123456" />--> <!--<add name="connString2" connectionString="Server=192.168.133.180;DataBase=HBG_CupDataTurnover;Uid=jyzdh;Pwd=eve123456" />-->
<add name="connString3" connectionString="Server=localhost;DataBase=ProConfigDB;User Id=jypz;Password=eve123456;Persist Security Info=true;Allow Zero Datetime=true;Character Set=utf8;" /> <add name="connString3" connectionString="Server=localhost;DataBase=ProConfigDB;User Id=jypz;Password=eve123456;Persist Security Info=true;Allow Zero Datetime=true;Character Set=utf8;" />
+34
View File
@@ -0,0 +1,34 @@
{
"channels": [
{
"channelId": 1,
"defaultValue": 21,
"gears": [ "E63y", "F63y" ]
},
{
"channelId": 2,
"defaultValue": 31,
"gears": [ "E63yG", "F63yG" ]
},
{
"channelId": 3,
"defaultValue": 98,
"gears": [ "NG" ]
},
{
"channelId": 4,
"defaultValue": 97,
"gears": [ "拦截" ]
},
{
"channelId": 5,
"defaultValue": 97,
"gears": [ "拦截" ]
},
{
"channelId": 6,
"defaultValue": 97,
"gears": [ "拦截" ]
}
]
}
+24 -17
View File
@@ -1,10 +1,10 @@
[配置信息] [配置信息]
开机自动启动=False 开机自动启动=True
启动自动登录=False 启动自动登录=True
无操作自动锁屏=False 无操作自动锁屏=False
锁屏间隔时间=3 锁屏间隔时间=3
无操作自动切换监控界面=True 无操作自动切换监控界面=True
切换监控界面间隔时间=1 切换监控界面间隔时间=3
曲线显示数量=1 曲线显示数量=1
开启刷卡模式=False 开启刷卡模式=False
MES/非MES模式切换=True MES/非MES模式切换=True
@@ -13,30 +13,37 @@ MES/
是否获取服务器数据=1 是否获取服务器数据=1
是否存储C模块数据=1 是否存储C模块数据=1
外观检测条码计数=1 外观检测条码计数=1
强制OK/正常NG模式切换=False 强制OK/正常NG模式切换=True
[MES配置] [MES配置]
工厂代码=60J 工厂代码=60J
产线编号=MW-602 产线编号=MW-602
设备编号=602VIM01 设备编号=602GRM01
智能电表编号=1,2 智能电表编号=1,2
白夜班交替时间=20:30:00 白夜班交替时间=20:30:00
MES日志保存路径=D:\APILog MES日志保存路径=D:\APILog
存储服务器IP地址=192.168.2.108 存储服务器IP地址=192.168.2.108
员工权限校验=http://10.22.160.141/core/api/public/equipment/base/user/login/verify Grading1=E63y
设备参数设定值请求=http://10.22.160.141/core/api/public/param/setting/request Grading2=F63y
设备参数设定值变更=http://10.22.160.141/core/api/public/param/setting/change Grading3=NG
产品进站=http://10.22.160.141/core/api/public/formation/section/arrival/bz Grading4=E63yG
产品过程加工参数=http://10.22.160.141/core/api/public/product/process/param/new/process Grading5=F63yG
产品结果加工参数=http://10.22.160.141/core/api/public/product/process/param/new/result Grading6=拦截
产品出站=http://10.22.160.141/core/api/public/eve/pm/formation-section 员工权限校验=http://10.22.160.1/core/api/public/equipment/base/user/login/verify
设备报警=http://10.22.160.141/core/api/public/equipment/alarm/currency 设备参数设定值请求=http://10.22.160.2/core/api/public/param/setting/request
设备状态=http://10.22.160.141/core/api/public/eve/pm/eqm/run/status/operation 设备参数设定值变更=http://10.22.160.2/core/api/public/param/setting/change
能耗=http://10.22.160.141/core/api/public/eve/pm/energy/consumption/collection/submit 产品进站=http://10.22.160.2/core/api/public/formation/section/arrival/bz
产品过程加工参数=http://10.22.160.3/core/api/public/product/process/param/new/process
产品结果加工参数=http://10.22.160.3/core/api/public/product/process/param/new/result
产品出站=http://10.22.160.2/core/api/public/eve/pm/formation-section/bz
设备报警=http://10.22.160.2/core/api/public/equipment/alarm/currency
设备状态=http://10.22.160.2/core/api/public/eve/pm/eqm/run/status/operation
能耗=http://10.22.160.3/core/api/public/eve/pm/energy/consumption/collection/submit
风速仪=https://iot.eveportal.com:9470/eve_api/ems/iot/upload_device_collect_data 风速仪=https://iot.eveportal.com:9470/eve_api/ems/iot/upload_device_collect_data
风速仪=https://iot.eveportal.com:9470/eve_api/ems/iot/upload_device_collect_data 风速仪=https://iot.eveportal.com:9470/eve_api/ems/iot/upload_device_collect_data
分档参数=http://10.22.160.141/core/api/public/eve/pm/eqm/new/grading 分档参数=http://10.22.160.2/core/api/public/eve/pm/eqm/auto/grading
guid=a270c7d2-9cbd-4739-9a0b-0709b5813332 安全设备状态=http://10.22.161.62:804/device-status
guid=8bd808da-0398-4a7d-ac92-bcea41869c03
DeviceState=1 DeviceState=1
run_AlarmMark=0 run_AlarmMark=0
run_IdleMark=0 run_IdleMark=0
+1 -1
View File
@@ -1,4 +1,4 @@
[设备参数] [设备参数]
IP華硊=127.0.0.1 IP華硊=192.168.1.52
端口号=9600 端口号=9600
PLC类型=OmronFinsTcp_HSL PLC类型=OmronFinsTcp_HSL
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+311
View File
@@ -0,0 +1,311 @@
namespace LargeSquareOne
{
partial class FrmChannelCfg
{
/// <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.panel1 = new JinYuan.ControlLib.PanelExt();
this.label7 = new System.Windows.Forms.Label();
this.btnRemoveGear = new System.Windows.Forms.Button();
this.listBoxGears = new System.Windows.Forms.ListBox();
this.numChannelId = new System.Windows.Forms.NumericUpDown();
this.listBoxChannels = new System.Windows.Forms.ListBox();
this.numDefaultValue = new System.Windows.Forms.NumericUpDown();
this.button4 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.txtNewGear = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numChannelId)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numDefaultValue)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.BordeColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(79)))), ((int)(((byte)(150)))));
this.panel1.BordeWidth = 2;
this.panel1.BottomGap = 0;
this.panel1.Controls.Add(this.label7);
this.panel1.Controls.Add(this.btnRemoveGear);
this.panel1.Controls.Add(this.listBoxGears);
this.panel1.Controls.Add(this.numChannelId);
this.panel1.Controls.Add(this.listBoxChannels);
this.panel1.Controls.Add(this.numDefaultValue);
this.panel1.Controls.Add(this.button4);
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.txtNewGear);
this.panel1.Controls.Add(this.label6);
this.panel1.Controls.Add(this.label5);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.LeftGap = 0;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.panel1.Name = "panel1";
this.panel1.RightGap = 0;
this.panel1.Size = new System.Drawing.Size(1204, 752);
this.panel1.TabIndex = 0;
this.panel1.TopGap = 0;
//
// label7
//
this.label7.AutoSize = true;
this.label7.ForeColor = System.Drawing.Color.DarkGray;
this.label7.Location = new System.Drawing.Point(882, 133);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(62, 21);
this.label7.TabIndex = 20;
this.label7.Text = "98: NG";
//
// btnRemoveGear
//
this.btnRemoveGear.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(27)))), ((int)(((byte)(78)))));
this.btnRemoveGear.Font = new System.Drawing.Font("微软雅黑", 11.5F);
this.btnRemoveGear.ForeColor = System.Drawing.Color.White;
this.btnRemoveGear.Location = new System.Drawing.Point(1004, 213);
this.btnRemoveGear.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.btnRemoveGear.Name = "btnRemoveGear";
this.btnRemoveGear.Size = new System.Drawing.Size(133, 58);
this.btnRemoveGear.TabIndex = 19;
this.btnRemoveGear.Text = "删除选中项";
this.btnRemoveGear.UseVisualStyleBackColor = false;
this.btnRemoveGear.Click += new System.EventHandler(this.btnRemoveGear_Click);
//
// listBoxGears
//
this.listBoxGears.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38)))));
this.listBoxGears.ForeColor = System.Drawing.Color.White;
this.listBoxGears.FormattingEnabled = true;
this.listBoxGears.ItemHeight = 21;
this.listBoxGears.Location = new System.Drawing.Point(674, 213);
this.listBoxGears.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.listBoxGears.Name = "listBoxGears";
this.listBoxGears.Size = new System.Drawing.Size(289, 235);
this.listBoxGears.TabIndex = 18;
this.listBoxGears.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.listBoxGears_MouseDoubleClick);
//
// numChannelId
//
this.numChannelId.Enabled = false;
this.numChannelId.Location = new System.Drawing.Point(674, 60);
this.numChannelId.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.numChannelId.Name = "numChannelId";
this.numChannelId.Size = new System.Drawing.Size(180, 29);
this.numChannelId.TabIndex = 17;
//
// listBoxChannels
//
this.listBoxChannels.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38)))));
this.listBoxChannels.ForeColor = System.Drawing.Color.White;
this.listBoxChannels.FormattingEnabled = true;
this.listBoxChannels.ItemHeight = 21;
this.listBoxChannels.Location = new System.Drawing.Point(69, 62);
this.listBoxChannels.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.listBoxChannels.Name = "listBoxChannels";
this.listBoxChannels.Size = new System.Drawing.Size(367, 508);
this.listBoxChannels.TabIndex = 16;
this.listBoxChannels.SelectedIndexChanged += new System.EventHandler(this.listBoxChannels_SelectedIndexChanged);
//
// numDefaultValue
//
this.numDefaultValue.Location = new System.Drawing.Point(674, 126);
this.numDefaultValue.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.numDefaultValue.Name = "numDefaultValue";
this.numDefaultValue.Size = new System.Drawing.Size(180, 29);
this.numDefaultValue.TabIndex = 15;
this.numDefaultValue.ValueChanged += new System.EventHandler(this.numDefaultValue_ValueChanged);
this.numDefaultValue.Validating += new System.ComponentModel.CancelEventHandler(this.numDefaultValue_Validating);
//
// button4
//
this.button4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(27)))), ((int)(((byte)(78)))));
this.button4.ForeColor = System.Drawing.Color.White;
this.button4.Location = new System.Drawing.Point(674, 662);
this.button4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(112, 41);
this.button4.TabIndex = 14;
this.button4.Text = "退出";
this.button4.UseVisualStyleBackColor = false;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// button2
//
this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(27)))), ((int)(((byte)(78)))));
this.button2.Font = new System.Drawing.Font("微软雅黑", 11.5F);
this.button2.ForeColor = System.Drawing.Color.White;
this.button2.Location = new System.Drawing.Point(324, 662);
this.button2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(112, 41);
this.button2.TabIndex = 12;
this.button2.Text = "保存";
this.button2.UseVisualStyleBackColor = false;
this.button2.Click += new System.EventHandler(this.btnSave_Click);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(27)))), ((int)(((byte)(78)))));
this.button1.Font = new System.Drawing.Font("微软雅黑", 11.5F);
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Location = new System.Drawing.Point(851, 579);
this.button1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(112, 41);
this.button1.TabIndex = 11;
this.button1.Text = "添加";
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.btnAddGear_Click);
//
// txtNewGear
//
this.txtNewGear.Location = new System.Drawing.Point(674, 579);
this.txtNewGear.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txtNewGear.Name = "txtNewGear";
this.txtNewGear.Size = new System.Drawing.Size(148, 29);
this.txtNewGear.TabIndex = 10;
//
// label6
//
this.label6.AutoSize = true;
this.label6.ForeColor = System.Drawing.Color.White;
this.label6.Location = new System.Drawing.Point(552, 579);
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(74, 21);
this.label6.TabIndex = 9;
this.label6.Text = "新增档位";
//
// label5
//
this.label5.AutoSize = true;
this.label5.ForeColor = System.Drawing.Color.White;
this.label5.Location = new System.Drawing.Point(543, 198);
this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(74, 21);
this.label5.TabIndex = 7;
this.label5.Text = "档位列表";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("微软雅黑", 12F);
this.label4.ForeColor = System.Drawing.Color.White;
this.label4.Location = new System.Drawing.Point(528, 126);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(87, 21);
this.label4.TabIndex = 5;
this.label4.Text = "PLC档位值";
//
// label3
//
this.label3.AutoSize = true;
this.label3.ForeColor = System.Drawing.Color.White;
this.label3.Location = new System.Drawing.Point(563, 62);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(58, 21);
this.label3.TabIndex = 3;
this.label3.Text = "通道号";
//
// label2
//
this.label2.AutoSize = true;
this.label2.ForeColor = System.Drawing.Color.White;
this.label2.Location = new System.Drawing.Point(669, 19);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(74, 21);
this.label2.TabIndex = 2;
this.label2.Text = "通道详情";
//
// label1
//
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(64, 19);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(74, 21);
this.label1.TabIndex = 1;
this.label1.Text = "通道列表";
//
// FrmChannelCfg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38)))));
this.ClientSize = new System.Drawing.Size(1204, 752);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("微软雅黑", 12F);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "FrmChannelCfg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FrmChannelCfg";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numChannelId)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numDefaultValue)).EndInit();
this.ResumeLayout(false);
}
#endregion
private JinYuan.ControlLib.PanelExt panel1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox txtNewGear;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.NumericUpDown numDefaultValue;
private System.Windows.Forms.ListBox listBoxChannels;
private System.Windows.Forms.NumericUpDown numChannelId;
private System.Windows.Forms.ListBox listBoxGears;
private System.Windows.Forms.Button btnRemoveGear;
private System.Windows.Forms.Label label7;
}
}
+136
View File
@@ -0,0 +1,136 @@
using JinYuan.Models;
using JinYuan.VirtualDataLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LargeSquareOne
{
public partial class FrmChannelCfg : Form
{
private ChannelConfig _config;
private Channel _currentChannel;
public FrmChannelCfg()
{
InitializeComponent();
LoadData();
}
private void LoadData()
{
_config = CommonMethods.LoadFromJson(CommonMethods.ChannelPath);
listBoxChannels.DataSource = _config.Channels;
listBoxChannels.DisplayMember = "AllContent";
}
// 选中通道时更新右侧详情
private void listBoxChannels_SelectedIndexChanged(object sender, EventArgs e)
{
_currentChannel = (Channel)listBoxChannels.SelectedItem;
if (_currentChannel != null)
{
numChannelId.Value = _currentChannel.ChannelId;
numDefaultValue.Value = _currentChannel.DefaultValue;
UpdateGearsList();
}
}
private void UpdateGearsList()
{
listBoxGears.DataSource = null;
listBoxGears.DataSource = _currentChannel.Gears;
}
private void UpdateChannelList()
{
listBoxChannels.DataSource = null;
listBoxChannels.DataSource = _config.Channels;
listBoxChannels.DisplayMember = "AllContent";
}
// 添加档位
private void btnAddGear_Click(object sender, EventArgs e)
{
var gearName = txtNewGear.Text.Trim();
if (!string.IsNullOrEmpty(gearName))
{
_currentChannel.Gears.Add(gearName);
txtNewGear.Text = "";
UpdateGearsList();
}
}
// 删除档位
private void btnRemoveGear_Click(object sender, EventArgs e)
{
if (listBoxGears.SelectedItem != null)
{
var gear = listBoxGears.SelectedItem.ToString();
_currentChannel.Gears.Remove(gear);
UpdateGearsList();
}
}
// 保存
private void btnSave_Click(object sender, EventArgs e)
{
var errList = _config.Channels.Where(x => x.AllContent.Contains("NG") && x.DefaultValue != 98).ToList();
if (errList.Count > 0)
{
var errArr = errList.Select(it => it.DefaultValue).ToArray();
MessageBox.Show($"NG写给PLC的值必须为98,不能为{string.Join(",", errArr)}");
return;
}
CommonMethods.SaveToJson(CommonMethods.ChannelPath, _config);
MessageBox.Show("保存成功!");
}
private void button4_Click(object sender, EventArgs e)
{
this.Close();
}
private void listBoxGears_MouseDoubleClick(object sender, MouseEventArgs e)
{
int index = listBoxGears.IndexFromPoint(e.Location);
if (index != ListBox.NoMatches)
{
string oldValue = listBoxGears.Items[index].ToString();
FrmInput frm = new FrmInput(oldValue);
frm.ShowDialog();
string newValue = frm.CurGear;
if (!string.IsNullOrEmpty(newValue))
{
var gearIndex = _currentChannel.Gears.IndexOf(oldValue);
_currentChannel.Gears[gearIndex] = newValue; // 直接修改 Items
UpdateChannelList();
}
}
}
private void numDefaultValue_ValueChanged(object sender, EventArgs e)
{
_currentChannel.DefaultValue = (int)numDefaultValue.Value;
UpdateChannelList();
}
private void numDefaultValue_Validating(object sender, CancelEventArgs e)
{
//if ((int)numDefaultValue.Value == 98)
//{
// MessageBox.Show("98: 扫码NG(不允许在界面配置)");
// e.Cancel = true;
// return;
//}
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?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>
</root>
+23 -23
View File
@@ -63,7 +63,6 @@
this.rtb_Info = new System.Windows.Forms.RichTextBox(); this.rtb_Info = new System.Windows.Forms.RichTextBox();
this.groupBoxEX5 = new JinYuan.ControlLib.GroupBoxEX(); this.groupBoxEX5 = new JinYuan.ControlLib.GroupBoxEX();
this.dgvBlankingData = new System.Windows.Forms.DataGridView(); this.dgvBlankingData = new System.Windows.Forms.DataGridView();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -77,6 +76,7 @@
this.Column35 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column35 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column102 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column102 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout();
this.groupBoxEX3.SuspendLayout(); this.groupBoxEX3.SuspendLayout();
this.groupBoxEX2.SuspendLayout(); this.groupBoxEX2.SuspendLayout();
@@ -108,7 +108,7 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 54.37666F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 54.37666F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 477F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 477F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 13F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 13F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(1370, 749); this.tableLayoutPanel1.Size = new System.Drawing.Size(1480, 749);
this.tableLayoutPanel1.TabIndex = 0; this.tableLayoutPanel1.TabIndex = 0;
// //
// groupBoxEX3 // groupBoxEX3
@@ -127,7 +127,7 @@
this.groupBoxEX3.Margin = new System.Windows.Forms.Padding(2); this.groupBoxEX3.Margin = new System.Windows.Forms.Padding(2);
this.groupBoxEX3.Name = "groupBoxEX3"; this.groupBoxEX3.Name = "groupBoxEX3";
this.groupBoxEX3.Padding = new System.Windows.Forms.Padding(2); this.groupBoxEX3.Padding = new System.Windows.Forms.Padding(2);
this.groupBoxEX3.Size = new System.Drawing.Size(206, 120); this.groupBoxEX3.Size = new System.Drawing.Size(233, 120);
this.groupBoxEX3.TabIndex = 14; this.groupBoxEX3.TabIndex = 14;
this.groupBoxEX3.TabStop = false; this.groupBoxEX3.TabStop = false;
this.groupBoxEX3.Text = "操作设置"; this.groupBoxEX3.Text = "操作设置";
@@ -136,7 +136,7 @@
// //
this.btSatrt.BackNormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); this.btSatrt.BackNormalColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
this.btSatrt.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btSatrt.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btSatrt.Location = new System.Drawing.Point(42, 24); this.btSatrt.Location = new System.Drawing.Point(22, 105);
this.btSatrt.Margin = new System.Windows.Forms.Padding(2); this.btSatrt.Margin = new System.Windows.Forms.Padding(2);
this.btSatrt.Name = "btSatrt"; this.btSatrt.Name = "btSatrt";
this.btSatrt.Padding = new System.Windows.Forms.Padding(2); this.btSatrt.Padding = new System.Windows.Forms.Padding(2);
@@ -217,7 +217,7 @@
this.groupBoxEX2.Margin = new System.Windows.Forms.Padding(2); this.groupBoxEX2.Margin = new System.Windows.Forms.Padding(2);
this.groupBoxEX2.Name = "groupBoxEX2"; this.groupBoxEX2.Name = "groupBoxEX2";
this.groupBoxEX2.Padding = new System.Windows.Forms.Padding(2); this.groupBoxEX2.Padding = new System.Windows.Forms.Padding(2);
this.groupBoxEX2.Size = new System.Drawing.Size(206, 143); this.groupBoxEX2.Size = new System.Drawing.Size(233, 143);
this.groupBoxEX2.TabIndex = 13; this.groupBoxEX2.TabIndex = 13;
this.groupBoxEX2.TabStop = false; this.groupBoxEX2.TabStop = false;
this.groupBoxEX2.Text = "参数"; this.groupBoxEX2.Text = "参数";
@@ -239,7 +239,7 @@
this.lVConfigRange.Margin = new System.Windows.Forms.Padding(2); this.lVConfigRange.Margin = new System.Windows.Forms.Padding(2);
this.lVConfigRange.Name = "lVConfigRange"; this.lVConfigRange.Name = "lVConfigRange";
this.lVConfigRange.OwnerDraw = true; this.lVConfigRange.OwnerDraw = true;
this.lVConfigRange.Size = new System.Drawing.Size(202, 120); this.lVConfigRange.Size = new System.Drawing.Size(229, 120);
this.lVConfigRange.TabIndex = 2; this.lVConfigRange.TabIndex = 2;
this.lVConfigRange.UseCompatibleStateImageBehavior = false; this.lVConfigRange.UseCompatibleStateImageBehavior = false;
this.lVConfigRange.View = System.Windows.Forms.View.Details; this.lVConfigRange.View = System.Windows.Forms.View.Details;
@@ -278,12 +278,12 @@
this.groupBoxEX4.Controls.Add(this.dgvFeedingData); this.groupBoxEX4.Controls.Add(this.dgvFeedingData);
this.groupBoxEX4.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBoxEX4.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBoxEX4.ForeColor = System.Drawing.Color.White; this.groupBoxEX4.ForeColor = System.Drawing.Color.White;
this.groupBoxEX4.Location = new System.Drawing.Point(212, 2); this.groupBoxEX4.Location = new System.Drawing.Point(239, 2);
this.groupBoxEX4.Margin = new System.Windows.Forms.Padding(2); this.groupBoxEX4.Margin = new System.Windows.Forms.Padding(2);
this.groupBoxEX4.Name = "groupBoxEX4"; this.groupBoxEX4.Name = "groupBoxEX4";
this.groupBoxEX4.Padding = new System.Windows.Forms.Padding(2); this.groupBoxEX4.Padding = new System.Windows.Forms.Padding(2);
this.tableLayoutPanel1.SetRowSpan(this.groupBoxEX4, 2); this.tableLayoutPanel1.SetRowSpan(this.groupBoxEX4, 2);
this.groupBoxEX4.Size = new System.Drawing.Size(1156, 267); this.groupBoxEX4.Size = new System.Drawing.Size(1239, 267);
this.groupBoxEX4.TabIndex = 15; this.groupBoxEX4.TabIndex = 15;
this.groupBoxEX4.TabStop = false; this.groupBoxEX4.TabStop = false;
this.groupBoxEX4.Text = "进站"; this.groupBoxEX4.Text = "进站";
@@ -344,7 +344,7 @@
this.dgvFeedingData.RowHeadersWidth = 60; this.dgvFeedingData.RowHeadersWidth = 60;
this.dgvFeedingData.RowTemplate.Height = 23; this.dgvFeedingData.RowTemplate.Height = 23;
this.dgvFeedingData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgvFeedingData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvFeedingData.Size = new System.Drawing.Size(1152, 244); this.dgvFeedingData.Size = new System.Drawing.Size(1235, 244);
this.dgvFeedingData.TabIndex = 10; this.dgvFeedingData.TabIndex = 10;
this.dgvFeedingData.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvFeedingData_CellContentClick); this.dgvFeedingData.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvFeedingData_CellContentClick);
this.dgvFeedingData.RowPrePaint += new System.Windows.Forms.DataGridViewRowPrePaintEventHandler(this.dgvFeedingData_RowPrePaint); this.dgvFeedingData.RowPrePaint += new System.Windows.Forms.DataGridViewRowPrePaintEventHandler(this.dgvFeedingData_RowPrePaint);
@@ -422,7 +422,7 @@
this.groupBoxEX1.Margin = new System.Windows.Forms.Padding(2); this.groupBoxEX1.Margin = new System.Windows.Forms.Padding(2);
this.groupBoxEX1.Name = "groupBoxEX1"; this.groupBoxEX1.Name = "groupBoxEX1";
this.groupBoxEX1.Padding = new System.Windows.Forms.Padding(2); this.groupBoxEX1.Padding = new System.Windows.Forms.Padding(2);
this.groupBoxEX1.Size = new System.Drawing.Size(206, 474); this.groupBoxEX1.Size = new System.Drawing.Size(233, 474);
this.groupBoxEX1.TabIndex = 12; this.groupBoxEX1.TabIndex = 12;
this.groupBoxEX1.TabStop = false; this.groupBoxEX1.TabStop = false;
this.groupBoxEX1.Text = "日志记录"; this.groupBoxEX1.Text = "日志记录";
@@ -437,7 +437,7 @@
this.rtb_Info.Margin = new System.Windows.Forms.Padding(2); this.rtb_Info.Margin = new System.Windows.Forms.Padding(2);
this.rtb_Info.Name = "rtb_Info"; this.rtb_Info.Name = "rtb_Info";
this.rtb_Info.ReadOnly = true; this.rtb_Info.ReadOnly = true;
this.rtb_Info.Size = new System.Drawing.Size(202, 451); this.rtb_Info.Size = new System.Drawing.Size(229, 451);
this.rtb_Info.TabIndex = 1; this.rtb_Info.TabIndex = 1;
this.rtb_Info.Text = ""; this.rtb_Info.Text = "";
// //
@@ -449,11 +449,11 @@
this.groupBoxEX5.Controls.Add(this.dgvBlankingData); this.groupBoxEX5.Controls.Add(this.dgvBlankingData);
this.groupBoxEX5.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBoxEX5.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBoxEX5.ForeColor = System.Drawing.Color.White; this.groupBoxEX5.ForeColor = System.Drawing.Color.White;
this.groupBoxEX5.Location = new System.Drawing.Point(212, 273); this.groupBoxEX5.Location = new System.Drawing.Point(239, 273);
this.groupBoxEX5.Margin = new System.Windows.Forms.Padding(2); this.groupBoxEX5.Margin = new System.Windows.Forms.Padding(2);
this.groupBoxEX5.Name = "groupBoxEX5"; this.groupBoxEX5.Name = "groupBoxEX5";
this.groupBoxEX5.Padding = new System.Windows.Forms.Padding(2); this.groupBoxEX5.Padding = new System.Windows.Forms.Padding(2);
this.groupBoxEX5.Size = new System.Drawing.Size(1156, 474); this.groupBoxEX5.Size = new System.Drawing.Size(1239, 474);
this.groupBoxEX5.TabIndex = 16; this.groupBoxEX5.TabIndex = 16;
this.groupBoxEX5.TabStop = false; this.groupBoxEX5.TabStop = false;
this.groupBoxEX5.Text = "出站"; this.groupBoxEX5.Text = "出站";
@@ -520,18 +520,10 @@
this.dgvBlankingData.RowHeadersWidth = 60; this.dgvBlankingData.RowHeadersWidth = 60;
this.dgvBlankingData.RowTemplate.Height = 23; this.dgvBlankingData.RowTemplate.Height = 23;
this.dgvBlankingData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgvBlankingData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvBlankingData.Size = new System.Drawing.Size(1152, 451); this.dgvBlankingData.Size = new System.Drawing.Size(1235, 451);
this.dgvBlankingData.TabIndex = 10; this.dgvBlankingData.TabIndex = 10;
this.dgvBlankingData.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvBlankingData_CellContentClick); this.dgvBlankingData.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvBlankingData_CellContentClick);
// //
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "info.png");
this.imageList1.Images.SetKeyName(1, "error.png");
this.imageList1.Images.SetKeyName(2, "warning.png");
//
// dataGridViewTextBoxColumn1 // dataGridViewTextBoxColumn1
// //
this.dataGridViewTextBoxColumn1.HeaderText = "序号"; this.dataGridViewTextBoxColumn1.HeaderText = "序号";
@@ -643,13 +635,21 @@
this.Column3.ReadOnly = true; this.Column3.ReadOnly = true;
this.Column3.Width = 400; this.Column3.Width = 400;
// //
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "info.png");
this.imageList1.Images.SetKeyName(1, "error.png");
this.imageList1.Images.SetKeyName(2, "warning.png");
//
// FrmDataMonitor // FrmDataMonitor
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38))))); this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38)))));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(1370, 749); this.ClientSize = new System.Drawing.Size(1480, 749);
this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.tableLayoutPanel1);
this.DoubleBuffered = true; this.DoubleBuffered = true;
this.Font = new System.Drawing.Font("微软雅黑", 10.5F); this.Font = new System.Drawing.Font("微软雅黑", 10.5F);
+1 -1
View File
@@ -188,7 +188,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABE ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABE
DQAAAk1TRnQBSQFMAgEBAwEAAZgBAgGYAQIBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA DQAAAk1TRnQBSQFMAgEBAwEAAagBAgGoAQIBEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABEAMAAQEBAAEgBgABEC4AAxUBHQMkATQDBQEGKAADHQEpAl4BZwHwATUBNgHPAf8BNQE2Ac8B/wE1 AwABEAMAAQEBAAEgBgABEC4AAxUBHQMkATQDBQEGKAADHQEpAl4BZwHwATUBNgHPAf8BNQE2Ac8B/wE1
ATYBzwH/ATUBNgHPAf8BNQE2Ac8B/wNOAZagAAMTARkDZQHlA+YB/wPmAf8D5gH/A+YB/wPmAf8DRwGA ATYBzwH/ATUBNgHPAf8BNQE2Ac8B/wNOAZagAAMTARkDZQHlA+YB/wPmAf8D5gH/A+YB/wPmAf8DRwGA
HAACUwFUAaoBNQE2Ac8B/wE1ATYBzwH/ATUBNgHPAf8BNQE2Ac8B/wE1ATYBzwH/ATUBNgHPAf8BNQE2 HAACUwFUAaoBNQE2Ac8B/wE1ATYBzwH/ATUBNgHPAf8BNQE2Ac8B/wE1ATYBzwH/ATUBNgHPAf8BNQE2
+2 -2
View File
@@ -455,9 +455,9 @@ namespace LargeSquareOne
TimeSpan timeSpan = endDateTime - startDateTime; TimeSpan timeSpan = endDateTime - startDateTime;
if (timeSpan.TotalDays > 1.0) if (timeSpan.TotalDays > 31.0)
{ {
return OperateResult.CreateFailResult<DataTable>("查询范围不能超过1天"); return OperateResult.CreateFailResult<DataTable>("查询范围不能超过31天");
} }
DataTable dataTable = CommonMethods.db.QueryDataTable(CommonMethods.dBSQL.SelectHostAlarmData(start, end, alarmType)); DataTable dataTable = CommonMethods.db.QueryDataTable(CommonMethods.dBSQL.SelectHostAlarmData(start, end, alarmType));
+116
View File
@@ -0,0 +1,116 @@
namespace LargeSquareOne
{
partial class FrmInput
{
/// <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.panel1 = new JinYuan.ControlLib.PanelExt();
this.btnOk = new System.Windows.Forms.Button();
this.txtGear = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.BordeColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(79)))), ((int)(((byte)(150)))));
this.panel1.BordeWidth = 2;
this.panel1.BottomGap = 0;
this.panel1.Controls.Add(this.btnOk);
this.panel1.Controls.Add(this.txtGear);
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.LeftGap = 0;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.panel1.Name = "panel1";
this.panel1.RightGap = 0;
this.panel1.Size = new System.Drawing.Size(438, 72);
this.panel1.TabIndex = 0;
this.panel1.TopGap = 0;
//
// btnOk
//
this.btnOk.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(27)))), ((int)(((byte)(78)))));
this.btnOk.Font = new System.Drawing.Font("微软雅黑", 11.5F);
this.btnOk.ForeColor = System.Drawing.Color.White;
this.btnOk.Location = new System.Drawing.Point(305, 12);
this.btnOk.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(112, 41);
this.btnOk.TabIndex = 12;
this.btnOk.Text = "确定";
this.btnOk.UseVisualStyleBackColor = false;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// txtGear
//
this.txtGear.Location = new System.Drawing.Point(111, 16);
this.txtGear.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.txtGear.Name = "txtGear";
this.txtGear.Size = new System.Drawing.Size(148, 34);
this.txtGear.TabIndex = 10;
//
// label1
//
this.label1.AutoSize = true;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(32, 19);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(52, 27);
this.label1.TabIndex = 1;
this.label1.Text = "档位";
//
// FrmInput
//
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 27F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38)))));
this.ClientSize = new System.Drawing.Size(438, 72);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("微软雅黑", 12F);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "FrmInput";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FrmChannelCfg";
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private JinYuan.ControlLib.PanelExt panel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.TextBox txtGear;
}
}
+42
View File
@@ -0,0 +1,42 @@
using JinYuan.Models;
using JinYuan.VirtualDataLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LargeSquareOne
{
public partial class FrmInput : Form
{
public string CurGear
{
get
{
return txtGear.Text?.Trim();
}
}
public FrmInput()
{
InitializeComponent();
}
public FrmInput(string gear)
{
InitializeComponent();
this.txtGear.Text = gear;
}
private void btnOk_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?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>
</root>
+1 -1
View File
@@ -72,7 +72,7 @@ namespace LargeSquareOne
CommonMethods.IsLoginOk = true; CommonMethods.IsLoginOk = true;
} }
//ngcode //ngcode
CommonMethods.listNgCodeEntity = CommonMethods.db.QueryAll<NgCodeEntity>(); //CommonMethods.listNgCodeEntity = CommonMethods.db.QueryAll<NgCodeEntity>();
} }
/// <summary> /// <summary>
+1
View File
@@ -205,6 +205,7 @@ namespace LargeSquareOne
CommonMethods.mesConfig.WattrMeterUrl = IniConfigHelper.ReadIniData("MES配置", "能耗", "0"); CommonMethods.mesConfig.WattrMeterUrl = IniConfigHelper.ReadIniData("MES配置", "能耗", "0");
CommonMethods.mesConfig.CollectData = IniConfigHelper.ReadIniData("MES配置", "风速仪", "0"); CommonMethods.mesConfig.CollectData = IniConfigHelper.ReadIniData("MES配置", "风速仪", "0");
CommonMethods.mesConfig.GradingMesUrl = IniConfigHelper.ReadIniData("MES配置", "分档参数", "0"); CommonMethods.mesConfig.GradingMesUrl = IniConfigHelper.ReadIniData("MES配置", "分档参数", "0");
CommonMethods.mesConfig.SafeEqptStatusMesUrl = IniConfigHelper.ReadIniData("MES配置", "安全设备状态", "0");
//CommonMethods.ProdDRFIDNgQty = Convert.ToInt32(IniConfigHelper.ReadIniData("统计计数", "ProdDRFIDNgQty", "0")); //CommonMethods.ProdDRFIDNgQty = Convert.ToInt32(IniConfigHelper.ReadIniData("统计计数", "ProdDRFIDNgQty", "0"));
//CommonMethods.ProdDXNgQty = Convert.ToInt32(IniConfigHelper.ReadIniData("统计计数", "ProdDXNgQty", "0")); //CommonMethods.ProdDXNgQty = Convert.ToInt32(IniConfigHelper.ReadIniData("统计计数", "ProdDXNgQty", "0"));
+1111 -1111
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -2448,7 +2448,7 @@
<value>550, 54</value> <value>550, 54</value>
</data> </data>
<data name="lbl_TitleBar.Text" xml:space="preserve"> <data name="lbl_TitleBar.Text" xml:space="preserve">
<value>外观检测监测系统</value> <value>外观检分档系统</value>
</data> </data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing"> <data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>550, 64</value> <value>550, 64</value>
@@ -5051,13 +5051,13 @@
</value> </value>
</data> </data>
<data name="MainPanel.Size" type="System.Drawing.Size, System.Drawing"> <data name="MainPanel.Size" type="System.Drawing.Size, System.Drawing">
<value>1874, 910</value> <value>1874, 891</value>
</data> </data>
<data name="CorePanel.Size" type="System.Drawing.Size, System.Drawing"> <data name="CorePanel.Size" type="System.Drawing.Size, System.Drawing">
<value>1920, 936</value> <value>1920, 917</value>
</data> </data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing"> <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>1920, 1080</value> <value>1920, 1061</value>
</data> </data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
+71 -53
View File
@@ -29,9 +29,9 @@
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmSystemSet)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmSystemSet));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
this.up_QieHuanPeriod = new JinYuan.ControlLib.UpDownLabel(); this.up_QieHuanPeriod = new JinYuan.ControlLib.UpDownLabel();
this.tog_AutoQieHuanM = new JinYuan.ControlLib.Toggle(); this.tog_AutoQieHuanM = new JinYuan.ControlLib.Toggle();
this.label16 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label();
@@ -78,6 +78,7 @@
this.tog_OKSwitching = new JinYuan.ControlLib.Toggle(); this.tog_OKSwitching = new JinYuan.ControlLib.Toggle();
this.title5 = new JinYuan.ControlLib.Title(); this.title5 = new JinYuan.ControlLib.Title();
this.dgvFdConfigs = new System.Windows.Forms.DataGridView(); this.dgvFdConfigs = new System.Windows.Forms.DataGridView();
this.btn_cfgChannel = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgvFdConfigs)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvFdConfigs)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
@@ -121,7 +122,7 @@
this.label16.ForeColor = System.Drawing.Color.White; this.label16.ForeColor = System.Drawing.Color.White;
this.label16.Location = new System.Drawing.Point(911, 276); this.label16.Location = new System.Drawing.Point(911, 276);
this.label16.Name = "label16"; this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(202, 26); this.label16.Size = new System.Drawing.Size(254, 31);
this.label16.TabIndex = 43; this.label16.TabIndex = 43;
this.label16.Text = "自动切换监控界面时间"; this.label16.Text = "自动切换监控界面时间";
// //
@@ -133,7 +134,7 @@
this.label17.ForeColor = System.Drawing.Color.White; this.label17.ForeColor = System.Drawing.Color.White;
this.label17.Location = new System.Drawing.Point(556, 275); this.label17.Location = new System.Drawing.Point(556, 275);
this.label17.Name = "label17"; this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(221, 26); this.label17.Size = new System.Drawing.Size(278, 31);
this.label17.TabIndex = 44; this.label17.TabIndex = 44;
this.label17.Text = "无操作自动切换监控界面"; this.label17.Text = "无操作自动切换监控界面";
// //
@@ -142,7 +143,7 @@
this.txtEqp_code.Font = new System.Drawing.Font("微软雅黑", 12F); this.txtEqp_code.Font = new System.Drawing.Font("微软雅黑", 12F);
this.txtEqp_code.Location = new System.Drawing.Point(832, 101); this.txtEqp_code.Location = new System.Drawing.Point(832, 101);
this.txtEqp_code.Name = "txtEqp_code"; this.txtEqp_code.Name = "txtEqp_code";
this.txtEqp_code.Size = new System.Drawing.Size(173, 29); this.txtEqp_code.Size = new System.Drawing.Size(173, 34);
this.txtEqp_code.TabIndex = 42; this.txtEqp_code.TabIndex = 42;
this.txtEqp_code.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtEqp_code.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
// //
@@ -154,7 +155,7 @@
this.label13.ForeColor = System.Drawing.Color.White; this.label13.ForeColor = System.Drawing.Color.White;
this.label13.Location = new System.Drawing.Point(738, 101); this.label13.Location = new System.Drawing.Point(738, 101);
this.label13.Name = "label13"; this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(88, 26); this.label13.Size = new System.Drawing.Size(110, 31);
this.label13.TabIndex = 41; this.label13.TabIndex = 41;
this.label13.Text = "设备编号"; this.label13.Text = "设备编号";
// //
@@ -163,7 +164,7 @@
this.txtline_No.Font = new System.Drawing.Font("微软雅黑", 12F); this.txtline_No.Font = new System.Drawing.Font("微软雅黑", 12F);
this.txtline_No.Location = new System.Drawing.Point(549, 101); this.txtline_No.Location = new System.Drawing.Point(549, 101);
this.txtline_No.Name = "txtline_No"; this.txtline_No.Name = "txtline_No";
this.txtline_No.Size = new System.Drawing.Size(173, 29); this.txtline_No.Size = new System.Drawing.Size(173, 34);
this.txtline_No.TabIndex = 40; this.txtline_No.TabIndex = 40;
this.txtline_No.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtline_No.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
// //
@@ -175,7 +176,7 @@
this.label14.ForeColor = System.Drawing.Color.White; this.label14.ForeColor = System.Drawing.Color.White;
this.label14.Location = new System.Drawing.Point(455, 101); this.label14.Location = new System.Drawing.Point(455, 101);
this.label14.Name = "label14"; this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(88, 26); this.label14.Size = new System.Drawing.Size(110, 31);
this.label14.TabIndex = 39; this.label14.TabIndex = 39;
this.label14.Text = "产线编号"; this.label14.Text = "产线编号";
// //
@@ -184,7 +185,7 @@
this.txtFactory_code.Font = new System.Drawing.Font("微软雅黑", 12F); this.txtFactory_code.Font = new System.Drawing.Font("微软雅黑", 12F);
this.txtFactory_code.Location = new System.Drawing.Point(261, 101); this.txtFactory_code.Location = new System.Drawing.Point(261, 101);
this.txtFactory_code.Name = "txtFactory_code"; this.txtFactory_code.Name = "txtFactory_code";
this.txtFactory_code.Size = new System.Drawing.Size(173, 29); this.txtFactory_code.Size = new System.Drawing.Size(173, 34);
this.txtFactory_code.TabIndex = 38; this.txtFactory_code.TabIndex = 38;
this.txtFactory_code.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtFactory_code.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
// //
@@ -196,7 +197,7 @@
this.label15.ForeColor = System.Drawing.Color.White; this.label15.ForeColor = System.Drawing.Color.White;
this.label15.Location = new System.Drawing.Point(167, 99); this.label15.Location = new System.Drawing.Point(167, 99);
this.label15.Name = "label15"; this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(88, 26); this.label15.Size = new System.Drawing.Size(110, 31);
this.label15.TabIndex = 37; this.label15.TabIndex = 37;
this.label15.Text = "工厂代码"; this.label15.Text = "工厂代码";
// //
@@ -218,7 +219,7 @@
this.cmb_PLCType.FormattingEnabled = true; this.cmb_PLCType.FormattingEnabled = true;
this.cmb_PLCType.Location = new System.Drawing.Point(261, 34); this.cmb_PLCType.Location = new System.Drawing.Point(261, 34);
this.cmb_PLCType.Name = "cmb_PLCType"; this.cmb_PLCType.Name = "cmb_PLCType";
this.cmb_PLCType.Size = new System.Drawing.Size(173, 28); this.cmb_PLCType.Size = new System.Drawing.Size(173, 31);
this.cmb_PLCType.TabIndex = 33; this.cmb_PLCType.TabIndex = 33;
// //
// label12 // label12
@@ -229,7 +230,7 @@
this.label12.ForeColor = System.Drawing.Color.White; this.label12.ForeColor = System.Drawing.Color.White;
this.label12.Location = new System.Drawing.Point(141, 35); this.label12.Location = new System.Drawing.Point(141, 35);
this.label12.Name = "label12"; this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(123, 26); this.label12.Size = new System.Drawing.Size(155, 31);
this.label12.TabIndex = 34; this.label12.TabIndex = 34;
this.label12.Text = "PLC类型配置"; this.label12.Text = "PLC类型配置";
// //
@@ -270,7 +271,7 @@
this.label11.ForeColor = System.Drawing.Color.White; this.label11.ForeColor = System.Drawing.Color.White;
this.label11.Location = new System.Drawing.Point(44, 273); this.label11.Location = new System.Drawing.Point(44, 273);
this.label11.Name = "label11"; this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(126, 26); this.label11.Size = new System.Drawing.Size(158, 31);
this.label11.TabIndex = 30; this.label11.TabIndex = 30;
this.label11.Text = "开启刷卡模式"; this.label11.Text = "开启刷卡模式";
// //
@@ -298,7 +299,7 @@
this.label10.ForeColor = System.Drawing.Color.White; this.label10.ForeColor = System.Drawing.Color.White;
this.label10.Location = new System.Drawing.Point(368, 376); this.label10.Location = new System.Drawing.Point(368, 376);
this.label10.Name = "label10"; this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(130, 26); this.label10.Size = new System.Drawing.Size(163, 31);
this.label10.TabIndex = 28; this.label10.TabIndex = 28;
this.label10.Text = "获取MES参数"; this.label10.Text = "获取MES参数";
// //
@@ -326,7 +327,7 @@
this.label9.ForeColor = System.Drawing.Color.White; this.label9.ForeColor = System.Drawing.Color.White;
this.label9.Location = new System.Drawing.Point(39, 376); this.label9.Location = new System.Drawing.Point(39, 376);
this.label9.Name = "label9"; this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(200, 26); this.label9.Size = new System.Drawing.Size(251, 31);
this.label9.TabIndex = 26; this.label9.TabIndex = 26;
this.label9.Text = "MES/非MES模式切换"; this.label9.Text = "MES/非MES模式切换";
// //
@@ -354,7 +355,7 @@
this.label8.ForeColor = System.Drawing.Color.White; this.label8.ForeColor = System.Drawing.Color.White;
this.label8.Location = new System.Drawing.Point(266, 273); this.label8.Location = new System.Drawing.Point(266, 273);
this.label8.Name = "label8"; this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(164, 26); this.label8.Size = new System.Drawing.Size(206, 31);
this.label8.TabIndex = 24; this.label8.TabIndex = 24;
this.label8.Text = "线程耗时日志保存"; this.label8.Text = "线程耗时日志保存";
// //
@@ -446,7 +447,7 @@
this.label5.ForeColor = System.Drawing.Color.White; this.label5.ForeColor = System.Drawing.Color.White;
this.label5.Location = new System.Drawing.Point(1068, 215); this.label5.Location = new System.Drawing.Point(1068, 215);
this.label5.Name = "label5"; this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(202, 26); this.label5.Size = new System.Drawing.Size(254, 31);
this.label5.TabIndex = 12; this.label5.TabIndex = 12;
this.label5.Text = "焊机功率曲线显示数量"; this.label5.Text = "焊机功率曲线显示数量";
this.label5.Visible = false; this.label5.Visible = false;
@@ -459,7 +460,7 @@
this.label4.ForeColor = System.Drawing.Color.White; this.label4.ForeColor = System.Drawing.Color.White;
this.label4.Location = new System.Drawing.Point(809, 215); this.label4.Location = new System.Drawing.Point(809, 215);
this.label4.Name = "label4"; this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(126, 26); this.label4.Size = new System.Drawing.Size(158, 31);
this.label4.TabIndex = 13; this.label4.TabIndex = 13;
this.label4.Text = "自动锁屏时间"; this.label4.Text = "自动锁屏时间";
// //
@@ -471,7 +472,7 @@
this.label3.ForeColor = System.Drawing.Color.White; this.label3.ForeColor = System.Drawing.Color.White;
this.label3.Location = new System.Drawing.Point(556, 215); this.label3.Location = new System.Drawing.Point(556, 215);
this.label3.Name = "label3"; this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(145, 26); this.label3.Size = new System.Drawing.Size(182, 31);
this.label3.TabIndex = 14; this.label3.TabIndex = 14;
this.label3.Text = "无操作自动锁屏"; this.label3.Text = "无操作自动锁屏";
// //
@@ -483,7 +484,7 @@
this.label6.ForeColor = System.Drawing.Color.WhiteSmoke; this.label6.ForeColor = System.Drawing.Color.WhiteSmoke;
this.label6.Location = new System.Drawing.Point(291, 215); this.label6.Location = new System.Drawing.Point(291, 215);
this.label6.Name = "label6"; this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(126, 26); this.label6.Size = new System.Drawing.Size(158, 31);
this.label6.TabIndex = 11; this.label6.TabIndex = 11;
this.label6.Text = "软件自动登录"; this.label6.Text = "软件自动登录";
// //
@@ -495,7 +496,7 @@
this.label7.ForeColor = System.Drawing.Color.White; this.label7.ForeColor = System.Drawing.Color.White;
this.label7.Location = new System.Drawing.Point(44, 215); this.label7.Location = new System.Drawing.Point(44, 215);
this.label7.Name = "label7"; this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(126, 26); this.label7.Size = new System.Drawing.Size(158, 31);
this.label7.TabIndex = 10; this.label7.TabIndex = 10;
this.label7.Text = "开机自动启动"; this.label7.Text = "开机自动启动";
// //
@@ -573,7 +574,7 @@
this.txt_Prot.Font = new System.Drawing.Font("微软雅黑", 12F); this.txt_Prot.Font = new System.Drawing.Font("微软雅黑", 12F);
this.txt_Prot.Location = new System.Drawing.Point(832, 35); this.txt_Prot.Location = new System.Drawing.Point(832, 35);
this.txt_Prot.Name = "txt_Prot"; this.txt_Prot.Name = "txt_Prot";
this.txt_Prot.Size = new System.Drawing.Size(173, 29); this.txt_Prot.Size = new System.Drawing.Size(173, 34);
this.txt_Prot.TabIndex = 4; this.txt_Prot.TabIndex = 4;
this.txt_Prot.Text = "9600"; this.txt_Prot.Text = "9600";
this.txt_Prot.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txt_Prot.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
@@ -586,7 +587,7 @@
this.label2.ForeColor = System.Drawing.Color.White; this.label2.ForeColor = System.Drawing.Color.White;
this.label2.Location = new System.Drawing.Point(726, 36); this.label2.Location = new System.Drawing.Point(726, 36);
this.label2.Name = "label2"; this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(107, 26); this.label2.Size = new System.Drawing.Size(134, 31);
this.label2.TabIndex = 3; this.label2.TabIndex = 3;
this.label2.Text = "端口号配置"; this.label2.Text = "端口号配置";
// //
@@ -595,7 +596,7 @@
this.txt_IP.Font = new System.Drawing.Font("微软雅黑", 12F); this.txt_IP.Font = new System.Drawing.Font("微软雅黑", 12F);
this.txt_IP.Location = new System.Drawing.Point(549, 35); this.txt_IP.Location = new System.Drawing.Point(549, 35);
this.txt_IP.Name = "txt_IP"; this.txt_IP.Name = "txt_IP";
this.txt_IP.Size = new System.Drawing.Size(173, 29); this.txt_IP.Size = new System.Drawing.Size(173, 34);
this.txt_IP.TabIndex = 2; this.txt_IP.TabIndex = 2;
this.txt_IP.Text = "127.0.0.1"; this.txt_IP.Text = "127.0.0.1";
this.txt_IP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txt_IP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
@@ -608,7 +609,7 @@
this.label1.ForeColor = System.Drawing.Color.White; this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(443, 36); this.label1.Location = new System.Drawing.Point(443, 36);
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(106, 26); this.label1.Size = new System.Drawing.Size(134, 31);
this.label1.TabIndex = 1; this.label1.TabIndex = 1;
this.label1.Text = "IP地址配置"; this.label1.Text = "IP地址配置";
// //
@@ -632,7 +633,7 @@
this.label18.ForeColor = System.Drawing.Color.White; this.label18.ForeColor = System.Drawing.Color.White;
this.label18.Location = new System.Drawing.Point(634, 376); this.label18.Location = new System.Drawing.Point(634, 376);
this.label18.Name = "label18"; this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(202, 26); this.label18.Size = new System.Drawing.Size(254, 31);
this.label18.TabIndex = 47; this.label18.TabIndex = 47;
this.label18.Text = "强制OK/正常模式切换"; this.label18.Text = "强制OK/正常模式切换";
// //
@@ -674,50 +675,66 @@
this.dgvFdConfigs.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38))))); this.dgvFdConfigs.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38)))));
this.dgvFdConfigs.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.dgvFdConfigs.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.dgvFdConfigs.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; this.dgvFdConfigs.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38))))); dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38)))));
dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 10.5F); dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 10.5F);
dataGridViewCellStyle1.ForeColor = System.Drawing.Color.White; dataGridViewCellStyle7.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38))))); dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38)))));
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvFdConfigs.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dgvFdConfigs.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
this.dgvFdConfigs.ColumnHeadersHeight = 40; this.dgvFdConfigs.ColumnHeadersHeight = 40;
this.dgvFdConfigs.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.dgvFdConfigs.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(6)))), ((int)(((byte)(40)))), ((int)(((byte)(86))))); dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(6)))), ((int)(((byte)(40)))), ((int)(((byte)(86)))));
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 10.5F); dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 10.5F);
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; dataGridViewCellStyle8.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvFdConfigs.DefaultCellStyle = dataGridViewCellStyle2; this.dgvFdConfigs.DefaultCellStyle = dataGridViewCellStyle8;
this.dgvFdConfigs.EnableHeadersVisualStyles = false; this.dgvFdConfigs.EnableHeadersVisualStyles = false;
this.dgvFdConfigs.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(77)))), ((int)(((byte)(147))))); this.dgvFdConfigs.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(77)))), ((int)(((byte)(147)))));
this.dgvFdConfigs.Location = new System.Drawing.Point(44, 486); this.dgvFdConfigs.Location = new System.Drawing.Point(22, 594);
this.dgvFdConfigs.Name = "dgvFdConfigs"; this.dgvFdConfigs.Name = "dgvFdConfigs";
this.dgvFdConfigs.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; this.dgvFdConfigs.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(6)))), ((int)(((byte)(40)))), ((int)(((byte)(86))))); dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(6)))), ((int)(((byte)(40)))), ((int)(((byte)(86)))));
dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 10.5F); dataGridViewCellStyle9.Font = new System.Drawing.Font("微软雅黑", 10.5F);
dataGridViewCellStyle3.ForeColor = System.Drawing.Color.White; dataGridViewCellStyle9.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgvFdConfigs.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; this.dgvFdConfigs.RowHeadersDefaultCellStyle = dataGridViewCellStyle9;
this.dgvFdConfigs.RowHeadersWidth = 55; this.dgvFdConfigs.RowHeadersWidth = 55;
this.dgvFdConfigs.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; this.dgvFdConfigs.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
this.dgvFdConfigs.RowTemplate.Height = 40; this.dgvFdConfigs.RowTemplate.Height = 40;
this.dgvFdConfigs.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False; this.dgvFdConfigs.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.dgvFdConfigs.Size = new System.Drawing.Size(1757, 69); this.dgvFdConfigs.Size = new System.Drawing.Size(1757, 69);
this.dgvFdConfigs.TabIndex = 78; this.dgvFdConfigs.TabIndex = 78;
this.dgvFdConfigs.Visible = false;
//
// btn_cfgChannel
//
this.btn_cfgChannel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(3)))), ((int)(((byte)(27)))), ((int)(((byte)(78)))));
this.btn_cfgChannel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_cfgChannel.Font = new System.Drawing.Font("微软雅黑", 11.5F);
this.btn_cfgChannel.ForeColor = System.Drawing.Color.White;
this.btn_cfgChannel.Location = new System.Drawing.Point(45, 484);
this.btn_cfgChannel.Name = "btn_cfgChannel";
this.btn_cfgChannel.Size = new System.Drawing.Size(105, 36);
this.btn_cfgChannel.TabIndex = 80;
this.btn_cfgChannel.Text = "修改分档";
this.btn_cfgChannel.UseVisualStyleBackColor = false;
this.btn_cfgChannel.Click += new System.EventHandler(this.btn_cfgChannel_Click);
// //
// FrmSystemSet // FrmSystemSet
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 23F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38))))); this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(23)))), ((int)(((byte)(38)))));
this.ClientSize = new System.Drawing.Size(1370, 651); this.ClientSize = new System.Drawing.Size(1370, 651);
this.Controls.Add(this.btn_cfgChannel);
this.Controls.Add(this.dgvFdConfigs); this.Controls.Add(this.dgvFdConfigs);
this.Controls.Add(this.title5); this.Controls.Add(this.title5);
this.Controls.Add(this.tog_OKSwitching); this.Controls.Add(this.tog_OKSwitching);
@@ -822,5 +839,6 @@
private JinYuan.ControlLib.Toggle tog_OKSwitching; private JinYuan.ControlLib.Toggle tog_OKSwitching;
private JinYuan.ControlLib.Title title5; private JinYuan.ControlLib.Title title5;
private System.Windows.Forms.DataGridView dgvFdConfigs; private System.Windows.Forms.DataGridView dgvFdConfigs;
private System.Windows.Forms.Button btn_cfgChannel;
} }
} }
+42 -23
View File
@@ -5,14 +5,15 @@ using JinYuan.Models;
using JinYuan.VirtualDataLibrary; using JinYuan.VirtualDataLibrary;
using Microsoft.Win32; using Microsoft.Win32;
using MiniExcelLibs; using MiniExcelLibs;
using PLCCommunication;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
using System.Linq;
using static Org.BouncyCastle.Math.EC.ECCurve;
using System.Drawing; using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using static Org.BouncyCastle.Math.EC.ECCurve;
namespace LargeSquareOne namespace LargeSquareOne
{ {
@@ -801,28 +802,40 @@ namespace LargeSquareOne
{ {
try try
{ {
var row = dgvFdConfigs.Rows[rowIndex];
var config = fdConfigs[rowIndex]; int result = CommonMethods.PlcLink.ReadInt16("D88");//判断是否停机 1为停机,0为正在运行
if (result == 1)
{
var row = dgvFdConfigs.Rows[rowIndex];
var config = fdConfigs[rowIndex];
// 更新配置对象 // 更新配置对象
config.OKLD1Type = row.Cells["OKLD1Type"].Value?.ToString() ?? ""; config.OKLD1Type = row.Cells["OKLD1Type"].Value?.ToString() ?? "";
config.OKLD2Type = row.Cells["OKLD2Type"].Value?.ToString() ?? ""; config.OKLD2Type = row.Cells["OKLD2Type"].Value?.ToString() ?? "";
config.OKLD3Type = row.Cells["OKLD3Type"].Value?.ToString() ?? ""; config.OKLD3Type = row.Cells["OKLD3Type"].Value?.ToString() ?? "";
config.OKLD4Type = row.Cells["OKLD4Type"].Value?.ToString() ?? ""; config.OKLD4Type = row.Cells["OKLD4Type"].Value?.ToString() ?? "";
config.OKLD5Type = row.Cells["OKLD5Type"].Value?.ToString() ?? ""; config.OKLD5Type = row.Cells["OKLD5Type"].Value?.ToString() ?? "";
config.OKLD6Type = row.Cells["OKLD6Type"].Value?.ToString() ?? ""; config.OKLD6Type = row.Cells["OKLD6Type"].Value?.ToString() ?? "";
//config.NGLD5Type = row.Cells["NGLD5Type"].Value?.ToString() ?? ""; //config.NGLD5Type = row.Cells["NGLD5Type"].Value?.ToString() ?? "";
//config.NGLD6Type = row.Cells["NGLD6Type"].Value?.ToString() ?? ""; //config.NGLD6Type = row.Cells["NGLD6Type"].Value?.ToString() ?? "";
//config.NGLD7Type = row.Cells["NGLD7Type"].Value?.ToString() ?? ""; //config.NGLD7Type = row.Cells["NGLD7Type"].Value?.ToString() ?? "";
config.IsFDActive = row.Cells["IsFDActive"].Value != null && config.IsFDActive = row.Cells["IsFDActive"].Value != null &&
Convert.ToBoolean(row.Cells["IsFDActive"].Value); Convert.ToBoolean(row.Cells["IsFDActive"].Value);
config.IsNGActive = row.Cells["IsNGActive"].Value != null && config.IsNGActive = row.Cells["IsNGActive"].Value != null &&
Convert.ToBoolean(row.Cells["IsNGActive"].Value); Convert.ToBoolean(row.Cells["IsNGActive"].Value);
// 保存更改 // 保存更改
SaveFDConfig(); SaveFDConfig();
MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); //加载
CommonMethods.WriteGrading();
MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("机器正在运行不能修改", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -915,5 +928,11 @@ namespace LargeSquareOne
} }
#endregion #endregion
private void btn_cfgChannel_Click(object sender, EventArgs e)
{
FrmChannelCfg frm = new FrmChannelCfg();
frm.ShowDialog();
}
} }
} }
+27 -1
View File
@@ -200,6 +200,12 @@
<Compile Include="CustomMessageBox.Designer.cs"> <Compile Include="CustomMessageBox.Designer.cs">
<DependentUpon>CustomMessageBox.cs</DependentUpon> <DependentUpon>CustomMessageBox.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FrmChannelCfg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmChannelCfg.Designer.cs">
<DependentUpon>FrmChannelCfg.cs</DependentUpon>
</Compile>
<Compile Include="FrmCpkCount.cs"> <Compile Include="FrmCpkCount.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -224,6 +230,12 @@
<Compile Include="FrmHelper.Designer.cs"> <Compile Include="FrmHelper.Designer.cs">
<DependentUpon>FrmHelper.cs</DependentUpon> <DependentUpon>FrmHelper.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FrmInput.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmInput.Designer.cs">
<DependentUpon>FrmInput.cs</DependentUpon>
</Compile>
<Compile Include="FrmLogin.cs"> <Compile Include="FrmLogin.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -324,6 +336,9 @@
<EmbeddedResource Include="CustomMessageBox.resx"> <EmbeddedResource Include="CustomMessageBox.resx">
<DependentUpon>CustomMessageBox.cs</DependentUpon> <DependentUpon>CustomMessageBox.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmChannelCfg.resx">
<DependentUpon>FrmChannelCfg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmCpkCount.resx"> <EmbeddedResource Include="FrmCpkCount.resx">
<DependentUpon>FrmCpkCount.cs</DependentUpon> <DependentUpon>FrmCpkCount.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@@ -337,6 +352,9 @@
<EmbeddedResource Include="FrmHelper.resx"> <EmbeddedResource Include="FrmHelper.resx">
<DependentUpon>FrmHelper.cs</DependentUpon> <DependentUpon>FrmHelper.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmInput.resx">
<DependentUpon>FrmInput.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmLogin.resx"> <EmbeddedResource Include="FrmLogin.resx">
<DependentUpon>FrmLogin.cs</DependentUpon> <DependentUpon>FrmLogin.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@@ -345,15 +363,19 @@
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmMain.en-US.resx"> <EmbeddedResource Include="FrmMain.en-US.resx">
<DependentUpon>FrmMain.cs</DependentUpon> <DependentUpon>FrmMain.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmMain.hu-HU.resx"> <EmbeddedResource Include="FrmMain.hu-HU.resx">
<DependentUpon>FrmMain.cs</DependentUpon> <DependentUpon>FrmMain.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmMain.syr.resx"> <EmbeddedResource Include="FrmMain.syr.resx">
<DependentUpon>FrmMain.cs</DependentUpon> <DependentUpon>FrmMain.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmMain.zh-CN.resx"> <EmbeddedResource Include="FrmMain.zh-CN.resx">
<DependentUpon>FrmMain.cs</DependentUpon> <DependentUpon>FrmMain.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FrmMesParamMsgBoxWithAck.resx"> <EmbeddedResource Include="FrmMesParamMsgBoxWithAck.resx">
<DependentUpon>FrmMesParamMsgBoxWithAck.cs</DependentUpon> <DependentUpon>FrmMesParamMsgBoxWithAck.cs</DependentUpon>
@@ -413,10 +435,14 @@
<None Include="Assts\Fonts\Zen圓体-Regular.ttf"> <None Include="Assts\Fonts\Zen圓体-Regular.ttf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<None Include="Config\Configure.ini"> <None Include="Config\Channel.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="Config\Configure.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Config\Device.ini" /> <None Include="Config\Device.ini" />
<None Include="Config\FdConfig.xlsx" />
<None Include="Config\Group.xlsx" /> <None Include="Config\Group.xlsx" />
<None Include="Config\Variable.xlsx" /> <None Include="Config\Variable.xlsx" />
<Content Include="NLog.config"> <Content Include="NLog.config">
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView> <ProjectView>ProjectFiles</ProjectView>
<PublishUrlHistory>publish\</PublishUrlHistory> <PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory /> <InstallUrlHistory />
<SupportUrlHistory /> <SupportUrlHistory />
@@ -1,88 +0,0 @@
[配置信息]
开机自动启动=False
启动自动登录=False
无操作自动锁屏=False
锁屏间隔时间=3
无操作自动切换监控界面=True
切换监控界面间隔时间=1
曲线显示数量=1
开启刷卡模式=False
MES/非MES模式切换=False
获取MES参数=True
线程耗时日志保存=False
是否获取服务器数据=1
是否存储C模块数据=1
外观检测条码计数=1
强制OK/正常NG模式切换=False
[MES配置]
工厂代码=60J
产线编号=MW-602
设备编号=602VIM01
智能电表编号=1,2
白夜班交替时间=20:30:00
MES日志保存路径=D:\APILog
存储服务器IP地址=192.168.2.108
Grading1=K71
Grading2=K70
Grading3=K79
Grading4=K78
Grading5=K888
Grading6=K89
员工权限校验=http://10.22.160.141/core/api/public/equipment/base/user/login/verify
设备参数设定值请求=http://10.22.160.141/core/api/public/param/setting/request
设备参数设定值变更=http://10.22.160.141/core/api/public/param/setting/change
产品进站=http://10.22.160.141/core/api/public/formation/section/arrival/bz
产品过程加工参数=http://10.22.160.141/core/api/public/product/process/param/new/process
产品结果加工参数=http://10.22.160.141/core/api/public/product/process/param/new/result
产品出站=http://10.22.160.141/core/api/public/eve/pm/formation-section/bz
设备报警=http://10.22.160.141/core/api/public/equipment/alarm/currency
设备状态=http://10.22.160.141/core/api/public/eve/pm/eqm/run/status/operation
能耗=http://10.22.160.141/core/api/public/eve/pm/energy/consumption/collection/submit
风速仪=https://iot.eveportal.com:9470/eve_api/ems/iot/upload_device_collect_data
风速仪=https://iot.eveportal.com:9470/eve_api/ems/iot/upload_device_collect_data
分档参数=http://10.22.160.141/core/api/public/eve/pm/eqm/new/grading
guid=22bd9dc0-9f1f-40c4-86cf-bae5c5a0031c
DeviceState=4
run_AlarmMark=0
run_IdleMark=1
[统计计数]
LastHour=1030
LastResetTime=0
LastTotalOldNum=360
LastOkOldNum=358
ProdAllQty=0
ProdOKQty=0
ProdDRFIDNgQty=0
ProdDXNgQty=0
ProdGRFIDNgQty=0
ProdYLZNgQty=0
[风速仪]
AntiDustAirSpeedCount=25
AntiDustAirSpeed1=FSY-2A-001
AntiDustAirSpeed2=FSY-2A-002
AntiDustAirSpeed3=FSY-2A-003
AntiDustAirSpeed4=FSY-2A-004
AntiDustAirSpeed5=FSY-2A-005
AntiDustAirSpeed6=FSY-2A-006
AntiDustAirSpeed7=FSY-2A-007
AntiDustAirSpeed8=FSY-2A-008
AntiDustAirSpeed9=FSY-2A-009
AntiDustAirSpeed10=FSY-2A-010
AntiDustAirSpeed11=FSY-2A-011
AntiDustAirSpeed12=FSY-2A-012
AntiDustAirSpeed13=FSY-2A-013
AntiDustAirSpeed14=FSY-2A-014
AntiDustAirSpeed15=FSY-2A-015
AntiDustAirSpeed16=FSY-2A-016
AntiDustAirSpeed17=FSY-2A-017
AntiDustAirSpeed18=FSY-2A-018
AntiDustAirSpeed19=FSY-2A-019
AntiDustAirSpeed20=FSY-2A-020
AntiDustAirSpeed21=FSY-2A-021
AntiDustAirSpeed22=FSY-2A-022
AntiDustAirSpeed23=FSY-2A-023
AntiDustAirSpeed24=FSY-2A-024
AntiDustAirSpeed25=FSY-2A-025
+1 -1
View File
@@ -1,4 +1,4 @@
[设备参数] [设备参数]
IP華硊=127.0.0.1 IP華硊=192.168.1.52
端口号=9600 端口号=9600
PLC类型=OmronFinsTcp_HSL PLC类型=OmronFinsTcp_HSL
Binary file not shown.
Binary file not shown.
Binary file not shown.