コード例 #1
0
        public void tbTLSaveClick(object sender, EventArgs e)
        {
            sdTagList.Filter           = "Tags list file (*.lst)|*.lst|All files|*.*";
            sdTagList.InitialDirectory = PIBUtils.GetAppPath();

            if (sdTagList.ShowDialog() == DialogResult.OK)
            {
                using (IniFile iniFile = new IniFile(sdTagList.FileName)) {
                    for (int i = 1; i <= MAX_TRENDS; i++)
                    {
                        TrendObj trendObj = TrendChart1[i - 1];
                        iniFile.WriteString("Trends", "Trend" + Convert.ToString(i), trendObj.Tag);
                        iniFile.WriteInteger("Trends", "PostAction" + Convert.ToString(i), (int)trendObj.PostAction);
                        if (trendObj.PostAction != PostAction.paNone)
                        {
                            iniFile.WriteInteger("Trends", "Mode" + Convert.ToString(i), (int)trendObj.Filter.Mode);
                            iniFile.WriteFloat("Trends", "BandWidth" + Convert.ToString(i), trendObj.Filter.BandWidth);
                            iniFile.WriteBool("Trends", "Overshoot" + Convert.ToString(i), trendObj.Filter.Overshoot);
                            iniFile.WriteInteger("Trends", "FrequencyResolution" + Convert.ToString(i), trendObj.Filter.FrequencyResolution);
                            iniFile.WriteInteger("Trends", "SuppressionDegree" + Convert.ToString(i), (int)trendObj.Filter.SuppressionDegree);
                            iniFile.WriteInteger("Trends", "SubstractionNoiseDegree" + Convert.ToString(i), (int)trendObj.Filter.SubstractionNoiseDegree);
                        }
                    }
                }

                CaptionTagList = "Current list of tags: " + Path.GetFileName(sdTagList.FileName);
                fModified      = false;
            }
        }
コード例 #2
0
        public void tbTLLoadClick(object sender, EventArgs e)
        {
            CheckModifyTagList();

            odTagList.Filter           = "Tags list file (*.lst)|*.lst|All files|*.*";
            odTagList.InitialDirectory = PIBUtils.GetAppPath();

            if (odTagList.ShowDialog() == DialogResult.OK)
            {
                for (int i = 0; i < lvTags.Items.Count; i++)
                {
                    lvTags.Items[i].Checked = false;
                }

                LoadListTrend(odTagList.FileName);

                fCurTagListFile = odTagList.FileName;
                if (!string.IsNullOrEmpty(fCurTagListFile))
                {
                    CaptionTagList = "Current list of tags: " + Path.GetFileName(fCurTagListFile);
                }
                else
                {
                    CaptionTagList = "No loaded tag lists";
                }
                fModified = false;
            }
        }