예제 #1
0
        private void ExportWf(int headid)
        {
            int bytes = GetDrivingWaveformBytes();

            for (int i = 0; i < readWaveformDatas.Count; i++)
            {
                if (abList[i].Checked)
                {
                    List <byte> temp = new List <byte>();
                    string      filename;
                    if (panel4.Visible)
                    {
                        filename = string.Format("{0}_HeadBoard{1}_Head{2}_{3}.txt",
                                                 Path.GetFileNameWithoutExtension(path),
                                                 _hbindexReadall, headid + 1,
                                                 i == 0 ? "A" : "B");
                    }
                    else
                    {
                        filename = string.Format("{0}_HeadBoard{1}_Head{2}.txt",
                                                 Path.GetFileNameWithoutExtension(path),
                                                 _hbindexReadall, headid + 1);
                    }
                    string savepath = Path.Combine(Path.GetDirectoryName(path), filename);
                    //StreamWriter sw = new StreamWriter(savepath, false);
                    int j = 0;
                    for (int h = 7; h < readWaveformDatas[i].Length; h++)
                    {
                        temp.Add(readWaveformDatas[i][h]);
                        //sw.WriteLine(string.Format("{0}", readWaveformDatas[i][h]));
                        j++;
                        if (j == bytes)
                        {
                            break;
                        }
                    }
                    //sw.Flush();
                    //sw.Close();
                    //加密
                    PubFunc.EncryptSave(savepath, temp.ToArray());
                }
            }
        }