|
|
|
@ -743,8 +743,15 @@ namespace ProductionSystem.Forms
|
|
|
|
|
Thread.Sleep(Program.ReadPlcRate);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if(txtProductCode)
|
|
|
|
|
//ClearMiddleData
|
|
|
|
|
|
|
|
|
|
if (txtProductCode.Text.Contains("暂无条码") || txtProductCode.Text== "12345889" || txtProductCode.Text=="")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
CleanMiddleData("BZ1");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var d1300Value = GetPlcValue("D1300");
|
|
|
|
@ -2016,7 +2023,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
|
|
|
|
|
middleMyTestResultControls[j].TestResultBackColor = Color.Green;
|
|
|
|
|
|
|
|
|
|
SetColor(middleMyTestResultControls[j], head);
|
|
|
|
|
SetColor(middleMyTestResultControls[j], head, result);
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2042,13 +2049,70 @@ namespace ProductionSystem.Forms
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void SetColor(MyTestResultControl control, int status)
|
|
|
|
|
private void CleanMiddleData(string paraCategory)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var groupControls = middleFlowLayoutPanel.Controls.OfType<GroupControl>().FirstOrDefault(m => m.Tag.ToString().Contains(paraCategory));
|
|
|
|
|
var tagDict = GetTagDict();
|
|
|
|
|
//如果有GroupControl控件,设置突出颜色
|
|
|
|
|
if (groupControls != null)
|
|
|
|
|
{
|
|
|
|
|
var layOutControl = groupControls.Controls.OfType<LayoutControl>().FirstOrDefault(m => m.Name.Contains(paraCategory));
|
|
|
|
|
|
|
|
|
|
//var entity = Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == ls[i - 1]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (layOutControl != null)
|
|
|
|
|
{
|
|
|
|
|
var middleMyTestResultControls = layOutControl.Controls.OfType<MyTestResultControl>().ToList();
|
|
|
|
|
if (middleMyTestResultControls.Any())
|
|
|
|
|
{
|
|
|
|
|
for (int j = 0; j < middleMyTestResultControls.Count; j++)
|
|
|
|
|
{
|
|
|
|
|
if (middleMyTestResultControls[j].IsHandleCreated && !middleMyTestResultControls[j].IsDisposed)
|
|
|
|
|
{
|
|
|
|
|
var result = string.Empty;
|
|
|
|
|
var val = string.Empty;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.Invoke(new Action(() =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetColor(middleMyTestResultControls[j], -1,"0.000");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Error(ex, $"给中间部分控件赋值时异常!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void SetColor(MyTestResultControl control, int status,string testValText)
|
|
|
|
|
{
|
|
|
|
|
switch (status)
|
|
|
|
|
{
|
|
|
|
|
case -1:
|
|
|
|
|
case 0:
|
|
|
|
|
control.TestResultBackColor = Color.LightGray;
|
|
|
|
|
control.TestResultText = "空闲";
|
|
|
|
|
control.TestValText = testValText;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
control.TestResultBackColor = Color.Green;
|
|
|
|
@ -2060,7 +2124,7 @@ namespace ProductionSystem.Forms
|
|
|
|
|
control.TestResultText = "NG";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
control.TestResultBackColor = Color.Red;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|