提交UPH 准备修改

This commit is contained in:
TD
2025-03-27 15:11:48 +08:00
parent 5d77eebc67
commit 3be4b185d6
4 changed files with 309 additions and 278 deletions

View File

@ -322,10 +322,10 @@ namespace DHSoftware
detectionConfig.ModelHeight = detection.ModelHeight;
detectionConfig.In_lable_path = detection.In_lable_path;
detectionConfig.IsEnabled = detection.IsEnabled;
detectionConfig.ShowLocation.X = (i + 1) % 5+ (i + 1) / 5;
// detectionConfig.ShowLocation.X = detection.ShowLocation.X;
detectionConfig.ShowLocation.Y = (i + 1) / 5+1;
// detectionConfig.ShowLocation.Y = detection.ShowLocation.Y;
detectionConfig.ShowLocation.X = (i + 1) % 5 + (i + 1) / 5;
// detectionConfig.ShowLocation.X = detection.ShowLocation.X;
detectionConfig.ShowLocation.Y = (i + 1) / 5 + 1;
// detectionConfig.ShowLocation.Y = detection.ShowLocation.Y;
DetectionConfigs.Add(detectionConfig);
}
}
@ -513,7 +513,10 @@ namespace DHSoftware
camera.CameraDisConnect();
}
if (PLC != null)
PLC.PLCDisConnect();
{
PLC.CloseProcess();
}
CloseWindow.Instance.Close();// 关闭提示窗口
//Application.Exit();
System.Environment.Exit(0);
@ -582,12 +585,12 @@ namespace DHSoftware
private void StartProcess()
{
ProcessstartTime= DateTime.Now;
lblstarttime.Text = ProcessstartTime.ToString("yyyy-MM-dd HH:mm:ss");
ProcessstartTime = DateTime.Now;
lblstarttime2.Text = ProcessstartTime.ToString("yyyy-MM-dd HH:mm:ss");
//计数清零
PieceCount = 0;
if (PLC?.Enable == true)
{
PLC.OnNewPieces -= MainMotion_NewPieces;
@ -696,10 +699,10 @@ namespace DHSoftware
}
private uint PieceCount = 0;
private List<ConcurrentDictionary<uint, ProductData>> _productLists = new List<ConcurrentDictionary<uint, ProductData>>();
private int ProductListMulti = 2;
@ -902,7 +905,7 @@ namespace DHSoftware
product.ProductResult = product.ResultCollection.Any(u => u.ResultState != ResultState.OK)
? ResultState.B_NG
: ResultState.OK;
if (product.ProductResult == ResultState.OK)
if (product.ProductResult == ResultState.OK)
{
PLC.Blowing(productNumber, 1);
}
@ -1025,10 +1028,9 @@ namespace DHSoftware
//UPM = (int)UPH / 60;
this.BeginInvoke(new MethodInvoker(delegate ()
{
lblNowtime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
label1.Text = UPH.ToString();
lblUPH.Text = UPH.ToString();
lblNum.Text = ProductNum_Total.ToString();
lblNowtime2.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
lblUPH2.Text = UPH.ToString();
lblNum2.Text = ProductNum_Total.ToString();
labuph.Text = UPH.ToString();
}));
}
@ -1061,5 +1063,10 @@ namespace DHSoftware
{
}
private void splitContainer2_Panel1_Paint(object sender, PaintEventArgs e)
{
}
}
}