Browse Source

添加自定义通知页面,添加领料单查看,修改温度图表逻辑

master
sc 7 months ago
parent
commit
a2bb445e1d
  1. 72
      Properties/Resources.Designer.cs
  2. 24
      Properties/Resources.en-US.resx
  3. 24
      Properties/Resources.resx
  4. 24
      Properties/Resources.zh-CN.resx
  5. 24
      Properties/Resources.zh-TW.resx
  6. 14
      SunlightCentralizedControlManagement_SCCM_.csproj
  7. 21
      View/DyeingPlanView.xaml.cs
  8. 60
      View/DyelotView.xaml
  9. 54
      View/DyelotView.xaml.cs
  10. 3
      View/MonitorView.xaml.cs
  11. 17
      View/ProductionPlanningView.xaml.cs
  12. 15
      WindowsView/UserMessage.xaml
  13. 40
      WindowsView/UserMessage.xaml.cs

72
Properties/Resources.Designer.cs

@ -267,6 +267,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
/// <summary>
/// 查找类似 Cancel 的本地化字符串。
/// </summary>
public static string Cancel {
get {
return ResourceManager.GetString("Cancel", resourceCulture);
}
}
/// <summary>
/// 查找类似 Client 的本地化字符串。
/// </summary>
@ -609,6 +618,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
/// <summary>
/// 查找类似 Details 的本地化字符串。
/// </summary>
public static string Details {
get {
return ResourceManager.GetString("Details", resourceCulture);
}
}
/// <summary>
/// 查找类似 Dide 的本地化字符串。
/// </summary>
@ -663,6 +681,24 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
/// <summary>
/// 查找类似 DispenseEndTime 的本地化字符串。
/// </summary>
public static string DispenseEndTime {
get {
return ResourceManager.GetString("DispenseEndTime", resourceCulture);
}
}
/// <summary>
/// 查找类似 DispenseGrams 的本地化字符串。
/// </summary>
public static string DispenseGrams {
get {
return ResourceManager.GetString("DispenseGrams", resourceCulture);
}
}
/// <summary>
/// 查找类似 Details were not sent 的本地化字符串。
/// </summary>
@ -942,6 +978,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
/// <summary>
/// 查找类似 Grams 的本地化字符串。
/// </summary>
public static string Grams {
get {
return ResourceManager.GetString("Grams", resourceCulture);
}
}
/// <summary>
/// 查找类似 Group 的本地化字符串。
/// </summary>
@ -1806,6 +1851,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
/// <summary>
/// 查找类似 ProductCode 的本地化字符串。
/// </summary>
public static string ProductCode {
get {
return ResourceManager.GetString("ProductCode", resourceCulture);
}
}
/// <summary>
/// 查找类似 ProductionPlanning 的本地化字符串。
/// </summary>
@ -1815,6 +1869,24 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
/// <summary>
/// 查找类似 ProductName 的本地化字符串。
/// </summary>
public static string ProductName {
get {
return ResourceManager.GetString("ProductName", resourceCulture);
}
}
/// <summary>
/// 查找类似 ProductType 的本地化字符串。
/// </summary>
public static string ProductType {
get {
return ResourceManager.GetString("ProductType", resourceCulture);
}
}
/// <summary>
/// 查找类似 ProgramGroup 的本地化字符串。
/// </summary>

24
Properties/Resources.en-US.resx

@ -990,4 +990,28 @@
<data name="TTAE" xml:space="preserve">
<value>The ticket already exists</value>
</data>
<data name="Details" xml:space="preserve">
<value>Details</value>
</data>
<data name="ProductCode" xml:space="preserve">
<value>ProductCode</value>
</data>
<data name="ProductName" xml:space="preserve">
<value>ProductName</value>
</data>
<data name="ProductType" xml:space="preserve">
<value>ProductType</value>
</data>
<data name="Grams" xml:space="preserve">
<value>Grams</value>
</data>
<data name="DispenseGrams" xml:space="preserve">
<value>Actual</value>
</data>
<data name="DispenseEndTime" xml:space="preserve">
<value>EndTime</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>Cancel</value>
</data>
</root>

24
Properties/Resources.resx

@ -990,4 +990,28 @@
<data name="TTAE" xml:space="preserve">
<value>The ticket already exists</value>
</data>
<data name="Details" xml:space="preserve">
<value>Details</value>
</data>
<data name="ProductCode" xml:space="preserve">
<value>ProductCode</value>
</data>
<data name="ProductName" xml:space="preserve">
<value>ProductName</value>
</data>
<data name="ProductType" xml:space="preserve">
<value>ProductType</value>
</data>
<data name="Grams" xml:space="preserve">
<value>Grams</value>
</data>
<data name="DispenseGrams" xml:space="preserve">
<value>DispenseGrams</value>
</data>
<data name="DispenseEndTime" xml:space="preserve">
<value>DispenseEndTime</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>Cancel</value>
</data>
</root>

24
Properties/Resources.zh-CN.resx

@ -990,4 +990,28 @@
<data name="TTAE" xml:space="preserve">
<value>工单已经存在</value>
</data>
<data name="Details" xml:space="preserve">
<value>明细</value>
</data>
<data name="ProductCode" xml:space="preserve">
<value>原料代码</value>
</data>
<data name="ProductName" xml:space="preserve">
<value>原料名称</value>
</data>
<data name="ProductType" xml:space="preserve">
<value>原料类型</value>
</data>
<data name="Grams" xml:space="preserve">
<value>克重</value>
</data>
<data name="DispenseGrams" xml:space="preserve">
<value>实际</value>
</data>
<data name="DispenseEndTime" xml:space="preserve">
<value>完成时间</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>取消</value>
</data>
</root>

24
Properties/Resources.zh-TW.resx

@ -990,4 +990,28 @@
<data name="TTAE" xml:space="preserve">
<value>工單已經存在</value>
</data>
<data name="Details" xml:space="preserve">
<value>詳細</value>
</data>
<data name="ProductCode" xml:space="preserve">
<value>原料代碼</value>
</data>
<data name="ProductName" xml:space="preserve">
<value>原料名稱</value>
</data>
<data name="ProductType" xml:space="preserve">
<value>原料類型</value>
</data>
<data name="Grams" xml:space="preserve">
<value>克重</value>
</data>
<data name="DispenseGrams" xml:space="preserve">
<value>實際</value>
</data>
<data name="DispenseEndTime" xml:space="preserve">
<value>完成時間</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>取消</value>
</data>
</root>

14
SunlightCentralizedControlManagement_SCCM_.csproj

@ -176,6 +176,9 @@
<Compile Include="UserControls\RoilingTextBlock.xaml.cs">
<DependentUpon>RoilingTextBlock.xaml</DependentUpon>
</Compile>
<Compile Include="View\DyelotView.xaml.cs">
<DependentUpon>DyelotView.xaml</DependentUpon>
</Compile>
<Compile Include="View\Whole.xaml.cs">
<DependentUpon>Whole.xaml</DependentUpon>
</Compile>
@ -197,6 +200,9 @@
<Compile Include="WindowsView\User.xaml.cs">
<DependentUpon>User.xaml</DependentUpon>
</Compile>
<Compile Include="WindowsView\UserMessage.xaml.cs">
<DependentUpon>UserMessage.xaml</DependentUpon>
</Compile>
<Compile Include="WindowsView\ViewStep.xaml.cs">
<DependentUpon>ViewStep.xaml</DependentUpon>
</Compile>
@ -286,6 +292,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\DyelotView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\Whole.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -314,6 +324,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="WindowsView\UserMessage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="WindowsView\ViewStep.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

21
View/DyeingPlanView.xaml.cs

@ -411,17 +411,18 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
{
//处理计划温度图表
TEMPTable.Clear();
DataRow nrow = TEMPTable.NewRow();
string TIMET = "00:00:00";
Double MSTT = 30.0;
Double TT;
Double TC;
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
for (int i = 0; i < dat.Rows.Count; i++)
{
switch (dat.Rows[i][3].ToString())//步骤用时计算
{
case "001":
Double TT = MSTT;
Double TC;
TT = MSTT;
TC = (Double)dat.Rows[i][7];
if (TC > 9.9 || TC < 0.1) TC = 9.9;//计算限制
MSTT = (Double)dat.Rows[i][6];
@ -440,10 +441,16 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
break;
case "013":
TIMET = Convert.ToDateTime(TIMET).AddMinutes((Double)dat.Rows[i][8]* (Double)dat.Rows[i][9]).ToString("HH:mm:ss");
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
break;
case "015":
TIMET = Convert.ToDateTime(TIMET).AddMinutes((Double)dat.Rows[i][8]).ToString("HH:mm:ss");
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
break;
case "017":
TIMET = Convert.ToDateTime(TIMET).AddMinutes((Double)dat.Rows[i][8]).ToString("HH:mm:ss");
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
break;
case "020":
TIMET = Convert.ToDateTime(TIMET).AddMinutes(5).ToString("HH:mm:ss");
@ -462,6 +469,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
break;
case "091":
TT = MSTT;
TC = (Double)dat.Rows[i][7];
if (TC > 9.9 || TC < 0.1) TC = 9.9;//计算限制
MSTT = (Double)dat.Rows[i][6];
TT = Math.Abs(MSTT - TT) / TC * 60;
TIMET = Convert.ToDateTime(TIMET).AddSeconds(TT).ToString("HH:mm:ss");
TEMPTable.Rows.Add(new object[] { TIMET, MSTT });
break;
case "093":
TIMET = Convert.ToDateTime(TIMET).AddMinutes((int)dat.Rows[i][6]).ToString("HH:mm:ss");
@ -509,7 +523,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
conn_SC.Close();
DyelotsBulkedRecipe_.Fill(DyelotsBulkedRecipe);
DataTable ds = new DataTable();//载入信息
DYELOTS_data.Fill(ds);
TEXTColorNumber.Text = ds.AsEnumerable().Select(row => row.Field<string>("ColorNo")).First();

60
View/DyelotView.xaml

@ -0,0 +1,60 @@
<UserControl x:Class="SunlightCentralizedControlManagement_SCCM_.View.DyelotView"
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:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.View"
mc:Ignorable="d" Loaded="UserControl_Loaded"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<DataGrid x:Name="Grid_data" AlternationCount="2" IsReadOnly="True" d:ItemsSource="{d:SampleData ItemCount=99}"
Background="White" HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9"
GridLinesVisibility="All" ColumnHeaderHeight="40"
Grid.ColumnSpan="2" CanUserResizeRows="False" AutoGenerateColumns="False" MinColumnWidth="30"
CanUserAddRows="False" CanUserDeleteRows="False" HeadersVisibility ="Column" SelectionMode="Single"
Margin="0,0,0,0" BorderBrush="#FFC9C9C9" FontSize="16" BorderThickness="5,5,5,5" >
<DataGrid.RowStyle >
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="Height" Value="25" />
<Setter Property="FontSize" Value="15" />
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFFFF" />
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFF0F0F0" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False"/>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="MinWidth" Value="20"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFC0C0C0"/>
<Setter Property="BorderBrush" Value="#FFC0C0C0"/>
<Setter Property="Foreground" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<!--列信息绑定-->
<DataGridTextColumn Header="{x:Static lang:Resources.Step}" Binding="{Binding Step}" Width="80" IsReadOnly="True" />
<DataGridTextColumn Header="{x:Static lang:Resources.ProductCode}" Width="150" Binding="{Binding ProductCode}" IsReadOnly="True"/>
<DataGridTextColumn Header="{x:Static lang:Resources.ProductName}" Width="150" Binding="{Binding ProductName}" IsReadOnly="True"/>
<DataGridTextColumn Header="{x:Static lang:Resources.ProductType}" Width="100" Binding="{Binding ProductType}" IsReadOnly="True"/>
<DataGridTextColumn Header="{x:Static lang:Resources.State}" Width="80" Binding="{Binding State}" IsReadOnly="True"/>
<DataGridTextColumn Header="{x:Static lang:Resources.Grams}" Width="150" Binding="{Binding Grams}" IsReadOnly="True"/>
<DataGridTextColumn Header="{x:Static lang:Resources.DispenseGrams}" Width="150" Binding="{Binding DispenseGrams}" IsReadOnly="True"/>
<DataGridTextColumn Header="{x:Static lang:Resources.DispenseEndTime}" Width="200" Binding="{Binding DispenseEndTime}" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>

54
View/DyelotView.xaml.cs

@ -0,0 +1,54 @@
using DyeingComputer.UserClass;
using SunlightCentralizedControlManagement_SCCM_.UserClass;
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
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.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
namespace SunlightCentralizedControlManagement_SCCM_.View
{
/// <summary>
/// Whole.xaml 的交互逻辑
/// </summary>
public partial class DyelotView : UserControl
{
private SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\SCCM.db"; //数据库路径
public DyelotView()
{
InitializeComponent();
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
}
public void Dyelot(object dat)
{
SQLiteHelpers = new SQLiteHelper(DBAddress);
SQLiteHelpers.Open(); //打开数据库
DataTable dat_c = SQLiteHelpers.ExecuteDataSet("select * from Dyelot where WorkOrder = '" + dat + "'", null).Tables[0];//缓存
SQLiteHelpers.Close();
Grid_data.ItemsSource = dat_c.DefaultView;
}
}
}

3
View/MonitorView.xaml.cs

@ -102,6 +102,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
machines_info = 2;
log.Visibility = Visibility.Visible;
Picture.Visibility = Visibility.Collapsed;
DyelotView dyelotView = new DyelotView();
dyelotView.Dyelot(workOrder);
Picture.Content = dyelotView;
}//单据
private void ListViewItem_Curve(object sender, MouseButtonEventArgs e)
{

17
View/ProductionPlanningView.xaml.cs

@ -71,6 +71,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
minDate = DateTime.Now.Date;
maxDate = minDate.AddDays(1);
//添加表右键功能
ganttTaskContextMenuItems.Add(new ContextMenuItem(DyelotClicked, Properties.Resources.Dyelot + "..."));
ganttTaskContextMenuItems.Add(new ContextMenuItem(ViewClicked, Properties.Resources.View + "..."));
ganttTaskContextMenuItems.Add(new ContextMenuItem(DelayedClicked, Properties.Resources.State + "..."));
ganttTaskContextMenuItems.Add(new ContextMenuItem(EditClicked, Properties.Resources.edit + "..."));
@ -124,6 +125,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
Name = Properties.Resources.ProcessName + ": " + dataRows[j].Field<string>("ProgramName"),
Background = colorBackground,
Status = colorStatus,
WorkOrder = dataRows[j].Field<string>("WorkOrder").ToString(),
ID = Properties.Resources.WorkOrder + ": " + dataRows[j].Field<string>("WorkOrder").ToString(),
Dyelot = Properties.Resources.Dyelot + ": " + dataRows[j].Field<string>("Dyelot"),
Remark = Properties.Resources.Remark + ": " + dataRows[j].Field<string>("Remark"),
@ -145,11 +147,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
{
Picture.Content = null;
Picture.Width = 600;
Picture.Content = new ProductionPlanningEdit(ganttTask.ID,false);
Picture.Content = new ProductionPlanningEdit(ganttTask.WorkOrder,false);
}
private void AdvanceClicked(GanttTask ganttTask)
private void DyelotClicked(GanttTask ganttTask)//领料单查看
{
UserMessage userMessage = new UserMessage();
userMessage.Dyelots(ganttTask.WorkOrder);
userMessage.ShowDialog();
}
private void DelayedClicked(GanttTask ganttTask)
{
@ -162,7 +166,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
DataTable WorkOrder_dt = SQLiteHelpers.ExecuteDataSet(
"select * from WorkOrder where WorkOrder='" + ganttTask.ID + "'Order by StartTime", null).Tables[0]; //读取表写入缓存
"select * from WorkOrder where WorkOrder='" + ganttTask.WorkOrder + "'Order by StartTime", null).Tables[0]; //读取表写入缓存
SQLiteHelpers.Close();
if (DateTime.Now > DateTime.Parse(WorkOrder_dt.Select().First().Field<object>("EndTime").ToString()))
@ -176,7 +180,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
{
Picture.Content = null;
Picture.Width = 600;
Picture.Content = new ProductionPlanningEdit(ganttTask.ID, true);
Picture.Content = new ProductionPlanningEdit(ganttTask.WorkOrder, true);
}
else
{
@ -195,7 +199,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
///执行删除
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
SQLiteHelpers.Delete("WorkOrder", "WorkOrder='" + ganttTask.ID + "'", null);
SQLiteHelpers.Delete("WorkOrder", "WorkOrder='" + ganttTask.WorkOrder + "'", null);
SQLiteHelpers.Delete("WorkOrderSteps", "WorkOrder='" + ganttTask.WorkOrder + "'", null);
SQLiteHelpers.Close();
GanttChartNEW();
}

15
WindowsView/UserMessage.xaml

@ -0,0 +1,15 @@
<Window x:Class="SunlightCentralizedControlManagement_SCCM_.WindowsView.UserMessage"
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:SunlightCentralizedControlManagement_SCCM_.WindowsView"
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
mc:Ignorable="d"
Title="UserMessage" Height="450" Width="800">
<Grid Margin="0,0,0,0">
<Button x:Name="Save" Content="{x:Static lang:Resources.Cancel}" HorizontalAlignment="Right" Height="35" Margin="450,0,50,10" VerticalAlignment="Bottom" Width="80" Click="Save_Click"/>
<ContentControl x:Name="Picture" Margin="0,0,0,50"/>
</Grid>
</Window>

40
WindowsView/UserMessage.xaml.cs

@ -0,0 +1,40 @@
using SunlightCentralizedControlManagement_SCCM_.View;
using System;
using System.Collections.Generic;
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 SunlightCentralizedControlManagement_SCCM_.WindowsView
{
/// <summary>
/// UserMessage.xaml 的交互逻辑
/// </summary>
public partial class UserMessage : Window
{
public UserMessage()
{
InitializeComponent();
}
public void Dyelots(object dat)
{
DyelotView dyelotView = new DyelotView();
dyelotView.Dyelot(dat);
Picture.Content= dyelotView;
}
private void Save_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}
Loading…
Cancel
Save