页面布局修改

This commit is contained in:
gf zhou committed 2025-04-04 23:28:46 +08:00
1 parent d20b935213
commit 752e1f37b6
9 files changed
+1636 -1044

No files matched your search

+33 -30
View File
@@ -58,7 +58,7 @@ namespace WindowsFormsApp1.server
// 初始化 CsvLogger
// 初始化日志路径
_logBasePath = Path.Combine(@"D:\", "Logs", $"logs.csv");
_logBasePath = Path.Combine(@"C:\", "Logs", $"logs.csv");
// 初始化CSV日志记录器
CsvLogger.Initialize(_logBasePath);
@@ -94,8 +94,8 @@ namespace WindowsFormsApp1.server
headers.Add("保压时间");
break;
case "sealant":
headers.Add("重量");
headers.Add("宽度");
headers.Add("胶宽");
headers.Add("CCD结果");
break;
case "curing":
headers.Add("固化温度");
@@ -125,6 +125,7 @@ namespace WindowsFormsApp1.server
var httpContent = new StringContent(jsonPayload, Encoding.UTF8, "application/json");
#region test
// 回写对应PLC
if (statusCode > 0)
PlcData.Write_Status = (short)statusCode;
@@ -132,11 +133,12 @@ namespace WindowsFormsApp1.server
PlcData.Write_stSN = "testsn";
LogExecute.logNet.WriteDebug($"{eventName} 测ui接口请求成功\n请求:{jsonPayload}\n");
return ApiFormResult.Sucess(mesresult.PASS, true, "PASS", PlcData, DateTime.Now);
#endregion test
/*
#region 正式调用接口
try
/*try
{
#region MES交互
@@ -222,10 +224,11 @@ namespace WindowsFormsApp1.server
throw new Exception(ex.Message);
}
return ApiFormResult.Sucess(mesresult.PASS, false, "", PlcData, DateTime.Now);
#endregion 正式调用接口
*/
#endregion 正式调用接口
}
public ApiFormResult SN_CheckIN(string url, plcdata PlcData, otherdata OtherData)
@@ -235,7 +238,7 @@ namespace WindowsFormsApp1.server
var stationid = Init.t_Line.lineremark2.ToLower();
if ("loadaging,exchange2,exchange1".Contains(stationid))
{
sn = PlcData.Read_MaterialCode0;
sn = PlcData.Write_stSN ?? OtherData.JS_SN;
}
else
{
@@ -321,7 +324,7 @@ namespace WindowsFormsApp1.server
OPID = _opID,
Token = _token,
FixSN = _fixsn,
SN = OtherData.JS_SN ?? "",//扫码
SN = OtherData.JS_SN ?? PlcData.Write_stSN,//扫码
SendTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")
};
@@ -366,7 +369,7 @@ namespace WindowsFormsApp1.server
Qty = "1"
}
},
SN = PlcData.Read_MaterialCode0,
SN = PlcData.Write_stSN,
SendTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")
};
@@ -392,7 +395,7 @@ namespace WindowsFormsApp1.server
OPID = _opID,
Token = _token,
FixSN = _fixsn,
SN = Init.ScanString,
SN = PlcData.Write_stSN,
//CarrierID = PlcData.Read_MaterialCode1,
SendTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")
};
@@ -460,7 +463,7 @@ namespace WindowsFormsApp1.server
StationID = _stationID,
MachineID = _machineID,
OPID = _opID,
SN = OtherData.JS_SN ?? PlcData.Read_MaterialCode0 ?? "test",
SN = OtherData.JS_SN ?? PlcData.Write_stSN ?? "test",
CarrierID = PlcData.Read_MaterialCode1,
DC_INFO = new List<DCInfoItem>(),
CompList = new List<CompListItem>(),
@@ -554,7 +557,7 @@ namespace WindowsFormsApp1.server
List<string> fileList = new List<string>();
//从数据库读 未上传的 todo
string snNumber = PlcData.Read_MaterialCode0;
string snNumber = PlcData.Write_stSN;
if (string.IsNullOrEmpty(snNumber))
{
@@ -598,7 +601,7 @@ namespace WindowsFormsApp1.server
continue;
}
extensionstr = Path.GetExtension(file);
fileName = $"{month}{day}_{_stationID}_{result}_{PlcData.Read_MaterialCode0}_{monthDay}_{time}_{_machineID}_01_Original{num}{extensionstr}";
fileName = $"{month}{day}_{_stationID}_{result}_{PlcData.Write_stSN}_{monthDay}_{time}_{_machineID}_01_Original{num}{extensionstr}";
filePath = Path.Combine(sourceFolder, fileName1);
//string targetPath = Path.Combine(targetFolder, fileName);
//File.Copy(file, targetPath, true);
@@ -631,7 +634,7 @@ namespace WindowsFormsApp1.server
{
new
{
SN = PlcData.Read_MaterialCode0,
SN = PlcData.Write_stSN,
FileInfo = fileList.Select(x => new
{
FileName = x,
@@ -736,7 +739,7 @@ namespace WindowsFormsApp1.server
Line = _line, // 特殊值,不使用_line
Station = _stationID,
MachineID = _machineID,
SN = PlcData.Read_MaterialCode0
SN = PlcData.Write_stSN
};
return CallApi(url, request, "CodeSoftPrint", PlcData, PLC_Status.CodeSoftPrint);
@@ -762,7 +765,7 @@ namespace WindowsFormsApp1.server
{
new SNInfoItem()
{
SN = PlcData.Read_MaterialCode0,
SN = PlcData.Write_stSN,
Result = result,
DC_INFO = new List<DCInfoItem>(),
CompList = new List<CompListItem>()
@@ -796,21 +799,21 @@ namespace WindowsFormsApp1.server
Value = Init.airtight.Leak_Value ?? "0",
Result = result
});
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{Init.airtight.Airtight_Value},{Init.airtight.Leak_Value}");
CsvLogger.Log($"{PlcData.Write_stSN},{Init.airtight.Airtight_Value},{Init.airtight.Leak_Value}");
}
//扭力,角度
if ("ScrewE,Assy2,Assy3,ScrewS,ScrewM,ScrewTC".Contains(stationid))
{
var count = OtherData.FinalAngleValue.Count(x => x > 0);
for(int i = 0; i < count; i++)
for (int i = 0; i < count; i++)
{
if ("Assy2,Assy3".Contains(stationid))
{
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{OtherData.FinalAngleValue[i]},{OtherData.FinalTorqueValue[i]},{logresult}");
CsvLogger.Log($"{PlcData.Write_stSN},{OtherData.FinalAngleValue[i]},{OtherData.FinalTorqueValue[i]},{logresult}");
}
else
{
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{OtherData.FinalAngleValue[i]},{OtherData.FinalTorqueValue[i]}");
CsvLogger.Log($"{PlcData.Write_stSN},{OtherData.FinalAngleValue[i]},{OtherData.FinalTorqueValue[i]}");
}
}
@@ -850,7 +853,7 @@ namespace WindowsFormsApp1.server
sninfo.DC_INFO.Add(dcInfo);
if (!"Assy2,Assy3,Sealant".Contains(stationid))
{
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{logresult}");
CsvLogger.Log($"{PlcData.Write_stSN},{logresult}");
}
//LogExecute.SNlogNet.WriteDebug($"追溯码:{PlcData.Read_MaterialCode0},检测结果:{logresult}");
}
@@ -865,8 +868,8 @@ namespace WindowsFormsApp1.server
dcInfo.Result = result;
sninfo.DC_INFO.Add(dcInfo);
str += $"{PlcData.Read_MaterialCode0},{dcInfo.Value}";
str += $"{PlcData.Write_stSN},{dcInfo.Value}";
dcInfo = new DCInfoItem();
dcInfo.Item = $"Hold_Time";
dcInfo.Value = PlcData.Read_Other0.ToString() ?? "0";
@@ -880,7 +883,7 @@ namespace WindowsFormsApp1.server
if ("Curing".Contains(stationid))
{
SQLiteHelper<t_materialcall> materialHelper = new db.SQLiteHelper<t_materialcall>();
var material = materialHelper.QuerySingle(x => x.materialid == PlcData.Read_MaterialCode0);
var material = materialHelper.QuerySingle(x => x.materialid == PlcData.Write_stSN);
if (material.Success)
{
// 计算加热时间
@@ -900,7 +903,7 @@ namespace WindowsFormsApp1.server
Down = "75",
Result = result
});
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{PlcData.Read_UploadData0.ToString()},{jrTime}");
CsvLogger.Log($"{PlcData.Write_stSN},{PlcData.Read_UploadData0.ToString()},{jrTime}");
}
else
{
@@ -915,7 +918,7 @@ namespace WindowsFormsApp1.server
dcInfo.Value = PlcData.Read_UploadData0.ToString();
dcInfo.Result = result;
//LogExecute.SNlogNet.WriteDebug($"{PlcData.Read_MaterialCode0},{dcInfo.Item},{dcInfo.Value}");
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{dcInfo.Value}");
CsvLogger.Log($"{PlcData.Write_stSN},{dcInfo.Value}");
sninfo.DC_INFO.Add(dcInfo);
}
@@ -926,14 +929,14 @@ namespace WindowsFormsApp1.server
dcInfo.Item = $"{stationid}_Weight";
dcInfo.Value = PlcData.Read_UploadData0.ToString();
dcInfo.Result = result;
sninfo.DC_INFO.Add(dcInfo);
dcInfo = new DCInfoItem();
dcInfo.Item = $"{stationid}_Width";
dcInfo.Value = PlcData.Read_UploadData1.ToString();
dcInfo.Result = result;
CsvLogger.Log($"{PlcData.Read_MaterialCode0},{PlcData.Read_UploadData0.ToString()},{PlcData.Read_UploadData1.ToString()},{logresult}");
CsvLogger.Log($"{PlcData.Write_stSN},{PlcData.Read_UploadData0.ToString()},{PlcData.Read_UploadData1.ToString()},{logresult}");
sninfo.DC_INFO.Add(dcInfo);
}
+2
View File
@@ -13,6 +13,8 @@ namespace WindowsFormsApp1.server
public static ILogNet PlclogNet = new LogNetDateTime("C:\\Log\\PlcLogs", GenerateMode.ByEveryDay);
public static ILogNet ApilogNet = new LogNetDateTime("C:\\Log\\Apilogs", GenerateMode.ByEveryHour);
public static ILogNet SNlogNet = new LogNetDateTime("C:\\Log\\SNlogs", GenerateMode.ByEveryDay);
public static ILogNet OEElogNet = new LogNetDateTime("C:\\Log\\Apilogs", GenerateMode.ByEveryDay);
public static HslCommunication.BasicFramework.SoftNumericalOrder softNumericalOrder = new HslCommunication.BasicFramework.SoftNumericalOrder("", "yyyyMMdd", 4, @"\numericalOrder.txt");
public LogExecute()