Exemplo n.º 1
0
        private void ApplyButton_Click(object sender, RoutedEventArgs e)
        {
            if (TierListBox.SelectedItem != null)
            {
                foreach (var tierName in TierListBox.SelectedItems)
                {
                    AnnoTier tier = handler.getAnnoTierFromName(tierName.ToString());
                    if (tier != null)
                    {
                        if (StreamListBox.SelectedItem != null)
                        {
                            string stream  = (string)StreamListBox.SelectedItem;
                            int    context = 0;
                            if (int.TryParse(ContextTextBox.Text, out context))
                            {
                                DatabaseHandler.StoreToDatabase(tier.AnnoList, handler.loadedDBmedia, false);

                                double confidence = -1.0;
                                if (ConfidenceTextBox.IsEnabled)
                                {
                                    double.TryParse(ConfidenceTextBox.Text, out confidence);
                                }
                                double minGap = 0.0;
                                if (FillGapTextBox.IsEnabled)
                                {
                                    double.TryParse(FillGapTextBox.Text, out minGap);
                                }
                                double minDur = 0.0;
                                if (RemoveLabelTextBox.IsEnabled)
                                {
                                    double.TryParse(RemoveLabelTextBox.Text, out minDur);
                                }
                                Properties.Settings.Default.CMLDefaultGap    = minGap;
                                Properties.Settings.Default.CMLDefaultConf   = confidence;
                                Properties.Settings.Default.CMLDefaultMinDur = minDur;
                                Properties.Settings.Default.Save();

                                logTextBox.Text = "";
                                logTextBox.AppendText(handler.CompleteTier(context, tier, stream, confidence, minGap, minDur));
                                //logTextBox.AppendText(File.ReadAllText("cml.log"));
                            }
                        }
                    }
                }
            }
        }