Merge branch 'master' of http://192.168.0.12:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
17a5d6b718
1 file changed
+66
-5
@@ -1,4 +1,5 @@
|
||||
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
||||
using ScottPlot.TickGenerators.TimeUnits;
|
||||
using SunlightCentralizedControlManagement_SCCM_.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -22,6 +23,7 @@ using System.Windows.Threading;
|
||||
using System.Xml.Linq;
|
||||
using TouchSocket.Core;
|
||||
using static SunlightCentralizedControlManagement_SCCM_.UserClass.SqliteHelper;
|
||||
using static SunlightCentralizedControlManagement_SCCM_.ViewModel.MainWindowViewModel;
|
||||
|
||||
namespace SunlightCentralizedControlManagement_SCCM_.WindowsView
|
||||
{
|
||||
@@ -51,11 +53,70 @@ namespace SunlightCentralizedControlManagement_SCCM_.WindowsView
|
||||
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
|
||||
string dat = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", "ID='" + index + "'") + dat_821.ToJsonString();
|
||||
|
||||
lock (MainWindowViewModel.Machines.Rows.SyncRoot)
|
||||
{
|
||||
ID = index,
|
||||
DAT = "SC821" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", "ID='" + index + "'") + dat_821.ToJsonString()
|
||||
});
|
||||
if (drEmployee.Field<bool>("Type"))
|
||||
{//网络
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user