Commit 0f891719 刘韬

增加判断x光点亮电流判断

1 个父辈 eac2c556
...@@ -184,6 +184,7 @@ namespace DeviceLibrary ...@@ -184,6 +184,7 @@ namespace DeviceLibrary
[HandleProcessCorruptedStateExceptions] [HandleProcessCorruptedStateExceptions]
public static (List<CodeInfo>, string) CameraScan(List<string> cameraNameList) public static (List<CodeInfo>, string) CameraScan(List<string> cameraNameList)
{ {
Thread.CurrentThread.Priority = ThreadPriority.Highest;
HashSet<string> codestr = new HashSet<string>(); HashSet<string> codestr = new HashSet<string>();
List<CodeInfo> codeList = new List<CodeInfo>(); List<CodeInfo> codeList = new List<CodeInfo>();
string bitmapfilename = ""; string bitmapfilename = "";
......
...@@ -80,7 +80,7 @@ namespace DeviceLibrary ...@@ -80,7 +80,7 @@ namespace DeviceLibrary
{ {
CountMoveInfo.NextMoveStep(MoveStep.Count_04); CountMoveInfo.NextMoveStep(MoveStep.Count_04);
CountMoveInfo.log($"打开X光"); CountMoveInfo.log($"打开X光");
CountMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(Setting_Init.XRay_Light_Delay));
return; return;
} }
else { else {
...@@ -116,6 +116,18 @@ namespace DeviceLibrary ...@@ -116,6 +116,18 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.Count_04: case MoveStep.Count_04:
var runtimedata = RobotManage.XRay.GetRuntimeData();
if (runtimedata.HighVoltage > Setting_Init.XRay_Voltage * 0.8
&& runtimedata.BeamCurrent > Setting_Init.XRay_Current * 0.7)
{
CountMoveInfo.log("X光点亮成功:" + runtimedata);
}
else if (CountMoveInfo.IsTimeOut(5)) {
CountMoveInfo.NextMoveStep(MoveStep.Count_03);
RobotManage.XRay.Stop();
CountMoveInfo.log("X光超时未打到电压电流.重新打开:"+ runtimedata);
return;
}
if (ScanTask.IsCompleted) if (ScanTask.IsCompleted)
{ {
var (x,s) = ScanTask.Result; var (x,s) = ScanTask.Result;
...@@ -133,6 +145,7 @@ namespace DeviceLibrary ...@@ -133,6 +145,7 @@ namespace DeviceLibrary
CountMoveInfo.MoveParam.IsNg = false; CountMoveInfo.MoveParam.IsNg = false;
CountMoveInfo.MoveParam.codeInfos = x; CountMoveInfo.MoveParam.codeInfos = x;
CountMoveInfo.MoveParam.bitmapfilename = s; CountMoveInfo.MoveParam.bitmapfilename = s;
CountMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(Setting_Init.XRay_Light_Delay));
xrayimageretry = 0; xrayimageretry = 0;
var cc = x.Select((a) => a.CodeType+":"+a.CodeStr); var cc = x.Select((a) => a.CodeType+":"+a.CodeStr);
LastCode = String.Join("##", cc); LastCode = String.Join("##", cc);
...@@ -221,6 +234,7 @@ namespace DeviceLibrary ...@@ -221,6 +234,7 @@ namespace DeviceLibrary
{ {
CountMoveInfo.log($"获取图像,开始点料 IsRayOpen:{RobotManage.XRay.IsRayOpen}"); CountMoveInfo.log($"获取图像,开始点料 IsRayOpen:{RobotManage.XRay.IsRayOpen}");
GetResultTask = Task.Run(() => { GetResultTask = Task.Run(() => {
Thread.CurrentThread.Priority = ThreadPriority.BelowNormal;
string reelid = CountMoveInfo.MoveParam.ReeID; string reelid = CountMoveInfo.MoveParam.ReeID;
int count = GetCountResult(); int count = GetCountResult();
lock (CountList) lock (CountList)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!