1
This commit is contained in:
parent
0d2e37a0a0
commit
3926ec6158
@ -1609,8 +1609,7 @@ namespace ViewModel
|
||||
|
||||
if (lastMsg != TestRecStr)
|
||||
{
|
||||
CacheLineList[1].State.StatuInfo = lastMsg;
|
||||
CacheLineList[0].State.StatuInfo = TestRecStr;
|
||||
|
||||
msgNumber++;
|
||||
info = new RecordInfo() { Number = msgNumber, HappenTime = DateTime.Now, Describe = TestRecStr };
|
||||
//异步新增项 这是微软的BUG 只能这么麻烦了
|
||||
@ -1704,9 +1703,9 @@ namespace ViewModel
|
||||
|
||||
//流线物料状态
|
||||
//ProduceLineList[0].State.StatusBackground = InputList[41].LightUp ? ColorStr.Green : ColorStr.Gray;
|
||||
ProduceLineList[1].State.StatusBackground = InputList[42].LightUp ? ColorStr.Green : ColorStr.Gray;
|
||||
// CacheLineList[0].State.StatusBackground = InputList[43].LightUp ? ColorStr.Green : ColorStr.Gray;
|
||||
CacheLineList[1].State.StatusBackground = InputList[44].LightUp ? ColorStr.Green : ColorStr.Gray;
|
||||
// ProduceLineList[1].State.StatusBackground = InputList[42].LightUp ? ColorStr.Green : ColorStr.Gray;
|
||||
// CacheLineList[0].State.StatusBackground = InputList[43].LightUp ? ColorStr.Green : ColorStr.Gray;
|
||||
// CacheLineList[1].State.StatusBackground = InputList[44].LightUp ? ColorStr.Green : ColorStr.Gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2161,151 +2160,151 @@ namespace ViewModel
|
||||
/// 缓存取料运行
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool CacheTakeRun(FlowModel MyFlow)
|
||||
{
|
||||
bool bl = false;
|
||||
switch (MyFlow.RunStep)
|
||||
{
|
||||
case GengralProcessEnum.Start:
|
||||
//获取可以取料的吸嘴
|
||||
CurrXizui = XizuiLabelPaperList[0];
|
||||
if (CurrXizui.State.StatusBackground == ColorStr.White)
|
||||
{
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
bl = true;
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step1:
|
||||
CacheHand = CacheLineList.Where(w => w.State.StatusBackground == ColorStr.Green).FirstOrDefault();
|
||||
//获取可以取料的缓存产品
|
||||
if (CacheHand != null)
|
||||
{
|
||||
//获取取料点
|
||||
TempPoint = Coper(CacheHand.PutProPoint1);
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step2:
|
||||
//发送机器人点位
|
||||
Robot.RunRobotPoint(TempPoint);
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
break;
|
||||
case GengralProcessEnum.Step3:
|
||||
//机器人到位
|
||||
if (Robot.RcvShowInfo.Contains("runpointok"))
|
||||
{
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else if (TimeOutValidation(MyFlow.RunTime, 20000, "机器人到位超时"))
|
||||
{
|
||||
MyFlow.RunStep--;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step4:
|
||||
//气缸下降
|
||||
CurrXizui.QiGang.Switchs = true;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
break;
|
||||
case GengralProcessEnum.Step5:
|
||||
//气缸下降到位
|
||||
if (CurrXizui.QiGangDown.LightUp)
|
||||
{
|
||||
//真空吸
|
||||
if (!CurrentMachine.RunningMode)
|
||||
{
|
||||
CurrXizui.VacuumSwitch.Switchs = true;
|
||||
}
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else if (TimeOutValidation(MyFlow.RunTime, 3000, CurrXizui.QiGangDown.InputMeaning + "异常"))
|
||||
{
|
||||
//气缸下降
|
||||
CurrXizui.QiGang.Switchs = true;
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step6:
|
||||
//真空检知有
|
||||
if (CurrXizui.VacuumCheck.LightUp || CurrentMachine.RunningMode)
|
||||
{
|
||||
CurrXizui.QiGang.Switchs = false; //气缸上升
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else if (TimeOutValidation(MyFlow.RunTime, 3000, CurrXizui.VacuumCheck.InputMeaning + "异常"))
|
||||
{
|
||||
//真空吸
|
||||
if (!CurrentMachine.RunningMode)
|
||||
{
|
||||
CurrXizui.VacuumSwitch.Switchs = true;
|
||||
}
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step7:
|
||||
//气缸上升到位
|
||||
if (CurrXizui.QiGangUp.LightUp)
|
||||
{
|
||||
//二次检查真空
|
||||
if (CurrXizui.VacuumCheck.LightUp || CurrentMachine.RunningMode)
|
||||
{
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else if (TimeOutValidation(MyFlow.RunTime, 3000, CurrXizui.VacuumCheck.InputMeaning + "异常"))
|
||||
{
|
||||
MyFlow.RunStep = GengralProcessEnum.Step4;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
else if (TimeOutValidation(MyFlow.RunTime, 3000, CurrXizui.QiGangUp.InputMeaning + "超时"))
|
||||
{
|
||||
CurrXizui.QiGang.Switchs = false; //气缸上升
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step8:
|
||||
//获取待机位
|
||||
TempPoint = Coper(Robot.RobotPointList.Where(w => w.PointType == 1).FirstOrDefault());
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
break;
|
||||
case GengralProcessEnum.Step9:
|
||||
//发送机器人点位
|
||||
Robot.RunRobotPoint(TempPoint);
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
break;
|
||||
case GengralProcessEnum.Step10:
|
||||
//机器人到位
|
||||
if (Robot.RcvShowInfo.Contains("runpointok"))
|
||||
{
|
||||
//机械手状态变成有料
|
||||
CurrXizui.State.StatusBackground = ColorStr.Blue;
|
||||
InCacheList[0].State.StatusBackground = ColorStr.White;
|
||||
MyFlow.RunStep = GengralProcessEnum.End;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
bl = true;
|
||||
}
|
||||
else if (TimeOutValidation(MyFlow.RunTime, 20000, "机器人到位超时"))
|
||||
{
|
||||
MyFlow.RunStep--;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
}
|
||||
//private bool CacheTakeRun(FlowModel MyFlow)
|
||||
//{
|
||||
// bool bl = false;
|
||||
// switch (MyFlow.RunStep)
|
||||
// {
|
||||
// case GengralProcessEnum.Start:
|
||||
// //获取可以取料的吸嘴
|
||||
// CurrXizui = XizuiLabelPaperList[0];
|
||||
// if (CurrXizui.State.StatusBackground == ColorStr.White)
|
||||
// {
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// bl = true;
|
||||
// }
|
||||
// break;
|
||||
// case GengralProcessEnum.Step1:
|
||||
// CacheHand = CacheLineList.Where(w => w.State.StatusBackground == ColorStr.Green).FirstOrDefault();
|
||||
// //获取可以取料的缓存产品
|
||||
// if (CacheHand != null)
|
||||
// {
|
||||
// //获取取料点
|
||||
// TempPoint = Coper(CacheHand.PutProPoint1);
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// break;
|
||||
// case GengralProcessEnum.Step2:
|
||||
// //发送机器人点位
|
||||
// Robot.RunRobotPoint(TempPoint);
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// break;
|
||||
// case GengralProcessEnum.Step3:
|
||||
// //机器人到位
|
||||
// if (Robot.RcvShowInfo.Contains("runpointok"))
|
||||
// {
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// else if (TimeOutValidation(MyFlow.RunTime, 20000, "机器人到位超时"))
|
||||
// {
|
||||
// MyFlow.RunStep--;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// break;
|
||||
// case GengralProcessEnum.Step4:
|
||||
// //气缸下降
|
||||
// CurrXizui.QiGang.Switchs = true;
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// break;
|
||||
// case GengralProcessEnum.Step5:
|
||||
// //气缸下降到位
|
||||
// if (CurrXizui.QiGangDown.LightUp)
|
||||
// {
|
||||
// //真空吸
|
||||
// if (!CurrentMachine.RunningMode)
|
||||
// {
|
||||
// CurrXizui.VacuumSwitch.Switchs = true;
|
||||
// }
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// else if (TimeOutValidation(MyFlow.RunTime, 3000, CurrXizui.QiGangDown.InputMeaning + "异常"))
|
||||
// {
|
||||
// //气缸下降
|
||||
// CurrXizui.QiGang.Switchs = true;
|
||||
// }
|
||||
// break;
|
||||
// case GengralProcessEnum.Step6:
|
||||
// //真空检知有
|
||||
// if (CurrXizui.VacuumCheck.LightUp || CurrentMachine.RunningMode)
|
||||
// {
|
||||
// CurrXizui.QiGang.Switchs = false; //气缸上升
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// else if (TimeOutValidation(MyFlow.RunTime, 3000, CurrXizui.VacuumCheck.InputMeaning + "异常"))
|
||||
// {
|
||||
// //真空吸
|
||||
// if (!CurrentMachine.RunningMode)
|
||||
// {
|
||||
// CurrXizui.VacuumSwitch.Switchs = true;
|
||||
// }
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// break;
|
||||
// case GengralProcessEnum.Step7:
|
||||
// //气缸上升到位
|
||||
// if (CurrXizui.QiGangUp.LightUp)
|
||||
// {
|
||||
// //二次检查真空
|
||||
// if (CurrXizui.VacuumCheck.LightUp || CurrentMachine.RunningMode)
|
||||
// {
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// else if (TimeOutValidation(MyFlow.RunTime, 3000, CurrXizui.VacuumCheck.InputMeaning + "异常"))
|
||||
// {
|
||||
// MyFlow.RunStep = GengralProcessEnum.Step4;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// }
|
||||
// else if (TimeOutValidation(MyFlow.RunTime, 3000, CurrXizui.QiGangUp.InputMeaning + "超时"))
|
||||
// {
|
||||
// CurrXizui.QiGang.Switchs = false; //气缸上升
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// break;
|
||||
// case GengralProcessEnum.Step8:
|
||||
// //获取待机位
|
||||
// TempPoint = Coper(Robot.RobotPointList.Where(w => w.PointType == 1).FirstOrDefault());
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// break;
|
||||
// case GengralProcessEnum.Step9:
|
||||
// //发送机器人点位
|
||||
// Robot.RunRobotPoint(TempPoint);
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// break;
|
||||
// case GengralProcessEnum.Step10:
|
||||
// //机器人到位
|
||||
// if (Robot.RcvShowInfo.Contains("runpointok"))
|
||||
// {
|
||||
// //机械手状态变成有料
|
||||
// CurrXizui.State.StatusBackground = ColorStr.Blue;
|
||||
// InCacheList[0].State.StatusBackground = ColorStr.White;
|
||||
// MyFlow.RunStep = GengralProcessEnum.End;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// bl = true;
|
||||
// }
|
||||
// else if (TimeOutValidation(MyFlow.RunTime, 20000, "机器人到位超时"))
|
||||
// {
|
||||
// MyFlow.RunStep--;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
|
||||
return bl;
|
||||
}
|
||||
// return bl;
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region 分选产品
|
||||
@ -2435,8 +2434,7 @@ namespace ViewModel
|
||||
{
|
||||
BadLineRun = true;
|
||||
}
|
||||
CacheLineList[0].State.StatusBackground=ColorStr.Green;//良品皮带
|
||||
ProduceLineList[0].State.StatusBackground = ColorStr.Green;//缓存皮带
|
||||
|
||||
CurrXizui.State = new ShowInfo();
|
||||
ClearBox = false; //清料完成
|
||||
MyFlow.RunStep = GengralProcessEnum.Start;
|
||||
@ -2779,7 +2777,7 @@ namespace ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
MyFlow.RunStep= GengralProcessEnum.Step6;
|
||||
MyFlow.RunStep = GengralProcessEnum.Step6;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
@ -4569,8 +4567,7 @@ namespace ViewModel
|
||||
|
||||
ClearBox = false;
|
||||
|
||||
CacheLineList[0].State.StatusBackground = ColorStr.Gray;//良品皮带
|
||||
ProduceLineList[0].State.StatusBackground = ColorStr.Gray;//缓存皮带
|
||||
|
||||
//MyVehicleBox.ForEach(w => w.State.StatusBackground = ColorStr.White);
|
||||
|
||||
//重置吸嘴状态
|
||||
@ -5236,7 +5233,7 @@ namespace ViewModel
|
||||
MyFlow.OutCmd.Switchs = false;
|
||||
MyFlow.ProductPut = false;
|
||||
//流线检知状态,感应器有料状态需要持续1S
|
||||
if (MyFlow.InSignal.LightUp && MyFlow.OutSignal.LightUp )
|
||||
if (MyFlow.InSignal.LightUp && MyFlow.OutSignal.LightUp)
|
||||
{
|
||||
ExcepStop($"{MyFlow.InSignal.InputMeaning} 和 {MyFlow.OutSignal.InputMeaning} 不能同时有料,请取出一个 ");
|
||||
}
|
||||
@ -5255,7 +5252,7 @@ namespace ViewModel
|
||||
else
|
||||
{
|
||||
MyFlow.ProductPut = true;
|
||||
CacheLineList[0].State.StatusBackground = ColorStr.Gray;
|
||||
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
@ -5275,29 +5272,27 @@ namespace ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CacheLineList[0].State.StatusBackground == ColorStr.Green)
|
||||
{
|
||||
|
||||
MyFlow.OutCmd.Switchs = true;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step10:
|
||||
//后站回复要料
|
||||
if (NextStationReceive.OutProducrOK && NextStationReceive.Running || OfflineMode)
|
||||
{
|
||||
if (CacheLineList[0].State.StatusBackground == ColorStr.Green)
|
||||
{
|
||||
|
||||
MyFlow.OutCmd.Switchs = true; //流线
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
|
||||
}
|
||||
else if (!MyFlow.OutSignal.LightUp)
|
||||
{
|
||||
//感应器2S无信号
|
||||
if (MyFlow.RunTime.AddSeconds(2) <= DateTime.Now)
|
||||
{
|
||||
MyFlow.RunStep=GengralProcessEnum.Step1;
|
||||
MyFlow.RunStep = GengralProcessEnum.Step1;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
@ -5347,7 +5342,7 @@ namespace ViewModel
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step13:
|
||||
CacheLineList[0].State.StatusBackground = ColorStr.Gray;//良品皮带
|
||||
|
||||
NextStationSend.RequestOut = false; //撤销
|
||||
MyFlow.RunStep = GengralProcessEnum.Start;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
@ -5380,7 +5375,7 @@ namespace ViewModel
|
||||
{
|
||||
ExcepStop($"{MyFlow.InSignal.InputMeaning} 和 {MyFlow.OutSignal.InputMeaning} 不能同时有料,请取出一个 ");
|
||||
}
|
||||
else if (MyFlow.InSignal.LightUp) //入料检知有
|
||||
else if (MyFlow.InSignal.LightUp && PutLock == false) //入料检知有
|
||||
{
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
@ -5396,7 +5391,7 @@ namespace ViewModel
|
||||
else //流线检知无,等待机械手放料
|
||||
{
|
||||
MyFlow.ProductPut = true;
|
||||
ProduceLineList[0].State.StatusBackground = ColorStr.Gray;
|
||||
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step2:
|
||||
@ -5415,25 +5410,23 @@ namespace ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ProduceLineList[0].State.StatusBackground == ColorStr.Green)
|
||||
{
|
||||
MyFlow.OutCmd.Switchs = true;
|
||||
}
|
||||
|
||||
|
||||
MyFlow.OutCmd.Switchs = true;
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step10:
|
||||
//后站要料,出料
|
||||
if (NextStationReceive.RequestCache && NextStationReceive.Running)
|
||||
{
|
||||
if (ProduceLineList[0].State.StatusBackground == ColorStr.Green)
|
||||
{
|
||||
|
||||
MyFlow.OutCmd.Switchs = true; //流线
|
||||
NextStationSend.RequestCacheAchieve = true; //回复出料信号
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step11:
|
||||
@ -5475,7 +5468,7 @@ namespace ViewModel
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step13:
|
||||
ProduceLineList[0].State.StatusBackground = ColorStr.Gray;
|
||||
|
||||
NextStationSend.RequestCacheAchieve = false; //撤销出料请求
|
||||
MyFlow.RunStep = GengralProcessEnum.Start;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
@ -5499,6 +5492,8 @@ namespace ViewModel
|
||||
/// 前后站状态集合
|
||||
/// </summary>
|
||||
public List<HandModel> StationStateList { get; set; }
|
||||
public bool PutLock { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 前后站状态Grid
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user