Exemplo n.º 1
0
        public string WriteChannelData(string json)
        {
            ResultInfo resultInfo = new ResultInfo();

            try
            {
                Request         request     = JsonConvert.DeserializeObject <Request>(json);
                List <double[]> channeldata = JsonConvert.DeserializeObject <List <double[]> >(request.channeldata);

                bool item = citHelper.WriteChannelData(request.filepath, channeldata);

                if (item)
                {
                    resultInfo.flag = 1;
                    resultInfo.msg  = "";
                    resultInfo.data = "";
                }
                else
                {
                    resultInfo.flag = 0;
                    resultInfo.msg  = "更新失败";
                    resultInfo.data = "";
                }
            }
            catch (Exception ex)
            {
                resultInfo.flag = 0;
                resultInfo.msg  = ex.Message;
            }

            return(JsonConvert.SerializeObject(resultInfo));
        }
Exemplo n.º 2
0
 /// <summary>
 /// 写入cit数据
 /// </summary>
 /// <param name="citFileName"></param>
 /// <param name="dataList"></param>
 private void CreateCitData(string citFileName, List <double[]> dataList)
 {
     citHelper.WriteChannelData(citFileName, dataList);
 }