Hide slot and regular hole columns in main list

This commit is contained in:
2026-05-16 10:56:12 +08:00
parent 03d9b8baa2
commit fc5b2b16fa
7 changed files with 12751 additions and 62 deletions

View File

@@ -120,7 +120,7 @@ namespace DrillTools.Integration
} }
else if (hole.Type == HoleType.Slot) else if (hole.Type == HoleType.Slot)
{ {
slotHoles++; slotHoles += SlotHoleCalculator.CalculateLineSlotHoleCount(hole.Slot);
slotCount++; slotCount++;
// LineSlot 是 struct不需要检查 null使用正确的属性名 // LineSlot 是 struct不需要检查 null使用正确的属性名
// 使用原始字符串保持格式一致 // 使用原始字符串保持格式一致

View File

@@ -117,6 +117,10 @@
Width="90" Width="90"
DisplayMemberBinding="{Binding ToolSuffixTypeDisplay}" DisplayMemberBinding="{Binding ToolSuffixTypeDisplay}"
Header="尾号类型" /> Header="尾号类型" />
<GridViewColumn
Width="60"
DisplayMemberBinding="{Binding TotalHoles}"
Header="总孔数" />
</GridView> </GridView>
</ListView.View> </ListView.View>
<ListView.ItemContainerStyle> <ListView.ItemContainerStyle>
@@ -250,4 +254,4 @@
</StatusBarItem> </StatusBarItem>
</StatusBar> </StatusBar>
</Grid> </Grid>
</Window> </Window>

View File

@@ -202,10 +202,10 @@ namespace DrillTools
{ {
ToolNumber = toolResult.ToolNumber, ToolNumber = toolResult.ToolNumber,
Diameter = toolResult.Diameter, Diameter = toolResult.Diameter,
// 孔数相关属性已移除 RegularHoles = toolResult.RegularHoles,
// RegularHoles = toolResult.RegularHoles; SlotHoles = toolResult.SlotHoles,
// SlotHoles = toolResult.SlotHoles; TotalHoles = toolResult.TotalHoles,
// TotalHoles = toolResult.TotalHoles; SlotCount = toolResult.SlotCount,
ToolType = toolResult.ToolType, ToolType = toolResult.ToolType,
ToolSuffixType = toolResult.ToolSuffixType, ToolSuffixType = toolResult.ToolSuffixType,
ToolCategory = toolResult.ToolCategory, ToolCategory = toolResult.ToolCategory,
@@ -266,6 +266,10 @@ namespace DrillTools
{ {
ToolNumber = toolResult.ToolNumber, ToolNumber = toolResult.ToolNumber,
Diameter = toolResult.Diameter, Diameter = toolResult.Diameter,
RegularHoles = toolResult.RegularHoles,
SlotHoles = toolResult.SlotHoles,
TotalHoles = toolResult.TotalHoles,
SlotCount = toolResult.SlotCount,
ToolType = toolResult.ToolType, ToolType = toolResult.ToolType,
ToolSuffixType = toolResult.ToolSuffixType, ToolSuffixType = toolResult.ToolSuffixType,
ToolCategory = toolResult.ToolCategory, ToolCategory = toolResult.ToolCategory,
@@ -569,6 +573,10 @@ namespace DrillTools
{ {
ToolNumber = t.ToolNumber, ToolNumber = t.ToolNumber,
Diameter = t.Diameter, Diameter = t.Diameter,
RegularHoles = t.RegularHoles,
SlotHoles = t.SlotHoles,
TotalHoles = t.TotalHoles,
SlotCount = t.SlotCount,
ToolType = t.ToolType, ToolType = t.ToolType,
ToolSuffixType = t.ToolSuffixType, ToolSuffixType = t.ToolSuffixType,
ToolCategory = t.ToolCategory, ToolCategory = t.ToolCategory,
@@ -586,6 +594,10 @@ namespace DrillTools
{ {
ToolNumber = t.ToolNumber, ToolNumber = t.ToolNumber,
Diameter = t.Diameter, Diameter = t.Diameter,
RegularHoles = t.RegularHoles,
SlotHoles = t.SlotHoles,
TotalHoles = t.TotalHoles,
SlotCount = t.SlotCount,
ToolType = t.ToolType, ToolType = t.ToolType,
ToolSuffixType = t.ToolSuffixType, ToolSuffixType = t.ToolSuffixType,
ToolCategory = t.ToolCategory, ToolCategory = t.ToolCategory,
@@ -681,10 +693,9 @@ namespace DrillTools
{ {
ToolNumber = 1, ToolNumber = 1,
Diameter = 1.049, // 尾号9特殊孔径固定为圆孔 Diameter = 1.049, // 尾号9特殊孔径固定为圆孔
// 孔数相关属性已移除 RegularHoles = 7,
// RegularHoles = 7, SlotHoles = 0,
// SlotHoles = 0, TotalHoles = 7,
// TotalHoles = 7,
ToolType = ToolType.Regular, ToolType = ToolType.Regular,
ToolSuffixType = ToolItem.GetToolSuffixType(1.049), // 特殊孔径 ToolSuffixType = ToolItem.GetToolSuffixType(1.049), // 特殊孔径
ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.049)), ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.049)),
@@ -703,10 +714,9 @@ namespace DrillTools
{ {
ToolNumber = 2, ToolNumber = 2,
Diameter = 1.550, // 尾号0 -> 钻针 Diameter = 1.550, // 尾号0 -> 钻针
// 孔数相关属性已移除 RegularHoles = 5,
// RegularHoles = 5, SlotHoles = 0,
// SlotHoles = 0, TotalHoles = 5,
// TotalHoles = 5,
ToolType = ToolType.Regular, ToolType = ToolType.Regular,
ToolSuffixType = ToolItem.GetToolSuffixType(1.550), // 基于孔径计算 ToolSuffixType = ToolItem.GetToolSuffixType(1.550), // 基于孔径计算
ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.550)), ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.550)),
@@ -723,10 +733,10 @@ namespace DrillTools
{ {
ToolNumber = 3, ToolNumber = 3,
Diameter = 1.156, // 尾号6 -> EA型槽刀 Diameter = 1.156, // 尾号6 -> EA型槽刀
// 孔数相关属性已移除 RegularHoles = 1,
// RegularHoles = 1, SlotHoles = 528,
// SlotHoles = 528, TotalHoles = 529,
// TotalHoles = 529, SlotCount = 6,
ToolType = ToolType.Slot, ToolType = ToolType.Slot,
ToolSuffixType = ToolItem.GetToolSuffixType(1.156), // 基于孔径计算 ToolSuffixType = ToolItem.GetToolSuffixType(1.156), // 基于孔径计算
ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.156)), ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.156)),
@@ -745,10 +755,9 @@ namespace DrillTools
{ {
ToolNumber = 4, ToolNumber = 4,
Diameter = 1.451, // 尾号1 -> 槽刀 Diameter = 1.451, // 尾号1 -> 槽刀
// 孔数相关属性已移除 RegularHoles = 57,
// RegularHoles = 57, SlotHoles = 0,
// SlotHoles = 0, TotalHoles = 57,
// TotalHoles = 57,
ToolType = ToolType.Regular, ToolType = ToolType.Regular,
ToolSuffixType = ToolItem.GetToolSuffixType(1.451), // 基于孔径计算 ToolSuffixType = ToolItem.GetToolSuffixType(1.451), // 基于孔径计算
ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.451)), ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.451)),
@@ -765,10 +774,9 @@ namespace DrillTools
{ {
ToolNumber = 5, ToolNumber = 5,
Diameter = 1.153, // 尾号3 -> 粉尘刀 Diameter = 1.153, // 尾号3 -> 粉尘刀
// 孔数相关属性已移除 RegularHoles = 10,
// RegularHoles = 10, SlotHoles = 0,
// SlotHoles = 0, TotalHoles = 10,
// TotalHoles = 10,
ToolType = ToolType.Regular, ToolType = ToolType.Regular,
ToolSuffixType = ToolItem.GetToolSuffixType(1.153), // 基于孔径计算 ToolSuffixType = ToolItem.GetToolSuffixType(1.153), // 基于孔径计算
ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.153)), ToolCategory = ToolItem.GetToolCategory(ToolItem.GetToolSuffixType(1.153)),
@@ -785,10 +793,9 @@ namespace DrillTools
{ {
ToolNumber = 6, ToolNumber = 6,
Diameter = 0.499, // 特殊孔径固定为圆孔(机台码) Diameter = 0.499, // 特殊孔径固定为圆孔(机台码)
// 孔数相关属性已移除 RegularHoles = 57,
// RegularHoles = 57, SlotHoles = 0,
// SlotHoles = 0, TotalHoles = 57,
// TotalHoles = 57,
ToolType = ToolType.MachineCode, ToolType = ToolType.MachineCode,
MachineCodeCommand = "M97", MachineCodeCommand = "M97",
MachineCodeType = "A*", MachineCodeType = "A*",
@@ -804,6 +811,10 @@ namespace DrillTools
{ {
ToolNumber = tool.ToolNumber, ToolNumber = tool.ToolNumber,
Diameter = tool.Diameter, Diameter = tool.Diameter,
RegularHoles = tool.RegularHoles,
SlotHoles = tool.SlotHoles,
TotalHoles = tool.TotalHoles,
SlotCount = tool.SlotCount,
ToolType = tool.ToolType, ToolType = tool.ToolType,
ToolSuffixType = tool.ToolSuffixType, ToolSuffixType = tool.ToolSuffixType,
ToolCategory = tool.ToolCategory, ToolCategory = tool.ToolCategory,
@@ -1690,6 +1701,10 @@ M30";
{ {
ToolNumber = t.ToolNumber, ToolNumber = t.ToolNumber,
Diameter = t.Diameter, Diameter = t.Diameter,
RegularHoles = t.RegularHoles,
SlotHoles = t.SlotHoles,
TotalHoles = t.TotalHoles,
SlotCount = t.SlotCount,
ToolType = t.ToolType, ToolType = t.ToolType,
ToolSuffixType = t.ToolSuffixType, ToolSuffixType = t.ToolSuffixType,
ToolCategory = t.ToolCategory, ToolCategory = t.ToolCategory,
@@ -1710,6 +1725,10 @@ M30";
{ {
ToolNumber = t.ToolNumber, ToolNumber = t.ToolNumber,
Diameter = t.Diameter, Diameter = t.Diameter,
RegularHoles = t.RegularHoles,
SlotHoles = t.SlotHoles,
TotalHoles = t.TotalHoles,
SlotCount = t.SlotCount,
ToolType = t.ToolType, ToolType = t.ToolType,
ToolSuffixType = t.ToolSuffixType, ToolSuffixType = t.ToolSuffixType,
ToolCategory = t.ToolCategory, ToolCategory = t.ToolCategory,
@@ -2062,6 +2081,10 @@ M30";
{ {
ToolNumber = t.ToolNumber, ToolNumber = t.ToolNumber,
Diameter = t.Diameter, Diameter = t.Diameter,
RegularHoles = t.RegularHoles,
SlotHoles = t.SlotHoles,
TotalHoles = t.TotalHoles,
SlotCount = t.SlotCount,
ToolType = t.ToolType, ToolType = t.ToolType,
ToolSuffixType = t.ToolSuffixType, ToolSuffixType = t.ToolSuffixType,
ToolCategory = t.ToolCategory, ToolCategory = t.ToolCategory,
@@ -2082,6 +2105,10 @@ M30";
{ {
ToolNumber = t.ToolNumber, ToolNumber = t.ToolNumber,
Diameter = t.Diameter, Diameter = t.Diameter,
RegularHoles = t.RegularHoles,
SlotHoles = t.SlotHoles,
TotalHoles = t.TotalHoles,
SlotCount = t.SlotCount,
ToolType = t.ToolType, ToolType = t.ToolType,
ToolSuffixType = t.ToolSuffixType, ToolSuffixType = t.ToolSuffixType,
ToolCategory = t.ToolCategory, ToolCategory = t.ToolCategory,

View File

@@ -39,7 +39,7 @@ namespace DrillTools
/// <summary> /// <summary>
/// 孔位信息标题 /// 孔位信息标题
/// </summary> /// </summary>
public string HoleLocationsHeader => Tool != null ? $"孔位信息 (共{Tool.HoleLocations?.Count ?? 0})" : "孔位信息"; public string HoleLocationsHeader => Tool != null ? $"孔位信息/槽位行数 (共{Tool.HoleLocations?.Count ?? 0})" : "孔位信息/槽位行数";
/// <summary> /// <summary>
/// 格式化后的孔位信息 /// 格式化后的孔位信息

View File

@@ -20,6 +20,7 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
@@ -69,8 +70,8 @@
</GroupBox> </GroupBox>
<!-- 机台码信息 (仅当刀具类型为机台码时显示) --> <!-- 机台码信息 (仅当刀具类型为机台码时显示) -->
<GroupBox Grid.Row="2" <GroupBox Grid.Row="2"
Header="机台码信息" Header="机台码信息"
Margin="0,0,0,10" Margin="0,0,0,10"
Visibility="{Binding IsMachineCodeTool, Converter={StaticResource BooleanToVisibilityConverter}}"> Visibility="{Binding IsMachineCodeTool, Converter={StaticResource BooleanToVisibilityConverter}}">
<Grid Margin="10"> <Grid Margin="10">
@@ -91,8 +92,36 @@
</Grid> </Grid>
</GroupBox> </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" <TextBox IsReadOnly="True"
Text="{Binding FormattedHoleLocations, Mode=OneWay}" Text="{Binding FormattedHoleLocations, Mode=OneWay}"
FontFamily="{StaticResource CodeFontFamily}" FontFamily="{StaticResource CodeFontFamily}"
@@ -104,7 +133,7 @@
</GroupBox> </GroupBox>
<!-- 关闭按钮 --> <!-- 关闭按钮 -->
<StackPanel Grid.Row="4" <StackPanel Grid.Row="5"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Orientation="Horizontal" Orientation="Horizontal"
Margin="0,15,0,0"> Margin="0,15,0,0">

View File

@@ -50,9 +50,10 @@ namespace DrillTools
private int _toolNumber; private int _toolNumber;
private double _diameter; private double _diameter;
// private int _regularHoles; // 孔数功能已移除 private int _regularHoles;
// private int _slotHoles; // 孔数功能已移除 private int _slotHoles;
// private int _totalHoles; // 孔数功能已移除 private int _totalHoles;
private int _slotCount;
private string _parameters = string.Empty; private string _parameters = string.Empty;
private ToolType _toolType; private ToolType _toolType;
@@ -80,32 +81,41 @@ namespace DrillTools
set => SetProperty(ref _diameter, value); set => SetProperty(ref _diameter, value);
} }
// /// <summary> /// <summary>
// /// 普通孔数 /// 普通孔数
// /// </summary> /// </summary>
// public int RegularHoles public int RegularHoles
// { {
// get => _regularHoles; get => _regularHoles;
// set => SetProperty(ref _regularHoles, value); set => SetProperty(ref _regularHoles, value);
// } }
// /// <summary> /// <summary>
// /// 槽孔数 /// 槽孔实际钻孔
// /// </summary> /// </summary>
// public int SlotHoles public int SlotHoles
// { {
// get => _slotHoles; get => _slotHoles;
// set => SetProperty(ref _slotHoles, value); set => SetProperty(ref _slotHoles, value);
// } }
// /// <summary> /// <summary>
// /// 总孔数 /// 总孔数
// /// </summary> /// </summary>
// public int TotalHoles public int TotalHoles
// { {
// get => _totalHoles; get => _totalHoles;
// set => SetProperty(ref _totalHoles, value); set => SetProperty(ref _totalHoles, value);
// } }
/// <summary>
/// 槽条数G85行数
/// </summary>
public int SlotCount
{
get => _slotCount;
set => SetProperty(ref _slotCount, value);
}
/// <summary> /// <summary>
/// 钻机参数 /// 钻机参数

12619
demo_drl/s20034192b0-a2-cs.drl Normal file

File diff suppressed because it is too large Load Diff