diff --git a/EDFPlusCheckerEngine/Engine/Actions/ActionCompareTriggers.cs b/EDFPlusCheckerEngine/Engine/Actions/ActionCompareTriggers.cs index cc91e87..c639780 100644 --- a/EDFPlusCheckerEngine/Engine/Actions/ActionCompareTriggers.cs +++ b/EDFPlusCheckerEngine/Engine/Actions/ActionCompareTriggers.cs @@ -54,7 +54,7 @@ public override string Act() // same triggernumber, unequal timing. else { - if(this.EqNumberUneqTiming_RemoveRec) + if (this.EqNumberUneqTiming_RemoveRec && !RemoveList.Contains(EDFPlusTriggers[j])) RemoveList.Add(EDFPlusTriggers[j]); } } @@ -63,7 +63,7 @@ public override string Act() // different triggernumber, equal timing. if (Map[i].SameTiming(EDFPlusTriggers[j], ErrorMargin)) { - if (this.UneqNumberEqTiming_RemoveRec) + if (this.UneqNumberEqTiming_RemoveRec && !RemoveList.Contains(EDFPlusTriggers[j])) RemoveList.Add(EDFPlusTriggers[j]); } // different triggernumber, different timing. @@ -77,7 +77,11 @@ public override string Act() if (!Found) //it's nowhere to be found, oh no! { if (this.UneqNumberUneqTiming_AddLog) - AddList.Add(new Trigger[] { Map[i], ClosestTrigger(Map[i].OnsetInSeconds, EDFPlusTriggers) }); + { + Trigger[] Addition = new Trigger[] { Map[i], ClosestTrigger(Map[i].OnsetInSeconds, EDFPlusTriggers) }; + if (!AddList.Contains(Addition)) + AddList.Add(Addition); + } } } @@ -114,13 +118,13 @@ public override string Act() if (AddList.Count == 0) Control.Log("None", PrintInConsole); for (int i = 0; i < AddList.Count; i++) - Control.Log(i+1 + ": Log. " + AddList[i][0].ToString() + Environment.NewLine + "\t closest trigger in recording: [Rec. " + AddList[i][1].ToString() + "]\tdiff: " + String.Format("{0:0.000}", Math.Round(Math.Abs(AddList[i][1].ApproximateOnsetInSeconds - AddList[i][0].ApproximateOnsetInSeconds), 3)) + "s", PrintInConsole); + Control.Log(i+1 + ":\t Log. " + AddList[i][0].ToString() + "\t closest trigger in recording: [Rec. " + AddList[i][1].ToString() + "]\tdiff: " + String.Format("{0:0.000}", Math.Round(Math.Abs(AddList[i][1].ApproximateOnsetInSeconds - AddList[i][0].ApproximateOnsetInSeconds), 3)) + "s", PrintInConsole); Control.Log(Environment.NewLine + "Rec. Triggers to be Removed: ", PrintInConsole); if (RemoveList.Count == 0) Control.Log("None", PrintInConsole); for (int i = 0; i < RemoveList.Count; i++) - Control.Log(i+1 + ": Rec. " + RemoveList[i].ToString()); + Control.Log(i+1 + ":\t Rec. " + RemoveList[i].ToString()); Control.Log(Environment.NewLine, PrintInConsole); diff --git a/EDFPlusCheckerEngine/Engine/FileHandles/IFile.cs b/EDFPlusCheckerEngine/Engine/FileHandles/IFile.cs index 485b52b..9dc567e 100644 --- a/EDFPlusCheckerEngine/Engine/FileHandles/IFile.cs +++ b/EDFPlusCheckerEngine/Engine/FileHandles/IFile.cs @@ -37,9 +37,9 @@ public bool SameTiming(Trigger reference, double errorMargin) public override string ToString() { - string Description = "Onset: " + OnsetInSeconds + "s"; - Description += UncertaintyInSeconds <= 0.0 ? "" : " ~+ " + Math.Round( (UncertaintyInSeconds * 1000),1) + "ms"; - Description += " Trigger: " + TriggerNumber; + string Description = "Onset: " + new String(' ', 5 - (int)Math.Floor(Math.Log10((int)OnsetInSeconds) + 1)) + String.Format("{0:0.000}",OnsetInSeconds) + "s"; + Description += UncertaintyInSeconds <= 0.0 ? "" : " ~+ " + String.Format("{0:0.0}", (UncertaintyInSeconds * 1000)) + "ms"; + Description += " Trigger: " + new String(' ', 3 - (int)Math.Floor(Math.Log10(TriggerNumber) + 1)) + TriggerNumber; return Description; } } diff --git a/EDFPlusCheckerGUI/ConfigurationWindow/OpenFilesPage.xaml.cs b/EDFPlusCheckerGUI/ConfigurationWindow/OpenFilesPage.xaml.cs index 0a8a09a..b72d828 100644 --- a/EDFPlusCheckerGUI/ConfigurationWindow/OpenFilesPage.xaml.cs +++ b/EDFPlusCheckerGUI/ConfigurationWindow/OpenFilesPage.xaml.cs @@ -84,6 +84,10 @@ private void RecordingFilesButton_Click(object sender, RoutedEventArgs e) RecordingFilesDialog.ShowDialog(); string[] FileList = RecordingFilesDialog.FileNames; RecordingFilesTextBox.Text = String.Join(Environment.NewLine, FileList); + + this.RecordingFilesTextBox.Focus(); + this.RecordingFilesTextBox.CaretIndex = this.RecordingFilesTextBox.Text.Length; + this.RecordingFilesTextBox.ScrollToEnd(); } private void LogFilesButton_Click(object sender, RoutedEventArgs e) @@ -91,6 +95,10 @@ private void LogFilesButton_Click(object sender, RoutedEventArgs e) LogFilesDialog.ShowDialog(); string[] FileList = LogFilesDialog.FileNames; LogFilesTextBox.Text = String.Join(Environment.NewLine, FileList); + + this.LogFilesTextBox.Focus(); + this.LogFilesTextBox.CaretIndex = this.RecordingFilesTextBox.Text.Length; + this.LogFilesTextBox.ScrollToEnd(); } } } diff --git a/EDFPlusCheckerGUI/ConfigurationWindow/ParseTriggerPage.xaml b/EDFPlusCheckerGUI/ConfigurationWindow/ParseTriggerPage.xaml index d2ae41e..d6f15d1 100644 --- a/EDFPlusCheckerGUI/ConfigurationWindow/ParseTriggerPage.xaml +++ b/EDFPlusCheckerGUI/ConfigurationWindow/ParseTriggerPage.xaml @@ -75,7 +75,7 @@