| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using XdCxRhDW.Dto;
- namespace CheckServer.AddIns
- {
- public class SigFilterHelper
- {
- Process pro;
- // 【fin】 [fout] [fsample] [bandwidth]
- public async Task SigFilter(SigFilterDto dto, string outFile)
- {
- pro = new Process();
- await Task.Run(() =>
- {
- pro.StartInfo.Arguments = $"\"{dto.File}\" \"{outFile}\" {(Int64)(dto.FsHz)} {dto.BandHz}";
- var exePath = Path.Combine(pro.StartInfo.WorkingDirectory, "AddIns");
- pro.StartInfo.WorkingDirectory = exePath;
- pro.StartInfo.FileName = Path.Combine(exePath, "FileFilter.exe");
- pro.StartInfo.CreateNoWindow = true;
- pro.StartInfo.RedirectStandardError = true;
- pro.StartInfo.RedirectStandardOutput = true;
- pro.StartInfo.UseShellExecute = false;
- pro.Start();
- var suceed = pro.WaitForExit(dto.TimeoutSeconds * 1000);
- if (!suceed)
- {
- throw new Exception("滤波处理超时");
- }
- });
- }
- }
- }
|