|
@ -1,4 +1,5 @@ |
|
|
using SunlightCentralizedControlManagement_SCCM_.ViewModel; |
|
|
using ScottPlot.TickGenerators.TimeUnits; |
|
|
|
|
|
using SunlightCentralizedControlManagement_SCCM_.ViewModel; |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Data; |
|
|
using System.Data; |
|
@ -22,6 +23,7 @@ using System.Windows.Threading; |
|
|
using System.Xml.Linq; |
|
|
using System.Xml.Linq; |
|
|
using TouchSocket.Core; |
|
|
using TouchSocket.Core; |
|
|
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper; |
|
|
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper; |
|
|
|
|
|
using static SunlightCentralizedControlManagement_SCCM_.ViewModel.MainWindowViewModel; |
|
|
|
|
|
|
|
|
namespace SunlightCentralizedControlManagement_SCCM_.WindowsView |
|
|
namespace SunlightCentralizedControlManagement_SCCM_.WindowsView |
|
|
{ |
|
|
{ |
|
@ -51,11 +53,70 @@ namespace SunlightCentralizedControlManagement_SCCM_.WindowsView |
|
|
dat_821.Add("WorkOrder", WorkOrder_); |
|
|
dat_821.Add("WorkOrder", WorkOrder_); |
|
|
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine_ + "'").First(); |
|
|
DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine_ + "'").First(); |
|
|
int index = Convert.ToInt16(drEmployee.Field<object>("ID")); |
|
|
int index = Convert.ToInt16(drEmployee.Field<object>("ID")); |
|
|
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString |
|
|
string dat = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", "ID='" + index + "'") + dat_821.ToJsonString(); |
|
|
|
|
|
|
|
|
|
|
|
lock (MainWindowViewModel.Machines.Rows.SyncRoot) |
|
|
{ |
|
|
{ |
|
|
ID = index, |
|
|
if (drEmployee.Field<bool>("Type")) |
|
|
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", "ID='" + index + "'") + dat_821.ToJsonString() |
|
|
{//网络
|
|
|
}); |
|
|
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString |
|
|
|
|
|
{ |
|
|
|
|
|
ID = index, |
|
|
|
|
|
DAT = dat |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{//串口
|
|
|
|
|
|
if (drEmployee.Field<string>("Serial") == "PORT1") |
|
|
|
|
|
{ |
|
|
|
|
|
bool exists = stringQueueSerial_1.Any(item => item.ID == index && item.DAT == dat); |
|
|
|
|
|
if (!exists) |
|
|
|
|
|
{ |
|
|
|
|
|
stringQueueSerial_1.Enqueue(new QueueSerial |
|
|
|
|
|
{ |
|
|
|
|
|
ID = index, |
|
|
|
|
|
DAT = dat |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else if (drEmployee.Field<string>("Serial") == "PORT2") |
|
|
|
|
|
{ |
|
|
|
|
|
bool exists = stringQueueSerial_2.Any(item => item.ID == index && item.DAT == dat); |
|
|
|
|
|
if (!exists) |
|
|
|
|
|
{ |
|
|
|
|
|
stringQueueSerial_2.Enqueue(new QueueSerial |
|
|
|
|
|
{ |
|
|
|
|
|
ID = index, |
|
|
|
|
|
DAT = dat |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else if (drEmployee.Field<string>("Serial") == "PORT3") |
|
|
|
|
|
{ |
|
|
|
|
|
bool exists = stringQueueSerial_3.Any(item => item.ID == index && item.DAT == dat); |
|
|
|
|
|
if (!exists) |
|
|
|
|
|
{ |
|
|
|
|
|
stringQueueSerial_3.Enqueue(new QueueSerial |
|
|
|
|
|
{ |
|
|
|
|
|
ID = index, |
|
|
|
|
|
DAT = dat |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else if (drEmployee.Field<string>("Serial") == "PORT4") |
|
|
|
|
|
{ |
|
|
|
|
|
bool exists = stringQueueSerial_4.Any(item => item.ID == index && item.DAT == dat); |
|
|
|
|
|
if (!exists) |
|
|
|
|
|
{ |
|
|
|
|
|
stringQueueSerial_4.Enqueue(new QueueSerial |
|
|
|
|
|
{ |
|
|
|
|
|
ID = index, |
|
|
|
|
|
DAT = dat |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.Close(); |
|
|
this.Close(); |
|
|
} |
|
|
} |
|
|