1
This commit is contained in:
parent
ab45ed87d8
commit
0793a89529
@ -7,9 +7,6 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DAL
|
||||
{
|
||||
@ -834,6 +831,7 @@ namespace DAL
|
||||
mt.ProductionTime = Convert.ToInt64(row["ProductionTime"]);
|
||||
mt.Quantitys = Convert.ToInt32(row["Quantitys"]);
|
||||
mt.Produce = (int)row["Produce"];
|
||||
mt.MyQita = ShareHelp.JsonToObj<QitaPar>( row["MyQita"].ToString());
|
||||
mt.ColoumsNumber = Convert.ToInt32(row["ColoumsNumber"]);
|
||||
mt.RowsNumber = Convert.ToInt32(row["RowsNumber"]);
|
||||
mt.PictureColoumns = Convert.ToInt32(row["PictureColoumns"]);
|
||||
@ -846,7 +844,7 @@ namespace DAL
|
||||
mt.Tray6 = row["Tray6"].ToString();
|
||||
mt.Tray7 = row["Tray7"].ToString();
|
||||
mt.Tray8 = row["Tray8"].ToString();
|
||||
// mt.StandList = GetATSList(mt.ID);
|
||||
// mt.StandList = GetATSList(mt.ID);
|
||||
mt.P_lenght = Convert.ToDouble(row["P_lenght"]);
|
||||
mt.P_width = Convert.ToDouble(row["P_width"]);
|
||||
mt.Lenght_dev = Convert.ToDouble(row["Lenght_dev"]);
|
||||
@ -943,10 +941,11 @@ namespace DAL
|
||||
{
|
||||
try
|
||||
{
|
||||
string sqlstr = "update MachineModel set ProductionTime=@ProductionTime, [Quantitys]=@Quantitys,[Produce]=@Produce where ID=@ID";
|
||||
string sqlstr = "update MachineModel set ProductionTime=@ProductionTime, [Quantitys]=@Quantitys,[Produce]=@Produce,[MyQita]=@MyQita where ID=@ID";
|
||||
return AccHelpers.ExecuteNonQuery(sqlstr, new OleDbParameter("@ProductionTime", mt.ProductionTime),
|
||||
new OleDbParameter("@Quantitys", mt.Quantitys),
|
||||
new OleDbParameter("@Produce", mt.Produce),
|
||||
new OleDbParameter("@MyQita", ShareHelp.ObjToJson(mt.MyQita)),
|
||||
new OleDbParameter("@ID", mt.ID));
|
||||
|
||||
}
|
||||
@ -1003,7 +1002,7 @@ namespace DAL
|
||||
ats.Enableing = Convert.ToBoolean(row["Enableing"]);
|
||||
ats.NgCount = Convert.ToInt32(row["NgCount"]);
|
||||
ats.StandState = ShareHelp.JsonToObj<ShowInfo>(row["StandState"].ToString());
|
||||
ats.Product= ShareHelp.JsonToObj<ShowInfo>(row["Product"].ToString());
|
||||
ats.Product = ShareHelp.JsonToObj<ShowInfo>(row["Product"].ToString());
|
||||
ats.InputQuantity = Convert.ToInt32(row["InputQuantity"]);
|
||||
ats.OutputQuantity = Convert.ToInt32(row["OutputQuantity"]);
|
||||
ats.CTime = Convert.ToInt32(row["CTime"]);
|
||||
@ -1067,7 +1066,7 @@ namespace DAL
|
||||
try
|
||||
{
|
||||
string sqlstr = "insert into StandModel(ParentID,StandName,ShortCode,StandType,StationNo,MachineNumber,PlcID,DeviceID1,DeviceID2,DeviceID3,DeviceID4,DeviceID5,Enableing,NgCount,StandState,Product,InputQuantity,OutputQuantity,CTime,Capacity)values(@ParentID,@StandName,@ShortCode,@StandType,@StationNo,@MachineNumber,@PlcID,@DeviceID1,@DeviceID2,@DeviceID3,@DeviceID4,@DeviceID5,@Enableing,@NgCount,@StandState,@Product,@InputQuantity,@OutputQuantity,@CTime,@Capacity)";
|
||||
int aa= AccHelpers.ExecuteNonQuery(sqlstr, new OleDbParameter("@ParentID", ATS.ParentID),
|
||||
int aa = AccHelpers.ExecuteNonQuery(sqlstr, new OleDbParameter("@ParentID", ATS.ParentID),
|
||||
new OleDbParameter("@StandName", ATS.StandName),
|
||||
new OleDbParameter("@ShortCode", ATS.ShortCode),
|
||||
new OleDbParameter("@StandType", ATS.StandType),
|
||||
@ -1087,7 +1086,7 @@ namespace DAL
|
||||
new OleDbParameter("@OutputQuantity", ATS.OutputQuantity),
|
||||
new OleDbParameter("@CTime", ATS.CTime),
|
||||
new OleDbParameter("@Capacity", ATS.Capacity));
|
||||
if (aa>0)
|
||||
if (aa > 0)
|
||||
{
|
||||
ATS.ID = GetInsertID();
|
||||
}
|
||||
|
||||
@ -70,6 +70,29 @@ namespace Model
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 子流程1
|
||||
/// </summary>
|
||||
public FlowModel NodeFlow1 { get; set; }
|
||||
/// <summary>
|
||||
/// 子流程2
|
||||
/// </summary>
|
||||
public FlowModel NodeFlow2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子流程完成标记1
|
||||
/// </summary>
|
||||
public bool NodeOK1 { get; set; }
|
||||
/// <summary>
|
||||
/// 子流程完成标记2
|
||||
/// </summary>
|
||||
public bool NodeOK2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 流程是否完成
|
||||
/// </summary>
|
||||
public bool bl { get; set; }
|
||||
|
||||
public FlowModel(string name)
|
||||
{
|
||||
MyName = name;
|
||||
|
||||
@ -3,9 +3,6 @@ using Model.MotionControl;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
@ -130,7 +127,9 @@ namespace Model
|
||||
get { return produceBads; }
|
||||
set
|
||||
{
|
||||
produceBads = value;
|
||||
|
||||
produceBads = value;
|
||||
|
||||
this.RaisePropertyChanged("ProduceBads");
|
||||
}
|
||||
}
|
||||
@ -251,7 +250,8 @@ namespace Model
|
||||
public double Lenght_dev
|
||||
{
|
||||
get { return lenght_dev; }
|
||||
set {
|
||||
set
|
||||
{
|
||||
lenght_dev = value;
|
||||
RaisePropertyChanged("Lenght_dev");
|
||||
}
|
||||
@ -264,7 +264,9 @@ namespace Model
|
||||
public double Width_dev
|
||||
{
|
||||
get { return width_dev; }
|
||||
set { width_dev = value;
|
||||
set
|
||||
{
|
||||
width_dev = value;
|
||||
RaisePropertyChanged("Width_dev");
|
||||
}
|
||||
}
|
||||
@ -329,6 +331,26 @@ namespace Model
|
||||
#endregion
|
||||
|
||||
|
||||
private QitaPar _MyQita;
|
||||
public QitaPar MyQita
|
||||
{
|
||||
get { return _MyQita; }
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
_MyQita = value;
|
||||
}
|
||||
else {
|
||||
_MyQita = new QitaPar();
|
||||
|
||||
|
||||
}
|
||||
this.RaisePropertyChanged("MyQita");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public MachineModel()
|
||||
{
|
||||
RejectRatio = 0;
|
||||
@ -337,4 +359,127 @@ namespace Model
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class QitaPar : NotificationObject
|
||||
{
|
||||
|
||||
private int _Total1;
|
||||
public int Total1
|
||||
{
|
||||
get { return _Total1; }
|
||||
set
|
||||
{
|
||||
_Total1 = value;
|
||||
if (value > 0)
|
||||
{
|
||||
|
||||
Yield1 = (double)_OK1 / value;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Yield1 = 0;
|
||||
|
||||
}
|
||||
this.RaisePropertyChanged("Total1");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private double _Yield1;
|
||||
public double Yield1
|
||||
{
|
||||
get { return _Yield1; }
|
||||
set
|
||||
{
|
||||
_Yield1 = value;
|
||||
this.RaisePropertyChanged("Yield1");
|
||||
}
|
||||
}
|
||||
|
||||
private int _OK1;
|
||||
public int OK1
|
||||
{
|
||||
get { return _OK1; }
|
||||
set
|
||||
{
|
||||
_OK1 = value;
|
||||
Total1 = _OK1 + NG1;
|
||||
this.RaisePropertyChanged("OK1");
|
||||
}
|
||||
}
|
||||
|
||||
private int _NG1;
|
||||
public int NG1
|
||||
{
|
||||
get { return _NG1; }
|
||||
set
|
||||
{
|
||||
_NG1 = value;
|
||||
Total1 = _OK1 + NG1;
|
||||
this.RaisePropertyChanged("NG1");
|
||||
}
|
||||
}
|
||||
|
||||
private int _Total2;
|
||||
public int Total2
|
||||
{
|
||||
get { return _Total2; }
|
||||
set
|
||||
{
|
||||
_Total2 = value;
|
||||
if (value > 0)
|
||||
{
|
||||
|
||||
Yield2 = (double)_OK2 / value;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Yield2 = 0;
|
||||
}
|
||||
this.RaisePropertyChanged("Total2");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private int _OK2;
|
||||
public int OK2
|
||||
{
|
||||
get { return _OK2; }
|
||||
set
|
||||
{
|
||||
_OK2 = value;
|
||||
Total2 = _OK2 + NG2;
|
||||
|
||||
this.RaisePropertyChanged("OK2");
|
||||
}
|
||||
}
|
||||
|
||||
private int _NG2;
|
||||
public int NG2
|
||||
{
|
||||
get { return _NG2; }
|
||||
set
|
||||
{
|
||||
_NG2 = value;
|
||||
Total2 = _OK2 + NG2;
|
||||
this.RaisePropertyChanged("NG2");
|
||||
}
|
||||
}
|
||||
|
||||
private double _Yield2;
|
||||
public double Yield2
|
||||
{
|
||||
get { return _Yield2; }
|
||||
set
|
||||
{
|
||||
_Yield2 = value;
|
||||
this.RaisePropertyChanged("Yield2");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -123,7 +123,10 @@ namespace ViewModel
|
||||
CurrentMachine.ProductionTime = 0;
|
||||
CurrentMachine.Produce = 0;
|
||||
dal.UpdateProductionData(CurrentMachine);
|
||||
|
||||
CurrentMachine.MyQita.OK1 = 0;
|
||||
CurrentMachine.MyQita.OK2 = 0;
|
||||
CurrentMachine.MyQita.NG1 = 0;
|
||||
CurrentMachine.MyQita.NG2 = 0;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -1723,23 +1723,41 @@ namespace ViewModel
|
||||
case GengralProcessEnum.Start:
|
||||
GoHomeSteps++;
|
||||
GoHomeTime = DateTime.Now;
|
||||
|
||||
XizuiLabelPaperList[0].QiGang.Switchs = false;
|
||||
XizuiLabelPaperList[1].QiGang.Switchs = false;
|
||||
break;
|
||||
case GengralProcessEnum.Step1:
|
||||
//优先机械手回原点
|
||||
if (Robot != null)
|
||||
int aaa = XizuiLabelPaperList.Where(w => w.QiGangUp.LightUp == true).Count();
|
||||
if (aaa >= 2)
|
||||
{
|
||||
if (Robot.HomeStep == GengralProcessEnum.End)
|
||||
//优先机械手回原点
|
||||
if (Robot != null)
|
||||
{
|
||||
GoHomeSteps++;
|
||||
if (Robot.HomeStep == GengralProcessEnum.End)
|
||||
{
|
||||
GoHomeSteps++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Robot.RobotOrgin();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Robot.RobotOrgin();
|
||||
GoHomeSteps++;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (GoHomeTime.AddSeconds(5) < DateTime.Now)
|
||||
{
|
||||
GoHomeSteps++;
|
||||
foreach (var item in XizuiLabelPaperList)
|
||||
{
|
||||
if (!item.QiGangUp.LightUp)
|
||||
{
|
||||
ExcepStop(item.QiGangUp.InputMeaning + ",异常");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step2:
|
||||
@ -1899,7 +1917,6 @@ namespace ViewModel
|
||||
case GengralProcessEnum.Step5:
|
||||
FrontStationSend.Safe = true;
|
||||
//获取可以投入的测试盒
|
||||
|
||||
if (CurrBox != null)
|
||||
{
|
||||
//指定吸嘴
|
||||
@ -1927,7 +1944,7 @@ namespace ViewModel
|
||||
//产品分选
|
||||
if (AnalysisRun(AnalysisFlow))
|
||||
{
|
||||
MyFlow.RunStep ++;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
@ -2061,27 +2078,27 @@ namespace ViewModel
|
||||
break;
|
||||
case GengralProcessEnum.Step4:
|
||||
//气缸下降
|
||||
CurrXizui.QiGang.Switchs = true;
|
||||
// CurrXizui.QiGang.Switchs = true;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
break;
|
||||
case GengralProcessEnum.Step5:
|
||||
//气缸下降到位
|
||||
if (CurrXizui.QiGangDown.LightUp)
|
||||
//if (CurrXizui.QiGangDown.LightUp)
|
||||
//{
|
||||
//真空吸
|
||||
if (!CurrentMachine.RunningMode)
|
||||
{
|
||||
//真空吸
|
||||
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;
|
||||
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:
|
||||
//真空检知有
|
||||
@ -2793,17 +2810,31 @@ namespace ViewModel
|
||||
break;
|
||||
case GengralProcessEnum.Step1:
|
||||
//获取可以投入的测试盒
|
||||
//CurrBox = TestBenchBox.Where(w => (w.State.StatusBackground == ColorStr.White) || w.State.StatusBackground == ColorStr.Green || w.State.StatusBackground == ColorStr.Red).FirstOrDefault();
|
||||
//if (CurrBox != null && !ZhiTongMode) //直通模式不测试
|
||||
//{
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
//}
|
||||
//else if (CacheLineList[0].State.StatusBackground == ColorStr.White && CacheLineList[1].State.StatusBackground == ColorStr.White) //缓存可放料
|
||||
//{
|
||||
// CurrXizui.State.StatusBackground = ColorStr.Yellow;
|
||||
// bl = true;
|
||||
//}
|
||||
|
||||
CurrBox = TestBenchBox.Where(w => (w.State.StatusBackground == ColorStr.White) || w.State.StatusBackground == ColorStr.Green || w.State.StatusBackground == ColorStr.Red).FirstOrDefault();
|
||||
if (CurrBox != null && !ZhiTongMode) //直通模式不测试
|
||||
{
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else if (CacheLineList[0].State.StatusBackground == ColorStr.White && CacheLineList[1].State.StatusBackground == ColorStr.White) //缓存可放料
|
||||
//优先往后放
|
||||
if (CacheLineList[0].State.StatusBackground == ColorStr.White && CacheLineList[1].State.StatusBackground == ColorStr.White) //缓存可放料
|
||||
{
|
||||
CurrXizui.State.StatusBackground = ColorStr.Yellow;
|
||||
bl = true;
|
||||
}
|
||||
else if (CurrBox != null && !ZhiTongMode) //直通模式不测试
|
||||
{
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
|
||||
break;
|
||||
case GengralProcessEnum.Step2:
|
||||
//获取下视觉扫码点
|
||||
@ -3131,74 +3162,83 @@ namespace ViewModel
|
||||
{
|
||||
case GengralProcessEnum.Start:
|
||||
//获取测试盒取料位
|
||||
|
||||
TempPoint = Coper(CurrBox.TakeProPoint1);
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
MyFlow.NodeFlow1 = new FlowModel("开箱流程");
|
||||
MyFlow.NodeFlow2 = new FlowModel("开箱流程");
|
||||
MyFlow.NodeOK1 = false;
|
||||
MyFlow.NodeOK2 = false;
|
||||
break;
|
||||
case GengralProcessEnum.Step1:
|
||||
//先运行点位,打开测试盒,再检查到位
|
||||
if (Robot.RunRobotPoint(TempPoint))
|
||||
|
||||
MyFlow.NodeOK1 = !MyFlow.NodeOK1 ? OpenBox(MyFlow.NodeFlow1, TestBenchBox[0]) : MyFlow.NodeOK1;
|
||||
MyFlow.NodeOK2 = !MyFlow.NodeOK2 ? OpenBox(MyFlow.NodeFlow2, TestBenchBox[1]) : MyFlow.NodeOK2;
|
||||
if (MyFlow.NodeOK1 && MyFlow.NodeOK2)
|
||||
{
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunStep = GengralProcessEnum.Step5;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
Robot.RunRobotPoint(TempPoint);
|
||||
}
|
||||
else if (MyFlow.RunTime.AddMilliseconds(5000)<DateTime.Now)
|
||||
{
|
||||
MyFlow.RunStep--;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
|
||||
break;
|
||||
case GengralProcessEnum.Step2:
|
||||
//打开测试盒
|
||||
//顶升气缸原位
|
||||
CurrBox.YDingShengQiGangDW.Switchs = false;
|
||||
// CurrBox.YDingShengQiGangYW.Switchs = true;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
break;
|
||||
case GengralProcessEnum.Step3:
|
||||
//顶升气缸原位
|
||||
if (CurrBox.XDingShengQigangYW.LightUp)
|
||||
{
|
||||
//伸缩气缸原位
|
||||
|
||||
//CurrBox.YShenSuoQiGangYW.Switchs = true;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
{
|
||||
ExcepStop(CurrBox.XDingShengQigangYW.InputMeaning + "异常");
|
||||
CurrBox.YDingShengQiGangDW.Switchs = false;
|
||||
//CurrBox.YDingShengQiGangYW.Switchs = true;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step4:
|
||||
|
||||
if (MyFlow.RunTime.AddSeconds(1) < DateTime.Now)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CurrBox.YShenSuoQiGangDW.Switchs = false;
|
||||
//伸缩气缸原位
|
||||
if (CurrBox.XShenSuoQigangYW.LightUp)
|
||||
{
|
||||
//伸缩置位
|
||||
CurrBox.YShenSuoQiGangDW.Switchs = false;
|
||||
//CurrBox.YShenSuoQiGangYW.Switchs = false;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
{
|
||||
ExcepStop(CurrBox.XShenSuoQigangYW.InputMeaning + "异常");
|
||||
//伸缩气缸原位
|
||||
CurrBox.YShenSuoQiGangDW.Switchs = false;
|
||||
//CurrBox.YShenSuoQiGangYW.Switchs = true;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
break;
|
||||
#region 报废
|
||||
//case GengralProcessEnum.Step2:
|
||||
// //打开测试盒
|
||||
// //顶升气缸原位
|
||||
// CurrBox.YDingShengQiGangDW.Switchs = false;
|
||||
// // CurrBox.YDingShengQiGangYW.Switchs = true;
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// break;
|
||||
//case GengralProcessEnum.Step3:
|
||||
// //顶升气缸原位
|
||||
// if (CurrBox.XDingShengQigangYW.LightUp)
|
||||
// {
|
||||
// //伸缩气缸原位
|
||||
// //CurrBox.YShenSuoQiGangYW.Switchs = true;
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
// {
|
||||
// ExcepStop(CurrBox.XDingShengQigangYW.InputMeaning + "异常");
|
||||
// CurrBox.YDingShengQiGangDW.Switchs = false;
|
||||
// //CurrBox.YDingShengQiGangYW.Switchs = true;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// break;
|
||||
//case GengralProcessEnum.Step4:
|
||||
// if (MyFlow.RunTime.AddSeconds(1) < DateTime.Now)
|
||||
// {
|
||||
// CurrBox.YShenSuoQiGangDW.Switchs = false;
|
||||
// //伸缩气缸原位
|
||||
// if (CurrBox.XShenSuoQigangYW.LightUp)
|
||||
// {
|
||||
// //伸缩置位
|
||||
// CurrBox.YShenSuoQiGangDW.Switchs = false;
|
||||
// //CurrBox.YShenSuoQiGangYW.Switchs = false;
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
// {
|
||||
// ExcepStop(CurrBox.XShenSuoQigangYW.InputMeaning + "异常");
|
||||
// //伸缩气缸原位
|
||||
// CurrBox.YShenSuoQiGangDW.Switchs = false;
|
||||
// //CurrBox.YShenSuoQiGangYW.Switchs = true;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
#endregion
|
||||
case GengralProcessEnum.Step5:
|
||||
//机器人到位
|
||||
if (Robot.RcvShowInfo.Contains("runpointok"))
|
||||
@ -3303,6 +3343,132 @@ namespace ViewModel
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 开箱
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool OpenBox(FlowModel MyFlow, HandModel MyHand)
|
||||
{
|
||||
MyFlow.bl = false;
|
||||
switch (MyFlow.RunStep)
|
||||
{
|
||||
case GengralProcessEnum.Start:
|
||||
//顶升气缸原位
|
||||
MyHand.YDingShengQiGangDW.Switchs = false;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
break;
|
||||
case GengralProcessEnum.Step1:
|
||||
//顶升气缸原位
|
||||
if (MyHand.XDingShengQigangYW.LightUp)
|
||||
{
|
||||
//伸缩气缸原位
|
||||
MyHand.YShenSuoQiGangDW.Switchs = false;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
{
|
||||
ExcepStop(MyHand.XDingShengQigangYW.InputMeaning + "异常");
|
||||
MyHand.YDingShengQiGangDW.Switchs = false;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step2:
|
||||
if (MyFlow.RunTime.AddSeconds(1) < DateTime.Now)
|
||||
{
|
||||
//伸缩气缸原位
|
||||
if (MyHand.XShenSuoQigangYW.LightUp)
|
||||
{
|
||||
//伸缩置位
|
||||
MyHand.YShenSuoQiGangDW.Switchs = false;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
MyFlow.bl = true;
|
||||
}
|
||||
else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
{
|
||||
ExcepStop(MyHand.XShenSuoQigangYW.InputMeaning + "异常");
|
||||
//伸缩气缸原位
|
||||
MyHand.YShenSuoQiGangDW.Switchs = false;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return MyFlow.bl;
|
||||
}
|
||||
/// <summary>
|
||||
/// 关箱
|
||||
/// </summary>
|
||||
/// <param name="MyFlow"></param>
|
||||
/// <param name="MyHand"></param>
|
||||
/// <returns></returns>
|
||||
private bool CloseBox(FlowModel MyFlow, HandModel MyHand)
|
||||
{
|
||||
MyFlow.bl = false;
|
||||
switch (MyFlow.RunStep)
|
||||
{
|
||||
case GengralProcessEnum.Start:
|
||||
//已投料
|
||||
//伸缩气缸到位
|
||||
//TestBenchBox[0].YShenSuoQiGangDW.Switchs = true;
|
||||
////TestBenchBox[0].YShenSuoQiGangYW.Switchs = false;
|
||||
//TestBenchBox[1].YShenSuoQiGangDW.Switchs = true;
|
||||
|
||||
MyHand.YShenSuoQiGangDW.Switchs = true;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
break;
|
||||
case GengralProcessEnum.Step1:
|
||||
//伸缩气缸到位
|
||||
if (MyHand.XShenSuoQigangDW.LightUp)
|
||||
{
|
||||
//顶升到位
|
||||
//TestBenchBox[0].YDingShengQiGangDW.Switchs = true;
|
||||
////TestBenchBox[0].YDingShengQiGangYW.Switchs = false;
|
||||
//TestBenchBox[1].YDingShengQiGangDW.Switchs = true;
|
||||
////TestBenchBox[1].YDingShengQiGangYW.Switchs = false;
|
||||
MyHand.YDingShengQiGangDW.Switchs = true;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
{
|
||||
ExcepStop(MyHand.XShenSuoQigangDW.InputMeaning + "异常");
|
||||
MyHand.YDingShengQiGangDW.Switchs = true;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step2:
|
||||
//顶升气缸到位
|
||||
if (MyHand.XDingShengQigangDW.LightUp)
|
||||
{
|
||||
MyFlow.RunStep = GengralProcessEnum.End;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
MyFlow.bl = true;
|
||||
}
|
||||
else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
{
|
||||
ExcepStop(MyHand.XDingShengQigangDW.InputMeaning + "异常");
|
||||
////顶升到位
|
||||
//TestBenchBox[0].YDingShengQiGangDW.Switchs = true;
|
||||
////TestBenchBox[0].YDingShengQiGangYW.Switchs = false;
|
||||
//TestBenchBox[1].YDingShengQiGangDW.Switchs = true;
|
||||
////TestBenchBox[1].YDingShengQiGangYW.Switchs = false;
|
||||
|
||||
MyHand.YDingShengQiGangDW.Switchs = true;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
return MyFlow.bl;
|
||||
}
|
||||
|
||||
#region 搬运出料
|
||||
/// <summary>
|
||||
/// 搬运出料流程
|
||||
@ -3404,8 +3570,6 @@ namespace ViewModel
|
||||
case GengralProcessEnum.End:
|
||||
var t = TestBenchBox.Where(w => w.State.StatusBackground == ColorStr.Yellow).Count();
|
||||
if (t < 2)
|
||||
//CurrTestBox = TestBenchBox.Where(w => w.State.StatusBackground == ColorStr.White && w.Number == 1).FirstOrDefault();
|
||||
|
||||
{
|
||||
MyFlow.RunStep = GengralProcessEnum.Start;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
@ -3415,18 +3579,6 @@ namespace ViewModel
|
||||
case GengralProcessEnum.Start:
|
||||
if (TestMachine.Showmsg.StatusBackground == ColorStr.Green || CurrentMachine.RunningMode)
|
||||
{
|
||||
// MyFlow.RunStep++;
|
||||
// //放满两个产品,开始测试
|
||||
// //if (TestBenchBox.Where(w => w.State.StatusBackground == ColorStr.Yellow).Count() >= 2)
|
||||
// //{
|
||||
// // MyFlow.RunStep = GengralProcessEnum.Step10;
|
||||
// // MyFlow.RunTime = DateTime.Now;
|
||||
// //}
|
||||
// //else
|
||||
// //{
|
||||
// // MyFlow.RunStep++;
|
||||
// // MyFlow.RunTime = DateTime.Now;
|
||||
// //}
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
@ -3439,122 +3591,83 @@ namespace ViewModel
|
||||
|
||||
break;
|
||||
case GengralProcessEnum.Step1:
|
||||
//获取可以放料的测试盒
|
||||
//全部都投料完成
|
||||
var y = TestBenchBox.Where(w => w.State.StatusBackground == ColorStr.Yellow).Count();
|
||||
if (y == TestBenchBox.Count)
|
||||
//CurrTestBox = TestBenchBox.Where(w => w.State.StatusBackground == ColorStr.White && w.Number == 1).FirstOrDefault();
|
||||
{
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
MyFlow.NodeFlow1 = new FlowModel("关闭流程");
|
||||
MyFlow.NodeFlow2 = new FlowModel("关闭流程");
|
||||
MyFlow.NodeOK1 = false;
|
||||
MyFlow.NodeOK2 = false;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
#region 测试盒气缸打开流程,已改为机械手流程控制
|
||||
//case GengralProcessEnum.Step2:
|
||||
// //顶升气缸原位
|
||||
// CurrTestBox.YDingShengQiGangDW.Switchs = false;
|
||||
// CurrTestBox.YDingShengQiGangYW.Switchs = true;
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// break;
|
||||
//case GengralProcessEnum.Step3:
|
||||
// //顶升气缸原位
|
||||
// if (CurrTestBox.XDingShengQigangYW.LightUp)
|
||||
// {
|
||||
// //伸缩气缸原位
|
||||
// CurrTestBox.YShenSuoQiGangDW.Switchs = false;
|
||||
// CurrTestBox.YShenSuoQiGangYW.Switchs = true;
|
||||
|
||||
// //顶升置位
|
||||
// CurrTestBox.YDingShengQiGangDW.Switchs = false;
|
||||
// CurrTestBox.YDingShengQiGangYW.Switchs = false;
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
// {
|
||||
// ExcepStop(CurrTestBox.XDingShengQigangYW.InputMeaning + "异常");
|
||||
// CurrTestBox.YDingShengQiGangDW.Switchs = false;
|
||||
// CurrTestBox.YDingShengQiGangYW.Switchs = true;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// break;
|
||||
//case GengralProcessEnum.Step4:
|
||||
// //伸缩气缸原位
|
||||
// if (CurrTestBox.XShenSuoQigangYW.LightUp)
|
||||
// {
|
||||
// //伸缩置位
|
||||
// CurrTestBox.YShenSuoQiGangDW.Switchs = false;
|
||||
// CurrTestBox.YShenSuoQiGangYW.Switchs = false;
|
||||
// CurrTestBox.State.StatusBackground = ColorStr.Blue; //允许投料状态
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
// {
|
||||
// ExcepStop(CurrTestBox.XShenSuoQigangYW.InputMeaning + "异常");
|
||||
// //伸缩气缸原位
|
||||
// CurrTestBox.YShenSuoQiGangDW.Switchs = false;
|
||||
// CurrTestBox.YShenSuoQiGangYW.Switchs = true;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// break;
|
||||
#endregion
|
||||
|
||||
case GengralProcessEnum.Step2:
|
||||
//已投料
|
||||
|
||||
//伸缩气缸到位
|
||||
TestBenchBox[0].YShenSuoQiGangDW.Switchs = true;
|
||||
//TestBenchBox[0].YShenSuoQiGangYW.Switchs = false;
|
||||
TestBenchBox[1].YShenSuoQiGangDW.Switchs = true;
|
||||
//TestBenchBox[1].YShenSuoQiGangYW.Switchs = false;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
|
||||
break;
|
||||
case GengralProcessEnum.Step3:
|
||||
//伸缩气缸到位
|
||||
if (TestBenchBox[0].XShenSuoQigangDW.LightUp && TestBenchBox[1].XShenSuoQigangDW.LightUp)
|
||||
{
|
||||
//顶升到位
|
||||
TestBenchBox[0].YDingShengQiGangDW.Switchs = true;
|
||||
//TestBenchBox[0].YDingShengQiGangYW.Switchs = false;
|
||||
TestBenchBox[1].YDingShengQiGangDW.Switchs = true;
|
||||
//TestBenchBox[1].YDingShengQiGangYW.Switchs = false;
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
{
|
||||
ExcepStop(TestBenchBox[0].XShenSuoQigangDW.InputMeaning + "异常");
|
||||
//伸缩气缸到位
|
||||
TestBenchBox[0].YShenSuoQiGangDW.Switchs = true;
|
||||
//TestBenchBox[0].YShenSuoQiGangYW.Switchs = false;
|
||||
TestBenchBox[1].YShenSuoQiGangDW.Switchs = true;
|
||||
//TestBenchBox[1].YShenSuoQiGangYW.Switchs = false;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step4:
|
||||
//顶升气缸到位
|
||||
if (TestBenchBox[0].XDingShengQigangDW.LightUp && TestBenchBox[1].XDingShengQigangDW.LightUp)
|
||||
MyFlow.NodeOK1 = !MyFlow.NodeOK1 ? CloseBox(MyFlow.NodeFlow1, TestBenchBox[0]) : MyFlow.NodeOK1;
|
||||
MyFlow.NodeOK2 = !MyFlow.NodeOK2 ? CloseBox(MyFlow.NodeFlow2, TestBenchBox[1]) : MyFlow.NodeOK2;
|
||||
if (MyFlow.NodeOK1 && MyFlow.NodeOK2)
|
||||
{
|
||||
MyFlow.RunStep = GengralProcessEnum.Step10;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
{
|
||||
ExcepStop(TestBenchBox[1].XDingShengQigangDW.InputMeaning + "异常");
|
||||
//顶升到位
|
||||
TestBenchBox[0].YDingShengQiGangDW.Switchs = true;
|
||||
//TestBenchBox[0].YDingShengQiGangYW.Switchs = false;
|
||||
TestBenchBox[1].YDingShengQiGangDW.Switchs = true;
|
||||
//TestBenchBox[1].YDingShengQiGangYW.Switchs = false;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
|
||||
#region 报废
|
||||
//case GengralProcessEnum.Step2:
|
||||
// //伸缩气缸到位
|
||||
// TestBenchBox[0].YShenSuoQiGangDW.Switchs = true;
|
||||
// //TestBenchBox[0].YShenSuoQiGangYW.Switchs = false;
|
||||
// TestBenchBox[1].YShenSuoQiGangDW.Switchs = true;
|
||||
// //TestBenchBox[1].YShenSuoQiGangYW.Switchs = false;
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
|
||||
// break;
|
||||
//case GengralProcessEnum.Step3:
|
||||
// //伸缩气缸到位
|
||||
// if (TestBenchBox[0].XShenSuoQigangDW.LightUp && TestBenchBox[1].XShenSuoQigangDW.LightUp)
|
||||
// {
|
||||
// //顶升到位
|
||||
// TestBenchBox[0].YDingShengQiGangDW.Switchs = true;
|
||||
// //TestBenchBox[0].YDingShengQiGangYW.Switchs = false;
|
||||
// TestBenchBox[1].YDingShengQiGangDW.Switchs = true;
|
||||
// //TestBenchBox[1].YDingShengQiGangYW.Switchs = false;
|
||||
// MyFlow.RunStep++;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
// {
|
||||
// ExcepStop(TestBenchBox[0].XShenSuoQigangDW.InputMeaning + "异常");
|
||||
// //伸缩气缸到位
|
||||
// TestBenchBox[0].YShenSuoQiGangDW.Switchs = true;
|
||||
// //TestBenchBox[0].YShenSuoQiGangYW.Switchs = false;
|
||||
// TestBenchBox[1].YShenSuoQiGangDW.Switchs = true;
|
||||
// //TestBenchBox[1].YShenSuoQiGangYW.Switchs = false;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// break;
|
||||
//case GengralProcessEnum.Step4:
|
||||
// //顶升气缸到位
|
||||
// if (TestBenchBox[0].XDingShengQigangDW.LightUp && TestBenchBox[1].XDingShengQigangDW.LightUp)
|
||||
// {
|
||||
// MyFlow.RunStep = GengralProcessEnum.Step10;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// else if (MyFlow.RunTime.AddSeconds(3) <= DateTime.Now)
|
||||
// {
|
||||
// ExcepStop(TestBenchBox[1].XDingShengQigangDW.InputMeaning + "异常");
|
||||
// //顶升到位
|
||||
// TestBenchBox[0].YDingShengQiGangDW.Switchs = true;
|
||||
// //TestBenchBox[0].YDingShengQiGangYW.Switchs = false;
|
||||
// TestBenchBox[1].YDingShengQiGangDW.Switchs = true;
|
||||
// //TestBenchBox[1].YDingShengQiGangYW.Switchs = false;
|
||||
// MyFlow.RunTime = DateTime.Now;
|
||||
// }
|
||||
// break;
|
||||
#endregion
|
||||
|
||||
case GengralProcessEnum.Step10:
|
||||
if (!CurrentMachine.RunningMode)
|
||||
{
|
||||
@ -3597,10 +3710,6 @@ namespace ViewModel
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
case GengralProcessEnum.Step13:
|
||||
if (TestBenchBox[0].XDingShengQigangDW.LightUp
|
||||
&& TestBenchBox[0].XShenSuoQigangDW.LightUp
|
||||
@ -3663,6 +3772,11 @@ namespace ViewModel
|
||||
{
|
||||
MyFlow.RunStep++;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
|
||||
MyFlow.NodeFlow1 = new FlowModel("开箱流程");
|
||||
MyFlow.NodeFlow2 = new FlowModel("开箱流程");
|
||||
MyFlow.NodeOK1 = false;
|
||||
MyFlow.NodeOK2 = false;
|
||||
}
|
||||
//200秒未回复,重置流程
|
||||
else if (MyFlow.RunTime.AddSeconds(80) <= DateTime.Now)
|
||||
@ -3673,79 +3787,87 @@ namespace ViewModel
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
|
||||
case GengralProcessEnum.Step15:
|
||||
#region 获取测试结果
|
||||
if (TestFinish) //测试成功
|
||||
MyFlow.NodeOK1 = !MyFlow.NodeOK1 ? OpenBox(MyFlow.NodeFlow1, TestBenchBox[0]) : MyFlow.NodeOK1;
|
||||
MyFlow.NodeOK2 = !MyFlow.NodeOK2 ? OpenBox(MyFlow.NodeFlow2, TestBenchBox[1]) : MyFlow.NodeOK2;
|
||||
if (MyFlow.NodeOK1 && MyFlow.NodeOK2)
|
||||
{
|
||||
if (TestResultStr != "NG") //测试机报错
|
||||
#region 获取测试结果
|
||||
if (TestFinish) //测试成功
|
||||
{
|
||||
string[] strList = TestResultStr.Split(';'); //分割结果
|
||||
//找到TEST数组所在位置,寻找结果
|
||||
int i = 0;
|
||||
foreach (var item in strList)
|
||||
if (TestResultStr != "NG") //测试机报错
|
||||
{
|
||||
if (item.Contains("TESTOK"))
|
||||
string[] strList = TestResultStr.Split(';'); //分割结果
|
||||
//找到TEST数组所在位置,寻找结果
|
||||
int i = 0;
|
||||
foreach (var item in strList)
|
||||
{
|
||||
break;
|
||||
if (item.Contains("TESTOK"))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
if (strList[i + 1] == "OK" && strList[i + 3] == "MES_OK")
|
||||
{
|
||||
TestBenchBox[0].State.StatusBackground = ColorStr.Green;
|
||||
CurrentMachine.Quantitys++;
|
||||
CurrentMachine.Produce++;
|
||||
CurrentMachine.MyQita.OK1++;
|
||||
}
|
||||
else
|
||||
{
|
||||
//TestBenchBox[0].State.StatusBackground = ColorStr.Green;
|
||||
TestBenchBox[0].State.StatusBackground = ColorStr.Red;
|
||||
CurrentMachine.Quantitys++;
|
||||
CurrentMachine.ProduceBads++;
|
||||
|
||||
if (strList[i + 1] == "OK" && strList[i + 3] == "MES_OK")
|
||||
{
|
||||
TestBenchBox[0].State.StatusBackground = ColorStr.Green;
|
||||
CurrentMachine.Quantitys++;
|
||||
CurrentMachine.Produce++;
|
||||
CurrentMachine.MyQita.NG1++;
|
||||
}
|
||||
|
||||
if (strList[i + 2] == "OK" && strList[i + 4] == "MES_OK")
|
||||
{
|
||||
TestBenchBox[1].State.StatusBackground = ColorStr.Green;
|
||||
CurrentMachine.Quantitys++;
|
||||
CurrentMachine.Produce++;
|
||||
CurrentMachine.MyQita.OK2++;
|
||||
}
|
||||
else
|
||||
{
|
||||
TestBenchBox[1].State.StatusBackground = ColorStr.Red;
|
||||
CurrentMachine.Quantitys++;
|
||||
CurrentMachine.ProduceBads++;
|
||||
CurrentMachine.MyQita.NG2++;
|
||||
}
|
||||
|
||||
MyFlow.RunStep = MyFlow.RunStep = GengralProcessEnum.Start;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
//TestBenchBox[0].State.StatusBackground = ColorStr.Green;
|
||||
TestBenchBox[0].State.StatusBackground = ColorStr.Red;
|
||||
CurrentMachine.Quantitys++;
|
||||
CurrentMachine.ProduceBads++;
|
||||
Testing = false;
|
||||
ExcepStop("测试机报错2,请重置流程");
|
||||
MyFlow.RunStep = GengralProcessEnum.End;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
|
||||
if (strList[i + 2] == "OK" && strList[i + 4] == "MES_OK")
|
||||
{
|
||||
TestBenchBox[1].State.StatusBackground = ColorStr.Green;
|
||||
CurrentMachine.Quantitys++;
|
||||
CurrentMachine.Produce++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// TestBenchBox[1].State.StatusBackground = ColorStr.Green;
|
||||
TestBenchBox[1].State.StatusBackground = ColorStr.Red;
|
||||
CurrentMachine.Quantitys++;
|
||||
CurrentMachine.ProduceBads++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
MyFlow.RunStep = MyFlow.RunStep = GengralProcessEnum.Start;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
Testing = false;
|
||||
ExcepStop("测试机报错2,请重置流程");
|
||||
MyFlow.RunStep = GengralProcessEnum.End;
|
||||
TestBenchBox.ForEach(w => w.State.StatusBackground = ColorStr.Red);
|
||||
MyFlow.RunStep = MyFlow.RunStep = GengralProcessEnum.Start;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TestBenchBox.ForEach(w => w.State.StatusBackground = ColorStr.Red);
|
||||
MyFlow.RunStep = MyFlow.RunStep = GengralProcessEnum.Start;
|
||||
MyFlow.RunTime = DateTime.Now;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
break;
|
||||
|
||||
#region 打开气缸,已交由机械手流程
|
||||
|
||||
|
||||
//case GengralProcessEnum.Step15:
|
||||
// //测试结束
|
||||
// if (TestBenchBox.Where(w => w.State.StatusBackground == ColorStr.Green || w.State.StatusBackground == ColorStr.Red).Count() >= 2)
|
||||
@ -3878,7 +4000,7 @@ namespace ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
ExcepStop("NG料满,请清料");
|
||||
ExcepNoStop("NG料满,请清料");
|
||||
}
|
||||
|
||||
|
||||
@ -4573,6 +4695,7 @@ namespace ViewModel
|
||||
/// <param name="per"></param>
|
||||
public void Start(object per)
|
||||
{
|
||||
ExcepNoIng = false;
|
||||
if (GoHomeSteps != GengralProcessEnum.End)
|
||||
{
|
||||
return;
|
||||
|
||||
@ -44,7 +44,71 @@
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Right">
|
||||
|
||||
<Grid Grid.RowSpan="5" Grid.ColumnSpan="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="0" Content="工位1数量:" Foreground="White" VerticalAlignment="Center" HorizontalContentAlignment="Right"></Label>
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="0" Grid.Column="1" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" Content="{Binding CurrentMachine.MyQita.Total1 }"></Label>
|
||||
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="1" Foreground="White" Content="产出良品:" HorizontalContentAlignment="Left"></Label>
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="1" Grid.Column="1" Foreground="White" HorizontalAlignment="Left" Content="{Binding CurrentMachine.MyQita.OK1}"></Label>
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="2" Foreground="White" Content="产出NG:" HorizontalContentAlignment="Left"></Label>
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="2" Grid.Column="1" Foreground="White" HorizontalAlignment="Left" Content="{Binding CurrentMachine.MyQita.NG1}"></Label>
|
||||
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="3" Foreground="White" Content="生产良率:" HorizontalContentAlignment="Left"></Label>
|
||||
<Viewbox Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Left">
|
||||
<TextBlock Text="{Binding CurrentMachine.MyQita.Yield1,StringFormat='P'}" Foreground="White"></TextBlock>
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="1" Margin="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="0" Content="工位2数量:" Foreground="White" VerticalAlignment="Center" HorizontalContentAlignment="Right"></Label>
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="0" Grid.Column="1" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" Content="{Binding CurrentMachine.MyQita.Total2 }"></Label>
|
||||
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="1" Foreground="White" Content="产出良品:" HorizontalContentAlignment="Left"></Label>
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="1" Grid.Column="1" Foreground="White" HorizontalAlignment="Left" Content="{Binding CurrentMachine.MyQita.OK2}"></Label>
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="2" Foreground="White" Content="产出NG:" HorizontalContentAlignment="Left"></Label>
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="2" Grid.Column="1" Foreground="White" HorizontalAlignment="Left" Content="{Binding CurrentMachine.MyQita.NG2}"></Label>
|
||||
|
||||
<Label Style="{DynamicResource Mylabel1}" Grid.Row="3" Foreground="White" Content="生产良率:" HorizontalContentAlignment="Left"></Label>
|
||||
<Viewbox Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Left">
|
||||
<TextBlock Text="{Binding CurrentMachine.MyQita.Yield2,StringFormat='P'}" Foreground="White"></TextBlock>
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<!--<Label Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Right">
|
||||
<Viewbox>
|
||||
<ContentControl Content="投入数量:"></ContentControl>
|
||||
</Viewbox>
|
||||
@ -84,7 +148,7 @@
|
||||
</Label>
|
||||
<Viewbox Grid.Column="1" Grid.Row="3" Height="{Binding ElementName=lb,Path=ActualHeight}" HorizontalAlignment="Left">
|
||||
<TextBlock Grid.Row="3" Text="{Binding CurrentMachine.RejectRatio,StringFormat='P'}" Foreground="White"></TextBlock>
|
||||
</Viewbox>
|
||||
</Viewbox>-->
|
||||
|
||||
<Label Grid.Row="5"
|
||||
Margin="1"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user