diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-03 18:01:27 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-03 18:01:27 +0300 |
| commit | 69343c64b63e2ae675332df10a8ad786cbda7094 (patch) | |
| tree | 4d6510feaeeba2adad0e2257586ffe1582b2831d /Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI | |
| parent | 34b3f33ec9ccb682c430b3c9e206507d0a396e1c (diff) | |
| download | Tango-69343c64b63e2ae675332df10a8ad786cbda7094.tar.gz Tango-69343c64b63e2ae675332df10a8ad786cbda7094.zip | |
Implemented RemoteRunner!
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI')
20 files changed, 1005 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.config b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.config new file mode 100644 index 000000000..c06036970 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.config @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> + </startup> + <runtime> + </runtime> +</configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.xaml b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.xaml new file mode 100644 index 000000000..20df5e220 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.xaml @@ -0,0 +1,29 @@ +<Application x:Class="Tango.RemoteRunner.UI.App" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.RemoteRunner.UI" + StartupUri="MainWindow.xaml"> + <Application.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! --> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" /> + + <!-- Accent and AppTheme setting --> + + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" /> + + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Colors.xaml" /> + <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Styles.xaml" /> + + <!--View Models--> + <ResourceDictionary> + <local:MainWindowVM x:Key="MainWindowVM" /> + </ResourceDictionary> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </Application.Resources> +</Application> diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.xaml.cs b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.xaml.cs new file mode 100644 index 000000000..9bfeb8192 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace Tango.RemoteRunner.UI +{ + /// <summary> + /// Interaction logic for App.xaml + /// </summary> + public partial class App : Application + { + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/FileUpload.cs b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/FileUpload.cs new file mode 100644 index 000000000..e707d475c --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/FileUpload.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.IO; + +namespace Tango.RemoteRunner.UI +{ + public class FileUpload + { + public TemporaryFolder Folder { get; set; } + public String UploadID { get; set; } + public String FileName { get; set; } + public bool Completed { get; set; } + public long Length { get; set; } + public long CurrentLength { get; set; } + public bool Expanded { get; set; } + + public String FullPath + { + get { return Path.Combine(Folder.Path, FileName); } + } + + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/FodyWeavers.xml b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/FodyWeavers.xml new file mode 100644 index 000000000..c6e1b7c8a --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/FodyWeavers.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<Weavers> + <Costura /> +</Weavers>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Images/cogwheel.png b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Images/cogwheel.png Binary files differnew file mode 100644 index 000000000..a93c7ff1a --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Images/cogwheel.png diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Images/process.png b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Images/process.png Binary files differnew file mode 100644 index 000000000..3992ca40d --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Images/process.png diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/MainWindow.xaml b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/MainWindow.xaml new file mode 100644 index 000000000..43d7b9c1c --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/MainWindow.xaml @@ -0,0 +1,72 @@ +<mahapps:MetroWindow x:Class="Tango.RemoteRunner.UI.MainWindow" + 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:local="clr-namespace:Tango.RemoteRunner.UI" + mc:Ignorable="d" + Title="Tango Remote Process Runner" Height="500" Width="800" ResizeMode="NoResize" TitlebarHeight="40" TitleCaps="False" BorderBrush="Gray" BorderThickness="1" WindowStartupLocation="CenterScreen" Background="#202020" Foreground="Gainsboro" DataContext="{StaticResource MainWindowVM}" d:DataContext="{d:DesignInstance Type=local:MainWindowVM, IsDesignTimeCreatable=False}"> + + <mahapps:MetroWindow.TitleTemplate> + <DataTemplate> + <TextBlock Foreground="Gray" Text="{Binding}" VerticalAlignment="Center"></TextBlock> + </DataTemplate> + </mahapps:MetroWindow.TitleTemplate> + <mahapps:MetroWindow.IconTemplate> + <DataTemplate> + <Image Source="/process.ico" Width="16" Height="16"></Image> + </DataTemplate> + </mahapps:MetroWindow.IconTemplate> + + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="1*"/> + <RowDefinition Height="80"/> + </Grid.RowDefinitions> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="456*"/> + <ColumnDefinition Width="5"/> + <ColumnDefinition Width="329*"/> + </Grid.ColumnDefinitions> + + <GridSplitter Grid.Column="1" Width="5" Background="#383838" HorizontalAlignment="Center" VerticalAlignment="Stretch" /> + <Rectangle VerticalAlignment="Bottom" Stroke="#383838" StrokeThickness="5" Grid.ColumnSpan="3" /> + + <DockPanel Margin="20"> + <TextBlock DockPanel.Dock="Top">Running Processes</TextBlock> + <DataGrid Margin="0 10 0 0" CanUserAddRows="False" RowHeight="40" CanUserDeleteRows="False" CanUserReorderColumns="False" ItemsSource="{Binding RunningProcesses}" AutoGenerateColumns="False"> + <DataGrid.Columns> + <DataGridTemplateColumn Width="40"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Image Source="/Images/cogwheel.png" Width="24" /> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + + <DataGridTextColumn Header="ID" Binding="{Binding ProcessID}" /> + <DataGridTextColumn Header="Name" Width="1*" Binding="{Binding ProcessName}" /> + + <DataGridTemplateColumn> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Button Width="70">Kill</Button> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + </DockPanel> + + <Grid Grid.Column="2"> + <DockPanel Margin="20"> + <TextBlock DockPanel.Dock="Top">Log</TextBlock> + <TextBox Text="{Binding Log,Mode=OneWay}" IsReadOnly="True" Padding="5" Margin="0 10 0 0" Background="#151515" Foreground="Gainsboro" BorderThickness="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" AcceptsReturn="True" /> + </DockPanel> + </Grid> + </Grid> + </Grid> +</mahapps:MetroWindow> diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/MainWindow.xaml.cs b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/MainWindow.xaml.cs new file mode 100644 index 000000000..07b702885 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/MainWindow.xaml.cs @@ -0,0 +1,120 @@ +using MahApps.Metro.Controls; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Forms; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.ComponentModel; +using System.Windows.Interop; + +namespace Tango.RemoteRunner.UI +{ + /// <summary> + /// Interaction logic for MainWindow.xaml + /// </summary> + public partial class MainWindow : MetroWindow + { + NotifyIcon _icon; + private bool _canClose; + private MainWindowVM _vm; + + public MainWindow() + { + InitializeComponent(); + + double width = Width; + double height = Height; + + Width = 0; + Height = 0; + + Loaded += (_, __) => + { + Visibility = Visibility.Hidden; + _vm = DataContext as MainWindowVM; + _vm.SetNotificationAction(Notify); + Notify("Running in background..."); + }; + + ContentRendered += (_, __) => + { + Width = width; + Height = height; + _vm.ViewLoaded(); + }; + + _icon = new NotifyIcon(); + _icon.Visible = true; + _icon.Text = Title; + _icon.Icon = new System.Drawing.Icon(Core.Helpers.EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.RemoteRunner.UI.process_task.ico")); + + var menuExit = new System.Windows.Forms.MenuItem() + { + Text = "Quit", + }; + + menuExit.Click += (_, __) => + { + _canClose = true; + Close(); + }; + + var menuOpen = new System.Windows.Forms.MenuItem() + { + Text = "Open", + }; + + menuOpen.Click += (_, __) => + { + Visibility = Visibility.Visible; + Activate(); + }; + + _icon.ContextMenu = new System.Windows.Forms.ContextMenu(); + _icon.ContextMenu.MenuItems.Add(menuOpen); + _icon.ContextMenu.MenuItems.Add(menuExit); + _icon.MouseClick += (_, e) => + { + if (e.Button == MouseButtons.Left) + { + Visibility = Visibility.Visible; + Activate(); + } + }; + + var helper = new WindowInteropHelper(this); + helper.EnsureHandle(); + } + + protected override void OnClosing(CancelEventArgs e) + { + base.OnClosing(e); + + if (!_canClose) + { + Visibility = Visibility.Hidden; + Notify("Running in background..."); + } + + e.Cancel = !_canClose; + } + + private void Notify(String text) + { + this.BeginInvoke(() => + { + _icon.ShowBalloonTip(500, Title, text, ToolTipIcon.Info); + }); + } + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/MainWindowVM.cs b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/MainWindowVM.cs new file mode 100644 index 000000000..d0108a499 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/MainWindowVM.cs @@ -0,0 +1,251 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using Tango.Logging; +using Tango.PMR; +using Tango.PMR.Common; +using Tango.PMR.IO; +using Tango.SharedUI; +using Tango.Transport; +using Tango.Transport.Adapters; +using Tango.Transport.Servers; +using Tango.Transport.Transporters; + +namespace Tango.RemoteRunner.UI +{ + public class MainWindowVM : ViewModel + { + private TcpServer _server; + private ITransporter _transporter; + private const int PORT = 9595; + private List<FileUpload> _uploads; + private const long MAX_CHUNK_LENGTH = 1024; + + private Action<String> _notificationAction; + private ObservableCollection<RunningProcess> _runningProcesses; + public ObservableCollection<RunningProcess> RunningProcesses + { + get { return _runningProcesses; } + set { _runningProcesses = value; RaisePropertyChangedAuto(); } + } + + private String _log; + public String Log + { + get { return _log; } + set { _log = value; RaisePropertyChangedAuto(); } + } + + public MainWindowVM() + { + RunningProcesses = new ObservableCollection<RunningProcess>(); + _uploads = new List<FileUpload>(); + + var logger = new SimpleStringLogger() { Enabled = true }; + logger.LogReceived += (_, log) => + { + Log += String.Format("{0}: {1}", log.TimeStamp.ToShortTimeString(), log.Message) + Environment.NewLine; + }; + LogManager.RegisterLogger(logger); + } + + public void ViewLoaded() + { + LogManager.Log("Application Started!"); + LogManager.Log("Initializing TCP listener on port " + PORT + "..."); + _server = new TcpServer(PORT); + _server.ClientConnected += _server_ClientConnected; + _server.Start(); + + LogManager.Log("Initializing basic transporter..."); + _transporter = new BasicTransporter(); + _transporter.FailsWithAdapter = false; + _transporter.RequestReceived += _transporter_RequestReceived; + } + + private void _transporter_RequestReceived(object sender, MessageContainer container) + { + try + { + switch (container.Type) + { + case MessageType.FileUploadRequest: + HandleFileUploadRequest(MessageFactory.ParseTangoMessageFromContainer<FileUploadRequest>(container)); + break; + case MessageType.FileChunkUploadRequest: + HandleFileChunkUploadRequest(MessageFactory.ParseTangoMessageFromContainer<FileChunkUploadRequest>(container)); + break; + case MessageType.ExecuteProcessRequest: + HandleExecuteProcessRequest(MessageFactory.ParseTangoMessageFromContainer<ExecuteProcessRequest>(container)); + break; + case MessageType.KillProcessRequest: + HandleKillProcessRequest(MessageFactory.ParseTangoMessageFromContainer<KillProcessRequest>(container)); + break; + } + } + catch (Exception ex) + { + LogManager.Log(ex); + _transporter.SendErrorResponse(ex, container.Token); + } + } + + #region Request Handlers + + private void HandleFileUploadRequest(TangoMessage<FileUploadRequest> request) + { + LogManager.Log("File upload request received " + request.Message.FileName); + + Notify("Upload request " + request.Message.FileName); + + var tempFolder = TemporaryManager.CreateFolder(); + LogManager.Log("Created temporary upload folder " + tempFolder.Path); + + String uploadID = Guid.NewGuid().ToString(); + + _uploads.Add(new FileUpload() + { + Folder = tempFolder, + UploadID = uploadID, + FileName = request.Message.FileName, + Length = request.Message.Length, + }); + + _transporter.SendResponse<FileUploadResponse>(new FileUploadResponse() + { + UploadID = uploadID, + MaxChunkLength = MAX_CHUNK_LENGTH, + }, request.Container.Token); + } + + private void HandleFileChunkUploadRequest(TangoMessage<FileChunkUploadRequest> request) + { + FileUpload upload = _uploads.SingleOrDefault(x => x.UploadID == request.Message.UploadID); + if (upload == null) + { + _transporter.SendResponse<FileChunkUploadResponse>(new FileChunkUploadResponse() { IsCanceled = true }, request.Container.Token, true, ErrorCode.InvalidUploadId); + return; + } + + if (upload.CurrentLength + request.Message.Buffer.Length > upload.Length) + { + _transporter.SendResponse<FileChunkUploadResponse>(new FileChunkUploadResponse() { IsCanceled = true }, request.Container.Token, true, ErrorCode.FileLengthOutOfRange); + return; + } + + using (FileStream fs = new FileStream(upload.FullPath, FileMode.Append)) + { + byte[] buffer = request.Message.Buffer.ToByteArray(); + fs.Write(buffer, 0, buffer.Length); + upload.CurrentLength = fs.Length; + + if (fs.Length == upload.Length) + { + upload.Completed = true; + LogManager.Log("File upload completed " + upload.FileName); + } + } + + _transporter.SendResponse<FileChunkUploadResponse>(new FileChunkUploadResponse(), request.Container.Token); + } + + private void HandleExecuteProcessRequest(TangoMessage<ExecuteProcessRequest> request) + { + LogManager.Log("Execute process request received " + request.Message.FileName); + + Notify("Execute request " + request.Message.FileName); + + FileUpload upload = _uploads.SingleOrDefault(x => x.UploadID == request.Message.UploadID); + if (upload == null || !upload.Completed) + { + _transporter.SendResponse<ExecuteProcessResponse>(new ExecuteProcessResponse(), request.Container.Token, true, ErrorCode.InvalidUploadId); + return; + } + + if (Path.GetExtension(upload.FileName).ToLower() == ".zip" && !upload.Expanded) + { + LogManager.Log("Extracting zip file to " + upload.Folder.Path); + ZipFile.ExtractToDirectory(upload.FullPath, upload.Folder.Path); + } + + upload.Expanded = true; + + RunningProcess process = new RunningProcess(); + process.Process = Process.Start(Path.Combine(upload.Folder.Path, Path.GetFileName(request.Message.FileName))); + + LogManager.Log("Process started " + process.ProcessName + ", " + process.ProcessID); + + InvokeUINow(() => + { + RunningProcesses.Add(process); + }); + + _transporter.SendResponse<ExecuteProcessResponse>(new ExecuteProcessResponse() { ProcessID = process.ProcessID }, request.Container.Token); + } + + private void HandleKillProcessRequest(TangoMessage<KillProcessRequest> request) + { + LogManager.Log("Kill process request received " + request.Message.ProcessID); + Notify("Kill request " + request.Message.ProcessID); + + var process = RunningProcesses.SingleOrDefault(x => x.ProcessID == request.Message.ProcessID); + + if (process == null) + { + _transporter.SendResponse<KillProcessResponse>(new KillProcessResponse(), request.Container.Token, true, ErrorCode.InvalidProcessId); + return; + } + + process.Process.Kill(); + LogManager.Log("Process killed " + process.ProcessName + ", " + process.ProcessID); + _transporter.SendResponse<KillProcessResponse>(new KillProcessResponse(), request.Container.Token); + } + + #endregion + + private void _server_ClientConnected(object sender, ClientConnectedEventArgs e) + { + Task.Factory.StartNew(async () => + { + try + { + Stopwatch watch = new Stopwatch(); + watch.Start(); + + LogManager.Log("Remote client connection from " + e.Socket.GetIPAddress()); + LogManager.Log("Initializing transporter with a new TCP adapter..."); + + Notify("Client connected from " + e.Socket.GetIPAddress()); + + await _transporter.Disconnect(); + TcpTransportAdapter adapter = new TcpTransportAdapter(e.Socket); + _transporter.Adapter = adapter; + await _transporter.Connect(); + + LogManager.Log(watch.Elapsed.Milliseconds + " milliseconds"); + } + catch (Exception ex) + { + LogManager.Log(ex); + } + }); + } + + public void SetNotificationAction(Action<String> notificationAction) + { + _notificationAction = notificationAction; + } + + private void Notify(String text) + { + _notificationAction?.Invoke(text); + } + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..587ec6945 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tango.RemoteRunner.UI")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.RemoteRunner.UI")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file +//inside a <PropertyGroup>. For example, if you are using US english +//in your source files, set the <UICulture> to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Resources.Designer.cs b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Resources.Designer.cs new file mode 100644 index 000000000..6714b7bda --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.RemoteRunner.UI.Properties +{ + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.RemoteRunner.UI.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Resources.resx b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Resources.resx @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Settings.Designer.cs b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Settings.Designer.cs new file mode 100644 index 000000000..7870758de --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.RemoteRunner.UI.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Settings.settings b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Properties/Settings.settings @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/RunningProcess.cs b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/RunningProcess.cs new file mode 100644 index 000000000..5e874791e --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/RunningProcess.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.RemoteRunner.UI +{ + public class RunningProcess + { + public Process Process { get; set; } + + public String ProcessID + { + get { return Process.Id.ToString(); } + } + + public String ProcessName + { + get { return Process.ProcessName; } + } + } +} diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Tango.RemoteRunner.UI.csproj b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Tango.RemoteRunner.UI.csproj new file mode 100644 index 000000000..99921bdcb --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/Tango.RemoteRunner.UI.csproj @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{4FD16878-1A44-4CCE-9589-5FC630FACDE9}</ProjectGuid> + <OutputType>WinExe</OutputType> + <RootNamespace>Tango.RemoteRunner.UI</RootNamespace> + <AssemblyName>Tango.RemoteRunner.UI</AssemblyName> + <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + <NuGetPackageImportStamp> + </NuGetPackageImportStamp> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\..\Build\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>..\..\Build\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Costura, Version=1.6.2.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Costura.Fody.1.6.2\lib\dotnet\Costura.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath> + </Reference> + <Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL"> + <HintPath>..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.IO.Compression" /> + <Reference Include="System.IO.Compression.FileSystem" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll</HintPath> + </Reference> + <Reference Include="System.Xml" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xaml"> + <RequiredTargetFramework>4.0</RequiredTargetFramework> + </Reference> + <Reference Include="WindowsBase" /> + <Reference Include="PresentationCore" /> + <Reference Include="PresentationFramework" /> + </ItemGroup> + <ItemGroup> + <ApplicationDefinition Include="App.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </ApplicationDefinition> + <Compile Include="FileUpload.cs" /> + <Compile Include="RunningProcess.cs" /> + <Page Include="MainWindow.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Compile Include="App.xaml.cs"> + <DependentUpon>App.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> + <Compile Include="MainWindow.xaml.cs"> + <DependentUpon>MainWindow.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> + </ItemGroup> + <ItemGroup> + <Compile Include="MainWindowVM.cs" /> + <Compile Include="Properties\AssemblyInfo.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + <None Include="packages.config" /> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Tango.Core\Tango.Core.csproj"> + <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> + <Name>Tango.Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.Logging\Tango.Logging.csproj"> + <Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project> + <Name>Tango.Logging</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.PMR\Tango.PMR.csproj"> + <Project>{e4927038-348d-4295-aaf4-861c58cb3943}</Project> + <Name>Tango.PMR</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.SharedUI\Tango.SharedUI.csproj"> + <Project>{8491D07B-C1F6-4B62-A412-41B9FD2D6538}</Project> + <Name>Tango.SharedUI</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.Transport\Tango.Transport.csproj"> + <Project>{74e700b0-1156-4126-be40-ee450d3c3026}</Project> + <Name>Tango.Transport</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <None Include="FodyWeavers.xml" /> + </ItemGroup> + <ItemGroup> + <Resource Include="process.ico" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\cogwheel.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\process.png" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="process_task.ico" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <Import Project="..\..\packages\Fody.2.0.0\build\dotnet\Fody.targets" Condition="Exists('..\..\packages\Fody.2.0.0\build\dotnet\Fody.targets')" /> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\..\packages\Fody.2.0.0\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Fody.2.0.0\build\dotnet\Fody.targets'))" /> + <Error Condition="!Exists('..\..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets'))" /> + </Target> + <Import Project="..\..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets" Condition="Exists('..\..\packages\Costura.Fody.1.6.2\build\dotnet\Costura.Fody.targets')" /> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/packages.config b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/packages.config new file mode 100644 index 000000000..8f0ca84f9 --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/packages.config @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Costura.Fody" version="1.6.2" targetFramework="net46" developmentDependency="true" /> + <package id="Fody" version="2.0.0" targetFramework="net46" developmentDependency="true" /> + <package id="Google.Protobuf" version="3.4.1" targetFramework="net46" /> + <package id="MahApps.Metro" version="1.5.0" targetFramework="net46" /> +</packages>
\ No newline at end of file diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/process.ico b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/process.ico Binary files differnew file mode 100644 index 000000000..777a3b36d --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/process.ico diff --git a/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/process_task.ico b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/process_task.ico Binary files differnew file mode 100644 index 000000000..777a3b36d --- /dev/null +++ b/Software/Visual_Studio/Utilities/Tango.RemoteRunner.UI/process_task.ico |
