GrooveComputerPage.xaml 19.7 KB
<Page
    x:Class="HHECS.RobotTool.View.GrooveComputerPage"
    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:hc="https://handyorg.github.io/handycontrol"
    xmlns:local="clr-namespace:HHECS.RobotTool.View"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewmodel="clr-namespace:HHECS.RobotTool.ViewModel"
    Title="GrooveComputerPage"
    d:DataContext="{d:DesignInstance Type=viewmodel:GrooveComputerVM}"
    d:DesignHeight="450"
    d:DesignWidth="800"
    mc:Ignorable="d">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <GroupBox
            Grid.Row="0"
            Padding="5"
            hc:TitleElement.TitlePlacement="Left"
            Header="输入参数"
            Style="{StaticResource GroupBoxTab.Small}">
            <Border Background="{DynamicResource RegionBrush}" CornerRadius="4">
                <hc:UniformSpacingPanel ChildWrapping="Wrap" Spacing="10">
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="坡口宽度(mm)" />
                        </Border>
                        <TextBox MinWidth="104" Text="{Binding InputParameter.GrooveWidth, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="坡口预留间隙(mm)" />
                        </Border>
                        <TextBox MinWidth="123" Text="{Binding InputParameter.ReservedGap, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="盖面后单边所需增加余宽(mm)" />
                        </Border>
                        <TextBox
                            MinWidth="60"
                            HorizontalAlignment="Stretch"
                            Text="{Binding InputParameter.WeldWidth, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="坡口深度(mm)" />
                        </Border>
                        <TextBox
                            MinWidth="104"
                            HorizontalAlignment="Stretch"
                            Text="{Binding InputParameter.GrooveDepth, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="坡口钝边大小(mm)" />
                        </Border>
                        <TextBox
                            MinWidth="123"
                            HorizontalAlignment="Stretch"
                            Text="{Binding InputParameter.BluntEdgeSize, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="盖面后所需焊缝余高(mm)" />
                        </Border>
                        <TextBox
                            MinWidth="83"
                            HorizontalAlignment="Stretch"
                            Text="{Binding InputParameter.WeldHeight, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="焊丝直径(mm)" />
                        </Border>
                        <TextBox
                            MinWidth="104"
                            HorizontalAlignment="Stretch"
                            Text="{Binding InputParameter.WeldingWire, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="焊缝长度(mm)" />
                        </Border>
                        <TextBox
                            MinWidth="147"
                            HorizontalAlignment="Stretch"
                            Text="{Binding InputParameter.WeldLength, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <Button
                        hc:IconElement.Geometry="{StaticResource SearchGeometry}"
                        Command="{Binding ComputerCommand}"
                        Content="计算"
                        Style="{StaticResource ButtonPrimary}" />
                    <Button
                        hc:IconElement.Geometry="{StaticResource RotateLeftGeometry}"
                        Command="{Binding ResetCommand}"
                        Content="重置"
                        Style="{StaticResource ButtonDefault}" />
                </hc:UniformSpacingPanel>
            </Border>
        </GroupBox>
        <GroupBox
            Grid.Row="1"
            Margin="0,2"
            Padding="5"
            hc:TitleElement.TitlePlacement="Left"
            Header="输出参数"
            Style="{StaticResource GroupBoxTab.Small}">
            <Border Background="{DynamicResource RegionBrush}" CornerRadius="4">
                <hc:UniformSpacingPanel ChildWrapping="Wrap" Spacing="10">
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="焊接道数判断" />
                        </Border>
                        <TextBox
                            MinWidth="110"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.Weld_Num, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="焊后焊缝高度(mm)" />
                        </Border>
                        <TextBox
                            MinWidth="123"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.WeldHeightAfterWelding, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="焊后焊缝宽度(mm)" />
                        </Border>
                        <TextBox
                            MinWidth="120"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.WeldWidthAfterWelding, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="坡口截面积(mm³)" />
                        </Border>
                        <TextBox
                            MinWidth="85"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.GrooveCrossSectionalArea, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="一层(打底)送丝速度V1" />
                        </Border>
                        <TextBox
                            MinWidth="108"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.OneLayerWireFeedingSpeed, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="焊丝截面积s2(mm²)" />
                        </Border>
                        <TextBox
                            MinWidth="114"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.WeldingWireCrossSectionalArea, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="总熔敷量(mm³)" />
                        </Border>
                        <TextBox
                            MinWidth="96"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.TotalDepositionAmount, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="对应电流01(A)" />
                        </Border>
                        <TextBox
                            MinWidth="150"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.OneLayerCurrent, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="盖面送丝速度V2" />
                        </Border>
                        <TextBox
                            MinWidth="135"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.CoverWireFeedingSpeed, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="对应电流02(A)" />
                        </Border>
                        <TextBox
                            MinWidth="100"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.CoverWireFeedingCurrent, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="焊后焊缝宽度(mm)" />
                        </Border>
                        <TextBox
                            MinWidth="126"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.WeldWidthAfterWelding, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="焊丝长度用量(mm)" />
                        </Border>
                        <TextBox
                            MinWidth="120"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.WeldingWireLengthAndUsage, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="总熔敷时间(s)" />
                        </Border>
                        <TextBox
                            MinWidth="105"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.TotalDepositionTime, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                    <hc:ElementGroup
                        Height="30"
                        Margin="0,1"
                        VerticalAlignment="Center"
                        Layout="Stack">
                        <Border Padding="6,0" Style="{StaticResource BorderRegion}">
                            <TextBlock VerticalAlignment="Center" Text="层数" />
                        </Border>
                        <TextBox
                            MinWidth="205"
                            IsEnabled="False"
                            IsReadOnly="True"
                            Text="{Binding OutputParameter.Layers, UpdateSourceTrigger=PropertyChanged}" />
                    </hc:ElementGroup>
                </hc:UniformSpacingPanel>
            </Border>
        </GroupBox>
        <DataGrid
            Grid.Row="2"
            hc:DataGridAttach.CanUnselectAllWithBlankArea="True"
            hc:DataGridAttach.ShowRowNumber="False"
            AutoGenerateColumns="False"
            HeadersVisibility="Column"
            IsReadOnly="True"
            ItemsSource="{Binding Technologies}"
            RowHeaderWidth="60"
            Style="{StaticResource DataGrid.Small}">
            <!--<DataGrid.RowHeaderTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=DataGridRow}}" />
                </DataTemplate>
            </DataGrid.RowHeaderTemplate>-->
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Layer}" Header="层号" />
                <DataGridTextColumn Binding="{Binding LayerHeight}" Header="层高(mm)" />
                <DataGridTextColumn Binding="{Binding LayerWidth}" Header="层宽(mm)" />
                <DataGridTextColumn Binding="{Binding DepositionAmount}" Header="熔敷量01(mm³)" />
                <DataGridTextColumn Binding="{Binding DepositionTime}" Header="熔敷时间01(s)" />
                <DataGridTextColumn Binding="{Binding WeldedHeight}" Header="已焊高(mm)" />
                <DataGridTextColumn Binding="{Binding ResidualWeldingHeight}" Header="余焊高(mm)" />
                <DataGridTextColumn Binding="{Binding RemainingDepositAmount}" Header="余熔敷量(mm³)" />
                <DataGridTextColumn Binding="{Binding RemainingDepositTime}" Header="余熔敷时间(s)" />
                <DataGridTextColumn Binding="{Binding WeldingSpeed}" Header="焊接速度v01(cm/min)" />
                <DataGridTextColumn Binding="{Binding Amplitude}" Header="振幅(mm)" />
                <DataGridTextColumn Binding="{Binding SwingFrequency}" Header="摆动频率(Hz)" />
                <DataGridTextColumn Binding="{Binding LeftAndRightDwellTime}" Header="左右停留时间(s)" />
                <DataGridTextColumn Binding="{Binding UsingCurrent}" Header="使用电流(A)" />
                <DataGridTextColumn Binding="{Binding WeldTotal}" Header="焊接道数" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Page>