示例#1
0
 void bw_generate_DoWork(object sender, DoWorkEventArgs e)
 {
     List<Microphone> mics = new List<Microphone>();
     //TODO verify
     mics.Add(new Microphone { Position = new Position3D { X = 0, Y = 0, Z = 0.36 }, ChannelIndex = 0 });
     mics.Add(new Microphone { Position = new Position3D { X = 0, Y = 7.4, Z = 0.36 }, ChannelIndex = 1 });
     //mics.Add(new Microphone { Position = new Position3D { X = 7, Y = 7.4, Z = 0.36 }, ChannelIndex = 2 });
     //mics.Add(new Microphone { Position = new Position3D { X = 7, Y = 0, Z = 0.36 }, ChannelIndex = 3 });
     //mics.Add(new Microphone { Position = new Position3D { X = 3.5, Y = 0, Z = 0.8 }, ChannelIndex = 4 });
     localizer = new Localizer(mics,(int) e.Argument);
     localizer.GenerateFilterMatrix();
 }
示例#2
0
 private void Window_Closed(object sender, EventArgs e)
 {
     App.Current.Dispatcher.Invoke((Action)delegate
     {
         if (pw != null)
         {
             pw.Close();
         }
     });
     if (localizer != null)
     {
         localizer.Dispose();
         localizer = null;
     }
 }
示例#3
0
 public void Init()
 {
     lock (_localizerLock)
     {
         localizer = new Localizer(Data.cfg.Microphones.ToList(), Data.cfg.FieldWidth, Data.cfg.FieldHeight, Data.cfg.FieldMargin, Data.cfg.SampleWindow, Data.cfg.SampleLength, Data.cfg.BeaconHeight, Data.cfg.MatchedFilterEnabled, Data.cfg.MatchedFilterToep);
     }
     bw_generate.DoWork += bw_generate_DoWork;
     bw_generate.WorkerReportsProgress = true;
     bw_generate.ProgressChanged += bw_generate_ProgressChanged;
     bw_generate.RunWorkerCompleted += bw_generate_RunWorkerCompleted;
     bw_generate.RunWorkerAsync();
 }