diff --git a/ConvertMoels/StatexmlConvert.cs b/ConvertMoels/StatexmlConvert.cs
index 3318486..0c46eaf 100644
--- a/ConvertMoels/StatexmlConvert.cs
+++ b/ConvertMoels/StatexmlConvert.cs
@@ -29,7 +29,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.ConvertMoels
else if (i == "800") Staten = "LinkOff";//未连接
else if (i == "801") Staten = "Link";//连接成功
else if (i == "899") Staten = "LinkOff";//关闭连接
- else if (i == "True") Staten = "Lock";//锁
+ else if (i == "True") Staten = "Visible";//
+ else if (i == "False") Staten = "Collapsed";//
return Staten;
}
diff --git a/ERR/ERR2025-08-28.txt b/ERR/ERR2025-08-28.txt
new file mode 100644
index 0000000..c7a25c3
--- /dev/null
+++ b/ERR/ERR2025-08-28.txt
@@ -0,0 +1,20 @@
+[2025-08-28 17:45:02];[Error] ||
+
+[2025-08-28 17:45:02];[Error source] ||.Net SqlClient Data Provider
+
+[2025-08-28 17:45:02];[Error message] ||在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: Named Pipes Provider, error: 40 - 无法打开到 SQL Server 的连接)
+
+[2025-08-28 17:45:02];[Error area] || 在 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
+ 在 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
+ 在 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
+ 在 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
+ 在 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
+ 在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
+ 在 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
+ 在 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
+ 在 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
+ 在 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
+ 在 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
+ 在 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
+ 在 System.Data.SqlClient.SqlConnection.Open()
+ 在 SunlightCentralizedControlManagement_SCCM_.ViewModel.ManualDyelotModel..ctor() 位置 C:\Users\Administrator\source\repos\SunlightCentralizedControlManagement(SCCM)\ViewModel\ManualDyelotModel.cs:行号 35
diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs
index 689ef94..268e3e6 100644
--- a/Properties/Resources.Designer.cs
+++ b/Properties/Resources.Designer.cs
@@ -60,6 +60,15 @@ namespace SunlightCentralizedControlManagement_SCCM_.Properties {
}
}
+ ///
+ /// 查找类似 Manual/Automatic 的本地化字符串。
+ ///
+ public static string _Auto {
+ get {
+ return ResourceManager.GetString("_Auto", resourceCulture);
+ }
+ }
+
///
/// 查找类似 continue 的本地化字符串。
///
diff --git a/Properties/Resources.en-US.resx b/Properties/Resources.en-US.resx
index cdeda62..b771253 100644
--- a/Properties/Resources.en-US.resx
+++ b/Properties/Resources.en-US.resx
@@ -1077,4 +1077,7 @@
Dispense Exception
+
+ Manual/Automatic
+
\ No newline at end of file
diff --git a/Properties/Resources.resx b/Properties/Resources.resx
index 5808cb1..0889381 100644
--- a/Properties/Resources.resx
+++ b/Properties/Resources.resx
@@ -1077,4 +1077,7 @@
DispenseException
+
+ Manual/Automatic
+
\ No newline at end of file
diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx
index bb8b9f2..ef47a64 100644
--- a/Properties/Resources.zh-CN.resx
+++ b/Properties/Resources.zh-CN.resx
@@ -1077,4 +1077,7 @@
输送异常
+
+ 手/自动
+
\ No newline at end of file
diff --git a/Properties/Resources.zh-TW.resx b/Properties/Resources.zh-TW.resx
index 62621bf..29ed59e 100644
--- a/Properties/Resources.zh-TW.resx
+++ b/Properties/Resources.zh-TW.resx
@@ -1077,4 +1077,7 @@
輸送異常
+
+
+
\ No newline at end of file
diff --git a/UserClass/AsyncTcpClient.cs b/UserClass/AsyncTcpClient.cs
index 0dc1d0a..e62c2ac 100644
--- a/UserClass/AsyncTcpClient.cs
+++ b/UserClass/AsyncTcpClient.cs
@@ -387,8 +387,12 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
.SetMinBufferSize(1024*64)
.SetRemoteIPHost(ip + ":" + port)
.ConfigurePlugins(a =>
- {
- // a.UseTcpReconnection();//触发型重连
+ {
+ //触发型重连
+ // a.UseTcpReconnection();
+ //使用Polling轮询连接插件
+ a.UseTcpReconnection()
+ .UsePolling(TimeSpan.FromSeconds(5));
})
.ConfigureContainer(a =>
{
@@ -396,7 +400,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserClass
}));
// Result result = await
- _ = tcpClient.TryConnectAsync();
+ await tcpClient.TryConnectAsync();
// return result.IsSuccess;
/* try
{
diff --git a/UserControls/info.xaml b/UserControls/info.xaml
index 0426d80..462aafe 100644
--- a/UserControls/info.xaml
+++ b/UserControls/info.xaml
@@ -5,20 +5,25 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.UserControls"
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
- mc:Ignorable="d"
+ xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
+ mc:Ignorable="d"
+ Loaded="UserControl_Loaded"
d:DesignHeight="400" d:DesignWidth="300" Background="White">
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UserControls/info.xaml.cs b/UserControls/info.xaml.cs
index 9095011..183d7fe 100644
--- a/UserControls/info.xaml.cs
+++ b/UserControls/info.xaml.cs
@@ -1,8 +1,18 @@
-using ScottPlot.Plottables;
+using LiveChartsCore;
+using LiveChartsCore.Defaults;
+using LiveChartsCore.Kernel.Sketches;
+using LiveChartsCore.SkiaSharpView;
+using LiveChartsCore.SkiaSharpView.Painting;
+using Newtonsoft.Json.Linq;
+using ScottPlot.Plottables;
+using SkiaSharp;
+using SunlightCentralizedControlManagement_SCCM_.ViewModel;
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
+using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
@@ -28,10 +38,75 @@ namespace SunlightCentralizedControlManagement_SCCM_.UserControls
public info()
{
InitializeComponent();
-
+ DataContext = this; //new infoModel();
}
-
+ public void DataAdd()
+ {
+ }
+ private readonly Random _random = new Random();
+ private readonly List _values = new List();
+ private readonly DateTimeAxis _customAxis;
+ public ObservableCollection Series { get; set; }
+ public static ObservableCollection ObservableValues { get; set; }
+
+ //x轴时间格式
+ public Axis[] XAxes { get; set; } =
+ {
+ new DateTimeAxis(TimeSpan.FromSeconds(5) , date => date.ToString("HH:mm"))
+ {
+ MinLimit = DateTime.Now.AddHours(-6).Ticks,
+ MaxLimit = DateTime.Now.AddHours(0.5).Ticks,
+ CrosshairLabelsBackground = SKColors.DarkGray.AsLvcColor(),
+ CrosshairLabelsPaint = new SolidColorPaint(SKColors.DarkSlateBlue, 1),
+ CrosshairPaint = new SolidColorPaint(SKColors.DarkSlateGray, 1),
+ },
+ };
+ //颜色
+ private static readonly SKColor s_blue = new SKColor(25, 118, 210);
+ private static readonly SKColor s_red = new SKColor(229, 57, 53);
+ public ICartesianAxis[] YAxes { get; set; } ={
+ new Axis //y在此轴上缩放
+ {
+ MinLimit =0,
+ MaxLimit =160,
+ NamePadding = new LiveChartsCore.Drawing.Padding(0, 20),
+ Padding = new LiveChartsCore.Drawing.Padding(0, 0, 20, 0),
+ TextSize = 12,
+ LabelsPaint = new SolidColorPaint(s_blue),
+ TicksPaint = new SolidColorPaint(s_blue),
+ SubticksPaint = new SolidColorPaint(s_blue),
+ DrawTicksPath = true,
+ CrosshairSnapEnabled = true,
+ Position = LiveChartsCore.Measure.AxisPosition.Start
+ },//温度轴
+
+ };
+
+ private static ObservableCollection MTH_values;
+ private void UserControl_Loaded(object sender, RoutedEventArgs e)
+ {
+ var MTH_items = new List();
+ MTH_values = new ObservableCollection(MTH_items);
+
+ Series = new ObservableCollection
+ {
+ new LineSeries
+ {
+ Name = Properties.Resources.Temperature,
+ Values = MTH_values,
+ Stroke = new SolidColorPaint(s_red, 2),
+ GeometrySize = 0,
+ GeometryStroke = new SolidColorPaint(s_red, 2),
+ Fill = null,
+ LineSmoothness = 0,
+ ScalesYAt = 2,
+ }
+ };
+
+
+
+ }
}
}
diff --git a/View/MonitorView.xaml b/View/MonitorView.xaml
index b2da9fb..0065645 100644
--- a/View/MonitorView.xaml
+++ b/View/MonitorView.xaml
@@ -19,6 +19,7 @@
+
@@ -112,9 +113,12 @@
-
+
diff --git a/View/MonitorView.xaml.cs b/View/MonitorView.xaml.cs
index b144c29..0e845ef 100644
--- a/View/MonitorView.xaml.cs
+++ b/View/MonitorView.xaml.cs
@@ -227,19 +227,21 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
}//单据
private void MenuItem_LOCK_XML(object sender, RoutedEventArgs e)
{
- string mode = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First().Field("LOCK");
+ bool mode = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First().Field("LOCK");
- Dictionary dat_821 = new Dictionary();
- dat_821.Clear();
+ Dictionary dat_ = new Dictionary();
+ dat_.Clear();
- if (mode != "True")
+ if (!mode)
{
- dat_821.Add("LOCK", "True");
- MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "LOCK", "Name='" + machine + "'", "True");
- }
+ dat_.Add("NAME", "LOCK");
+ dat_.Add("VALUE", "True");
+ MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "LOCK", "Name='" + machine + "'", "True");
+ }
else
{
- dat_821.Add("LOCK", "FALSE");
+ dat_.Add("NAME", "LOCK");
+ dat_.Add("VALUE", "False");
MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "LOCK", "Name='" + machine + "'", "False");
}
@@ -248,14 +250,43 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
MainWindowViewModel.stringQueue.Enqueue(new MainWindowViewModel.QueueString
{
ID = index,
- DAT = "SC829" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", "ID='" + index + "'") + dat_821.ToJsonString()
+ DAT = "SC829" + MainWindowViewModel.Selet_Machines(MainWindowViewModel.Machines, "SYSKEY", "ID='" + index + "'") + dat_.ToJsonString()
});
- if (mode != "True") { MessageBox.Show(machine + Properties.Resources.user_lock, "800", MessageBoxButton.OK, MessageBoxImage.Information);
+ if (!mode) { MessageBox.Show(machine + Properties.Resources.user_lock, "800", MessageBoxButton.OK, MessageBoxImage.Information);
} else {
MessageBox.Show(machine + Properties.Resources.user_unlock, "800", MessageBoxButton.OK, MessageBoxImage.Information);
}
}//锁定
+ private void MenuItem_AUTO_XML(object sender, RoutedEventArgs e)
+ {
+ bool mode = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First().Field("AUTO");
+
+ Dictionary dat_ = new Dictionary();
+ dat_.Clear();
+
+ if (!mode)
+ {
+ dat_.Add("NAME", "AUTO");
+ dat_.Add("VALUE", "True");
+ MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "AUTO", "Name='" + machine + "'", "True");
+ }
+ else
+ {
+ dat_.Add("NAME", "AUTO");
+ dat_.Add("VALUE", "FALSE");
+ MainWindowViewModel.Updata_Machines(MainWindowViewModel.Machines, "AUTO", "Name='" + machine + "'", "False");
+ }
+
+ DataRow drEmployee = MainWindowViewModel.Machines.Select("NAME='" + machine + "'").First();
+ int index = Convert.ToInt16(drEmployee.Field