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));
|
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewmodel="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.ViewModel"
|
xmlns:viewmodel="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.ViewModel"
|
||||||
Title="扫描"
|
Title="扫描"
|
||||||
Width="340"
|
Width="540"
|
||||||
Height="450"
|
Height="750"
|
||||||
MinWidth="340"
|
MinWidth="340"
|
||||||
d:DataContext="{d:DesignInstance Type=viewmodel:ScannerViewModel}"
|
d:DataContext="{d:DesignInstance Type=viewmodel:ScannerViewModel}"
|
||||||
Left="1580"
|
Left="1300"
|
||||||
Loaded="Window_Loaded"
|
Loaded="Window_Loaded"
|
||||||
Top="590"
|
Top="450"
|
||||||
WindowStartupLocation="Manual"
|
WindowStartupLocation="Manual"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
EnableRowVirtualization="False"
|
EnableRowVirtualization="False"
|
||||||
HeadersVisibility="Column"
|
HeadersVisibility="Column"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
ItemsSource="{Binding ScanCableModels}"
|
ItemsSource="{Binding _ScanCableModels}"
|
||||||
SelectedIndex="{Binding ScanedIndex}"
|
SelectedIndex="{Binding ScanedIndex}"
|
||||||
VirtualizingPanel.IsVirtualizing="False">
|
VirtualizingPanel.IsVirtualizing="False">
|
||||||
<DataGrid.Resources>
|
<DataGrid.Resources>
|
||||||
|
@ -161,6 +161,24 @@
|
||||||
hc:Poptip.HitMode="Hover"
|
hc:Poptip.HitMode="Hover"
|
||||||
Binding="{Binding Name}"
|
Binding="{Binding Name}"
|
||||||
Header="线材名称" />
|
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 Imprint}" Header="印记" />
|
||||||
<!--<DataGridTextColumn Binding="{Binding IsChecked}" Header="线材名称" />-->
|
<!--<DataGridTextColumn Binding="{Binding IsChecked}" Header="线材名称" />-->
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using EPLAN.Harness.API;
|
using EPLAN.Harness.API;
|
||||||
using EPLAN.Harness.AppCore.StudioCommon.TreeView;
|
using EPLAN.Harness.AppCore.StudioCommon.TreeView;
|
||||||
using EPLAN.Harness.Core.Controls;
|
using EPLAN.Harness.Core.Controls;
|
||||||
|
using EPLAN.Harness.Core.Extensions;
|
||||||
using EPLAN.Harness.Primitives.Treeviews;
|
using EPLAN.Harness.Primitives.Treeviews;
|
||||||
using EPLAN.Harness.ProjectCore;
|
using EPLAN.Harness.ProjectCore;
|
||||||
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
||||||
|
@ -69,7 +70,20 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
|
||||||
|
|
||||||
public ObservableCollection<ScanCableModel> ScanCableModels { get; set; } = [];
|
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()
|
public ScannerViewModel()
|
||||||
{
|
{
|
||||||
|
@ -90,7 +104,10 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
|
||||||
{
|
{
|
||||||
Index = ScanCableModels.Count + 1,
|
Index = ScanCableModels.Count + 1,
|
||||||
Id = wire.ID,
|
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,
|
Name = wire.LibraryName,
|
||||||
|
Length=wire.Length_VH.ToString(),
|
||||||
Code = wire.Name,
|
Code = wire.Name,
|
||||||
Imprint = wire.Imprint
|
Imprint = wire.Imprint
|
||||||
});
|
});
|
||||||
|
@ -146,7 +163,13 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
|
||||||
}
|
}
|
||||||
if (ScanAndAssembled)
|
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);
|
ScanedIndex = Math.Max(cable.Index - 1, 0);
|
||||||
ToSourceById(cable.Id);
|
ToSourceById(cable.Id);
|
||||||
|
|
Loading…
Reference in New Issue