diff --git a/DAL/MainWindowDAL.cs b/DAL/MainWindowDAL.cs index 5dc4578..7b6f806 100644 --- a/DAL/MainWindowDAL.cs +++ b/DAL/MainWindowDAL.cs @@ -841,6 +841,7 @@ namespace DAL mt.HanxiCount = Convert.ToInt32(row["HanxiCount"]); mt.QingjieTime = Convert.ToInt32(row["QingjieTime"]); mt.HanxiTime = Convert.ToInt32(row["HanxiTime"]); + mt.MyQita = ShareHelp.JsonToObj(row["MyQita"]); list.Add(mt); @@ -890,7 +891,7 @@ namespace DAL { if (mt.ID > 0) { - string sqlstr = "update MachineModel set MachineName=@MachineName,AddTime=@AddTime,EnableS=@EnableS,ColoumsNumber=@ColoumsNumber,RowsNumber=@RowsNumber,PictureColoumns=@PictureColoumns,PictureRows=@PictureRows,WherePicture=@WherePicture,CellJson=@CellJson,JxCellJson=@JxCellJson,HanxiCount=@HanxiCount,QingjieTime=@QingjieTime,HanxiTime=@HanxiTime where ID=@ID"; + string sqlstr = "update MachineModel set MachineName=@MachineName,AddTime=@AddTime,EnableS=@EnableS,ColoumsNumber=@ColoumsNumber,RowsNumber=@RowsNumber,PictureColoumns=@PictureColoumns,PictureRows=@PictureRows,WherePicture=@WherePicture,CellJson=@CellJson,JxCellJson=@JxCellJson,HanxiCount=@HanxiCount,QingjieTime=@QingjieTime,HanxiTime=@HanxiTime,MyQita=@MyQita where ID=@ID"; return AccHelpers.ExecuteNonQuery(sqlstr, new OleDbParameter("@MachineName", mt.MachineName), new OleDbParameter("@AddTime", mt.AddTime), new OleDbParameter("@EnableS", mt.EnableS), @@ -904,6 +905,7 @@ namespace DAL new OleDbParameter("@HanxiCount", mt.HanxiCount), new OleDbParameter("@QingjieTime", mt.QingjieTime), new OleDbParameter("@HanxiTime", mt.HanxiTime), + new OleDbParameter("@MyQita", ShareHelp.ObjToJson(mt.MyQita)), new OleDbParameter("@ID", mt.ID)); } else diff --git a/FeiYu/MainWindow.xaml b/FeiYu/MainWindow.xaml index 44c1461..51e1b7f 100644 --- a/FeiYu/MainWindow.xaml +++ b/FeiYu/MainWindow.xaml @@ -18,7 +18,8 @@ - + + diff --git a/Model/MachineModel.cs b/Model/MachineModel.cs index 7f2338d..65a32b2 100644 --- a/Model/MachineModel.cs +++ b/Model/MachineModel.cs @@ -365,4 +365,28 @@ namespace Model } + + public class Qita : NotificationObject + { + private double _XiaYa; + public double XiaYa + { + get { return _XiaYa; } + set + { + _XiaYa = value; + this.RaisePropertyChanged("XiaYa"); + } + } + private bool _DanJi; + public bool DanJi + { + get { return _DanJi; } + set + { + _DanJi = value; + this.RaisePropertyChanged("DanJi"); + } + } + } } diff --git a/ViewModel/MainWindowVM.cs b/ViewModel/MainWindowVM.cs index a3f9568..8969ddd 100644 --- a/ViewModel/MainWindowVM.cs +++ b/ViewModel/MainWindowVM.cs @@ -1566,12 +1566,15 @@ namespace ViewModel } else { - // HotBarQingjieRun(QingjieFlow); + + // HotBarQingjieRun(QingjieFlow); CurrHandxiCount = 0; ExcepStop("请清洁焊头"); } - - HuiLiuRun(HuiLiuRunFlow); + if (CurrentMachine.MyQita.DanJi == false) + { + HuiLiuRun(HuiLiuRunFlow); + } } catch (Exception ex) { @@ -1718,12 +1721,24 @@ namespace ViewModel switch (MyFlow.RunStep) { case GengralProcessEnum.Start: - //缓存区阻挡气缸升起 - OutputList[4].Switchs = false; - //上皮带停转 - OutputList[8].Switchs = false; - MyFlow.RunStep++; - MyFlow.RunTime = DateTime.Now; + + if (CurrentMachine.MyQita.DanJi == false) + { + //缓存区阻挡气缸升起 + OutputList[4].Switchs = false; + //上皮带停转 + OutputList[8].Switchs = false; + MyFlow.RunStep++; + + } + else { + + HotBarRunFlow = new FlowModel("焊接流程"); + MyFlow.RunStep= GengralProcessEnum.Step6; + + + } + MyFlow.RunTime = DateTime.Now; break; case GengralProcessEnum.Step1: //缓存区阻挡原位 @@ -1817,18 +1832,27 @@ namespace ViewModel break; case GengralProcessEnum.Step7: - //下站有载具请求 - if (CurrNextStr == VehicleRequest) - { - MyFlow.RunStep++; - MyFlow.RunTime = DateTime.Now; - //焊接阻挡 - OutputList[5].Switchs = true; - } - else + if (CurrentMachine.MyQita.DanJi == false) { - OutputList[5].Switchs = false; + //下站有载具请求 + if (CurrNextStr == VehicleRequest) + { + MyFlow.RunStep++; + MyFlow.RunTime = DateTime.Now; + //焊接阻挡 + OutputList[5].Switchs = true; + + } + else + { + OutputList[5].Switchs = false; + } + } + else { + + MyFlow.RunStep = GengralProcessEnum.Start; + Stop(0); //停止信号 } break; case GengralProcessEnum.Step8: @@ -1910,13 +1934,22 @@ namespace ViewModel switch (MyFlow.RunStep) { case GengralProcessEnum.Start: - //载具到焊接位 - if (InputList[7].LightUp) + if (CurrentMachine.MyQita.DanJi == false) { - //顶升气缸 - OutputList[7].Switchs = true; + //载具到焊接位 + if (InputList[7].LightUp) + { + //顶升气缸 + OutputList[7].Switchs = true; + MyFlow.RunStep++; + MyFlow.RunTime = DateTime.Now; + } + } + else { + MyFlow.RunStep++; MyFlow.RunStep++; MyFlow.RunTime = DateTime.Now; + } break; case GengralProcessEnum.Step1: @@ -1936,8 +1969,8 @@ namespace ViewModel if (InputList[20].LightUp && InputList[21].LightUp) { //获取焊接点位 - TempPoint = MCVM.TrajListL[0].PointList.Where(w => w.PointType == 10).FirstOrDefault(); - TempPoint2 = MCVM.TrajListL[0].PointList.Where(w => w.PointType == 20).FirstOrDefault(); + TempPoint = Coper( MCVM.TrajListL[0].PointList.Where(w => w.PointType == 10).FirstOrDefault()); + TempPoint2 = Coper(MCVM.TrajListL[0].PointList.Where(w => w.PointType == 20).FirstOrDefault()); TempPoint.PointRunStep = GengralProcessEnum.Start; TempPoint2.PointRunStep = GengralProcessEnum.Start; MyFlow.RunStep++; @@ -1969,6 +2002,12 @@ namespace ViewModel MyFlow.RunStep++; MyFlow.RunTime = DateTime.Now; + dw1 = false; + dw2 = false; + TempPoint.PointRunStep = GengralProcessEnum.Start; + TempPoint2.PointRunStep = GengralProcessEnum.Start; + TempPoint.PointZ += CurrentMachine.MyQita.XaiYa + TempPoint2.PointZ += CurrentMachine.MyQita.XaiYa } else if (TimeOutValidation(MyFlow.RunTime, 10000, "焊接位运行异常")) { @@ -1983,7 +2022,14 @@ namespace ViewModel //吹气信号 if (InputList[24].LightUp) { - + if (!dw1) + { + dw1 = TempPoint.PointRun(MCVM.AllShaftList); + } + if (!dw2) + { + dw2 = TempPoint2.PointRun(MCVM.AllShaftList); + } //焊机1 OutputList[12].Switchs = false; OutputList[14].Switchs = true; @@ -2040,9 +2086,21 @@ namespace ViewModel //吹气 OutputList[14].Switchs = false; OutputList[15].Switchs = false; - //顶升,阻挡下降 - OutputList[7].Switchs = false; + if (CurrentMachine.MyQita.DanJi == false) + { + + //顶升,阻挡下降 + OutputList[7].Switchs = false; + } + else { + + CurrHandxiCount++; + CurrentMachine.Quantitys += 2; + bl = true; + MyFlow.RunStep = GengralProcessEnum.End; + MyFlow.RunTime = DateTime.Now; + } } break; case GengralProcessEnum.Step6: diff --git a/Views/ParameterSetting.xaml b/Views/ParameterSetting.xaml index 2659d01..8fb798c 100644 --- a/Views/ParameterSetting.xaml +++ b/Views/ParameterSetting.xaml @@ -21,9 +21,9 @@ - - - + + +