<UserControl
    x:Class="LogoForceTestApp.Modules.MainModule.Views.ParamPage"
    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:LogoForceTestApp.Modules.MainModule.Views"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewmodels="clr-namespace:LogoForceTestApp.Modules.MainModule.ViewModels"
    d:DataContext="{d:DesignInstance Type=viewmodels:ParamPageViewModel}"
    d:DesignHeight="650"
    d:DesignWidth="1200"
    mc:Ignorable="d">

    <Grid>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <GroupBox Header="Trace参数">
                <StackPanel>
                    <hc:TextBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Necessary="True"
                        hc:InfoElement.Placeholder="station_id"
                        hc:InfoElement.Title="StationId"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Text="{Binding Param.station_id}" />
                    <!--<hc:TextBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Necessary="True"
                        hc:InfoElement.Placeholder="fixture_id"
                        hc:InfoElement.Title="FixtureId"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Text="{Binding Param.fixture_id}" />-->
                    <hc:TextBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Necessary="True"
                        hc:InfoElement.Placeholder="HeadId"
                        hc:InfoElement.Title="Cavity_Id"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Text="{Binding Param.cavity_id}" />
                    <hc:TextBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Necessary="True"
                        hc:InfoElement.Placeholder="line_id"
                        hc:InfoElement.Title="LineId"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Text="{Binding Param.line_id}" />
                    <!--<hc:TextBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Necessary="True"
                        hc:InfoElement.Placeholder="OpId"
                        hc:InfoElement.Title="OpId"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Text="{Binding Param.op_id}" />-->

                    <hc:TextBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Necessary="True"
                        hc:InfoElement.Placeholder="station_vendor"
                        hc:InfoElement.Title="station_vendor"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Text="{Binding Param.station_vendor}" />

                    <hc:TextBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Necessary="True"
                        hc:InfoElement.Placeholder="test"
                        hc:InfoElement.Title="Test"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Text="{Binding Param.test}" />
                    <hc:TextBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Necessary="True"
                        hc:InfoElement.Placeholder="OP_Id"
                        hc:InfoElement.Title="OP_Id"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Text="{Binding Param.OpId}" />
                    <hc:TextBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Necessary="True"
                        hc:InfoElement.Placeholder="上限值"
                        hc:InfoElement.Title="上限值"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Text="{Binding Param.UpperLimit}" />
                    <hc:TextBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Necessary="True"
                        hc:InfoElement.Placeholder="下限值"
                        hc:InfoElement.Title="下限值"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Text="{Binding Param.DownLimit}" />
                    <Button
                        Margin="0,16,0,0"
                        Command="{Binding SaveTraceParamCommand}"
                        Content="保存trace参数" />
                </StackPanel>
            </GroupBox>
            <GroupBox
                Grid.Column="1"
                hc:Growl.GrowlParent="True"
                Header="其他参数">
                <StackPanel>
                    <hc:TextBox
                        hc:InfoElement.Placeholder="Aim_Name"
                        hc:InfoElement.Title="AIM_NAME"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding AimName}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="AIM_UNIQUE"
                        hc:InfoElement.Title="AIM_UNIQUE"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding AIM_UNIQUE}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="INSPECTION_PROGRAM_NAME"
                        hc:InfoElement.Title="PROGRAM_NAME"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding INSPECTION_PROGRAM_NAME}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="Project"
                        hc:InfoElement.Title="Project"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding Project}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="Part"
                        hc:InfoElement.Title="Part"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding Part}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="Process"
                        hc:InfoElement.Title="Process"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding Process}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="Build"
                        hc:InfoElement.Title="Build"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding Build}" />
                    <CheckBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Title=""
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Content="上传屏蔽"
                        IsChecked="{Binding Selected}" />
                    <CheckBox
                        Width="380"
                        Margin="0,16,0,0"
                        hc:InfoElement.Title=""
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="140"
                        Content="卡关屏蔽"
                        IsChecked="{Binding TraceDisable}" />
                    <StackPanel Orientation="Horizontal">
                        <hc:TextBox
                            Width="380"
                            Margin="0,16,0,0"
                            hc:InfoElement.Title="CSV路径"
                            hc:InfoElement.TitlePlacement="Left"
                            hc:InfoElement.TitleWidth="120"
                            IsEnabled="False"
                            Text="{Binding CSVPath}" />
                        <Button VerticalAlignment="Bottom" Command="{Binding SelectFolderCommand}">...</Button>

                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <hc:TextBox
                            Width="380"
                            Margin="0,16,0,0"
                            hc:InfoElement.Title="图片路径"
                            hc:InfoElement.TitlePlacement="Left"
                            hc:InfoElement.TitleWidth="120"
                            IsEnabled="False"
                            Text="{Binding ImageSavePath}" />
                        <Button VerticalAlignment="Bottom" Command="{Binding SelectImageFolderCommand}">...</Button>

                    </StackPanel>
                    <Button
                        Margin="0,16,0,0"
                        Command="{Binding SaveOtherCommand}"
                        Content="保存" />
                </StackPanel>
            </GroupBox>
            <GroupBox
                Grid.Column="2"
                hc:Growl.GrowlParent="True"
                Header="OEE配置">
                <StackPanel>
                    <hc:TextBox
                        hc:InfoElement.Placeholder="IP"
                        hc:InfoElement.Title="OEE IP:"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding OeeIp}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="OEE Port"
                        hc:InfoElement.Title="OEE Port:"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding OeePort}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="待料间隔时间"
                        hc:InfoElement.Title="待料时间间隔(分钟)"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding WaitPartDuration}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="停机时间间隔"
                        hc:InfoElement.Title="停机时间间隔(分钟)"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding StopDuration}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="site"
                        hc:InfoElement.Title="site(站点区域)"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding Site}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="floor"
                        hc:InfoElement.Title="floor(站点楼层)"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding Floor}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="Product"
                        hc:InfoElement.Title="Product(机种名称)"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding Product}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="Line"
                        hc:InfoElement.Title="Line(线体名称)"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding Line}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="组装制程"
                        hc:InfoElement.Title="process(组装制程)"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding ProcessOee}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="具体站点"
                        hc:InfoElement.Title="terminalid(具体站点)"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding TerminalId}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="机台编号"
                        hc:InfoElement.Title="michineid(机台编号)"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding MachineId}" />
                    <hc:ComboBox
                        hc:InfoElement.Placeholder="物理地址"
                        hc:InfoElement.Title="macaddr(物理地址)"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        ItemsSource="{Binding AddressSource}"
                        SelectedItem="{Binding MacAddr}" />
                    <hc:TextBox
                        hc:InfoElement.Placeholder="本地MES地址"
                        hc:InfoElement.Title="ipaddr(本地MES地址)"
                        hc:InfoElement.TitlePlacement="Left"
                        hc:InfoElement.TitleWidth="120"
                        Text="{Binding IpAddr}" />
                    <CheckBox
                        Width="380"
                        Margin="0,16,0,0"
                        Content="上传屏蔽"
                        IsChecked="{Binding UnUseOee}" />
                    <StackPanel Orientation="Horizontal">
                        <hc:TextBox
                            Width="380"
                            Margin="0,16,0,0"
                            hc:InfoElement.Title="保存路径"
                            hc:InfoElement.TitlePlacement="Left"
                            hc:InfoElement.TitleWidth="120"
                            IsEnabled="False"
                            Text="{Binding OeePath}" />
                        <Button VerticalAlignment="Bottom" Command="{Binding SelectOeeFolderCommand}">...</Button>
                    </StackPanel>
                    <StackPanel
                        Margin="0,16,0,0"
                        HorizontalAlignment="Center"
                        Orientation="Horizontal">
                        <Button
                            Margin="10"
                            Command="{Binding SaveOeeCommand}"
                            Content="保存配置" />
                        <Button
                            Margin="10"
                            Command="{Binding DebugCommand}"
                            Content="调试" />
                    </StackPanel>

                </StackPanel>
            </GroupBox>

        </Grid>

    </Grid>
</UserControl>