This commit is contained in:
Admin 2026-05-14 20:20:31 +08:00
parent 06461e6e25
commit 1a48b96320
2 changed files with 43 additions and 11 deletions

View File

@ -33,7 +33,7 @@
<MenuItem Header="生产数据清零" Background="AliceBlue" Foreground="Black" Visibility="{Binding AllVis}" Command="{Binding CountClearedCommand}"/>
<!--<CheckBox Content="不进行MES验证" IsChecked="{Binding MesCheck}" FontFamily="楷体"></CheckBox>
<CheckBox Content="不上传数据" IsChecked="{Binding NoUpData}" FontFamily="楷体"></CheckBox>-->
<CheckBox Content="启用安全门" IsChecked="{Binding AnQuanDoor}" Visibility="{Binding AllVis}" FontFamily="楷体"></CheckBox>
<ComboBox Background="#4CFFFFFF" ItemsSource="{Binding EnableMachineList}" DisplayMemberPath="MachineName" SelectedValuePath="ID" SelectedValue="{Binding CurrentMachineID}" VerticalAlignment="Center" HorizontalContentAlignment="Center" Height="26" ></ComboBox>
</MenuItem>
</Menu>

View File

@ -1107,6 +1107,18 @@ namespace ViewModel
}
#endregion
#region 安全门
private bool _AnQuanDoor;
public bool AnQuanDoor
{
get { return _AnQuanDoor; }
set { _AnQuanDoor = value; this.RaisePropertyChanged("AnQuanDoor"); }
}
#endregion
#region 光源串口对象
private SerialCom lightCOM;
/// <summary>
@ -1242,6 +1254,8 @@ namespace ViewModel
//把吸嘴给机器人 避免撞坏吸嘴
Robot.XizuiLabelPaperList = this.XizuiLabelPaperList;
AnQuanDoor = true;
}
/// <summary>
@ -1591,7 +1605,16 @@ namespace ViewModel
//{
// ExcepStop(InputList[4].InputMeaning);
//}
if (AnQuanDoor)
{
for (int i = 8; i <= 11; i++)
{
if (!InputList[i].LightUp)
{
ExcepStop(InputList[i].InputMeaning + "触发");
}
}
}
#endregion
#region 获取轴状态
@ -2817,7 +2840,7 @@ namespace ViewModel
CurrXizui.State.StatusBackground = ColorStr.Yellow;
bl = true;
}
else if (CurrBox != null && !ZhiTongMode) //直通模式不测试
else if (CurrBox != null && !ZhiTongMode && NextStationReceive.RequestCache == false && MyFlow.RunTime.AddSeconds(1)<DateTime.Now) //直通模式不测试
{
MyFlow.RunStep++;
MyFlow.RunTime = DateTime.Now;
@ -2892,11 +2915,13 @@ namespace ViewModel
//机器人到位
if (Robot.RcvShowInfo.Contains("runpointok"))
{
ExcepNoStopClear("机器人到位超时");
MyFlow.RunStep++;
MyFlow.RunTime = DateTime.Now;
}
else if (TimeOutValidation(MyFlow.RunTime, 10000, "机器人到位超时"))
else if (MyFlow.RunTime.AddMilliseconds(2000)<DateTime.Now)
{
ExcepNoStop("机器人到位超时");
MyFlow.RunStep--;
MyFlow.RunTime = DateTime.Now;
}
@ -2964,12 +2989,14 @@ namespace ViewModel
//机器人到位
if (Robot.RcvShowInfo.Contains("runpointok"))
{
ExcepNoStopClear("机器人到位超时");
MyFlow.RunStep++;
MyFlow.RunTime = DateTime.Now;
VisonCount = 0;
}
else if (TimeOutValidation(MyFlow.RunTime, 10000, "机器人到位超时"))
else if (MyFlow.RunTime.AddMilliseconds(2000) < DateTime.Now)
{
ExcepNoStop("机器人到位超时");
MyFlow.RunStep--;
MyFlow.RunTime = DateTime.Now;
}
@ -2984,17 +3011,19 @@ namespace ViewModel
VisonCount++;
if (VisualB.FeatureMatchingIng(RM) || CurrentMachine.RunningMode)
{
CurrXizui.State.StatusBackground = ColorStr.Green;
MyFlow.RunStep = GengralProcessEnum.Start;
MyFlow.RunTime = DateTime.Now;
OutputList[O15下光源控制].Switchs = false;//光源
//记录补偿值
if (Math.Abs(RM.MyROI.ModelFeaturePiont.DeviationX) < 10 && Math.Abs(RM.MyROI.ModelFeaturePiont.DeviationY) < 10)
{
CurrXizui.OfficeX = (double)RM.MyROI.ModelFeaturePiont.DeviationX;
CurrXizui.OfficeY = (double)RM.MyROI.ModelFeaturePiont.DeviationY;
CurrXizui.State.StatusBackground = ColorStr.Green;
MyFlow.RunStep = GengralProcessEnum.Start;
MyFlow.RunTime = DateTime.Now;
}
else
{
@ -3008,7 +3037,7 @@ namespace ViewModel
ExcepStop("下视觉定位失败");
MyFlow.RunStep = GengralProcessEnum.Start;
MyFlow.RunTime = DateTime.Now;
OutputList[O15下光源控制].Switchs = false;//光源
}
}
break;
@ -3661,9 +3690,11 @@ namespace ViewModel
MyFlow.RunStep++;
TestMachine.SendInfo("LOAD_ACK");
MyFlow.RunTime = DateTime.Now;
ExcepNoStopClear("测试机通讯超时");
}
else if (MyFlow.RunTime.AddMilliseconds(1000) <= DateTime.Now)
{
ExcepNoStop("测试机通讯超时");
MyFlow.RunStep--;
MyFlow.RunTime = DateTime.Now;
}
@ -3672,11 +3703,12 @@ namespace ViewModel
if (TestRecStr.Contains("QUERY"))
{
MyFlow.RunStep++;
ExcepNoStopClear("测试机通讯超时");
MyFlow.RunTime = DateTime.Now;
}
else if (MyFlow.RunTime.AddMilliseconds(1000) <= DateTime.Now)
{
ExcepNoStop("测试机通讯超时");
MyFlow.RunStep--;
MyFlow.RunTime = DateTime.Now;
}