单机 and 下压
This commit is contained in:
parent
4a799ff73e
commit
19fa2a2df5
@ -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<Qita>(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
|
||||
|
||||
@ -18,7 +18,8 @@
|
||||
|
||||
<mah:MetroWindow.RightWindowCommands>
|
||||
<mah:WindowCommands>
|
||||
<CheckBox Content="空跑模式" IsChecked="{Binding CurrentMachine.RunningMode}"></CheckBox>
|
||||
<CheckBox Content="单机模式" IsChecked="{Binding CurrentMachine.MyQita.DanJi}"></CheckBox>
|
||||
|
||||
<!--<CheckBox Content="联机空跑" IsChecked="{Binding RunningModePlas}"></CheckBox>-->
|
||||
<!--<ComboBox Grid.Row="4" Grid.Column="5" VerticalContentAlignment="Center" Margin="1" Text="请选择串口" ItemsSource="{Binding LightCOM.ComPortList}" SelectedItem="{Binding SerialProt}"/>-->
|
||||
<Button Content="切换主题" Click="SubjectSwitch" ></Button>
|
||||
|
||||
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1566,13 +1566,16 @@ namespace ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// HotBarQingjieRun(QingjieFlow);
|
||||
CurrHandxiCount = 0;
|
||||
ExcepStop("请清洁焊头");
|
||||
}
|
||||
|
||||
if (CurrentMachine.MyQita.DanJi == false)
|
||||
{
|
||||
HuiLiuRun(HuiLiuRunFlow);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ExcepStop(ex.Message);
|
||||
@ -1718,11 +1721,23 @@ namespace ViewModel
|
||||
switch (MyFlow.RunStep)
|
||||
{
|
||||
case GengralProcessEnum.Start:
|
||||
|
||||
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,6 +1832,9 @@ namespace ViewModel
|
||||
|
||||
break;
|
||||
case GengralProcessEnum.Step7:
|
||||
|
||||
if (CurrentMachine.MyQita.DanJi == false)
|
||||
{
|
||||
//下站有载具请求
|
||||
if (CurrNextStr == VehicleRequest)
|
||||
{
|
||||
@ -1830,6 +1848,12 @@ namespace ViewModel
|
||||
{
|
||||
OutputList[5].Switchs = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
MyFlow.RunStep = GengralProcessEnum.Start;
|
||||
Stop(0); //停止信号
|
||||
}
|
||||
break;
|
||||
case GengralProcessEnum.Step8:
|
||||
//缓存阻挡下降到位,捡知保持500毫秒,预防光电闪烁造成的误感应
|
||||
@ -1910,6 +1934,8 @@ namespace ViewModel
|
||||
switch (MyFlow.RunStep)
|
||||
{
|
||||
case GengralProcessEnum.Start:
|
||||
if (CurrentMachine.MyQita.DanJi == false)
|
||||
{
|
||||
//载具到焊接位
|
||||
if (InputList[7].LightUp)
|
||||
{
|
||||
@ -1918,6 +1944,13 @@ namespace ViewModel
|
||||
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;
|
||||
|
||||
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:
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
<DataGridTextColumn Header="焊锡次数" Width="*" Binding="{Binding HanxiCount,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="清洁时间(ms)" Width="*" Binding="{Binding QingjieTime,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ></DataGridTextColumn>
|
||||
<DataGridTextColumn Header="吹气时间(ms)" Width="*" Binding="{Binding HanxiTime,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ></DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Header="下压高度" Width="*" Binding="{Binding MyQita.XiaYa,Mode=TwoWay, UpdateSourceTrigger=LostFocus}" ></DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</GroupBox>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user