<UserControl x:Class="MegaRobo.C00225155App.DevicesViews.LabXToolView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:MegaRobo.C00225155App.DevicesViews"
             xmlns:mega="clr-namespace:MegaRobo.WpfComponents.MegaControls;assembly=MegaRobo.WpfComponents"
             xmlns:navi="clr-namespace:Telerik.Windows.Controls.Navigation;assembly=Telerik.Windows.Controls.Navigation"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d"   Background="White"
             DataContext="{Binding LabXToolVM,Source={StaticResource vmLocator}}"
             d:DesignHeight="800" d:DesignWidth="900" Height="800" Width="900" Tag="Labx-调试">

    <mega:MegaGrid Rows="34,auto,34,100,100,Auto">
        <mega:MegaGrid.Resources>
            <Style BasedOn="{StaticResource CommandButtonBaseStyle}" TargetType="telerik:RadButton">
                <Setter Property="Height" Value="45" />
            </Style>
        </mega:MegaGrid.Resources>
        <Border Grid.Row="0" Background="#d8d8d8">
            <telerik:Label
            Margin="5,0"
            Content="Labx调试"
            FontSize="18" />
        </Border>
        <Border Grid.Row="1" Margin="10,5">
            <!--<StackPanel Orientation="Vertical">
                <StackPanel
                Height="48"
                Margin="2,5"
                Orientation="Horizontal">
                    <telerik:Label Content="仪器名称" Style="{StaticResource AttributeLabel}" />
                    <telerik:RadComboBox
                    Width="170"
                    Height="45"
                    DisplayMemberPath="Name"
                    ItemsSource="{Binding InstrumentList, Mode=OneWay}"
                    SelectedIndex="0"
                    SelectedItem="{Binding SelectedInstrument, Mode=TwoWay}"
                    SelectedValuePath="Code"
                    Style="{StaticResource AttributeCboValue}">
                        <telerik:EventToCommandBehavior.EventBindings>
                            <telerik:EventBinding
                            Command="{Binding SwitchInstrumentCommand}"
                            EventName="SelectionChanged"
                            PassEventArgsToCommand="True" />
                        </telerik:EventToCommandBehavior.EventBindings>
                    </telerik:RadComboBox>
                </StackPanel>
                <StackPanel
                Height="48"
                Margin="2,5"
                Orientation="Horizontal">
                    <telerik:Label Content="仪器序号" Style="{StaticResource AttributeLabel}" />
                    <telerik:RadNumericUpDown
                    Width="170"
                    Maximum="50"
                    Minimum="0"
                    SmallChange="1"
                    Style="{StaticResource RadNumericUpDownBaseStyle}"
                    Value="{Binding InstrumentNum, Mode=TwoWay}" />
                </StackPanel>
                <StackPanel
                Height="48"
                Margin="2,5"
                Orientation="Horizontal">
                    <telerik:Label Content="选择方法" Style="{StaticResource AttributeLabel}" />
                    <telerik:RadComboBox
                    Width="170"
                    Height="45"
                    ItemsSource="{Binding MethodList, Mode=OneWay}"
                    SelectedIndex="0"
                    SelectedItem="{Binding SelectedMethod, Mode=TwoWay}"
                    Style="{StaticResource AttributeCboValue}" />
                </StackPanel>

            </StackPanel>-->
        </Border>
        <Border Grid.Row="2" Background="#d8d8d8">
            <telerik:Label
            Margin="5,0"
            Content="labx控制"
            FontSize="18" />
        </Border>
        <StackPanel Grid.Row="3">
            <StackPanel Orientation="Horizontal" Margin="10">
                <TextBlock Text="目标加粉量："  Style="{StaticResource txtBlockBaseStyle}"/>
                <TextBox Text="{Binding TargetWeight}" Style="{StaticResource textBoxStyle }" />
                <TextBlock Text="mg" Style="{StaticResource txtBlockBaseStyle}"/>

                <TextBlock Margin="35,0,0,0" Text="上公差："  Style="{StaticResource txtBlockBaseStyle}"/>
                <TextBox Text="{Binding UpTolerance}" Style="{StaticResource textBoxStyle }" />
                <TextBlock Text="%" Style="{StaticResource txtBlockBaseStyle}"/>

                <TextBlock Margin="35,0,0,0" Text="下公差："  Style="{StaticResource txtBlockBaseStyle}"/>
                <TextBox Text="{Binding DnTolerance}" Style="{StaticResource textBoxStyle }" />
                <TextBlock Text="%" Style="{StaticResource txtBlockBaseStyle}"/>
            </StackPanel>

            <StackPanel Orientation="Horizontal">
                <Button  Style="{StaticResource btnMenu }"  Command="{Binding ActionCommand}"  CommandParameter="4" Content="开始加粉" />
                <TextBlock Margin="35,0,0,0" Text="加入量："  Style="{StaticResource txtBlockBaseStyle}"/>
                <TextBox Text="{Binding PowderWeight}" Style="{StaticResource textBoxStyle }" />
                <TextBlock Text="mg" Style="{StaticResource txtBlockBaseStyle}"/>
                <TextBlock Margin="35,0,0,0" Text="耗时："  Style="{StaticResource txtBlockBaseStyle}"/>
                <TextBox Text="{Binding PowderCT}" Style="{StaticResource textBoxStyle }" />
                <TextBlock Text="ms" Style="{StaticResource txtBlockBaseStyle}"/>
            </StackPanel>
        </StackPanel>
        <Border Grid.Row="4" Margin="10,5">
            <StackPanel Orientation="Vertical">
                <StackPanel Height="48" Orientation="Horizontal">
                    <Button Style="{StaticResource btnMenu }"   Command="{Binding ActionCommand}"  CommandParameter="0"  Content="关门" />
                    <Button  Style="{StaticResource btnMenu }"  Command="{Binding ActionCommand}"  CommandParameter="1"  Content="开门" />
                    <Button  Style="{StaticResource btnMenu }"  Command="{Binding ActionCommand}"  CommandParameter="2"  Content="置零" />
                    <Button  Style="{StaticResource btnMenu }"  Command="{Binding ActionCommand}"  CommandParameter="3"  Content="去皮" />
                    <Button  Style="{StaticResource btnMenu }"  Command="{Binding ActionCommand}"  CommandParameter="5"  Content="粉末头复位" />
                    <Button  Style="{StaticResource btnMenu }"  Command="{Binding ActionCommand}"  CommandParameter="6"  Content="等待放置粉末加样头" Width="138" />
                    <Button  Style="{StaticResource btnMenu }"  Command="{Binding ActionCommand}"  CommandParameter="7"  Content="加样头放置完成" Width="138" />
                    <!--<TextBlock  Text="状态：" Style="{StaticResource txtBlockBaseStyle}"/>-->
                    <!--<Border BorderThickness="1" BorderBrush="Gray" CornerRadius="3"  Width="120" Height="40">
                        <TextBlock Text="{Binding DeviceState}"  />
                    </Border>-->
                </StackPanel>
                <!--<StackPanel Height="48" Orientation="Horizontal" Margin="0,10,0,0">
                    <telerik:RadButton
                     Command="{Binding ActionCommand}"
                     CommandParameter="Conductivity"
                     Content="电导率任务" />
                    <telerik:RadButton
                     Command="{Binding ActionCommand}"
                     CommandParameter="T5"
                     Content="T5滴定仪任务" />
                </StackPanel>-->
            </StackPanel>
        </Border>
        <Border Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" BorderBrush="Gray" BorderThickness="1" Margin="5">
            <StackPanel>
                <TextBlock Text="状态记录">
                    <TextBlock.Effect>
                        <DropShadowEffect Color="#00BFFF" BlurRadius="5" Opacity="0.5" ShadowDepth="0"/>
                    </TextBlock.Effect>
                </TextBlock>
                <ListBox  VerticalAlignment="Top"  ItemsSource="{Binding LogInfos}"/>
            </StackPanel>
        </Border>
    </mega:MegaGrid>
</UserControl>
