界面数据步骤数据的绑定
This commit is contained in:
@@ -85,6 +85,8 @@
|
|||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!-- 手自动切换 -->
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
Margin="5,3,3,0"
|
Margin="5,3,3,0"
|
||||||
@@ -112,7 +114,7 @@
|
|||||||
Foreground="CadetBlue"
|
Foreground="CadetBlue"
|
||||||
Text="{Binding ElementName=MeterInstance, Path=AutoStateMsg}" />
|
Text="{Binding ElementName=MeterInstance, Path=AutoStateMsg}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<!-- MV -->
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
@@ -154,6 +156,7 @@
|
|||||||
Text="MV"
|
Text="MV"
|
||||||
Visibility="{Binding ElementName=MeterInstance, Path=IsHandValueShow}" />
|
Visibility="{Binding ElementName=MeterInstance, Path=IsHandValueShow}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<!-- SV -->
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
|
|||||||
@@ -76,11 +76,22 @@ namespace CapMachine.Wpf.Models.ProModelPars
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ProStepExe NextProStepExe { get; set; }
|
public ProStepExe NextProStepExe { get; set; }
|
||||||
|
|
||||||
|
private ProStepExe _CurProStepExe;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当前步骤数据执行
|
/// 当前步骤数据执行
|
||||||
/// 给看步骤是否变化使用
|
/// 给看步骤是否变化使用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ProStepExe CurProStepExe { get; set; }
|
public ProStepExe CurProStepExe
|
||||||
|
{
|
||||||
|
get { return _CurProStepExe; }
|
||||||
|
set { _CurProStepExe = value;RaisePropertyChanged(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 当前步骤数据执行
|
||||||
|
///// 给看步骤是否变化使用
|
||||||
|
///// </summary>
|
||||||
|
//public ProStepExe CurProStepExe { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上一步步骤数据执行
|
/// 上一步步骤数据执行
|
||||||
|
|||||||
@@ -183,6 +183,8 @@ namespace CapMachine.Wpf.Services
|
|||||||
/// <param name="IsEnable"></param>
|
/// <param name="IsEnable"></param>
|
||||||
public void UpdateCapEnableCmdData(bool IsEnable)
|
public void UpdateCapEnableCmdData(bool IsEnable)
|
||||||
{
|
{
|
||||||
|
if (!ToomossCanDrive.IsCycleSend) return;
|
||||||
|
|
||||||
if (EnableCanCmdData != null)
|
if (EnableCanCmdData != null)
|
||||||
{
|
{
|
||||||
EnableCanCmdData.SignalCmdValue = IsEnable ? 1 : 0;
|
EnableCanCmdData.SignalCmdValue = IsEnable ? 1 : 0;
|
||||||
|
|||||||
@@ -167,6 +167,8 @@ namespace CapMachine.Wpf.Services
|
|||||||
/// <param name="IsEnable"></param>
|
/// <param name="IsEnable"></param>
|
||||||
public void UpdateCapEnableCmdData(bool IsEnable)
|
public void UpdateCapEnableCmdData(bool IsEnable)
|
||||||
{
|
{
|
||||||
|
if (!ToomossLinDrive.IsCycleSend) return;
|
||||||
|
|
||||||
if (EnableLinCmdData != null)
|
if (EnableLinCmdData != null)
|
||||||
{
|
{
|
||||||
EnableLinCmdData.SignalCmdValue = IsEnable ? 1 : 0;
|
EnableLinCmdData.SignalCmdValue = IsEnable ? 1 : 0;
|
||||||
|
|||||||
@@ -2211,24 +2211,34 @@ namespace CapMachine.Wpf.Services
|
|||||||
ListHandSwitchData = new List<HandSwitchData>()
|
ListHandSwitchData = new List<HandSwitchData>()
|
||||||
{
|
{
|
||||||
new HandSwitchData(){Name="自动",ActionAddress="M0.0",StateAddress="M0.0" },
|
new HandSwitchData(){Name="自动",ActionAddress="M0.0",StateAddress="M0.0" },
|
||||||
new HandSwitchData(){Name="抽真空",ActionAddress="M0.1",StateAddress="V15.2" },
|
new HandSwitchData(){Name="抽真空",ActionAddress="M0.3",StateAddress="V9.0" },
|
||||||
//new HandSwitchData(){Name="复位",ActionAddress="M0.2",StateAddress="M0.2" },放到上侧的按钮区域了
|
//new HandSwitchData(){Name="复位",ActionAddress="M0.7",StateAddress="M0.7" },放到上侧的按钮区域了
|
||||||
//new HandSwitchData(){Name="消音",ActionAddress="M0.3",StateAddress="M0.3" },放到上侧的按钮区域了
|
//new HandSwitchData(){Name="消音",ActionAddress="M0.3",StateAddress="M0.3" },放到上侧的按钮区域了
|
||||||
new HandSwitchData(){Name="HV电源",ActionAddress="M1.1",StateAddress="Q0.1" },
|
new HandSwitchData(){Name="HV电源",ActionAddress="M1.1",StateAddress="Q0.1" },
|
||||||
new HandSwitchData(){Name="HV启动",ActionAddress="M1.2",StateAddress="Q0.6" },
|
new HandSwitchData(){Name="HV启动",ActionAddress="M1.2",StateAddress="Q2.0" },
|
||||||
new HandSwitchData(){Name="LV电源",ActionAddress="M1.3",StateAddress="Q0.2" },
|
new HandSwitchData(){Name="LV电源",ActionAddress="M1.3",StateAddress="Q0.2" },
|
||||||
new HandSwitchData(){Name="水泵",ActionAddress="M1.4",StateAddress="Q0.3" },
|
new HandSwitchData(){Name="LV启动",ActionAddress="M1.4",StateAddress="M1.4" },//VW30=1
|
||||||
new HandSwitchData(){Name="冷凝器电加热",ActionAddress="M1.5",StateAddress="Q0.4" },
|
|
||||||
new HandSwitchData(){Name="吸气混合器电加热",ActionAddress="M1.6",StateAddress="Q0.5" },
|
new HandSwitchData(){Name="P1水泵",ActionAddress="M1.5",StateAddress="Q0.3" },
|
||||||
new HandSwitchData(){Name="吸排气球阀",ActionAddress="M1.7",StateAddress="Q0.7" },
|
new HandSwitchData(){Name="P2水泵",ActionAddress="M1.6",StateAddress="Q0.4" },
|
||||||
new HandSwitchData(){Name="试验箱",ActionAddress="M2.0",StateAddress="V15.0" },
|
|
||||||
new HandSwitchData(){Name="水SEV1",ActionAddress="M2.1",StateAddress="Q1.0" },
|
new HandSwitchData(){Name="OS1加热器",ActionAddress="M1.7",StateAddress="Q0.5" },
|
||||||
new HandSwitchData(){Name="水SEV2",ActionAddress="M2.2",StateAddress="Q1.1" },
|
new HandSwitchData(){Name="OS2加热器",ActionAddress="M2.0",StateAddress="Q0.6" },
|
||||||
new HandSwitchData(){Name="HCV1",ActionAddress="M2.3",StateAddress="Q1.2" },
|
|
||||||
new HandSwitchData(){Name="HCV2",ActionAddress="M2.4",StateAddress="Q1.3" },
|
new HandSwitchData(){Name="COND2加热器",ActionAddress="M2.1",StateAddress="Q0.7" },
|
||||||
new HandSwitchData(){Name="ECV1",ActionAddress="M2.5",StateAddress="Q1.4" },
|
new HandSwitchData(){Name="EVAP加热器",ActionAddress="M2.2",StateAddress="Q1.0" },
|
||||||
new HandSwitchData(){Name="ECV2",ActionAddress="M2.6",StateAddress="Q1.5" },
|
new HandSwitchData(){Name="HCV1",ActionAddress="M2.3",StateAddress="Q1.1" },
|
||||||
new HandSwitchData(){Name="使能",ActionAddress="M2.7",StateAddress="V15.1" },
|
new HandSwitchData(){Name="HCV2",ActionAddress="M2.4",StateAddress="Q1.7" },
|
||||||
|
new HandSwitchData(){Name="HCV3",ActionAddress="M2.5",StateAddress="Q1.2" },
|
||||||
|
new HandSwitchData(){Name="HCV4",ActionAddress="M2.6",StateAddress="Q1.3" },
|
||||||
|
|
||||||
|
new HandSwitchData(){Name="EV1",ActionAddress="M2.7",StateAddress="Q1.4" },
|
||||||
|
new HandSwitchData(){Name="EV2",ActionAddress="M3.0",StateAddress="Q1.5" },
|
||||||
|
new HandSwitchData(){Name="EV3",ActionAddress="M3.1",StateAddress="Q1.6" },
|
||||||
|
new HandSwitchData(){Name="EV4",ActionAddress="M3.2",StateAddress="Q2.1" },
|
||||||
|
new HandSwitchData(){Name="试验箱",ActionAddress="M3.3",StateAddress="M3.3" },//VW32=1
|
||||||
|
new HandSwitchData(){Name="吸排气球阀",ActionAddress="M3.4",StateAddress="Q2.3" },
|
||||||
|
new HandSwitchData(){Name="使能",ActionAddress="M3.5",StateAddress="V9.1" },
|
||||||
};
|
};
|
||||||
|
|
||||||
ListPlcExdConfigCell = new List<PlcExdConfigCell>()
|
ListPlcExdConfigCell = new List<PlcExdConfigCell>()
|
||||||
@@ -2285,23 +2295,25 @@ namespace CapMachine.Wpf.Services
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool SysReset()
|
public bool SysReset()
|
||||||
{
|
{
|
||||||
//return true;
|
|
||||||
|
|
||||||
//取消XXX
|
SiemensDrive.Write("M0.7", true);
|
||||||
var FindData = ListHandSwitchData.Where(a => a.Name == "复位");
|
return true;
|
||||||
if (FindData.Count() > 0)
|
|
||||||
{
|
////取消XXX
|
||||||
var Result = SiemensDrive.Write(FindData.First().ActionAddress, true);
|
//var FindData = ListHandSwitchData.Where(a => a.Name == "复位");
|
||||||
if (Result.IsSuccess)
|
//if (FindData.Count() > 0)
|
||||||
{
|
//{
|
||||||
return true;
|
// var Result = SiemensDrive.Write(FindData.First().ActionAddress, true);
|
||||||
}
|
// if (Result.IsSuccess)
|
||||||
else
|
// {
|
||||||
{
|
// return true;
|
||||||
return false;
|
// }
|
||||||
}
|
// else
|
||||||
}
|
// {
|
||||||
return false;
|
// return false;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -2628,8 +2640,6 @@ namespace CapMachine.Wpf.Services
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//PV批量读取
|
//PV批量读取
|
||||||
OperateResultBlockPVRead = SiemensDrive.Read("VW100", 200);
|
OperateResultBlockPVRead = SiemensDrive.Read("VW100", 200);
|
||||||
if (OperateResultBlockPVRead.IsSuccess)
|
if (OperateResultBlockPVRead.IsSuccess)
|
||||||
@@ -2703,6 +2713,11 @@ namespace CapMachine.Wpf.Services
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//手自动切换按钮条件
|
||||||
|
AutoHandSwtichConditionState.AlarmStateResult = SiemensDrive.ReadBool(AutoHandSwtichConditionState.AlarmAddress);
|
||||||
|
AutoHandSwtichConditionState.HandStateResult = SiemensDrive.ReadBool(AutoHandSwtichConditionState.HandStateAddress);
|
||||||
|
AutoHandSwtichConditionState.SumResult();
|
||||||
|
|
||||||
//程序步骤的写入
|
//程序步骤的写入
|
||||||
ProRunStepWrite();
|
ProRunStepWrite();
|
||||||
|
|
||||||
@@ -2713,44 +2728,44 @@ namespace CapMachine.Wpf.Services
|
|||||||
//Console.WriteLine("Add Elapsed output runTime:{0}", stopwatch.Elapsed.TotalSeconds.ToString());
|
//Console.WriteLine("Add Elapsed output runTime:{0}", stopwatch.Elapsed.TotalSeconds.ToString());
|
||||||
//stopwatch.Reset();
|
//stopwatch.Reset();
|
||||||
|
|
||||||
////读取报警信息 取消报警XXX
|
//读取报警信息 取消报警XXX
|
||||||
//OperateResultAlarm = SiemensDrive.ReadBool("V0.0", 15);
|
OperateResultAlarm = SiemensDrive.ReadBool("V0.0", 15);
|
||||||
//if (OperateResultAlarm.IsSuccess)
|
if (OperateResultAlarm.IsSuccess)
|
||||||
//{
|
{
|
||||||
// foreach (var item in AlarmService.ListAlarmRunCell)
|
foreach (var item in AlarmService.ListAlarmRunCell)
|
||||||
// {
|
{
|
||||||
// item.UpdateBoolValue(OperateResultAlarm.Content[item.Index]);
|
item.UpdateBoolValue(OperateResultAlarm.Content[item.Index]);
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
////循环读取手自动切换 取消XXX
|
//循环读取手自动切换 取消XXX
|
||||||
//foreach (var item in ListHandSwitchData)
|
foreach (var item in ListHandSwitchData)
|
||||||
//{
|
{
|
||||||
// item.StateOperateResult = SiemensDrive.ReadBool(item.StateAddress);
|
item.StateOperateResult = SiemensDrive.ReadBool(item.StateAddress);
|
||||||
// if (item.StateOperateResult.IsSuccess)
|
if (item.StateOperateResult.IsSuccess)
|
||||||
// {
|
{
|
||||||
// item.State = item.StateOperateResult.Content;
|
item.State = item.StateOperateResult.Content;
|
||||||
// //根据PLC得到执行的步骤数据,更新到CAN和LIN的数据
|
//根据PLC得到执行的步骤数据,更新到CAN和LIN的数据
|
||||||
// if (item.Name!.Equals("使能"))
|
if (item.Name!.Equals("使能"))
|
||||||
// {
|
{
|
||||||
// switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
|
switch (ConfigService.CanLinRunStateModel.CurSysSelectedCanLin)
|
||||||
// {
|
{
|
||||||
// case CanLinEnum.Can:
|
case CanLinEnum.Can:
|
||||||
// //获取PLC的使能状态,更新到CAN的使能状态
|
//获取PLC的使能状态,更新到CAN的使能状态
|
||||||
// CanDriveService.UpdateCapEnableCmdData(item.State);
|
CanDriveService.UpdateCapEnableCmdData(item.State);
|
||||||
// //itemTag.Value.EngPvValue = 0;
|
//itemTag.Value.EngPvValue = 0;
|
||||||
// break;
|
break;
|
||||||
// case CanLinEnum.Lin:
|
case CanLinEnum.Lin:
|
||||||
// //获取PLC的使能状态,更新到LIN的使能状态
|
//获取PLC的使能状态,更新到LIN的使能状态
|
||||||
// LinDriveService.UpdateCapEnableCmdData(item.State);
|
LinDriveService.UpdateCapEnableCmdData(item.State);
|
||||||
// //itemTag.Value.EngPvValue = 0;
|
//itemTag.Value.EngPvValue = 0;
|
||||||
// break;
|
break;
|
||||||
// default:
|
default:
|
||||||
// break;
|
break;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
|
||||||
////拓展信息的展示 取消XXX
|
////拓展信息的展示 取消XXX
|
||||||
|
|||||||
@@ -301,7 +301,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontSize="30"
|
FontSize="30"
|
||||||
FontWeight="Bold"
|
FontWeight="Bold"
|
||||||
Text="" />
|
Text="{Binding ProRuntimeService.SpeedProExModel.CurProStepExe.ProStepInfo}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</materialDesign:Card>
|
</materialDesign:Card>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user