添加资源,修改机台设置页面,添加任务开始页面,修改网络连接错误
This commit is contained in:
commit
daaa2b5514
14 files changed
+294
-19
No files matched your search
+5
-3
@@ -1,4 +1,5 @@
|
|||||||
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
using SunlightCentralizedControlManagement_SCCM_.UserClass;
|
||||||
|
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
@@ -82,9 +83,10 @@ namespace SunlightCentralizedControlManagement_SCCM_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
System.Windows.MessageBox.Show(Properties.Resources.NPERR, "SCCM", MessageBoxButton.OK, MessageBoxImage.Error);
|
LogGing.ERRDATA(ex);
|
||||||
|
System.Windows.MessageBox.Show("Unable to start. Check the log for details.", "SCCM", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ namespace SunlightCentralizedControlManagement_SCCM_
|
|||||||
{
|
{
|
||||||
public static string user_;
|
public static string user_;
|
||||||
public static DataTable InfData = new DataTable();
|
public static DataTable InfData = new DataTable();
|
||||||
|
// public static string[] Inf_string ;
|
||||||
public UserInformation userInformation;
|
public UserInformation userInformation;
|
||||||
|
// public UserInf userInf;
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
@@ -74,6 +76,22 @@ namespace SunlightCentralizedControlManagement_SCCM_
|
|||||||
if (userInformation.WindowState == WindowState.Minimized) userInformation.WindowState = WindowState.Normal;
|
if (userInformation.WindowState == WindowState.Minimized) userInformation.WindowState = WindowState.Normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* private void UserInfTable(string dat)//触发行改变事件
|
||||||
|
{
|
||||||
|
userInf.Inf_DAT = dat;
|
||||||
|
if (userInf == null || !userInf.IsLoaded)//窗口不存在及创建
|
||||||
|
{
|
||||||
|
userInf = new UserInf();
|
||||||
|
userInf.Topmost = true;
|
||||||
|
userInf.Show();
|
||||||
|
userInf.Activate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{//窗口纯在及置顶
|
||||||
|
userInf.Activate();
|
||||||
|
if (userInf.WindowState == WindowState.Minimized) userInf.WindowState = WindowState.Normal;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
private void ButtonPopUpLogout_Click(object sender, RoutedEventArgs e)
|
private void ButtonPopUpLogout_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|||||||
Generated
+18
@@ -1284,6 +1284,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Machines 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string Machines {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Machines", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Malfunction 的本地化字符串。
|
/// 查找类似 Malfunction 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2004,6 +2013,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 ProgramName 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string ProgramName {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ProgramName", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 ProportionalValves 的本地化字符串。
|
/// 查找类似 ProportionalValves 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1086,4 +1086,10 @@
|
|||||||
<data name="Start" xml:space="preserve">
|
<data name="Start" xml:space="preserve">
|
||||||
<value>Start</value>
|
<value>Start</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ProgramName" xml:space="preserve">
|
||||||
|
<value>Program Name</value>
|
||||||
|
</data>
|
||||||
|
<data name="Machines" xml:space="preserve">
|
||||||
|
<value>Machines</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1086,4 +1086,10 @@
|
|||||||
<data name="Start" xml:space="preserve">
|
<data name="Start" xml:space="preserve">
|
||||||
<value>Start</value>
|
<value>Start</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ProgramName" xml:space="preserve">
|
||||||
|
<value>ProgramName</value>
|
||||||
|
</data>
|
||||||
|
<data name="Machines" xml:space="preserve">
|
||||||
|
<value>Machines</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1086,4 +1086,10 @@
|
|||||||
<data name="Start" xml:space="preserve">
|
<data name="Start" xml:space="preserve">
|
||||||
<value>开始</value>
|
<value>开始</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ProgramName" xml:space="preserve">
|
||||||
|
<value>工艺名</value>
|
||||||
|
</data>
|
||||||
|
<data name="Machines" xml:space="preserve">
|
||||||
|
<value>机台</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -1084,6 +1084,12 @@
|
|||||||
<value>擺佈</value>
|
<value>擺佈</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Start" xml:space="preserve">
|
<data name="Start" xml:space="preserve">
|
||||||
<value />
|
<value>開始</value>
|
||||||
|
</data>
|
||||||
|
<data name="ProgramName" xml:space="preserve">
|
||||||
|
<value>工藝名</value>
|
||||||
|
</data>
|
||||||
|
<data name="Machines" xml:space="preserve">
|
||||||
|
<value>機器</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -153,6 +153,9 @@
|
|||||||
<Compile Include="UserControls\DispenseMacInfo.xaml.cs">
|
<Compile Include="UserControls\DispenseMacInfo.xaml.cs">
|
||||||
<DependentUpon>DispenseMacInfo.xaml</DependentUpon>
|
<DependentUpon>DispenseMacInfo.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="WindowsView\UserWorkOrder.xaml.cs">
|
||||||
|
<DependentUpon>UserWorkOrder.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="WindowsView\UserInf.xaml.cs">
|
<Compile Include="WindowsView\UserInf.xaml.cs">
|
||||||
<DependentUpon>UserInf.xaml</DependentUpon>
|
<DependentUpon>UserInf.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -295,6 +298,10 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="WindowsView\UserWorkOrder.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Include="WindowsView\UserInf.xaml">
|
<Page Include="WindowsView\UserInf.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using ScottPlot.Colormaps;
|
|||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
using SunlightCentralizedControlManagement_SCCM_.View;
|
using SunlightCentralizedControlManagement_SCCM_.View;
|
||||||
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
||||||
|
using SunlightCentralizedControlManagement_SCCM_.WindowsView;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -22,10 +23,11 @@ using System.Text;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Documents;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using TouchSocket.Core;
|
using TouchSocket.Core;
|
||||||
using TouchSocket.Sockets;
|
|
||||||
using TouchSocket.SerialPorts;
|
using TouchSocket.SerialPorts;
|
||||||
|
using TouchSocket.Sockets;
|
||||||
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
|
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
|
||||||
using static SunlightCentralizedControlManagement_SCCM_.View.MachinesView;
|
using static SunlightCentralizedControlManagement_SCCM_.View.MachinesView;
|
||||||
using static System.Windows.Forms.AxHost;
|
using static System.Windows.Forms.AxHost;
|
||||||
@@ -181,8 +183,26 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
DataTable dataTable = JsonConvert.DeserializeObject<DataTable>(DAT).Copy();//反序列化
|
DataTable dataTable = JsonConvert.DeserializeObject<DataTable>(DAT).Copy();//反序列化
|
||||||
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
UserWorkOrder userWorkOrder = new UserWorkOrder();
|
||||||
|
userWorkOrder.WorkOrderTable = dataTable;
|
||||||
|
userWorkOrder.Show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
UserInf userInf = new UserInf();
|
||||||
|
userInf.Inf_DAT = "没有等待中的工艺";
|
||||||
|
userInf.Show();
|
||||||
|
userInf.Activate();
|
||||||
|
});
|
||||||
|
|
||||||
|
// LogGing.LogGingDATA("[ERR='" + ex + "']=Exception");
|
||||||
|
MainWindowViewModel.ERR_c++;
|
||||||
}
|
}
|
||||||
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
|
||||||
}
|
}
|
||||||
else if (SYSAPI == "SC827")
|
else if (SYSAPI == "SC827")
|
||||||
{
|
{
|
||||||
@@ -381,6 +401,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
}
|
}
|
||||||
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}//细节错误
|
}//细节错误
|
||||||
|
else if (SYSAPI == "SC921")
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
|
}
|
||||||
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
|
}//错误
|
||||||
else if (SYSAPI == "SC980")
|
else if (SYSAPI == "SC980")
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
dat_["IP"] = IP.Text;
|
dat_["IP"] = IP.Text;
|
||||||
dat_["PORT"] = PORT.Text;
|
dat_["PORT"] = PORT.Text;
|
||||||
dat_["Serial"] = comboBoxCOM0.Text;
|
dat_["Serial"] = comboBoxCOM0.Text;
|
||||||
dat_["Type"] = comboBoxtype.Text;
|
|
||||||
dat_["Model"] = comboBoxtype.Text;
|
dat_["Model"] = comboBoxtype.Text;
|
||||||
dat_["Station"] = Station.Text;
|
dat_["Station"] = Station.Text;
|
||||||
dat_["ID"] = 999;
|
dat_["ID"] = 999;
|
||||||
|
|||||||
@@ -232,7 +232,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(machine))
|
if (!string.IsNullOrEmpty(machine))
|
||||||
{
|
{
|
||||||
|
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
|
||||||
|
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
|
||||||
|
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
|
||||||
|
{
|
||||||
|
ID = index,
|
||||||
|
DAT = "SC822" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", "ID='" + index + "'")
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}//开始
|
}//开始
|
||||||
private void ListViewItem_DyeingMachine(object sender, MouseButtonEventArgs e)
|
private void ListViewItem_DyeingMachine(object sender, MouseButtonEventArgs e)
|
||||||
|
|||||||
@@ -108,19 +108,21 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
SN_KEY = Configini.IniReadvalue("SN", "SN1");
|
SN_KEY = Configini.IniReadvalue("SN", "SN1");
|
||||||
DyelotsDispenser = Convert.ToBoolean(Configini.IniReadvalue("SYS", "DyelotsDispenser"));
|
DyelotsDispenser = Convert.ToBoolean(Configini.IniReadvalue("SYS", "DyelotsDispenser"));
|
||||||
|
|
||||||
SQLiteChartAdress = new SQLiteHelper(ChartAdress); //数据库连接路径
|
SQLiteChartAdress = new SQLiteHelper(ChartAdress); //数据库连接路径
|
||||||
SQLiteChartAdress.Open(); //打开数据库
|
SQLiteChartAdress.Open(); //打开数据库
|
||||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
SQLiteHelpers.Open(); //打开数据库
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
Machines = SQLiteHelpers.ExecuteDataSet("select * from Machines Order by id", null).Tables[0]; //读取表写入缓存
|
Machines = SQLiteHelpers.ExecuteDataSet("select * from Machines Order by id", null).Tables[0]; //读取表写入缓存
|
||||||
USER_data = SQLiteHelpers.ExecuteDataSet("select * from USER order by Name desc", null).Tables[0];
|
USER_data = SQLiteHelpers.ExecuteDataSet("select * from USER order by Name desc", null).Tables[0];
|
||||||
Dyelot_CALL = SQLiteHelpers.ExecuteDataSet("select * from Dyelot", null).Tables[0].Clone();
|
Dyelot_CALL = SQLiteHelpers.ExecuteDataSet("select * from Dyelot", null).Tables[0].Clone();
|
||||||
|
|
||||||
Whole_dat.Columns.Add("Machine", Type.GetType("System.String"));
|
Whole_dat.Columns.Add("Machine", Type.GetType("System.String"));
|
||||||
Whole_dat.Columns.Add("DateTime", Type.GetType("System.DateTime"));
|
Whole_dat.Columns.Add("DateTime", Type.GetType("System.DateTime"));
|
||||||
Whole_dat.Columns.Add("DAT", Type.GetType("System.Double"));
|
Whole_dat.Columns.Add("DAT", Type.GetType("System.Double"));
|
||||||
}
|
}
|
||||||
catch (Exception ex) { LogGing.ERRDATA(ex);
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogGing.ERRDATA(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
USERCapacity(App.USER_Purview);//App.USER_Purview);
|
USERCapacity(App.USER_Purview);//App.USER_Purview);
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<Window x:Class="SunlightCentralizedControlManagement_SCCM_.WindowsView.UserWorkOrder"
|
||||||
|
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"
|
||||||
|
WindowStartupLocation="CenterScreen"
|
||||||
|
Loaded ="Window_Loaded"
|
||||||
|
ResizeMode="NoResize"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="SUNLIGHT 800" Height="400" Width="800">
|
||||||
|
<Grid>
|
||||||
|
<DataGrid Grid.Row="0" Grid.Column="0" x:Name="WorkOrder" AlternationCount="2" IsReadOnly="True"
|
||||||
|
SelectedCellsChanged="WorkOrder_SelectedCellsChanged" EnableRowVirtualization="True" EnableColumnVirtualization="True"
|
||||||
|
VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||||
|
Background="White" GridLinesVisibility="All" ColumnHeaderHeight="40" HorizontalContentAlignment="Right"
|
||||||
|
CanUserReorderColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserResizeColumns="True"
|
||||||
|
CanUserDeleteRows="False" SelectionMode="Single" FontSize="15" Focusable="True" Margin="0,0,0,132" >
|
||||||
|
<DataGrid.RowStyle >
|
||||||
|
<Style TargetType="{x:Type DataGridRow}">
|
||||||
|
<Setter Property="Height" Value="30" />
|
||||||
|
<Setter Property="FontSize" Value="25" />
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<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"/>
|
||||||
|
<DataTrigger Binding="{Binding lock}" Value="True">
|
||||||
|
<Setter Property="Background" Value="Red"/>
|
||||||
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding State}" Value="309">
|
||||||
|
<Setter Property="Background" Value="Red"/>
|
||||||
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding State}" Value="308">
|
||||||
|
<Setter Property="Background" Value="Yellow"/>
|
||||||
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding State}" Value="800">
|
||||||
|
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.RowStyle>
|
||||||
|
<DataGrid.CellStyle>
|
||||||
|
<Style TargetType="DataGridCell">
|
||||||
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
|
<Setter Property="MinWidth" Value="20"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<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.Resources>
|
||||||
|
<Style x:Key="CellStyle" TargetType="{x:Type DataGridCell}">
|
||||||
|
<Setter Property="Focusable" Value="False"/>
|
||||||
|
<Setter Property="Background" Value="#FFFFFFFF"/>
|
||||||
|
<Setter Property="BorderBrush" Value="#FFFFFFFF"/>
|
||||||
|
<Setter Property="Foreground" Value="#000000"/>
|
||||||
|
</Style>
|
||||||
|
</DataGrid.Resources>
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<!--列信息绑定-->
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.WorkOrder}" Binding="{Binding WorkOrder}" Width="200" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.ProgramName}" Binding="{Binding ProgramName}" Width="200" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.StartTime}" Binding="{Binding StartTime}" Width="250" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.Machines}" Binding="{Binding Machines}" Width="100" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.ColorNumber}" Binding="{Binding ColorNumber}" Width="200" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.Client}" Binding="{Binding Client}" Width="200" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.ClothWeight}" Binding="{Binding ClothWeight}" Width="200" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.ClothSpecies}" Binding="{Binding ClothSpecies}" Width="200" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.BathRatio}" Binding="{Binding BathRatio}" Width="200" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.Total}" Binding="{Binding Total}" Width="200" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.USER}" Binding="{Binding USER}" Width="150" IsReadOnly="True"/>
|
||||||
|
<DataGridTextColumn Header="{x:Static lang:Resources.ColorName}" Binding="{Binding ColorName}" Width="200" IsReadOnly="True"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
<Image Height="100" Width="100" FlowDirection="LeftToRight" HorizontalAlignment="Left" Margin="20,0,0,20" Source="/Lmage/IconParkInfo.png" VerticalAlignment="Bottom"/>
|
||||||
|
|
||||||
|
<Button Content="{x:Static lang:Resources.Start}" HorizontalAlignment="Right" Height="45" Margin="50,70,200,20" IsEnabled="False" x:Name="Start"
|
||||||
|
VerticalAlignment="Bottom" Width="100" Click="Start_Click" HorizontalContentAlignment="Center"/>
|
||||||
|
<Button Content="{x:Static lang:Resources.Quit}" HorizontalAlignment="Right" Height="45" Margin="50,70,20,20"
|
||||||
|
VerticalAlignment="Bottom" Width="100" Click="Quit_Click" HorizontalContentAlignment="Center"/>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
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.Forms;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Markup;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Animation;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using TouchSocket.Core;
|
||||||
|
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
|
||||||
|
|
||||||
|
namespace SunlightCentralizedControlManagement_SCCM_.WindowsView
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ViewProgram.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class UserWorkOrder : Window
|
||||||
|
{
|
||||||
|
|
||||||
|
public DataTable WorkOrderTable = new DataTable();//信息
|
||||||
|
private string WorkOrder_=null;
|
||||||
|
private string machine_ = null;
|
||||||
|
public UserWorkOrder()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
WorkOrder.ItemsSource = WorkOrderTable.DefaultView;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Start_Click(object sender, RoutedEventArgs e)//确认
|
||||||
|
{
|
||||||
|
Dictionary<string, object> dat_821 = new Dictionary<string, object>();
|
||||||
|
dat_821.Clear();
|
||||||
|
dat_821.Add("INSTRUCTION", "START");
|
||||||
|
dat_821.Add("WorkOrder", WorkOrder_);
|
||||||
|
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine_ + "'").First();
|
||||||
|
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
|
||||||
|
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
|
||||||
|
{
|
||||||
|
ID = index,
|
||||||
|
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", "ID='" + index + "'") + dat_821.ToJsonString()
|
||||||
|
});
|
||||||
|
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
private void Quit_Click(object sender, RoutedEventArgs e)//退出
|
||||||
|
{
|
||||||
|
this.Close(); //关闭窗口
|
||||||
|
}
|
||||||
|
private void WorkOrder_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||||
|
{
|
||||||
|
int rownum = WorkOrder.SelectedIndex;//获取鼠标选中行并定义变量
|
||||||
|
if (rownum != -1)//判断鼠标定位是否有效
|
||||||
|
{
|
||||||
|
WorkOrder_ = (WorkOrder.Columns[0].GetCellContent(WorkOrder.Items[rownum]) as TextBlock).Text;//定位第0列,
|
||||||
|
machine_ = (WorkOrder.Columns[3].GetCellContent(WorkOrder.Items[rownum]) as TextBlock).Text;//定位第0列,
|
||||||
|
|
||||||
|
Start.IsEnabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user