Computing.razor 8.22 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()
    {
        var inputResult = _grooveService.GetInputParameterDefault();
        if (!inputResult.Success)
        {
            _message.Error($"获取默输入参数失败:{inputResult.Msg}");
            return;
        }
        inputParameter = inputResult.Data;
        var result = _grooveService.GetExcelData(inputParameter);
        if (!result.Success)
        {
            _message.Error($"数据计算出现异常:{result.Msg}");
            return;
        }
        (outputParameter, technologies) = result.Data;
        base.OnInitialized();
    }

    private void InputOnChange(FocusEventArgs args)
    {
        var result = _grooveService.GetExcelData(inputParameter);
        if (!result.Success)
        {
            _message.Error($"数据计算出现异常:{result.Msg}");
            return;
        }
        (outputParameter, technologies) = result.Data;
        if (technologies.Count() > 10)
        {
            paginationPosition = "bottomCenter";
        }
        else
        {
            paginationPosition = "none";
        }
        _message.Info("数据更新成功");
    }
}