Esempio n. 1
0
        public void LoadSettings()
        {
            try {
                IniFile iniFile = new IniFile(PIBUtils.GetIniFile());
                try {
                    fAutoScaleMax      = iniFile.ReadBool("Trends", "AutoScaleMax", true);
                    fAutoScaleMin      = iniFile.ReadBool("Trends", "AutoScaleMin", true);
                    fMax               = iniFile.ReadFloat("Trends", "Max", 0);
                    fMin               = iniFile.ReadFloat("Trends", "Min", 0);
                    fShowSource        = iniFile.ReadBool("Trends", "ShowSource", false);
                    fSeries.PostAction = (PostAction)iniFile.ReadInteger("Trends", "PostAction", 0);

                    FilterOptions filter = fSeries.Filter;
                    filter.Mode                    = (FilterMode)iniFile.ReadInteger("Trends", "Filter.Mode", 0);
                    filter.BandWidth               = iniFile.ReadFloat("Trends", "Filter.BandWidth", 0);
                    filter.Overshoot               = iniFile.ReadBool("Trends", "Filter.Overshoot", false);
                    filter.FrequencyResolution     = iniFile.ReadInteger("Trends", "Filter.FrequencyResolution", 0);
                    filter.SuppressionDegree       = (FilterDegree)iniFile.ReadInteger("Trends", "Filter.SuppressionDegree", 0);
                    filter.SubstractionNoiseDegree = (FilterDegree)iniFile.ReadInteger("Trends", "Filter.SubstractionNoiseDegree", 0);

                    fSeries.ApplyFilter();
                } finally {
                    iniFile.Dispose();
                }
            } catch (Exception ex) {
            }
        }
Esempio n. 2
0
        public void SaveSettings()
        {
            try {
                IniFile iniFile = new IniFile(PIBUtils.GetIniFile());
                try {
                    iniFile.WriteBool("Trends", "AutoScaleMax", fAutoScaleMax);
                    iniFile.WriteBool("Trends", "AutoScaleMin", fAutoScaleMin);
                    iniFile.WriteFloat("Trends", "Max", fMax);
                    iniFile.WriteFloat("Trends", "Min", fMin);
                    iniFile.WriteBool("Trends", "ShowSource", fShowSource);
                    iniFile.WriteInteger("Trends", "PostAction", (int)((sbyte)fSeries.PostAction));

                    FilterOptions filter = fSeries.Filter;
                    iniFile.WriteInteger("Trends", "Filter.Mode", (int)((sbyte)filter.Mode));
                    iniFile.WriteFloat("Trends", "Filter.BandWidth", filter.BandWidth);
                    iniFile.WriteBool("Trends", "Filter.Overshoot", filter.Overshoot);
                    iniFile.WriteInteger("Trends", "Filter.FrequencyResolution", filter.FrequencyResolution);
                    iniFile.WriteInteger("Trends", "Filter.SuppressionDegree", (int)((sbyte)filter.SuppressionDegree));
                    iniFile.WriteInteger("Trends", "Filter.SubstractionNoiseDegree", (int)((sbyte)filter.SubstractionNoiseDegree));
                } finally {
                    iniFile.Dispose();
                }
            } catch (Exception ex) {
            }
        }
Esempio n. 3
0
        public void cmbTagSearch_DropDown(object sender, EventArgs e)
        {
            try {
                IniFile iniFile = new IniFile(PIBUtils.GetIniFile());
                try {
                    cmbTagSearch.Items.Clear();
                    for (int i = 0; i < 10; i++)
                    {
                        string text;
                        try {
                            text = iniFile.ReadString("Common", "PreFind" + Convert.ToString(i), "");
                        } catch (Exception ex) {
                            iniFile.WriteString("Common", "PreFind" + Convert.ToString(i), "");
                            text = "";
                        }

                        if (text != "" || text == " ")
                        {
                            cmbTagSearch.Items.Add(text);
                        }
                    }
                } finally {
                    iniFile.Dispose();
                }
            } catch (Exception ex) {
            }
        }
Esempio n. 4
0
        public void cmbTagSearch_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return && cmbTagSearch.Text != "*")
            {
                UpdateTagsList();
                ClearTagsList();
                LVTagsClick(sender, null);
                cmbTagSearch_DropDown(sender, null);

                if (cmbTagSearch.Items.IndexOf(cmbTagSearch.Text) == -1 && cmbTagSearch.Items.Count < 10)
                {
                    cmbTagSearch.Items.Add(cmbTagSearch.Text);
                }

                try {
                    IniFile iniFile = new IniFile(PIBUtils.GetIniFile());
                    try {
                        for (int i = 0; i < cmbTagSearch.Items.Count; i++)
                        {
                            if (!string.IsNullOrEmpty(cmbTagSearch.Items[i].ToString()))
                            {
                                iniFile.WriteString("Common", "PreFind" + Convert.ToString(i), cmbTagSearch.Items[i].ToString());
                            }
                        }
                    } finally {
                        iniFile.Dispose();
                    }
                } catch (Exception ex) {
                }
            }
        }
Esempio n. 5
0
 public void SaveConnectionSettings()
 {
     try {
         using (IniFile iniFile = new IniFile(PIBUtils.GetIniFile())) {
             iniFile.WriteString(PIBUtils.AppName, "ConServerName", ConServerName);
             iniFile.WriteString(PIBUtils.AppName, "ConUser", ConUser);
         }
     } catch (Exception ex) {
     }
 }
Esempio n. 6
0
 public void LoadConnectionSettings()
 {
     try {
         using (IniFile iniFile = new IniFile(PIBUtils.GetIniFile())) {
             ConServerName = iniFile.ReadString(PIBUtils.AppName, "ConServerName", "");
             ConUser       = iniFile.ReadString(PIBUtils.AppName, "ConUser", "");
         }
     } catch (Exception ex) {
         ResetConnectionSettings();
     }
 }
Esempio n. 7
0
 public void ClearSettings()
 {
     try {
         IniFile iniFile = new IniFile(PIBUtils.GetIniFile());
         try {
         } finally {
             iniFile.Dispose();
         }
         Init();
     } catch (Exception ex) {
     }
 }