har error 和日志更新

This commit is contained in:
Admin
2025-04-29 15:22:54 +08:00
parent 95bc9ce3b3
commit 6c1d86619e
5 changed files with 44 additions and 27 deletions

View File

@ -653,9 +653,9 @@ namespace DHSoftware
detectionConfig.IsEnabled = detection.IsEnabled;
detectionConfig.ImageSaveDirectory = "D://Projects//Images";
detectionConfig.ShowLocation.X = (i + 1) % 5 + (i + 1) / 5;
// detectionConfig.ShowLocation.X = detection.ShowLocation.X;
detectionConfig.ShowLocation.Y = (i + 1) / 5 + 1;
// 优化后代码
detectionConfig.ShowLocation.X = (i % 5) + 1; // X坐标从1开始每行1-5
detectionConfig.ShowLocation.Y = (i / 5) + 1; // Y坐标从1开始每5个换行
// detectionConfig.ShowLocation.Y = detection.ShowLocation.Y;
DetectionConfigs.Add(detectionConfig);
}
@ -998,8 +998,7 @@ namespace DHSoftware
// 处理按钮状态变化
if (startPressed)
{
PLC.TurnSpeed(0);
PLC.TurnStart(false);
HandleStartButton();
}
if (resetPressed)
@ -1015,7 +1014,7 @@ namespace DHSoftware
//EmergencyStop(null, null, null);
}
Thread.Sleep(50);
Thread.Sleep(100);
}
catch (Exception ex)
{
@ -1394,15 +1393,15 @@ namespace DHSoftware
//转盘2 的物料是不是重新覆盖之前的pDta
if (axisIndex == 1)
{
ProductData pData = new ProductData("", pieceNumber, ProductBaseCount);
ProductData pData = new ProductData(BatchNO, pieceNumber, ProductBaseCount);
_productLists[index][pieceNumber] = pData;
LogAsync(DateTime.Now, LogLevel.Action, $">> {axisIndex}新产品{pieceNumber}加入队列{index}----板卡计数{PieceCount}");
LogAsync(DateTime.Now, LogLevel.Action, $">> 转盘{axisIndex}新产品{pieceNumber}加入队列{index}----计数{PieceCount}");
}
DateTime dtNow = DateTime.Now;
UpdateCT(null, (float)(dtNow - _ctTime).TotalSeconds);
_ctTime = dtNow;
//DateTime dtNow = DateTime.Now;
//UpdateCT(null, (float)(dtNow - _ctTime).TotalSeconds);
// _ctTime = dtNow;
}
public async Task UpdateCT(object objData, float ctTime)

View File

@ -55,7 +55,7 @@
this.tsmiClearLog.Name = "tsmiClearLog";
this.tsmiClearLog.Size = new System.Drawing.Size(124, 22);
this.tsmiClearLog.Text = "清空日志";
this.tsmiClearLog.Click += new System.EventHandler(this.tsmiClearLog_Click);
// this.tsmiClearLog.Click += new System.EventHandler(this.tsmiClearLog_Click);
//
// menuStrip1
//

View File

@ -30,8 +30,11 @@ namespace DHSoftware.Views
#region
private const string SOURCE_PROCESS = "流程";
private const int LOG_NUM_LIMIT = 2000;
private const int BATCH_SIZE = 50;
private const int PROCESS_INTERVAL = 100;
// private const int BATCH_SIZE = 50;
// 调整常量配置
private const int BATCH_SIZE = 100; // 从50提升到100
private const int PROCESS_INTERVAL = 200; // 从100ms调整到200ms
// private const int PROCESS_INTERVAL = 100;
private const int FIRST_COL_WIDTH = 120;
#endregion