| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488 |
- <UserControl x:Class="TeamAAS_VP.Views.DebugMod.FeederClear"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.DebugMod"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
- xmlns:sys="clr-namespace:System;assembly=mscorlib"
- xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
- xmlns:lex="http://wpflocalizeextension.codeplex.com"
- lex:LocalizeDictionary.DesignCulture="zh-CN"
- lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
- lex:ResxLocalizationProvider.DefaultDictionary="Lang"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d"
- d:Background="White"
- d:DataContext="{d:DesignInstance Type=vm:FeederClearViewModel}"
- FontFamily="{DynamicResource DefaultFont}">
- <b:Interaction.Triggers>
- <b:EventTrigger EventName="Loaded">
- <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
- </b:EventTrigger>
- </b:Interaction.Triggers>
- <UserControl.Resources>
- <ObjectDataProvider x:Key="eVibrationFunction"
- MethodName="GetValues"
- ObjectType="{x:Type sys:Enum}">
- <ObjectDataProvider.MethodParameters>
- <x:Type TypeName="enums:VibrationFunction" />
- </ObjectDataProvider.MethodParameters>
- </ObjectDataProvider>
- </UserControl.Resources>
- <Grid IsEnabled="{Binding IsAllowEdit}"
- HorizontalAlignment="Center"
- VerticalAlignment="Top">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Border Grid.Row="2"
- CornerRadius="10"
- BorderThickness="1"
- BorderBrush="Gray"
- HorizontalAlignment="Center"
- IsEnabled="{Binding IsCanEdit}"
- Margin="0,10">
- <ScrollViewer Margin="20">
- <StackPanel Orientation="Vertical">
- <!-- 任务管理:全局任务列表与批量操作 -->
- <Border BorderBrush="LightGray"
- BorderThickness="1"
- CornerRadius="6"
- Padding="8"
- Margin="0,0,0,10">
- <StackPanel Orientation="Vertical">
- <StackPanel Orientation="Horizontal"
- VerticalAlignment="Center">
- <TextBlock Text="{lex:Loc 任务管理}"
- FontWeight="Bold"
- FontSize="14" />
- <StackPanel Orientation="Horizontal"
- HorizontalAlignment="Right"
- Margin="10,0,0,0">
- <!-- 新建/移除/保存/分配/启动 等操作 -->
- <Button Margin="5,0"
- Command="{Binding AddClearTaskCommand}">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="Add" />
- <TextBlock Text="{lex:Loc 新建任务}" />
- </StackPanel>
- </Button>
- <Button Margin="5,0"
- Command="{Binding RemoveClearTaskCommand}">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="Remove" />
- <TextBlock Text="{lex:Loc 移除任务}" />
- </StackPanel>
- </Button>
- <Button Margin="5,0"
- Command="{Binding SaveClearTaskCommand}">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="ContentSave" />
- <TextBlock Margin=" 5,0"
- Text="{lex:Loc 保存任务}" />
- </StackPanel>
- </Button>
- <Button HorizontalAlignment="Center"
- materialDesign:ButtonAssist.CornerRadius="10"
- MinWidth="150"
- Command="{Binding StartSelectedCommand}"
- Margin="5,0">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="Play" />
- <TextBlock Margin=" 5,0"
- Text="{lex:Loc 开始清料}" />
- </StackPanel>
- </Button>
- </StackPanel>
- </StackPanel>
- <Grid Margin="0,8,0,0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="3*" />
- <ColumnDefinition Width="2*" />
- </Grid.ColumnDefinitions>
- <!-- 全局任务列表 -->
- <ListView ItemsSource="{Binding AllTasks}"
- Height="180"
- SelectedItem="{Binding SelelctFeederClearWork, Mode=TwoWay}">
- <ListView.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{Binding TaskCode}"
- Margin="0,0,8,0" />
- <TextBlock Text="{Binding Name}"
- Width="200" />
- <TextBlock Text="{Binding CreateTime, StringFormat={}{0:yyyy-MM-dd HH:mm}}"
- Foreground="Gray"
- Width="140" />
- <TextBlock Text="Feeder:"
- Foreground="Gray"
- Margin="6,0,2,0" />
- <TextBlock Text="{Binding FeederName}"
- Foreground="DarkGray" />
- </StackPanel>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
- <!-- 所选任务快速编辑 -->
- <StackPanel Grid.Column="1"
- Margin="12,0,0,0"
- VerticalAlignment="Top">
- <TextBlock Text="{lex:Loc 编辑所选任务}"
- FontWeight="SemiBold" />
- <StackPanel Orientation="Vertical"
- Margin="0,6,0,0">
- <StackPanel Orientation="Horizontal"
- VerticalAlignment="Center">
- <TextBlock Text="{lex:Loc 名称, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Width="60"
- VerticalAlignment="Center" />
- <TextBox Text="{Binding SelelctFeederClearWork.Name, Mode=TwoWay}"
- MinWidth="160" />
- </StackPanel>
- <StackPanel Orientation="Horizontal"
- Margin="0,6,0,0">
- <TextBlock Text="{lex:Loc 描述, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Width="60"
- VerticalAlignment="Top" />
- <TextBox Text="{Binding SelelctFeederClearWork.Description, Mode=TwoWay}"
- MinWidth="160"
- Height="60"
- AcceptsReturn="True"
- TextWrapping="Wrap" />
- </StackPanel>
- <StackPanel Orientation="Horizontal"
- Margin="0,6,0,0">
- <TextBlock Text="Feeder:"
- Width="60"
- VerticalAlignment="Center" />
- <ComboBox IsEnabled="{Binding IsCanSelect}"
- SelectedItem="{Binding SelectFeeder,Mode=TwoWay}"
- Margin="5,0"
- MinWidth="80"
- HorizontalContentAlignment="Center"
- ItemsSource="{Binding DataContext.Feeders,RelativeSource={RelativeSource AncestorType=UserControl}}"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- materialDesign:HintAssist.Hint="{lex:Loc 选择Feeder}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon Kind="Vibrate" />
- <TextBlock Text="{Binding FeederName}" />
- </StackPanel>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- </StackPanel>
- <StackPanel Orientation="Horizontal"
- Margin="0,6,0,0">
- <TextBlock Text="{lex:Loc 循环次数, Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- Width="60"
- VerticalAlignment="Center" />
- <mah:NumericUpDown Value="{Binding SelelctFeederClearWork.ClearCount, Mode=TwoWay}"
- Minimum="1"
- Maximum="1000"
- Width="80" />
- </StackPanel>
- </StackPanel>
- </StackPanel>
- </Grid>
- </StackPanel>
- </Border>
- <!--清料前-->
- <Expander HorizontalAlignment="Stretch"
- Background="Transparent"
- IsEnabled="{Binding IsCanExecute}"
- materialDesign:ExpanderAssist.ExpanderButtonPosition="Start"
- IsExpanded="True">
- <Expander.Header>
- <TextBlock FontWeight="Bold"
- Text="{lex:Loc 清料开始前}" />
- </Expander.Header>
- <StackPanel Orientation="Vertical"
- Margin="10,3">
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{lex:Loc 输出,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- VerticalAlignment="Center" />
- <ComboBox MinWidth="100"
- materialDesign:HintAssist.Hint="{lex:Loc 选择输出}"
- materialDesign:HintAssist.HelperText="{lex:Loc 选择输出}"
- Margin="5,0"
- SelectedItem="{Binding SelelctFeederClearWork.BeforeOutput,Mode=TwoWay}"
- ItemsSource="{Binding Source={StaticResource eVibrationFunction}}" />
- <Button Style="{StaticResource MaterialDesignIconButton}">
- <materialDesign:PackIcon Kind="ScriptTextPlayOutline" />
- </Button>
- </StackPanel>
- </StackPanel>
- </Expander>
- <!--振动盘-->
- <Border BorderThickness="1,1,1,1"
- CornerRadius="10"
- Margin="0,2">
- <Border.BorderBrush>
- <VisualBrush>
- <VisualBrush.Visual>
- <Rectangle StrokeDashArray="4 4"
- Stroke="Gray"
- StrokeThickness="1"
- Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
- Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}" />
- </VisualBrush.Visual>
- </VisualBrush>
- </Border.BorderBrush>
- <Expander HorizontalAlignment="Stretch"
- Background="Transparent"
- IsEnabled="{Binding IsCanExecute}"
- materialDesign:ExpanderAssist.ExpanderButtonPosition="Start"
- IsExpanded="True">
- <Expander.Header>
- <TextBlock FontWeight="Bold"
- Text="{lex:Loc 清料过程}" />
- </Expander.Header>
- <StackPanel Orientation="Vertical"
- Margin="10,3">
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{lex:Loc 动作,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- VerticalAlignment="Center" />
- <ComboBox MinWidth="100"
- materialDesign:HintAssist.Hint="{lex:Loc 选择动作}"
- materialDesign:HintAssist.HelperText="{lex:Loc 选择动作}"
- Margin="5,0"
- SelectedIndex="{Binding SelectFeederFunctionIndex,Mode=TwoWay}">
- <!--A-->
- <ComboBoxItem>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="A"
- VerticalAlignment="Center" />
- <materialDesign:PackIcon Kind="ArrowLeftBold"
- Margin="5,0" />
- </StackPanel>
- </ComboBoxItem>
- <!--B-->
- <ComboBoxItem>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="B"
- VerticalAlignment="Center" />
- <materialDesign:PackIcon Kind="ArrowBottomLeftThick"
- Margin="5,0" />
- </StackPanel>
- </ComboBoxItem>
- <!--C-->
- <ComboBoxItem>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="C"
- VerticalAlignment="Center" />
- <materialDesign:PackIcon Kind="ArrowTopLeftThick"
- Margin="5,0" />
- </StackPanel>
- </ComboBoxItem>
- <!--D-->
- <ComboBoxItem>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="D"
- VerticalAlignment="Center" />
- <materialDesign:PackIcon Kind="ArrowDownBold"
- Margin="5,0" />
- </StackPanel>
- </ComboBoxItem>
- <!--E-->
- <ComboBoxItem>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="E"
- VerticalAlignment="Center" />
- <materialDesign:PackIcon Kind="ArrowUpBold"
- Margin="5,0" />
- </StackPanel>
- </ComboBoxItem>
- <!--F-->
- <ComboBoxItem>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="F"
- VerticalAlignment="Center" />
- <materialDesign:PackIcon Kind="ArrowRightBold"
- Margin="5,0" />
- </StackPanel>
- </ComboBoxItem>
- <!--G-->
- <ComboBoxItem>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="G"
- VerticalAlignment="Center" />
- <materialDesign:PackIcon Kind="ArrowBottomRightThick"
- Margin="5,0" />
- </StackPanel>
- </ComboBoxItem>
- <!--H-->
- <ComboBoxItem>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="H"
- VerticalAlignment="Center" />
- <materialDesign:PackIcon Kind="ArrowTopRightThick"
- Margin="5,0" />
- </StackPanel>
- </ComboBoxItem>
- <!--I-->
- <ComboBoxItem>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="I"
- VerticalAlignment="Center" />
- <materialDesign:PackIcon Kind="ArrowExpandAll"
- Margin="5,0" />
- </StackPanel>
- </ComboBoxItem>
- <!--J-->
- <ComboBoxItem>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="J"
- VerticalAlignment="Center" />
- <materialDesign:PackIcon Kind="ArrowCollapseHorizontal"
- Margin="5,0" />
- </StackPanel>
- </ComboBoxItem>
- <!--K-->
- <ComboBoxItem>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="K"
- VerticalAlignment="Center" />
- <materialDesign:PackIcon Kind="ArrowCollapseVertical"
- Margin="5,0" />
- </StackPanel>
- </ComboBoxItem>
- <!--L-->
- <ComboBoxItem>L</ComboBoxItem>
- <!--M-->
- <ComboBoxItem>M</ComboBoxItem>
- <!--N-->
- <ComboBoxItem>N</ComboBoxItem>
- <!--O-->
- <ComboBoxItem>O</ComboBoxItem>
- <!--P-->
- <ComboBoxItem>P</ComboBoxItem>
- <!--Q-->
- <ComboBoxItem>Q</ComboBoxItem>
- <!--R-->
- <ComboBoxItem>R</ComboBoxItem>
- <!--S-->
- <ComboBoxItem>S</ComboBoxItem>
- <!--T-->
- <ComboBoxItem>T</ComboBoxItem>
- <!--U-->
- <ComboBoxItem>U</ComboBoxItem>
- <!--V-->
- <ComboBoxItem>V</ComboBoxItem>
- <!--W-->
- <ComboBoxItem>W</ComboBoxItem>
- <!--X-->
- <ComboBoxItem>X</ComboBoxItem>
- <!--Y-->
- <ComboBoxItem>Y</ComboBoxItem>
- <!--Z-->
- <ComboBoxItem>Z</ComboBoxItem>
- <!--Delay-->
- <ComboBoxItem>Delay</ComboBoxItem>
- </ComboBox>
- <Button Content="{lex:Loc 添加}"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding AddFunctionCommand}" />
- <Button Content="{lex:Loc 移除}"
- Margin="5,0"
- materialDesign:ButtonAssist.CornerRadius="10"
- Command="{Binding RemoveFunctionCommand}"
- CommandParameter="{Binding ElementName=lstAction,Path=SelectedIndex}" />
- <mah:NumericUpDown Interval="1"
- Style="{StaticResource MahApps.Styles.NumericUpDown.DataGrid.Editing}"
- Minimum="1"
- Maximum="100"
- materialDesign:HintAssist.Hint="{lex:Loc 循环次数}"
- materialDesign:HintAssist.HelperText="{lex:Loc 循环次数}"
- BorderThickness="1"
- VerticalAlignment="Center"
- StringFormat="{}{0:N0}"
- Value="{Binding SelelctFeederClearWork.VibrationCount,Mode=TwoWay}" />
- </StackPanel>
- <ListView x:Name="lstAction"
- ItemsSource="{Binding SelelctFeederClearWork.FeederWorks.FeederWorkList}">
- <ListView.View>
- <GridView>
- <GridViewColumn Header="Setp"
- DisplayMemberBinding="{Binding Step}" />
- <GridViewColumn Header="{lex:Loc 动作}">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <ComboBox Width="100"
- HorizontalContentAlignment="Center"
- SelectedItem="{Binding Function,Mode=TwoWay}"
- ItemsSource="{Binding Source={StaticResource eVibrationFunction}}">
- </ComboBox>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- <GridViewColumn Header="{lex:Loc 持续时间,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}(ms)'}">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <mah:NumericUpDown Interval="100"
- Style="{StaticResource MahApps.Styles.NumericUpDown.DataGrid.Editing}"
- Minimum="1"
- Maximum="100000"
- StringFormat="{}{0:N0} ms"
- Value="{Binding Duration,Mode=TwoWay}" />
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- </GridView>
- </ListView.View>
- </ListView>
- </StackPanel>
- </Expander>
- </Border>
- <!--清料完成时-->
- <Expander HorizontalAlignment="Stretch"
- Background="Transparent"
- IsEnabled="{Binding IsCanExecute}"
- materialDesign:ExpanderAssist.ExpanderButtonPosition="Start"
- IsExpanded="True">
- <Expander.Header>
- <TextBlock FontWeight="Bold"
- Text="{lex:Loc 清料完成时}" />
- </Expander.Header>
- <StackPanel Orientation="Vertical"
- Margin="10,3">
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{lex:Loc 输出,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
- VerticalAlignment="Center" />
- <ComboBox MinWidth="100"
- materialDesign:HintAssist.Hint="{lex:Loc 选择输出}"
- materialDesign:HintAssist.HelperText="{lex:Loc 选择输出}"
- Margin="5,0"
- SelectedItem="{Binding SelelctFeederClearWork.BackOutput,Mode=TwoWay}"
- ItemsSource="{Binding Source={StaticResource eVibrationFunction}}" />
- <Button Style="{StaticResource MaterialDesignIconButton}">
- <materialDesign:PackIcon Kind="ScriptTextPlayOutline" />
- </Button>
- </StackPanel>
- </StackPanel>
- </Expander>
- </StackPanel>
- </ScrollViewer>
- </Border>
- </Grid>
- </UserControl>
|