Hide slot and regular hole columns in main list
This commit is contained in:
@@ -120,7 +120,7 @@ namespace DrillTools.Integration
|
||||
}
|
||||
else if (hole.Type == HoleType.Slot)
|
||||
{
|
||||
slotHoles++;
|
||||
slotHoles += SlotHoleCalculator.CalculateLineSlotHoleCount(hole.Slot);
|
||||
slotCount++;
|
||||
// LineSlot 是 struct,不需要检查 null,使用正确的属性名
|
||||
// 使用原始字符串保持格式一致
|
||||
|
||||
@@ -117,6 +117,10 @@
|
||||
Width="90"
|
||||
DisplayMemberBinding="{Binding ToolSuffixTypeDisplay}"
|
||||
Header="尾号类型" />
|
||||
<GridViewColumn
|
||||
Width="60"
|
||||
DisplayMemberBinding="{Binding TotalHoles}"
|
||||
Header="总孔数" />
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
<ListView.ItemContainerStyle>
|
||||
@@ -250,4 +254,4 @@
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
</Window>
|
||||
</Window>
|
||||
|
||||
@@ -202,10 +202,10 @@ namespace DrillTools
|
||||
{
|
||||
ToolNumber = toolResult.ToolNumber,
|
||||
Diameter = toolResult.Diameter,
|
||||
// 孔数相关属性已移除
|
||||
// RegularHoles = toolResult.RegularHoles;
|
||||
// SlotHoles = toolResult.SlotHoles;
|
||||
// TotalHoles = toolResult.TotalHoles;
|
||||
RegularHoles = toolResult.RegularHoles,
|
||||
SlotHoles = toolResult.SlotHoles,
|
||||
TotalHoles = toolResult.TotalHoles,
|
||||
SlotCount = toolResult.SlotCount,
|
||||
ToolType = toolResult.ToolType,
|
||||
ToolSuffixType = toolResult.ToolSuffixType,
|
||||
ToolCategory = toolResult.ToolCategory,
|
||||
@@ -266,6 +266,10 @@ namespace DrillTools
|
||||
{
|
||||
ToolNumber = toolResult.ToolNumber,
|
||||
Diameter = toolResult.Diameter,
|
||||
RegularHoles = toolResult.RegularHoles,
|
||||
SlotHoles = toolResult.SlotHoles,
|
||||
TotalHoles = toolResult.TotalHoles,
|
||||
SlotCount = toolResult.SlotCount,
|
||||
ToolType = toolResult.ToolType,
|
||||
ToolSuffixType = toolResult.ToolSuffixType,
|
||||
ToolCategory = toolResult.ToolCategory,
|
||||
@@ -569,6 +573,10 @@ namespace DrillTools
|
||||
{
|
||||
ToolNumber = t.ToolNumber,
|
||||
Diameter = t.Diameter,
|
||||
RegularHoles = t.RegularHoles,
|
||||
SlotHoles = t.SlotHoles,
|
||||
TotalHoles = t.TotalHoles,
|
||||
SlotCount = t.SlotCount,
|
||||
ToolType = t.ToolType,
|
||||
ToolSuffixType = t.ToolSuffixType,
|
||||
ToolCategory = t.ToolCategory,
|
||||
@@ -586,6 +594,10 @@ namespace DrillTools
|
||||
{
|
||||
ToolNumber = t.ToolNumber,
|
||||
Diameter = t.Diameter,
|
||||
RegularHoles = t.RegularHoles,
|
||||
SlotHoles = t.SlotHoles,
|
||||
TotalHoles = t.TotalHoles,
|
||||
SlotCount = t.SlotCount,
|
||||
ToolType = t.ToolType,
|
||||
ToolSuffixType = t.ToolSuffixType,
|
||||
ToolCategory = t.ToolCategory,
|
||||
@@ -681,10 +693,9 @@ namespace DrillTools
|
||||
{
|
||||
ToolNumber = 1,
|
||||
Diameter = 1.049, // 尾号9,特殊孔径固定为圆孔
|
||||
// 孔数相关属性已移除
|
||||
// RegularHoles = 7,
|
||||
// SlotHoles = 0,
|
||||
// TotalHoles = 7,
|
||||
RegularHoles = 7,
|
||||
SlotHoles = 0,
|
||||
TotalHoles = 7,
|
||||
ToolType = ToolType.Regular,
|
||||
ToolSuffixType = ToolItem.GetToolSuffixType(1.049), // 特殊孔径
|
||||
ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.049)),
|
||||
@@ -703,10 +714,9 @@ namespace DrillTools
|
||||
{
|
||||
ToolNumber = 2,
|
||||
Diameter = 1.550, // 尾号0 -> 钻针
|
||||
// 孔数相关属性已移除
|
||||
// RegularHoles = 5,
|
||||
// SlotHoles = 0,
|
||||
// TotalHoles = 5,
|
||||
RegularHoles = 5,
|
||||
SlotHoles = 0,
|
||||
TotalHoles = 5,
|
||||
ToolType = ToolType.Regular,
|
||||
ToolSuffixType = ToolItem.GetToolSuffixType(1.550), // 基于孔径计算
|
||||
ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.550)),
|
||||
@@ -723,10 +733,10 @@ namespace DrillTools
|
||||
{
|
||||
ToolNumber = 3,
|
||||
Diameter = 1.156, // 尾号6 -> EA型槽刀
|
||||
// 孔数相关属性已移除
|
||||
// RegularHoles = 1,
|
||||
// SlotHoles = 528,
|
||||
// TotalHoles = 529,
|
||||
RegularHoles = 1,
|
||||
SlotHoles = 528,
|
||||
TotalHoles = 529,
|
||||
SlotCount = 6,
|
||||
ToolType = ToolType.Slot,
|
||||
ToolSuffixType = ToolItem.GetToolSuffixType(1.156), // 基于孔径计算
|
||||
ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.156)),
|
||||
@@ -745,10 +755,9 @@ namespace DrillTools
|
||||
{
|
||||
ToolNumber = 4,
|
||||
Diameter = 1.451, // 尾号1 -> 槽刀
|
||||
// 孔数相关属性已移除
|
||||
// RegularHoles = 57,
|
||||
// SlotHoles = 0,
|
||||
// TotalHoles = 57,
|
||||
RegularHoles = 57,
|
||||
SlotHoles = 0,
|
||||
TotalHoles = 57,
|
||||
ToolType = ToolType.Regular,
|
||||
ToolSuffixType = ToolItem.GetToolSuffixType(1.451), // 基于孔径计算
|
||||
ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.451)),
|
||||
@@ -765,10 +774,9 @@ namespace DrillTools
|
||||
{
|
||||
ToolNumber = 5,
|
||||
Diameter = 1.153, // 尾号3 -> 粉尘刀
|
||||
// 孔数相关属性已移除
|
||||
// RegularHoles = 10,
|
||||
// SlotHoles = 0,
|
||||
// TotalHoles = 10,
|
||||
RegularHoles = 10,
|
||||
SlotHoles = 0,
|
||||
TotalHoles = 10,
|
||||
ToolType = ToolType.Regular,
|
||||
ToolSuffixType = ToolItem.GetToolSuffixType(1.153), // 基于孔径计算
|
||||
ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.153)),
|
||||
@@ -785,10 +793,9 @@ namespace DrillTools
|
||||
{
|
||||
ToolNumber = 6,
|
||||
Diameter = 0.499, // 特殊孔径固定为圆孔(机台码)
|
||||
// 孔数相关属性已移除
|
||||
// RegularHoles = 57,
|
||||
// SlotHoles = 0,
|
||||
// TotalHoles = 57,
|
||||
RegularHoles = 57,
|
||||
SlotHoles = 0,
|
||||
TotalHoles = 57,
|
||||
ToolType = ToolType.MachineCode,
|
||||
MachineCodeCommand = "M97",
|
||||
MachineCodeType = "A*",
|
||||
@@ -804,6 +811,10 @@ namespace DrillTools
|
||||
{
|
||||
ToolNumber = tool.ToolNumber,
|
||||
Diameter = tool.Diameter,
|
||||
RegularHoles = tool.RegularHoles,
|
||||
SlotHoles = tool.SlotHoles,
|
||||
TotalHoles = tool.TotalHoles,
|
||||
SlotCount = tool.SlotCount,
|
||||
ToolType = tool.ToolType,
|
||||
ToolSuffixType = tool.ToolSuffixType,
|
||||
ToolCategory = tool.ToolCategory,
|
||||
@@ -1690,6 +1701,10 @@ M30";
|
||||
{
|
||||
ToolNumber = t.ToolNumber,
|
||||
Diameter = t.Diameter,
|
||||
RegularHoles = t.RegularHoles,
|
||||
SlotHoles = t.SlotHoles,
|
||||
TotalHoles = t.TotalHoles,
|
||||
SlotCount = t.SlotCount,
|
||||
ToolType = t.ToolType,
|
||||
ToolSuffixType = t.ToolSuffixType,
|
||||
ToolCategory = t.ToolCategory,
|
||||
@@ -1710,6 +1725,10 @@ M30";
|
||||
{
|
||||
ToolNumber = t.ToolNumber,
|
||||
Diameter = t.Diameter,
|
||||
RegularHoles = t.RegularHoles,
|
||||
SlotHoles = t.SlotHoles,
|
||||
TotalHoles = t.TotalHoles,
|
||||
SlotCount = t.SlotCount,
|
||||
ToolType = t.ToolType,
|
||||
ToolSuffixType = t.ToolSuffixType,
|
||||
ToolCategory = t.ToolCategory,
|
||||
@@ -2062,6 +2081,10 @@ M30";
|
||||
{
|
||||
ToolNumber = t.ToolNumber,
|
||||
Diameter = t.Diameter,
|
||||
RegularHoles = t.RegularHoles,
|
||||
SlotHoles = t.SlotHoles,
|
||||
TotalHoles = t.TotalHoles,
|
||||
SlotCount = t.SlotCount,
|
||||
ToolType = t.ToolType,
|
||||
ToolSuffixType = t.ToolSuffixType,
|
||||
ToolCategory = t.ToolCategory,
|
||||
@@ -2082,6 +2105,10 @@ M30";
|
||||
{
|
||||
ToolNumber = t.ToolNumber,
|
||||
Diameter = t.Diameter,
|
||||
RegularHoles = t.RegularHoles,
|
||||
SlotHoles = t.SlotHoles,
|
||||
TotalHoles = t.TotalHoles,
|
||||
SlotCount = t.SlotCount,
|
||||
ToolType = t.ToolType,
|
||||
ToolSuffixType = t.ToolSuffixType,
|
||||
ToolCategory = t.ToolCategory,
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace DrillTools
|
||||
/// <summary>
|
||||
/// 孔位信息标题
|
||||
/// </summary>
|
||||
public string HoleLocationsHeader => Tool != null ? $"孔位信息 (共{Tool.HoleLocations?.Count ?? 0}个)" : "孔位信息";
|
||||
public string HoleLocationsHeader => Tool != null ? $"孔位信息/槽位行数 (共{Tool.HoleLocations?.Count ?? 0}行)" : "孔位信息/槽位行数";
|
||||
|
||||
/// <summary>
|
||||
/// 格式化后的孔位信息
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
@@ -69,8 +70,8 @@
|
||||
</GroupBox>
|
||||
|
||||
<!-- 机台码信息 (仅当刀具类型为机台码时显示) -->
|
||||
<GroupBox Grid.Row="2"
|
||||
Header="机台码信息"
|
||||
<GroupBox Grid.Row="2"
|
||||
Header="机台码信息"
|
||||
Margin="0,0,0,10"
|
||||
Visibility="{Binding IsMachineCodeTool, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Grid Margin="10">
|
||||
@@ -91,8 +92,36 @@
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<!-- 孔数统计 -->
|
||||
<GroupBox Grid.Row="3" Header="孔数统计" Margin="0,0,0,10">
|
||||
<Grid Margin="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="普通孔数:" VerticalAlignment="Center" />
|
||||
<TextBox Grid.Row="0" Grid.Column="1" IsReadOnly="True" Text="{Binding Tool.RegularHoles, Mode=OneWay}" Margin="5" />
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="2" Text="槽孔钻孔数:" VerticalAlignment="Center" />
|
||||
<TextBox Grid.Row="0" Grid.Column="3" IsReadOnly="True" Text="{Binding Tool.SlotHoles, Mode=OneWay}" Margin="5" />
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="槽条数:" VerticalAlignment="Center" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" IsReadOnly="True" Text="{Binding Tool.SlotCount, Mode=OneWay}" Margin="5" />
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="2" Text="总孔数:" VerticalAlignment="Center" />
|
||||
<TextBox Grid.Row="1" Grid.Column="3" IsReadOnly="True" Text="{Binding Tool.TotalHoles, Mode=OneWay}" Margin="5" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<!-- 孔位信息 -->
|
||||
<GroupBox Grid.Row="3" Header="{Binding HoleLocationsHeader}">
|
||||
<GroupBox Grid.Row="4" Header="{Binding HoleLocationsHeader}">
|
||||
<TextBox IsReadOnly="True"
|
||||
Text="{Binding FormattedHoleLocations, Mode=OneWay}"
|
||||
FontFamily="{StaticResource CodeFontFamily}"
|
||||
@@ -104,7 +133,7 @@
|
||||
</GroupBox>
|
||||
|
||||
<!-- 关闭按钮 -->
|
||||
<StackPanel Grid.Row="4"
|
||||
<StackPanel Grid.Row="5"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal"
|
||||
Margin="0,15,0,0">
|
||||
|
||||
64
ToolItem.cs
64
ToolItem.cs
@@ -50,9 +50,10 @@ namespace DrillTools
|
||||
private int _toolNumber;
|
||||
private double _diameter;
|
||||
|
||||
// private int _regularHoles; // 孔数功能已移除
|
||||
// private int _slotHoles; // 孔数功能已移除
|
||||
// private int _totalHoles; // 孔数功能已移除
|
||||
private int _regularHoles;
|
||||
private int _slotHoles;
|
||||
private int _totalHoles;
|
||||
private int _slotCount;
|
||||
private string _parameters = string.Empty;
|
||||
|
||||
private ToolType _toolType;
|
||||
@@ -80,32 +81,41 @@ namespace DrillTools
|
||||
set => SetProperty(ref _diameter, value);
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// /// 普通孔数
|
||||
// /// </summary>
|
||||
// public int RegularHoles
|
||||
// {
|
||||
// get => _regularHoles;
|
||||
// set => SetProperty(ref _regularHoles, value);
|
||||
// }
|
||||
/// <summary>
|
||||
/// 普通孔数
|
||||
/// </summary>
|
||||
public int RegularHoles
|
||||
{
|
||||
get => _regularHoles;
|
||||
set => SetProperty(ref _regularHoles, value);
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// /// 槽孔数
|
||||
// /// </summary>
|
||||
// public int SlotHoles
|
||||
// {
|
||||
// get => _slotHoles;
|
||||
// set => SetProperty(ref _slotHoles, value);
|
||||
// }
|
||||
/// <summary>
|
||||
/// 槽孔实际钻孔数
|
||||
/// </summary>
|
||||
public int SlotHoles
|
||||
{
|
||||
get => _slotHoles;
|
||||
set => SetProperty(ref _slotHoles, value);
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// /// 总孔数
|
||||
// /// </summary>
|
||||
// public int TotalHoles
|
||||
// {
|
||||
// get => _totalHoles;
|
||||
// set => SetProperty(ref _totalHoles, value);
|
||||
// }
|
||||
/// <summary>
|
||||
/// 总孔数
|
||||
/// </summary>
|
||||
public int TotalHoles
|
||||
{
|
||||
get => _totalHoles;
|
||||
set => SetProperty(ref _totalHoles, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 槽条数(G85行数)
|
||||
/// </summary>
|
||||
public int SlotCount
|
||||
{
|
||||
get => _slotCount;
|
||||
set => SetProperty(ref _slotCount, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 钻机参数
|
||||
|
||||
12619
demo_drl/s20034192b0-a2-cs.drl
Normal file
12619
demo_drl/s20034192b0-a2-cs.drl
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user