Merge branch 'master' of http://192.168.1.144:8859/SinvoCSharp/Sinvo.EplanHpD.Plugin.WireCheck
This commit is contained in:
commit
5a8652457c
|
@ -60,5 +60,36 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
|
|||
OnPropertyChanged(nameof(Imprint));
|
||||
}
|
||||
}
|
||||
private string _length;
|
||||
public string Length
|
||||
{
|
||||
get => _length;
|
||||
set
|
||||
{
|
||||
_length = value;
|
||||
OnPropertyChanged(nameof(Length));
|
||||
}
|
||||
}
|
||||
|
||||
private string _s_pin;
|
||||
public string S_Pin
|
||||
{
|
||||
get => _s_pin;
|
||||
set
|
||||
{
|
||||
_s_pin = value;
|
||||
OnPropertyChanged(nameof(S_Pin));
|
||||
}
|
||||
}
|
||||
private string _e_pin;
|
||||
public string E_Pin
|
||||
{
|
||||
get => _e_pin;
|
||||
set
|
||||
{
|
||||
_e_pin = value;
|
||||
OnPropertyChanged(nameof(E_Pin));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:viewmodel="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.ViewModel"
|
||||
Title="扫描"
|
||||
Width="340"
|
||||
Height="450"
|
||||
Width="540"
|
||||
Height="750"
|
||||
MinWidth="340"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodel:ScannerViewModel}"
|
||||
Left="1580"
|
||||
Left="1300"
|
||||
Loaded="Window_Loaded"
|
||||
Top="590"
|
||||
Top="450"
|
||||
WindowStartupLocation="Manual"
|
||||
mc:Ignorable="d">
|
||||
<Window.Resources>
|
||||
|
@ -113,7 +113,7 @@
|
|||
EnableRowVirtualization="False"
|
||||
HeadersVisibility="Column"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ScanCableModels}"
|
||||
ItemsSource="{Binding _ScanCableModels}"
|
||||
SelectedIndex="{Binding ScanedIndex}"
|
||||
VirtualizingPanel.IsVirtualizing="False">
|
||||
<DataGrid.Resources>
|
||||
|
@ -161,6 +161,24 @@
|
|||
hc:Poptip.HitMode="Hover"
|
||||
Binding="{Binding Name}"
|
||||
Header="线材名称" />
|
||||
<DataGridTextColumn
|
||||
Width="60"
|
||||
hc:Poptip.Content="{Binding Length}"
|
||||
hc:Poptip.HitMode="Hover"
|
||||
Binding="{Binding Length}"
|
||||
Header="长度" />
|
||||
<DataGridTextColumn
|
||||
Width="auto"
|
||||
hc:Poptip.Content="{Binding Length}"
|
||||
hc:Poptip.HitMode="Hover"
|
||||
Binding="{Binding S_Pin}"
|
||||
Header="开始管脚" />
|
||||
<DataGridTextColumn
|
||||
Width="auto"
|
||||
hc:Poptip.Content="{Binding Length}"
|
||||
hc:Poptip.HitMode="Hover"
|
||||
Binding="{Binding E_Pin}"
|
||||
Header="结束管脚" />
|
||||
<DataGridTextColumn Binding="{Binding Imprint}" Header="印记" />
|
||||
<!--<DataGridTextColumn Binding="{Binding IsChecked}" Header="线材名称" />-->
|
||||
</DataGrid.Columns>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using EPLAN.Harness.API;
|
||||
using EPLAN.Harness.AppCore.StudioCommon.TreeView;
|
||||
using EPLAN.Harness.Core.Controls;
|
||||
using EPLAN.Harness.Core.Extensions;
|
||||
using EPLAN.Harness.Primitives.Treeviews;
|
||||
using EPLAN.Harness.ProjectCore;
|
||||
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
||||
|
@ -69,7 +70,20 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
|
|||
|
||||
public ObservableCollection<ScanCableModel> ScanCableModels { get; set; } = [];
|
||||
|
||||
private DispatcherTimer _debounceTimer;
|
||||
|
||||
public ObservableCollection<ScanCableModel> _ScanCableModels
|
||||
{
|
||||
get => ScanCableModels;
|
||||
set
|
||||
{
|
||||
if (ScanCableModels != value)
|
||||
{
|
||||
ScanCableModels = value;
|
||||
OnPropertyChanged(nameof(_ScanCableModels));
|
||||
}
|
||||
}
|
||||
}
|
||||
private DispatcherTimer _debounceTimer;
|
||||
|
||||
public ScannerViewModel()
|
||||
{
|
||||
|
@ -90,7 +104,10 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
|
|||
{
|
||||
Index = ScanCableModels.Count + 1,
|
||||
Id = wire.ID,
|
||||
S_Pin= wire.ConnectedPinsUI.Substring(0,wire.ConnectedPinsUI.IndexOf("<>")),
|
||||
E_Pin= wire.ConnectedPinsUI.Substring( wire.ConnectedPinsUI.IndexOf("<>")+3,wire.ConnectedPinsUI.Length- wire.ConnectedPinsUI.IndexOf("<>")-3),
|
||||
Name = wire.LibraryName,
|
||||
Length=wire.Length_VH.ToString(),
|
||||
Code = wire.Name,
|
||||
Imprint = wire.Imprint
|
||||
});
|
||||
|
@ -146,7 +163,13 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
|
|||
}
|
||||
if (ScanAndAssembled)
|
||||
{
|
||||
cable.IsChecked = true;
|
||||
//cable.IsChecked = true;
|
||||
ScanCableModel scanCableModel = new ScanCableModel();
|
||||
scanCableModel = cable;
|
||||
scanCableModel.IsChecked = true;
|
||||
ScanCableModels.Remove(cable);
|
||||
ScanCableModels.Insert(0,scanCableModel);
|
||||
|
||||
}
|
||||
ScanedIndex = Math.Max(cable.Index - 1, 0);
|
||||
ToSourceById(cable.Id);
|
||||
|
|
Loading…
Reference in New Issue