单机 and 下压
This commit is contained in:
parent
4a799ff73e
commit
19fa2a2df5
@ -841,6 +841,7 @@ namespace DAL
|
|||||||
mt.HanxiCount = Convert.ToInt32(row["HanxiCount"]);
|
mt.HanxiCount = Convert.ToInt32(row["HanxiCount"]);
|
||||||
mt.QingjieTime = Convert.ToInt32(row["QingjieTime"]);
|
mt.QingjieTime = Convert.ToInt32(row["QingjieTime"]);
|
||||||
mt.HanxiTime = Convert.ToInt32(row["HanxiTime"]);
|
mt.HanxiTime = Convert.ToInt32(row["HanxiTime"]);
|
||||||
|
mt.MyQita = ShareHelp.JsonToObj<Qita>(row["MyQita"]);
|
||||||
|
|
||||||
|
|
||||||
list.Add(mt);
|
list.Add(mt);
|
||||||
@ -890,7 +891,7 @@ namespace DAL
|
|||||||
{
|
{
|
||||||
if (mt.ID > 0)
|
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),
|
return AccHelpers.ExecuteNonQuery(sqlstr, new OleDbParameter("@MachineName", mt.MachineName),
|
||||||
new OleDbParameter("@AddTime", mt.AddTime),
|
new OleDbParameter("@AddTime", mt.AddTime),
|
||||||
new OleDbParameter("@EnableS", mt.EnableS),
|
new OleDbParameter("@EnableS", mt.EnableS),
|
||||||
@ -904,6 +905,7 @@ namespace DAL
|
|||||||
new OleDbParameter("@HanxiCount", mt.HanxiCount),
|
new OleDbParameter("@HanxiCount", mt.HanxiCount),
|
||||||
new OleDbParameter("@QingjieTime", mt.QingjieTime),
|
new OleDbParameter("@QingjieTime", mt.QingjieTime),
|
||||||
new OleDbParameter("@HanxiTime", mt.HanxiTime),
|
new OleDbParameter("@HanxiTime", mt.HanxiTime),
|
||||||
|
new OleDbParameter("@MyQita", ShareHelp.ObjToJson(mt.MyQita)),
|
||||||
new OleDbParameter("@ID", mt.ID));
|
new OleDbParameter("@ID", mt.ID));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
<mah:MetroWindow.RightWindowCommands>
|
<mah:MetroWindow.RightWindowCommands>
|
||||||
<mah:WindowCommands>
|
<mah:WindowCommands>
|
||||||
<CheckBox Content="空跑模式" IsChecked="{Binding CurrentMachine.RunningMode}"></CheckBox>
|
<CheckBox Content="单机模式" IsChecked="{Binding CurrentMachine.MyQita.DanJi}"></CheckBox>
|
||||||
|
|
||||||
<!--<CheckBox Content="联机空跑" IsChecked="{Binding RunningModePlas}"></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}"/>-->
|
<!--<ComboBox Grid.Row="4" Grid.Column="5" VerticalContentAlignment="Center" Margin="1" Text="请选择串口" ItemsSource="{Binding LightCOM.ComPortList}" SelectedItem="{Binding SerialProt}"/>-->
|
||||||
<Button Content="切换主题" Click="SubjectSwitch" ></Button>
|
<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,12 +1566,15 @@ namespace ViewModel
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// HotBarQingjieRun(QingjieFlow);
|
|
||||||
|
// HotBarQingjieRun(QingjieFlow);
|
||||||
CurrHandxiCount = 0;
|
CurrHandxiCount = 0;
|
||||||
ExcepStop("请清洁焊头");
|
ExcepStop("请清洁焊头");
|
||||||
}
|
}
|
||||||
|
if (CurrentMachine.MyQita.DanJi == false)
|
||||||
HuiLiuRun(HuiLiuRunFlow);
|
{
|
||||||
|
HuiLiuRun(HuiLiuRunFlow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -1718,12 +1721,24 @@ namespace ViewModel
|
|||||||
switch (MyFlow.RunStep)
|
switch (MyFlow.RunStep)
|
||||||
{
|
{
|
||||||
case GengralProcessEnum.Start:
|
case GengralProcessEnum.Start:
|
||||||
//缓存区阻挡气缸升起
|
|
||||||
OutputList[4].Switchs = false;
|
if (CurrentMachine.MyQita.DanJi == false)
|
||||||
//上皮带停转
|
{
|
||||||
OutputList[8].Switchs = false;
|
//缓存区阻挡气缸升起
|
||||||
MyFlow.RunStep++;
|
OutputList[4].Switchs = false;
|
||||||
MyFlow.RunTime = DateTime.Now;
|
//上皮带停转
|
||||||
|
OutputList[8].Switchs = false;
|
||||||
|
MyFlow.RunStep++;
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
HotBarRunFlow = new FlowModel("焊接流程");
|
||||||
|
MyFlow.RunStep= GengralProcessEnum.Step6;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
MyFlow.RunTime = DateTime.Now;
|
||||||
break;
|
break;
|
||||||
case GengralProcessEnum.Step1:
|
case GengralProcessEnum.Step1:
|
||||||
//缓存区阻挡原位
|
//缓存区阻挡原位
|
||||||
@ -1817,18 +1832,27 @@ namespace ViewModel
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case GengralProcessEnum.Step7:
|
case GengralProcessEnum.Step7:
|
||||||
//下站有载具请求
|
|
||||||
if (CurrNextStr == VehicleRequest)
|
|
||||||
{
|
|
||||||
MyFlow.RunStep++;
|
|
||||||
MyFlow.RunTime = DateTime.Now;
|
|
||||||
//焊接阻挡
|
|
||||||
OutputList[5].Switchs = true;
|
|
||||||
|
|
||||||
}
|
if (CurrentMachine.MyQita.DanJi == false)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
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;
|
break;
|
||||||
case GengralProcessEnum.Step8:
|
case GengralProcessEnum.Step8:
|
||||||
@ -1910,13 +1934,22 @@ namespace ViewModel
|
|||||||
switch (MyFlow.RunStep)
|
switch (MyFlow.RunStep)
|
||||||
{
|
{
|
||||||
case GengralProcessEnum.Start:
|
case GengralProcessEnum.Start:
|
||||||
//载具到焊接位
|
if (CurrentMachine.MyQita.DanJi == false)
|
||||||
if (InputList[7].LightUp)
|
|
||||||
{
|
{
|
||||||
//顶升气缸
|
//载具到焊接位
|
||||||
OutputList[7].Switchs = true;
|
if (InputList[7].LightUp)
|
||||||
|
{
|
||||||
|
//顶升气缸
|
||||||
|
OutputList[7].Switchs = true;
|
||||||
|
MyFlow.RunStep++;
|
||||||
|
MyFlow.RunTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MyFlow.RunStep++;
|
||||||
MyFlow.RunStep++;
|
MyFlow.RunStep++;
|
||||||
MyFlow.RunTime = DateTime.Now;
|
MyFlow.RunTime = DateTime.Now;
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GengralProcessEnum.Step1:
|
case GengralProcessEnum.Step1:
|
||||||
@ -1936,8 +1969,8 @@ namespace ViewModel
|
|||||||
if (InputList[20].LightUp && InputList[21].LightUp)
|
if (InputList[20].LightUp && InputList[21].LightUp)
|
||||||
{
|
{
|
||||||
//获取焊接点位
|
//获取焊接点位
|
||||||
TempPoint = MCVM.TrajListL[0].PointList.Where(w => w.PointType == 10).FirstOrDefault();
|
TempPoint = Coper( MCVM.TrajListL[0].PointList.Where(w => w.PointType == 10).FirstOrDefault());
|
||||||
TempPoint2 = MCVM.TrajListL[0].PointList.Where(w => w.PointType == 20).FirstOrDefault();
|
TempPoint2 = Coper(MCVM.TrajListL[0].PointList.Where(w => w.PointType == 20).FirstOrDefault());
|
||||||
TempPoint.PointRunStep = GengralProcessEnum.Start;
|
TempPoint.PointRunStep = GengralProcessEnum.Start;
|
||||||
TempPoint2.PointRunStep = GengralProcessEnum.Start;
|
TempPoint2.PointRunStep = GengralProcessEnum.Start;
|
||||||
MyFlow.RunStep++;
|
MyFlow.RunStep++;
|
||||||
@ -1969,6 +2002,12 @@ namespace ViewModel
|
|||||||
|
|
||||||
MyFlow.RunStep++;
|
MyFlow.RunStep++;
|
||||||
MyFlow.RunTime = DateTime.Now;
|
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, "焊接位运行异常"))
|
else if (TimeOutValidation(MyFlow.RunTime, 10000, "焊接位运行异常"))
|
||||||
{
|
{
|
||||||
@ -1983,7 +2022,14 @@ namespace ViewModel
|
|||||||
//吹气信号
|
//吹气信号
|
||||||
if (InputList[24].LightUp)
|
if (InputList[24].LightUp)
|
||||||
{
|
{
|
||||||
|
if (!dw1)
|
||||||
|
{
|
||||||
|
dw1 = TempPoint.PointRun(MCVM.AllShaftList);
|
||||||
|
}
|
||||||
|
if (!dw2)
|
||||||
|
{
|
||||||
|
dw2 = TempPoint2.PointRun(MCVM.AllShaftList);
|
||||||
|
}
|
||||||
//焊机1
|
//焊机1
|
||||||
OutputList[12].Switchs = false;
|
OutputList[12].Switchs = false;
|
||||||
OutputList[14].Switchs = true;
|
OutputList[14].Switchs = true;
|
||||||
@ -2040,9 +2086,21 @@ namespace ViewModel
|
|||||||
//吹气
|
//吹气
|
||||||
OutputList[14].Switchs = false;
|
OutputList[14].Switchs = false;
|
||||||
OutputList[15].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;
|
break;
|
||||||
case GengralProcessEnum.Step6:
|
case GengralProcessEnum.Step6:
|
||||||
|
|||||||
@ -21,9 +21,9 @@
|
|||||||
<DataGridTextColumn Header="机种名称" Width="*" Binding="{Binding MachineName,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ></DataGridTextColumn>
|
<DataGridTextColumn Header="机种名称" Width="*" Binding="{Binding MachineName,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ></DataGridTextColumn>
|
||||||
<DataGridTextColumn Header="焊锡次数" Width="*" Binding="{Binding HanxiCount,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 QingjieTime,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ></DataGridTextColumn>
|
||||||
<DataGridTextColumn Header="吹气时间(ms)" Width="*" Binding="{Binding HanxiTime,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.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user