Files
Shrlalgo.RvKits/Sai.RvKits/ModelManager/ModelCheckView.xaml

168 lines
8.1 KiB
Plaintext
Raw Normal View History

2024-09-22 11:05:41 +08:00
<ex:FluentWindowEx
x:Class="Sai.RvKits.RvFamily.ModelCheckView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ex="https://github.com/sherlockforrest/Wpf.Ui.Extend"
xmlns:local="clr-namespace:Sai.RvKits.RvFamily"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="模型检查"
Width="600"
MinHeight="500"
d:DataContext="{d:DesignInstance local:ModelCheckViewModel}"
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Sai.RvKits;component/WPFUI.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander Header="{Binding Name}" IsExpanded="True">
<!--<Expander.Header>
<TextBlock Text="{Binding Path=Name}"/>
</Expander.Header>-->
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Window.Resources>
<ex:AutoGrid
ChildMargin="5"
Columns="*,Auto"
Rows="*,Auto,Auto">
<DataGrid
Grid.ColumnSpan="2"
AutoGenerateColumns="False"
CanUserAddRows="False"
IsReadOnly="True"
ItemsSource="{Binding Items}"
ToolTip="双击行可快速定位">
<b:Interaction.Triggers>
<b:EventTrigger EventName="MouseDoubleClick">
<b:InvokeCommandAction Command="{Binding ShowElementCommand}" CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}, Mode=FindAncestor}}" />
</b:EventTrigger>
</b:Interaction.Triggers>
<DataGrid.GroupStyle>
<GroupStyle ContainerStyle="{StaticResource GroupHeaderStyle}">
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter />
</ItemsPanelTemplate>
</GroupStyle.Panel>
</GroupStyle>
</DataGrid.GroupStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Element.Id}" Header="ID" />
<DataGridTextColumn Binding="{Binding Element.Category.Name}" Header="族类别名称" />
<DataGridTextColumn Binding="{Binding Element.Name}" Header="类型或实例名称" />
<!--<DataGridTextColumn Binding="{Binding ErrorMessage}" Header="错误信息" />-->
<!--<DataGridTemplateColumn Header="操作">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
-->
<!-- 按钮参数绑定到当前行的绑定的Item -->
<!--
<Button
Command="{Binding DataContext.ShowElementCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=DataGrid}}"
CommandParameter="{Binding}"
Content="定位构件" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
<!-- ReSharper disable once Xaml.BindingWithContextNotResolved -->
<DataGridTextColumn Binding="{Binding Element.ReferenceLevel.Name}" Header="参照标高" />
<!-- ReSharper disable once Xaml.BindingWithContextNotResolved -->
<DataGridTextColumn Binding="{Binding Element.MEPSystem.Name}" Header="系统" />
<!-- ReSharper disable once Xaml.BindingWithContextNotResolved -->
<DataGridTextColumn Binding="{Binding Element.Host.Name}" Header="主体" />
<!-- ReSharper disable once Xaml.BindingWithContextNotResolved -->
<DataGridTextColumn Binding="{Binding Element.Room.Name}" Header="房间" />
</DataGrid.Columns>
</DataGrid>
<StackPanel
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2">
<ui:Card>
<TextBlock Text="{Binding ProjectBasePoint, StringFormat=项目基点:{}{0}}" />
</ui:Card>
<ui:Card>
<TextBlock Text="{Binding SharedBasePoint, StringFormat=测量点:{}{0}}" />
</ui:Card>
</StackPanel>
<UniformGrid
Grid.Row="2"
Grid.Column="0"
Rows="3">
<CheckBox
Content="管线坡度"
IsChecked="{Binding IsCheckSlope}"
ToolTip="管线坡度错误" />
<CheckBox
Content="孤立管线"
IsChecked="{Binding IsCheckLength}"
ToolTip="检查管线长度是否过短" />
<CheckBox
Content="参照标高"
IsChecked="{Binding IsCheckLevel}"
ToolTip="检查构件的参照标高" />
<CheckBox
Content="命名要求"
IsChecked="{Binding IsCheckName}"
ToolTip="检查构件的三段式命名" />
<CheckBox
Content="构件复杂度"
IsChecked="{Binding IsCheckSymbolGeometry}"
ToolTip="检查构件的复杂程度,避免模型导出、轻量化失败" />
<CheckBox
Content="属性检查"
IsChecked="{Binding IsCheckProps}"
ToolTip="检查构件属性是否存在,是否填写" />
<CheckBox
Content="重叠管线"
IsChecked="{Binding IsCheckEqual}"
ToolTip="检查管线是否重叠" />
</UniformGrid>
<UniformGrid
Grid.Row="2"
Grid.Column="1"
Rows="2">
<UniformGrid Rows="2">
<TextBlock Text="{Binding ErrorCount, Mode=TwoWay, StringFormat=错误数量:{}{0}}" TextWrapping="WrapWithOverflow" />
<CheckBox Content="使用剖切框" IsChecked="{Binding UseSectionBox}" />
</UniformGrid>
<UniformGrid Rows="2">
<!--
md:ButtonProgressAssist.IsIndeterminate="{Binding CheckModelCommand.ExecutionTask,Converter={StaticResource TaskResultConverter}, Mode=OneWay}"
md:ButtonProgressAssist.IsIndicatorVisible="{Binding CheckModelCommand.IsRunning, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}"
md:ButtonProgressAssist.Value="-1"
-->
<Button
Width="80"
Margin="5"
Command="{Binding CheckModelCommand}"
Content="模型检查" />
<Button
Width="80"
Command="{Binding ExportToExcelCommand}"
Content="导出结果" />
<Button
Width="80"
Margin="5"
Command="{Binding ModifyModelCommand}"
Content="矫正错误"
ToolTip="对参照标高进行修改、立管坡度修正" />
</UniformGrid>
</UniformGrid>
</ex:AutoGrid>
</ex:FluentWindowEx>