解决冲突

#	Resources/Strings.zh-CN.xaml
#	Window6.xaml
#	Window6.xaml.cs
This commit is contained in:
2026-05-09 10:57:16 +08:00
5 changed files with 159 additions and 44 deletions

View File

@@ -22,7 +22,7 @@ using System.Windows.Threading;
using OxyPlot.Axes;
using OxyPlot.Legends;
using ;
using .Data;
namespace ShanghaiEnvironmentalTechnology
{
/// <summary>
@@ -91,7 +91,7 @@ namespace ShanghaiEnvironmentalTechnology
private TcpClient _tcpClient;
private IModbusMaster _modbusMaster;
private System.Timers.Timer resetTimer; // 启动状态实时定时器
string currentLang = LanguageManager.CurrentLanguage;
#region
private PlotModel _plotModel;
@@ -139,6 +139,7 @@ namespace ShanghaiEnvironmentalTechnology
}
else
{
btn1.IsEnabled = true;
btn2.IsEnabled = true;
btn3.IsEnabled = true;
@@ -147,6 +148,7 @@ namespace ShanghaiEnvironmentalTechnology
ResetBtn.Content = _lang == "en-US" ? "Reset" : "复位";
ResetBtn.Foreground = Brushes.White;
}
});
@@ -235,7 +237,20 @@ namespace ShanghaiEnvironmentalTechnology
{
if (!IsModbusConnected())
{
updateAction(_lang == "en-US" ? "Offline" : "离线");
//updateAction("离线");
//// 2. 直接判断是否是英文
if (LanguageManager.IsEnglish)
{
// 英文逻辑
updateAction("Offline");
}
else if (LanguageManager.IsChinese)
{
// 中文逻辑
updateAction("离线");
}
return;
}
try