LIN 调度表 V1
This commit is contained in:
@@ -130,6 +130,7 @@ namespace CapMachine.Wpf.ViewModels
|
||||
canLinConfigPros = FreeSql.Select<CanLinConfigPro>().Where(a => a.CANLINInfo == CANLIN.LIN)
|
||||
.Include(a => a.LINConfigExd)
|
||||
.IncludeMany(a => a.CanLinConfigContents)
|
||||
.IncludeMany(a => a.LinScheduleConfigs)
|
||||
.ToList();
|
||||
|
||||
ListCanLinConfigPro = new ObservableCollection<CanLinConfigPro>(canLinConfigPros);
|
||||
@@ -182,6 +183,12 @@ namespace CapMachine.Wpf.ViewModels
|
||||
ListReadCanLinRWConfigDto = new ObservableCollection<CanLinRWConfigDto>();
|
||||
}
|
||||
|
||||
//调度表配置信息
|
||||
if (SelectCanLinConfigPro.CanScheduleConfigs != null && SelectCanLinConfigPro.CanScheduleConfigs.Count() > 0)
|
||||
{
|
||||
ListLINScheduleConfigDto = new ObservableCollection<LINScheduleConfigDto>(Mapper.Map<List<LINScheduleConfigDto>>(SelectCanLinConfigPro.LinScheduleConfigs));
|
||||
}
|
||||
|
||||
//匹配选中的SelectCanLinConfigPro.CanLinConfigContents和ListLinLdfModel
|
||||
MatchSeletedAndLinLdfModel();
|
||||
}
|
||||
@@ -543,6 +550,18 @@ namespace CapMachine.Wpf.ViewModels
|
||||
}
|
||||
|
||||
SelectCanLinConfigProConfigName = SelectCanLinConfigPro.ConfigName;
|
||||
|
||||
//调度表配置信息
|
||||
if (SelectCanLinConfigPro.CanScheduleConfigs != null && SelectCanLinConfigPro.CanScheduleConfigs.Count() > 0)
|
||||
{
|
||||
ListLINScheduleConfigDto = new ObservableCollection<LINScheduleConfigDto>(Mapper.Map<List<LINScheduleConfigDto>>(SelectCanLinConfigPro.LinScheduleConfigs));
|
||||
}
|
||||
else
|
||||
{
|
||||
ListLINScheduleConfigDto = new ObservableCollection<LINScheduleConfigDto>();
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
//先判断是否是正确的集合数据,防止DataGrid的数据源刷新导致的触发事件
|
||||
@@ -1030,6 +1049,17 @@ namespace CapMachine.Wpf.ViewModels
|
||||
}
|
||||
|
||||
|
||||
private ObservableCollection<LINScheduleConfigDto> _ListLINScheduleConfigDto;
|
||||
/// <summary>
|
||||
///调度表集合
|
||||
/// </summary>
|
||||
public ObservableCollection<LINScheduleConfigDto> ListLINScheduleConfigDto
|
||||
{
|
||||
get { return _ListLINScheduleConfigDto; }
|
||||
set { _ListLINScheduleConfigDto = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
|
||||
//private string _SelectedWriteName;
|
||||
///// <summary>
|
||||
///// 选中的写入的Name
|
||||
@@ -1174,6 +1204,47 @@ namespace CapMachine.Wpf.ViewModels
|
||||
System.Windows.MessageBox.Show("请选中后再进行【删除】操作?", "提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Hand);
|
||||
}
|
||||
|
||||
break;
|
||||
case "WriteSch"://调度表
|
||||
|
||||
LinDriveService.ToomossLinDrive.LinTest();
|
||||
|
||||
|
||||
//var data = LinDriveService.CmdData.GroupBy(a => a.MsgName).Select(a => a.Key).ToList();
|
||||
|
||||
//if (data != null && data.Count > 0)
|
||||
//{
|
||||
// //弹窗
|
||||
// DialogService.ShowDialog("DialogLINSchConfigView", new DialogParameters() {
|
||||
// {"ListMsg", LinDriveService.CmdData.GroupBy(a=>a.MsgName).Select(a=>a.Key).ToList() },
|
||||
// { "ListLINScheduleConfigDto",ListLINScheduleConfigDto},
|
||||
// { "SelectCanLinConfigProId",SelectCanLinConfigPro.Id},
|
||||
|
||||
// }, (par) =>
|
||||
// {
|
||||
// if (par.Result == ButtonResult.OK)
|
||||
// {
|
||||
// ////程序名称
|
||||
// ListLINScheduleConfigDto = par.Parameters.GetValue<ObservableCollection<LINScheduleConfigDto>>("ReturnValue");
|
||||
// //把更新后的最新值给当前的主集合中
|
||||
// SelectCanLinConfigPro.LinScheduleConfigs = Mapper.Map<List<LINScheduleConfig>>(ListLINScheduleConfigDto.ToList());
|
||||
|
||||
// }
|
||||
// else if (par.Result == ButtonResult.Cancel)
|
||||
// {
|
||||
// //取消
|
||||
|
||||
// }
|
||||
|
||||
// });
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// System.Windows.MessageBox.Show("未发现写入的执行的命令数据,无法配置?", "提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Hand);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user