Compare commits
20
Commits
552d45485d
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb2828aab0 | ||
|
|
33b970eff9 | ||
|
|
5caf92be59 | ||
|
|
437b8957ce | ||
|
|
a68fb9ae01 | ||
|
|
68b98ac7e4 | ||
|
|
2329ac9abc | ||
|
|
b062420be1 | ||
|
|
a248c41163 | ||
|
|
2b676adbba | ||
|
|
00a5cd3ec7 | ||
|
|
abfcf6e36a | ||
|
|
1df7212414 | ||
|
|
751a2b092f | ||
|
|
8a5e0ecfd9 | ||
|
|
ebcd5b7182 | ||
|
|
7f905617fa | ||
|
|
54d8cc7266 | ||
|
|
33e83fa5d6 | ||
|
|
927c38853d |
No files matched your search
@@ -60,6 +60,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
portclient.Closed = (client, e) => { return EasyTask.CompletedTask; };//从端口断开连接,当连接不成功时不会触发。
|
portclient.Closed = (client, e) => { return EasyTask.CompletedTask; };//从端口断开连接,当连接不成功时不会触发。
|
||||||
portclient.Received = (client, e) =>
|
portclient.Received = (client, e) =>
|
||||||
{
|
{
|
||||||
|
//接受重置事件状态
|
||||||
_responseEvent.Set();
|
_responseEvent.Set();
|
||||||
string[] sArray = Regex.Split(e.ByteBlock.Span.ToString(Encoding.UTF8),
|
string[] sArray = Regex.Split(e.ByteBlock.Span.ToString(Encoding.UTF8),
|
||||||
@"\n", RegexOptions.IgnoreCase);
|
@"\n", RegexOptions.IgnoreCase);
|
||||||
@@ -71,6 +72,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
string SYSAPI = sArray[i].Substring(0, 5);
|
string SYSAPI = sArray[i].Substring(0, 5);
|
||||||
string Station = ClipBetween(sArray[i], '[', ']');
|
string Station = ClipBetween(sArray[i], '[', ']');
|
||||||
string DAT = sArray[i].Substring(sArray[i].IndexOf("]") + 1);
|
string DAT = sArray[i].Substring(sArray[i].IndexOf("]") + 1);
|
||||||
|
|
||||||
if (SYSAPI == "SC800")
|
if (SYSAPI == "SC800")
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -99,7 +101,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
Dictionary<string, object> _dat;
|
Dictionary<string, object> _dat;
|
||||||
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
||||||
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 111 } },
|
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 111 } },
|
||||||
"WorkOrder ='" + _dat.GetValue("WorkOrder") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
"WorkOrder ='" + _dat.GetValue("Work") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -114,15 +116,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
Dictionary<string, object> _dat;
|
Dictionary<string, object> _dat;
|
||||||
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
||||||
MainWindowViewModel.SQLiteHelpers.Update("WorkorderSteps", new Dictionary<string, object> { { "Mode", 1 } },
|
MainWindowViewModel.SQLiteHelpers.Update("WorkorderSteps", new Dictionary<string, object> { { "Mode", 1 } },
|
||||||
"WorkOrder ='" + _dat.GetValue("Order") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "' AND Step ='" +
|
"WorkOrder ='" + _dat.GetValue("Work") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "' AND Step ='" +
|
||||||
_dat.GetValue("Step") + "'", null);
|
_dat.GetValue("Step") + "'", null);
|
||||||
|
|
||||||
int x = MainWindowViewModel.SQLiteHelpers.ExecuteDataSet("select * from WorkorderSteps where WorkOrder='" +
|
int x = MainWindowViewModel.SQLiteHelpers.ExecuteDataSet("select * from WorkorderSteps where WorkOrder='" +
|
||||||
_dat.GetValue("Order") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "' AND Mode <> '1'", null).Tables[0].Rows.Count;
|
_dat.GetValue("Work") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "' AND Mode <> '1'", null).Tables[0].Rows.Count;
|
||||||
if (x == 0)
|
if (x == 0)
|
||||||
{
|
{
|
||||||
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 113 } },
|
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 113 } },
|
||||||
"WorkOrder ='" + _dat.GetValue("Order") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
"WorkOrder ='" + _dat.GetValue("Work") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
@@ -135,7 +137,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
Dictionary<string, object> _dat;
|
Dictionary<string, object> _dat;
|
||||||
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
||||||
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 101 } },
|
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 101 } },
|
||||||
"WorkOrder ='" + _dat.GetValue("WorkOrder") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
"WorkOrder ='" + _dat.GetValue("Work") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
||||||
}
|
}
|
||||||
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}//回复的工单设置状态后就位101
|
}//回复的工单设置状态后就位101
|
||||||
@@ -161,17 +163,17 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
drEmployee["ERR"] = _new.GetValue("ERR");
|
drEmployee["ERR"] = _new.GetValue("ERR");
|
||||||
drEmployee["LOCK"] = _new.GetValue("LOCK");
|
drEmployee["LOCK"] = _new.GetValue("LOCK");
|
||||||
drEmployee["Message"] = _new.GetValue("Status");
|
drEmployee["Message"] = _new.GetValue("Status");
|
||||||
drEmployee["WorkOrder"] = _new.GetValue("WorkNumder");
|
drEmployee["WorkOrder"] = _new.GetValue("Work");
|
||||||
drEmployee["Temperature"] = _new.GetValue("MTT");
|
drEmployee["Temperature"] = _new.GetValue("MTT");
|
||||||
drEmployee["WaterLevel"] = _new.GetValue("MTL");
|
drEmployee["WaterLevel"] = _new.GetValue("MTL");
|
||||||
drEmployee["Process"] = _new.GetValue("Process");
|
drEmployee["Process"] = _new.GetValue("Process");
|
||||||
drEmployee["Step"] = _new.GetValue("Step");
|
drEmployee["Step"] = _new.GetValue("Step");
|
||||||
drEmployee["UserButton"] = _new.GetValue("UserButton");
|
drEmployee["UserButton"] = _new.GetValue("UserB");
|
||||||
if (_new.GetValue("UserInfoStart").ToString() != "900")
|
if (_new.GetValue("InfoS").ToString() != "900")
|
||||||
{ drEmployee["UserInfoStart"] = _new.GetValue("UserInfoStart"); }
|
{ drEmployee["UserInfoStart"] = _new.GetValue("InfoS"); }
|
||||||
drEmployee["UserInfo"] = _new.GetValue("UserInfo");
|
drEmployee["UserInfo"] = _new.GetValue("Info");
|
||||||
drEmployee["WORK_RUN"] = _new.GetValue("WORK_RUN");
|
drEmployee["WORK_RUN"] = _new.GetValue("RUN");
|
||||||
drEmployee["RUN_STEPID"] = _new.GetValue("RUN_STEPID");
|
drEmployee["RUN_STEPID"] = _new.GetValue("STEPID");
|
||||||
drEmployee["CALL"] = _new.GetValue("CALL");
|
drEmployee["CALL"] = _new.GetValue("CALL");
|
||||||
drEmployee.EndEdit();
|
drEmployee.EndEdit();
|
||||||
drEmployee.AcceptChanges();
|
drEmployee.AcceptChanges();
|
||||||
@@ -180,9 +182,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
if (_new.GetValue("Status").ToString() != "----------")
|
if (_new.GetValue("Status").ToString() != "----------")
|
||||||
{
|
{
|
||||||
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
|
Dictionary<string, object> Chart_new = new Dictionary<string, object>();//缓存函数
|
||||||
Chart_new.Add("WorkOrder", _new.GetValue("WorkNumder"));
|
Chart_new.Add("WorkOrder", _new.GetValue("Work"));
|
||||||
Chart_new.Add("Machine", mac);
|
//Chart_new.Add("Machine", mac);
|
||||||
Chart_new.Add("Time", _new.GetValue("Time"));
|
//Chart_new.Add("Time", _new.GetValue("Time"));
|
||||||
Chart_new.Add("MST", _new.GetValue("MST"));
|
Chart_new.Add("MST", _new.GetValue("MST"));
|
||||||
Chart_new.Add("MTT", _new.GetValue("MTT"));
|
Chart_new.Add("MTT", _new.GetValue("MTT"));
|
||||||
Chart_new.Add("MTL", _new.GetValue("MTL"));
|
Chart_new.Add("MTL", _new.GetValue("MTL"));
|
||||||
@@ -198,7 +200,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
MainWindowViewModel.SQLiteChartAdress.InsertData("Chart", Chart_new);// 执行插入
|
MainWindowViewModel.SQLiteChartAdress.InsertData("Chart", Chart_new);// 执行插入
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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 == "SC831")
|
else if (SYSAPI == "SC831")
|
||||||
@@ -403,8 +407,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
string[] sArray = Regex.Split(e.ByteBlock.Span.ToString(Encoding.UTF8),
|
string[] sArray = Regex.Split(e.ByteBlock.Span.ToString(Encoding.UTF8),
|
||||||
@"\n", RegexOptions.IgnoreCase);
|
@"\n", RegexOptions.IgnoreCase);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return EasyTask.CompletedTask; ;
|
return EasyTask.CompletedTask; ;
|
||||||
};
|
};
|
||||||
await portclient.SetupAsync(new TouchSocketConfig()
|
await portclient.SetupAsync(new TouchSocketConfig()
|
||||||
@@ -416,7 +418,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
PortName = com,//COM
|
PortName = com,//COM
|
||||||
StopBits = System.IO.Ports.StopBits.One,//停止位
|
StopBits = System.IO.Ports.StopBits.One,//停止位
|
||||||
})
|
})
|
||||||
.SetSerialDataHandlingAdapter(() => new PeriodPackageAdapter() { CacheTimeout = TimeSpan.FromMilliseconds(100) })
|
.SetSerialDataHandlingAdapter(() => new PeriodPackageAdapter() { CacheTimeout = TimeSpan.FromMilliseconds(500) })
|
||||||
.ConfigurePlugins(a =>
|
.ConfigurePlugins(a =>
|
||||||
{
|
{
|
||||||
//a.Add<MyPlugin>();
|
//a.Add<MyPlugin>();
|
||||||
@@ -444,9 +446,10 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
var t = CRCcheck16.ToCRC16(command);
|
var t = CRCcheck16.ToCRC16(command);
|
||||||
_responseEvent.Reset();
|
_responseEvent.Reset();
|
||||||
serialPortClients.Send(command); // 发送指令
|
serialPortClients.Send(command); // 发送指令
|
||||||
|
|
||||||
// 等待500毫秒或直到收到响应
|
// 等待500毫秒或直到收到响应
|
||||||
_responseEvent.Wait(TimeSpan.FromMilliseconds(1000));
|
if (!_responseEvent.Wait(TimeSpan.FromMilliseconds(1000)))
|
||||||
// 重置事件状态
|
{
|
||||||
_responseEvent.Set();
|
_responseEvent.Set();
|
||||||
//清楚了解状态
|
//清楚了解状态
|
||||||
string Station = ClipBetween(command, '[', ']');
|
string Station = ClipBetween(command, '[', ']');
|
||||||
@@ -472,7 +475,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
drEmployee.AcceptChanges();
|
drEmployee.AcceptChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,10 +160,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
Dictionary<string, object> _dat;
|
|
||||||
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
|
||||||
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 111 } },
|
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 111 } },
|
||||||
"WorkOrder ='" + _dat.GetValue("WorkOrder") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
"WorkOrder ='" + DAT + "'", null);
|
||||||
|
// Dictionary<string, object> _dat;
|
||||||
|
// _dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
||||||
|
// MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 111 } },
|
||||||
|
// "WorkOrder ='" + _dat.GetValue("WorkOrder") + "' AND ReDye ='" + _dat.GetValue("ReDye") + "'", null);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -175,10 +178,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
|
||||||
Dictionary<string, object> _dat;
|
|
||||||
_dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 111 } },
|
||||||
MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 113 } },
|
"WorkOrder ='" + DAT + "'", null);
|
||||||
"WorkOrder ='" + _dat.GetValue("WorkOrder") + "' AND ReDye ='"+ _dat.GetValue("ReDye") + "'", null);
|
// Dictionary<string, object> _dat;
|
||||||
|
// _dat = SerializeConvert.JsonDeserializeFromString<Dictionary<string, object>>(DAT);
|
||||||
|
// MainWindowViewModel.SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 113 } },
|
||||||
|
// "WorkOrder ='" + _dat.GetValue("WorkOrder") + "' AND ReDye ='"+ _dat.GetValue("ReDye") + "'", null);
|
||||||
}
|
}
|
||||||
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
catch (Exception ex) { LogGing.LogGingDATA("[ERR='" + ex + "']=Exception"); MainWindowViewModel.ERR_c++; }
|
||||||
}
|
}
|
||||||
@@ -331,7 +337,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
MainWindowViewModel.dt_TP = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
MainWindowViewModel.dt_TP = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
||||||
}
|
}
|
||||||
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 == "SC832")
|
else if (SYSAPI == "SC832")
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -403,7 +409,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
|||||||
MachinesView.LOG_dataTable = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
MachinesView.LOG_dataTable = JsonConvert.DeserializeObject<DataTable>(DAT);//反序列化
|
||||||
}
|
}
|
||||||
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 == "SC910")
|
else if (SYSAPI == "SC910")
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
foreach (DataRow dataRow in dataTable.Select("Mode<>'1'"))
|
foreach (DataRow dataRow in dataTable.Select("Mode<>'1'"))
|
||||||
{
|
{
|
||||||
Dictionary<string, object> dat_ = new Dictionary<string, object>();
|
Dictionary<string, object> dat_ = new Dictionary<string, object>();
|
||||||
dat_.Add("Order", dataRow["WorkOrder"].ToString());
|
dat_.Add("Work", dataRow["WorkOrder"].ToString());
|
||||||
dat_.Add("Dye", dataRow["DYELOT"].ToString());
|
dat_.Add("Dye", dataRow["DYELOT"].ToString());
|
||||||
dat_.Add("Time", dataRow["StepTime"].ToString());
|
dat_.Add("Time", dataRow["StepTime"].ToString());
|
||||||
dat_.Add("ReDye", dataRow["ReDye"].ToString());
|
dat_.Add("ReDye", dataRow["ReDye"].ToString());
|
||||||
@@ -314,7 +314,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
ID = index,
|
ID = index,
|
||||||
DAT = "SC811[" + Selet_Machines(Machines, "Station", "ID='" + index + "'") + "]" + dat_.ToJsonString()
|
DAT = "SC811[" + Selet_Machines(Machines, "Station", "ID='" + index + "'") + "]" + dat_.ToJsonString()
|
||||||
});
|
});
|
||||||
} }
|
}
|
||||||
|
}
|
||||||
else if (Selet_Machines(Machines, "Serial", "Name='" + WorkOrderdata_m + "'").ToString() == "PORT3")
|
else if (Selet_Machines(Machines, "Serial", "Name='" + WorkOrderdata_m + "'").ToString() == "PORT3")
|
||||||
{ // 检查队列中是否已存在相同项
|
{ // 检查队列中是否已存在相同项
|
||||||
bool exists = stringQueueSerial_3.Any(item => item.ID == index && item.DAT == dat);
|
bool exists = stringQueueSerial_3.Any(item => item.ID == index && item.DAT == dat);
|
||||||
@@ -337,13 +338,17 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
ID = index,
|
ID = index,
|
||||||
DAT = "SC811[" + Selet_Machines(Machines, "Station", "ID='" + index + "'") + "]" + dat_.ToJsonString()
|
DAT = "SC811[" + Selet_Machines(Machines, "Station", "ID='" + index + "'") + "]" + dat_.ToJsonString()
|
||||||
});
|
});
|
||||||
} }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (WorkOrderstepdata.Select()[k].Field<object>("State").ToString() == "111")
|
||||||
|
{
|
||||||
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 112 } },
|
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 112 } },
|
||||||
"WorkOrder ='" + WorkOrderstepdata.Select()[k].Field<object>("WorkOrder").ToString() + "'", null);
|
"WorkOrder ='" + WorkOrderstepdata.Select()[k].Field<object>("WorkOrder").ToString() + "'", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/*下传工单总览*/
|
/*下传工单总览*/
|
||||||
DataTable WorkOrderdata = SQLiteHelpers.ExecuteDataSet("select * from WorkOrder where (State='100' OR State='110') AND StartTime >'" +
|
DataTable WorkOrderdata = SQLiteHelpers.ExecuteDataSet("select * from WorkOrder where (State='100' OR State='110') AND StartTime >'" +
|
||||||
DateTime.Now.AddHours(-8).ToString("yyyy/MM/dd HH:mm:ss") + "'", null).Tables[0]; //读取表写入缓存
|
DateTime.Now.AddHours(-8).ToString("yyyy/MM/dd HH:mm:ss") + "'", null).Tables[0]; //读取表写入缓存
|
||||||
@@ -391,9 +396,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
dt_temp.EndEdit();
|
dt_temp.EndEdit();
|
||||||
dataTable.Rows.Add(dt_temp.ItemArray);
|
dataTable.Rows.Add(dt_temp.ItemArray);
|
||||||
|
|
||||||
|
Dictionary<string, object> dat_ = new Dictionary<string, object>();
|
||||||
|
dat_.Add("Work", dt_temp["WorkOrder"].ToString());
|
||||||
|
dat_.Add("Dye", dt_temp["DYELOT"].ToString());
|
||||||
|
dat_.Add("STime", dt_temp["StartTime"].ToString());
|
||||||
|
dat_.Add("Time", dt_temp["Time"].ToString());
|
||||||
|
dat_.Add("ReDye", 0);
|
||||||
|
|
||||||
int index = Convert.ToInt16(Selet_Machines(Machines, "ID", "Name='" + WorkOrderdata_m + "'").ToString());
|
int index = Convert.ToInt16(Selet_Machines(Machines, "ID", "Name='" + WorkOrderdata_m + "'").ToString());
|
||||||
string dat = "SC810[" + Selet_Machines(Machines, "Station", "ID='" + index + "'") + "]" +
|
string dat = "SC810[" + Selet_Machines(Machines, "Station", "ID='" + index + "'") + "]" + dat_.ToJsonString();
|
||||||
DataTableToDictionary(dataTable).ToJsonString();
|
|
||||||
if (Selet_Machines(Machines, "Serial", "Name='" + WorkOrderdata_m + "'").ToString() == "PORT1")
|
if (Selet_Machines(Machines, "Serial", "Name='" + WorkOrderdata_m + "'").ToString() == "PORT1")
|
||||||
{ // 检查队列中是否已存在相同项
|
{ // 检查队列中是否已存在相同项
|
||||||
bool exists = stringQueueSerial_1.Any(item => item.ID == index && item.DAT == dat);
|
bool exists = stringQueueSerial_1.Any(item => item.ID == index && item.DAT == dat);
|
||||||
@@ -444,10 +455,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (WorkOrderdata.Select()[k].Field<object>("State").ToString() == "110")
|
||||||
|
{
|
||||||
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 110 } },
|
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 110 } },
|
||||||
"WorkOrder ='" + WorkOrderdata.Select()[k].Field<object>("WorkOrder").ToString() + "'", null);
|
"WorkOrder ='" + WorkOrderdata.Select()[k].Field<object>("WorkOrder").ToString() + "'", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/*下传工单设置*/
|
/*下传工单设置*/
|
||||||
DataTable WorkOrderset_ = SQLiteHelpers.ExecuteDataSet("select * from WorkOrder where (State='113' OR State='114') AND StartTime >'" +
|
DataTable WorkOrderset_ = SQLiteHelpers.ExecuteDataSet("select * from WorkOrder where (State='113' OR State='114') AND StartTime >'" +
|
||||||
DateTime.Now.AddHours(-8).ToString("yyyy/MM/dd HH:mm:ss") + "'", null).Tables[0]; //读取表写入缓存
|
DateTime.Now.AddHours(-8).ToString("yyyy/MM/dd HH:mm:ss") + "'", null).Tables[0]; //读取表写入缓存
|
||||||
@@ -536,10 +550,13 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (WorkOrderset_.Select()[k].Field<object>("State").ToString() == "113")
|
||||||
|
{
|
||||||
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 114 } },
|
SQLiteHelpers.Update("WorkOrder", new Dictionary<string, object> { { "State", 114 } },
|
||||||
"WorkOrder ='" + WorkOrderset_.Select()[k].Field<object>("WorkOrder").ToString() + "'", null);
|
"WorkOrder ='" + WorkOrderset_.Select()[k].Field<object>("WorkOrder").ToString() + "'", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//系统时间
|
//系统时间
|
||||||
Sys_Time = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
|
Sys_Time = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
|
||||||
@@ -633,6 +650,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Updata_Machines(Machines, "State", "ID='" + MachinesRow["ID"] + "'", "101");
|
||||||
}
|
}
|
||||||
else if (MachinesRow["Serial"].ToString() == "PORT2")
|
else if (MachinesRow["Serial"].ToString() == "PORT2")
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user