diff --git a/Controls/MainControl.xaml b/Controls/MainControl.xaml index 6c6ef2e7..ff80fff0 100644 --- a/Controls/MainControl.xaml +++ b/Controls/MainControl.xaml @@ -86,6 +86,8 @@ + + @@ -129,6 +131,8 @@ + + diff --git a/Controls/MainHandler.cs b/Controls/MainHandler.cs index 12bf386b..4aca80ae 100644 --- a/Controls/MainHandler.cs +++ b/Controls/MainHandler.cs @@ -23,7 +23,7 @@ public partial class MainHandler { //Config - public static string BuildVersion = "1.2.8.3"; + public static string BuildVersion = "1.2.8.4"; public static MEDIABACKEND MediaBackend = (Properties.Settings.Default.MediaBackend == "Hardware") ? MEDIABACKEND.MEDIAKIT : MEDIABACKEND.MEDIA; public static bool ENABLE_PYTHON = Properties.Settings.Default.EnablePython; public static bool ENABLE_LIGHTNING = Properties.Settings.Default.EnableLightning; @@ -116,10 +116,11 @@ public AnnoTier getAnnoTierFromName(string name) public MainHandler(MainControl view) { control = view; - + //TEST //DatabaseHandler.ExportMultipleCSV(); - //batchConvertNoldus("W:\\nova\\data\\DFG-PP_T5"); + + // Shadow box control.shadowBoxCancelButton.Click += shadowBoxCancel_Click; @@ -276,6 +277,8 @@ public MainHandler(MainControl view) } + control.BatchToolsMenu.Click += BatchToolsMenu_Click; + //PYTHON //if(ENABLE_PYTHON) startExplainableThread(); if (ENABLE_PYTHON) @@ -488,6 +491,12 @@ public MainHandler(MainControl view) control.Drop += controlDrop; } + private void BatchToolsMenu_Click(object sender, RoutedEventArgs e) + { + BatchTools batchtools = new BatchTools(); + batchtools.Show(); + } + private void AssistantMenu_Click(object sender, RoutedEventArgs e) { LLAMA llama = new LLAMA(); diff --git a/Controls/MainHandlerFile.cs b/Controls/MainHandlerFile.cs index fec4691c..91a0bd94 100644 --- a/Controls/MainHandlerFile.cs +++ b/Controls/MainHandlerFile.cs @@ -1092,7 +1092,7 @@ private void saveProjectFile(List annoTiers, List mediaBoxes #region IMPORT - private void BatchConvertElanAnnotations(string parentDiretory) + public static void BatchConvertElanAnnotations(string parentDiretory) { DirectoryInfo directory = new DirectoryInfo(parentDiretory); DirectoryInfo[] directories = directory.GetDirectories(); @@ -1107,6 +1107,7 @@ private void BatchConvertElanAnnotations(string parentDiretory) foreach (AnnoList list in lists) { list.Scheme.Name = convert_uml(list.Scheme.Name); + list.Scheme.Name = list.Scheme.Name.Replace(" ", "_"); string saveto = folder.FullName + "\\" + list.Meta.Role + "." + list.Scheme.Name + ".annotation"; list.Source.StoreToFile = true; @@ -1242,7 +1243,7 @@ private void ImportAnnoFromAnvil(string filename) } - private void batchConvertNoldus (string directory) + public static void batchConvertNoldus (string directory) { string[] dirs = Directory.GetDirectories(directory, "*", SearchOption.AllDirectories); foreach(string dir in dirs) diff --git a/Nostr/NostrDVM.xaml.cs b/Nostr/NostrDVM.xaml.cs index 751b3da2..898e6911 100644 --- a/Nostr/NostrDVM.xaml.cs +++ b/Nostr/NostrDVM.xaml.cs @@ -43,8 +43,8 @@ public partial class NostrDVM : System.Windows.Window List relays = new List { "wss://relay.primal.net", - "wss://nos.lol/", - "wss://nostr.mom/" + "wss://nostr.mom/", + "wss://nostr.oxtr.dev/" }; public NostrDVM() diff --git a/Tools/BatchTools.xaml b/Tools/BatchTools.xaml new file mode 100644 index 00000000..478074f8 --- /dev/null +++ b/Tools/BatchTools.xaml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + Elan Format + Noldus Format + + + + + + + + + + + + + + + diff --git a/Tools/BatchTools.xaml.cs b/Tools/BatchTools.xaml.cs new file mode 100644 index 00000000..2acd3430 --- /dev/null +++ b/Tools/BatchTools.xaml.cs @@ -0,0 +1,100 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +using OxyPlot.Reporting; +using Secp256k1Net; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing.Imaging; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using System.Web.UI.WebControls; +using System.Windows; +using System.Windows.Controls; + +using System.Windows.Documents; +using System.Windows.Forms; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using ThirdParty.BouncyCastle.Utilities.IO.Pem; +using WebSocketSharp; + +using static ssi.MainHandler; +using static System.Net.Mime.MediaTypeNames; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; +using Button = System.Windows.Controls.Button; +using Image = System.Windows.Controls.Image; + + +namespace ssi +{ + /// + /// Interaktionslogik für NostrDVM.xaml + /// + public partial class BatchTools : System.Windows.Window + { + public BatchTools() + { + InitializeComponent(); + + + } + + private void PickDownloadDirectory_Click(object sender, RoutedEventArgs e) + { + var dialog = new System.Windows.Forms.FolderBrowserDialog(); + dialog.SelectedPath = Defaults.LocalDataLocations().First(); + dialog.ShowNewFolderButton = true; + dialog.Description = "Select the folder where you want to store the media of your databases in."; + System.Windows.Forms.DialogResult result = System.Windows.Forms.DialogResult.None; + + try + { + dialog.SelectedPath = Defaults.LocalDataLocations().First(); + result = dialog.ShowDialog(); + + } + + catch + { + dialog.SelectedPath = ""; + result = dialog.ShowDialog(); + } + + + + if (result == System.Windows.Forms.DialogResult.OK) + { + DownloadDirectory.Text = dialog.SelectedPath; + } + } + + private void ViewDownloadDirectory_Click(object sender, RoutedEventArgs e) + { + if (Directory.Exists(DownloadDirectory.Text)) + { + Directory.CreateDirectory(DownloadDirectory.Text); + Process.Start(DownloadDirectory.Text); + } + } + + private void batch_send_Click(object sender, RoutedEventArgs e) + { + if (elan.IsChecked == true) + { + MainHandler.BatchConvertElanAnnotations(DownloadDirectory.Text); + } + else if (noldus.IsChecked == true) + { + MainHandler.batchConvertNoldus(DownloadDirectory.Text); + } + + System.Windows.MessageBox.Show("Done"); + + } + } +} diff --git a/Types/AnnoListFile.cs b/Types/AnnoListFile.cs index f7ec4d40..3e94eacd 100644 --- a/Types/AnnoListFile.cs +++ b/Types/AnnoListFile.cs @@ -1270,7 +1270,9 @@ public static List LoadfromElanFile(String filepath) { role = tier.Attributes.GetNamedItem("PARTICIPANT").Value.ToString(); } - catch { } + catch { + role = "role"; + } bool hasreftrack = false; AnnoList refList = new AnnoList(); @@ -1296,7 +1298,7 @@ public static List LoadfromElanFile(String filepath) endtmp = (from kvp in time_order_list where kvp.Key == alignable_annotation.Attributes.GetNamedItem("TIME_SLOT_REF2").Value.ToString() select kvp.Value).ToList()[0]; end = double.Parse(endtmp, CultureInfo.InvariantCulture) / 1000; id = alignable_annotation.Attributes.GetNamedItem("ANNOTATION_ID").Value.ToString(); - label = alignable_annotation.FirstChild.InnerText.Replace(';', ','); + label = alignable_annotation.FirstChild.InnerText.Replace(';', ',').Replace(", ", "_"); if (label == "" || label == " " || label == null) { continue; diff --git a/bin/nova.exe b/bin/nova.exe index 7745c1d8..9eceac85 100644 Binary files a/bin/nova.exe and b/bin/nova.exe differ diff --git a/nova.csproj b/nova.csproj index eb542c41..116979fa 100644 --- a/nova.csproj +++ b/nova.csproj @@ -645,7 +645,9 @@ LightningTipps.xaml - + + BatchTools.xaml + @@ -1015,6 +1017,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + MSBuild:Compile Designer