Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
915aedd87b
5 files changed
+35
-25
No files matched your search
+5
-4
@@ -1,4 +1,5 @@
|
||||
using LiveChartsCore;
|
||||
using DyeingComputer.UserClass;
|
||||
using LiveChartsCore;
|
||||
using LiveChartsCore.SkiaSharpView;
|
||||
using SkiaSharp;
|
||||
using System;
|
||||
@@ -84,7 +85,7 @@ namespace SunlightCentralizedControlManagement_SCCM_
|
||||
mutex = new System.Threading.Mutex(true, "SCCM", out ret);//程序只允许启动一次
|
||||
if (!ret)
|
||||
{
|
||||
// LogGing.LogGingDATA("800_The program has been launched");
|
||||
LogGing.LogGingDATA("800_The program has been launched");
|
||||
MessageBox.Show("The program has been launched");
|
||||
Environment.Exit(0);
|
||||
}
|
||||
@@ -127,8 +128,8 @@ namespace SunlightCentralizedControlManagement_SCCM_
|
||||
|
||||
string Log_time = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
string logpath = System.Environment.CurrentDirectory + "\\ERR";//日志文件目录
|
||||
//string logPathtxt = "" + System.Environment.CurrentDirectory + "\\Log\\"+ Log_time + "Log.txt";//日志文件
|
||||
// System.IO.DirectoryInfo log = new System.IO.DirectoryInfo();//生成日志文件目录
|
||||
// string logPathtxt = "" + System.Environment.CurrentDirectory + "\\Log\\"+ Log_time + "Log.txt";//日志文件
|
||||
// System.IO.DirectoryInfo log = new System.IO.DirectoryInfo();//生成日志文件目录
|
||||
string log_path = logpath + "\\ERR" + Log_time + ".txt";
|
||||
string Log_timehms = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
if (Directory.Exists(logpath))//检查日志路径
|
||||
|
||||
@@ -27,6 +27,7 @@ using Newtonsoft.Json.Linq;
|
||||
using System.Xml.Linq;
|
||||
using ScottPlot;
|
||||
using System.Collections;
|
||||
using DyeingComputer.UserClass;
|
||||
|
||||
namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
{/// <summary>
|
||||
@@ -49,6 +50,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
drEmployee.AcceptChanges();
|
||||
drEmployee.ClearErrors();
|
||||
|
||||
LogGing.LogGingDATA("[IP='" + client.IP + "' AND port='" + client.Port + "']=Link_OK");
|
||||
|
||||
return EasyTask.CompletedTask;
|
||||
};//成功连接到服务器
|
||||
tcpClient.Closing = (client, e) =>
|
||||
@@ -59,6 +62,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
drEmployee.EndEdit();
|
||||
drEmployee.AcceptChanges();
|
||||
drEmployee.ClearErrors();
|
||||
LogGing.LogGingDATA("[IP='" + client.IP + "' AND port='" + client.Port + "']=Link_STOP");
|
||||
|
||||
return EasyTask.CompletedTask;
|
||||
};//即将从服务器断开连接。此处仅主动断开才有效。
|
||||
@@ -70,6 +74,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
drEmployee.EndEdit();
|
||||
drEmployee.AcceptChanges();
|
||||
drEmployee.ClearErrors();
|
||||
LogGing.LogGingDATA("[IP='" + client.IP + "' AND port='" + client.Port + "']=Link_INTERRUPT");
|
||||
|
||||
return EasyTask.CompletedTask;
|
||||
};//从服务器断开连接,当连接不成功时不会触发。
|
||||
@@ -100,20 +105,19 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
_new = JsonConvert.DeserializeObject<Dictionary<string, object>>(DAT);//反序列化
|
||||
DataRow drEmployee = MainWindowViewModel.Machines.Select("IP='" + client.IP + "' AND port='" + client.Port + "'").First();
|
||||
drEmployee.BeginEdit();
|
||||
drEmployee["Message"] = _new.GetValue("Status").ToString();
|
||||
drEmployee["WorkOrder"] = _new.GetValue("WorkNumder").ToString();
|
||||
drEmployee["Temperature"] = _new.GetValue("MTT").ToString();
|
||||
drEmployee["WaterLevel"] = _new.GetValue("MTL").ToString();
|
||||
drEmployee["Process"] = _new.GetValue("Process").ToString();
|
||||
drEmployee["Step"] = _new.GetValue("Step").ToString();
|
||||
drEmployee["Message"] = _new.GetValue("Status");
|
||||
drEmployee["WorkOrder"] = _new.GetValue("WorkNumder");
|
||||
drEmployee["Temperature"] = _new.GetValue("MTT");
|
||||
drEmployee["WaterLevel"] = _new.GetValue("MTL");
|
||||
drEmployee["Process"] = _new.GetValue("Process");
|
||||
drEmployee["Step"] = _new.GetValue("Step");
|
||||
drEmployee.EndEdit();
|
||||
drEmployee.AcceptChanges();
|
||||
drEmployee.ClearErrors();
|
||||
|
||||
if (_new.GetValue("Status").ToString() != "----------")
|
||||
{
|
||||
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
|
||||
// Chart_new.Add("DYELOT", _new.GetValue("Status"));
|
||||
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
|
||||
Chart_new.Add("WorkOrder", _new.GetValue("WorkNumder"));
|
||||
Chart_new.Add("Machine", _new.GetValue("Machine"));
|
||||
Chart_new.Add("Time", _new.GetValue("Time"));
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<ColumnDefinition Width="5"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<DataGrid Grid.Column="2" x:Name="Gridstep" AlternationCount="2" IsReadOnly="True" SelectionChanged="Gridstep_SelectionChanged"
|
||||
<DataGrid Grid.Column="2" x:Name="Gridstep" AlternationCount="2" IsReadOnly="True" MouseDoubleClick="Gridstep_MouseDoubleClick"
|
||||
d:ItemsSource="{d:SampleData ItemCount=90}" AutoGenerateColumns="False" MinColumnWidth="30"
|
||||
ItemsSource="{Binding Path=TechnologicalProcess_View,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
HorizontalGridLinesBrush="#FFC9C9C9" VerticalGridLinesBrush="#FFC9C9C9" Background="White"
|
||||
|
||||
@@ -59,10 +59,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
|
||||
machin_LOG.Text = Properties.Resources.Machine + ":" + machine + " " + Properties.Resources.WorkOrder + ":" + workOrder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Gridstep_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
private void Gridstep_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
Paused.IsEnabled = true;
|
||||
MainWindowViewModel.TechnologicalProcess_bool = false;
|
||||
int rownum = Gridstep.SelectedIndex;//获取鼠标选中行并定义变量
|
||||
if (rownum != -1)//判断鼠标定位是否有效
|
||||
{
|
||||
@@ -74,8 +76,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
P4 = (Gridstep.Columns[9].GetCellContent(Gridstep.Items[rownum]) as TextBlock).Text;//定位第9列,
|
||||
P5 = (Gridstep.Columns[10].GetCellContent(Gridstep.Items[rownum]) as TextBlock).Text;//定位第10列,
|
||||
}
|
||||
Paused.IsEnabled = true;
|
||||
MainWindowViewModel.TechnologicalProcess_bool = false;
|
||||
}
|
||||
|
||||
private void ListViewItem_DyeingMachine(object sender, MouseButtonEventArgs e)
|
||||
@@ -148,13 +148,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
viewstop.data = ID;
|
||||
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(edit_ButtonClicked);
|
||||
viewstop.ShowDialog();
|
||||
MainWindowViewModel.TechnologicalProcess_bool = true;
|
||||
}//编辑
|
||||
string Numder = null;
|
||||
string ID = null;
|
||||
string P1 = "0", P2 = "0", P3 = "0", P4 = "0", P5 = "0";
|
||||
private void edit_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果
|
||||
{
|
||||
MainWindowViewModel.TechnologicalProcess_bool = true;
|
||||
|
||||
Dictionary<string, object> dat_821 = new Dictionary<string, object>();
|
||||
dat_821.Clear();
|
||||
dat_821.Add("INSTRUCTION", "EDIT");
|
||||
@@ -184,7 +185,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
viewstop.data = ID;
|
||||
viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Insert_ButtonClicked);
|
||||
viewstop.ShowDialog();
|
||||
}//插入
|
||||
}//插入
|
||||
private void Insert_ButtonClicked(object sender, AddressUpdateEventArgs e)//cr返回结果
|
||||
{
|
||||
|
||||
|
||||
@@ -163,12 +163,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
{
|
||||
for (int i = 0; i < Machinesdata_Count; i++)
|
||||
{
|
||||
MachiensTcpClient[i] = new TcpClient();
|
||||
DataRow dt = machinesdata[i];
|
||||
Updata_Machines(Machines, "State", Convert.ToInt16(dt["ID"]), "800");
|
||||
_ = AsyncTcpClient.TcpClient(MachiensTcpClient[i] //建立tcp连接
|
||||
, Selet_Machines(Machines, "IP", Convert.ToInt16(dt["ID"])).ToString()
|
||||
, Selet_Machines(Machines, "PORT", Convert.ToInt16(dt["ID"])).ToString());
|
||||
if (Selet_Machines(Machines, "State", i).ToString() == "800")
|
||||
{
|
||||
MachiensTcpClient[i] = new TcpClient();
|
||||
DataRow dt = machinesdata[i];
|
||||
_ = AsyncTcpClient.TcpClient(MachiensTcpClient[i] //建立tcp连接
|
||||
, Selet_Machines(Machines, "IP", Convert.ToInt16(dt["ID"])).ToString()
|
||||
, Selet_Machines(Machines, "PORT", Convert.ToInt16(dt["ID"])).ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,6 +449,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
return lst;
|
||||
}
|
||||
//通讯队列
|
||||
public static UInt32 RX=0;
|
||||
public static UInt32 TX=0;
|
||||
public class QueueString
|
||||
{
|
||||
public int ID { get; set; }
|
||||
|
||||
Reference in new issue
Block a user