public void LoadWaveletSettings()
        {
            var ser = new XmlSerializer(typeof(WaveletSettings));
            if (Directory.Exists(_libDir))
            {
                var files = Directory.GetFiles(_libDir, "*.xml");
                foreach (var file in files)
                {
                    var ws = new WaveletSettings();
                    using (FileStream fs = File.OpenRead(file))
                    {
                        try
                        {
                            ws = (WaveletSettings) ser.Deserialize(fs);

                        }
                        catch (Exception e)
                        {
                            MessageBox.Show(e.Message, "Файл настройки вейвлета испорчен");
                            continue;
                        }

                    }
                    _activeWaveletSettings.Add(ws);
                }
            }
        }
 public void SaveWaveletSettings(WaveletSettings ws)
 {
     var s = new System.Xml.Serialization.XmlSerializer(typeof(WaveletSettings));
     var ns = new System.Xml.Serialization.XmlSerializerNamespaces();
     ns.Add("", "");
     //TODO: убрать скаляр
     System.IO.StreamWriter writer = System.IO.File.CreateText(_libDir + "\\test.xml");
     s.Serialize(writer, ws, ns);
     writer.Close();
 }
        public RunningProcessor(SignalBuffer buffer, WaveletSettings waveletSettings)
        {
            _buffer = buffer;
            _wSettings = waveletSettings;
            int wLength = waveletSettings.H0.Length;
            _wPhase = WaveletTools.GetWaveletPhase(wLength, buffer.CoefficientsDepth);

            //Начальная задержка фазы для заполнения буфера стартовыми данными для
            //старта безошибочного преобразования
            int _wDelay = WaveletTools.GetPhaseDelay(wLength, buffer.CoefficientsDepth);
            int _wPower = (int)Math.Pow(2, buffer.CoefficientsDepth);
            _wiPhase = (_wDelay % _wPower) == 0 ? 1 : (_wPower - (_wDelay % _wPower) + 1);
        }
 private void WaveletSettingsInitialization()
 {
     var wl = new WaveletLoader();
     wl.LoadWaveletSettings();
     wList = wl.GetWaveletsNames;
     //BUG: GetWaveletsNames[0] может не существовать
     _waveletSettings = wl.GetWaveletByName(String.IsNullOrEmpty(_view.UsingWavelet)?wl.GetWaveletsNames[0]:_view.UsingWavelet);
 }