diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs
index 1f42857..22cd608 100644
--- a/Properties/Resources.Designer.cs
+++ b/Properties/Resources.Designer.cs
@@ -1131,6 +1131,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
+ ///
+ /// 查找类似 Log 的本地化字符串。
+ ///
+ public static string log {
+ get {
+ return ResourceManager.GetString("log", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Low-water level 的本地化字符串。
///
diff --git a/Properties/Resources.en-US.resx b/Properties/Resources.en-US.resx
index c65153a..d6f5e86 100644
--- a/Properties/Resources.en-US.resx
+++ b/Properties/Resources.en-US.resx
@@ -948,4 +948,7 @@
Editing non-pending work order is prohibited
+
+ Log
+
\ No newline at end of file
diff --git a/Properties/Resources.resx b/Properties/Resources.resx
index c3f4c29..ccdb27d 100644
--- a/Properties/Resources.resx
+++ b/Properties/Resources.resx
@@ -948,4 +948,7 @@
Editing non-pending work order is prohibited
+
+ Log
+
\ No newline at end of file
diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx
index 2356fbf..28c9069 100644
--- a/Properties/Resources.zh-CN.resx
+++ b/Properties/Resources.zh-CN.resx
@@ -948,4 +948,7 @@
禁止编辑非等待中的工单
+
+ 日志
+
\ No newline at end of file
diff --git a/Properties/Resources.zh-TW.resx b/Properties/Resources.zh-TW.resx
index 5aec2c6..d1e0b2d 100644
--- a/Properties/Resources.zh-TW.resx
+++ b/Properties/Resources.zh-TW.resx
@@ -942,4 +942,13 @@
頁面不存在
+
+ 禁止編輯非待處理工單!
+
+
+ 禁止編輯歷史工單!
+
+
+ 日誌
+
\ No newline at end of file
diff --git a/SunlightCentralizedControlManagement_SCCM_.csproj b/SunlightCentralizedControlManagement_SCCM_.csproj
index 50e4163..b2fcb26 100644
--- a/SunlightCentralizedControlManagement_SCCM_.csproj
+++ b/SunlightCentralizedControlManagement_SCCM_.csproj
@@ -127,6 +127,9 @@
CurveDiagram.xaml
+
+ LogView.xaml
+
MachinesView.xaml
@@ -203,6 +206,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
diff --git a/UserClass/AsyncTcpClient.cs b/UserClass/AsyncTcpClient.cs
index c1c2a19..aeef3e8 100644
--- a/UserClass/AsyncTcpClient.cs
+++ b/UserClass/AsyncTcpClient.cs
@@ -285,7 +285,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
else if (SYSAPI == "SC980")
{
DAT = DAT.Substring(DAT.IndexOf("]") + 1);
- MessageBox.Show(DAT);
+ MessageBox.Show(DAT,"SCCM", MessageBoxButton.OK, MessageBoxImage.Question);
}
return EasyTask.CompletedTask;
diff --git a/View/EngineerSetView.xaml b/View/EngineerSetView.xaml
index b319472..4283578 100644
--- a/View/EngineerSetView.xaml
+++ b/View/EngineerSetView.xaml
@@ -8,22 +8,22 @@
mc:Ignorable="d"
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
-
+
-
-
-
+
+
+
-
+
-
-
-
+
+
+
diff --git a/View/LogView.xaml b/View/LogView.xaml
new file mode 100644
index 0000000..f6a5d6a
--- /dev/null
+++ b/View/LogView.xaml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/View/LogView.xaml.cs b/View/LogView.xaml.cs
new file mode 100644
index 0000000..8a3b114
--- /dev/null
+++ b/View/LogView.xaml.cs
@@ -0,0 +1,99 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.IO;
+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.Navigation;
+using System.Windows.Shapes;
+
+namespace SunlightCentralizedControlManagement_SCCM_.View
+{
+ ///
+ /// LogView.xaml 的交互逻辑
+ ///
+ public partial class LogView : UserControl
+ {
+ string Log_time = DateTime.Now.ToString("yyyy-MM-dd");
+ DataTable logdataTable = new DataTable(); //建立RRODUCT缓存
+
+ public LogView()
+ {
+ InitializeComponent();
+
+ comboBox_log.ItemsSource = new string[3] { "Log", "ERR", "Exchange" };
+ comboBox_log.Text = "Log";
+
+ logdataTable.Columns.Add("Name", typeof(string));
+ logdataTable.Columns.Add("Length", typeof(int));
+ logdataTable.Columns.Add("CreationTimeUtc", typeof(string));
+ logdataTable.Columns.Add("LastWriteTimeUtc", typeof(string));
+
+ LOG_file();
+ }
+ private void LOG_file()//建立列表
+ {
+ DirectoryInfo loginfo = new DirectoryInfo(System.Environment.CurrentDirectory + "\\"+comboBox_log.Text); //new文件夹
+ logdataTable.Clear();
+ foreach (var item in loginfo.GetFiles())
+ {
+ DataRow FileRow = logdataTable.NewRow();
+
+ FileRow["Name"] = item.Name;
+ FileRow["Length"] = item.Length / 1024;
+ FileRow["CreationTimeUtc"] = item.CreationTimeUtc;
+ FileRow["LastWriteTimeUtc"] = item.LastWriteTimeUtc;
+ logdataTable.Rows.Add(FileRow);
+ }
+ logdataTable.DefaultView.Sort = "Name DESC";
+ gridLog.ItemsSource = logdataTable.DefaultView.ToTable().DefaultView;
+ }
+
+ private void DataGrid_gridLogClick(object sender, MouseButtonEventArgs e)//数据表双击事件
+ {
+ int rownum = gridLog.SelectedIndex;//获取鼠标选中行并定义变量
+ if (rownum != -1)//判断鼠标定位是否有效
+ {
+ /*定位选中行及指定列单元格文本信息*/
+ LOGDATA_file((gridLog.Columns[0].GetCellContent(gridLog.Items[rownum]) as TextBlock).Text.TrimEnd());//
+ }
+ }
+
+ private void LOGDATA_file(string dat) //读取文件显示到前端
+ {
+ Logtext.Document = new FlowDocument();
+ string filePath = System.Environment.CurrentDirectory + "\\"+comboBox_log.Text+"\\";
+ try
+ {
+ // 使用StreamReader读取文件
+ using (StreamReader reader = new StreamReader(filePath + dat))
+ {
+ // 读取文件直到文件的末尾
+ while (!reader.EndOfStream)
+ {
+ // 添加文件的每一行到RichTextBox
+ Logtext.AppendText(reader.ReadLine() + "\r\n");
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ // 处理可能发生的任何异常
+ MessageBox.Show("Error reading file: " + ex.Message);
+ }
+ }
+
+ private void comboBox_log_DropDownClosed(object sender, EventArgs e)
+ {
+ LOG_file();
+ }
+ }
+}
diff --git a/View/ProductionPlanningEdit.xaml.cs b/View/ProductionPlanningEdit.xaml.cs
index a1602ba..6d59378 100644
--- a/View/ProductionPlanningEdit.xaml.cs
+++ b/View/ProductionPlanningEdit.xaml.cs
@@ -108,12 +108,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
{
if (string.IsNullOrEmpty(comboBoxMachine.Text))
{
- MessageBox.Show("Not Machine");
+ MessageBox.Show("Not Machine","SCCM", MessageBoxButton.OK, MessageBoxImage.Question);
return;
}
if (string.IsNullOrEmpty(comboBoxProgram.Text))
{
- MessageBox.Show("Not Program");
+ MessageBox.Show("Not Program", "SCCM", MessageBoxButton.OK, MessageBoxImage.Question);
return;
}
string[] sArray = Regex.Split(comboBoxMachine.Text, @"\+", RegexOptions.IgnoreCase);
diff --git a/View/ProductionPlanningView.xaml.cs b/View/ProductionPlanningView.xaml.cs
index 4da26ee..13289ff 100644
--- a/View/ProductionPlanningView.xaml.cs
+++ b/View/ProductionPlanningView.xaml.cs
@@ -155,7 +155,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
if (DateTime.Now > DateTime.Parse(WorkOrder_dt.Select().First().Field