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