Пример #1
0
        /// <summary>
        /// 导出通道数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Export_Click(object sender, EventArgs e)
        {
            try
            {
                this.btn_Export.Enabled = false;

                GetChannelNames();
                if (channelNameList.Count == 0)
                {
                    MessageBox.Show("请选择至少一个通道");
                    return;
                }

                dataList.Clear();

                for (int i = 0; i < channelNameList.Count; i++)
                {
                    CitFileHelper citHelper = new CitFileHelper();

                    if (channelNameList[i].sNameEn == "sample")
                    {
                        double[] d = citHelper.GetSingleChannelDataNoConvert(filePathStr, 2);
                        dataList.Add(d);
                    }
                    else
                    {
                        double[] d = citHelper.GetSingleChannelData(filePathStr, citHelper.GetChannelId(channelNameList[i].sNameEn, filePathStr));
                        dataList.Add(d);
                    }
                }

                //使用中文名称
                if (ckb_Chinese.Checked)
                {
                    ExportDataTxt(true);
                }
                else
                {
                    ExportDataTxt(false);
                }

                MessageBox.Show("数据导出完成");

                this.btn_Export.Enabled = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }