From 52a8e61db164cf3eaa006e4eee47aaee2342a6aa Mon Sep 17 00:00:00 2001 From: tayttt Date: Thu, 28 May 2026 14:51:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9D=9ENuGet=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Txgy.Controls/myListBox.cs | 1 - .../Helpers/ReportPlanImage.cs | 2 -- .../Helpers/ReportStereogramImage.cs | 4 --- Txgy.EWS.Client.Common/Helpers/XMLHelper.cs | 2 +- Txgy.EWS.Client.DAL/RemoteMySQLDataAccess.cs | 8 ++--- .../ViewModels/EarlyWarningViewModel.cs | 2 +- .../ViewModels/PlanViewModel.cs | 1 - .../ViewModels/ReportViewModel.cs | 3 -- .../ViewModels/WaveformViewModel.cs | 29 ++----------------- .../Views/EarlyWarningView.xaml.cs | 6 ++-- .../Views/EarlyWarningViewBak.xaml.cs | 4 +-- .../Views/FocalMechanismView.xaml.cs | 1 - .../Views/PlanView.xaml.cs | 7 ++--- .../Views/ReportDayListView.xaml.cs | 3 -- .../ViewModels/AddFileDialogViewModel.cs | 2 ++ .../DAL/LocalDataAccess.cs | 2 +- 16 files changed, 18 insertions(+), 59 deletions(-) diff --git a/Txgy.Controls/myListBox.cs b/Txgy.Controls/myListBox.cs index c20c8f7..7795b4b 100644 --- a/Txgy.Controls/myListBox.cs +++ b/Txgy.Controls/myListBox.cs @@ -12,7 +12,6 @@ namespace Txgy.Controls public class myListBox : System.Windows.Controls.ListBox { - private ListBoxItem _lastSelectedItem; protected override DependencyObject GetContainerForItemOverride() { return new myListBoxItem(); diff --git a/Txgy.EWS.Client.Common/Helpers/ReportPlanImage.cs b/Txgy.EWS.Client.Common/Helpers/ReportPlanImage.cs index e92ed37..bbfc8c0 100644 --- a/Txgy.EWS.Client.Common/Helpers/ReportPlanImage.cs +++ b/Txgy.EWS.Client.Common/Helpers/ReportPlanImage.cs @@ -44,8 +44,6 @@ namespace Txgy.EWS.Client.Common.Helpers double yDrawUnit = 1; double drawUnit = 1; Point _downPoint = new Point(0, 0); - bool _isMoving = false; - double left = 0, top = 0; public bool IsShowGridText = true; public bool IsShowGrid = true; public System.Windows.Media.Color BackGroundColor = System.Windows.Media.Colors.White; diff --git a/Txgy.EWS.Client.Common/Helpers/ReportStereogramImage.cs b/Txgy.EWS.Client.Common/Helpers/ReportStereogramImage.cs index 935cc8f..b9368d6 100644 --- a/Txgy.EWS.Client.Common/Helpers/ReportStereogramImage.cs +++ b/Txgy.EWS.Client.Common/Helpers/ReportStereogramImage.cs @@ -20,7 +20,6 @@ namespace Txgy.EWS.Client.Common.Helpers public class ReportStereogramImage : IDisposable { string stereoImagePath; - List eventList; public LightningChart lightChart = new LightningChart(); View3D view3D = new View3D(); @@ -30,8 +29,6 @@ namespace Txgy.EWS.Client.Common.Helpers double _sideRotationRS = 0; double _horizontalRotationRS = -30; double _verticalRotationRS = 30; - double _distanceRS = 150; - bool _clipDispaly = false; WallXZ _topWall; WallYZ _leftWall; WallYZ _rightWall; @@ -41,7 +38,6 @@ namespace Txgy.EWS.Client.Common.Helpers AxisX3D _axisXPri3D; AxisY3D _axisYPri3D; AxisZ3D _axisZPri3D; - ProjectionType _projectionTypeRS = ProjectionType.Perspective; public double _scale = 1; SizeDoubleXYZ eventSize; diff --git a/Txgy.EWS.Client.Common/Helpers/XMLHelper.cs b/Txgy.EWS.Client.Common/Helpers/XMLHelper.cs index 68752fa..e005baa 100644 --- a/Txgy.EWS.Client.Common/Helpers/XMLHelper.cs +++ b/Txgy.EWS.Client.Common/Helpers/XMLHelper.cs @@ -25,7 +25,7 @@ namespace Txgy.EWS.Client.Common.Helpers //CommonLogHelper.Debug("XML文件读取成功。"); } - catch (Exception ex) + catch (Exception) { //CommonLogHelper.log.Error(string.Format("XML文件读取失败。{0}", ex)); } diff --git a/Txgy.EWS.Client.DAL/RemoteMySQLDataAccess.cs b/Txgy.EWS.Client.DAL/RemoteMySQLDataAccess.cs index 08355b3..e4c8769 100644 --- a/Txgy.EWS.Client.DAL/RemoteMySQLDataAccess.cs +++ b/Txgy.EWS.Client.DAL/RemoteMySQLDataAccess.cs @@ -129,7 +129,7 @@ namespace Txgy.EWS.Client.DAL // //result.Data = Newtonsoft.Json.JsonConvert.SerializeObject(v.ToList()); //} } - catch (Exception ex) + catch (Exception) { return null; } @@ -229,7 +229,7 @@ namespace Txgy.EWS.Client.DAL return list; } } - catch (Exception ex) + catch (Exception) { //messagebox.show } @@ -307,7 +307,7 @@ namespace Txgy.EWS.Client.DAL return resultlist; } } - catch (Exception ex) + catch (Exception) { //throw ex; } @@ -496,7 +496,7 @@ namespace Txgy.EWS.Client.DAL } } } - catch (Exception ex) + catch (Exception) { //messagebox.show } diff --git a/Txgy.EWS.Client.PageModule/ViewModels/EarlyWarningViewModel.cs b/Txgy.EWS.Client.PageModule/ViewModels/EarlyWarningViewModel.cs index a45ae2e..b005ebe 100644 --- a/Txgy.EWS.Client.PageModule/ViewModels/EarlyWarningViewModel.cs +++ b/Txgy.EWS.Client.PageModule/ViewModels/EarlyWarningViewModel.cs @@ -934,7 +934,7 @@ namespace Txgy.EWS.Client.PageModule.ViewModels } } } - catch (Exception ex) + catch (Exception) { return 0; //throw ex; diff --git a/Txgy.EWS.Client.PageModule/ViewModels/PlanViewModel.cs b/Txgy.EWS.Client.PageModule/ViewModels/PlanViewModel.cs index 36c8bf1..803b364 100644 --- a/Txgy.EWS.Client.PageModule/ViewModels/PlanViewModel.cs +++ b/Txgy.EWS.Client.PageModule/ViewModels/PlanViewModel.cs @@ -193,7 +193,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels } } private Fill _chartBackGround = new Fill(); - private IEventAggregator _ea; public Fill ChartBackGround { diff --git a/Txgy.EWS.Client.PageModule/ViewModels/ReportViewModel.cs b/Txgy.EWS.Client.PageModule/ViewModels/ReportViewModel.cs index a3427d4..63f8ea5 100644 --- a/Txgy.EWS.Client.PageModule/ViewModels/ReportViewModel.cs +++ b/Txgy.EWS.Client.PageModule/ViewModels/ReportViewModel.cs @@ -92,8 +92,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels double _sideRotationRS = 0; double _horizontalRotationRS = -30; double _verticalRotationRS = 30; - double _distanceRS = 150; - bool _clipDispaly = false; WallXZ _topWall; WallYZ _leftWall; WallYZ _rightWall; @@ -103,7 +101,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels AxisX3D _axisXPri3D; AxisY3D _axisYPri3D; AxisZ3D _axisZPri3D; - ProjectionType _projectionTypeRS = ProjectionType.Perspective; public double _scale = 1; SizeDoubleXYZ eventSize; #endregion diff --git a/Txgy.EWS.Client.PageModule/ViewModels/WaveformViewModel.cs b/Txgy.EWS.Client.PageModule/ViewModels/WaveformViewModel.cs index 0d5d710..62b5708 100644 --- a/Txgy.EWS.Client.PageModule/ViewModels/WaveformViewModel.cs +++ b/Txgy.EWS.Client.PageModule/ViewModels/WaveformViewModel.cs @@ -43,7 +43,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels /// 当前采样数 /// public int CurPoints; - private DispatcherTimer _fitYTimer; private readonly IEventAggregator _ea; private readonly ISearchMsEventBLL _searchMsEventBLL; private int _selectResult = 0; @@ -58,17 +57,12 @@ namespace Txgy.EWS.Client.PageModule.ViewModels } int _channelCount = 60; // Channel count. double _samplingFrequency = 500; // Sampling frequency (Hz). - double _xLength = 10; // X axis length. double _previousX = 0; // Latest X value on axis. long _now; // Latest time stamp. - long _startTicks; // Controls timing. + long _startTicks = DateTime.Now.Ticks; // Controls timing. long _samplesOutput; // Generated samples quantity. - // Constants - const double YMin = 30000; // Minimal y-value. - const double YMax = 33000; // Maximal y-value. - - private volatile bool _stop; // Stops thread work. + private volatile bool _stop = false; // Stops thread work. internal bool IsRunning { get @@ -82,15 +76,12 @@ namespace Txgy.EWS.Client.PageModule.ViewModels /// Thread. /// private Thread _thread; - private Thread _threadWrite; private delegate void ChartUpdateFromThreadHandler(double[][] samples); private ChartUpdateFromThreadHandler _chartUpdate; - private Random _rand = new Random((int)DateTime.Now.Ticks); - #region "属性" private int _lChartCount = 1; /// @@ -192,7 +183,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels /// 文件数据位置 /// public string FileDataPath { get; set; } = @"D:\TaySystemPath\Downloads"; - private string _cachePath; private int _cacheSize; /// @@ -265,7 +255,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels set { gridChart = value; } } private string _btnContrlContent = "开始"; - private int channelCount; public string BtnContrlContent { @@ -281,7 +270,7 @@ namespace Txgy.EWS.Client.PageModule.ViewModels SetProperty(ref _showEvents, value); } } - StationWorkModel _stationWorker; + StationWorkModel _stationWorker = new StationWorkModel(); public List smList; //public static readonly DependencyProperty XAxesProperty = @@ -455,8 +444,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels } private void UpdateChartData() { - double yRange = YMax - YMin; - double[][] multiChannelData = new double[smList.Count * 3][]; try { @@ -480,10 +467,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels public void UpdateWavesFromTxt(string fn) { string allStr; - string sn = "";//0 - int points = 0;//1 - int samp = 500;//2 - string startTime = "";//3;4,5,6=null smList = new List(); using (StreamReader streamReader = new StreamReader(fn)) @@ -493,9 +476,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels if (allStr.Length > 0) { string[] strLines = allStr.Trim().Split(new char[] { '\n' }); - List strList = strLines.ToList(); - int cnt = strList.Count; - int num = 0; string[] snStr = strLines[0].Trim().Split(','); string tmpName = snStr[0].Substring(14, 3); CurPoints = int.Parse(snStr[1].Trim().Split(' ')[0]); @@ -913,8 +893,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels } private void ThreadLoop() { - int sm = 0; - while (_stop == false) { @@ -941,7 +919,6 @@ namespace Txgy.EWS.Client.PageModule.ViewModels if (sampleBundleToGenerate > 0) { //YMax = tmps.Max(); - double yRange = YMax - YMin; double[][] multiChannelData = new double[_channelCount][]; diff --git a/Txgy.EWS.Client.PageModule/Views/EarlyWarningView.xaml.cs b/Txgy.EWS.Client.PageModule/Views/EarlyWarningView.xaml.cs index bf432f6..1395d7c 100644 --- a/Txgy.EWS.Client.PageModule/Views/EarlyWarningView.xaml.cs +++ b/Txgy.EWS.Client.PageModule/Views/EarlyWarningView.xaml.cs @@ -36,7 +36,7 @@ namespace Txgy.EWS.Client.PageModule.Views { Dispatcher _dispatcher; private readonly IEventAggregator _ea; - private VisualHost host; + private readonly VisualHost host = new VisualHost(); public TransformGroup transGroup; private delegate void HandleDataGeneratedDelegate(List results, double dw, double dh, int ts, DateTime inTime); /// @@ -67,7 +67,6 @@ namespace Txgy.EWS.Client.PageModule.Views double drawUnit = 1; Point _downPoint = new Point(0, 0); bool _isMoving = false; - double left = 0, top = 0; public bool IsShowGridText = true; public bool IsShowGrid = true; public System.Windows.Media.Color BackGroundColor = System.Windows.Media.Colors.White; @@ -109,6 +108,7 @@ namespace Txgy.EWS.Client.PageModule.Views rpi.Draw(null, canvas.Width, canvas.Height); //host = new VisualHost(); canvas.Children.Add(rpi.host); + canvas.Children.Add(host); baseX = GlobalConfig.ProjectConfig.WorkArea.EMin; baseY = GlobalConfig.ProjectConfig.WorkArea.NMin; @@ -1034,8 +1034,6 @@ namespace Txgy.EWS.Client.PageModule.Views transform.Y += position.Y - this.previousMousePoint.Y; this.previousMousePoint = position; } - private ListBoxItem _lastSelectedItem; - private void myListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { //if (ReceivedEventListBox.SelectedItem == null && _lastSelectedItem != null) diff --git a/Txgy.EWS.Client.PageModule/Views/EarlyWarningViewBak.xaml.cs b/Txgy.EWS.Client.PageModule/Views/EarlyWarningViewBak.xaml.cs index 6402167..7479124 100644 --- a/Txgy.EWS.Client.PageModule/Views/EarlyWarningViewBak.xaml.cs +++ b/Txgy.EWS.Client.PageModule/Views/EarlyWarningViewBak.xaml.cs @@ -35,7 +35,7 @@ namespace Txgy.EWS.Client.PageModule.Views { Dispatcher _dispatcher; private readonly IEventAggregator _ea; - private VisualHost host; + private readonly VisualHost host = new VisualHost(); public TransformGroup transGroup; private delegate void HandleDataGeneratedDelegate(List results, double dw, double dh,int ts,DateTime inTime); /// @@ -65,7 +65,6 @@ namespace Txgy.EWS.Client.PageModule.Views double drawUnit = 1; Point _downPoint = new Point(0, 0); bool _isMoving = false; - double left = 0, top = 0; public bool IsShowGridText = true; public bool IsShowGrid = true; public System.Windows.Media.Color BackGroundColor = System.Windows.Media.Colors.White; @@ -105,6 +104,7 @@ namespace Txgy.EWS.Client.PageModule.Views rpi.Draw(null, canvas.Width, canvas.Height); //host = new VisualHost(); canvas.Children.Add(rpi.host); + canvas.Children.Add(host); baseX = GlobalConfig.ProjectConfig.WorkArea.EMin; baseY = GlobalConfig.ProjectConfig.WorkArea.NMin; diff --git a/Txgy.EWS.Client.PageModule/Views/FocalMechanismView.xaml.cs b/Txgy.EWS.Client.PageModule/Views/FocalMechanismView.xaml.cs index 0c9c837..bcac194 100644 --- a/Txgy.EWS.Client.PageModule/Views/FocalMechanismView.xaml.cs +++ b/Txgy.EWS.Client.PageModule/Views/FocalMechanismView.xaml.cs @@ -68,7 +68,6 @@ namespace Txgy.EWS.Client.PageModule.Views double drawUnit = 1; Point _downPoint = new Point(0, 0); bool _isMoving = false; - double left = 0, top = 0; public bool IsShowGridText = true; public bool IsShowGrid = true; public System.Windows.Media.Color BackGroundColor = System.Windows.Media.Colors.White; diff --git a/Txgy.EWS.Client.PageModule/Views/PlanView.xaml.cs b/Txgy.EWS.Client.PageModule/Views/PlanView.xaml.cs index 35d2d24..677ec89 100644 --- a/Txgy.EWS.Client.PageModule/Views/PlanView.xaml.cs +++ b/Txgy.EWS.Client.PageModule/Views/PlanView.xaml.cs @@ -56,7 +56,6 @@ namespace Txgy.EWS.Client.PageModule.Views { Dispatcher _dispatcher; private readonly IEventAggregator _ea; - private readonly ISearchMsEventBLL searchMsEventBLL; IFreeSql fsqlSqLite = FreeSqlLocalSqLite.freeLocalSqLite; //private readonly IRemoteDownloadDataBLL remoteDownloadDataBLL; @@ -65,7 +64,7 @@ namespace Txgy.EWS.Client.PageModule.Views /// Delegate for data generation. /// private HandleDataGeneratedDelegate _handleDataGenerated; - private VisualHost host; + private readonly VisualHost host = new VisualHost(); public TransformGroup transGroup; double width = 700; double height = 700; @@ -83,12 +82,9 @@ namespace Txgy.EWS.Client.PageModule.Views public double stationFontSize = 10; double baseX = 39701000; double baseY = 4352000; - double xDrawUnit = 1; - double yDrawUnit = 1; double drawUnit = 1; Point _downPoint = new Point(0, 0); bool _isMoving = false; - double left = 0, top = 0; public bool IsShowGridText = true; public bool IsShowGrid = true; public System.Windows.Media.Color BackGroundColor = System.Windows.Media.Colors.White; @@ -130,6 +126,7 @@ namespace Txgy.EWS.Client.PageModule.Views //rpi.DrawPlanClipToDrawVisual(mes, (int)rView.canvasPlan.ActualWidth, (int)rView.canvasPlan.ActualHeight); rpi.DrawGier(null, width, height); canvas.Children.Add(rpi.host); + canvas.Children.Add(host); _handleDataGenerated = new HandleDataGeneratedDelegate(rpi.DrawGier); diff --git a/Txgy.EWS.Client.PageModule/Views/ReportDayListView.xaml.cs b/Txgy.EWS.Client.PageModule/Views/ReportDayListView.xaml.cs index a711f06..18136f4 100644 --- a/Txgy.EWS.Client.PageModule/Views/ReportDayListView.xaml.cs +++ b/Txgy.EWS.Client.PageModule/Views/ReportDayListView.xaml.cs @@ -37,9 +37,6 @@ namespace Txgy.EWS.Client.PageModule.Views IFreeSql fsqlTencent = FreeSqlTencent.tencentRemoteMySQL; ReportFreqImage reportImage = new ReportFreqImage(); CultureInfo culture = new CultureInfo("zh-CN"); - byte[] dayFreqBytes = null; - byte[] dayMiddleEventPlanBytes = null; - byte[] dayMiddleEventStereoBytes = null; public string dayFreqImagePath; public int dayFreqImageWidth = 1485; public int dayFreqImageHeight = 585; diff --git a/Txgy.EWS.Client.SysModule/ViewModels/AddFileDialogViewModel.cs b/Txgy.EWS.Client.SysModule/ViewModels/AddFileDialogViewModel.cs index 574a441..73c4e09 100644 --- a/Txgy.EWS.Client.SysModule/ViewModels/AddFileDialogViewModel.cs +++ b/Txgy.EWS.Client.SysModule/ViewModels/AddFileDialogViewModel.cs @@ -19,7 +19,9 @@ namespace Txgy.EWS.Client.SysModule.ViewModels { public string Title => "系统更新文件上传"; +#pragma warning disable CS0067 public event Action RequestClose; +#pragma warning restore CS0067 public bool CanCloseDialog() => true; diff --git a/Txgy.EWS.Client.Upgrade/DAL/LocalDataAccess.cs b/Txgy.EWS.Client.Upgrade/DAL/LocalDataAccess.cs index 0a03337..f7ffaf2 100644 --- a/Txgy.EWS.Client.Upgrade/DAL/LocalDataAccess.cs +++ b/Txgy.EWS.Client.Upgrade/DAL/LocalDataAccess.cs @@ -50,7 +50,7 @@ namespace Txgy.EWS.Client.Upgrade.DAL return true; } - catch (Exception ex) + catch (Exception) { return false; }