添加烘房进入log

master
zhaojian 2 years ago
parent e20452af69
commit ef2f83d674

@ -377,12 +377,12 @@
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="10,0,0,0">
<Label Content="当前温度:" VerticalContentAlignment="Center" FontSize="16"/>
<Label x:Name="lbCurrTemperature" Width="60" VerticalContentAlignment="Center" FontSize="24"
<Label x:Name="lbCurrTemperature" Width="60" VerticalContentAlignment="Center" FontSize="17"
Foreground="#1A68CA"></Label>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Label Content="当前湿度:" VerticalContentAlignment="Center" FontSize="16"/>
<Label x:Name="lbCurrHumilly" Width="60" VerticalContentAlignment="Center" FontSize="24"
<Label x:Name="lbCurrHumilly" Width="60" VerticalContentAlignment="Center" FontSize="17"
Foreground="#1A68CA"></Label>
</StackPanel>
<StackPanel Orientation="Horizontal">

@ -0,0 +1,128 @@
<Window x:Class="XGL.Views.HBLogWin"
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:XGL.Views" xmlns:localDate="clr-namespace:XGL.Tools"
xmlns:convert="clr-namespace:XGL.Tools"
mc:Ignorable="d"
Title="ViewLogWin" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" WindowStyle="None" WindowState="Maximized">
<Window.Resources>
<convert:DeviceNameConverter x:Key="DeviceNameConverter"/>
<SolidColorBrush x:Key="EvenRowBackground" Color="#E0E0E0"/>
<SolidColorBrush x:Key="OddRowBackground" Color="#FFFFFF"/>
<Style x:Key="DataGridRowStyle" TargetType="DataGridRow">
<Setter Property="Background" Value="{StaticResource EvenRowBackground}"/>
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="{StaticResource OddRowBackground}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="CustomCellStyle" TargetType="DataGridCell">
<Setter Property="Foreground" Value="Black" />
<Setter Property="TextBlock.TextAlignment" Value="Center" />
<Setter Property="TextBlock.FontSize" Value="22" />
</Style>
<!--日历样式-->
<Style TargetType="CalendarDayButton" x:Key="CalendarDayBtnStyle">
<Setter Property="FontSize" Value="16"></Setter>
</Style>
<Style x:Key="calendarWithGotToTodayStyle"
TargetType="{x:Type Calendar}">
<Setter Property="CalendarDayButtonStyle"
Value="{StaticResource CalendarDayBtnStyle}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Calendar}">
<Border>
<StackPanel Orientation="Vertical">
<StackPanel x:Name="PART_Root"
HorizontalAlignment="Center" Background="#FF878787">
<CalendarItem x:Name="PART_CalendarItem"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Style="{TemplateBinding CalendarItemStyle}"
Height="{TemplateBinding Height}"
/>
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="52"></ColumnDefinition>
<ColumnDefinition Width="26"></ColumnDefinition>
<ColumnDefinition Width="52"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock x:Name="PART_GoToday"
Width="40" Height="20"
Text="今天" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" Cursor="Hand" Foreground="#FFFFFFFF" />
<TextBlock Grid.Column="2" x:Name="PART_GoClear"
Width="40" Height="20"
Text="清空" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" Cursor="Hand" Foreground="#FFFFFFFF" />
</Grid>
</StackPanel>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="0.9*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Grid.Row="0" VerticalAlignment="Center">
<Label Content="设备编码:" VerticalContentAlignment="Center" FontSize="14" Margin="20"></Label>
<TextBox x:Name="txtDeviceCode" Width="150" Height="30" FontSize="18" VerticalContentAlignment="Center" KeyDown="txtDeviceCode_KeyDown"></TextBox>
<Button x:Name="btnQueryLog" Content="查询" Foreground="White" Margin="20,0,0,0" FontSize="18" Background="#2B7EE6" Width="100" Height="30" Click="btnQueryLog_Click"/>
</StackPanel>
<Button x:Name="btnClose" Content="关闭" Foreground="White" FontSize="18" Background="#2B7EE6" Width="100" Margin="20" Height="30" Click="btnClose_Click" HorizontalAlignment="Right"/>
<DataGrid
x:Name="dgPlcValueInfo"
Grid.Row="1"
MinHeight="340"
AlternatingRowBackground="{StaticResource OddRowBackground}"
AlternationCount="2"
RowStyle="{StaticResource DataGridRowStyle}"
Margin="20,0,0,5"
LoadingRow="dgLogInfo_LoadingRow"
HeadersVisibility="Column"
CellStyle="{StaticResource CustomCellStyle}"
HorizontalAlignment="Left"
VerticalAlignment="Top" IsReadOnly="True"
AutoGenerateColumns="False" CanUserAddRows="False">
<DataGrid.ColumnHeaderStyle >
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Height" Value="48" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="#2B7EE6" />
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Columns>
<DataGridTemplateColumn Header=" 序号" Width="80" MinWidth="10" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow}}, Path=Header}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,0,0"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Width="0.08*" Header="设备编码" Binding="{Binding device_code}" />
<DataGridTextColumn Width="0.1*" Header="值" Binding="{Binding value}" />
<DataGridTextColumn Width="0.15*" Header="更新时间" Binding="{Binding create_time, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" />
<!--<DataGridTextColumn Width="340" Header="流转码" Binding="{Binding work_batch_code}" />-->
<!--<DataGridTextColumn Width="60" Header="出入" Binding="{Binding taskcode,Converter={StaticResource TaskCodeConverter}}"/>-->
</DataGrid.Columns>
</DataGrid>
</Grid>
</Window>

@ -0,0 +1,74 @@
using CentralControl.DBDAO;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace XGL.Views
{
/// <summary>
/// HBLogWin.xaml 的交互逻辑
/// </summary>
public partial class HBLogWin : Window
{
DBService userDbWareHouse = new DBService();
public HBLogWin()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
GetPlcValueList();
}
private void dgLogInfo_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = (e.Row.GetIndex() + 1).ToString();
}
private void btnQueryLog_Click(object sender, RoutedEventArgs e)
{
GetPlcValueList();
}
private void GetPlcValueList()
{
DataTable dt = userDbWareHouse.GetHFPlcValueList(this.txtDeviceCode.Text);
if (dt == null) return;
this.dgPlcValueInfo.ItemsSource = null;
this.dgPlcValueInfo.ItemsSource = dt.DefaultView;
}
private void btnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void txtKey_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
GetPlcValueList();
}
}
private void txtDeviceCode_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
GetPlcValueList();
}
}
}
}

@ -374,6 +374,25 @@
Foreground="White"
Click="btnViewPlcvalue_Click" Content="查看Plc值"></Button>
</StackPanel>
<StackPanel
Grid.Row="0"
Grid.Column="8"
Width="220"
Height="90">
<Button
x:Name="HFPlcvalue"
Grid.Row="1"
Grid.Column="5"
Width="170"
Height="60"
Margin="25,5"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="#2B7EE6"
FontSize="20"
Foreground="White"
Click="HFPlcvalue_Click" Content="查看烘房值"></Button>
</StackPanel>
<DataGrid
x:Name="dgWorkOrderInfo"
Grid.Row="1"

@ -466,5 +466,11 @@ namespace XGL.Views
_workOrderCode = (dgWorkOrderInfo.SelectedItem as FoamingMacModel).workorder_code;
InOut_Click(null,null);
}
private void HFPlcvalue_Click(object sender, RoutedEventArgs e)
{
HBLogWin HFPlcWin = new HBLogWin();
HFPlcWin.ShowDialog();
}
}
}

@ -98,6 +98,7 @@ namespace XGL.Views
// list_modelWareHouse.QuantitySplit = i["QuantitySplit"].ToString();
// list_modelWareHouse.BatchCode = i["BatchCode"].ToString();
// modelWareHouse.Add(list_modelWareHouse);
LogHelper.instance.log.Info(wet.prod_line_code);
}
this.WorkOrder.ItemsSource = null;
this.WorkOrder.ItemsSource = wetList;
@ -199,8 +200,9 @@ namespace XGL.Views
wet.sync_flag = i["sync_flag"].ToString();
wet.processid = i["route_code"].ToString();
wetList.Add(wet);
LogHelper.instance.log.Info(wet.prod_line_code);
}
if (wetList != null)
{
//使用Dispatcher来在UI线程上更新UI

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Views\LanJu_Operator.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "B92E7E61C39C901A7FA4616B61E410627571E415C6089F472C16239020DF5B90"
#pragma checksum "..\..\..\..\Views\LanJu_Operator.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "78352914B9142AAC31B7370C1E4947E13871C6386E9E928CF46E67383F325ED7"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -90,7 +90,15 @@ namespace XGL.Views {
#line hidden
#line 378 "..\..\..\..\Views\LanJu_Operator.xaml"
#line 383 "..\..\..\..\Views\LanJu_Operator.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button HFPlcvalue;
#line default
#line hidden
#line 397 "..\..\..\..\Views\LanJu_Operator.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.DataGrid dgWorkOrderInfo;
@ -98,7 +106,7 @@ namespace XGL.Views {
#line hidden
#line 518 "..\..\..\..\Views\LanJu_Operator.xaml"
#line 537 "..\..\..\..\Views\LanJu_Operator.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.ContentControl Window1;
@ -214,29 +222,38 @@ namespace XGL.Views {
#line hidden
return;
case 10:
this.dgWorkOrderInfo = ((System.Windows.Controls.DataGrid)(target));
#line 389 "..\..\..\..\Views\LanJu_Operator.xaml"
this.dgWorkOrderInfo.LoadingRow += new System.EventHandler<System.Windows.Controls.DataGridRowEventArgs>(this.dgWorkOrderInfo_LoadingRow);
#line default
#line hidden
this.HFPlcvalue = ((System.Windows.Controls.Button)(target));
#line 394 "..\..\..\..\Views\LanJu_Operator.xaml"
this.dgWorkOrderInfo.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.dgWorkOrderInfo_SelectionChanged);
this.HFPlcvalue.Click += new System.Windows.RoutedEventHandler(this.HFPlcvalue_Click);
#line default
#line hidden
return;
case 11:
this.dgWorkOrderInfo = ((System.Windows.Controls.DataGrid)(target));
#line 450 "..\..\..\..\Views\LanJu_Operator.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.InOut_Click);
#line 408 "..\..\..\..\Views\LanJu_Operator.xaml"
this.dgWorkOrderInfo.LoadingRow += new System.EventHandler<System.Windows.Controls.DataGridRowEventArgs>(this.dgWorkOrderInfo_LoadingRow);
#line default
#line hidden
#line 413 "..\..\..\..\Views\LanJu_Operator.xaml"
this.dgWorkOrderInfo.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.dgWorkOrderInfo_SelectionChanged);
#line default
#line hidden
return;
case 12:
#line 469 "..\..\..\..\Views\LanJu_Operator.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.InOut_Click);
#line default
#line hidden
return;
case 13:
this.Window1 = ((System.Windows.Controls.ContentControl)(target));
return;
}

Loading…
Cancel
Save