添加机台故障信息状态
This commit is contained in:
commit
7d7ed08f96
4 files changed
+33
-5
No files matched your search
@@ -22,9 +22,9 @@ namespace SunlightCentralizedControlManagement_SCCM_.ConvertMoels
|
||||
string i = value.ToString();
|
||||
|
||||
if (i == "201") return "#FF00FF00";
|
||||
else if (i == "202") return "#FFFFFF00";
|
||||
else if (i == "309") return "#FFFFFFFF";
|
||||
else if (i == "800") return "#FFFF0000";
|
||||
else if (i == "202") return "Green";
|
||||
else if (i == "309") return "#FF000000";
|
||||
else if (i == "800") return "Red";
|
||||
else return "#FF000000";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
drEmployee["Step"] = "";
|
||||
drEmployee["Message"] = "";
|
||||
drEmployee["SYSKEY"] = "";
|
||||
drEmployee["WORK_RUN"] = "-1";
|
||||
drEmployee.EndEdit();
|
||||
drEmployee.AcceptChanges();
|
||||
LogGing.LogGingDATA("[IP='" + client.IP + "' AND port='" + client.Port + "']=Link_STOP");
|
||||
@@ -100,6 +101,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
drEmployee["Step"] = "";
|
||||
drEmployee["Message"] = "";
|
||||
drEmployee["SYSKEY"] = "";
|
||||
drEmployee["WORK_RUN"] = "-1";
|
||||
drEmployee.EndEdit();
|
||||
drEmployee.AcceptChanges();
|
||||
LogGing.LogGingDATA("[IP='" + client.IP + "' AND port='" + client.Port + "']=Link_INTERRUPT");
|
||||
@@ -175,6 +177,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||
_new = JsonConvert.DeserializeObject<Dictionary<string, object>>(DAT);//反序列化
|
||||
DataRow drEmployee = MainWindowViewModel.Machines.Select("IP='" + client.IP + "'").First();
|
||||
drEmployee.BeginEdit();
|
||||
drEmployee["ERR"] = _new.GetValue("ERR");
|
||||
drEmployee["LOCK"] = _new.GetValue("LOCK");
|
||||
drEmployee["Message"] = _new.GetValue("Status");
|
||||
drEmployee["WorkOrder"] = _new.GetValue("WorkNumder");
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="False"/>
|
||||
<DataTrigger Binding="{Binding State}" Value="309">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding State}" Value="308">
|
||||
<Setter Property="Background" Value="Yellow"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
@@ -103,7 +106,7 @@
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.WorkOrder}" Binding="{Binding WorkOrder}" Width="200" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Dyelot}" Binding="{Binding Dyelot}" Width="200" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Dyelot}" Binding="{Binding Dyelot}" Width="0" MaxWidth="0" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Temperature}" Binding="{Binding Temperature}" Width="100" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.WaterLevel}" Binding="{Binding WaterLevel}" Width="100" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.process}" Binding="{Binding Process}" Width="300" IsReadOnly="True"/>
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
@@ -259,6 +260,25 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
}
|
||||
for (int i = 0; i < Machinesdata_Count; i++)
|
||||
{
|
||||
int m_run = (int)Selet_Machines(Machines, "WORK_RUN", "ID='" + i + "'");
|
||||
if (m_run==0)
|
||||
{
|
||||
Updata_Machines(Machines, "State", "ID='" + i + "'", "101");//停止状态
|
||||
}
|
||||
else if (m_run==1)
|
||||
{
|
||||
Updata_Machines(Machines, "State", "ID='" + i + "'", "101");//暂停状态
|
||||
}
|
||||
else if (m_run==2)
|
||||
{
|
||||
Updata_Machines(Machines, "State", "ID='" + i + "'", "202");//运行
|
||||
}
|
||||
|
||||
if ((bool)Selet_Machines(Machines, "ERR", "ID='" + i + "'"))
|
||||
{
|
||||
Updata_Machines(Machines, "State", "ID='" + i + "'", "309");//错误
|
||||
}
|
||||
|
||||
string mac_s = Selet_Machines(Machines, "State", "ID='" + i + "'").ToString();
|
||||
if ((mac_s == "101") || (mac_s == "201") || (mac_s == "202") || (mac_s == "301") || (mac_s == "309"))//获取信息
|
||||
{
|
||||
@@ -329,12 +349,14 @@ namespace SunlightCentralizedControlManagement_SCCM_.ViewModel
|
||||
Updata_Machines(Machines, "State", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "800");
|
||||
Updata_Machines(Machines, "Temperature", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "0.0");
|
||||
Updata_Machines(Machines, "WaterLevel", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "0");
|
||||
Updata_Machines(Machines, "WORK_RUN", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "-1");
|
||||
Updata_Machines(Machines, "ERR", "ID='" + Convert.ToInt16(dt["ID"]) + "'", "False");
|
||||
_ = AsyncTcpClient.TcpClient(MachiensTcpClient[i] //建立tcp连接
|
||||
, Selet_Machines(Machines, "IP", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString()
|
||||
, Selet_Machines(Machines, "PORT", "ID='" + Convert.ToInt16(dt["ID"]) + "'").ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static string SYS_WorkNumder; //工单号
|
||||
public static int SYS_AT1; //附缸1-3
|
||||
public static int SYS_AT2;
|
||||
|
||||
Reference in new issue
Block a user