liulb@mesnac.com 1 year ago
parent 95efc382f5
commit 48585bf9fb

@ -6,11 +6,12 @@
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:local="clr-namespace:Aucma.Core.Palletiz.Views" xmlns:local="clr-namespace:Aucma.Core.Palletiz.Views"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="800" d:DesignHeight="800" FontFamily="Microsoft YaHei"
d:DesignWidth="1000" > d:DesignWidth="1000" >
<UserControl.Resources> <UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}"> <Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="30" />
</Style> </Style>
<Style TargetType="DataGrid"> <Style TargetType="DataGrid">
@ -65,59 +66,6 @@
</Style> </Style>
<Style TargetType="{x:Type Slider}">
<Style.Resources>
<!-- 重写重复触发按钮的样式 -->
<Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}">
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Padding" Value="0" />
<Setter Property="Width" Value="30" />
</Style>
</Style.Resources>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="SmallChange" Value="1" />
<!-- 重写Slider的模板 -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Slider}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Grid.RowSpan="2" Height="Auto" Margin="0" Padding="0" VerticalAlignment="Stretch"
VerticalContentAlignment="Center" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Value}">
<!-- 给TextBox绑定上下命令 -->
<TextBox.InputBindings>
<KeyBinding Gesture="Up" Command="{x:Static Slider.IncreaseSmall}" />
<KeyBinding Gesture="Down" Command="{x:Static Slider.DecreaseSmall}" />
<KeyBinding Gesture="PageUp" Command="{x:Static Slider.IncreaseLarge}" />
<KeyBinding Gesture="PageDown" Command="{x:Static Slider.DecreaseLarge}" />
</TextBox.InputBindings>
</TextBox>
<RepeatButton Grid.Row="0" Grid.Column="1" Command="{x:Static Slider.IncreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M4,0 L0,4 8,4 Z" Fill="Black" />
</RepeatButton>
<RepeatButton Grid.Row="1" Grid.Column="1" Command="{x:Static Slider.DecreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M0,0 L4,4 8,0 Z" Fill="Black" />
</RepeatButton>
<!-- 由于Slider的内部实现要求存在这些必要组件,所以必须保留,但是设置为隐藏即可 -->
<Border x:Name="TrackBackground" Visibility="Collapsed">
<Rectangle x:Name="PART_SelectionRange" Visibility="Collapsed" />
</Border>
<Thumb x:Name="Thumb" Visibility="Collapsed" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type DatePickerTextBox}"> <Style TargetType="{x:Type DatePickerTextBox}">
<Setter Property="Background" Value="#0288d1" /> <Setter Property="Background" Value="#0288d1" />
</Style> </Style>
@ -129,7 +77,7 @@
<Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="16"/> <Setter Property="FontSize" Value="16"/>
<Setter Property="FontFamily" Value="微软雅黑"/> <Setter Property="FontFamily" Value="Microsoft YaHei"/>
</Style> </Style>
<Style TargetType="Border"> <Style TargetType="Border">
<Setter Property="BorderBrush" Value="#0288d1"/> <Setter Property="BorderBrush" Value="#0288d1"/>
@ -158,55 +106,55 @@
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border Grid.Row="0" Grid.Column="0" Background="#1157b9"> <Border Grid.Row="0" Grid.Column="0" Background="#1157b9">
<TextBlock Text="当前工位" Foreground="White"/> <TextBlock Text="当前工位" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="1" Grid.RowSpan="3" Grid.Column="0" Background="#1157b9"> <Border Grid.Row="1" Grid.RowSpan="3" Grid.Column="0" Background="#1157b9">
<TextBlock Text="产品分垛" Foreground="White" FontWeight="Bold" FontSize="25"/> <TextBlock Text="产品分垛" Foreground="White" FontWeight="Bold" FontSize="30"/>
</Border> </Border>
<Border Grid.Row="0" Grid.Column="1" Background="#1157b9"> <Border Grid.Row="0" Grid.Column="1" Background="#1157b9">
<TextBlock Text="产品条码" Foreground="White" /> <TextBlock Text="产品条码" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="1" Grid.Column="1" Background="#1157b9"> <Border Grid.Row="1" Grid.Column="1" Background="#1157b9">
<TextBlock Text="产品型号" Foreground="White" /> <TextBlock Text="产品型号" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="2" Grid.Column="1" Background="#1157b9"> <Border Grid.Row="2" Grid.Column="1" Background="#1157b9">
<TextBlock Text="订单数量" Foreground="White" /> <TextBlock Text="订单数量" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="3" Grid.Column="1" Background="#1157b9"> <Border Grid.Row="3" Grid.Column="1" Background="#1157b9">
<TextBlock Text="提示信息" Foreground="White" /> <TextBlock Text="提示信息" Foreground="White" FontSize="20" />
</Border> </Border>
<Border Grid.Row="0" Grid.Column="2"> <Border Grid.Row="0" Grid.Column="2">
<TextBlock Text="312799000093D8U0050" Foreground="White" /> <TextBlock Text="312799000093D8U0050" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="1" Grid.Column="2"> <Border Grid.Row="1" Grid.Column="2">
<TextBlock Text="SC-279,C,特许" Foreground="White" /> <TextBlock Text="SC-279,C,特许" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="2" Grid.Column="2"> <Border Grid.Row="2" Grid.Column="2">
<TextBlock Text="76" Foreground="White" /> <TextBlock Text="76" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="3"> <Border Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="3">
<TextBlock Text="获取信息成功3127991000093D8U0050 返回值 : Y.上传条码失败E,条码重复,上传条码失败E,条码重复上传" Foreground="White" /> <TextBlock Text="获取信息成功3127991000093D8U0050 返回值 : Y.上传条码失败E,条码重复,上传条码失败E,条码重复上传" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="0" Grid.Column="3" Background="#1157b9"> <Border Grid.Row="0" Grid.Column="3" Background="#1157b9">
<TextBlock Text="扫描时间" Foreground="White" /> <TextBlock Text="扫描时间" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="1" Grid.Column="3" Background="#1157b9"> <Border Grid.Row="1" Grid.Column="3" Background="#1157b9">
<TextBlock Text="订单编号" Foreground="White" /> <TextBlock Text="订单编号" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="2" Grid.Column="3" Background="#1157b9"> <Border Grid.Row="2" Grid.Column="3" Background="#1157b9">
<TextBlock Text="订单已上传" Foreground="White" /> <TextBlock Text="订单已上传" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="0" Grid.Column="4"> <Border Grid.Row="0" Grid.Column="4">
<TextBlock Text="2023-08-29 13:10:53" Foreground="White" /> <TextBlock Text="2023-08-29 13:10:53" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="1" Grid.Column="4"> <Border Grid.Row="1" Grid.Column="4">
<TextBlock Text="000011203687" Foreground="White" /> <TextBlock Text="000011203687" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="2" Grid.Column="4"> <Border Grid.Row="2" Grid.Column="4">
<TextBlock Text="48" Foreground="White" /> <TextBlock Text="48" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="0" Grid.Column="5" Background="#1157b9"> <Border Grid.Row="0" Grid.Column="5" Background="#1157b9">
<TextBlock Text="实际产量" Foreground="White" /> <TextBlock Text="实际产量" Foreground="White" FontSize="20"/>
</Border> </Border>
<Border Grid.Row="1" Grid.RowSpan="2" Grid.Column="5"> <Border Grid.Row="1" Grid.RowSpan="2" Grid.Column="5">
<TextBlock Text="255" Foreground="White" FontSize="40" FontWeight="Bold"/> <TextBlock Text="255" Foreground="White" FontSize="40" FontWeight="Bold"/>

@ -6,7 +6,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Aucma.Core.Palletiz.Views" xmlns:local="clr-namespace:Aucma.Core.Palletiz.Views"
xmlns:cvt="clr-namespace:Aucma.Core.Palletiz.ConvertTo" xmlns:cvt="clr-namespace:Aucma.Core.Palletiz.ConvertTo"
mc:Ignorable="d" mc:Ignorable="d" FontFamily="Microsoft YaHei"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources> <UserControl.Resources>
@ -38,7 +38,7 @@
<Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="#dddddd" /> <Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="40"/> <Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="14"/> <Setter Property="FontSize" Value="100"/>
<Setter Property="Background" Value="#4285DE"/> <Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/> <Setter Property="Foreground" Value="White"/>
</Style> </Style>
@ -49,7 +49,7 @@
<Setter Property="BorderThickness" Value="0" /> <Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="Gray" /> <Setter Property="BorderBrush" Value="Gray" />
<Setter Property="Height" Value="40"/> <Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="12"/> <Setter Property="FontSize" Value="18"/>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}"> <ControlTemplate TargetType="{x:Type DataGridCell}">
@ -68,59 +68,6 @@
</Style> </Style>
<Style TargetType="{x:Type Slider}">
<Style.Resources>
<!-- 重写重复触发按钮的样式 -->
<Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}">
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Padding" Value="0" />
<Setter Property="Width" Value="30" />
</Style>
</Style.Resources>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="SmallChange" Value="1" />
<!-- 重写Slider的模板 -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Slider}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Grid.RowSpan="2" Height="Auto" Margin="0" Padding="0" VerticalAlignment="Stretch"
VerticalContentAlignment="Center" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Value}">
<!-- 给TextBox绑定上下命令 -->
<TextBox.InputBindings>
<KeyBinding Gesture="Up" Command="{x:Static Slider.IncreaseSmall}" />
<KeyBinding Gesture="Down" Command="{x:Static Slider.DecreaseSmall}" />
<KeyBinding Gesture="PageUp" Command="{x:Static Slider.IncreaseLarge}" />
<KeyBinding Gesture="PageDown" Command="{x:Static Slider.DecreaseLarge}" />
</TextBox.InputBindings>
</TextBox>
<RepeatButton Grid.Row="0" Grid.Column="1" Command="{x:Static Slider.IncreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M4,0 L0,4 8,4 Z" Fill="Black" />
</RepeatButton>
<RepeatButton Grid.Row="1" Grid.Column="1" Command="{x:Static Slider.DecreaseSmall}"
Style="{StaticResource RepeatButtonStyle}">
<Path Data="M0,0 L4,4 8,0 Z" Fill="Black" />
</RepeatButton>
<!-- 由于Slider的内部实现要求存在这些必要组件,所以必须保留,但是设置为隐藏即可 -->
<Border x:Name="TrackBackground" Visibility="Collapsed">
<Rectangle x:Name="PART_SelectionRange" Visibility="Collapsed" />
</Border>
<Thumb x:Name="Thumb" Visibility="Collapsed" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type DatePickerTextBox}"> <Style TargetType="{x:Type DatePickerTextBox}">
<Setter Property="Background" Value="#0288d1" /> <Setter Property="Background" Value="#0288d1" />
</Style> </Style>
@ -142,7 +89,7 @@
<RowDefinition Height="8*"/> <RowDefinition Height="8*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center"> <WrapPanel Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="开始时间" Margin="10 0" Foreground="White" FontSize="15" VerticalAlignment="Center"/> <TextBlock Text="开始时间" Margin="10 0" Foreground="White" FontSize="18" VerticalAlignment="Center"/>
<DatePicker <DatePicker
x:Name="BeginTime" x:Name="BeginTime"
Width="200" Margin="10 0" Text="2023-10-09" BorderBrush="White" Width="200" Margin="10 0" Text="2023-10-09" BorderBrush="White"
@ -157,7 +104,7 @@
</DatePicker.SelectedDate> </DatePicker.SelectedDate>
</DatePicker> </DatePicker>
<TextBlock Text="结束时间" Margin="10 0" Foreground="White" FontSize="15" VerticalAlignment="Center"/> <TextBlock Text="结束时间" Margin="10 0" Foreground="White" FontSize="18" VerticalAlignment="Center"/>
<DatePicker <DatePicker
x:Name="EndTime" Margin="10 0" Text="2023-10-09" x:Name="EndTime" Margin="10 0" Text="2023-10-09"
Width="200" BorderBrush="White" Width="200" BorderBrush="White"
@ -185,8 +132,8 @@
</Button> </Button>
</WrapPanel> </WrapPanel>
<UniformGrid Grid.Row="1"> <UniformGrid Grid.Row="1">
<DataGrid Grid.Row="0" ItemsSource="{Binding MaterialDataGrid}" Background="#00000000" <DataGrid Grid.Row="0" ItemsSource="{Binding MaterialDataGrid}"
ColumnHeaderHeight="35" ColumnHeaderHeight="45" FontSize="100"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0" RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden" GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True" ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"

@ -72,13 +72,12 @@ namespace Aucma.Core.ScannerGun
string code = serialPort.ReadExisting(); string code = serialPort.ReadExisting();
if (!string.IsNullOrEmpty(code)) if (string.IsNullOrEmpty(code))
{ {
Console.WriteLine(code.Trim());
return; return;
} }
//业务处理 //业务处理
Console.WriteLine(code.Trim());
} }
catch (Exception ex) catch (Exception ex)
{ {

Loading…
Cancel
Save