105067 点击部件和管脚能追踪到对应部件
This commit is contained in:
parent
c0f43b6ff7
commit
a8dcd5bd9c
|
@ -133,6 +133,26 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
|
||||||
OnPropertyChanged(nameof(E_part));
|
OnPropertyChanged(nameof(E_part));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public string _s_PartID;
|
||||||
|
public string S_PartID
|
||||||
|
{
|
||||||
|
get => _s_PartID;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_s_PartID = value;
|
||||||
|
OnPropertyChanged(nameof(S_PartID));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _e_PartID;
|
||||||
|
public string E_PartID
|
||||||
|
{
|
||||||
|
get => _e_PartID;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_e_PartID = value;
|
||||||
|
OnPropertyChanged(nameof(E_PartID));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public BaseOccurrence S_partObj { get; set; }
|
public BaseOccurrence S_partObj { get; set; }
|
||||||
public BaseOccurrence E_partObj { get; set; }
|
public BaseOccurrence E_partObj { get; set; }
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition Width="2.5*" />
|
<ColumnDefinition Width="1.5*" />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
|
@ -55,39 +55,61 @@
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<TextBlock Grid.Row="1" Text="部件1:" />
|
<TextBlock Grid.Row="1" Text="部件1:" />
|
||||||
<TextBlock
|
<Button
|
||||||
|
Name="button1"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="50,0,0,0"
|
Click="Button_Click">
|
||||||
Text="{Binding S_part}" />
|
<TextBlock
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="50,0,0,0"
|
||||||
|
Text="{Binding S_part}" />
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="2" Text="管脚1:" />
|
<TextBlock Grid.Row="2" Text="管脚1:" />
|
||||||
<TextBlock
|
<Button
|
||||||
|
Name="button2"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Margin="50,0,0,0"
|
Margin="50,0,0,0"
|
||||||
Text="{Binding S_pin}" />
|
Click="Button_Click_1">
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="2"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
Text="{Binding S_pin}" />
|
||||||
|
</Button>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.RowSpan="2"
|
Grid.RowSpan="2"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="0,15,0,0"
|
Margin="0,15,0,0"
|
||||||
Text="<------------------------------------------------------------------------------------->" />
|
Text="<--------------------------------------------------------------->" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Text="部件2:" />
|
Text="部件2:" />
|
||||||
<TextBlock
|
|
||||||
|
<Button
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="50,0,0,0"
|
Margin="50,0,0,0" Click="Button_Click_2">
|
||||||
Text="{Binding E_part}" />
|
<TextBlock
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="2"
|
||||||
|
Margin="50,0,0,0"
|
||||||
|
Text="{Binding E_part}" />
|
||||||
|
</Button>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Text="管脚2:" />
|
Text="管脚2:" />
|
||||||
<TextBlock
|
<Button
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Margin="50,0,0,0"
|
Margin="50,0,0,0" Click="Button_Click_3">
|
||||||
Text="{Binding E_pin}" />
|
<TextBlock Text="{Binding E_pin}" />
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
|
@ -57,5 +57,52 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 部件1
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void Button_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(_scannerViewModel.S_part)) ;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_scannerViewModel.ToSourceById(_scannerViewModel._ScanCableModels.FirstOrDefault().S_PartID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 管脚1
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void Button_Click_1(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(_scannerViewModel.S_pin)) ;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_scannerViewModel.ToSourceById(_scannerViewModel._ScanCableModels.FirstOrDefault().S_pinID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click_2(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(_scannerViewModel.E_part)) ;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_scannerViewModel.ToSourceById(_scannerViewModel._ScanCableModels.FirstOrDefault().E_PartID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Button_Click_3(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(_scannerViewModel.E_pin)) ;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_scannerViewModel.ToSourceById(_scannerViewModel._ScanCableModels.FirstOrDefault().E_pinID);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
|
||||||
{
|
{
|
||||||
S_pin = scanCableModel.E_Pin;
|
S_pin = scanCableModel.E_Pin;
|
||||||
E_pin = scanCableModel.E_Pin;
|
E_pin = scanCableModel.E_Pin;
|
||||||
S_part = scanCableModel.S_part;
|
|
||||||
Length = scanCableModel.Length;
|
Length = scanCableModel.Length;
|
||||||
Name = scanCableModel.Name;
|
Name = scanCableModel.Name;
|
||||||
Code = scanCableModel.Code;
|
Code = scanCableModel.Code;
|
||||||
|
@ -263,6 +263,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
|
||||||
var parent = oriOcc.Parents?.FirstOrDefault();
|
var parent = oriOcc.Parents?.FirstOrDefault();
|
||||||
var grandparent = parent.Parents?.FirstOrDefault();
|
var grandparent = parent.Parents?.FirstOrDefault();
|
||||||
scanCableModel.S_partObj = grandparent;
|
scanCableModel.S_partObj = grandparent;
|
||||||
|
scanCableModel.S_PartID = grandparent.ID;
|
||||||
scanCableModel.S_part = grandparent.Name;
|
scanCableModel.S_part = grandparent.Name;
|
||||||
S_part = scanCableModel.S_part;
|
S_part = scanCableModel.S_part;
|
||||||
}
|
}
|
||||||
|
@ -272,6 +273,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
|
||||||
var parent = oriOcc.Parents?.FirstOrDefault();
|
var parent = oriOcc.Parents?.FirstOrDefault();
|
||||||
var grandparent = parent.Parents?.FirstOrDefault();
|
var grandparent = parent.Parents?.FirstOrDefault();
|
||||||
scanCableModel.E_partObj = grandparent;
|
scanCableModel.E_partObj = grandparent;
|
||||||
|
scanCableModel.E_PartID = grandparent.ID;
|
||||||
scanCableModel.E_part = grandparent.Name;
|
scanCableModel.E_part = grandparent.Name;
|
||||||
E_part = scanCableModel.E_part;
|
E_part = scanCableModel.E_part;
|
||||||
}
|
}
|
||||||
|
@ -391,7 +393,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
|
||||||
/// 将设计器聚焦到对应的线
|
/// 将设计器聚焦到对应的线
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="occId"></param>
|
/// <param name="occId"></param>
|
||||||
private void ToSourceById(string occId)
|
public void ToSourceById(string occId)
|
||||||
{
|
{
|
||||||
// 从设计器中获取线实例
|
// 从设计器中获取线实例
|
||||||
var occWire = _currentFlexDesigner.GetOccurrenceByID(occId);
|
var occWire = _currentFlexDesigner.GetOccurrenceByID(occId);
|
||||||
|
@ -427,7 +429,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel
|
||||||
/// 将设计器聚焦到对应的线
|
/// 将设计器聚焦到对应的线
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="occId"></param>
|
/// <param name="occId"></param>
|
||||||
private void ToSourceById(ScanCableModel scanedWire)
|
public void ToSourceById(ScanCableModel scanedWire)
|
||||||
{
|
{
|
||||||
var occId = scanedWire.Id;
|
var occId = scanedWire.Id;
|
||||||
// 从设计器中获取线实例
|
// 从设计器中获取线实例
|
||||||
|
|
Loading…
Reference in New Issue