| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -28,6 +28,8 @@ using System.Windows.Markup;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					using System.Windows.Forms.VisualStyles;
 | 
					 | 
					 | 
					 | 
					using System.Windows.Forms.VisualStyles;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					using System.Xml.Linq;
 | 
					 | 
					 | 
					 | 
					using System.Xml.Linq;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					using Prism.Services.Dialogs;
 | 
					 | 
					 | 
					 | 
					using Prism.Services.Dialogs;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					using Microsoft.VisualBasic.Logging;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					using log4net;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					namespace Txgy.FilesWatcher.ViewModels
 | 
					 | 
					 | 
					 | 
					namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{
 | 
					 | 
					 | 
					 | 
					{
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -35,6 +37,7 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    {
 | 
					 | 
					 | 
					 | 
					    {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        public MainViewModel(WebsocketClient websocketClient, SystemConfig systemConfig, IEventAggregator ea, IDialogService dialogService, ManualModeDialogViewModel manualModeDialog)
 | 
					 | 
					 | 
					 | 
					        public MainViewModel(WebsocketClient websocketClient, SystemConfig systemConfig, IEventAggregator ea, IDialogService dialogService, ManualModeDialogViewModel manualModeDialog)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log = new GetLogger("MainViewModel");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            StartCommand = new DelegateCommand(Start, StartCanExecute).ObservesProperty(() => StartEnable);
 | 
					 | 
					 | 
					 | 
					            StartCommand = new DelegateCommand(Start, StartCanExecute).ObservesProperty(() => StartEnable);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            StopCommand= new DelegateCommand(Stop, StopCanExecute).ObservesProperty(() => StopEnable);
 | 
					 | 
					 | 
					 | 
					            StopCommand= new DelegateCommand(Stop, StopCanExecute).ObservesProperty(() => StopEnable);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            string filter = "*.index";
 | 
					 | 
					 | 
					 | 
					            string filter = "*.index";
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -56,7 +59,7 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this._dialogService = dialogService;
 | 
					 | 
					 | 
					 | 
					            this._dialogService = dialogService;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this._manualModeDialog = manualModeDialog;
 | 
					 | 
					 | 
					 | 
					            this._manualModeDialog = manualModeDialog;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					        private GetLogger _log;
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        private string watcherPath;
 | 
					 | 
					 | 
					 | 
					        private string watcherPath;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        public string PostPath
 | 
					 | 
					 | 
					 | 
					        public string PostPath
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -267,6 +270,7 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        public DelegateCommand ManualCommand => new DelegateCommand(() => 
 | 
					 | 
					 | 
					 | 
					        public DelegateCommand ManualCommand => new DelegateCommand(() => 
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log.Log.Debug("MainViewModel.ManualCommand,打开");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            DialogParameters param = new DialogParameters
 | 
					 | 
					 | 
					 | 
					            DialogParameters param = new DialogParameters
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            {
 | 
					 | 
					 | 
					 | 
					            {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                { "main", this }
 | 
					 | 
					 | 
					 | 
					                { "main", this }
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -278,7 +282,7 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        });
 | 
					 | 
					 | 
					 | 
					        });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        private void Start()
 | 
					 | 
					 | 
					 | 
					        private void Start()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            int res= WatchStartOrSopt(true);
 | 
					 | 
					 | 
					 | 
					            int res = WatchStartOrSopt(true);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (res == 0)
 | 
					 | 
					 | 
					 | 
					            if (res == 0)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            {
 | 
					 | 
					 | 
					 | 
					            {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                StartEnable = false;
 | 
					 | 
					 | 
					 | 
					                StartEnable = false;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -434,7 +438,7 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            mqttClient = new MqttFactory().CreateManagedMqttClient();
 | 
					 | 
					 | 
					 | 
					            mqttClient = new MqttFactory().CreateManagedMqttClient();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            mqttClient.UseDisconnectedHandler(ee =>
 | 
					 | 
					 | 
					 | 
					            mqttClient.UseDisconnectedHandler(ee =>
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            {
 | 
					 | 
					 | 
					 | 
					            {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                Debug.WriteLine($">>> 服务器断开连接,{ee}");
 | 
					 | 
					 | 
					 | 
					                _log.Log.Debug($">>> 服务器断开连接,{ee}");
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            });
 | 
					 | 
					 | 
					 | 
					            });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            mqttClient.UseApplicationMessageReceivedHandler(ee =>
 | 
					 | 
					 | 
					 | 
					            mqttClient.UseApplicationMessageReceivedHandler(ee =>
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            {
 | 
					 | 
					 | 
					 | 
					            {
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -514,6 +518,8 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        private void MseedFileChanged(DateTime currentT)
 | 
					 | 
					 | 
					 | 
					        private void MseedFileChanged(DateTime currentT)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log.Log.Debug("MainViewModel.MseedFileChanged() > enter....");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log.Log.DebugFormat("MainViewModel.MseedFileChanged() currentT:{0}", currentT);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            string path = $"{Path.Combine(MainPath, MseedPath)}/{currentT.Month.ToString("D2")}/{currentT.Day.ToString("D2")}/{currentT.Hour.ToString("D2")}/{currentT.AddMinutes(-2).Minute.ToString("D2")}";
 | 
					 | 
					 | 
					 | 
					            string path = $"{Path.Combine(MainPath, MseedPath)}/{currentT.Month.ToString("D2")}/{currentT.Day.ToString("D2")}/{currentT.Hour.ToString("D2")}/{currentT.AddMinutes(-2).Minute.ToString("D2")}";
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Debug.WriteLine($"**********当前时间:{currentT},监控路径:{path}");
 | 
					 | 
					 | 
					 | 
					            Debug.WriteLine($"**********当前时间:{currentT},监控路径:{path}");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (Directory.Exists(path) && IsUploadDB && IsUploadMseedPath)
 | 
					 | 
					 | 
					 | 
					            if (Directory.Exists(path) && IsUploadDB && IsUploadMseedPath)
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -531,6 +537,8 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    });
 | 
					 | 
					 | 
					 | 
					                    });
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                }), path, WorkAreaId);
 | 
					 | 
					 | 
					 | 
					                }), path, WorkAreaId);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            }
 | 
					 | 
					 | 
					 | 
					            }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log.Log.Debug("MainViewModel.MseedFileChanged() < exit....");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -605,7 +613,8 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            var watch= sender as FileSystemWatcher;
 | 
					 | 
					 | 
					 | 
					            var watch= sender as FileSystemWatcher;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            string lastLine = File.ReadLines(e.FullPath).Last().Trim();
 | 
					 | 
					 | 
					 | 
					            string lastLine = File.ReadLines(e.FullPath).Last().Trim();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Debug.WriteLine($"最后修改时间:{lastWriteTime},文件路径:{watch.Path}");
 | 
					 | 
					 | 
					 | 
					            Debug.WriteLine($"最后修改时间:{lastWriteTime},文件路径:{watch.Path}");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            var filePath=  Path.GetDirectoryName(e.FullPath);
 | 
					 | 
					 | 
					 | 
					            _log.Log.DebugFormat($"MainViewModel.Watcher_Changed() 最后修改时间:{lastWriteTime},文件路径:{watch.Path}");
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            var filePath =  Path.GetDirectoryName(e.FullPath);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (watch != null && watch.Path == watcherArray[0].Path)
 | 
					 | 
					 | 
					 | 
					            if (watch != null && watch.Path == watcherArray[0].Path)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            {
 | 
					 | 
					 | 
					 | 
					            {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                watcherArray[0].EnableRaisingEvents = false;
 | 
					 | 
					 | 
					 | 
					                watcherArray[0].EnableRaisingEvents = false;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -727,7 +736,6 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        private void Watcher_Deleted(object sender, FileSystemEventArgs e)
 | 
					 | 
					 | 
					 | 
					        private void Watcher_Deleted(object sender, FileSystemEventArgs e)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            DateTime dt = DateTime.Now;
 | 
					 | 
					 | 
					 | 
					            DateTime dt = DateTime.Now;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            string tmp = dt.Hour.ToString() + "时" + dt.Minute.ToString() + "分" + dt.Second.ToString() + "秒" + dt.Millisecond.ToString() + "毫秒,目录发生变化\r\n";
 | 
					 | 
					 | 
					 | 
					            string tmp = dt.Hour.ToString() + "时" + dt.Minute.ToString() + "分" + dt.Second.ToString() + "秒" + dt.Millisecond.ToString() + "毫秒,目录发生变化\r\n";
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            tmp += "改变类型 :" + e.ChangeType.ToString() + "\r\n"; ;
 | 
					 | 
					 | 
					 | 
					            tmp += "改变类型 :" + e.ChangeType.ToString() + "\r\n"; ;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -744,8 +752,9 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        private void StartConnectMQ()
 | 
					 | 
					 | 
					 | 
					        private void StartConnectMQ()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log.Log.Debug("MainViewModel.StartConnectMQ() > enter....");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            // 向服务端开放的端口进行服务请求
 | 
					 | 
					 | 
					 | 
					            // 向服务端开放的端口进行服务请求
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        //    string clientID = Guid.NewGuid().ToString();
 | 
					 | 
					 | 
					 | 
					            //    string clientID = Guid.NewGuid().ToString();
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            var mqttClientOptions = new MqttClientOptionsBuilder()
 | 
					 | 
					 | 
					 | 
					            var mqttClientOptions = new MqttClientOptionsBuilder()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                             .WithClientId(_systemConfig.mQTTConfig.clientID)// 传入ClientID参数
 | 
					 | 
					 | 
					 | 
					                             .WithClientId(_systemConfig.mQTTConfig.clientID)// 传入ClientID参数
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                             .WithTcpServer(_systemConfig.mQTTConfig.serverIP, _systemConfig.mQTTConfig.port)//指定TCP连接的IP和Port
 | 
					 | 
					 | 
					 | 
					                             .WithTcpServer(_systemConfig.mQTTConfig.serverIP, _systemConfig.mQTTConfig.port)//指定TCP连接的IP和Port
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -757,6 +766,7 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        .Build();
 | 
					 | 
					 | 
					 | 
					                        .Build();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            mqttClient.StartAsync(options);
 | 
					 | 
					 | 
					 | 
					            mqttClient.StartAsync(options);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            startTime = DateTime.Now;
 | 
					 | 
					 | 
					 | 
					            startTime = DateTime.Now;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log.Log.Debug("MainViewModel.StartConnectMQ() < exit....");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        private void StopMQ()
 | 
					 | 
					 | 
					 | 
					        private void StopMQ()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -764,7 +774,9 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        private void MQPublish(string topic, string openCmd)
 | 
					 | 
					 | 
					 | 
					        private void MQPublish(string topic, string openCmd)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					         //   byte[] cmdByte = Convert.FromHexString(openCmd.Replace(" ", ""));
 | 
					 | 
					 | 
					 | 
					            _log.Log.Debug("MainViewModel.MQPublish() > enter....");
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log.Log.DebugFormat("MainViewModel.MQPublish() topic:{0},cmd:{1}", topic, openCmd);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //   byte[] cmdByte = Convert.FromHexString(openCmd.Replace(" ", ""));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            MqttApplicationMessage message = new MqttApplicationMessageBuilder()
 | 
					 | 
					 | 
					 | 
					            MqttApplicationMessage message = new MqttApplicationMessageBuilder()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                .WithTopic(topic)
 | 
					 | 
					 | 
					 | 
					                .WithTopic(topic)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                .WithPayload(openCmd)
 | 
					 | 
					 | 
					 | 
					                .WithPayload(openCmd)
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -781,6 +793,7 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                mes = $">>>数据发送失败:{topic},{openCmd}";
 | 
					 | 
					 | 
					 | 
					                mes = $">>>数据发送失败:{topic},{openCmd}";
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            }
 | 
					 | 
					 | 
					 | 
					            }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Debug.WriteLine(mes);
 | 
					 | 
					 | 
					 | 
					            Debug.WriteLine(mes);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log.Log.Debug("MainViewModel.MQPublish() < exit....");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -822,6 +835,9 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        private bool CMDStartProcess(ProcessInfo proInfo, string path)
 | 
					 | 
					 | 
					 | 
					        private bool CMDStartProcess(ProcessInfo proInfo, string path)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log.Log.Debug("MainViewModel.CMDStartProcess() > enter....");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log.Log.DebugFormat("MainViewModel.CMDStartProcess() proInfo:{0},path:{1}", proInfo.ProName, path);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Process process = new Process();
 | 
					 | 
					 | 
					 | 
					            Process process = new Process();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            process.Exited += Process_Exited;
 | 
					 | 
					 | 
					 | 
					            process.Exited += Process_Exited;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            process.EnableRaisingEvents = true;
 | 
					 | 
					 | 
					 | 
					            process.EnableRaisingEvents = true;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -838,17 +854,18 @@ namespace Txgy.FilesWatcher.ViewModels
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            process.ErrorDataReceived += new DataReceivedEventHandler(OutputHandler);
 | 
					 | 
					 | 
					 | 
					            process.ErrorDataReceived += new DataReceivedEventHandler(OutputHandler);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            bool res = process.Start();
 | 
					 | 
					 | 
					 | 
					            bool res = process.Start();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					            _log.Log.Debug("MainViewModel.CMDStartProcess() < exit....");
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            return res;
 | 
					 | 
					 | 
					 | 
					            return res;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        private void Process_Exited(object? sender, EventArgs e)
 | 
					 | 
					 | 
					 | 
					        private void Process_Exited(object? sender, EventArgs e)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            _log.Log.Debug("MainViewModel.Process_Exited()");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        void OutputHandler(object sendingProcess, DataReceivedEventArgs outLine)
 | 
					 | 
					 | 
					 | 
					        void OutputHandler(object sendingProcess, DataReceivedEventArgs outLine)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        {
 | 
					 | 
					 | 
					 | 
					        {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            Debug.WriteLine("output*************:{0},{1}", sendingProcess.ToString(), outLine.Data);
 | 
					 | 
					 | 
					 | 
					            _log.Log.DebugFormat("MainViewModel.OutputHandler() output:{0},{1}", sendingProcess.ToString(), outLine.Data);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (string.IsNullOrEmpty(outLine.Data)) return;
 | 
					 | 
					 | 
					 | 
					            if (string.IsNullOrEmpty(outLine.Data)) return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        }
 | 
					 | 
					 | 
					 | 
					        }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        #endregion
 | 
					 | 
					 | 
					 | 
					        #endregion
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |