Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
            }
        }