-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #589 from hcmlab/ws
introduce batchtools
- Loading branch information
Showing
9 changed files
with
174 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<Window x:Class="ssi.BatchTools" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:ssi" | ||
mc:Ignorable="d" | ||
Title="BatchTools" Height="450" Width="800"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="70"></RowDefinition> | ||
<RowDefinition Height="*"></RowDefinition> | ||
<RowDefinition Height="40"></RowDefinition> | ||
<RowDefinition Height="Auto"></RowDefinition> | ||
</Grid.RowDefinitions> | ||
|
||
<Grid> | ||
|
||
</Grid> | ||
|
||
<DockPanel Grid.Row="0" LastChildFill="True" Grid.ColumnSpan="2"> | ||
<Label DockPanel.Dock="Top" | ||
VerticalContentAlignment="Center">Convert Annotation Formats:</Label> | ||
<RadioButton Name="elan" DockPanel.Dock="Top" | ||
VerticalContentAlignment="Center" IsChecked="True">Elan Format</RadioButton> | ||
<RadioButton Name="noldus" DockPanel.Dock="Top" | ||
VerticalContentAlignment="Center">Noldus Format</RadioButton> | ||
</DockPanel> | ||
|
||
<DockPanel Grid.Row="2" LastChildFill="True" Grid.ColumnSpan="2"> | ||
<Label>Root Directory:</Label> | ||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal"> | ||
<Button Name="PickDownloadDirectory" Margin="5,0,5,5" Click="PickDownloadDirectory_Click">Pick</Button> | ||
<Button Name="ViewDownloadDirectory" Margin="5,0,5,5" Click="ViewDownloadDirectory_Click">View</Button> | ||
</StackPanel> | ||
<TextBox Name="DownloadDirectory" Margin="5,0,5,5" DockPanel.Dock="Left"/> | ||
</DockPanel> | ||
|
||
|
||
<Button x:Name="batch_send" Grid.Row="3" Height="30" Width="70" Click="batch_send_Click">Process</Button> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
{ | ||
/// <summary> | ||
/// Interaktionslogik für NostrDVM.xaml | ||
/// </summary> | ||
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"); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters