253 lines
11 KiB
XML
253 lines
11 KiB
XML
<Window
|
||
x:Class="DrillTools.MainWindow"
|
||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||
xmlns:local="clr-namespace:DrillTools"
|
||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
Title="钻带处理工具(支持拖入钻带文件)"
|
||
Width="1000"
|
||
Height="550"
|
||
AllowDrop="True"
|
||
mc:Ignorable="d">
|
||
|
||
<Window.DataContext>
|
||
<local:MainWindowViewModel />
|
||
</Window.DataContext>
|
||
|
||
<Grid>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="*" />
|
||
<RowDefinition Height="Auto" />
|
||
</Grid.RowDefinitions>
|
||
|
||
<!-- 工具栏 -->
|
||
<ToolBar Grid.Row="0">
|
||
<!--<Button
|
||
Name="LoadSampleDataButton"
|
||
Click="LoadSampleDataButton_Click"
|
||
Content="加载示例数据" />
|
||
<Separator />-->
|
||
<Button
|
||
Name="LoadDrillTapeButton"
|
||
Click="LoadDrillTapeButton_Click"
|
||
Content="加载钻带文件" />
|
||
<!--<Button
|
||
Name="TestReferenceDrillTapeButton"
|
||
Click="TestReferenceDrillTapeButton_Click"
|
||
Content="测试参考钻带功能" />-->
|
||
<Menu>
|
||
<MenuItem Header="排序功能">
|
||
<MenuItem
|
||
Name="ReorderToolsMenuItem"
|
||
Click="ReorderToolsButton_Click"
|
||
Header="重排刀序" />
|
||
<MenuItem
|
||
Name="GenerateSortSeedMenuItem"
|
||
Click="GenerateSortSeedButton_Click"
|
||
Header="生成排序种子"
|
||
IsEnabled="{Binding HasOriginalFile}" />
|
||
<Separator />
|
||
<MenuItem
|
||
Name="UseReferenceDrillTapeMenuItem"
|
||
Click="UseReferenceDrillTapeButton_Click"
|
||
Header="使用指定钻带的刀序" />
|
||
<MenuItem
|
||
Name="UseSortSeedMenuItem"
|
||
Click="UseSortSeedButton_Click"
|
||
Header="使用指定种子的刀序" />
|
||
</MenuItem>
|
||
</Menu>
|
||
<Button
|
||
Name="ApplyOrderButton"
|
||
Click="ApplyOrderButton_Click"
|
||
Content="应用并保存"
|
||
IsEnabled="{Binding HasOriginalFile}" />
|
||
<Button
|
||
Name="ToggleTopmostButton"
|
||
Click="ToggleTopmostButton_Click"
|
||
Content="{Binding TopmostButtonText}" />
|
||
</ToolBar>
|
||
|
||
<!-- 主内容区域 -->
|
||
<Grid Grid.Row="1">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*" MinWidth="400" />
|
||
<ColumnDefinition Width="2*" />
|
||
</Grid.ColumnDefinitions>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="100" />
|
||
<RowDefinition Height="*" />
|
||
</Grid.RowDefinitions>
|
||
|
||
<!-- 刀具列表 -->
|
||
<GroupBox
|
||
Grid.RowSpan="2"
|
||
Grid.Column="0"
|
||
Header="刀具列表(可拖动排序)">
|
||
<Grid>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="*" />
|
||
<RowDefinition Height="Auto" />
|
||
</Grid.RowDefinitions>
|
||
|
||
<ListView
|
||
Name="ToolsListView"
|
||
Grid.Row="0"
|
||
AllowDrop="True"
|
||
ItemsSource="{Binding Tools}"
|
||
MouseDoubleClick="ToolsListView_MouseDoubleClick"
|
||
SelectedItem="{Binding SelectedTool}">
|
||
<ListView.View>
|
||
<GridView>
|
||
<GridViewColumn
|
||
Width="80"
|
||
DisplayMemberBinding="{Binding ToolNumber, StringFormat=T{0:D2}}"
|
||
Header="刀具编号" />
|
||
<GridViewColumn
|
||
Width="80"
|
||
DisplayMemberBinding="{Binding Diameter, StringFormat=F3}"
|
||
Header="孔径(mm)" />
|
||
<GridViewColumn
|
||
Width="70"
|
||
DisplayMemberBinding="{Binding ToolTypeDisplay}"
|
||
Header="类型" />
|
||
<GridViewColumn
|
||
Width="90"
|
||
DisplayMemberBinding="{Binding ToolSuffixTypeDisplay}"
|
||
Header="尾号类型" />
|
||
</GridView>
|
||
</ListView.View>
|
||
<ListView.ItemContainerStyle>
|
||
<Style BasedOn="{StaticResource {x:Type ListViewItem}}" TargetType="ListViewItem">
|
||
<Style.Triggers>
|
||
<Trigger Property="IsMouseOver" Value="True">
|
||
<Setter Property="Background" Value="#E0E0E0" />
|
||
</Trigger>
|
||
<Trigger Property="IsSelected" Value="True">
|
||
<Setter Property="Background" Value="#0078D4" />
|
||
<Setter Property="Foreground" Value="White" />
|
||
</Trigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</ListView.ItemContainerStyle>
|
||
</ListView>
|
||
|
||
<!-- 插入位置指示器 -->
|
||
<Rectangle
|
||
x:Name="InsertionIndicator"
|
||
Grid.Row="0"
|
||
Height="2"
|
||
Margin="0,0,0,0"
|
||
HorizontalAlignment="Stretch"
|
||
Fill="#FF0078D4"
|
||
IsHitTestVisible="False"
|
||
Visibility="Collapsed" />
|
||
|
||
<!-- 上移/下移按钮 -->
|
||
<StackPanel
|
||
Grid.Row="1"
|
||
Margin="0,5,0,5"
|
||
HorizontalAlignment="Center"
|
||
Orientation="Horizontal">
|
||
<Button
|
||
Name="MoveUpButton"
|
||
Width="80"
|
||
Height="35"
|
||
Margin="5,0"
|
||
Click="MoveUpButton_Click"
|
||
Content="↑ 上移"
|
||
IsEnabled="{Binding CanMoveUp}" />
|
||
<Button
|
||
Name="MoveDownButton"
|
||
Width="80"
|
||
Height="35"
|
||
Margin="5,0"
|
||
Click="MoveDownButton_Click"
|
||
Content="↓ 下移"
|
||
IsEnabled="{Binding CanMoveDown}" />
|
||
</StackPanel>
|
||
</Grid>
|
||
</GroupBox>
|
||
|
||
<!-- 基础信息显示 -->
|
||
<GroupBox
|
||
Grid.Row="0"
|
||
Grid.Column="1"
|
||
Header="基础信息">
|
||
<Grid Margin="1">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="Auto" />
|
||
<RowDefinition Height="Auto" />
|
||
</Grid.RowDefinitions>
|
||
|
||
<!-- 文件名单独一行 -->
|
||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||
<TextBlock VerticalAlignment="Center" Text="文件名:" />
|
||
<TextBlock
|
||
Margin="0,0,0,5"
|
||
VerticalAlignment="Center"
|
||
FontWeight="Bold"
|
||
Text="{Binding FileNameWithoutExtension}" />
|
||
</StackPanel>
|
||
|
||
<!-- 三个最小直径信息在同一行 -->
|
||
<Grid Grid.Row="1">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*" />
|
||
<ColumnDefinition Width="*" />
|
||
<ColumnDefinition Width="*" />
|
||
</Grid.ColumnDefinitions>
|
||
|
||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||
<TextBlock VerticalAlignment="Center" Text="最小钻咀:" />
|
||
<TextBlock
|
||
Margin="5,0,0,0"
|
||
VerticalAlignment="Center"
|
||
Text="{Binding MinDrillDiameter, StringFormat=F3}" />
|
||
</StackPanel>
|
||
|
||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||
<TextBlock VerticalAlignment="Center" Text="最小槽刀:" />
|
||
<TextBlock
|
||
Margin="5,0,0,0"
|
||
VerticalAlignment="Center"
|
||
Text="{Binding MinSlotDiameter, StringFormat=F3}" />
|
||
</StackPanel>
|
||
|
||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||
<TextBlock VerticalAlignment="Center" Text="最小EA刀:" />
|
||
<TextBlock
|
||
Margin="5,0,0,0"
|
||
VerticalAlignment="Center"
|
||
Text="{Binding MinEADiameter, StringFormat=F3}" />
|
||
</StackPanel>
|
||
</Grid>
|
||
</Grid>
|
||
</GroupBox>
|
||
|
||
<!-- 钻带内容显示 -->
|
||
<GroupBox
|
||
Grid.Row="1"
|
||
Grid.Column="1"
|
||
Header="钻带内容">
|
||
<TextBox
|
||
Name="DrillTapeTextBox"
|
||
HorizontalScrollBarVisibility="Auto"
|
||
IsReadOnly="True"
|
||
Style="{StaticResource CodeTextBoxStyle}"
|
||
Text="{Binding DrillTapeContent}"
|
||
TextWrapping="Wrap"
|
||
VerticalScrollBarVisibility="Auto" />
|
||
</GroupBox>
|
||
</Grid>
|
||
|
||
<!-- 状态栏 -->
|
||
<StatusBar Grid.Row="2">
|
||
<StatusBarItem>
|
||
<TextBlock Text="就绪" />
|
||
</StatusBarItem>
|
||
</StatusBar>
|
||
</Grid>
|
||
</Window> |