<Page x:Class="BoFilTest.UI.StartPage"
        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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:BoFilTest.UI"
        mc:Ignorable="d"
        d:DesignWidth="1400"
        Title="BoFilTest">
    <Page.Resources>
        <Style TargetType="TextBox">
            <Setter Property="Margin" Value="2,2,2,2"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <EventSetter Event="GotKeyboardFocus" Handler="TextBox_GotKeyboardFocus"/>
        </Style>
        <Style TargetType="TextBlock">
            <Setter Property="Margin" Value="5,2,5,2"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style TargetType="CheckBox">
            <Setter Property="Margin" Value="2,2,2,2"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
    </Page.Resources>
    <Grid x:Name="MainLayout" Margin="6, 6, 6, 6" Grid.Row="0" Grid.Column="0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Title}" FontSize="36" VerticalAlignment="Center"/>
            <TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding DateTime}" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Top"/>
            <Image Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Source="{StaticResource Logo}" Width="400"  HorizontalAlignment="Right" VerticalAlignment="Top" Margin="8"/>
        </Grid>
        <Grid Margin="0,10,0,0" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <TextBlock x:Name="projectNumber" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="PROJECT_NUMBER" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="3" Text="{Binding ProjectNumber}"/>
            <TextBlock x:Name="orderNumber" Grid.Row="0" Grid.Column="7" Grid.ColumnSpan="2" Text="ORDER_NUMBER" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="0" Grid.Column="9" Grid.ColumnSpan="3" Text="{Binding PurchaseOrderNumber}"/>

            <TextBlock x:Name="customer" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="CUSTOMER"  HorizontalAlignment="Right"/>
            <TextBox Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="3" Text="{Binding Client}" />
            <TextBlock x:Name="conductor" Grid.Row="1" Grid.Column="7" Grid.ColumnSpan="2" Text="CONDUCTOR"  HorizontalAlignment="Right"/>
            <TextBox Grid.Row="1" Grid.Column="9" Grid.ColumnSpan="3" Text="{Binding TestOperator}" />

            <TextBlock x:Name="labEquipment" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Text="LAB_EQUIPMENT"  HorizontalAlignment="Right"/>
            <TextBox Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="10" Text="{Binding LabEquipment}" />

            <TextBlock x:Name="intervalLabel" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Text="ACQUISITION_INTERVAL" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="3" TextWrapping="Wrap" Text="{Binding AcquisitionInterval}"/>
        </Grid>

        <TextBlock x:Name="productData" Grid.Row="2" Text="PRODUCT_DATA" FontSize="24"/>

        <Grid Margin="0, 0, 0, 0" Grid.Row="3" Grid.Column="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="PRODUCT_LABEL"  HorizontalAlignment="Right"/>
            <TextBox Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="3" Text="{Binding Product}" />
            <TextBlock Grid.Row="0" Grid.Column="7" Grid.ColumnSpan="2" Text="PRODUCT_NUMBER_LABEL"  HorizontalAlignment="Right"/>
            <TextBox Grid.Row="0" Grid.Column="9" Grid.ColumnSpan="3" Text="{Binding ProductNumber}" />

            <TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="FILTER_CLOTH" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="3" Text="{Binding FilterCloth}" />
            <TextBlock Grid.Row="1" Grid.Column="7" Grid.ColumnSpan="2" Text="GAS_TEMPERATURE" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="1" Grid.Column="9" Grid.ColumnSpan="3" Text="{Binding GasTemperature}"/>

            <TextBlock Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="12" Text="SUSPENSION_LABEL"  FontSize="14" Margin="10,10,10,2"/>
            
            <TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Text="SOLID_DENSITY" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="2" Text="{Binding SolidDensity, StringFormat=N0}"/>
            <TextBlock Grid.Row="3" Grid.Column="4" Grid.ColumnSpan="2" Text="LIQUID_DENSITY" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="3" Grid.Column="6" Grid.ColumnSpan="2" Text="{Binding LiquidDensity, StringFormat=N0}"/>
            <TextBlock Grid.Row="3" Grid.Column="8" Grid.ColumnSpan="2" Text="DYNAMIC_VISCOSITY" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="3" Grid.Column="10" Grid.ColumnSpan="2" Text="{Binding DynamicViscosity, StringFormat=N2}"/>
            
            <TextBlock Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Text="SUSPENSION_CONCENTRATION_LABEL" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2" Text="{Binding SuspensionConcentration}"/>
            <TextBlock Grid.Row="4" Grid.Column="4" Grid.ColumnSpan="2" Text="SUSPENSION_TEMPERATURE_LABEL" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="4" Grid.Column="6" Grid.ColumnSpan="2" Text="{Binding SuspensionTemperature}"/>
            
            <TextBlock  Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="12" Text="COAGULANT_LABEL"  FontSize="14" Margin="10,10,10,2"/>

            <TextBlock Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Text="COAGULANT_CONCENTRATION_LABEL" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="2" Text="{Binding CoagulantConcentration}"/>
            <TextBlock Grid.Row="6" Grid.Column="4" Grid.ColumnSpan="2" Text="COAGULANT_TYPE_LABEL" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="6" Grid.Column="6" Grid.ColumnSpan="2" Text="{Binding CoagulantType}"/>
            <TextBlock Grid.Row="6" Grid.Column="8" Grid.ColumnSpan="2" Text="COAGULANT_AMOUNT_LABEL" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="6" Grid.Column="10" Grid.ColumnSpan="2" Text="{Binding CoagulantAmount}"/>
        </Grid>

        <TextBlock x:Name="filtrationDataLabel" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="12" Text="FILTRATION_DATA_LABEL" FontSize="24"/>
        <Grid Margin="0, 0, 0, 0" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="12">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="10"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <TextBlock x:Name="filterArea" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="FILTER_AREA" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="2" TextWrapping="Wrap" Text="{Binding FilterArea}" />
            <TextBlock x:Name="filtrationPressureDifference" Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" Text="FILTRATION_PRESSURE_DIFFERENCE" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="0" Grid.Column="6" Grid.ColumnSpan="2" TextWrapping="Wrap" Text="{Binding FilterPressureDifference}"/>
            <TextBlock x:Name="demoisturizingRatio" Grid.Row="0" Grid.Column="8" Grid.ColumnSpan="2" Text="DEMOISTURIZATION_RATIO" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="0" Grid.Column="10" Grid.ColumnSpan="2" TextWrapping="Wrap" Text="{Binding DemoisturizationQuotient}"/>

            <!-- empty row for spacing -->
            <CheckBox Grid.Row="2" Grid.Column="0" Margin="5,2,5,2" IsChecked="{Binding WashingEnabled}">
                <TextBlock x:Name="washing" Text="WASHING"/>
            </CheckBox>
            <TextBlock Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="1" Text="WASHING_PASS_COUNT" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2" TextWrapping="Wrap" Text="{Binding WashingPassCount}"/>

            <TextBlock Grid.Row="2" Grid.Column="4" Grid.ColumnSpan="2" Text="WASHING_MEDIUM" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="2" Grid.Column="6" Grid.ColumnSpan="2" Text="{Binding WashingMedium}"/>
            <TextBlock Grid.Row="2" Grid.Column="8" Grid.ColumnSpan="2" Text="WASHING_FLUID_TEMPERATURE" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="2" Grid.Column="10" Grid.ColumnSpan="2" Text="{Binding WashingFluidTemperature}"/>

            <TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Text="WASHING_AMOUNT_1" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="2" TextWrapping="Wrap" Text="{Binding WashingPass0FluidAmount}"/>
            <TextBlock Grid.Row="3" Grid.Column="4" Grid.ColumnSpan="2" Text="WASHING_AMOUNT_2" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="3" Grid.Column="6" Grid.ColumnSpan="2" TextWrapping="Wrap" Text="{Binding WashingPass1FluidAmount}"/>
            <TextBlock Grid.Row="3" Grid.Column="8" Grid.ColumnSpan="2" Text="WASHING_AMOUNT_3" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="3" Grid.Column="10" Grid.ColumnSpan="2" TextWrapping="Wrap" Text="{Binding WashingPass2FluidAmount}"/>

            <TextBlock Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Text="INTERMEDIATE_DEMOISTURIZING_TIME" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2" TextWrapping="Wrap" Text="{Binding IntermediateDemoisturizationTime}"/>

            <CheckBox Grid.Row="5" Grid.Column="0" Margin="5,2,5,2" IsChecked="{Binding PressingEnabled}">
                <TextBlock Text="PRESSING"/>
            </CheckBox>
            <TextBlock Grid.Row="5" Grid.Column="1" Text="CONFIGURED_PRESSING_TIME" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="5" Grid.Column="2" Grid.ColumnSpan="2" TextWrapping="Wrap" Text="{Binding PressingTime}"/>
            <TextBlock Grid.Row="5" Grid.Column="4" Grid.ColumnSpan="2" Text="PRESSING_PRESSURE" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="5" Grid.Column="6" Grid.ColumnSpan="2" TextWrapping="Wrap" Text="{Binding PressingPressure}"/>

            <CheckBox Grid.Row="6" Grid.Column="0" x:Name="steaming" Margin="5,2,5,2" IsChecked="{Binding VaporizationEnabled}">
                <TextBlock Text="VAPORIZATION"/>
            </CheckBox>
            <TextBlock Grid.Row="6" Grid.Column="1" Text="CONFIGURED_VAPORIZATION_TIME" HorizontalAlignment="Right"/>
            <TextBox Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="2" TextWrapping="Wrap" Text="{Binding VaporizationTime}"/>

            <CheckBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="3" Margin="5,2,5,2" IsChecked="{Binding UseGasBreakthrough}">
                <TextBlock Text="USE_GAS_BREAKTHROUGH"/>
            </CheckBox>
        </Grid>
        <Grid Grid.Row="6" VerticalAlignment="Bottom" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Button 
                Grid.Row="0"
                Grid.Column="0"
                Grid.ColumnSpan="2"
                x:Name="StartButton" 
                FontSize="24"
                Click="StartButton_Click" 
                HorizontalAlignment="Center" 
                MinWidth="300" MinHeight="55">
                <TextBlock FontSize="24" Text="PROCEED"/>
            </Button>
            <Button Grid.Row="0" Grid.Column="1" HorizontalAlignment="Center" MinWidth="55" MinHeight="55" Click="RefreshButton_Click" Margin="2">
                <Image Source="{StaticResource RefreshIcon}"/>
            </Button>
            <Button Grid.Row="0" Grid.Column="2" HorizontalAlignment="Center" MinWidth="55" MinHeight="55" Click="HardwareSettingsButton_Click" Margin="2">
                <Image Source="{StaticResource SettingsIcon}"/>
            </Button>
        </Grid>
    </Grid>
</Page>
