diff --git a/shangjian/XGL.Data/DBService/DBService.cs b/shangjian/XGL.Data/DBService/DBService.cs
index ac0b13e..508214d 100644
--- a/shangjian/XGL.Data/DBService/DBService.cs
+++ b/shangjian/XGL.Data/DBService/DBService.cs
@@ -11,6 +11,7 @@ using System.Data.SqlClient;
using MySql.Data.MySqlClient;
using CommonFunc.Tools;
+using XGL.Models.Model;
namespace CentralControl.DBDAO
{
@@ -770,7 +771,42 @@ where route.route_code = '{processid}'"; //where CONVERT(VARCHAR(10), wet.plan_
}
return null;
}
-
+
+ ///
+ /// 查询烘房状态
+ ///
+ ///
+ public List GetHFStatusInfo()
+ {
+ string sql = $@"SELECT * FROM [dbo].[base_equipment_attached] WHERE (property='dollyNumber' OR property='state') AND device_code LIKE '%H%' ORDER BY device_code";
+ DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
+
+ if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
+ {
+ List result = new List();
+
+ foreach (DataRow row in dtset.Tables[0].Rows)
+ {
+ BaseEquipmentAttached model = new BaseEquipmentAttached
+ {
+ id = row["id"].ToString(),
+ device_type = row["device_type"].ToString(),
+ device_code = row["device_code"].ToString(),
+ property = row["property"].ToString(),
+ explain = row["explain"].ToString(),
+ isvalue = row["isvalue"].ToString(),
+ last_update_time = row["last_update_time"].ToString()
+ };
+
+ result.Add(model);
+ }
+
+ return result;
+ }
+
+ return null;
+ }
+
///
/// 查询物料信息
@@ -854,11 +890,42 @@ where workorder.workorder_id = '{workOrderNo}'";
/// 获取日志
///
///
- public DataTable GetLogList(string datetime,string key)
+ public DataTable GetLogList(string datetime,string key,string selectin)
+ {
+ if (selectin!="")
+ {
+ //根据工单获取成型机
+ string sql = $@"SELECT Top 2000 * FROM [dbo].[mes_interface_log] where CONVERT(VARCHAR(10), creter_time , 120)= CONVERT(VARCHAR(10), '{datetime}' , 120) and remark like '%{selectin}%' order by creter_time desc ; ";
+
+ DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
+ if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
+ {
+ return dtset.Tables[0];
+ }
+ }
+ else
+ {
+ //根据工单获取成型机
+ string sql = $@"SELECT Top 2000 * FROM [dbo].[mes_interface_log] where CONVERT(VARCHAR(10), creter_time , 120)= CONVERT(VARCHAR(10), '{datetime}' , 120) and remark like '%{key}%' order by creter_time desc ; ";
+
+ DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
+ if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
+ {
+ return dtset.Tables[0];
+ }
+ }
+
+ return null;
+ }
+ ///
+ /// 获取类型
+ ///
+ ///
+ public DataTable GettypeList()
{
//根据工单获取成型机
- string sql = $@"SELECT * FROM [dbo].[mes_interface_log] where CONVERT(VARCHAR(10), creter_time , 120)= CONVERT(VARCHAR(10), '{datetime}' , 120) and remark like '%{key}%' order by creter_time desc ; ";
-
+ string sql = $@" SELECT DISTINCT remark FROM[dbo].[mes_interface_log] ";
+
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
@@ -866,6 +933,8 @@ where workorder.workorder_id = '{workOrderNo}'";
}
return null;
}
+
+
public DataTable GetPlcValueList(string key,string deviceCode)
{
//根据工单获取成型机
diff --git a/shangjian/XGL.Data/DBService/FormingMachineService.cs b/shangjian/XGL.Data/DBService/FormingMachineService.cs
index a201b76..8d1d053 100644
--- a/shangjian/XGL.Data/DBService/FormingMachineService.cs
+++ b/shangjian/XGL.Data/DBService/FormingMachineService.cs
@@ -162,7 +162,7 @@ FROM [dbo].[mes_material_transfer_result] res
LEFT JOIN pro_order_workorder ord on res.OrderCode = ord.workorder_id
left JOIN pro_wet_material_plan_detail wet on wet.workorder_id = ord.workorder_id
LEFT JOIN pro_rfid_process_detail rfid on rfid.workorder_code = ord.workorder_code and rfid.rfid = res.rfid
-where equipmentCode = '{devicecode}' and work_date = '{workDate}' and ord.workorder_code = '{workOrderCode}' and res.OrderCode is not null ORDER BY plan_time desc; ";
+where equipmentCode = '{devicecode}' and work_date = '{workDate}' and ord.workorder_code = '{workOrderCode}' and res.OrderCode is not null ORDER BY update_time desc; ";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
diff --git a/shangjian/XGL.Model/Model/BaseEquipmentAttached.cs b/shangjian/XGL.Model/Model/BaseEquipmentAttached.cs
new file mode 100644
index 0000000..aa12d7c
--- /dev/null
+++ b/shangjian/XGL.Model/Model/BaseEquipmentAttached.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XGL.Models.Model
+{
+ public class BaseEquipmentAttached
+ {
+ public string id { get; set; }
+ public string device_type { get; set; }
+ public string device_code { get; set; }
+ public string property { get; set; }
+ public string explain { get; set; }
+ public string isvalue { get; set; }
+ public string last_update_time { get; set; }
+ }
+}
diff --git a/shangjian/XGL/FormItem/Main.xaml.cs b/shangjian/XGL/FormItem/Main.xaml.cs
index 4785456..9f85c4c 100644
--- a/shangjian/XGL/FormItem/Main.xaml.cs
+++ b/shangjian/XGL/FormItem/Main.xaml.cs
@@ -126,6 +126,16 @@ namespace XGL.FormItem
{
if (MessageBox.Show("是否确认关闭程序", "提示信息", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes)
{
+ try
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOff();
+ serialHelper.buzzerOff();
+ serialHelper.ComOff();
+ }
+ catch (Exception ex)
+ {
+ }
System.Environment.Exit(System.Environment.ExitCode);
}
}
diff --git a/shangjian/XGL/HFstatus.xaml b/shangjian/XGL/HFstatus.xaml
new file mode 100644
index 0000000..cd723e1
--- /dev/null
+++ b/shangjian/XGL/HFstatus.xaml
@@ -0,0 +1,1160 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/shangjian/XGL/HFstatus.xaml.cs b/shangjian/XGL/HFstatus.xaml.cs
new file mode 100644
index 0000000..6976e0b
--- /dev/null
+++ b/shangjian/XGL/HFstatus.xaml.cs
@@ -0,0 +1,1428 @@
+using CentralControl.DBDAO;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using XGL.Models.Model;
+using System.Windows.Threading;
+using XGL.Tools;
+
+namespace XGL
+{
+ ///
+ /// Window1.xaml 的交互逻辑
+ ///
+ public partial class HFstatus : Window
+ {
+ private DispatcherTimer timer;
+ public static int menqian = 20000;
+ public static int shifouchaxun18 = 1;
+ public static int shifouchaxun17 = 1;
+ public static int shifouchaxun16 = 1;
+ public static int shifouchaxun15 = 1;
+ public static int shifouchaxun14 = 1;
+ public static int shifouchaxun13 = 1;
+ public static int shifouchaxun12 = 1;
+ public static int shifouchaxun11 = 1;
+ public static int shifouchaxun10 = 1;
+ SerialHelper serialHelper = new SerialHelper();
+ public HFstatus()
+ {
+ InitializeComponent();
+ // 创建并配置定时器
+ fenzhong.Text = menqian.ToString();
+ timer = new DispatcherTimer();
+ timer.Interval = TimeSpan.FromSeconds(3); // 设置定时器间隔(3秒)
+ timer.Tick += new EventHandler(selectHFvalue); // 每次定时器触发时执行 UpdateUI 方法
+ timer.Start(); // 启动定时器
+ }
+ DBService userDbWareHouse = new DBService();
+
+
+ public void selectHFvalue(object sender, EventArgs e)
+ {
+ var dt= userDbWareHouse.GetHFStatusInfo();
+ foreach (var item in dt)
+ {
+ if (item.device_code=="H18")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian18.Text = "有车";
+ menqian18.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian18.Text = "无";
+ menqian18.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi18.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze18.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房18门前小车数量值保持超过"+ menqian + "分钟请查看!!!");
+ bianhao18.Background= new SolidColorBrush(Colors.Wheat);
+ }
+ }
+ else
+ {
+ bianhao18.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai18.Text = "自动";
+ zhuangtai18.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai18.Foreground = new SolidColorBrush(Colors.Red);
+ zhuangtai18.Text = "手动或异常";
+ }
+
+ }
+
+ }else if (item.device_code == "H17")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian17.Text = "有车";
+ menqian17.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian17.Text = "无";
+ menqian17.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi17.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze17.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房17门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao17.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao17.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai17.Text = "自动";
+ zhuangtai17.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai17.Text = "手动或异常";
+ zhuangtai17.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+
+
+ }
+ else if (item.device_code == "H16")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian16.Text = "有车";
+ menqian16.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian16.Text = "无";
+ menqian16.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi16.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze16.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房16门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao16.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao16.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai16.Text = "自动";
+ zhuangtai16.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai16.Text = "手动或异常";
+ zhuangtai16.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+
+ }
+ else if (item.device_code == "H15")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian15.Text = "有车";
+ menqian15.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian15.Text = "无";
+ menqian15.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi15.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze15.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房15门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao15.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao15.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai15.Text = "自动";
+ zhuangtai15.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai15.Text = "手动或异常";
+ zhuangtai15.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H14")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian14.Text = "有车";
+ menqian14.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian14.Text = "无";
+ menqian14.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi14.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze14.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房14门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao14.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao14.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai14.Text = "自动";
+ zhuangtai14.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai14.Text = "手动或异常";
+ zhuangtai14.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+
+ }
+ else if (item.device_code == "H13")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian13.Text = "有车";
+ menqian13.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian13.Text = "无";
+ menqian13.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi13.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze13.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房13门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao13.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao13.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai13.Text = "自动";
+ zhuangtai13.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai13.Text = "手动或异常";
+ zhuangtai13.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+
+ }
+ else if (item.device_code == "H12")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian12.Text = "有车";
+ menqian12.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian12.Text = "无";
+ menqian12.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi12.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze12.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房12门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao12.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao12.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai12.Text = "自动";
+ zhuangtai12.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai12.Text = "手动或异常";
+ zhuangtai12.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H11")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian11.Text = "有车";
+ menqian11.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian11.Text = "无";
+ menqian11.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi11.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze11.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房11门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao11.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao11.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai11.Text = "自动";
+ zhuangtai11.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai11.Text = "手动或异常";
+ zhuangtai11.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H10")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian10.Text = "有车";
+ menqian10.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian10.Text = "无";
+ menqian10.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi10.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze10.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房10门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao10.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao10.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai10.Text = "自动";
+ zhuangtai10.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai10.Text = "手动或异常";
+ zhuangtai10.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H61")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian61.Text = "有车";
+ menqian61.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian61.Text = "无";
+ menqian61.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi61.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze61.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房61门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao61.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao61.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai61.Text = "自动";
+ zhuangtai61.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai61.Text = "手动或异常";
+ zhuangtai61.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H62")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian62.Text = "有车";
+ menqian62.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian62.Text = "无";
+ menqian62.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi62.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze62.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房62门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao62.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao62.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai62.Text = "自动";
+ zhuangtai62.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai62.Text = "手动或异常";
+ zhuangtai62.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H63")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian63.Text = "有车";
+ menqian63.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian63.Text = "无";
+ menqian63.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi63.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze63.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房63门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao63.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao63.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai63.Text = "自动";
+ zhuangtai63.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai63.Text = "手动或异常";
+ zhuangtai63.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H9")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian9.Text = "有车";
+ menqian9.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian9.Text = "无";
+ menqian9.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi9.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze9.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房9门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao9.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao10.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai9.Text = "自动";
+ zhuangtai9.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai9.Text = "手动或异常";
+ zhuangtai9.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H8")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian8.Text = "有车";
+ menqian8.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian8.Text = "无";
+ menqian8.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi8.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze8.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房8门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao8.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao8.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai8.Text = "自动";
+ zhuangtai8.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai8.Text = "手动或异常";
+ zhuangtai8.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H7")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian7.Text = "有车";
+ menqian7.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian7.Text = "无";
+ menqian7.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi7.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze7.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房7门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao7.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao7.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai7.Text = "自动";
+ zhuangtai7.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai7.Text = "手动或异常";
+ zhuangtai7.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H6")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian6.Text = "有车";
+ menqian6.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian6.Text = "无";
+ menqian6.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi6.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze6.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房6门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao6.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao6.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai6.Text = "自动";
+ zhuangtai6.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai6.Text = "手动或异常";
+ zhuangtai6.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H5")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian5.Text = "有车";
+ menqian5.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian5.Text = "无";
+ menqian5.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi5.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze5.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房5门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao5.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao5.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai5.Text = "自动";
+ zhuangtai5.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai5.Text = "手动或异常";
+ zhuangtai5.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H4")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian4.Text = "有车";
+ menqian4.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian4.Text = "无";
+ menqian4.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi4.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze4.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房4门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao4.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao4.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai4.Text = "自动";
+ zhuangtai4.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai4.Text = "手动或异常";
+ zhuangtai4.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H3")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian3.Text = "有车";
+ menqian3.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian3.Text = "无";
+ menqian3.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi3.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze3.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房3门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao3.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao3.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai3.Text = "自动";
+ zhuangtai3.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai3.Text = "手动或异常";
+ zhuangtai3.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H2")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian2.Text = "有车";
+ menqian2.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian2.Text = "无";
+ menqian2.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi2.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze2.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房2门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao2.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao2.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai2.Text = "自动";
+ zhuangtai2.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai2.Text = "手动或异常";
+ zhuangtai2.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ else if (item.device_code == "H1")
+ {
+
+ if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() == "1")
+ {
+ menqian1.Text = "有车";
+ menqian1.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian1.Text = "无";
+ menqian1.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
+
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
+
+ daojishi1.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
+ if (xuanze1.IsChecked == true)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOn();
+ serialHelper.buzzerOn();
+ serialHelper.ComOff();
+ MessageBox.Show("烘房1门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao1.Background = new SolidColorBrush(Colors.Wheat);
+
+ }
+ }
+ else
+ {
+ bianhao1.Background = new SolidColorBrush(Colors.White);
+ }
+ }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai1.Text = "自动";
+ zhuangtai1.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ else
+ {
+ zhuangtai1.Text = "手动或异常";
+ zhuangtai1.Foreground = new SolidColorBrush(Colors.Red);
+ }
+
+ }
+ }
+ }
+ }
+
+ private void sos_Click(object sender, RoutedEventArgs e)
+ {
+ menqian =Convert.ToInt32(fenzhong.Text);
+ MessageBox.Show("设置成功!当前分钟数为"+ menqian);
+ }
+
+ private void cloce_Click(object sender, RoutedEventArgs e)
+ {
+ serialHelper.ComOn();
+ serialHelper.redLightOff();
+ serialHelper.buzzerOff();
+ serialHelper.ComOff();
+ }
+
+ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+ {
+ timer.Stop();
+ }
+ }
+}
diff --git a/shangjian/XGL/Resources/hongfang.png b/shangjian/XGL/Resources/hongfang.png
new file mode 100644
index 0000000..703f016
Binary files /dev/null and b/shangjian/XGL/Resources/hongfang.png differ
diff --git a/shangjian/XGL/Views/LanJu_InOut.xaml.cs b/shangjian/XGL/Views/LanJu_InOut.xaml.cs
index 0bd225b..f69d8df 100644
--- a/shangjian/XGL/Views/LanJu_InOut.xaml.cs
+++ b/shangjian/XGL/Views/LanJu_InOut.xaml.cs
@@ -27,8 +27,8 @@ namespace XGL.Views
{
FormingMachineService formingMachineService = new FormingMachineService();
- string _workOrderCode = "";
- string _deviceCode = "";
+ static string _workOrderCode = "";
+ static string _deviceCode = "";
public LanJu_InOut()
{
diff --git a/shangjian/XGL/Views/LanJu_Operator.xaml.cs b/shangjian/XGL/Views/LanJu_Operator.xaml.cs
index 6d93b41..95284bc 100644
--- a/shangjian/XGL/Views/LanJu_Operator.xaml.cs
+++ b/shangjian/XGL/Views/LanJu_Operator.xaml.cs
@@ -470,8 +470,10 @@ namespace XGL.Views
private void HFPlcvalue_Click(object sender, RoutedEventArgs e)
{
- HBLogWin HFPlcWin = new HBLogWin();
- HFPlcWin.ShowDialog();
+ //HBLogWin HFPlcWin = new HBLogWin();
+ //HFPlcWin.ShowDialog();
+ HFstatus hFstatus = new HFstatus();
+ hFstatus.ShowDialog();
}
}
}
diff --git a/shangjian/XGL/Views/LanJu_Prepare.xaml b/shangjian/XGL/Views/LanJu_Prepare.xaml
index 0a5992b..b64bc60 100644
--- a/shangjian/XGL/Views/LanJu_Prepare.xaml
+++ b/shangjian/XGL/Views/LanJu_Prepare.xaml
@@ -353,6 +353,26 @@
Width="*"
Binding="{Binding BatchCode}"
Header="生产批次" />-->
+
+
+
+
+
-
+
-
-
+
+
-
+
-
+
wetList = new List();
-
+
//modelWareHouse = new List();
//userDbWareHouse = new DBService();
- string date = this.dateStart.SelectedDate.ToString() == "" ? DateTime.Now.ToString() : this.dateStart.SelectedDate.ToString();
+ string date;
+
+ if (this.dateStart.SelectedDate == null || !DateTime.TryParse(this.dateStart.SelectedDate.ToString(), out DateTime selectedDate))
+ {
+ // 如果日期无效或未选择日期,则使用当前日期时间
+ date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+ }
+ else
+ {
+ // 使用已选择的日期,并确保月份和日期部分为两位
+ date = selectedDate.ToString("yyyy-MM-dd HH:mm:ss");
+ }
+
+ //string date = this.dateStart.SelectedDate.ToString() == "" ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : this.dateStart.SelectedDate.ToString();
dt = userDbWareHouse.GetWetPlanInfo(date);
eqment = userDbWareHouse.GeteqmentInfo();
if (dt == null)
diff --git a/shangjian/XGL/Views/ViewLogWin.xaml b/shangjian/XGL/Views/ViewLogWin.xaml
index 485f4cd..51b84c0 100644
--- a/shangjian/XGL/Views/ViewLogWin.xaml
+++ b/shangjian/XGL/Views/ViewLogWin.xaml
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:XGL.Views" xmlns:localDate="clr-namespace:XGL.Tools"
mc:Ignorable="d"
- Title="ViewLogWin" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" WindowStyle="None" WindowState="Maximized">
+ Title="ViewLogWin" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" WindowStyle="None" WindowState="Maximized" Width="1920" Height="1080">
@@ -79,17 +79,20 @@
Width="150" SelectedDateFormat="Short" IsTodayHighlighted="True">
-
-
+
+
-
+
+
+
+
strings = new List();
+ foreach (DataRow row in dt.Rows)
+ {
+ string rolis = row["remark"].ToString();
+ strings.Add(rolis);
+ }
+ selebeizhu.ItemsSource = strings;
+
}
private void dgLogInfo_LoadingRow(object sender, DataGridRowEventArgs e)
@@ -46,10 +59,21 @@ namespace XGL.Views
private void GetLogList()
{
string date = dateStart.SelectedDate.ToString();
- DataTable dt = userDbWareHouse.GetLogList(date,this.txtKey.Text);
- if (dt == null) return;
- this.dgLogInfo.ItemsSource = null;
- this.dgLogInfo.ItemsSource = dt.DefaultView;
+ if (selebeizhu.SelectedItem!=null)
+ {
+ DataTable dt = userDbWareHouse.GetLogList(date, this.txtKey.Text, selebeizhu.SelectedItem.ToString());
+ if (dt == null) return;
+ this.dgLogInfo.ItemsSource = null;
+ this.dgLogInfo.ItemsSource = dt.DefaultView;
+ }
+ else
+ {
+ DataTable dt = userDbWareHouse.GetLogList(date, this.txtKey.Text,"");
+ if (dt == null) return;
+ this.dgLogInfo.ItemsSource = null;
+ this.dgLogInfo.ItemsSource = dt.DefaultView;
+ }
+
}
private void btnClose_Click(object sender, RoutedEventArgs e)
diff --git a/shangjian/XGL/XGL.csproj b/shangjian/XGL/XGL.csproj
index f8bdfa6..3dca9d8 100644
--- a/shangjian/XGL/XGL.csproj
+++ b/shangjian/XGL/XGL.csproj
@@ -398,6 +398,9 @@
True
Reference.map
+
+ HFstatus.xaml
+
MSBuild:Compile
Designer
@@ -649,6 +652,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
@@ -1055,6 +1062,9 @@
Always
+
+ PreserveNewest
+
PreserveNewest
diff --git a/shangjian/XGL/obj/x86/Debug/XGL_Content.g.cs b/shangjian/XGL/obj/x86/Debug/XGL_Content.g.cs
index 3e4f5bd..1c0a8f8 100644
--- a/shangjian/XGL/obj/x86/Debug/XGL_Content.g.cs
+++ b/shangjian/XGL/obj/x86/Debug/XGL_Content.g.cs
@@ -10,6 +10,7 @@
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("newmessage.wav")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("libmupdf.dll")]
+[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("resources/hongfang.png")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("resources/nitsos.png")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("snap7.dll")]
diff --git a/shangjian/XGL/obj/x86/Debug/XGL_Content.g.i.cs b/shangjian/XGL/obj/x86/Debug/XGL_Content.g.i.cs
index 3e4f5bd..1c0a8f8 100644
--- a/shangjian/XGL/obj/x86/Debug/XGL_Content.g.i.cs
+++ b/shangjian/XGL/obj/x86/Debug/XGL_Content.g.i.cs
@@ -10,6 +10,7 @@
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("newmessage.wav")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("libmupdf.dll")]
+[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("resources/hongfang.png")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("resources/nitsos.png")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("snap7.dll")]