dep_yangw
我叫锄头 11 months ago
parent 88dfff2210
commit 70803709f5

@ -1578,20 +1578,23 @@ namespace ProductionSystem.Forms
GetPlc(Program.BZ8, "BZ8"); GetPlc(Program.BZ8, "BZ8");
count++; // count++;
if (count == 5) // if (count == 1)
{ // {
Collect("BZ1"); //
Collect("BZ2"); // count = 0;
Collect("BZ3"); //
Collect("BZ4"); // }
Collect("BZ5");
Collect("BZ6"); Collect("BZ1");
Collect("BZ7"); Collect("BZ2");
Collect("BZ8"); Collect("BZ3");
count = 0; Collect("BZ4");
Collect("BZ5");
Collect("BZ6");
Collect("BZ7");
Collect("BZ8");
}
SetMiddleData("BZ1_DB"); SetMiddleData("BZ1_DB");
SetMiddleData("BZ2_DB"); SetMiddleData("BZ2_DB");
SetMiddleData("BZ3_DB"); SetMiddleData("BZ3_DB");
@ -1616,16 +1619,14 @@ namespace ProductionSystem.Forms
if (entity != null) if (entity != null)
{ {
string productBarCode = ""; string productBarCode = "";
if (txtProductCode.Text == "暂无条码") //2024 暂无条码不插入数据
{ if (txtProductCode.Text.Contains("暂无条码"))
productBarCode = "8888";
}
else
{ {
//处理换行符 return;
productBarCode=txtProductCode.Text;
productBarCode= productBarCode.Replace("\r", "").Replace("\n", "");
} }
//处理换行符
productBarCode=txtProductCode.Text;
productBarCode= productBarCode.Replace("\r", "").Replace("\n", "");
var value = OmronHelper.GetPlcVal(entity.DataType, entity.Address); var value = OmronHelper.GetPlcVal(entity.DataType, entity.Address);
if (value.Item2.ToDouble().ToInt()==1) if (value.Item2.ToDouble().ToInt()==1)
@ -1982,8 +1983,21 @@ namespace ProductionSystem.Forms
val = testVal.val; val = testVal.val;
} }
int head = 0;
if (testResultPoint != null) if (testResultPoint != null)
{ {
if (paraCategory == "BZ1")
{
//电压采集值
if (testResultPoint.Address == "D1200")
{
head = GetPlcValue("D1100").ToDouble().ToInt();
}
}
var testResult = OmronHelper.GetPlcVal(testResultPoint.DataType, testResultPoint.Address); var testResult = OmronHelper.GetPlcVal(testResultPoint.DataType, testResultPoint.Address);
testResultPoint.Val = testResult.val; testResultPoint.Val = testResult.val;
result = testResult.val; result = testResult.val;
@ -2000,6 +2014,8 @@ namespace ProductionSystem.Forms
middleMyTestResultControls[j].TestResultText = "Ok"; middleMyTestResultControls[j].TestResultText = "Ok";
middleMyTestResultControls[j].TestResultBackColor = Color.Green; middleMyTestResultControls[j].TestResultBackColor = Color.Green;
SetColor(middleMyTestResultControls[j], head);
})); }));
} }
} }
@ -2025,6 +2041,27 @@ namespace ProductionSystem.Forms
private void SetColor(MyTestResultControl control, int status)
{
switch (status)
{
case 0:
control.TestResultBackColor = Color.LightGray;
control.TestResultText = "空闲";
break;
case 1:
control.TestResultBackColor = Color.Green;
control.TestResultText = "OK";
break;
case 2:
control.TestResultBackColor = Color.Red;
control.TestResultText = "NG";
break;
}
control.TestResultBackColor = Color.Red;
}
/// <summary> /// <summary>

Loading…
Cancel
Save