From 47fad304ebc8f056f1c5ffcde037c66029fc80c9 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 1 May 2018 14:44:53 +0300 Subject: Added device information for ConnectResponse. Fixed issue with razor parser. Added report issue option to application crash. Added DeviceInformation to MachineOperator. Added LastHardwareConfiguration to machine operator. --- .../Console/ConsoleManager.cs | 14 +++ .../Console/ConsoleWindow.xaml | 113 +++++++++++++++++++++ .../Console/ConsoleWindow.xaml.cs | 28 +++++ .../Console/ConsoleWindowVM.cs | 88 ++++++++++++++++ 4 files changed, 243 insertions(+) create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindowVM.cs (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs new file mode 100644 index 000000000..0a737c526 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; + +namespace Tango.MachineStudio.UI.Console +{ + public class ConsoleManager + { + public TangoIOC TangoIOC { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml new file mode 100644 index 000000000..90c07b1af --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml.cs new file mode 100644 index 000000000..459c3d119 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindow.xaml.cs @@ -0,0 +1,28 @@ +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.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.UI.Console +{ + /// + /// Interaction logic for ConsoleWindow.xaml + /// + public partial class ConsoleWindow : MetroWindow + { + public ConsoleWindow() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindowVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindowVM.cs new file mode 100644 index 000000000..c88976948 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleWindowVM.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Threading; +using Tango.Core.Commands; +using Tango.MachineStudio.Common.Modules; +using Tango.SharedUI; + +namespace Tango.MachineStudio.UI.Console +{ + public class ConsoleWindowVM : ViewModel + { + + /// + /// Gets or sets the additional highlight C# types. + /// + public ObservableCollection> HighlightTypes { get; set; } + + /// + /// Gets or sets the intellisense types. + /// + public ObservableCollection> IntellisenseTypes { get; set; } + + /// + /// Gets or sets the run command. + /// + public RelayCommand RunCommand { get; set; } + + /// + /// Gets or sets the stop command. + /// + public RelayCommand StopCommand { get; set; } + + /// + /// Gets or sets the clear command. + /// + public RelayCommand ClearCommand { get; set; } + + public ConsoleWindowVM(IStudioModuleLoader moduleLoader) + { + RunCommand = new RelayCommand(Run); + StopCommand = new RelayCommand(Stop); + + HighlightTypes = new ObservableCollection>(); + IntellisenseTypes = new ObservableCollection>(); + + IntellisenseTypes.Add(new KeyValuePair("consoleManager", typeof(ConsoleManager))); + + foreach (var moduleType in moduleLoader.UserModules.SelectMany(x => x.MainViewType.Assembly.GetTypes())) + { + if (!moduleType.FullName.Contains("<") && !moduleType.FullName.Contains(">")) + { + HighlightTypes.Add(new KeyValuePair(moduleType.FullName, moduleType)); + } + } + + HighlightTypes.Add(new KeyValuePair("Thread", typeof(Thread))); + HighlightTypes.Add(new KeyValuePair("DateTime", typeof(DateTime))); + HighlightTypes.Add(new KeyValuePair("TimeSpan", typeof(TimeSpan))); + HighlightTypes.Add(new KeyValuePair("Dispatcher", typeof(Dispatcher))); + HighlightTypes.Add(new KeyValuePair("Task", typeof(Task))); + HighlightTypes.Add(new KeyValuePair("List", typeof(IList))); + HighlightTypes.Add(new KeyValuePair("int", typeof(Int32))); + HighlightTypes.Add(new KeyValuePair("double", typeof(Double))); + HighlightTypes.Add(new KeyValuePair("String", typeof(String))); + HighlightTypes.Add(new KeyValuePair("string", typeof(String))); + + foreach (var item in HighlightTypes) + { + IntellisenseTypes.Add(item); + } + } + + private void Stop() + { + + } + + private void Run() + { + + } + } +} -- cgit v1.3.1