Computing.razor 8.04 KB
@page "/Computing"
@inject GrooveService _grooveService
@inject IMessageService _message
@using HHECS.RobotTool.Model;
@using HHECS.RobotTool.Services;
@using HHECS.RobotTool.Dto;

<Card Title="输入参数" Size="small">
    <GridRow Gutter="(16,24)">
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="InputParameter.GrooveWidth" BindOnInput OnBlur="InputOnChange">
                 <AddOnBefore>坡口宽度</AddOnBefore>
             </AntDesign.Input>
         </GridCol>
         <GridCol Class="gutter-row" Span="6">
             <AntDesign.Input @bind-Value="InputParameter.ReservedGapForGroove" BindOnInput OnBlur="InputOnChange">
                 <AddOnBefore>坡口预留间隙</AddOnBefore>
             </AntDesign.Input>
         </GridCol>
         <GridCol Class="gutter-row" Span="6">
             <AntDesign.Input @bind-Value="InputParameter.AdditionalWidthRequiredOnOneSideAfterCovering" BindOnInput OnBlur="InputOnChange">
                 <AddOnBefore>盖面后单边所需增加余宽</AddOnBefore>
             </AntDesign.Input>
         </GridCol>
         <GridCol Class="gutter-row" Span="6">
             <AntDesign.Input @bind-Value="InputParameter.GrooveDepth" BindOnInput OnBlur="InputOnChange">
                 <AddOnBefore>坡口深度</AddOnBefore>
             </AntDesign.Input>
         </GridCol>
         <GridCol Class="gutter-row" Span="6">
             <AntDesign.Input @bind-Value="InputParameter.SizeOfTheBluntEdgeOfTheGroove" BindOnInput OnBlur="InputOnChange">
                 <AddOnBefore>坡口钝边大小</AddOnBefore>
             </AntDesign.Input>
         </GridCol>
         <GridCol Class="gutter-row" Span="6">
             <AntDesign.Input @bind-Value="InputParameter.WeldReinforcementRequiredAfterCovering" BindOnInput OnBlur="InputOnChange">
                 <AddOnBefore>盖面后所需焊缝余高</AddOnBefore>
             </AntDesign.Input>
         </GridCol>
         <GridCol Class="gutter-row" Span="6">
             <AntDesign.Input @bind-Value="InputParameter.WeldingWire" BindOnInput OnBlur="InputOnChange">
                 <AddOnBefore>焊丝直径</AddOnBefore>
             </AntDesign.Input>
         </GridCol>
         <GridCol Class="gutter-row" Span="6">
             <AntDesign.Input @bind-Value="InputParameter.WeldLength" BindOnInput OnBlur="InputOnChange">
                 <AddOnBefore>焊缝长度</AddOnBefore>
             </AntDesign.Input>
         </GridCol>
     </GridRow>
 </Card>

 <Card Title="输出数据" Size="small">
     <GridRow Gutter="(16,24)">
         <GridCol Class="gutter-row" Span="6">
             <AntDesign.Input @bind-Value="OutputParameter.Weld_Num" ReadOnly>
                <AddOnBefore>焊接道数判断 N</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.WeldHeightAfterWelding" ReadOnly>
                <AddOnBefore>焊后焊缝高度H(mm)</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.WeldWidthAfterWelding" ReadOnly>
                <AddOnBefore>焊后焊缝宽度A(mm)</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.GrooveCrossSectionalArea" ReadOnly>
                <AddOnBefore>坡口截面积(mm³)</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.OneLayerWireFeedingSpeed" ReadOnly>
                <AddOnBefore>一层(打底)送丝速度V1</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.OneLayerCurrent" ReadOnly>
                <AddOnBefore>对应电流01(A)</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.CoverWireFeedingSpeed" ReadOnly>
                <AddOnBefore>盖面送丝速度V2</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.CoverWireFeedingCurrent" ReadOnly>
                <AddOnBefore>对应电流02(A)</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.WeldingWireCrossSectionalArea" ReadOnly>
                <AddOnBefore>焊丝截面积s2(mm²)</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.TotalDepositionAmount" ReadOnly>
                <AddOnBefore>总熔敷量(mm³)</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.WeldingWireLengthAndUsage" ReadOnly>
                <AddOnBefore>焊丝长度用量(mm)</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.TotalDepositionTime" ReadOnly>
                <AddOnBefore>总熔敷时间(s)</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
        <GridCol Class="gutter-row" Span="6">
            <AntDesign.Input @bind-Value="OutputParameter.Layers" ReadOnly>
                <AddOnBefore>层数</AddOnBefore>
            </AntDesign.Input>
        </GridCol>
    </GridRow>
</Card>

<Card Title="工艺参数" Size="small">
    <Table TItem="Technology" DataSource="@Technologies" PaginationPosition="@paginationPosition" Size="TableSize.Small" ScrollX="1800">
        <PropertyColumn Property="c=>c.Layer" Fixed="left" />
        <PropertyColumn Property="c=>c.LayerHeight" />
        <PropertyColumn Property="c=>c.LayerWidth" />
        <PropertyColumn Property="c=>c.DepositionAmount" />
        <PropertyColumn Property="c=>c.DepositionTime" />
        <PropertyColumn Property="c=>c.WeldedHeight" />
        <PropertyColumn Property="c=>c.ResidualWeldingHeight" />
        <PropertyColumn Property="c=>c.RemainingDepositAmount" />
        <PropertyColumn Property="c=>c.RemainingDepositTime" />
        <PropertyColumn Property="c=>c.WeldingSpeed" />
        <PropertyColumn Property="c=>c.Amplitude" />
        <PropertyColumn Property="c=>c.SwingFrequency" />
        <PropertyColumn Property="c=>c.LeftAndRightDwellTime" />
        <PropertyColumn Property="c=>c.UsingCurrent" />
        <PropertyColumn Property="c=>c.WeldTotal" />
    </Table>
</Card>
@* </PageContainer> *@

@code {
    string style = "background: #0092ff; padding: 8px 0;";
    IEnumerable<Technology> Technologies = new List<Technology>();

    InputParameter InputParameter = new InputParameter();

    OutputParameter OutputParameter = new OutputParameter();

    string paginationPosition = "none";

    protected override void OnInitialized()
    {
        InputParameter = new InputParameter
        {
            GrooveWidth = 37,
            GrooveDepth = 30,
            WeldingWire = 1.2,
            ReservedGapForGroove = 0,
            SizeOfTheBluntEdgeOfTheGroove = 2,
            WeldLength = 1000,
            AdditionalWidthRequiredOnOneSideAfterCovering = 1.5,
            WeldReinforcementRequiredAfterCovering = 2
        };
        (OutputParameter, Technologies) = _grooveService.GetExcelData(InputParameter);
        base.OnInitialized();
    }

    private void InputOnChange(FocusEventArgs args)
    {
        (OutputParameter, Technologies) = _grooveService.GetExcelData(InputParameter);
        if (Technologies.Count() > 10)
        {
            paginationPosition = "bottomCenter";
        }
        else
        {
            paginationPosition = "none";
        }
        _message.Info("数据更新成功");
    }
}