|
- <UserControl x:Class="BPASmartClient.JXJFoodSmallStation.View.RobotView"
- 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:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:vm="clr-namespace:BPASmartClient.JXJFoodSmallStation.ViewModel"
- mc:Ignorable="d"
- d:DesignHeight="1080" d:DesignWidth="1920">
- <UserControl.Resources>
- <Style x:Key="radioButtonStyle" TargetType="RadioButton">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="RadioButton">
- <Grid Name="gr" Opacity="0.8">
- <ContentControl
- Margin="{TemplateBinding Margin}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Content="{TemplateBinding Content}"
- FontSize="{TemplateBinding FontSize}"
- Foreground="{TemplateBinding Foreground}" />
- <Image
- Name="image"
- Source="/BPASmartClient.CustomResource;component/Image/边框线.png"
- Stretch="Fill" />
-
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="False">
- <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/边框线.png" />
- </Trigger>
- <Trigger Property="IsChecked" Value="True">
- <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/透明背景.png" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="gr" Property="Opacity" Value="1" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <UserControl.DataContext>
- <vm:RobotViewModel/>
- </UserControl.DataContext>
-
- <Grid Margin="10">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="4*"/>
- <ColumnDefinition Width="4*"/>
- <ColumnDefinition Width="4*"/>
- </Grid.ColumnDefinitions>
- <!--#region 表格标题栏设置-->
- <Grid>
- <StackPanel>
- <WrapPanel>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人自动运行模式:"></TextBlock>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsAutoMode}"></TextBlock>
- </WrapPanel>
- <WrapPanel>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人正在自动运行:"></TextBlock>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsAutoRun}"></TextBlock>
- </WrapPanel>
- <WrapPanel>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人停止状态:"></TextBlock>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsStop}"></TextBlock>
- </WrapPanel>
- <WrapPanel>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人运行正常:"></TextBlock>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsRun}"></TextBlock>
- </WrapPanel>
- <WrapPanel>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人运行故障:"></TextBlock>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsAlarm}"></TextBlock>
- </WrapPanel>
- <WrapPanel>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人在Home点:"></TextBlock>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotIsHomed}"></TextBlock>
- </WrapPanel>
- <WrapPanel>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="机器人运行的程序号:"></TextBlock>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding IsRunProgramNum}"></TextBlock>
- </WrapPanel>
- <!--<WrapPanel>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="抓空桶完成:"></TextBlock>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotGetEmptyBarrelComplete}"></TextBlock>
- </WrapPanel>
- <WrapPanel>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="放空桶完成:"></TextBlock>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotPutEmptyBarrelComplete}"></TextBlock>
- </WrapPanel>
- <WrapPanel>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="抓满桶完成:"></TextBlock>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotGetFullBarrelComplete}"></TextBlock>
- </WrapPanel>
- <WrapPanel>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="放满桶完成:"></TextBlock>
- <TextBlock Margin="5" FontSize="22" Foreground="Aqua" Text="{Binding RobotPutFullBarrelComplete}"></TextBlock>
- </WrapPanel>-->
- </StackPanel>
- </Grid>
- <Grid Grid.Column="1">
- <Grid.RowDefinitions>
- <RowDefinition Height="1*"></RowDefinition>
- <RowDefinition Height="7*"></RowDefinition>
- </Grid.RowDefinitions>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Button
- Margin="20,15"
- Command="{Binding SystemStart}"
- Content="启动"
- FontSize="40"
- Background="LightGreen"></Button>
- <Button
- Grid.Column="1"
- Margin="20,15"
- Command="{Binding SystemStop}"
- Content="停止"
- FontSize="40"
- Background="OrangeRed"></Button>
- <Button
- Grid.Column="2"
- Grid.ColumnSpan="2"
- Margin="20,15"
- Command="{Binding EStopReset}"
- Content="急停复位"
- FontSize="40"
- Background="DodgerBlue"></Button>
- </Grid>
- </Grid>
- <!--<Grid Grid.Column="2">
- <Grid.RowDefinitions>
- <RowDefinition></RowDefinition>
- <RowDefinition></RowDefinition>
- <RowDefinition></RowDefinition>
- </Grid.RowDefinitions>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition></RowDefinition>
- <RowDefinition></RowDefinition>
- <RowDefinition></RowDefinition>
- </Grid.RowDefinitions>
- <Button
- Margin="20,5"
- Command="{Binding AutoMode}"
- Content="自动模式"
- FontSize="32"
- Panel.ZIndex="0"
- Style="{StaticResource ImageButtonStyle}"></Button>
- <Button
- Grid.Column="1"
- Margin="20,5"
- Command="{Binding TestMode}"
- Content="测试模式"
- FontSize="32"
- Panel.ZIndex="0"
- Style="{StaticResource ImageButtonStyle}"></Button>
- <Grid Grid.Row="1" Grid.ColumnSpan="2">
- <StackPanel Orientation="Vertical">
- <WrapPanel Orientation="Horizontal">
- <TextBlock Text="机器人正在运行程序号:" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left"></TextBlock>
- <TextBlock Text="{Binding IsRunProgramNum}" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left" TextAlignment="Center"></TextBlock>
- </WrapPanel>
- <WrapPanel Orientation="Horizontal" VerticalAlignment="Center">
- <TextBlock Text="机器人需要运行程序号:" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left"></TextBlock>
- <TextBox Text="{Binding SetProgramNum}" Width="50" Foreground="#FF2AB2E7" FontSize="25" Margin="10" HorizontalAlignment="Left" TextAlignment="Center"></TextBox>
- <Button FontSize="20" Height="40" Command="{Binding SetProgramNumCommand}" Content="设置" Style="{StaticResource ImageButtonStyle}"></Button>
- </WrapPanel>
- </StackPanel>
- </Grid>
- <Button
- Grid.Row="2"
- Margin="20,5"
- Command="{Binding TestRobotRun}"
- Content="测试抓桶程序"
- FontSize="32"
- Style="{StaticResource ImageButtonStyle}"></Button>
- </Grid>
- --><!--<ListView
- Grid.Row="1"
- Background="Transparent"
- BorderBrush="#00BEFA"
- BorderThickness="0"
- ItemsSource="{Binding cylinderModels}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled">
- <ListView.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- Columns="8" />
- </ItemsPanelTemplate>
- </ListView.ItemsPanel>
-
- <ListView.ItemTemplate>
- <DataTemplate>
- <Grid
- Width="200"
- Height="100"
- Margin="0,0,0,15"
- Background="Transparent">
- <Grid.RowDefinitions>
- <RowDefinition Height="30" />
- <RowDefinition />
- <RowDefinition Height="30" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.5*" />
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Column="1"
- Grid.ColumnSpan="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Foreground="Aqua"
- Text="{Binding Name}" />
-
- <pry:Cylinder
- Grid.Row="1"
- Grid.ColumnSpan="3"
- Width="200"
- Height="50"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- LeftTogIsChecked="{Binding LeftTog}"
- RightTogIsChecked="{Binding RightTog}" />
-
- <RadioButton
- Grid.Row="2"
- Grid.Column="1"
- Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
- CommandParameter="{Binding Name}"
- Content="伸出"
- Foreground="Aqua"
- IsChecked="True"
- Style="{StaticResource radioButtonStyle}" />
-
- <RadioButton
- Grid.Row="2"
- Grid.Column="2"
- Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
- CommandParameter="{Binding Name}"
- Content="缩回"
- Foreground="Aqua"
- IsChecked="False"
- Style="{StaticResource radioButtonStyle}" />
- </Grid>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>--><!--
- <Grid Grid.Row="1" Visibility="Hidden">
- <Grid.ColumnDefinitions>
- <ColumnDefinition></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition></RowDefinition>
- <RowDefinition></RowDefinition>
- </Grid.RowDefinitions>
- <Grid Grid.Row="0">
- <Button
- Margin="20,5"
- Command="{Binding RobotGetEmptyBarrel}"
- Content="允许机器人抓空桶"
- Style="{StaticResource ImageButtonStyle}"></Button>
- </Grid>
- <Grid Grid.Column="1">
- <Button
- Margin="20,5"
- Command="{Binding RobotPutEmptyBarrel}"
- Content="允许机器人放空桶"
- Style="{StaticResource ImageButtonStyle}"></Button>
- </Grid>
- <Grid Grid.Row="1">
- <Button
- Margin="20,5"
- Command="{Binding RobotGetFullBarrel}"
- Content="允许机器人抓满桶"
- Style="{StaticResource ImageButtonStyle}"></Button>
- </Grid>
- <Grid Grid.Row="1" Grid.Column="1">
- <Button
- Margin="20,5"
- Command="{Binding RobotPutFullBarrel}"
- Content="允许机器人放满桶"
- Style="{StaticResource ImageButtonStyle}"></Button>
- </Grid>
- </Grid>
- </Grid>-->
- </Grid>
- </UserControl>
|