Compare commits
2 Commits
ffc5786ed5
...
8fa07593ac
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8fa07593ac | ||
![]() |
ae99e29e99 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -10,6 +10,9 @@ using SWS.CAD.Views.Dialog;
|
||||
using Prism.Services.Dialogs;
|
||||
using SWS.Commons;
|
||||
using SWS.Model;
|
||||
using System.Windows;
|
||||
using SWS.Service;
|
||||
using Unity;
|
||||
|
||||
namespace SWS.CAD.ViewModels
|
||||
{
|
||||
@ -30,6 +33,11 @@ namespace SWS.CAD.ViewModels
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
IOModuleService _iOModuleService;
|
||||
public DialogCablePreAssignPreviewViewModel()
|
||||
{
|
||||
_iOModuleService = GlobalObject.container.Resolve<IOModuleService>();
|
||||
}
|
||||
|
||||
public string Title => "";
|
||||
|
||||
@ -52,30 +60,95 @@ namespace SWS.CAD.ViewModels
|
||||
_PreAssignCables = parameters.GetValue<ObservableCollection<PreAssignCable>>(GlobalObject.dialogPar.para1.ToString());
|
||||
}
|
||||
|
||||
public override void ExecuteOKCommandAsync(object parameter)
|
||||
public override async void ExecuteOKCommandAsync(object parameter)
|
||||
{
|
||||
|
||||
if (PreAssignCables.Any(p => p.IsChecked == true))
|
||||
bool isShowDialog = false;
|
||||
List<string> cableids = new List<string>();
|
||||
foreach (var preAssignCable in PreAssignCables)
|
||||
{
|
||||
//打开窗体
|
||||
IDialogParameters para = new Prism.Services.Dialogs.DialogParameters();
|
||||
para.Add(GlobalObject.dialogPar.para1.ToString(), PreAssignCables);
|
||||
var _dialogService = GlobalObject._prismContainer.Resolve<IDialogService>();
|
||||
_dialogService.ShowDialog(nameof(DialogCablePreAssignResult), para, async (RES) =>
|
||||
if (preAssignCable.IsChecked)
|
||||
{
|
||||
if (RES.Result == ButtonResult.Yes)
|
||||
{
|
||||
|
||||
}
|
||||
else if (RES.Result == ButtonResult.No)
|
||||
{ }
|
||||
});
|
||||
cableids.Add(preAssignCable.CableId);
|
||||
}
|
||||
}
|
||||
|
||||
if (cableids != null && cableids.Count() > 0)
|
||||
{
|
||||
bool AcceptNearbyPanel;
|
||||
MessageBoxResult result = System.Windows.MessageBox.Show($"遇到I/O类型不合适的采集箱,是否需要自动更换就近的采集箱", "KunHengCAD", MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||
if (result == MessageBoxResult.Yes)
|
||||
{
|
||||
AcceptNearbyPanel = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
AcceptNearbyPanel = false;
|
||||
}
|
||||
|
||||
var ResHttp = await _iOModuleService.AutoAssignCable2channel_step1(cableids, AcceptNearbyPanel) as learunHttpRes<object>;
|
||||
if (ResHttp.code == 200)
|
||||
{
|
||||
isShowDialog = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (AcceptNearbyPanel)
|
||||
{
|
||||
result = System.Windows.MessageBox.Show($"{ResHttp.info}", "KunHengCAD", MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||
if (result == MessageBoxResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
isShowDialog = true;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var info = ResHttp.info;
|
||||
// 找到第一个句号的位置
|
||||
int firstPeriodIndex = info.IndexOf('。');
|
||||
if (firstPeriodIndex >= 0)
|
||||
{
|
||||
// 从第一个句号后开始找第二个句号
|
||||
int secondPeriodIndex = info.IndexOf('。', firstPeriodIndex + 1);
|
||||
if (secondPeriodIndex >= 0)
|
||||
{
|
||||
// 截取到第二个句号(包括句号)
|
||||
info = info.Substring(0, secondPeriodIndex + 1);
|
||||
}
|
||||
}
|
||||
System.Windows.MessageBox.Show($"{info}", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
|
||||
}
|
||||
}
|
||||
if (isShowDialog)
|
||||
{
|
||||
//打开窗体
|
||||
IDialogParameters para = new Prism.Services.Dialogs.DialogParameters();
|
||||
para.Add(GlobalObject.dialogPar.para1.ToString(), PreAssignCables);
|
||||
var _dialogService = GlobalObject._prismContainer.Resolve<IDialogService>();
|
||||
_dialogService.ShowDialog(nameof(DialogCablePreAssignResult), para, async (RES) =>
|
||||
{
|
||||
if (RES.Result == ButtonResult.Yes)
|
||||
{
|
||||
|
||||
}
|
||||
else if (RES.Result == ButtonResult.No)
|
||||
{ }
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.MessageBox.Show("未勾选预分配电缆", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
|
||||
}
|
||||
|
||||
//返回的结果
|
||||
IDialogParameters res = new Prism.Services.Dialogs.DialogParameters();
|
||||
//IDialogParameters res = new Prism.Services.Dialogs.DialogParameters();
|
||||
//res.Add(GlobalObject.dialogPar.para1.ToString(), SelectedStripParametersInfo);
|
||||
RequestClose.Invoke(new DialogResult(ButtonResult.Yes, res));
|
||||
//RequestClose.Invoke(new DialogResult(ButtonResult.Yes, res));
|
||||
}
|
||||
public override void ExecuteCloseCommand(object parameter)
|
||||
{
|
||||
@ -119,7 +192,7 @@ namespace SWS.CAD.ViewModels
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(parameter.ToString().Equals("清空"))
|
||||
if (parameter.ToString().Equals("清空"))
|
||||
{
|
||||
foreach (var item in PreAssignCables)
|
||||
{
|
||||
@ -133,9 +206,18 @@ namespace SWS.CAD.ViewModels
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class PreAssignCable: DialogBase
|
||||
public class PreAssignCable : DialogBase
|
||||
{
|
||||
#region 页面渲染字段
|
||||
private string _CableId;
|
||||
|
||||
public string CableId
|
||||
{
|
||||
get { return _CableId; }
|
||||
set { _CableId = value; }
|
||||
}
|
||||
|
||||
|
||||
private int _Index;
|
||||
/// <summary>
|
||||
/// 序号
|
||||
@ -152,7 +234,9 @@ namespace SWS.CAD.ViewModels
|
||||
public bool IsChecked
|
||||
{
|
||||
get { return _IsChecked; }
|
||||
set { _IsChecked = value;
|
||||
set
|
||||
{
|
||||
_IsChecked = value;
|
||||
RaisePropertyChanged(nameof(IsChecked));
|
||||
}
|
||||
}
|
||||
@ -196,14 +280,15 @@ namespace SWS.CAD.ViewModels
|
||||
|
||||
public PreAssignCable()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
public PreAssignCable(ec_Cable ec_Cable)
|
||||
{
|
||||
CableId = ec_Cable.CableID;
|
||||
TagNumber = ec_Cable.TagNumber;
|
||||
PreAssignIOType = ec_Cable.PreAssignIOType;
|
||||
CableClass =ec_Cable.CableClass.Equals("homerun") ? "是":"否";
|
||||
ToPanel_TagNumber = ec_Cable.ToPanel!=null?ec_Cable.ToPanel.TagNumber:null;
|
||||
CableClass = ec_Cable.CableClass.Equals("homerun") ? "是" : "否";
|
||||
ToPanel_TagNumber = ec_Cable.ToPanel != null ? ec_Cable.ToPanel.TagNumber : null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
@ -7,17 +7,51 @@ using Telerik.Windows.Controls;
|
||||
using Prism.Services.Dialogs;
|
||||
using SWS.Commons;
|
||||
using SWS.Model;
|
||||
using SWS.Service;
|
||||
using Unity;
|
||||
using System.Linq;
|
||||
using Telerik.Windows.Controls.MaskedInput.Tokens.Numeric;
|
||||
|
||||
namespace SWS.CAD.ViewModels
|
||||
{
|
||||
public class DialogCablePreAssignResultViewModel : DialogBase, IDialogAware
|
||||
{
|
||||
#region 字段
|
||||
private ObservableCollection<PreAssignCable> _PreAssignCables = new ObservableCollection<PreAssignCable>();
|
||||
private ObservableCollection<PreAllocationResult> _PreAllocationResultls = new ObservableCollection<PreAllocationResult>();
|
||||
/// <summary>
|
||||
/// 端子排参数信息列表
|
||||
/// 预分配结果表格源
|
||||
/// </summary>
|
||||
public ObservableCollection<PreAssignCable> PreAssignCables
|
||||
public ObservableCollection<PreAllocationResult> PreAllocationResultls
|
||||
{
|
||||
get { return _PreAllocationResultls; }
|
||||
set
|
||||
{
|
||||
_PreAllocationResultls = value;
|
||||
RaisePropertyChanged(nameof(PreAllocationResultls));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string _SuccessOrFailure = "分配成功";
|
||||
/// <summary>
|
||||
/// 选择成功还是选择失败
|
||||
/// </summary>
|
||||
public string SuccessOrFailure
|
||||
{
|
||||
get { return _SuccessOrFailure; }
|
||||
set
|
||||
{
|
||||
_SuccessOrFailure = value;
|
||||
RaisePropertyChanged(nameof(SuccessOrFailure));
|
||||
UpdataPreAssignCables();
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<ec_Cable> _PreAssignCables = new ObservableCollection<ec_Cable>();
|
||||
/// <summary>
|
||||
/// 左侧预分配电缆列表
|
||||
/// </summary>
|
||||
public ObservableCollection<ec_Cable> PreAssignCables
|
||||
{
|
||||
get { return _PreAssignCables; }
|
||||
set
|
||||
@ -27,90 +61,28 @@ namespace SWS.CAD.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private StripParametersInfo _SelectedStripParametersInfo;
|
||||
private ec_Cable _SelectedPreAssignCable;
|
||||
/// <summary>
|
||||
/// 当前选中的信号类型
|
||||
/// 选择的预分配电缆
|
||||
/// </summary>
|
||||
public StripParametersInfo SelectedStripParametersInfo
|
||||
public ec_Cable SelectedPreAssignCable
|
||||
{
|
||||
get { return _SelectedStripParametersInfo; }
|
||||
get { return _SelectedPreAssignCable; }
|
||||
set
|
||||
{
|
||||
_SelectedStripParametersInfo = value;
|
||||
RaisePropertyChanged(nameof(SelectedStripParametersInfo));
|
||||
}
|
||||
}
|
||||
private bool _IsReadOnly;
|
||||
/// <summary>
|
||||
/// 是否可编辑
|
||||
/// </summary>
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get { return _IsReadOnly; }
|
||||
set
|
||||
{
|
||||
_IsReadOnly = value;
|
||||
RaisePropertyChanged(nameof(IsReadOnly));
|
||||
}
|
||||
}
|
||||
|
||||
#region 表格下拉列表
|
||||
private List<string> _TermNamingType_ls = new List<string>() { "数字", "字母" };
|
||||
/// <summary>
|
||||
/// 端子编号类型
|
||||
/// </summary>
|
||||
public List<string> TermNamingType_ls
|
||||
{
|
||||
get { return _TermNamingType_ls; }
|
||||
set
|
||||
{
|
||||
_TermNamingType_ls = value;
|
||||
RaisePropertyChanged(nameof(TermNamingType_ls));
|
||||
}
|
||||
}
|
||||
private List<string> _TermNamingRule_ls = new List<string>() { "按端子排全局编号", "按通道内端子编号", "按通道编号" };
|
||||
/// <summary>
|
||||
/// 端子编号规则
|
||||
/// </summary>
|
||||
public List<string> TermNamingRule_ls
|
||||
{
|
||||
get { return _TermNamingRule_ls; }
|
||||
set
|
||||
{
|
||||
_TermNamingRule_ls = value;
|
||||
RaisePropertyChanged(nameof(TermNamingRule_ls));
|
||||
}
|
||||
}
|
||||
private List<string> _TermNamePrefix_ls = new List<string>() { "通道编号", "+,-,s", "无" };
|
||||
/// <summary>
|
||||
/// 端子前缀
|
||||
/// </summary>
|
||||
public List<string> TermNamePrefix_ls
|
||||
{
|
||||
get { return _TermNamePrefix_ls; }
|
||||
set
|
||||
{
|
||||
_TermNamePrefix_ls = value;
|
||||
RaisePropertyChanged(nameof(TermNamePrefix_ls));
|
||||
}
|
||||
}
|
||||
private List<string> _TermNameSuffix_ls = new List<string>() { "通道编号", "+,-,s", "无" };
|
||||
/// <summary>
|
||||
/// 端子后缀
|
||||
/// </summary>
|
||||
public List<string> TermNameSuffix_ls
|
||||
{
|
||||
get { return _TermNameSuffix_ls; }
|
||||
set
|
||||
{
|
||||
_TermNameSuffix_ls = value;
|
||||
RaisePropertyChanged(nameof(TermNameSuffix_ls));
|
||||
_SelectedPreAssignCable = value;
|
||||
RaisePropertyChanged(nameof(SelectedPreAssignCable));
|
||||
UpdataPreAllocationResultls(_SelectedPreAssignCable);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
IOModuleService _iOModuleService;
|
||||
public DialogCablePreAssignResultViewModel()
|
||||
{
|
||||
_iOModuleService = GlobalObject.container.Resolve<IOModuleService>();
|
||||
}
|
||||
public string Title => "";
|
||||
|
||||
public event Action<IDialogResult> RequestClose;
|
||||
@ -124,18 +96,31 @@ namespace SWS.CAD.ViewModels
|
||||
|
||||
}
|
||||
|
||||
private List<ec_Cable> CablePreAssigns;
|
||||
//全部预分配电缆
|
||||
private List<ec_Cable> AllPreAssignCables;
|
||||
public async void OnDialogOpened(IDialogParameters parameters)
|
||||
{
|
||||
//title = parameters.GetValue<string>(GlobalObject.dialogPar.title.ToString());
|
||||
title = "信号预分配结果";
|
||||
_PreAssignCables = parameters.GetValue<ObservableCollection<PreAssignCable>>(GlobalObject.dialogPar.para1.ToString());
|
||||
_IsReadOnly = parameters.GetValue<bool>(GlobalObject.dialogPar.para2.ToString());
|
||||
AllPreAssignCables = await _iOModuleService.AutoAssignCable2channel_step2();
|
||||
UpdataPreAssignCables();
|
||||
}
|
||||
|
||||
public override void ExecuteOKCommandAsync(object para)
|
||||
public override async void ExecuteOKCommandAsync(object para)
|
||||
{
|
||||
|
||||
var Cables = new List<ec_Cable>();
|
||||
if (AllPreAssignCables != null)
|
||||
{
|
||||
foreach (var PreAssignCable in AllPreAssignCables)
|
||||
{
|
||||
if (PreAssignCable.Sets != null && !string.IsNullOrEmpty(PreAssignCable.Sets.FirstOrDefault().ConnectionInfo))
|
||||
{
|
||||
Cables.Add(PreAssignCable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var resHttp = await _iOModuleService.AutoAssignCable2channel_step3(Cables);
|
||||
//返回结果
|
||||
IDialogParameters res = new Prism.Services.Dialogs.DialogParameters();
|
||||
//res.Add(GlobalObject.dialogPar.para1.ToString(), SelectedStripParametersInfo);
|
||||
@ -156,6 +141,61 @@ namespace SWS.CAD.ViewModels
|
||||
}
|
||||
|
||||
#region 方法
|
||||
/// <summary>
|
||||
/// 修改预分配电缆列表,成功或者失败的电缆列表
|
||||
/// </summary>
|
||||
public void UpdataPreAssignCables()
|
||||
{
|
||||
PreAssignCables = new ObservableCollection<ec_Cable>();
|
||||
if (AllPreAssignCables != null)
|
||||
{
|
||||
if (SuccessOrFailure.Equals("分配成功"))
|
||||
{
|
||||
foreach (var PreAssignCable in AllPreAssignCables)
|
||||
{
|
||||
if (PreAssignCable.Sets != null && !string.IsNullOrEmpty(PreAssignCable.Sets.FirstOrDefault().ConnectionInfo))
|
||||
{
|
||||
PreAssignCables.Add(PreAssignCable);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var PreAssignCable in AllPreAssignCables)
|
||||
{
|
||||
if (PreAssignCable.Sets == null || string.IsNullOrEmpty(PreAssignCable.Sets.FirstOrDefault().ConnectionInfo))
|
||||
{
|
||||
PreAssignCables.Add(PreAssignCable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改表格显示数据
|
||||
/// </summary>
|
||||
public void UpdataPreAllocationResultls(ec_Cable cable)
|
||||
{
|
||||
|
||||
PreAllocationResultls = new ObservableCollection<PreAllocationResult>();
|
||||
if (cable == null) return;
|
||||
if (cable.Sets != null)
|
||||
{
|
||||
foreach (var Set in cable.Sets)
|
||||
{
|
||||
PreAllocationResult preAllocationResult = new PreAllocationResult();
|
||||
preAllocationResult.CablePair = Set.CableSetName;
|
||||
preAllocationResult.IOType = cable.PreAssignIOType;
|
||||
preAllocationResult.ToPanel_TagNumber = cable.ToPanel == null ? "" : cable.ToPanel.TagNumber;
|
||||
preAllocationResult.Panel_TagNumber = string.IsNullOrEmpty(Set.ConnectionInfo) ? "" : Set.ConnectionInfo.Split('/')[0].Split(':')[1].Trim();
|
||||
preAllocationResult.StripName = string.IsNullOrEmpty(Set.ConnectionInfo) ? "" : Set.ConnectionInfo.Split('/')[1].Split(':')[1].Trim();
|
||||
preAllocationResult.Terms = new ObservableCollection<ec_PanelStripTerm>(Set.AssignedTerms);
|
||||
PreAllocationResultls.Add(preAllocationResult);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ICommand EditEndCmd => new DelegateCommand(EditEnd);
|
||||
/// <summary>
|
||||
/// 编辑结束事件
|
||||
@ -168,7 +208,73 @@ namespace SWS.CAD.ViewModels
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
/// <summary>
|
||||
/// 预分配结果类
|
||||
/// </summary>
|
||||
public class PreAllocationResult : DialogBase
|
||||
{
|
||||
private string _CablePair;
|
||||
/// <summary>
|
||||
/// 电缆对
|
||||
/// </summary>
|
||||
public string CablePair
|
||||
{
|
||||
get { return _CablePair; }
|
||||
set { _CablePair = value; }
|
||||
}
|
||||
|
||||
private string _IOType;
|
||||
/// <summary>
|
||||
/// IO类型
|
||||
/// </summary>
|
||||
public string IOType
|
||||
{
|
||||
get { return _IOType; }
|
||||
set { _IOType = value; }
|
||||
}
|
||||
|
||||
|
||||
private string _ToPanel_TagNumber;
|
||||
/// <summary>
|
||||
/// 预分配的系统柜
|
||||
/// </summary>
|
||||
public string ToPanel_TagNumber
|
||||
{
|
||||
get { return _ToPanel_TagNumber; }
|
||||
set { _ToPanel_TagNumber = value; }
|
||||
}
|
||||
|
||||
private string _Panel_TagNumber;
|
||||
/// <summary>
|
||||
/// 实际分配的系统柜
|
||||
/// </summary>
|
||||
public string Panel_TagNumber
|
||||
{
|
||||
get { return _Panel_TagNumber; }
|
||||
set { _Panel_TagNumber = value; }
|
||||
}
|
||||
|
||||
private string _StripName;
|
||||
/// <summary>
|
||||
/// 实际分配的端子排
|
||||
/// </summary>
|
||||
public string StripName
|
||||
{
|
||||
get { return _StripName; }
|
||||
set { _StripName = value; }
|
||||
}
|
||||
|
||||
private ObservableCollection<ec_PanelStripTerm> _Terms;
|
||||
/// <summary>
|
||||
/// 实际端子
|
||||
/// </summary>
|
||||
public ObservableCollection<ec_PanelStripTerm> Terms
|
||||
{
|
||||
get { return _Terms; }
|
||||
set { _Terms = value; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2706,12 +2706,17 @@ namespace SWS.CAD.ViewModels
|
||||
//获取到所有预分配的电缆并设置到页面渲染对象中
|
||||
IsBusy = true;
|
||||
List<ec_Cable> CablePreAssigns = await _iOModuleService.GetCablePreAssignPreview();
|
||||
if (CablePreAssigns==null)
|
||||
{
|
||||
CablePreAssigns = new List<ec_Cable>();
|
||||
}
|
||||
var PreAssignCables = new ObservableCollection<PreAssignCable>();
|
||||
int index = 0;
|
||||
|
||||
foreach (var CablePreAssign in CablePreAssigns)
|
||||
{
|
||||
index++;
|
||||
PreAssignCables.Add(new PreAssignCable(CablePreAssign) { Index = index });
|
||||
PreAssignCables.Add(new PreAssignCable(CablePreAssign) { Index = index ,IsChecked=true});
|
||||
}
|
||||
IsBusy = false;
|
||||
//打开窗体
|
||||
|
@ -6,6 +6,7 @@
|
||||
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:SWS.CAD.Views.CustomControl"
|
||||
xmlns:cvt="clr-namespace:SWS.Commons.Helper.Converter;assembly=SWS.Commons"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
@ -13,6 +14,41 @@
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/SWS.CAD;component/Views/Style/CustomStyles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<!-- 转换器 -->
|
||||
<cvt:RadioButtonValueConverter x:Key="RadioButtonValueCvt" />
|
||||
|
||||
<!-- 使用ItemsControl垂直显示多个值 -->
|
||||
<DataTemplate x:Key="CellTemplate2">
|
||||
<ItemsControl ItemsSource="{Binding Terms}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border BorderBrush="#cccccc" BorderThickness="0,0,0,1" Padding="0"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<TextBlock Text="{Binding Term_No}" TextAlignment="Center" Padding="4,2" />
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="CellEditTemplate2">
|
||||
<ItemsControl ItemsSource="{Binding Terms}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding Term_No}" TextAlignment="Center" Padding="4,2" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</DataTemplate>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<StackPanel Background="#5d6b99">
|
||||
@ -23,22 +59,55 @@
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0">
|
||||
<Grid Width="400" Height="300" Background="White">
|
||||
|
||||
</Grid>
|
||||
<TextBlock Text="分配成功" Foreground="White" FontSize="12" Margin="0 0 0 10"/>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2">
|
||||
<Grid Width="400" Height="300" Background="White">
|
||||
|
||||
</Grid>
|
||||
<TextBlock Text="分配失败" Foreground="White" FontSize="12" Margin="0 0 0 10"/>
|
||||
<StackPanel >
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton IsChecked="{Binding SuccessOrFailure, Converter={StaticResource RadioButtonValueCvt},ConverterParameter=分配成功}" Content="分配成功" Foreground="White" GroupName="RadioButton1"/>
|
||||
<RadioButton IsChecked="{Binding SuccessOrFailure, Converter={StaticResource RadioButtonValueCvt},ConverterParameter=分配失败}" Content="分配失败" Foreground="White" GroupName="RadioButton1"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<GroupBox Margin="5,0,5,5"
|
||||
Foreground="White"
|
||||
VerticalAlignment="Bottom"
|
||||
Header="预分配电缆列表">
|
||||
<ListBox x:Name="treeView1" Width="120" Height="490" Background="White"
|
||||
ItemsSource="{Binding PreAssignCables,Mode=TwoWay}" SelectedItem="{Binding SelectedPreAssignCable,Mode=TwoWay}"
|
||||
Margin="5" telerik:StyleManager.Theme="Office_Blue"
|
||||
|
||||
>
|
||||
<ListBox.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding PreAssignCables,Mode=TwoWay}">
|
||||
<TextBlock Text="{Binding TagNumber}">
|
||||
</TextBlock>
|
||||
</HierarchicalDataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</GroupBox>
|
||||
<GroupBox Margin="5,0,5,5"
|
||||
Foreground="White"
|
||||
Header="预分配信息">
|
||||
<Grid Width="450" Height="500" Background="White">
|
||||
<telerik:RadGridView x:Name="RadGridView1" SelectionMode="Single" Width="auto" Height="660"
|
||||
AutoGenerateColumns="False" IsFilteringAllowed="False"
|
||||
IsReadOnly="False" RowIndicatorVisibility="Collapsed"
|
||||
ShowGroupPanel="False" telerik:StyleManager.Theme="Office_Blue"
|
||||
ItemsSource="{Binding PreAllocationResultls}" SelectedItem="{Binding SelectedChannelInfo, Mode=TwoWay}"
|
||||
>
|
||||
<telerik:RadGridView.Columns>
|
||||
<telerik:GridViewDataColumn Header="电缆对" DataMemberBinding="{Binding CablePair}" IsReadOnly="True"/>
|
||||
<telerik:GridViewDataColumn Header="IO类型" DataMemberBinding="{Binding IOType}" IsReadOnly="True"/>
|
||||
<telerik:GridViewDataColumn Header="预分配箱子" DataMemberBinding="{Binding ToPanel_TagNumber}" IsReadOnly="True"/>
|
||||
<telerik:GridViewDataColumn Header="实际分配箱子" DataMemberBinding="{Binding Panel_TagNumber}" IsReadOnly="True"/>
|
||||
<telerik:GridViewDataColumn Header="实际分配端子排" DataMemberBinding="{Binding StripName}" IsReadOnly="True"/>
|
||||
<telerik:GridViewDataColumn Header="实际分配端子"
|
||||
DataMemberBinding="{Binding Terms}"
|
||||
Width="*" IsReadOnly="True"
|
||||
CellTemplate="{StaticResource CellTemplate2}" CellEditTemplate="{StaticResource CellEditTemplate2}"/>
|
||||
</telerik:RadGridView.Columns>
|
||||
</telerik:RadGridView>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding SuccessOrFailure}" Foreground="White" FontSize="12" Margin="0 0 0 10"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
|
@ -117,6 +117,9 @@ namespace SWS.Model
|
||||
/// 删除标记
|
||||
/// </summary>
|
||||
public bool DeleteFlg { set; get; } = false;
|
||||
|
||||
public List<ec_PanelStripTerm> AssignedTerms { set; get; }
|
||||
|
||||
#endregion
|
||||
|
||||
public ec_CableSet()
|
||||
|
@ -333,6 +333,46 @@ namespace SWS.Service
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<object> AutoAssignCable2channel_step1(List<string> CableIds ,bool AcceptNearbyPanel)
|
||||
{
|
||||
var res = await this.PostBodyAsync<object,List<string>>($"IOModuleApi/AutoAssignCable2Channel_step1?projId={GlobalObject.curProject?.ProjectId}&AcceptNearbyPanel={AcceptNearbyPanel}", CableIds);
|
||||
//if (res.code == 200)
|
||||
//{
|
||||
// return res.data;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
//}
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<List<ec_Cable>> AutoAssignCable2channel_step2()
|
||||
{
|
||||
var res = await this.PostBodyAsync<List<ec_Cable>, object>($"IOModuleApi/AutoAssignCable2Channel_step2?projId={GlobalObject.curProject?.ProjectId}", null);
|
||||
if (res.code == 200)
|
||||
{
|
||||
return res.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<List<ec_Cable>> AutoAssignCable2channel_step3(List<ec_Cable> CableIds)
|
||||
{
|
||||
var res = await this.PostBodyAsync<List<ec_Cable>, object>($"IOModuleApi/AutoAssignCable2Channel_step3?projId={GlobalObject.curProject?.ProjectId}", CableIds);
|
||||
if (res.code == 200)
|
||||
{
|
||||
return res.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// SaveConnections 专用
|
||||
/// </summary>
|
||||
@ -341,5 +381,7 @@ namespace SWS.Service
|
||||
public string ID { get; set; }
|
||||
public List<ec_WireTerminal> Conns { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user