private void btnAvg_Click(object sender, EventArgs e) { AccelerationOffLineCommon.Bat bat = new AccelerationOffLineCommon.Bat(); AccelerationOffLineCommon.Model.BaseRequest max = new AccelerationOffLineCommon.Model.BaseRequest(); max.path = @"H:\工作文件汇总\铁科院\程序\离线加速度\离线加速度dll\测试\CitData_170907214945_CGZX_11_Rms.idf"; //max.path = @"F:\个人文件\铁路\工程代码\离线加速度\离线加速度dll平台开发\数据\CitData_160612202839_GZXS_11_Rms.idf"; string json = JsonConvert.SerializeObject(max); string result = bat.ProcessAvg(json); }
private void btnPeak_Click(object sender, EventArgs e) { AccelerationOffLineCommon.Bat bat = new AccelerationOffLineCommon.Bat(); AccelerationOffLineCommon.Model.PeakRequest peak = new AccelerationOffLineCommon.Model.PeakRequest(); peak.path = @"H:\\工作文件汇总\\铁科院\\程序\\离线加速度\\cit\\CitData_160612060534_CHSS_11_11_Rms.idf"; peak.segavgs = new double[] { 0.673, 0.786, 0.819 }; string json = JsonConvert.SerializeObject(peak); string result = bat.ProcessPeak(json); }
private void btnMax_Click(object sender, EventArgs e) { AccelerationOffLineCommon.Bat bat = new AccelerationOffLineCommon.Bat(); AccelerationOffLineCommon.Model.MaxRequest max = new AccelerationOffLineCommon.Model.MaxRequest(); max.path = @"H:\工作文件汇总\铁科院\程序\离线加速度\test\CitData_160612060534_CHSS_11_11.cit"; max.exportPath = @"H:\工作文件汇总\铁科院\程序\离线加速度\test\"; max.sectionLen = 160; max.isCreateIdf = false; string json = JsonConvert.SerializeObject(max); string result = bat.ProcessMax(json); }
private void btnRms_Click(object sender, EventArgs e) { AccelerationOffLineCommon.Bat bat = new AccelerationOffLineCommon.Bat(); AccelerationOffLineCommon.Model.RmsRequest rms = new AccelerationOffLineCommon.Model.RmsRequest(); rms.fs = 2000; rms.upperFreq = 500; rms.lowerFreq = 20; rms.path = @"H:\工作文件汇总\铁科院\程序\离线加速度\test\CitData_160612060534_CHSS_11.cit"; rms.exportPath = @"H:\工作文件汇总\铁科院\程序\离线加速度\test\"; rms.windowLen = 160; rms.lowerChannelFreq = new List <double> { 0.2, 0.2, 0.2, 0.2, 0.2 }; rms.upperChannelFreq = new List <double> { 20, 10, 10, 20, 20 }; string json = JsonConvert.SerializeObject(rms); string result = bat.ProcessRms(json); }
static void RunCommon() { string configPath = ConfigurationManager.AppSettings["configPath"]; if (!String.IsNullOrEmpty(configPath)) { string json = ReadConfigTxtContent(configPath); AccelerationOffLineCommon.Bat bat = new AccelerationOffLineCommon.Bat(); string result = bat.ProcessRms(json); Console.WriteLine(result); } else { Response resultInfo = new Response(); resultInfo.flag = 0; resultInfo.msg = "config配置文件为空"; string resultMessage = JsonConvert.SerializeObject(resultInfo); Console.WriteLine(resultMessage); } }