Browse Source

单据信息显示

master
sc 3 months ago
parent
commit
d047a4f23e
  1. 35
      UserClass/AsyncTcpClient.cs
  2. 2
      View/DyelotView.xaml
  3. 5
      View/DyelotView.xaml.cs
  4. 33
      View/MonitorView.xaml.cs

35
UserClass/AsyncTcpClient.cs

@ -1,33 +1,34 @@
using System;
using DyeingComputer.UserClass;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using ScottPlot;
using ScottPlot.Colormaps;
using SkiaSharp;
using SunlightCentralizedControlManagement_SCCM_.View;
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Sockets;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Windows;
using System.Xml.Linq;
using TouchSocket.Core;
using TouchSocket.Sockets;
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
using System.Runtime.InteropServices;
using ScottPlot.Colormaps;
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
using static System.Windows.Forms.AxHost;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using Newtonsoft.Json;
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
using SunlightCentralizedControlManagement_SCCM_.View;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
using TcpClient = TouchSocket.Sockets.TcpClient;
using Newtonsoft.Json.Linq;
using System.Xml.Linq;
using ScottPlot;
using System.Collections;
using DyeingComputer.UserClass;
using System.Windows;
namespace SunlightCentralizedControlManagement_SCCM_.UserClass
{/// <summary>
@ -240,7 +241,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
{
try
{
MainWindowViewModel.MachineLOG = DAT.Substring(DAT.IndexOf("]") + 1);
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
MonitorView.Product_DAT = JsonConvert.DeserializeObject<DataTable>(DAT).Copy();//反序列化
MonitorView.Product_bool=true;
}
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
}//当前领料单信息

2
View/DyelotView.xaml

@ -63,7 +63,7 @@
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<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.DispenseGrams}" Width="150" Binding="{Binding Amount}" IsReadOnly="True"/>
<DataGridTextColumn Header="{x:Static lang:Resources.DispenseEndTime}" Width="200" Binding="{Binding DispenseEndTime}" IsReadOnly="True"/>
</DataGrid.Columns>
</DataGrid>

5
View/DyelotView.xaml.cs

@ -48,7 +48,10 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
Grid_data.ItemsSource = dat_c.DefaultView;
}
public void DyelotDatatable(DataTable dat)
{
Grid_data.ItemsSource = dat.DefaultView;
}
}
}

33
View/MonitorView.xaml.cs

@ -75,6 +75,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
private string dyelot;
private int machines_info=0;
public static string Sys_log;
public static DataTable Product_DAT = new DataTable();
public static bool Product_bool = false;
private void Griddata_SelectionChanged(object sender, SelectionChangedEventArgs e)//设备列表
{
@ -122,7 +124,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
}
}
private void Gridstep_SelectionChanged(object sender, SelectionChangedEventArgs e)
private void Gridstep_SelectionChanged(object sender, SelectionChangedEventArgs e)//步骤定位
{
TechnologicalProcess_bool = false;
int rownum = Gridstep.SelectedIndex;//获取鼠标选中行并定义变量
@ -145,7 +147,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
rdp.Visibility = Visibility.Collapsed;
Picture.Visibility = Visibility.Collapsed;
}//信息
private async Task<bool> PingTest(string ip)
{
bool result = false;
@ -210,12 +211,19 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
return;
}
int index = Convert.ToInt16(drEmployee.Field<object>("ID"));
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
{
ID = index,
DAT = "SC833" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", "ID='" + index + "'")
});
machines_info = 2;
log.Visibility = Visibility.Visible;
log.Visibility = Visibility.Collapsed;
rdp.Visibility = Visibility.Collapsed;
Picture.Visibility = Visibility.Collapsed;
Picture.Visibility = Visibility.Visible;
DyelotView dyelotView = new DyelotView();
dyelotView.Dyelot(workOrder);
dyelotView.DyelotDatatable(Product_DAT);
Picture.Content = dyelotView;
}//单据
private void ListViewItem_LOCK_XML(object sender, MouseButtonEventArgs e)
@ -249,7 +257,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
MessageBox.Show(machine + Properties.Resources.user_unlock, "800", MessageBoxButton.OK, MessageBoxImage.Information);
}
}//锁定
private void ListViewItem_Curve(object sender, MouseButtonEventArgs e)
{
log.Visibility = Visibility.Collapsed;
@ -258,6 +265,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
Picture.Content = new View.CurveDiagram(true, "", "", "", workOrder);
machines_info = 3;
}//曲线
private void ListViewItem_Resume(object sender, MouseButtonEventArgs e)
{
IsInteractive = false;
@ -356,7 +364,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
TechnologicalProcess_bool = true;
}
private void ListViewItem_Jump(object sender, MouseButtonEventArgs e)
{
Dictionary<string, object> dat_821 = new Dictionary<string, object>();
@ -541,13 +548,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
{
}//输送状态
else if (machines_info == 2)
else if (machines_info == 2 && Product_bool)
{
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
{
ID = index,
DAT = "SC833" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", "ID='" + index + "'")
});
Product_bool = false;
DyelotView dyelotView = new DyelotView();
dyelotView.DyelotDatatable(Product_DAT);
Picture.Content = dyelotView;
}//单据
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
@ -627,7 +633,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
RaisePropertyChanged("TechnologicalProcess_View");
}
}
public ObservableCollection<TechnologicalM> TechnologicalMachine_View
{
get { return technologicalMachine_View; }

Loading…
Cancel
Save