123456789101112131415161718192021222324252627282930313233343536373839404142 |
- 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
- {
- // 【fin】 [fout] [fsample] [bandwidth]
- public static async Task<string> SigFilter(SigFilterDto dto, string outFile)
- {
- var pro = new Process();
- var res = await Task.Run(() =>
- {
- pro.StartInfo.Arguments = $"\"{dto.File}\" \"{outFile}\" {(long)(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(60 * 1000);
- if (!suceed)
- {
- throw new Exception("滤波处理超时(60秒)");
- }
- return outFile;
- });
- return res;
- }
- }
- }
|