单机 and 下压

This commit is contained in:
tfar 2026-12-04 15:06:13 +08:00
parent 4a799ff73e
commit 19fa2a2df5
5 changed files with 118 additions and 33 deletions

View File

@ -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

View File

@ -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>

View File

@ -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");
}
}
}
}

View File

@ -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:

View File

@ -21,9 +21,9 @@
<DataGridTextColumn Header="机种名称" Width="*" Binding="{Binding MachineName,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ></DataGridTextColumn>
<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>
</DataGrid.Columns>
<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>
</TabItem>