更新了Tag的字段属性和Can配置的修复
This commit is contained in:
@@ -407,6 +407,19 @@ namespace CapMachine.Wpf.ViewModels
|
||||
{
|
||||
ListWriteCanLinRWConfigDto = new ObservableCollection<CanLinRWConfigDto>(Mapper.Map<List<CanLinRWConfigDto>>(WirteData));
|
||||
|
||||
//加载把当前的配置信息给指令
|
||||
CanDriveService.CmdData.Clear();
|
||||
foreach (var item in WirteData)
|
||||
{
|
||||
CanDriveService.CmdData.Add(new CanCmdData()
|
||||
{
|
||||
ConfigName = item.Name,
|
||||
MsgName = item.MsgFrameName,
|
||||
SignalName = item.SignalName,
|
||||
SignalCmdValue = double.TryParse(item.DefautValue, out double result) == true ? result : 0,
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
var ReadData = SelectCanLinConfigPro.CanLinConfigContents!.Where(a => a.RWInfo == RW.Read).ToList();
|
||||
if (ReadData != null && ReadData.Count > 0)
|
||||
|
||||
@@ -334,10 +334,10 @@ namespace CapMachine.Wpf.ViewModels
|
||||
{
|
||||
switch (ChannelValue.Type)
|
||||
{
|
||||
case "MV":
|
||||
case "MV"://10的倍率
|
||||
if (!string.IsNullOrEmpty(item.Value.MVAddress))
|
||||
{
|
||||
var Result = MachineRtDataService.SiemensDrive.Write(item.Value.MVAddress, (short)((double)ChannelValue.Value));
|
||||
var Result = MachineRtDataService.SiemensDrive.Write(item.Value.MVAddress, (short)((double)ChannelValue.Value * 10));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -405,13 +405,36 @@ namespace CapMachine.Wpf.ViewModels
|
||||
var FindData = ListHandSwitchData.FirstOrDefault(a => a.Name == Name);
|
||||
if (FindData != null)
|
||||
{
|
||||
//ToDo
|
||||
Console.WriteLine($"{FindData.Name}-{FindData.ActionAddress}-{FindData.StateAddress}-{Data}");
|
||||
var Result = MachineRtDataService.SiemensDrive.Write(FindData.ActionAddress, (bool)Data);
|
||||
if (Result.IsSuccess)
|
||||
if (Name == "自动")
|
||||
{
|
||||
//手动切换是可以自由的切换,不受限制
|
||||
|
||||
//ToDo
|
||||
Console.WriteLine($"{FindData.Name}-{FindData.ActionAddress}-{FindData.StateAddress}-{Data}");
|
||||
var Result = MachineRtDataService.SiemensDrive.Write(FindData.ActionAddress, (bool)Data);
|
||||
if (Result.IsSuccess)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//其他的手自动切换受条件过滤处理
|
||||
if (!MachineRtDataService.AutoHandSwtichConditionState.IsCanSwitch)
|
||||
{
|
||||
System.Windows.MessageBox.Show("当前的切换需要在【手动】和【无报警】的情况下进行");
|
||||
return;
|
||||
}
|
||||
|
||||
//满足条件进行操作,只进行True操作,PLC会处理的
|
||||
Console.WriteLine($"{FindData.Name}-{FindData.ActionAddress}-{FindData.StateAddress}-{Data}");
|
||||
var Result = MachineRtDataService.SiemensDrive.Write(FindData.ActionAddress, true);
|
||||
if (Result.IsSuccess)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//FindData.State = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user