From 8a59643571080bfff715f0b0e4bb03e2dee4961a Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 12 Jun 2018 15:47:10 +0300 Subject: Starting splitting PPC to modules. --- .../PPC/Modules/Tango.PPC.Jobs/App.xaml | 11 ++ .../Tango.PPC.Jobs/Images/Job Issues/cyan.png | Bin 0 -> 1905 bytes .../PPC/Modules/Tango.PPC.Jobs/Images/arrows.png | Bin 0 -> 472 bytes .../Modules/Tango.PPC.Jobs/Images/jobs-module.png | Bin 0 -> 1626 bytes .../PPC/Modules/Tango.PPC.Jobs/Images/liquid.png | Bin 0 -> 1043 bytes .../PPC/Modules/Tango.PPC.Jobs/Images/warning.png | Bin 0 -> 603 bytes .../PPC/Modules/Tango.PPC.Jobs/JobsModule.cs | 61 +++++++ .../Tango.PPC.Jobs/Properties/AssemblyInfo.cs | 19 +++ .../Properties/Resources.Designer.cs | 62 ++++++++ .../Tango.PPC.Jobs/Properties/Resources.resx | 117 ++++++++++++++ .../Tango.PPC.Jobs/Properties/Settings.Designer.cs | 30 ++++ .../Tango.PPC.Jobs/Properties/Settings.settings | 7 + .../Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj | 176 +++++++++++++++++++++ .../PPC/Modules/Tango.PPC.Jobs/ViewModelLocator.cs | 32 ++++ .../Tango.PPC.Jobs/ViewModels/JobsViewVM.cs | 124 +++++++++++++++ .../Tango.PPC.Jobs/ViewModels/MainViewVM.cs | 17 ++ .../PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml | 153 ++++++++++++++++++ .../Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs | 28 ++++ .../PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml | 15 ++ .../Modules/Tango.PPC.Jobs/Views/MainView.xaml.cs | 28 ++++ .../PPC/Modules/Tango.PPC.Jobs/app.config | 61 +++++++ .../PPC/Modules/Tango.PPC.Jobs/packages.config | 7 + .../PPC/Modules/Tango.PPC.Synchronization/App.xaml | 11 ++ .../Images/ppc-module.png | Bin 0 -> 1748 bytes .../Modules/Tango.PPC.Synchronization/MyModule.cs | 83 ++++++++++ .../Properties/AssemblyInfo.cs | 19 +++ .../Properties/Resources.Designer.cs | 71 +++++++++ .../Properties/Resources.resx | 117 ++++++++++++++ .../Properties/Settings.Designer.cs | 30 ++++ .../Properties/Settings.settings | 7 + .../Tango.PPC.Synchronization.csproj | 156 ++++++++++++++++++ .../Tango.PPC.Synchronization/ViewModelLocator.cs | 32 ++++ .../ViewModels/MainViewVM.cs | 24 +++ .../Tango.PPC.Synchronization/Views/MainView.xaml | 14 ++ .../Views/MainView.xaml.cs | 28 ++++ .../Modules/Tango.PPC.Synchronization/app.config | 61 +++++++ .../Tango.PPC.Synchronization/packages.config | 7 + 37 files changed, 1608 insertions(+) create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/App.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Job Issues/cyan.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/arrows.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/jobs-module.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/liquid.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/warning.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModule.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Resources.resx create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Settings.settings create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModelLocator.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/packages.config create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/App.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Images/ppc-module.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/MyModule.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Resources.resx create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Settings.settings create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Tango.PPC.Synchronization.csproj create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/ViewModelLocator.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/ViewModels/MainViewVM.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Views/MainView.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Views/MainView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/app.config create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/packages.config (limited to 'Software/Visual_Studio/PPC/Modules') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/App.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/App.xaml new file mode 100644 index 000000000..c8281a6e6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/App.xaml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Job Issues/cyan.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Job Issues/cyan.png new file mode 100644 index 000000000..d53382f28 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/Job Issues/cyan.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/arrows.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/arrows.png new file mode 100644 index 000000000..ae3482ee5 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/arrows.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/jobs-module.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/jobs-module.png new file mode 100644 index 000000000..15f9c73bb Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/jobs-module.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/liquid.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/liquid.png new file mode 100644 index 000000000..7c5a4bceb Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/liquid.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/warning.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/warning.png new file mode 100644 index 000000000..5c7672421 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/warning.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModule.cs new file mode 100644 index 000000000..de4b89c22 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/JobsModule.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.BL.Enumerations; +using Tango.PPC.Common; +using Tango.PPC.Jobs.Views; +using Tango.SharedUI.Helpers; + +namespace Tango.PPC.Jobs +{ + public class JobsModule : PPCModuleBase + { + public override string Name + { + get + { + return "Jobs"; + } + } + + public override string Description + { + get + { + return "Manage and run jobs"; + } + } + + public override BitmapSource Image + { + get + { + return ResourceHelper.GetImageFromResources("Images/jobs-module.png"); + } + } + + public override Type MainViewType + { + get + { + return typeof(MainView); + } + } + + public override Permissions Permission + { + get + { + return Permissions.RunTechnicianModule; + } + } + + public override void Dispose() + { + + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..1e290e73e --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +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 Panel PC Jobs Module")] + +[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) +)] diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Resources.Designer.cs new file mode 100644 index 000000000..69824181c --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace Tango.PPC.Jobs.Properties { + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [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.PPC.Jobs.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [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/PPC/Modules/Tango.PPC.Jobs/Properties/Resources.resx b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Settings.Designer.cs new file mode 100644 index 000000000..07b7f7e97 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace Tango.PPC.Jobs.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/PPC/Modules/Tango.PPC.Jobs/Properties/Settings.settings b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj new file mode 100644 index 000000000..48826d1f4 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -0,0 +1,176 @@ + + + + + Debug + AnyCPU + {096F16C8-6D06-4B5F-9496-B9D2DF2D94A3} + library + Tango.PPC.Jobs + Tango.PPC.Jobs + v4.6 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + true + full + false + ..\..\..\Build\Debug\PPC\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\..\Build\Release\PPC\ + TRACE + prompt + 4 + + + + ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll + True + + + ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + + + ..\..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll + + + ..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + + + + + ..\..\..\packages\Expression.Blend.Sdk.1.0.2\lib\net45\System.Windows.Interactivity.dll + + + + + + + + + 4.0 + + + + + + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + PPCVersionInfo.cs + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + JobsView.xaml + + + MainView.xaml + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {f441feee-322a-4943-b566-110e12fd3b72} + Tango.BL + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {b112d89a-a106-41ae-a0c1-4abc84c477f5} + Tango.DragAndDrop + + + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} + Tango.Logging + + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + + + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} + Tango.Settings + + + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} + Tango.SharedUI + + + {fd86424c-6e84-491b-8df9-3d0f5c236a2a} + Tango.Touch + + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + + + {0be74eee-22cb-4dba-b896-793b9e1a3ac0} + Tango.PPC.Common + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModelLocator.cs new file mode 100644 index 000000000..479490486 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModelLocator.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.PPC.Jobs.ViewModels; + +namespace Tango.PPC.Jobs +{ + public static class ViewModelLocator + { + /// + /// Initializes a new instance of the ViewModelLocator class. + /// + static ViewModelLocator() + { + TangoIOC.Default.Register(); + } + + /// + /// Gets the main view VM. + /// + public static MainViewVM MainViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs new file mode 100644 index 000000000..12d811c42 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.BL; +using Tango.BL.Entities; +using Tango.Core.Commands; +using Tango.DragAndDrop; +using Tango.PPC.Common; + +namespace Tango.PPC.Jobs.ViewModels +{ + public class JobsViewVM : PPCViewModel + { + private ObservablesContext _jobsContext; + + private ObservableCollection _jobs; + public ObservableCollection Jobs + { + get { return _jobs; } + set { _jobs = value; RaisePropertyChangedAuto(); } + } + + private ICollectionView _jobsCollectionView; + /// + /// Gets or sets the jobs collection view. + /// + public ICollectionView JobsCollectionView + { + get { return _jobsCollectionView; } + set + { + _jobsCollectionView = value; + RaisePropertyChangedAuto(); + } + } + + public RelayCommand JobSelectedCommand { get; set; } + + public RelayCommand OnDragAndDropCommand { get; set; } + + public RelayCommand RemoveJobCommand { get; set; } + + private void OnDragAndDropJobs(Job draggedJob, Job droppedJob) + { + Debug.WriteLine(draggedJob.Name + " Dragged on to " + droppedJob.Name); + + if (draggedJob.JobIndex > droppedJob.JobIndex) + { + draggedJob.JobIndex = droppedJob.JobIndex - 1; + } + else + { + draggedJob.JobIndex = droppedJob.JobIndex + 1; + } + + int index = 1; + + foreach (var job in Jobs.OrderBy(x => x.JobIndex)) + { + job.JobIndex = index++; + } + + JobsCollectionView.Refresh(); + } + + private async void JobSelected(Job job) + { + Debug.WriteLine(job.Name); + await NotificationProvider.ShowInfo("Job details not yet implemented..."); + } + + public JobsViewVM() + { + Jobs = new ObservableCollection(); + + JobSelectedCommand = new RelayCommand((x) => JobSelected(x as Job)); + OnDragAndDropCommand = new RelayCommand((e) => + { + Job draggedJob = e.Draggable.DataContext as Job; + Job droppedJob = e.Droppable.DataContext as Job; + + OnDragAndDropJobs(draggedJob, droppedJob); + }); + + RemoveJobCommand = new RelayCommand(RemoveJob); + } + + private void RemoveJob(Job job) + { + NotificationProvider.ShowQuestion("Are you sure you want to remove " + job.Name); + } + + public override void OnApplicationStarted() + { + LoadJobs(); + } + + private void LoadJobs() + { + Task.Factory.StartNew(() => + { + Thread.Sleep(500); + + if (_jobsContext != null) + { + _jobsContext.Dispose(); + } + + _jobsContext = ObservablesContext.CreateDefault(); + + Jobs = _jobsContext.Jobs.Where(x => x.Machine.SerialNumber == Settings.MachineSerialNumber).ToObservableCollection(); + JobsCollectionView = CollectionViewSource.GetDefaultView(Jobs); + JobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending)); + }); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..9750652f7 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/MainViewVM.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common; + +namespace Tango.PPC.Jobs.ViewModels +{ + public class MainViewVM : PPCViewModel + { + public override void OnApplicationStarted() + { + + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml new file mode 100644 index 000000000..8da6012bf --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + Jobs + + + + + + + + + + + + + + + + READY TO DYE + NOT READY + ALL + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs new file mode 100644 index 000000000..6085810b6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs @@ -0,0 +1,28 @@ +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.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.Jobs.Views +{ + /// + /// Interaction logic for JobsView.xaml + /// + public partial class JobsView : UserControl + { + public JobsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml new file mode 100644 index 000000000..4c9f432cb --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml @@ -0,0 +1,15 @@ + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml.cs new file mode 100644 index 000000000..afba4c396 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/MainView.xaml.cs @@ -0,0 +1,28 @@ +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.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.Jobs.Views +{ + /// + /// Interaction logic for MainView.xaml + /// + public partial class MainView : UserControl + { + public MainView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config new file mode 100644 index 000000000..77b7003e2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/app.config @@ -0,0 +1,61 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/packages.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/packages.config new file mode 100644 index 000000000..80367fdd2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/App.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/App.xaml new file mode 100644 index 000000000..aa78e02a4 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/App.xaml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Images/ppc-module.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Images/ppc-module.png new file mode 100644 index 000000000..6f27f49be Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Images/ppc-module.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/MyModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/MyModule.cs new file mode 100644 index 000000000..e53b902e0 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/MyModule.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; +using Tango.BL.Enumerations; +using Tango.PPC.Common; +using Tango.PPC.Synchronization.Views; +using Tango.SharedUI.Helpers; + +namespace Tango.PPC.Synchronization +{ + /// + /// Represents a PPC . + /// + /// + public class MyModule : PPCModuleBase + { + /// + /// Gets the module name. + /// + public override string Name + { + get + { + return "My Module"; + } + } + + /// + /// Gets the module description. + /// + public override string Description + { + get + { + return "Some Module Description"; + } + } + + /// + /// Gets the module cover image. + /// + public override BitmapSource Image + { + get + { + return ResourceHelper.GetImageFromResources("Images/ppc-module.png"); + } + } + + /// + /// Gets the module entry point view type. + /// + public override Type MainViewType + { + get + { + return typeof(MainView); + } + } + + /// + /// Gets the permission required to see and load this module. + /// + public override Permissions Permission + { + get + { + return Permissions.RunMachineStudio; + } + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public override void Dispose() + { + //Dispose module here... + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..a9ea5b8b0 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +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 Module")] + +[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) +)] diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Resources.Designer.cs new file mode 100644 index 000000000..61ce72f65 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace Tango.PPC.Synchronization.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [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.PPC.Synchronization.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [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/PPC/Modules/Tango.PPC.Synchronization/Properties/Resources.resx b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Settings.Designer.cs new file mode 100644 index 000000000..6b0a60b94 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace Tango.PPC.Synchronization.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/PPC/Modules/Tango.PPC.Synchronization/Properties/Settings.settings b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Tango.PPC.Synchronization.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Tango.PPC.Synchronization.csproj new file mode 100644 index 000000000..3aeafb1e0 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Tango.PPC.Synchronization.csproj @@ -0,0 +1,156 @@ + + + + + Debug + AnyCPU + {729455D4-C384-4497-AF5D-0A598F86DAC6} + library + Tango.PPC.Synchronization + Tango.PPC.Synchronization + v4.6 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + true + full + false + ..\..\..\Build\Debug\PPC\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\..\Build\Release\PPC\ + TRACE + prompt + 4 + + + + ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll + True + + + ..\..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll + + + ..\..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll + + + ..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + + + + + ..\..\..\packages\Expression.Blend.Sdk.1.0.2\lib\net45\System.Windows.Interactivity.dll + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + + + PPCVersionInfo.cs + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + MainView.xaml + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {f441feee-322a-4943-b566-110e12fd3b72} + Tango.BL + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {b112d89a-a106-41ae-a0c1-4abc84c477f5} + Tango.DragAndDrop + + + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} + Tango.Logging + + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + + + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} + Tango.Settings + + + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} + Tango.SharedUI + + + {fd86424c-6e84-491b-8df9-3d0f5c236a2a} + Tango.Touch + + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + + + {0be74eee-22cb-4dba-b896-793b9e1a3ac0} + Tango.PPC.Common + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/ViewModelLocator.cs new file mode 100644 index 000000000..155a37a2d --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/ViewModelLocator.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.PPC.Synchronization.ViewModels; + +namespace Tango.PPC.Synchronization +{ + public static class ViewModelLocator + { + /// + /// Initializes a new instance of the ViewModelLocator class. + /// + static ViewModelLocator() + { + TangoIOC.Default.Register(); + } + + /// + /// Gets the main view VM. + /// + public static MainViewVM MainViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..d57b2b615 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/ViewModels/MainViewVM.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common; + +namespace Tango.PPC.Synchronization.ViewModels +{ + /// + /// Represents the main view VM and entry point for . + /// + /// + public class MainViewVM : PPCViewModel + { + /// + /// Called when the application has been started + /// + public override void OnApplicationStarted() + { + //Start initializing here rather then in the constructor. + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Views/MainView.xaml new file mode 100644 index 000000000..2bba2019d --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Views/MainView.xaml @@ -0,0 +1,14 @@ + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Views/MainView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Views/MainView.xaml.cs new file mode 100644 index 000000000..f2cbbf503 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/Views/MainView.xaml.cs @@ -0,0 +1,28 @@ +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.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.Synchronization.Views +{ + /// + /// Interaction logic for MainView.xaml + /// + public partial class MainView : UserControl + { + public MainView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/app.config new file mode 100644 index 000000000..77b7003e2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/app.config @@ -0,0 +1,61 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/packages.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/packages.config new file mode 100644 index 000000000..80367fdd2 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Synchronization/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file -- cgit v1.3.1