From 024eb7867d2b400212ce4ce0e4845d99bf532568 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 4 Nov 2020 13:01:49 +0200 Subject: First steps on FSE configuration module. --- .../Tango.FSE.MachineConfiguration/App.xaml | 16 ++ .../ConfigurationModule.cs | 26 +++ .../ConfigurationViewModel.cs | 14 ++ .../Images/configuration.png | Bin 0 -> 2668 bytes .../Messages/MachineLoadedMessage.cs | 14 ++ .../Navigation/ConfigurationNavigationManager.cs | 18 ++ .../Navigation/ConfigurationView.cs | 14 ++ .../Properties/AssemblyInfo.cs | 55 ++++++ .../Properties/Resources.Designer.cs | 71 +++++++ .../Properties/Resources.resx | 117 +++++++++++ .../Properties/Settings.Designer.cs | 30 +++ .../Properties/Settings.settings | 7 + .../Tango.FSE.MachineConfiguration.csproj | 216 +++++++++++++++++++++ .../ViewModelLocator.cs | 65 +++++++ .../ViewModels/ConfigurationViewVM.cs | 44 +++++ .../ViewModels/DataStoreViewVM.cs | 13 ++ .../ViewModels/MachineViewVM.cs | 60 ++++++ .../ViewModels/MainViewVM.cs | 60 ++++++ .../ViewModels/SelectionViewVM.cs | 48 +++++ .../Views/ConfigurationView.xaml | 115 +++++++++++ .../Views/ConfigurationView.xaml.cs | 28 +++ .../Views/DataStoreView.xaml | 16 ++ .../Views/DataStoreView.xaml.cs | 28 +++ .../Views/MachineView.xaml | 49 +++++ .../Views/MachineView.xaml.cs | 28 +++ .../Views/MainView.xaml | 18 ++ .../Views/MainView.xaml.cs | 31 +++ .../Views/SelectionView.xaml | 61 ++++++ .../Views/SelectionView.xaml.cs | 28 +++ .../Tango.FSE.MachineConfiguration/app.config | 85 ++++++++ .../Tango.FSE.MachineConfiguration/packages.config | 10 + .../ViewModels/OrganizationSelectionViewVM.cs | 2 +- .../FSE/Tango.FSE.Common/Resources/Styles.xaml | 80 ++++++++ .../FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 4 + 34 files changed, 1470 insertions(+), 1 deletion(-) create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/App.xaml create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationModule.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationViewModel.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/configuration.png create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/MachineLoadedMessage.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationNavigationManager.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationView.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Resources.resx create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Settings.settings create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModelLocator.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MainViewVM.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/app.config create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/packages.config (limited to 'Software/Visual_Studio/FSE') diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/App.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/App.xaml new file mode 100644 index 000000000..28a976e78 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/App.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationModule.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationModule.cs new file mode 100644 index 000000000..2f2c0dbb1 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationModule.cs @@ -0,0 +1,26 @@ +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.FSE.Common; +using Tango.FSE.MachineConfiguration.Views; + +namespace Tango.FSE.MachineConfiguration +{ + [FSEModule(index: 7)] + public class ConfigurationModule : FSEModuleBase + { + public override string Name { get; } = "Configuration"; + public override string Description { get; } = "Configuration Module"; + public override Type MainViewType { get; } = typeof(MainView); + public override Permissions Permission { get; } = Permissions.FSE_RunFSE; + + public override void Dispose() + { + + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationViewModel.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationViewModel.cs new file mode 100644 index 000000000..bfcc60bcf --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ConfigurationViewModel.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.FSE.Common.Navigation; +using Tango.FSE.MachineConfiguration.Navigation; + +namespace Tango.FSE.MachineConfiguration +{ + public class ConfigurationViewModel : ModularNavigationFSEViewModel + { + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/configuration.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/configuration.png new file mode 100644 index 000000000..f46a49d23 Binary files /dev/null and b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/configuration.png differ diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/MachineLoadedMessage.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/MachineLoadedMessage.cs new file mode 100644 index 000000000..4a703b2a9 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/MachineLoadedMessage.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; + +namespace Tango.FSE.MachineConfiguration.Messages +{ + public class MachineLoadedMessage + { + public Machine Machine { get; set; } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationNavigationManager.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationNavigationManager.cs new file mode 100644 index 000000000..c1dfdfda7 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationNavigationManager.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using Tango.FSE.Common.Navigation; +using Tango.SharedUI.Controls; + +namespace Tango.FSE.MachineConfiguration.Navigation +{ + public class ConfigurationNavigationManager : ModularNavigationManager + { + public ConfigurationNavigationManager(FrameworkElement navigationControlParent) : base(navigationControlParent) + { + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationView.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationView.cs new file mode 100644 index 000000000..187e44ac9 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Navigation/ConfigurationView.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.MachineConfiguration.Navigation +{ + public enum ConfigurationView + { + SelectionView, + MachineView, + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/AssemblyInfo.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..027dd9516 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/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.FSE.MachineConfiguration")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.FSE.MachineConfiguration")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[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 +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the 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/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Resources.Designer.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Resources.Designer.cs new file mode 100644 index 000000000..830d15d6a --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/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.FSE.MachineConfiguration.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.FSE.MachineConfiguration.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/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Resources.resx b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/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/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Settings.Designer.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Settings.Designer.cs new file mode 100644 index 000000000..e41736026 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/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.FSE.MachineConfiguration.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/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Settings.settings b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj new file mode 100644 index 000000000..e7adc1d3f --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj @@ -0,0 +1,216 @@ + + + + + Debug + AnyCPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC} + library + Tango.FSE.MachineConfiguration + Tango.FSE.MachineConfiguration + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + + + true + full + false + ..\..\..\Build\FSE\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\..\Build\FSE\Release\ + TRACE + prompt + 4 + + + + ..\..\..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll + + + ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + + + ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + + + ..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + + ..\..\..\packages\MahApps.Metro.1.6.5\lib\net46\MahApps.Metro.dll + + + ..\..\..\packages\MaterialDesignColors.1.2.2\lib\net45\MaterialDesignColors.dll + + + ..\..\..\packages\MaterialDesignThemes.3.0.1\lib\net45\MaterialDesignThemes.Wpf.dll + + + ..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + + + + + + ..\..\..\packages\ControlzEx.3.0.2.4\lib\net45\System.Windows.Interactivity.dll + + + + + + + + + 4.0 + + + + + + + + + + + + + + + + + + + ConfigurationView.xaml + + + DataStoreView.xaml + + + SelectionView.xaml + + + MachineView.xaml + + + MainView.xaml + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {bb2abb74-ba58-4812-83aa-ec8171f42df4} + Tango.AutoComplete + + + {f441feee-322a-4943-b566-110e12fd3b72} + Tango.BL + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {4206ac58-3b57-4699-8835-90bf6db01a61} + Tango.Integration + + + {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 + + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + + + {834c81c3-09b5-45d7-be12-e7d1e6655a7c} + Tango.FSE.BL + + + {bc37cccb-7392-4f78-8d1c-e9629e6e046e} + Tango.FSE.Common + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + + + + + + 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}. + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModelLocator.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModelLocator.cs new file mode 100644 index 000000000..187565ca4 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModelLocator.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.FSE.MachineConfiguration.Navigation; +using Tango.FSE.MachineConfiguration.ViewModels; +using Tango.FSE.MachineConfiguration.Views; + +namespace Tango.FSE.MachineConfiguration +{ + public static class ViewModelLocator + { + static ViewModelLocator() + { + TangoIOC.Default.Register(new ConfigurationNavigationManager(MainView.Instance)); + TangoIOC.Default.Register(); + TangoIOC.Default.Register(); + TangoIOC.Default.Register(); + TangoIOC.Default.Register(); + TangoIOC.Default.Register(); + } + + public static MainViewVM MainViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + + public static SelectionViewVM SelectionViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + + public static MachineViewVM MachineViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + + public static ConfigurationViewVM ConfigurationViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + + public static DataStoreViewVM DataStoreViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs new file mode 100644 index 000000000..1540a4e67 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.FSE.Common; +using Tango.FSE.Common.AutoComplete; +using Tango.FSE.MachineConfiguration.Messages; + +namespace Tango.FSE.MachineConfiguration.ViewModels +{ + public class ConfigurationViewVM : FSEViewModel + { + private Machine _machine; + public Machine Machine + { + get { return _machine; } + set { _machine = value; RaisePropertyChangedAuto(); } + } + + private List _organizations; + public List Organizations + { + get { return _organizations; } + set { _organizations = value; RaisePropertyChangedAuto(); } + } + + public ConfigurationViewVM() + { + RegisterForMessage(HandleMachineLoadedMessage); + } + + private async void HandleMachineLoadedMessage(MachineLoadedMessage msg) + { + using (NotificationProvider.PushTaskItem("Loading configuration options...")) + { + Machine = msg.Machine; + Organizations = await Services.OrganizationsService.GetCurrentUserOrganizations(); + Machine.Organization = Organizations.SingleOrDefault(x => x.Guid == Machine.OrganizationGuid); + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs new file mode 100644 index 000000000..f321cd061 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.FSE.Common; + +namespace Tango.FSE.MachineConfiguration.ViewModels +{ + public class DataStoreViewVM : FSEViewModel + { + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs new file mode 100644 index 000000000..cbd6c1cf1 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.FSE.Common; +using Tango.FSE.Common.Navigation; +using Tango.FSE.MachineConfiguration.Messages; +using static Tango.FSE.MachineConfiguration.ViewModels.MachineViewVM; + +namespace Tango.FSE.MachineConfiguration.ViewModels +{ + public class MachineViewVM : ConfigurationViewModel, INavigationObjectReceiver + { + public class NavigationObject + { + public String MachineSerialNumber { get; set; } + } + + public enum NavigationView + { + ConfigurationView, + DataStoreView, + } + + private NavigationView _selectedView; + public NavigationView SelectedView + { + get { return _selectedView; } + set + { + _selectedView = value; + RaisePropertyChangedAuto(); + } + } + + private Machine _machine; + public Machine Machine + { + get { return _machine; } + set { _machine = value; RaisePropertyChangedAuto(); } + } + + public void OnNavigatedToWithObject(NavigationObject obj) + { + SelectedView = NavigationView.ConfigurationView; + LoadMachine(obj.MachineSerialNumber); + } + + private async void LoadMachine(String serialNumber) + { + using (NotificationProvider.PushTaskItem("Loading machine configuration...")) + { + Machine = await Services.MachinesService.GetMachineFull(serialNumber); + RaiseMessage(new MachineLoadedMessage() { Machine = Machine }); + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MainViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..efb2fc3cc --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MainViewVM.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.FSE.Common; +using Tango.FSE.Common.Navigation; +using Tango.FSE.MachineConfiguration.Navigation; +using Tango.SharedUI.Helpers; + +namespace Tango.FSE.MachineConfiguration.ViewModels +{ + [ModularNavigationContainer] + public class MainViewVM : ConfigurationViewModel + { + public override void OnApplicationStarted() + { + InvokeUI(() => + { + NavigationManager.MenuItems.Add(new NavigationMenuItem(() => + { + NavigationManager.NavigateTo(); + }) + { + Name = "Configuration", + Index = 8, + Description = "Access to the organization machines configuration and settings", + Image = ResourceHelper.GetImageFromResources("Images/configuration.png"), + }); + }); + } + + public async override Task OnApplicationLogout() + { + while (ModularNavigationManager.CurrentView != ConfigurationView.SelectionView) + { + if (!await ModularNavigationManager.NavigateBack()) + { + return false; + } + } + + return await base.OnApplicationLogout(); + } + + public async override Task OnNavigateBackRequest() + { + if (ModularNavigationManager.CurrentView == ConfigurationView.SelectionView) + { + return await base.OnNavigateBackRequest(); + } + else + { + await ModularNavigationManager.NavigateBack(); + return false; + } + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs new file mode 100644 index 000000000..c62ade6fb --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core.Commands; +using Tango.FSE.Common; +using Tango.FSE.MachineConfiguration.Navigation; + +namespace Tango.FSE.MachineConfiguration.ViewModels +{ + public class SelectionViewVM : ConfigurationViewModel + { + private Machine _selectedMachine; + /// + /// Gets or sets the selected machine. + /// + public Machine SelectedMachine + { + get { return _selectedMachine; } + set { _selectedMachine = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + public RelayCommand ManageMachineCommand { get; set; } + + public SelectionViewVM() + { + ManageMachineCommand = new RelayCommand(ManageSelectedMachine, () => SelectedMachine != null); + } + + private void ManageSelectedMachine() + { + if (SelectedMachine == null) + { + NotificationProvider.ShowError("No machine selected."); + return; + } + + ModularNavigationManager.NavigateTo(ConfigurationView.MachineView, new MachineViewVM.NavigationObject() + { + MachineSerialNumber = SelectedMachine.SerialNumber + }); + } + } +} + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml new file mode 100644 index 000000000..8d8aa7b0e --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml @@ -0,0 +1,115 @@ + + + + + + + + + + + Activate Windows License + + + + License Key + + + + + + Setup Team Viewer + + + + + Activate Disk Protection + + + + + Use Firmware Emulator (Demo Machine) + + + Device Registration + + + + + + Registered: + + + + + Device ID: + + + + + Device Name: + + + + + + + + + + + + + + + Perform Firmware Upgrade + + + + + Force Version Update + + + + + Suspend Version Update + + + + + + + + + Serial Number + + + + + Name + + + + + Organization + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml.cs new file mode 100644 index 000000000..d25948d2c --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.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.FSE.MachineConfiguration.Views +{ + /// + /// Interaction logic for MachineDataStoreView.xaml + /// + public partial class ConfigurationView : UserControl + { + public ConfigurationView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml new file mode 100644 index 000000000..ac26bf445 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml @@ -0,0 +1,16 @@ + + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml.cs new file mode 100644 index 000000000..add553b35 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.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.FSE.MachineConfiguration.Views +{ + /// + /// Interaction logic for MachineDataStoreView.xaml + /// + public partial class DataStoreView : UserControl + { + public DataStoreView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml new file mode 100644 index 000000000..ba9418d5d --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml.cs new file mode 100644 index 000000000..5e4d5ed7d --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.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.FSE.MachineConfiguration.Views +{ + /// + /// Interaction logic for MachineView.xaml + /// + public partial class MachineView : UserControl + { + public MachineView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml new file mode 100644 index 000000000..a321a1bb8 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml.cs new file mode 100644 index 000000000..650c297a4 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MainView.xaml.cs @@ -0,0 +1,31 @@ +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.FSE.MachineConfiguration.Views +{ + /// + /// Interaction logic for MainView.xaml + /// + public partial class MainView : UserControl + { + public static MainView Instance { get; set; } + + public MainView() + { + Instance = this; + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml new file mode 100644 index 000000000..69cebf324 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml @@ -0,0 +1,61 @@ + + + + + Machine Configuration + + The machine configuration module allows you to manage the currently connected machine configuration and other machine settings. + + Given the proper permissions, you will also be able to manage other organization machines. + + + + + + Select Machine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml.cs new file mode 100644 index 000000000..618ae299a --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.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.FSE.MachineConfiguration.Views +{ + /// + /// Interaction logic for MachineSelectionView.xaml + /// + public partial class SelectionView : UserControl + { + public SelectionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/app.config b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/app.config new file mode 100644 index 000000000..36bc04f85 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/app.config @@ -0,0 +1,85 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/packages.config b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/packages.config new file mode 100644 index 000000000..dd8c723e4 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/packages.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/OrganizationSelectionViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/OrganizationSelectionViewVM.cs index 9a84cca7d..0abc285a9 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/OrganizationSelectionViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.UsersAndRoles/ViewModels/OrganizationSelectionViewVM.cs @@ -63,7 +63,7 @@ namespace Tango.FSE.UsersAndRoles.ViewModels try { - return Services.OrganizationsService.GetCurrentUserOrganizations().Result.Where(x => x.Name.ToLower().StartsWith(key.ToLower())).Take(4).ToList(); + return Services.OrganizationsService.GetCurrentUserOrganizations().Result.Where(x => x.Name.ToLower().StartsWith(key.ToLower())).ToList(); } catch (Exception ex) { diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml index 24c4e91ec..8d5e5ae0d 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml @@ -3,6 +3,7 @@ xmlns:editors="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:actions="clr-namespace:Tango.FSE.Common.EventTriggerActions" xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:wpf="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" @@ -821,4 +822,83 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index 6c5b993b5..1434e13cd 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -716,6 +716,10 @@ {ac5b4be7-d607-4a38-98f8-b87aca468313} Tango.FSE.Insights + + {15bcb5bb-731e-4e2d-aa28-75485050a8dc} + Tango.FSE.MachineConfiguration + {866b916a-207c-43f0-b403-7c4a820c2e11} Tango.FSE.PPCConsole -- cgit v1.3.1 From d6db3244c15e3937d339064da0a5c7186f32daa1 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 9 Nov 2020 07:00:47 +0200 Subject: Working on machine configuration. --- .../Messages/EditingCompositionLoadedMessage.cs | 16 ++ .../Messages/MachineLoadedMessage.cs | 14 -- .../Tango.FSE.MachineConfiguration.csproj | 2 +- .../ViewModels/ConfigurationViewVM.cs | 85 ++++++-- .../ViewModels/MachineViewVM.cs | 19 +- .../ViewModels/MainViewVM.cs | 2 +- .../ViewModels/SelectionViewVM.cs | 19 +- .../Views/ConfigurationView.xaml | 234 ++++++++++++++------- .../Views/MachineView.xaml | 4 +- .../FSE/Tango.FSE.BL/FSEServicesContainer.cs | 6 + .../Services/MachineConfigurationService.cs | 88 ++++++++ .../FSE/Tango.FSE.BL/Tango.FSE.BL.csproj | 1 + .../Connection/IMachineProvider.cs | 2 +- .../FSE/Tango.FSE.Common/Controls/MachineView.xaml | 12 +- .../FSE/Tango.FSE.Common/Resources/Styles.xaml | 197 +++++++++++++++-- .../Connection/DefaultMachineProvider.cs | 1 + .../DefaultFileAssociationProvider.cs | 5 + .../Tango.BL/Entities/HardwareVersion.cs | 11 + 18 files changed, 578 insertions(+), 140 deletions(-) create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/EditingCompositionLoadedMessage.cs delete mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/MachineLoadedMessage.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.BL/Services/MachineConfigurationService.cs (limited to 'Software/Visual_Studio/FSE') diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/EditingCompositionLoadedMessage.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/EditingCompositionLoadedMessage.cs new file mode 100644 index 000000000..b858c34e0 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/EditingCompositionLoadedMessage.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.FSE.BL.Services; +using static Tango.FSE.BL.Services.MachineConfigurationService; + +namespace Tango.FSE.MachineConfiguration.Messages +{ + public class EditingCompositionLoadedMessage + { + public MachineEditingComposition EditingComposition { get; set; } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/MachineLoadedMessage.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/MachineLoadedMessage.cs deleted file mode 100644 index 4a703b2a9..000000000 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Messages/MachineLoadedMessage.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Entities; - -namespace Tango.FSE.MachineConfiguration.Messages -{ - public class MachineLoadedMessage - { - public Machine Machine { get; set; } - } -} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj index e7adc1d3f..c5aa8c4bf 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj @@ -79,7 +79,7 @@ - + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs index 1540a4e67..63e3f22d9 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs @@ -4,41 +4,96 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; +using Tango.Core.Commands; +using Tango.Core.DI; using Tango.FSE.Common; using Tango.FSE.Common.AutoComplete; +using Tango.FSE.Common.SQL; using Tango.FSE.MachineConfiguration.Messages; +using static Tango.FSE.BL.Services.MachineConfigurationService; namespace Tango.FSE.MachineConfiguration.ViewModels { public class ConfigurationViewVM : FSEViewModel { - private Machine _machine; - public Machine Machine + [TangoInject] + private IRemoteSqlProvider RemoteSqlProvider { get; set; } + + private MachineEditingComposition _editingComposition; + public MachineEditingComposition EditingComposition { - get { return _machine; } - set { _machine = value; RaisePropertyChangedAuto(); } + get { return _editingComposition; } + set { _editingComposition = value; RaisePropertyChangedAuto(); } } - private List _organizations; - public List Organizations + public RelayCommand SaveCommand { get; set; } + public RelayCommand ResetCountersCommand { get; set; } + public RelayCommand ResetDeviceRegistrationCommand { get; set; } + + + public ConfigurationViewVM() { - get { return _organizations; } - set { _organizations = value; RaisePropertyChangedAuto(); } + RegisterForMessage(OnEditingCompositionLoaded); + SaveCommand = new RelayCommand(SaveConfiguration); + ResetCountersCommand = new RelayCommand(ResetCounters); + ResetDeviceRegistrationCommand = new RelayCommand(ResetDeviceRegistration); } - public ConfigurationViewVM() + private void OnEditingCompositionLoaded(EditingCompositionLoadedMessage msg) { - RegisterForMessage(HandleMachineLoadedMessage); + using (NotificationProvider.PushTaskItem("Loading machine configuration...")) + { + EditingComposition = msg.EditingComposition; + } } - private async void HandleMachineLoadedMessage(MachineLoadedMessage msg) + private async void SaveConfiguration() { - using (NotificationProvider.PushTaskItem("Loading configuration options...")) + using (NotificationProvider.PushTaskItem("Saving machine configuration...")) { - Machine = msg.Machine; - Organizations = await Services.OrganizationsService.GetCurrentUserOrganizations(); - Machine.Organization = Organizations.SingleOrDefault(x => x.Guid == Machine.OrganizationGuid); + EditingComposition = await Services.MachineConfigurationService.SaveMachineEditingComposition(EditingComposition); + await NotificationProvider.ShowSuccess("Machine configuration saved successfully."); } } + + private async void ResetCounters() + { + if (!MachineProvider.IsPPCAvailable) + { + await NotificationProvider.ShowError("Resetting the machine counters requires an active connection to this machine."); + return; + } + + if (!await NotificationProvider.ShowWarningQuestion("Resetting the machine counters will delete the entire job runs history. Are you sure?", "RESET COUNTERS", "CANCEL")) return; + + using (var task = NotificationProvider.PushTaskItem("Resetting machine counters...")) + { + task.UpdateProgress("Resetting local machine counters..."); + + var result = await RemoteSqlProvider.ExecuteSqlCommandAsync(new RemoteSqlCommand() + { + Mode = RemoteSqlCommandMode.Local, + Timeout = 30, + SQL = "DELETE FROM JOB_RUNS" + }); + + int localJobRuns = result.LocalAffectedRecords; + + task.UpdateProgress("Resetting global machine counters..."); + + int remoteJobRuns = await Services.MachineConfigurationService.ResetCounters(EditingComposition.Machine.Guid); + + await NotificationProvider.ShowSuccess("Machine counters deleted successfully."); + } + } + + private async void ResetDeviceRegistration() + { + if (!await NotificationProvider.ShowWarningQuestion("Resetting the machine's device registration will allow other panel PCs to perform a machine setup for this machine. Are you sure?", "RESET", "CANCEL")) return; + + EditingComposition.Machine.IsDeviceRegistered = false; + EditingComposition.Machine.DeviceId = null; + EditingComposition.Machine.DeviceName = null; + } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs index cbd6c1cf1..24a0cbc42 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs @@ -7,6 +7,7 @@ using Tango.BL.Entities; using Tango.FSE.Common; using Tango.FSE.Common.Navigation; using Tango.FSE.MachineConfiguration.Messages; +using static Tango.FSE.BL.Services.MachineConfigurationService; using static Tango.FSE.MachineConfiguration.ViewModels.MachineViewVM; namespace Tango.FSE.MachineConfiguration.ViewModels @@ -15,7 +16,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels { public class NavigationObject { - public String MachineSerialNumber { get; set; } + public String MachineGuid { get; set; } } public enum NavigationView @@ -35,25 +36,25 @@ namespace Tango.FSE.MachineConfiguration.ViewModels } } - private Machine _machine; - public Machine Machine + private MachineEditingComposition _editingComposition; + public MachineEditingComposition EditingComposition { - get { return _machine; } - set { _machine = value; RaisePropertyChangedAuto(); } + get { return _editingComposition; } + set { _editingComposition = value; RaisePropertyChangedAuto(); } } public void OnNavigatedToWithObject(NavigationObject obj) { SelectedView = NavigationView.ConfigurationView; - LoadMachine(obj.MachineSerialNumber); + LoadMachine(obj.MachineGuid); } - private async void LoadMachine(String serialNumber) + private async void LoadMachine(String machineGuid) { using (NotificationProvider.PushTaskItem("Loading machine configuration...")) { - Machine = await Services.MachinesService.GetMachineFull(serialNumber); - RaiseMessage(new MachineLoadedMessage() { Machine = Machine }); + EditingComposition = await Services.MachineConfigurationService.GetMachineEditingComposition(machineGuid); + RaiseMessage(new EditingCompositionLoadedMessage() { EditingComposition = EditingComposition }); } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MainViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MainViewVM.cs index efb2fc3cc..5b8ca21ac 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MainViewVM.cs @@ -14,7 +14,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels [ModularNavigationContainer] public class MainViewVM : ConfigurationViewModel { - public override void OnApplicationStarted() + public override void OnApplicationReady() { InvokeUI(() => { diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs index c62ade6fb..b65ad7102 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs @@ -39,9 +39,26 @@ namespace Tango.FSE.MachineConfiguration.ViewModels ModularNavigationManager.NavigateTo(ConfigurationView.MachineView, new MachineViewVM.NavigationObject() { - MachineSerialNumber = SelectedMachine.SerialNumber + MachineGuid = SelectedMachine.Guid }); } + + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + + if (SelectedMachine == null && MachineProvider.Machine != null) + { + SelectedMachine = MachineProvider.Machine; + } + } + + public override Task OnApplicationLogout() + { + ModularNavigationManager.NavigateTo(ConfigurationView.SelectionView); + SelectedMachine = null; + return base.OnApplicationLogout(); + } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml index 8d8aa7b0e..9c8b2d878 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml @@ -5,111 +5,191 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.FSE.MachineConfiguration.Views" xmlns:global="clr-namespace:Tango.FSE.MachineConfiguration" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:vm="clr-namespace:Tango.FSE.MachineConfiguration.ViewModels" + xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" xmlns:commonControls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" xmlns:resolution="clr-namespace:Tango.FSE.Common.Resolution;assembly=Tango.FSE.Common" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" mc:Ignorable="d" - d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:ConfigurationViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.ConfigurationViewVM}" d:DesignStyle="{StaticResource FSE_User_Control_Designer}"> - + d:DesignHeight="2000" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:ConfigurationViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.ConfigurationViewVM}" d:DesignStyle="{StaticResource FSE_User_Control_Designer}"> - - + - - - - - Activate Windows License - + - - License Key - - + + + + + - - - Setup Team Viewer - + - - - Activate Disk Protection - + - - - Use Firmware Emulator (Demo Machine) - - - Device Registration + + + + + Activate Windows License + + + + License Key + + + + + + Setup Team Viewer + + + + + Activate Disk Protection + + + + + Use Firmware Emulator (Demo Machine) + + + + - - + Device Registration - + + + + Registered: - - + + - + Device ID: - - + + - + Device Name: - - - + + + - - - - - - - - - - - Perform Firmware Upgrade - + + + - - - Force Version Update - + - - - Suspend Version Update - - - + - - + Machine Counters - - Serial Number - - + + + + + Total Dye Time: + + - - Name - + + Total Dye Meters: + + + + + + + + + + + + + + Perform Firmware Upgrade + + + + + Force Version Update + - - Organization - + + + Suspend Version Update + - - - + + + + + + + Serial Number + + + + + Name + + + + + Organization + + + + + Site + + + + + + + + + Head Type + + + + + Hardware Version + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml index ba9418d5d..9f81f82e4 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml @@ -29,8 +29,8 @@ - - + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs b/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs index e5487bc1e..14b74fd9c 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs @@ -62,6 +62,11 @@ namespace Tango.FSE.BL /// public OrganizationsService OrganizationsService { get; set; } + /// + /// Gets or sets the machine configuration service. + /// + public MachineConfigurationService MachineConfigurationService { get; set; } + /// /// Initializes a new instance of the class. /// @@ -78,6 +83,7 @@ namespace Tango.FSE.BL PublishedProcedureProjectsService = new PublishedProcedureProjectsService(); MachineEventsService = new MachineEventsService(); OrganizationsService = new OrganizationsService(); + MachineConfigurationService = new MachineConfigurationService(); } } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/MachineConfigurationService.cs b/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/MachineConfigurationService.cs new file mode 100644 index 000000000..e6798e197 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/MachineConfigurationService.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; +using System.Data.Entity; +using Tango.BL.Builders; + +namespace Tango.FSE.BL.Services +{ + public class MachineConfigurationService : FSEServiceBase + { + public class MachineEditingComposition : IDisposable + { + public Machine Machine { get; set; } + public List Organizations { get; set; } + public List HardwareVersions { get; set; } + public String TotalDyeTime { get; set; } + public String TotalDyeMeters { get; set; } + internal ObservablesContext Context { get; set; } + + public MachineEditingComposition() + { + Organizations = new List(); + HardwareVersions = new List(); + } + + public void Dispose() + { + Context?.Dispose(); + Context = null; + } + } + + public Task GetMachineEditingComposition(String machineGuid) + { + return Task.Factory.StartNew(() => + { + ObservablesContext db = ObservablesContext.CreateDefault(); + + MachineEditingComposition composition = new MachineEditingComposition(); + + //Organizations + bool allowAll = CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_ManageAllOrganizationsUsersAndRoles); + composition.Organizations = db.Organizations.Where(x => allowAll || x.Guid == CurrentUser.OrganizationGuid).Include(x => x.Sites).ToList(); + + //Machine + composition.Machine = new MachineBuilder(db).Set(machineGuid).WithConfiguration().Build(); + + //Hardware Versions + composition.HardwareVersions = db.HardwareVersions.OrderByDescending(x => x.Version).ToList(); + + //Counters + var jobRuns = db.JobRuns.Where(x => x.MachineGuid == machineGuid).Select(x => new { x.StartDate, x.EndDate, x.EndPosition }).ToList(); + composition.TotalDyeTime = TimeSpan.FromHours(jobRuns.Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToStringUnlimitedHours(); + int meters = (int)jobRuns.Select(x => x.EndPosition).Sum(); + composition.TotalDyeMeters = $"{meters.ToString("N0")} meters"; + + composition.Context = db; + + return composition; + }); + } + + public Task SaveMachineEditingComposition(MachineEditingComposition composition) + { + return Task.Factory.StartNew(() => + { + composition.Context.SaveChanges(); + composition.Context.Dispose(); + return GetMachineEditingComposition(composition.Machine.Guid).Result; + }); + } + + public Task ResetCounters(String machineGuid) + { + return Task.Factory.StartNew(() => + { + using (ObservablesContext db = new ObservablesContext()) + { + return db.JobRuns.Where(x => x.MachineGuid == machineGuid).DeleteFromQuery(); + } + }); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj b/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj index 39257df86..fba87644b 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj @@ -119,6 +119,7 @@ + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Connection/IMachineProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/Connection/IMachineProvider.cs index 9a98477b8..8c4512c41 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Connection/IMachineProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Connection/IMachineProvider.cs @@ -41,7 +41,7 @@ namespace Tango.FSE.Common.Connection MachineConnectionTypes ConnectionType { get; } /// - /// Gets a value indicating whether the equals or . + /// Gets a value indicating whether the machine is connected and the equals or . /// bool IsPPCAvailable { get; } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/MachineView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/MachineView.xaml index c37613e3e..8d375cc6d 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/MachineView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/MachineView.xaml @@ -47,11 +47,11 @@ - Hardware + 1 @@ -217,17 +217,17 @@ - Mid Tanks + - Cartridges + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml index 8d5e5ae0d..2b7ea3640 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml @@ -9,6 +9,8 @@ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:local="clr-namespace:Tango.FSE.Common.Resources"> + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs index 94b035ab5..aad63fdf9 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Connection/DefaultMachineProvider.cs @@ -342,6 +342,7 @@ namespace Tango.FSE.UI.Connection { IsConnected = false; IsBusy = false; + Machine = null; OnMachineDisconnected(MachineOperator, null); } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/FileAssociation/DefaultFileAssociationProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileAssociation/DefaultFileAssociationProvider.cs index 0d582cb11..89364cbbd 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/FileAssociation/DefaultFileAssociationProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileAssociation/DefaultFileAssociationProvider.cs @@ -19,6 +19,7 @@ namespace Tango.FSE.UI.FileAssociation { private Dictionary> _handlers; private IpcServer _ipcServer; + private bool _initialized; public const string FILE_ASSOCIATION_PREFIX = "-file"; public const int FILE_ASSOCIATION_ARGS_COUNT = 3; @@ -44,6 +45,10 @@ namespace Tango.FSE.UI.FileAssociation public async void OnApplicationReady(IFSEApplicationManager applicationManager) { + if (!_initialized) return; + + _initialized = true; + try { LogManager.Log("Starting file association IPC service..."); diff --git a/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs index 590fe9e13..bc65c33ce 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/HardwareVersion.cs @@ -109,5 +109,16 @@ namespace Tango.BL.Entities { } + + /// + /// Returns a that represents this instance. + /// + /// + /// A that represents this instance. + /// + public override string ToString() + { + return FullName; + } } } -- cgit v1.3.1 From 775f0015321f91aa5be3aca079e289e89d4719f5 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 10 Nov 2020 11:06:48 +0200 Subject: DataStore editing.. --- .../Converters/DataStoreValueToStringConverter.cs | 32 ++++++ .../Tango.FSE.MachineConfiguration.csproj | 17 +++ .../ViewModels/DataStoreViewVM.cs | 74 +++++++++++- .../Views/DataStoreView.xaml | 66 ++++++++++- .../FSE/Tango.FSE.BL/FSEServicesContainer.cs | 6 + .../FSE/Tango.FSE.BL/Services/DataStoreService.cs | 36 ++++++ .../FSE/Tango.FSE.BL/Tango.FSE.BL.csproj | 9 ++ .../DataStore/IDataStoreProvider.cs | 14 +++ .../DataStore/IRemoteDataStoreManager.cs | 2 +- .../FSE/Tango.FSE.Common/Tango.FSE.Common.csproj | 5 + .../DataStore/DefaultDataStoreProvider.cs | 124 +++++++++++++++++++++ .../FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 9 ++ .../FSE/Tango.FSE.UI/ViewModelLocator.cs | 2 + .../DataStore/DefaultDataStoreService.cs | 29 +++++ .../PPC/Tango.PPC.Common/Tango.PPC.Common.csproj | 2 +- .../Tango.DataStore.Editing/CustomControl1.cs | 25 +++++ .../DataStoreCollectionModel.cs | 21 ++++ .../Tango.DataStore.Editing/DataStoreItemModel.cs | 89 +++++++++++++++ .../Tango.DataStore.Editing/DataStoreModel.cs | 20 ++++ .../Properties/AssemblyInfo.cs | 55 +++++++++ .../Properties/Resources.Designer.cs | 62 +++++++++++ .../Properties/Resources.resx | 117 +++++++++++++++++++ .../Properties/Settings.Designer.cs | 30 +++++ .../Properties/Settings.settings | 7 ++ .../Tango.DataStore.Editing.csproj | 100 +++++++++++++++++ .../Tango.DataStore.Editing/Themes/Generic.xaml | 18 +++ .../RemoteDataStoreCollection.cs | 19 ++++ .../RemoteDataStoreGetAllItemsRequest.cs | 12 ++ .../RemoteDataStoreGetAllItemsResponse.cs | 18 +++ .../Tango.DataStore.Remote.csproj | 3 + .../Tango.DataStore/DataStoreHelper.cs | 4 +- Software/Visual_Studio/Tango.sln | 34 +++++- 32 files changed, 1047 insertions(+), 14 deletions(-) create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Converters/DataStoreValueToStringConverter.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.BL/Services/DataStoreService.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.Common/DataStore/IDataStoreProvider.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/CustomControl1.cs create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/DataStoreCollectionModel.cs create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/DataStoreItemModel.cs create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/DataStoreModel.cs create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/Properties/Resources.resx create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/Properties/Settings.settings create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/Tango.DataStore.Editing.csproj create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/Themes/Generic.xaml create mode 100644 Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCollection.cs create mode 100644 Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsRequest.cs create mode 100644 Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsResponse.cs (limited to 'Software/Visual_Studio/FSE') diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Converters/DataStoreValueToStringConverter.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Converters/DataStoreValueToStringConverter.cs new file mode 100644 index 000000000..6b3c8e28c --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Converters/DataStoreValueToStringConverter.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using Tango.DataStore; + +namespace Tango.FSE.MachineConfiguration.Converters +{ + public class DataStoreValueToStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is IDataStoreItem item) + { + if (item != null) + { + return DataStoreHelper.FormatDataStoreItem(item); + } + } + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj index c5aa8c4bf..af67b0d74 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj @@ -79,6 +79,7 @@ + @@ -143,6 +144,22 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core + + {ee088ff7-04d1-41fb-9d6a-cedeee7a7b9c} + Tango.DataStore.Editing + + + {88d9906b-8fc4-4fe0-b7eb-127a0a8fcee4} + Tango.DataStore.EF + + + {29448f3c-9b3e-4da6-8555-46a8b9a6b3aa} + Tango.DataStore.Remote + + + {e0364dfa-0721-4637-9d32-9d22aac109d6} + Tango.DataStore + {4206ac58-3b57-4699-8835-90bf6db01a61} Tango.Integration diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs index f321cd061..4a75c137b 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs @@ -3,11 +3,83 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core.DI; +using Tango.DataStore.Editing; using Tango.FSE.Common; +using Tango.FSE.Common.DataStore; +using Tango.FSE.MachineConfiguration.Messages; +using static Tango.SharedUI.Controls.NavigationControl; namespace Tango.FSE.MachineConfiguration.ViewModels { - public class DataStoreViewVM : FSEViewModel + public class DataStoreViewVM : FSEViewModel, INavigationViewModel { + private String machineGuid; + + [TangoInject] + private IDataStoreProvider DataStoreProvider { get; set; } + + private DataStoreModel _dataStore; + public DataStoreModel DataStore + { + get { return _dataStore; } + set { _dataStore = value; RaisePropertyChangedAuto(); } + } + + private DataStoreCollectionModel _selectedCollection; + public DataStoreCollectionModel SelectedCollection + { + get { return _selectedCollection; } + set { _selectedCollection = value; RaisePropertyChangedAuto(); } + } + + private DataStoreItemModel _selectedItem; + public DataStoreItemModel SelectedItem + { + get { return _selectedItem; } + set { _selectedItem = value; RaisePropertyChangedAuto(); } + } + + private bool _isLoading; + public bool IsLoading + { + get { return _isLoading; } + set { _isLoading = value; RaisePropertyChangedAuto(); } + } + + public DataStoreViewVM() + { + RegisterForMessage(OnEditingCompositionLoaded); + } + + private void OnEditingCompositionLoaded(EditingCompositionLoadedMessage obj) + { + DataStore = null; + machineGuid = obj.EditingComposition.Machine.Guid; + } + + public async override void OnNavigatedTo() + { + base.OnNavigatedTo(); + + if (DataStore == null) + { + try + { + IsLoading = true; + IsFree = false; + DataStore = await DataStoreProvider.GetDataStoreModel(machineGuid); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error loading data store."); + } + finally + { + IsLoading = false; + IsFree = true; + } + } + } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml index ac26bf445..f078efcee 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml @@ -6,11 +6,71 @@ xmlns:local="clr-namespace:Tango.FSE.MachineConfiguration.Views" xmlns:global="clr-namespace:Tango.FSE.MachineConfiguration" xmlns:vm="clr-namespace:Tango.FSE.MachineConfiguration.ViewModels" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:commonControls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" xmlns:resolution="clr-namespace:Tango.FSE.Common.Resolution;assembly=Tango.FSE.Common" + xmlns:converters="clr-namespace:Tango.FSE.MachineConfiguration.Converters" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:DataStoreViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.DataStoreViewVM}"> - - + d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:DataStoreViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.DataStoreViewVM}" d:DesignStyle="{StaticResource FSE_User_Control_Designer}"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs b/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs index 14b74fd9c..c8773eccd 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/FSEServicesContainer.cs @@ -67,6 +67,11 @@ namespace Tango.FSE.BL /// public MachineConfigurationService MachineConfigurationService { get; set; } + /// + /// Gets or sets the data store service. + /// + public DataStoreService DataStoreService { get; set; } + /// /// Initializes a new instance of the class. /// @@ -84,6 +89,7 @@ namespace Tango.FSE.BL MachineEventsService = new MachineEventsService(); OrganizationsService = new OrganizationsService(); MachineConfigurationService = new MachineConfigurationService(); + DataStoreService = new DataStoreService(); } } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/DataStoreService.cs b/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/DataStoreService.cs new file mode 100644 index 000000000..41ab7725b --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/Services/DataStoreService.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; +using Tango.DataStore; + +namespace Tango.FSE.BL.Services +{ + public class DataStoreService : FSEServiceBase + { + public Task> GetGlobalDataStoreItems() + { + return Task.Factory.StartNew>(() => + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + return db.GlobalDataStoreItems.ToList().OrderBy(x => x.CollectionName).OrderBy(x => x.Key).ToList(); + } + }); + } + + public Task> GetMachinelDataStoreItems(String machineGuid) + { + return Task.Factory.StartNew>(() => + { + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + return db.DataStoreItems.Where(x => x.MachineGuid == machineGuid).ToList().OrderBy(x => x.CollectionName).OrderBy(x => x.Key).ToList(); + } + }); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj b/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj index fba87644b..d15611e91 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj @@ -119,6 +119,7 @@ + @@ -146,6 +147,14 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core + + {88d9906b-8fc4-4fe0-b7eb-127a0a8fcee4} + Tango.DataStore.EF + + + {e0364dfa-0721-4637-9d32-9d22aac109d6} + Tango.DataStore + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} Tango.Logging diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/DataStore/IDataStoreProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/DataStore/IDataStoreProvider.cs new file mode 100644 index 000000000..bab513e36 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/DataStore/IDataStoreProvider.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DataStore.Editing; + +namespace Tango.FSE.Common.DataStore +{ + public interface IDataStoreProvider + { + Task GetDataStoreModel(String machineGuid); + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/DataStore/IRemoteDataStoreManager.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/DataStore/IRemoteDataStoreManager.cs index 02cc3ac9d..162c109be 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/DataStore/IRemoteDataStoreManager.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/DataStore/IRemoteDataStoreManager.cs @@ -9,6 +9,6 @@ namespace Tango.FSE.Common.DataStore { public interface IRemoteDataStoreManager : IDataStoreManager { - + } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index 4f0cb622b..bb44045b7 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -188,6 +188,7 @@ + @@ -505,6 +506,10 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core + + {ee088ff7-04d1-41fb-9d6a-cedeee7a7b9c} + Tango.DataStore.Editing + {e0364dfa-0721-4637-9d32-9d22aac109d6} Tango.DataStore diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs new file mode 100644 index 000000000..6239a33d9 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core.DI; +using Tango.DataStore; +using Tango.DataStore.Editing; +using Tango.DataStore.Remote; +using Tango.FSE.BL; +using Tango.FSE.Common.Connection; +using Tango.FSE.Common.DataStore; + +namespace Tango.FSE.UI.DataStore +{ + public class DefaultDataStoreProvider : IDataStoreProvider + { + [TangoInject] + private IMachineProvider MachineProvider { get; set; } + + [TangoInject] + private FSEServicesContainer Services { get; set; } + + public Task GetDataStoreModel(String machineGuid) + { + return Task.Factory.StartNew(() => + { + DataStoreModel model = new DataStoreModel(); + + List globalItems = Services.DataStoreService.GetGlobalDataStoreItems().Result; + List localItems = Services.DataStoreService.GetMachinelDataStoreItems(machineGuid).Result; + + List itemsModels = new List(); + + //Get machine items from db. + foreach (var collection in localItems.GroupBy(x => x.CollectionName)) + { + DataStoreCollectionModel collectionModel = new DataStoreCollectionModel(); + collectionModel.Name = collection.First().CollectionName; + + foreach (var item in collection) + { + GlobalDataStoreItem globalItem = globalItems.FirstOrDefault(x => x.CollectionName == item.CollectionName && x.Key == item.Key); + + if (globalItem != null) + { + globalItems.Remove(globalItem); + } + + DataStoreItemModel itemModel = DataStoreItemModel.FromLocalDataStoreItem(item.ToDataStoreItem(), globalItem?.ToDataStoreItem()); + collectionModel.Items.Add(itemModel); + } + + model.Collections.Add(collectionModel); + } + + //Get machine items from connected machine. + if (MachineProvider.IsPPCAvailable) + { + var response = MachineProvider.MachineOperator.SendGenericRequest(new RemoteDataStoreGetAllItemsRequest(), new Transport.TransportRequestConfig() { Timeout = TimeSpan.FromSeconds(30) }).Result; + + foreach (var collection in response.Collections) + { + DataStoreCollectionModel collectionModel = model.Collections.FirstOrDefault(x => x.Name == collection.Name); + + if (collectionModel == null) + { + collectionModel = new DataStoreCollectionModel(); + collectionModel.Name = collection.Name; + model.Collections.Add(collectionModel); + } + + foreach (var remoteItem in collection.Items) + { + var localItem = collectionModel.Items.FirstOrDefault(x => x.Key == remoteItem.Key); + + if (localItem != null && remoteItem.Date > localItem.Date) + { + localItem.Value = remoteItem.Value; + localItem.Type = remoteItem.Type; + localItem.Date = remoteItem.Date; + } + else if (localItem == null) + { + GlobalDataStoreItem globalItem = globalItems.FirstOrDefault(x => x.CollectionName == collection.Name && x.Key == remoteItem.Key); + + if (globalItem != null) + { + globalItems.Remove(globalItem); + } + + DataStoreItemModel itemModel = DataStoreItemModel.FromLocalDataStoreItem(remoteItem, globalItem?.ToDataStoreItem()); + collectionModel.Items.Add(itemModel); + } + + } + } + } + + //Get global items without overrides from db. + foreach (var collection in globalItems.GroupBy(x => x.CollectionName)) + { + DataStoreCollectionModel collectionModel = model.Collections.FirstOrDefault(x => x.Name == collection.First().CollectionName); + + if (collectionModel == null) + { + collectionModel = new DataStoreCollectionModel(); + collectionModel.Name = collection.First().CollectionName; + model.Collections.Add(collectionModel); + } + + foreach (var item in collection) + { + DataStoreItemModel itemModel = DataStoreItemModel.FromGlobalDataStoreItem(item.ToDataStoreItem()); + collectionModel.Items.Add(itemModel); + } + } + + return model; + }); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index 1434e13cd..baff92208 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -261,6 +261,7 @@ + @@ -640,6 +641,14 @@ {38197109-8610-4d3f-92b9-16d48df94d7c} Tango.DAL.Remote + + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C} + Tango.DataStore.Editing + + + {88d9906b-8fc4-4fe0-b7eb-127a0a8fcee4} + Tango.DataStore.EF + {29448f3c-9b3e-4da6-8555-46a8b9a6b3aa} Tango.DataStore.Remote diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs index fd514b7ac..e9d18d777 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs @@ -117,6 +117,7 @@ namespace Tango.FSE.UI TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); TangoIOC.Default.Unregister(); + TangoIOC.Default.Unregister(); //TangoIOC.Default.Unregister(); //TangoIOC.Default.Unregister(); //TangoIOC.Default.Unregister(); @@ -160,6 +161,7 @@ namespace Tango.FSE.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); + TangoIOC.Default.Register(); TangoIOC.Default.Register(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs index ddc0f6cdb..7c8cf4158 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs @@ -17,6 +17,7 @@ using Tango.PPC.Common.ExternalBridge; using Tango.Transport; using Tango.Core.ExtensionMethods; using Newtonsoft.Json.Linq; +using Tango.BL; namespace Tango.PPC.Common.DataStore { @@ -132,6 +133,34 @@ namespace Tango.PPC.Common.DataStore }, token); } + [ExternalBridgeRequestHandlerMethod(typeof(RemoteDataStoreGetAllItemsRequest), RequestHandlerLoggingMode.LogRequestName)] + public async Task RemoteDataStoreGetAllItemsRequest(RemoteDataStoreGetAllItemsRequest request, String token, ExternalBridgeReceiver receiver) + { + List collections = new List(); + + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var items = db.DataStoreItems.ToList(); + + foreach (var itemsGroup in items.GroupBy(x => x.CollectionName)) + { + RemoteDataStoreCollection collection = new RemoteDataStoreCollection(); + collection.Name = itemsGroup.First().CollectionName; + collections.Add(collection); + + foreach (var item in itemsGroup) + { + collection.Items.Add(CreateRemoteItem(item.ToDataStoreItem())); + } + } + } + + await receiver.SendGenericResponse(new RemoteDataStoreGetAllItemsResponse() + { + Collections = collections + }, token); + } + private RemoteDataStoreItem CreateRemoteItem(IDataStoreItem item) { RemoteDataStoreItem remote = new RemoteDataStoreItem(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index 0a6e57f5d..3d7f11809 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -511,7 +511,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/CustomControl1.cs b/Software/Visual_Studio/Tango.DataStore.Editing/CustomControl1.cs new file mode 100644 index 000000000..fab0127e8 --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Editing/CustomControl1.cs @@ -0,0 +1,25 @@ +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.DataStore.Editing +{ + public class CustomControl1 : Control + { + static CustomControl1() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl1), new FrameworkPropertyMetadata(typeof(CustomControl1))); + } + } +} diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreCollectionModel.cs b/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreCollectionModel.cs new file mode 100644 index 000000000..a5c9ba4a7 --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreCollectionModel.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.DataStore.Editing +{ + public class DataStoreCollectionModel : ExtendedObject + { + public String Name { get; set; } + public ObservableCollection Items { get; set; } + + public DataStoreCollectionModel() + { + Items = new ObservableCollection(); + } + } +} diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreItemModel.cs b/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreItemModel.cs new file mode 100644 index 000000000..36dd44f22 --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreItemModel.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.DataStore.Editing +{ + public class DataStoreItemModel : ExtendedObject, IDataStoreItem + { + public IDataStoreItem GlobalItem { get; set; } + + private Object _value; + public Object Value + { + get { return _value; } + set { _value = value; RaisePropertyChangedAuto(); EditingValue = value; } + } + + private Object _editingValue; + public Object EditingValue + { + get { return _editingValue; } + set { _editingValue = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasDifference)); } + } + + public bool HasDifference + { + get { return EditingValue != Value || (IsGlobal && GlobalItem.Value != Value); } + } + + public string Guid { get; set; } + public string Key { get; set; } + public DataType Type { get; set; } + public DateTime Date { get; set; } + public bool IsGlobal { get; set; } + public bool IsSynchronized { get; set; } + + public void Apply() + { + Value = EditingValue; + } + + public static DataStoreItemModel FromLocalDataStoreItem(IDataStoreItem local, IDataStoreItem globalItem) + { + DataStoreItemModel model = new DataStoreItemModel(); + + model.Value = local.Value; + model.Guid = local.Guid; + model.Key = local.Key; + model.Type = local.Type; + model.Date = local.Date; + model.IsGlobal = false; + model.IsSynchronized = local.IsSynchronized; + + model.GlobalItem = globalItem; + + return model; + } + + public static DataStoreItemModel FromGlobalDataStoreItem(IDataStoreItem global) + { + DataStoreItemModel model = new DataStoreItemModel(); + + model.GlobalItem = global; + model.Guid = global.Guid; + model.Key = global.Key; + model.Type = global.Type; + model.Date = global.Date; + model.IsGlobal = true; + model.IsSynchronized = global.IsSynchronized; + + return model; + } + + public override string ToString() + { + if (!IsGlobal) + { + return DataStoreHelper.FormatDataStoreItem(this); + } + else + { + return null; + } + } + } +} diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreModel.cs b/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreModel.cs new file mode 100644 index 000000000..a68cc0af9 --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreModel.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; + +namespace Tango.DataStore.Editing +{ + public class DataStoreModel : ExtendedObject + { + public ObservableCollection Collections { get; set; } + + public DataStoreModel() + { + Collections = new ObservableCollection(); + } + } +} diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.DataStore.Editing/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..9f04af8ea --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Editing/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.DataStore.Editing")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.DataStore.Editing")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[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 +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the 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/Tango.DataStore.Editing/Properties/Resources.Designer.cs b/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Resources.Designer.cs new file mode 100644 index 000000000..c23f8f4eb --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Editing/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.DataStore.Editing.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.DataStore.Editing.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/Tango.DataStore.Editing/Properties/Resources.resx b/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Editing/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/Tango.DataStore.Editing/Properties/Settings.Designer.cs b/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Settings.Designer.cs new file mode 100644 index 000000000..28f49dcd4 --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Editing/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.DataStore.Editing.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/Tango.DataStore.Editing/Properties/Settings.settings b/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/Tango.DataStore.Editing.csproj b/Software/Visual_Studio/Tango.DataStore.Editing/Tango.DataStore.Editing.csproj new file mode 100644 index 000000000..98df18ac3 --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Editing/Tango.DataStore.Editing.csproj @@ -0,0 +1,100 @@ + + + + + Debug + AnyCPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C} + library + Tango.DataStore.Editing + Tango.DataStore.Editing + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + Code + + + + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {e0364dfa-0721-4637-9d32-9d22aac109d6} + Tango.DataStore + + + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} + Tango.SharedUI + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/Themes/Generic.xaml b/Software/Visual_Studio/Tango.DataStore.Editing/Themes/Generic.xaml new file mode 100644 index 000000000..795842292 --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Editing/Themes/Generic.xaml @@ -0,0 +1,18 @@ + + + diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCollection.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCollection.cs new file mode 100644 index 000000000..e4453fafc --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCollection.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreCollection + { + public String Name { get; set; } + public List Items { get; set; } + + public RemoteDataStoreCollection() + { + Items = new List(); + } + } +} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsRequest.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsRequest.cs new file mode 100644 index 000000000..a285cd5c1 --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetAllItemsRequest + { + } +} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsResponse.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsResponse.cs new file mode 100644 index 000000000..3afb22c1e --- /dev/null +++ b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsResponse.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetAllItemsResponse + { + public List Collections { get; set; } + + public RemoteDataStoreGetAllItemsResponse() + { + Collections = new List(); + } + } +} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/Tango.DataStore.Remote.csproj b/Software/Visual_Studio/Tango.DataStore.Remote/Tango.DataStore.Remote.csproj index 4d0d04054..c01607af0 100644 --- a/Software/Visual_Studio/Tango.DataStore.Remote/Tango.DataStore.Remote.csproj +++ b/Software/Visual_Studio/Tango.DataStore.Remote/Tango.DataStore.Remote.csproj @@ -50,12 +50,15 @@ GlobalVersionInfo.cs + + + diff --git a/Software/Visual_Studio/Tango.DataStore/DataStoreHelper.cs b/Software/Visual_Studio/Tango.DataStore/DataStoreHelper.cs index 96a905120..7167648b4 100644 --- a/Software/Visual_Studio/Tango.DataStore/DataStoreHelper.cs +++ b/Software/Visual_Studio/Tango.DataStore/DataStoreHelper.cs @@ -95,11 +95,11 @@ namespace Tango.DataStore } else if (item.Type == DataType.Proto) { - return (item.Value as DataStoreProtoObject).Message.ToJsonString(); + return (item.Value as DataStoreProtoObject).Message.ToString(); } else { - return $"{item.Key}: {item.Value}"; + return item.Value.ToStringSafe(); } } } diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 893e7f945..64f19da67 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -429,6 +429,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.EF", "Tango EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.MachineConfiguration", "FSE\Modules\Tango.FSE.MachineConfiguration\Tango.FSE.MachineConfiguration.csproj", "{15BCB5BB-731E-4E2D-AA28-75485050A8DC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.Editing", "Tango.DataStore.Editing\Tango.DataStore.Editing.csproj", "{EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -4056,6 +4058,26 @@ Global {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|x64.Build.0 = Release|Any CPU {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|x86.ActiveCfg = Release|Any CPU {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|x86.Build.0 = Release|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|ARM.ActiveCfg = Debug|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|ARM.Build.0 = Debug|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|ARM64.Build.0 = Debug|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|x64.ActiveCfg = Debug|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|x64.Build.0 = Debug|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|x86.ActiveCfg = Debug|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|x86.Build.0 = Debug|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Release|Any CPU.Build.0 = Release|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Release|ARM.ActiveCfg = Release|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Release|ARM.Build.0 = Release|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Release|ARM64.ActiveCfg = Release|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Release|ARM64.Build.0 = Release|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Release|x64.ActiveCfg = Release|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Release|x64.Build.0 = Release|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Release|x86.ActiveCfg = Release|Any CPU + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -4202,12 +4224,12 @@ Global {15BCB5BB-731E-4E2D-AA28-75485050A8DC} = {4EE6DBA1-71BC-49E2-8DC7-266487E61050} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} - BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear - BuildVersion_UpdateAssemblyVersion = True - BuildVersion_UpdateFileVersion = False - BuildVersion_StartDate = 2000/1/1 - BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs BuildVersion_UseGlobalSettings = False + BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs + BuildVersion_StartDate = 2000/1/1 + BuildVersion_UpdateFileVersion = False + BuildVersion_UpdateAssemblyVersion = True + BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear + SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} EndGlobalSection EndGlobal -- cgit v1.3.1 From 14e4bd850fa6730eecd7d15bd7044f364b41c986 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 12 Nov 2020 20:38:57 +0200 Subject: Working on data store view. --- Software/PMR/Messages/Common/MessageType.proto | 2 + .../DataStore/DataStoreItemModifiedRequest.proto | 10 + .../DataStore/DataStoreItemModifiedResponse.proto | 9 + .../Tango.FSE.Firmware_0qifchtm_wpftmp.csproj | 203 ++++++++++++++++ .../Converters/DataStoreValueToStringConverter.cs | 2 +- .../Dialogs/DataStoreItemEditDialogView.xaml | 53 +++++ .../Dialogs/DataStoreItemEditDialogView.xaml.cs | 28 +++ .../Dialogs/DataStoreItemEditDialogViewVM.cs | 173 ++++++++++++++ .../Images/data_collection.png | Bin 0 -> 1963 bytes .../Tango.FSE.MachineConfiguration.csproj | 11 + .../ViewModels/ConfigurationViewVM.cs | 2 + .../ViewModels/DataStoreViewVM.cs | 216 +++++++++++++++-- .../Views/ConfigurationView.xaml | 10 +- .../Views/DataStoreView.xaml | 258 ++++++++++++++++----- .../Views/MachineView.xaml | 6 +- .../Tango.FSE.Procedures/Themes/Generic.xaml | 1 - .../FSE/Tango.FSE.BL/Services/DataStoreService.cs | 2 +- .../Services/MachineConfigurationService.cs | 2 + .../FSE/Tango.FSE.BL/Services/MachinesService.cs | 28 ++- .../DataStore/IDataStoreProvider.cs | 1 + .../Notifications/INotificationProvider.cs | 2 +- .../Tango.FSE.Common/Notifications/InputBoxVM.cs | 38 ++- .../FSE/Tango.FSE.Common/Resources/Styles.xaml | 2 +- .../Controls/NotificationsControl.xaml | 12 +- .../DataStore/DefaultDataStoreProvider.cs | 140 +++++++++++ .../Notifications/DefaultNotificationProvider.cs | 4 +- .../DataStore/DefaultDataStoreService.cs | 75 +++++- .../PPC/Tango.PPC.Common/Tango.PPC.Common.csproj | 6 +- .../Connectivity/DefaultConnectivityProvider.cs | 2 +- .../Tango.BL/DTO/DataStoreItemDTOBase.cs | 8 + .../Tango.BL/Entities/DataStoreItemBase.cs | 38 +++ .../ExtensionMethods/StringExtensions.cs | 5 + .../Tango.DAL.Remote/DB/DATA_STORE_ITEMS.cs | 1 + .../Tango.DAL.Remote/DB/RemoteADO.edmx | 3 + .../Tango.DAL.Remote/DB/RemoteADO.edmx.diagram | 146 ++++++------ .../DataStoreCollectionModel.cs | 1 + .../Tango.DataStore.Editing/DataStoreItemModel.cs | 53 ++++- .../Tango.DataStore.Editing.csproj | 6 + .../UpdateDataStoreRequest.cs | 21 ++ .../UpdateDataStoreResponse.cs | 13 ++ .../Tango.DataStore/DataStoreHelper.cs | 72 +++++- .../Tango.DataStore/DataStoreProtoObject.cs | 6 + .../Visual_Studio/Tango.PMR/Common/MessageType.cs | 9 +- .../DataStore/DataStoreItemModifiedRequest.cs | 188 +++++++++++++++ .../DataStore/DataStoreItemModifiedResponse.cs | 131 +++++++++++ Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj | 4 +- .../Tango.SharedUI/Controls/SearchComboBox.cs | 24 +- .../Converters/EnumToItemsSourceConverter.cs | 13 +- .../Controllers/PPCController.cs | 11 +- .../Properties/AssemblyInfo.cs | 2 +- 50 files changed, 1852 insertions(+), 201 deletions(-) create mode 100644 Software/PMR/Messages/DataStore/DataStoreItemModifiedRequest.proto create mode 100644 Software/PMR/Messages/DataStore/DataStoreItemModifiedResponse.proto create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/Tango.FSE.Firmware_0qifchtm_wpftmp.csproj create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogViewVM.cs create mode 100644 Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/data_collection.png create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/UpdateDataStoreRequest.cs create mode 100644 Software/Visual_Studio/Tango.DataStore.Editing/UpdateDataStoreResponse.cs create mode 100644 Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItemModifiedRequest.cs create mode 100644 Software/Visual_Studio/Tango.PMR/DataStore/DataStoreItemModifiedResponse.cs (limited to 'Software/Visual_Studio/FSE') diff --git a/Software/PMR/Messages/Common/MessageType.proto b/Software/PMR/Messages/Common/MessageType.proto index e8ad94156..4fe8a5e6f 100644 --- a/Software/PMR/Messages/Common/MessageType.proto +++ b/Software/PMR/Messages/Common/MessageType.proto @@ -313,4 +313,6 @@ enum MessageType PutDataStoreItemResponse = 13001; GetDataStoreItemRequest = 13002; GetDataStoreItemResponse = 13003; + DataStoreItemModifiedRequest = 13004; + DataStoreItemModifiedResponse = 13005; } diff --git a/Software/PMR/Messages/DataStore/DataStoreItemModifiedRequest.proto b/Software/PMR/Messages/DataStore/DataStoreItemModifiedRequest.proto new file mode 100644 index 000000000..c86d9e016 --- /dev/null +++ b/Software/PMR/Messages/DataStore/DataStoreItemModifiedRequest.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package Tango.PMR.DataStore; +option java_package = "com.twine.tango.pmr.datastore"; + +message DataStoreItemModifiedRequest +{ + string Collection = 1; + string Key = 2; +} \ No newline at end of file diff --git a/Software/PMR/Messages/DataStore/DataStoreItemModifiedResponse.proto b/Software/PMR/Messages/DataStore/DataStoreItemModifiedResponse.proto new file mode 100644 index 000000000..d6a597fb5 --- /dev/null +++ b/Software/PMR/Messages/DataStore/DataStoreItemModifiedResponse.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.DataStore; +option java_package = "com.twine.tango.pmr.datastore"; + +message DataStoreItemModifiedResponse +{ + +} \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/Tango.FSE.Firmware_0qifchtm_wpftmp.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/Tango.FSE.Firmware_0qifchtm_wpftmp.csproj new file mode 100644 index 000000000..8708fb9b0 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Firmware/Tango.FSE.Firmware_0qifchtm_wpftmp.csproj @@ -0,0 +1,203 @@ + + + + + Debug + AnyCPU + {7CB96D74-8B71-4A81-B4E1-6DE7BFCA6174} + library + Tango.FSE.Firmware + Tango.FSE.Firmware + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + + + true + full + false + ..\..\..\Build\FSE\Debug\ + DEBUG;TRACE + prompt + 4 + Off + + + pdbonly + true + ..\..\..\Build\FSE\Release\ + TRACE + prompt + 4 + + + + + + + FirmwareUpdateView.xaml + + + + + + + + + + + FileSystemView.xaml + + + LogsView.xaml + + + MainView.xaml + + + UpdatesView.xaml + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7} + Tango.PPC.Shared + + + {bb2abb74-ba58-4812-83aa-ec8171f42df4} + Tango.AutoComplete + + + {f441feee-322a-4943-b566-110e12fd3b72} + Tango.BL + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {c6ebbbbe-2123-44dc-aef7-a0d47d736ac0} + Tango.FileSystem + + + {4206ac58-3b57-4699-8835-90bf6db01a61} + Tango.Integration + + + {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 + + + {74e700b0-1156-4126-be40-ee450d3c3026} + Tango.Transport + + + {834c81c3-09b5-45d7-be12-e7d1e6655a7c} + Tango.FSE.BL + + + {bc37cccb-7392-4f78-8d1c-e9629e6e046e} + Tango.FSE.Common + + + + + + + + + + + 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}. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Converters/DataStoreValueToStringConverter.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Converters/DataStoreValueToStringConverter.cs index 6b3c8e28c..4acf7fd8e 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Converters/DataStoreValueToStringConverter.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Converters/DataStoreValueToStringConverter.cs @@ -17,7 +17,7 @@ namespace Tango.FSE.MachineConfiguration.Converters { if (item != null) { - return DataStoreHelper.FormatDataStoreItem(item); + return DataStoreHelper.FormatDataStoreItem(item).ToOneLine().Ellipsis(100); } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml new file mode 100644 index 000000000..2fd3b9cdf --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml @@ -0,0 +1,53 @@ + + + + + + + + + + + + Data Type + + + + + + + + + Message Type + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.xaml.cs new file mode 100644 index 000000000..b0f741759 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogView.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.FSE.MachineConfiguration.Dialogs +{ + /// + /// Interaction logic for DataStoreItemEditDialogView.xaml + /// + public partial class DataStoreItemEditDialogView : UserControl + { + public DataStoreItemEditDialogView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogViewVM.cs new file mode 100644 index 000000000..29ec03942 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogViewVM.cs @@ -0,0 +1,173 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.Core.DI; +using Tango.Core.ExtensionMethods; +using Tango.Core.Helpers; +using Tango.DataStore; +using Tango.DataStore.Editing; +using Tango.FSE.Common; +using Tango.FSE.Common.Storage; +using Tango.PMR; +using Tango.PMR.Common; + +namespace Tango.FSE.MachineConfiguration.Dialogs +{ + public class DataStoreItemEditDialogViewVM : FSEDialogViewVM + { + private const int MAX_FILE_SIZE_KB = 100; + + [TangoInject] + private IStorageProvider StorageProvider { get; set; } + + [TangoInject] + private Common.Notifications.INotificationProvider NotificationProvider { get; set; } + + private DataStoreItemModel _item; + public DataStoreItemModel Item + { + get { return _item; } + set + { + _item = value; + RaisePropertyChangedAuto(); + + if (_item.IsGlobal) + { + Value = _item.GlobalItem.Value; + } + else + { + Value = _item.Value; + } + + Type = _item.Type; + + if (Type == DataType.Proto) + { + ProtoMessageType = (Value as DataStoreProtoObject).MessageType; + } + + if (_item.IsGlobal) + { + EditingValue = _item.GlobalItem.ToString(); + } + else + { + EditingValue = _item.ToString(); + } + } + } + + public bool EnableTypeChange { get; set; } + + private Object _value; + public Object Value + { + get { return _value; } + set { _value = value; RaisePropertyChangedAuto(); } + } + + private DataType _type; + public DataType Type + { + get { return _type; } + set { _type = value; RaisePropertyChangedAuto(); OnEditingValueChanged(); } + } + + private MessageType _protoMessageType; + public MessageType ProtoMessageType + { + get { return _protoMessageType; } + set { _protoMessageType = value; RaisePropertyChangedAuto(); OnEditingValueChanged(); } + } + + private String _editingValue; + public String EditingValue + { + get { return _editingValue; } + set { _editingValue = value; RaisePropertyChangedAuto(); OnEditingValueChanged(); } + } + + private String _error; + public String Error + { + get { return _error; } + set { _error = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasError)); InvalidateRelayCommands(); } + } + + public bool HasError + { + get { return Error != null; } + } + + public RelayCommand LoadFileCommand { get; set; } + + public RelayCommand InitProtoCommand { get; set; } + + public DataStoreItemEditDialogViewVM() + { + EnableTypeChange = true; + LoadFileCommand = new RelayCommand(LoadFile); + InitProtoCommand = new RelayCommand(InitProto); + TangoIOC.Default.Inject(this); + } + + private void InitProto() + { + if (Type == DataType.Proto) + { + var type = MessageFactory.GetPMRTypeFromMessageType(ProtoMessageType); + var instance = Activator.CreateInstance(type); + EditingValue = instance.ToJsonString(); + } + } + + private async void LoadFile() + { + if (Type == DataType.Bytes) + { + var result = await StorageProvider.OpenFile("Load a file"); + if (result) + { + if ((new FileInfo(result.SelectedItem).Length / 1024) > MAX_FILE_SIZE_KB) + { + await NotificationProvider.ShowError($"The selected file size exceeds the maximum {MAX_FILE_SIZE_KB}kb allowed."); + return; + } + + var bytes = File.ReadAllBytes(result.SelectedItem); + Value = bytes; + _editingValue = DataStoreHelper.GetByteArrayHexString(bytes); + RaisePropertyChanged(nameof(EditingValue)); + } + } + } + + private void OnEditingValueChanged() + { + if (EditingValue != null) + { + try + { + Value = DataStoreHelper.ParseDataStoreValue(Type, EditingValue, ProtoMessageType); + Error = null; + } + catch (Exception ex) + { + Error = ex.Message; + } + } + } + + protected override bool CanOK() + { + return base.CanOK() && !HasError; + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/data_collection.png b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/data_collection.png new file mode 100644 index 000000000..95163a226 Binary files /dev/null and b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Images/data_collection.png differ diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj index af67b0d74..2e876db16 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj @@ -80,6 +80,10 @@ + + DataStoreItemEditDialogView.xaml + + @@ -198,6 +202,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -222,6 +230,9 @@ + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs index 63e3f22d9..61eef2bdc 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/ConfigurationViewVM.cs @@ -44,6 +44,8 @@ namespace Tango.FSE.MachineConfiguration.ViewModels using (NotificationProvider.PushTaskItem("Loading machine configuration...")) { EditingComposition = msg.EditingComposition; + EditingComposition.Machine.ForceVersionUpdateChanged += (x, value) => { if (value) EditingComposition.Machine.SuspendVersionUpdate = false; }; + EditingComposition.Machine.SuspendVersionUpdateChanged += (x, value) => { if (value) EditingComposition.Machine.ForceVersionUpdate = false; }; } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs index 4a75c137b..76aee9cde 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs @@ -1,12 +1,17 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Data; +using Tango.Core.Commands; using Tango.Core.DI; +using Tango.DataStore; using Tango.DataStore.Editing; using Tango.FSE.Common; using Tango.FSE.Common.DataStore; +using Tango.FSE.MachineConfiguration.Dialogs; using Tango.FSE.MachineConfiguration.Messages; using static Tango.SharedUI.Controls.NavigationControl; @@ -15,6 +20,8 @@ namespace Tango.FSE.MachineConfiguration.ViewModels public class DataStoreViewVM : FSEViewModel, INavigationViewModel { private String machineGuid; + private ICollectionView _selectedCollectionView; + private ICollectionView _collectionsView; [TangoInject] private IDataStoreProvider DataStoreProvider { get; set; } @@ -30,7 +37,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels public DataStoreCollectionModel SelectedCollection { get { return _selectedCollection; } - set { _selectedCollection = value; RaisePropertyChangedAuto(); } + set { _selectedCollection = value; RaisePropertyChangedAuto(); OnSelectedCollectionChanged(); } } private DataStoreItemModel _selectedItem; @@ -40,16 +47,134 @@ namespace Tango.FSE.MachineConfiguration.ViewModels set { _selectedItem = value; RaisePropertyChangedAuto(); } } - private bool _isLoading; - public bool IsLoading + private String _filter; + public String Filter { - get { return _isLoading; } - set { _isLoading = value; RaisePropertyChangedAuto(); } + get { return _filter; } + set { _filter = value; RaisePropertyChangedAuto(); _selectedCollectionView?.Refresh(); } } + public RelayCommand RemoveItemCommand { get; set; } + public RelayCommand RemoveCollectionCommand { get; set; } + public RelayCommand AddItemCommand { get; set; } + public RelayCommand AddCollectionCommand { get; set; } + public RelayCommand EditItemCommand { get; set; } + public RelayCommand SaveCommand { get; set; } + public RelayCommand ReloadCommand { get; set; } + public DataStoreViewVM() { RegisterForMessage(OnEditingCompositionLoaded); + RemoveItemCommand = new RelayCommand(RemoveItem); + RemoveCollectionCommand = new RelayCommand(RemoveCollection); + AddItemCommand = new RelayCommand(AddItem); + AddCollectionCommand = new RelayCommand(AddCollection); + EditItemCommand = new RelayCommand(EditItem); + SaveCommand = new RelayCommand(SaveModel); + ReloadCommand = new RelayCommand(ReloadDataStore); + } + + private async void ReloadDataStore() + { + if (DataStore != null) + { + if (DataStore.Collections.SelectMany(x => x.Items).Any(x => x.HasDifference)) + { + if (!await NotificationProvider.ShowWarningQuestion("Reloading the data store will discard all the current changes. Are you sure?", "RELOAD")) + { + return; + } + } + } + + await LoadDataStore(); + } + + private async void EditItem(DataStoreItemModel item) + { + var vm = await NotificationProvider.ShowDialog(new DataStoreItemEditDialogViewVM() { Item = item, EnableTypeChange = !item.IsGlobal }); + + if (vm.DialogResult) + { + item.IsDeleted = false; + item.IsGlobal = false; + item.Type = vm.Type; + item.Value = vm.Value; + } + } + + private async void AddCollection() + { + var result = await NotificationProvider.ShowInputBox("Add Collection", "Please enter the collection name", MaterialDesignThemes.Wpf.PackIconKind.Collection, null, null, 20, null, null, (input) => + { + if (DataStore.Collections.ToList().Exists(x => x.Name.ToLower() == input.ToLower())) + { + return "The specified collection already exists."; + } + + return null; + }); + + if (result.Confirmed) + { + if (DataStore.Collections.ToList().Exists(x => x.Name.ToLower() == result.Input.ToLower())) + { + await NotificationProvider.ShowError("The specified collection already exists."); + AddCollection(); + return; + } + + DataStore.Collections.Add(new DataStoreCollectionModel() + { + Name = result.Input + }); + + SelectedCollection = DataStore.Collections.Last(); + } + } + + private async void AddItem() + { + var result = await NotificationProvider.ShowInputBox("Add Item", "Please enter the item key", MaterialDesignThemes.Wpf.PackIconKind.KeyAdd, null, null, 20, null, null, (input) => + { + if (SelectedCollection.Items.ToList().Exists(x => x.Key.ToLower() == input.ToLower())) + { + return "The specified key already exists in the collection."; + } + + return null; + }); + + if (result.Confirmed) + { + if (SelectedCollection.Items.ToList().Exists(x => x.Key == result.Input)) + { + await NotificationProvider.ShowError("The specified key already exists in the collection."); + AddItem(); + return; + } + + SelectedCollection.Items.Add(new DataStoreItemModel() + { + Date = DateTime.UtcNow, + Guid = Guid.NewGuid().ToString(), + Key = result.Input, + Type = DataType.Int32, + Value = 10 + }); + } + } + + private void RemoveCollection(DataStoreCollectionModel collection) + { + collection.IsDeleted = true; + _collectionsView?.Refresh(); + } + + private void RemoveItem(DataStoreItemModel item) + { + item.IsDeleted = true; + _selectedCollectionView.Refresh(); } private void OnEditingCompositionLoaded(EditingCompositionLoadedMessage obj) @@ -58,28 +183,87 @@ namespace Tango.FSE.MachineConfiguration.ViewModels machineGuid = obj.EditingComposition.Machine.Guid; } - public async override void OnNavigatedTo() + private void OnSelectedCollectionChanged() { - base.OnNavigatedTo(); + if (SelectedCollection != null) + { + _selectedCollectionView = CollectionViewSource.GetDefaultView(SelectedCollection.Items); + _selectedCollectionView.Filter = (x) => FilterItems(x as DataStoreItemModel); + _selectedCollectionView.Refresh(); + } + } - if (DataStore == null) + private bool FilterItems(DataStoreItemModel itemModel) + { + return (!itemModel.IsDeleted || itemModel.GlobalItem != null) && (String.IsNullOrWhiteSpace(Filter) || itemModel.Key.ToLower().Contains(Filter.ToLower())); + } + + private async void SaveModel() + { + try { - try + using (NotificationProvider.PushTaskItem("Updating data store...")) { - IsLoading = true; - IsFree = false; - DataStore = await DataStoreProvider.GetDataStoreModel(machineGuid); + await DataStoreProvider.UpdateDataStoreModel(DataStore, machineGuid); } - catch (Exception ex) + + if (MachineProvider.IsPPCAvailable) { - LogManager.Log(ex, "Error loading data store."); + await NotificationProvider.ShowSuccess("The connected machine is now synchronized with the data store."); } - finally + else { - IsLoading = false; + await NotificationProvider.ShowInfo("Data store save successfully.\nThe machine will be updated on the next synchronization pass."); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error saving data store."); + await NotificationProvider.ShowError($"Error occurred while trying to save the data store.\n{ex.FlattenMessage()}"); + return; + } + + await LoadDataStore(); + } + + private async Task LoadDataStore() + { + try + { + using (NotificationProvider.PushTaskItem("Loading data store...")) + { + IsFree = false; + var dataStore = await DataStoreProvider.GetDataStoreModel(machineGuid); + + _collectionsView = CollectionViewSource.GetDefaultView(dataStore.Collections); + _collectionsView.Filter = (x) => { return !(x as DataStoreCollectionModel).IsDeleted; }; + _collectionsView.Refresh(); + + DataStore = dataStore; + SelectedCollection = DataStore.Collections.FirstOrDefault(); + IsFree = true; } } + catch (Exception ex) + { + LogManager.Log(ex, "Error loading data store."); + if (await NotificationProvider.ShowWarningQuestion($"Error occurred while trying to load the data store.\n{ex.FlattenMessage()}", "RETRY", "CANCEL")) + { + await LoadDataStore(); + return; + } + } + } + + public async override void OnNavigatedTo() + { + base.OnNavigatedTo(); + + if (DataStore == null) + { + await LoadDataStore(); + } } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml index 9c8b2d878..ed24c3a67 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml @@ -114,18 +114,18 @@ - - - Perform Firmware Upgrade + + + Disable Firmware Upgrade - + Force Version Update - + Suspend Version Update diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml index f078efcee..f4029e30c 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml @@ -4,7 +4,9 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.FSE.MachineConfiguration.Views" + xmlns:helpers="clr-namespace:Tango.SharedUI.Helpers;assembly=Tango.SharedUI" xmlns:global="clr-namespace:Tango.FSE.MachineConfiguration" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" xmlns:vm="clr-namespace:Tango.FSE.MachineConfiguration.ViewModels" xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:commonControls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" @@ -16,61 +18,213 @@ - - - - - - + + + + + + + + + The data store contains global and local (machine) configuration and calibration parameters. + + Updating the data store parameters will take effect on the next machine cloud synchronization pass. + + If this is the currently connected machine, updating the data store will take effect immediately. + + + + + + + + + + + + Machine is connected, updating the data store will be take effect immediately. + + + + + + + + + + + + + + + + + + + + + + + + + ADD ITEM + + + + + + + + + + + ADD COLLECTION + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml index 9f81f82e4..ca6470db3 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml @@ -12,14 +12,14 @@ d:DesignHeight="1080" d:DesignWidth="1920" d:DataContext="{d:DesignInstance Type=vm:MachineViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MachineViewVM}" d:DesignStyle="{StaticResource FSE_User_Control_Designer}"> - + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Themes/Generic.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Themes/Generic.xaml index 3917368f2..0e055d730 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Themes/Generic.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Themes/Generic.xaml @@ -635,7 +635,6 @@ - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogView.xaml.cs new file mode 100644 index 000000000..4ee37908c --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogView.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.FSE.MachineConfiguration.Dialogs +{ + /// + /// Interaction logic for ImportDialogView.xaml + /// + public partial class ExportDialogView : UserControl + { + public ExportDialogView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogViewVM.cs new file mode 100644 index 000000000..9f605c79e --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ExportDialogViewVM.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DataStore.Editing; +using Tango.FSE.Common; + +namespace Tango.FSE.MachineConfiguration.Dialogs +{ + public class ExportDialogViewVM : FSEDialogViewVM + { + public DataStoreModel DataStore { get; set; } + + public ExportDialogViewVM() + { + OKText = "EXPORT"; + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.xaml new file mode 100644 index 000000000..5d9653eb4 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.xaml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.xaml.cs new file mode 100644 index 000000000..bc729601f --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogView.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.FSE.MachineConfiguration.Dialogs +{ + /// + /// Interaction logic for ImportDialogView.xaml + /// + public partial class ImportDialogView : UserControl + { + public ImportDialogView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogViewVM.cs new file mode 100644 index 000000000..a4e53e85b --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/ImportDialogViewVM.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DataStore.Editing; +using Tango.FSE.Common; + +namespace Tango.FSE.MachineConfiguration.Dialogs +{ + public class ImportDialogViewVM : FSEDialogViewVM + { + public DataStoreModel DataStore { get; set; } + + public ImportDialogViewVM() + { + OKText = "IMPORT"; + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Models/CsvModel.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Models/CsvModel.cs new file mode 100644 index 000000000..1e12fda4b --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Models/CsvModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.MachineConfiguration.Models +{ + public class CsvModel + { + public String Date { get; set; } + public String Collection { get; set; } + public String Key { get; set; } + public String Type { get; set; } + public String MessageType { get; set; } + public String Value { get; set; } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj index 2e876db16..db7b7d12d 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj @@ -84,7 +84,16 @@ DataStoreItemEditDialogView.xaml + + ExportDialogView.xaml + + + ImportDialogView.xaml + + + + @@ -148,6 +157,10 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core + + {58e8825f-0c96-449c-b320-1e82b0aa876b} + Tango.CSV + {ee088ff7-04d1-41fb-9d6a-cedeee7a7b9c} Tango.DataStore.Editing @@ -206,6 +219,14 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -233,6 +254,7 @@ + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs index 76aee9cde..198f1bd9b 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs @@ -7,24 +7,30 @@ using System.Threading.Tasks; using System.Windows.Data; using Tango.Core.Commands; using Tango.Core.DI; +using Tango.CSV; using Tango.DataStore; using Tango.DataStore.Editing; using Tango.FSE.Common; +using Tango.FSE.Common.Connection; using Tango.FSE.Common.DataStore; +using Tango.FSE.Common.Notifications; using Tango.FSE.MachineConfiguration.Dialogs; using Tango.FSE.MachineConfiguration.Messages; +using Tango.FSE.MachineConfiguration.Models; +using static Tango.FSE.BL.Services.MachineConfigurationService; using static Tango.SharedUI.Controls.NavigationControl; namespace Tango.FSE.MachineConfiguration.ViewModels { public class DataStoreViewVM : FSEViewModel, INavigationViewModel { - private String machineGuid; + private String _machineGuid; + private MachineEditingComposition _editingComposition; private ICollectionView _selectedCollectionView; private ICollectionView _collectionsView; [TangoInject] - private IDataStoreProvider DataStoreProvider { get; set; } + public IDataStoreProvider DataStoreProvider { get; set; } private DataStoreModel _dataStore; public DataStoreModel DataStore @@ -54,6 +60,11 @@ namespace Tango.FSE.MachineConfiguration.ViewModels set { _filter = value; RaisePropertyChangedAuto(); _selectedCollectionView?.Refresh(); } } + public bool CanSync + { + get { return MachineProvider.IsPPCAvailable && MachineProvider.Machine != null && _machineGuid == MachineProvider.Machine.Guid; } + } + public RelayCommand RemoveItemCommand { get; set; } public RelayCommand RemoveCollectionCommand { get; set; } public RelayCommand AddItemCommand { get; set; } @@ -61,6 +72,8 @@ namespace Tango.FSE.MachineConfiguration.ViewModels public RelayCommand EditItemCommand { get; set; } public RelayCommand SaveCommand { get; set; } public RelayCommand ReloadCommand { get; set; } + public RelayCommand ImportCommand { get; set; } + public RelayCommand ExportCommand { get; set; } public DataStoreViewVM() { @@ -72,6 +85,15 @@ namespace Tango.FSE.MachineConfiguration.ViewModels EditItemCommand = new RelayCommand(EditItem); SaveCommand = new RelayCommand(SaveModel); ReloadCommand = new RelayCommand(ReloadDataStore); + ExportCommand = new RelayCommand(ExportDataStore); + ImportCommand = new RelayCommand(ImportDataStore); + } + + [TangoInject] + public DataStoreViewVM(IMachineProvider machineProvider) : this() + { + machineProvider.MachineConnected += (_, __) => RaisePropertyChanged(nameof(CanSync)); + machineProvider.MachineDisconnected += (_, __) => RaisePropertyChanged(nameof(CanSync)); } private async void ReloadDataStore() @@ -180,7 +202,8 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private void OnEditingCompositionLoaded(EditingCompositionLoadedMessage obj) { DataStore = null; - machineGuid = obj.EditingComposition.Machine.Guid; + _editingComposition = obj.EditingComposition; + _machineGuid = obj.EditingComposition.Machine.Guid; } private void OnSelectedCollectionChanged() @@ -204,7 +227,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels { using (NotificationProvider.PushTaskItem("Updating data store...")) { - await DataStoreProvider.UpdateDataStoreModel(DataStore, machineGuid); + await DataStoreProvider.UpdateDataStoreModel(DataStore, _machineGuid); } if (MachineProvider.IsPPCAvailable) @@ -213,7 +236,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels } else { - await NotificationProvider.ShowInfo("Data store save successfully.\nThe machine will be updated on the next synchronization pass."); + await NotificationProvider.ShowSuccess("Data store saved successfully.\nThe machine will be updated on the next synchronization pass."); } } catch (Exception ex) @@ -233,7 +256,9 @@ namespace Tango.FSE.MachineConfiguration.ViewModels using (NotificationProvider.PushTaskItem("Loading data store...")) { IsFree = false; - var dataStore = await DataStoreProvider.GetDataStoreModel(machineGuid); + RaisePropertyChanged(nameof(CanSync)); + + var dataStore = await DataStoreProvider.GetDataStoreModel(_machineGuid); _collectionsView = CollectionViewSource.GetDefaultView(dataStore.Collections); _collectionsView.Filter = (x) => { return !(x as DataStoreCollectionModel).IsDeleted; }; @@ -265,5 +290,176 @@ namespace Tango.FSE.MachineConfiguration.ViewModels await LoadDataStore(); } } + + private async void ImportDataStore() + { + var result = await StorageProvider.OpenFile("Import data store", "CSV Files|*.csv"); + + if (result) + { + try + { + DataStoreModel model = new DataStoreModel(); + + using (NotificationProvider.PushTaskItem("Analyzing file...")) + { + await Task.Delay(1000); + + await Task.Factory.StartNew(() => + { + var items = CsvFile.Read(new CsvSource(result.SelectedItem)).ToList(); + + foreach (var collection in items.GroupBy(x => x.Collection)) + { + DataStoreCollectionModel collectionModel = new DataStoreCollectionModel(); + + collectionModel = new DataStoreCollectionModel(); + collectionModel.Name = collection.First().Collection; + collectionModel.IsSelected = true; + model.Collections.Add(collectionModel); + + foreach (var item in collection) + { + DataStoreItemModel itemModel = new DataStoreItemModel(); + itemModel.Guid = Guid.NewGuid().ToString(); + itemModel.Key = item.Key; + itemModel.Date = DateTime.Parse(item.Date); + itemModel.IsSelected = true; + + DataType type = (DataType)Enum.Parse(typeof(DataType), item.Type); + itemModel.OriginalType = type; + itemModel.Type = type; + + PMR.Common.MessageType? messageType = null; + if (type == DataType.Proto && item.MessageType.IsNotNullOrEmpty()) + { + messageType = (PMR.Common.MessageType)Enum.Parse(typeof(PMR.Common.MessageType), item.MessageType); + } + + itemModel.OriginalValue = DataStoreHelper.ParseDataStoreValue(type, item.Value, messageType); + itemModel.Value = itemModel.OriginalValue; + + collectionModel.Items.Add(itemModel); + } + } + }); + } + + var vm = await NotificationProvider.ShowDialog(new ImportDialogViewVM() { DataStore = model }); + + if (vm.DialogResult) + { + if (!vm.DataStore.Collections.SelectMany(x => x.Items).Any(x => x.IsSelected)) + { + await NotificationProvider.ShowInfo("No items selected to import."); + return; + } + + foreach (var collection in vm.DataStore.Collections.Where(x => x.Items.Any(y => y.IsSelected))) + { + var collectionModel = DataStore.Collections.FirstOrDefault(x => x.Name == collection.Name); + + if (collectionModel == null) + { + DataStore.Collections.Add(collection); + } + else + { + foreach (var item in collection.Items.Where(x => x.IsSelected)) + { + var itemModel = collectionModel.Items.FirstOrDefault(x => x.Key == item.Key); + + if (itemModel == null) + { + itemModel = new DataStoreItemModel(); + itemModel.Guid = item.Guid; + itemModel.Key = item.Key; + collectionModel.Items.Add(itemModel); + } + + itemModel.Date = DateTime.UtcNow; + itemModel.IsDeleted = false; + itemModel.IsGlobal = false; + itemModel.Type = item.Type; + itemModel.Value = item.Value; + } + } + } + + await NotificationProvider.ShowSuccess("Data store imported successfully."); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error importing data store."); + await NotificationProvider.ShowError($"Error importing the data store.\n{ex.FlattenMessage()}"); + } + } + } + + private async void ExportDataStore() + { + var vm = await NotificationProvider.ShowDialog(new ExportDialogViewVM() { DataStore = DataStore }); + + if (vm.DialogResult) + { + if (!vm.DataStore.Collections.SelectMany(x => x.Items).Any(x => x.IsSelected)) + { + await NotificationProvider.ShowInfo("No items selected to export."); + return; + } + + var result = await StorageProvider.SaveFile("Export data store", "CSV Files|*.csv", $"{_editingComposition.Machine.SerialNumber}_datastore_{DateTime.Now.ToFileName()}.csv", ".csv"); + + if (result) + { + try + { + using (NotificationProvider.PushTaskItem("Exporting data store...")) + { + await Task.Delay(1000); + + await Task.Factory.StartNew(() => + { + using (DynamicCsvFile csvFile = new DynamicCsvFile(result.SelectedItem)) + { + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "Date" }); + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "Collection" }); + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "Key" }); + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "Type" }); + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "MessageType" }); + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = "Value" }); + + foreach (var collection in DataStore.Collections) + { + foreach (var item in collection.Items.Where(x => x.IsSelected && !x.IsGlobal && x.Value != null)) + { + PMR.Common.MessageType? messageType = null; + + if (item.Type == DataType.Proto) + { + messageType = (item.Value as DataStoreProtoObject).MessageType; + } + + csvFile.Append(item.Date, $"\"{collection.Name}\"", $"\"{item.Key}\"", item.Type, messageType.ToStringSafe(), $"\"{item.FormattedValue.Replace("\"", "\"\"")}\""); + } + } + } + }); + } + + NotificationProvider.PushSnackbarItem(MessageType.Success, "Export Data Store", true, "Data store exported successfully.", TimeSpan.FromSeconds(8), null, () => + { + StorageProvider.ShowInExplorer(result.SelectedItem); + }); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error exporting data store."); + await NotificationProvider.ShowError($"Error exporting the data store.\n{ex.FlattenMessage()}"); + } + } + } + } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml index f4029e30c..52a140c81 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/DataStoreView.xaml @@ -22,7 +22,7 @@ - + @@ -34,13 +34,22 @@ + + + + Accept Real-Time Firmware Updates + + + + + - + Machine is connected, updating the data store will be take effect immediately. @@ -67,7 +76,7 @@ + diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreRequest.cs new file mode 100644 index 000000000..dc95ea6ae --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreRequest.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.DTO; + +namespace Tango.DataStore.Editing +{ + public class UpdateDataStoreRequest + { + public List ToDelete { get; set; } + public List ToUpsert { get; set; } + + public UpdateDataStoreRequest() + { + ToDelete = new List(); + ToUpsert = new List(); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreResponse.cs new file mode 100644 index 000000000..697ae341d --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Editing/UpdateDataStoreResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Editing +{ + public class UpdateDataStoreResponse + { + + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/LiteDBDataStoreCollection.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/LiteDBDataStoreCollection.cs new file mode 100644 index 000000000..c76a3b6d9 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/LiteDBDataStoreCollection.cs @@ -0,0 +1,113 @@ +using LiteDB; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Lite +{ + public class LiteDBDataStoreCollection : IDataStoreCollection + { + private ILiteCollection _collection; + + public string Name { get; private set; } + + public LiteDBDataStoreCollection(ILiteCollection collection) + { + _collection = collection; + } + + public void Put(string key, T value) + { + Put(key, (object)value); + } + + public void Put(string key, object value) + { + Put(key, DataStoreHelper.GetDataType(value), value); + } + + public void Put(string key, DataType type, object value) + { + _collection.Upsert(new LiteDBDataStoreItem() + { + Key = key, + Date = DateTime.UtcNow, + Type = type, + Value = value, + IsSynchronized = false, + }); + } + + public T Get(string key) + { + return (T)Convert.ChangeType(Get(key), typeof(T)); + } + + public T Get(string key, T defaultValue) + { + return (T)Convert.ChangeType(Get(key, defaultValue), typeof(T)); + } + + public object Get(string key) + { + return Get(key, null); + } + + public object Get(string key, object defaultValue) + { + return GetItem(key, defaultValue).Value; + } + + public IDataStoreItem GetItem(string key) + { + return GetItem(key, null); + } + + public IDataStoreItem GetItem(string key, object defaultValue) + { + var item = _collection.FindById(key); + + if (item == null) + { + if (defaultValue == null) + { + throw new KeyNotFoundException("The specified key was not found on the data store."); + } + else + { + Put(key, defaultValue); + return GetItem(key); + } + } + + return item; + } + + public List GetAll() + { + return _collection.FindAll().ToList(); + } + + public void Delete(string key) + { + _collection.Delete(key); + } + + public void DeleteAll() + { + _collection.DeleteMany(x => true); + } + + public int Count() + { + return _collection.Count(); + } + + public List GetUnsynchronized() + { + return _collection.Find(x => !x.IsSynchronized).ToList(); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/LiteDBDataStoreItem.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/LiteDBDataStoreItem.cs new file mode 100644 index 000000000..ba2e5748e --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/LiteDBDataStoreItem.cs @@ -0,0 +1,30 @@ +using LiteDB; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Lite +{ + public class LiteDBDataStoreItem : IDataStoreItem + { + public String Guid { get; set; } + [BsonId] + public string Key { get; set; } + public DataType Type { get; set; } + public object Value { get; set; } + public DateTime Date { get; set; } + public bool IsSynchronized { get; set; } + + public LiteDBDataStoreItem() + { + Guid = System.Guid.NewGuid().ToString(); + } + + public override string ToString() + { + return DataStoreHelper.FormatDataStoreItem(this); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/LiteDBDataStoreManager.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/LiteDBDataStoreManager.cs new file mode 100644 index 000000000..25abd91ab --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/LiteDBDataStoreManager.cs @@ -0,0 +1,47 @@ +using LiteDB; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Lite +{ + public class LiteDBDataStoreManager : IDataStoreManager + { + private bool _disposed; + private LiteDatabase _database; + + public String DatabasePath { get; private set; } + + public LiteDBDataStoreManager(String databasePath) + { + DatabasePath = databasePath; + Directory.CreateDirectory(Path.GetDirectoryName(DatabasePath)); + _database = new LiteDatabase($"Filename={DatabasePath}"); + _database.Pragma("TIMEOUT", 10); //Read Timeout + _database.Pragma("UTC_DATE", true); //Keep time as UTC when getting data + _database.Commit(); + } + + public IDataStoreCollection GetCollection(string name) + { + return new LiteDBDataStoreCollection(_database.GetCollection(name)); + } + + public List GetCollectionNames() + { + return _database.GetCollectionNames().ToList(); + } + + public void Dispose() + { + if (!_disposed) + { + _disposed = true; + _database.Dispose(); + } + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/Properties/AssemblyInfo.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..f1b35f107 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/Properties/AssemblyInfo.cs @@ -0,0 +1,7 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Tango - Data Store LiteDB Implementation")] +[assembly: AssemblyVersion("2.0.4.1608")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/Tango.DataStore.Lite.csproj b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/Tango.DataStore.Lite.csproj new file mode 100644 index 000000000..65ba97520 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/Tango.DataStore.Lite.csproj @@ -0,0 +1,66 @@ + + + + + Debug + AnyCPU + {FA96BC0C-4055-475C-9DCC-70A5A9436B10} + Library + Properties + Tango.DataStore.Lite + Tango.DataStore.Lite + v4.6.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\LiteDB.5.0.4\lib\net45\LiteDB.dll + + + + + + + + + + + + + + GlobalVersionInfo.cs + + + + + + + + + {e0364dfa-0721-4637-9d32-9d22aac109d6} + Tango.DataStore + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/packages.config b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/packages.config new file mode 100644 index 000000000..9dcac7837 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.LiteDB/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/Properties/AssemblyInfo.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..808b25d41 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/Properties/AssemblyInfo.cs @@ -0,0 +1,7 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Tango - Data Store Remote Messages")] +[assembly: AssemblyVersion("2.0.4.1608")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreCollection.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreCollection.cs new file mode 100644 index 000000000..e4453fafc --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreCollection.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreCollection + { + public String Name { get; set; } + public List Items { get; set; } + + public RemoteDataStoreCollection() + { + Items = new List(); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreCountRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreCountRequest.cs new file mode 100644 index 000000000..84ba279fb --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreCountRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreCountRequest + { + public String Collection { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreCountResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreCountResponse.cs new file mode 100644 index 000000000..71d4e13b2 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreCountResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreCountResponse + { + public int Count { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteAllRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteAllRequest.cs new file mode 100644 index 000000000..ab5406611 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteAllRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreDeleteAllRequest + { + public String Collection { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteAllResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteAllResponse.cs new file mode 100644 index 000000000..b5ddc0b64 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteAllResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreDeleteAllResponse + { + + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteRequest.cs new file mode 100644 index 000000000..13d400154 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteRequest.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreDeleteRequest + { + public String Collection { get; set; } + public String Key { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteResponse.cs new file mode 100644 index 000000000..07bb40a8b --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreDeleteResponse.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreDeleteResponse + { + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsRequest.cs new file mode 100644 index 000000000..a285cd5c1 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetAllItemsRequest + { + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsResponse.cs new file mode 100644 index 000000000..3afb22c1e --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsResponse.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetAllItemsResponse + { + public List Collections { get; set; } + + public RemoteDataStoreGetAllItemsResponse() + { + Collections = new List(); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllRequest.cs new file mode 100644 index 000000000..747a5cb2f --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetAllRequest + { + public String Collection { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllResponse.cs new file mode 100644 index 000000000..2d9e0f527 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetAllResponse.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetAllResponse + { + public List Items { get; set; } + + public RemoteDataStoreGetAllResponse() + { + Items = new List(); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesRequest.cs new file mode 100644 index 000000000..6299f7512 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetCollectionNamesRequest + { + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesResponse.cs new file mode 100644 index 000000000..fe98b73fc --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesResponse.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetCollectionNamesResponse + { + public List Names { get; set; } + + public RemoteDataStoreGetCollectionNamesResponse() + { + Names = new List(); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetItemRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetItemRequest.cs new file mode 100644 index 000000000..7d16a0f38 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetItemRequest.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetItemRequest + { + public String Collection { get; set; } + public String Key { get; set; } + public Object DefaultValue { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetItemResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetItemResponse.cs new file mode 100644 index 000000000..82393a786 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetItemResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetItemResponse + { + public RemoteDataStoreItem Item { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetRequest.cs new file mode 100644 index 000000000..4b8e9ee47 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetRequest.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetRequest + { + public String Collection { get; set; } + public String Key { get; set; } + public Object DefaultValue { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetResponse.cs new file mode 100644 index 000000000..cc3b157e8 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreGetResponse.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreGetResponse + { + public DataType DataType { get; set; } + + private Object _value; + public Object Value + { + get + { + return DataType == DataType.Proto ? ProtoObject : _value; + } + set + { + if (value is DataStoreProtoObject protoValue) + { + ProtoObject = protoValue; + } + else + { + _value = value; + } + } + } + + public DataStoreProtoObject ProtoObject { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreItem.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreItem.cs new file mode 100644 index 000000000..4327a0bd6 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreItem.cs @@ -0,0 +1,47 @@ +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreItem : IDataStoreItem + { + public string Guid { get; set; } + public string Key { get; set; } + public DataType Type { get; set; } + + private object _value; + public object Value + { + get + { + if (_value is JObject jObject) + { + return (jObject.ToObject()); + } + else + { + return _value; + } + } + set { _value = value; } + } + + public DateTime Date { get; set; } + public bool IsSynchronized { get; set; } + + public RemoteDataStoreItem() + { + Guid = System.Guid.NewGuid().ToString(); + Date = DateTime.UtcNow; + } + + public override string ToString() + { + return DataStoreHelper.FormatDataStoreItem(this); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStorePutRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStorePutRequest.cs new file mode 100644 index 000000000..77aa5e41f --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStorePutRequest.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStorePutRequest + { + public String Collection { get; set; } + public DataType DataType { get; set; } + public String Key { get; set; } + + private Object _value; + public Object Value + { + get + { + return DataType == DataType.Proto ? ProtoObject : _value; + } + set + { + if (value is DataStoreProtoObject protoValue) + { + ProtoObject = protoValue; + } + else + { + _value = value; + } + } + } + + public DataStoreProtoObject ProtoObject { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStorePutResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStorePutResponse.cs new file mode 100644 index 000000000..7dd92490a --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStorePutResponse.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStorePutResponse + { + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreStartListenRequest.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreStartListenRequest.cs new file mode 100644 index 000000000..b8da17012 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreStartListenRequest.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public class RemoteDataStoreStartListenRequest + { + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreStartListenResponse.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreStartListenResponse.cs new file mode 100644 index 000000000..c2a6c24a6 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/RemoteDataStoreStartListenResponse.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Remote +{ + public enum RemoteDataStoreChangeType + { + None, + Modified + } + + public class RemoteDataStoreStartListenResponse + { + public RemoteDataStoreChangeType ChangeType { get; set; } + public String CollectionName { get; set; } + public RemoteDataStoreItem Item { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/Tango.DataStore.Remote.csproj b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/Tango.DataStore.Remote.csproj new file mode 100644 index 000000000..49fa37dc1 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/Tango.DataStore.Remote.csproj @@ -0,0 +1,87 @@ + + + + + Debug + AnyCPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA} + Library + Properties + Tango.DataStore.Remote + Tango.DataStore.Remote + v4.6.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + GlobalVersionInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + {e0364dfa-0721-4637-9d32-9d22aac109d6} + Tango.DataStore + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/packages.config b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/packages.config new file mode 100644 index 000000000..026e719c3 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Remote/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore/DataStoreHelper.cs b/Software/Visual_Studio/DataStore/Tango.DataStore/DataStoreHelper.cs new file mode 100644 index 000000000..0ca8e484e --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore/DataStoreHelper.cs @@ -0,0 +1,160 @@ +using Google.Protobuf; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.ExtensionMethods; +using Tango.PMR; +using Tango.PMR.Common; + +namespace Tango.DataStore +{ + /// + /// Contains data store helper methods. + /// + public static class DataStoreHelper + { + /// + /// Gets the data store data type by the specified object type. + /// + /// The value. + /// + public static DataType GetDataType(Object value) + { + return GetDataType(value.GetType()); + } + + /// + /// Gets data store data type by the specified .net type. + /// + /// The type. + /// + /// + public static DataType GetDataType(Type type) + { + if (type == typeof(int)) + { + return DataType.Int32; + } + else if (type == typeof(Int64)) + { + return DataType.Int32; + } + else if (type == typeof(float)) + { + return DataType.Float; + } + else if (type == typeof(double)) + { + return DataType.Double; + } + else if (type == typeof(String)) + { + return DataType.String; + } + else if (type == typeof(bool)) + { + return DataType.Boolean; + } + else if (type == typeof(byte[])) + { + return DataType.Bytes; + } + else if (type == typeof(DataStoreProtoObject)) + { + return DataType.Proto; + } + else if (typeof(IMessage).IsAssignableFrom(type)) + { + return DataType.Proto; + } + + throw new NotSupportedException($"The specified type '{type.Name}' is not supported by the data store."); + } + + /// + /// Formats the data store item as a string. + /// + /// The item. + /// + public static String FormatDataStoreItem(IDataStoreItem item) + { + if (item.Type == DataType.Bytes) + { + return GetByteArrayHexString((byte[])item.Value); + } + else if (item.Type == DataType.Proto) + { + return (item.Value as DataStoreProtoObject).Message.ToJsonString(); + } + else + { + return item.Value.ToStringSafe(); + } + } + + /// + /// Returns a byte array string representation in hex format. + /// + /// The data. + /// + public static String GetByteArrayHexString(byte[] data) + { + StringBuilder hex = new StringBuilder(); + foreach (byte b in data) + { + hex.Append(b.ToString("X2") + " "); + } + return hex.ToString(); + } + + /// + /// Parses a data store value from a string. + /// + /// The type. + /// The string. + /// Type of the proto message (if type is Proto). + /// + /// No PMR message type specified. + /// The specified data store type is not supported. + public static Object ParseDataStoreValue(DataType type, String text, MessageType? protoMessageType = null) + { + switch (type) + { + case DataType.String: + return text; + case DataType.Int32: + return int.Parse(text); + case DataType.Float: + return float.Parse(text); + case DataType.Double: + return double.Parse(text); + case DataType.Boolean: + return bool.Parse(text); + case DataType.Proto: + if (protoMessageType == null) throw new ArgumentNullException("No PMR message type specified."); + var messageType = MessageFactory.GetPMRTypeFromMessageType(protoMessageType.Value); + var instance = Activator.CreateInstance(messageType) as IMessage; + instance = instance.GetParser().ParseJson(text); + return DataStoreProtoObject.FromMessage(instance); + case DataType.Bytes: + string[] hexValuesSplit = text.Split(' '); + List bytes = new List(); + foreach (string hex in hexValuesSplit) + { + if (hex.IsNotNullOrEmpty()) + { + byte b = (byte)Convert.ToInt32(hex.Trim(), 16); + bytes.Add(b); + } + } + return bytes.ToArray(); + } + + throw new NotSupportedException("The specified data store type is not supported."); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore/DataStoreProtoObject.cs b/Software/Visual_Studio/DataStore/Tango.DataStore/DataStoreProtoObject.cs new file mode 100644 index 000000000..5aa7c5342 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore/DataStoreProtoObject.cs @@ -0,0 +1,83 @@ +using Google.Protobuf; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Bson; +using Tango.Core.ExtensionMethods; +using Tango.PMR; +using Tango.PMR.Common; +using Tango.PMR.DataStore; + +namespace Tango.DataStore +{ + public class DataStoreProtoObject + { + public MessageType MessageType { get; set; } + public Type Type { get; set; } + public byte[] Data { get; set; } + + + private IMessage _message; + [JsonIgnore] + public IMessage Message + { + get + { + if (_message == null) + { + _message = MessageFactory.ParseProtoMessage(Data, Type); + } + + return _message; + } + private set { _message = value; } + } + + public byte[] ToBytes() + { + return BsonConvert.Serialize(this); + } + + public static DataStoreProtoObject FromBytes(byte[] data) + { + var instance = BsonConvert.Deserialize(data); + instance.Message = MessageFactory.ParseProtoMessage(instance.Data, instance.Type); + + return instance; + } + + public static DataStoreProtoObject FromMessage(IMessage message) + { + DataStoreProtoObject proto = new DataStoreProtoObject(); + proto.Type = message.GetType(); + proto.MessageType = MessageFactory.ParseMessageType(proto.Type.Name); + proto.Data = message.ToByteArray(); + proto.Message = message; + return proto; + } + + public static DataStoreProtoObject FromJObject(JObject obj) + { + return (obj.ToObject()); + } + + public static DataStoreProtoObject FromPMRDataStoreItem(DataStoreItem item) + { + DataStoreProtoObject proto = new DataStoreProtoObject(); + proto.MessageType = item.ProtoType; + proto.Type = MessageFactory.GetPMRTypeFromMessageType(item.ProtoType); + proto.Data = item.BytesValue.ToByteArray(); + return proto; + } + + public override string ToString() + { + return Message?.ToJsonString(); + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore/DataType.cs b/Software/Visual_Studio/DataStore/Tango.DataStore/DataType.cs new file mode 100644 index 000000000..132bff28e --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore/DataType.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore +{ + /// + /// Represents a data store item type. + /// + public enum DataType + { + Int32, + Float, + Double, + Boolean, + String, + Bytes, + Proto + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore/ExtensionMethods.cs b/Software/Visual_Studio/DataStore/Tango.DataStore/ExtensionMethods.cs new file mode 100644 index 000000000..acc381a61 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore/ExtensionMethods.cs @@ -0,0 +1,16 @@ +using Google.Protobuf; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DataStore; + +public static class ExtensionMethods +{ + public static DataStoreProtoObject ToDataStoreProtoObject(IMessage message) + { + return DataStoreProtoObject.FromMessage(message); + } +} + diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore/IDataStoreCollection.cs b/Software/Visual_Studio/DataStore/Tango.DataStore/IDataStoreCollection.cs new file mode 100644 index 000000000..baca95c67 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore/IDataStoreCollection.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore +{ + /// + /// Represents a data store collection. + /// + public interface IDataStoreCollection + { + /// + /// Gets the collection name. + /// + String Name { get; } + + /// + /// Upserts the specified key and value. + /// + /// The key. + /// The value. + void Put(String key, Object value); + + /// + /// Upserts the specified key and value of type T. + /// + /// + /// The key. + /// The value. + void Put(String key, T value); + + /// + /// Upserts the specified key and value. + /// The value must be of the specified DataType. + /// + /// The key. + /// The type. + /// The value. + void Put(String key, DataType type, Object value); + + /// + /// Gets the value by the specified key + /// + /// The key. + /// + Object Get(String key); + + /// + /// Gets the value by the specified key + /// + /// The key. + /// Will execute put when the key was not found. + /// + Object Get(String key, Object defaultValue); + + /// + /// Gets the value of type T by the specified key + /// + /// + /// The key. + /// + T Get(String key); + + /// + /// Gets the value of type T by the specified key + /// + /// + /// The key. + /// Will execute put when the key was not found. + /// + T Get(String key, T defaultValue); + + /// + /// Gets the full data store item by the specified key. + /// + /// The key. + /// + IDataStoreItem GetItem(String key); + + /// + /// Gets the full data store item by the specified key. + /// + /// The key. + /// Will execute put when the key was not found. + /// + IDataStoreItem GetItem(String key, Object defaultValue); + + /// + /// Gets all the data store items in the collection. + /// + /// + List GetAll(); + + /// + /// Gets all the data store unsynchronized items in the collection. + /// + /// + List GetUnsynchronized(); + + /// + /// Deleted an item by the specified key. + /// + /// The key. + void Delete(String key); + + /// + /// Deletes all items in the collection. + /// + void DeleteAll(); + + /// + /// Returns the number of items in the collection. + /// + /// + int Count(); + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore/IDataStoreItem.cs b/Software/Visual_Studio/DataStore/Tango.DataStore/IDataStoreItem.cs new file mode 100644 index 000000000..9c03f40ee --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore/IDataStoreItem.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore +{ + /// + /// Represents a data store item. + /// + public interface IDataStoreItem + { + /// + /// Gets or sets the unique identifier (Use only for synchronization). + /// + String Guid { get; set; } + + /// + /// Gets or sets item id. + /// + String Key { get; set; } + + /// + /// Gets or sets the item type. + /// + DataType Type { get; set; } + + /// + /// Gets or sets the item value. + /// + Object Value { get; set; } + + /// + /// Gets or sets the item update UTC date. + /// + DateTime Date { get; set; } + + /// + /// Gets or sets a value indicating whether this item is synchronized with the remote service. + /// + bool IsSynchronized { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore/IDataStoreManager.cs b/Software/Visual_Studio/DataStore/Tango.DataStore/IDataStoreManager.cs new file mode 100644 index 000000000..5443f12e2 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore/IDataStoreManager.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore +{ + /// + /// Represents a key/value data store manager. + /// + /// + public interface IDataStoreManager : IDisposable + { + /// + /// Gets the data store collection by name. + /// + /// The name. + /// + IDataStoreCollection GetCollection(String name); + + /// + /// Gets all the collection names. + /// + /// + List GetCollectionNames(); + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore/Properties/AssemblyInfo.cs b/Software/Visual_Studio/DataStore/Tango.DataStore/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..8e9365e03 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore/Properties/AssemblyInfo.cs @@ -0,0 +1,7 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Tango - Data Store Library")] +[assembly: AssemblyVersion("2.0.4.1608")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore/Tango.DataStore.csproj b/Software/Visual_Studio/DataStore/Tango.DataStore/Tango.DataStore.csproj new file mode 100644 index 000000000..d75d39963 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore/Tango.DataStore.csproj @@ -0,0 +1,78 @@ + + + + + Debug + AnyCPU + {E0364DFA-0721-4637-9D32-9D22AAC109D6} + Library + Properties + Tango.DataStore + Tango.DataStore + v4.6.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + bin\Debug\Tango.DataStore.xml + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + bin\Release\Tango.DataStore.xml + + + + ..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + GlobalVersionInfo.cs + + + + + + + + + + + + + + + + {A34EE0F0-649D-41C8-8489-B6F1CC6924EE} + Tango.Core + + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore/packages.config b/Software/Visual_Studio/DataStore/Tango.DataStore/packages.config new file mode 100644 index 000000000..026e719c3 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj index db7b7d12d..1a820ae3c 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Tango.FSE.MachineConfiguration.csproj @@ -161,19 +161,19 @@ {58e8825f-0c96-449c-b320-1e82b0aa876b} Tango.CSV - + {ee088ff7-04d1-41fb-9d6a-cedeee7a7b9c} Tango.DataStore.Editing - + {88d9906b-8fc4-4fe0-b7eb-127a0a8fcee4} Tango.DataStore.EF - + {29448f3c-9b3e-4da6-8555-46a8b9a6b3aa} Tango.DataStore.Remote - + {e0364dfa-0721-4637-9d32-9d22aac109d6} Tango.DataStore diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm index dd4a2d6c4..8777b5768 100644 Binary files a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm and b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm differ diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Tango.FSE.Procedures.Documentation.shfbproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Tango.FSE.Procedures.Documentation.shfbproj index dc353ec12..10bf82219 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Tango.FSE.Procedures.Documentation.shfbproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Tango.FSE.Procedures.Documentation.shfbproj @@ -34,7 +34,7 @@ - + HtmlHelp1 C# @@ -57,106 +57,107 @@ InheritedMembers, InheritedFrameworkMembers, ProtectedInternalAsProtected, NonBrowsable - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This is the global summery for the help file. This is the global summery for the help file. @@ -211,10 +212,10 @@ - + Tango.DataStore {e0364dfa-0721-4637-9d32-9d22aac109d6} - True + False Tango.FSE.Common diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Tango.FSE.Procedures.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Tango.FSE.Procedures.csproj index 32a333579..72b3dadd1 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Tango.FSE.Procedures.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/Tango.FSE.Procedures.csproj @@ -288,7 +288,7 @@ {58e8825f-0c96-449c-b320-1e82b0aa876b} Tango.CSV - + {e0364dfa-0721-4637-9d32-9d22aac109d6} Tango.DataStore diff --git a/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj b/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj index d15611e91..c361f1d3f 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.BL/Tango.FSE.BL.csproj @@ -147,11 +147,11 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core - + {88d9906b-8fc4-4fe0-b7eb-127a0a8fcee4} Tango.DataStore.EF - + {e0364dfa-0721-4637-9d32-9d22aac109d6} Tango.DataStore diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index bb44045b7..9a43bb5fb 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -506,11 +506,11 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core - + {ee088ff7-04d1-41fb-9d6a-cedeee7a7b9c} Tango.DataStore.Editing - + {e0364dfa-0721-4637-9d32-9d22aac109d6} Tango.DataStore diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index baff92208..4b4d46a78 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -641,19 +641,19 @@ {38197109-8610-4d3f-92b9-16d48df94d7c} Tango.DAL.Remote - + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C} Tango.DataStore.Editing - + {88d9906b-8fc4-4fe0-b7eb-127a0a8fcee4} Tango.DataStore.EF - + {29448f3c-9b3e-4da6-8555-46a8b9a6b3aa} Tango.DataStore.Remote - + {E0364DFA-0721-4637-9D32-9D22AAC109D6} Tango.DataStore diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index 1b073ee6f..9d39c96d9 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -364,6 +364,26 @@ + + {ee088ff7-04d1-41fb-9d6a-cedeee7a7b9c} + Tango.DataStore.Editing + + + {88d9906b-8fc4-4fe0-b7eb-127a0a8fcee4} + Tango.DataStore.EF + + + {fa96bc0c-4055-475c-9dcc-70a5a9436b10} + Tango.DataStore.Lite + + + {29448f3c-9b3e-4da6-8555-46a8b9a6b3aa} + Tango.DataStore.Remote + + + {e0364dfa-0721-4637-9d32-9d22aac109d6} + Tango.DataStore + {c5df1816-34e5-4700-824c-29623a1baa22} Tango.AdvancedInstaller @@ -388,26 +408,6 @@ {58e8825f-0c96-449c-b320-1e82b0aa876b} Tango.CSV - - {ee088ff7-04d1-41fb-9d6a-cedeee7a7b9c} - Tango.DataStore.Editing - - - {88d9906b-8fc4-4fe0-b7eb-127a0a8fcee4} - Tango.DataStore.EF - - - {fa96bc0c-4055-475c-9dcc-70a5a9436b10} - Tango.DataStore.Lite - - - {29448f3c-9b3e-4da6-8555-46a8b9a6b3aa} - Tango.DataStore.Remote - - - {e0364dfa-0721-4637-9d32-9d22aac109d6} - Tango.DataStore - {63561e19-ff5a-414b-a5ef-e30711543e1d} Tango.Emulations @@ -520,7 +520,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreCollection.cs b/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreCollection.cs deleted file mode 100644 index 0baf5bb19..000000000 --- a/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreCollection.cs +++ /dev/null @@ -1,156 +0,0 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL; -using Tango.BL.Entities; -using Tango.Core.ExtensionMethods; - -namespace Tango.DataStore.EF -{ - public class EFDataStoreCollection : IDataStoreCollection - { - public string Name { get; } - - public EFDataStoreCollection(String name) - { - Name = name; - } - - public void Put(string key, T value) - { - Put(key, (object)value); - } - - public void Put(string key, object value) - { - Put(key, DataStoreHelper.GetDataType(value), value); - } - - public void Put(string key, DataType type, object value) - { - using (var db = ObservablesContext.CreateDefault()) - { - DataStoreItem item = db.DataStoreItems.SingleOrDefault(x => x.CollectionName == Name && x.Key == key); - - if (item == null) - { - item = new DataStoreItem(); - db.DataStoreItems.Add(item); - } - - item.CollectionName = Name; - item.Key = key; - item.DataType = (int)type; - item.Value = EFDataStoreHelper.CreateBytes(type, value); - item.IsSynchronized = false; - item.LastUpdated = DateTime.UtcNow; - - db.SaveChanges(); - } - } - - public T Get(string key) - { - return (T)Get(key, null); - } - - public T Get(string key, T defaultValue) - { - return (T)Get(key, (object)defaultValue); - } - - public object Get(string key) - { - return Get(key, null); - } - - public object Get(string key, object defaultValue) - { - return GetItem(key, defaultValue).Value; - } - - public IDataStoreItem GetItem(string key) - { - return GetItem(key, null); - } - - public IDataStoreItem GetItem(string key, object defaultValue) - { - using (var db = ObservablesContext.CreateDefault()) - { - var item = db.DataStoreItems.SingleOrDefault(x => x.CollectionName == Name && x.Key == key); - - if (item == null) - { - var globalItem = db.GlobalDataStoreItems.SingleOrDefault(x => x.CollectionName == Name && x.Key == key); - - if (globalItem == null) - { - if (defaultValue == null) - { - throw new KeyNotFoundException("The specified data store key was not found."); - } - else - { - Put(key, defaultValue); - return GetItem(key); - } - } - else - { - return globalItem.ToDataStoreItem(); - } - } - - return item.ToDataStoreItem(); - } - } - - public List GetAll() - { - using (var db = ObservablesContext.CreateDefault()) - { - var items = db.DataStoreItems.Where(x => x.CollectionName == Name).ToList().Select(x => x.ToDataStoreItem()).ToList(); - var globalItems = db.GlobalDataStoreItems.Where(x => x.CollectionName == Name).ToList().Select(x => x.ToDataStoreItem()).ToList(); - - - return globalItems.Concat(items).ToList(); - } - } - - public List GetUnsynchronized() - { - using (var db = ObservablesContext.CreateDefault()) - { - return db.DataStoreItems.Where(x => x.CollectionName == Name && !x.IsSynchronized).ToList().Select(x => x.ToDataStoreItem()).ToList(); - } - } - - public void Delete(string key) - { - using (var db = ObservablesContext.CreateDefault()) - { - db.Database.ExecuteSqlCommand($"DELETE FROM DATA_STORE_ITEMS WHERE COLLECTION_NAME = '{Name}' AND [KEY] = '{key}'"); - } - } - - public void DeleteAll() - { - using (var db = ObservablesContext.CreateDefault()) - { - db.Database.ExecuteSqlCommand($"DELETE FROM DATA_STORE_ITEMS WHERE COLLECTION_NAME = '{Name}'"); - } - } - - public int Count() - { - using (var db = ObservablesContext.CreateDefault()) - { - return db.DataStoreItems.Count(x => x.CollectionName == Name); - } - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreHelper.cs b/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreHelper.cs deleted file mode 100644 index 85b3b6731..000000000 --- a/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreHelper.cs +++ /dev/null @@ -1,105 +0,0 @@ -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Entities; - -namespace Tango.DataStore.EF -{ - public static class EFDataStoreHelper - { - public static byte[] CreateBytes(DataType type, Object obj) - { - switch (type) - { - case DataType.Int32: - return BitConverter.GetBytes((int)obj); - case DataType.Float: - return BitConverter.GetBytes((float)obj); - case DataType.Double: - return BitConverter.GetBytes((double)obj); - case DataType.Boolean: - return BitConverter.GetBytes((bool)obj); - case DataType.String: - return Encoding.Default.GetBytes(obj.ToString()); - case DataType.Bytes: - return (byte[])obj; - case DataType.Proto: - if (obj is DataStoreProtoObject protoMessage) - { - return protoMessage.ToBytes(); - } - else - { - throw new NotSupportedException($"Data type is 'Proto' but object is not of type '{nameof(DataStoreProtoObject)}'."); - } - } - - throw new NotSupportedException("The specified type is not supported."); - } - - public static Object CreateObject(DataType type, byte[] bytes) - { - switch (type) - { - case DataType.Int32: - return BitConverter.ToInt32(bytes, 0); - case DataType.Float: - return BitConverter.ToSingle(bytes, 0); - case DataType.Double: - return BitConverter.ToDouble(bytes, 0); - case DataType.Boolean: - return BitConverter.ToBoolean(bytes, 0); - case DataType.String: - return Encoding.Default.GetString(bytes); - case DataType.Bytes: - return bytes; - case DataType.Proto: - return DataStoreProtoObject.FromBytes(bytes); - } - - throw new NotSupportedException("The specified type is not supported."); - } - - public static IDataStoreItem CreateDataStoreItem(DataStoreItem item) - { - return new EFDataStoreItem() - { - Guid = item.Guid, - Date = item.LastUpdated, - IsSynchronized = item.IsSynchronized, - Key = item.Key, - Type = (DataType)item.DataType, - Value = CreateObject((DataType)item.DataType, item.Value) - }; - } - - public static IDataStoreItem CreateDataStoreItem(GlobalDataStoreItem item) - { - return new EFDataStoreItem() - { - Guid = item.Guid, - Date = item.LastUpdated, - IsSynchronized = true, - Key = item.Key, - Type = (DataType)item.DataType, - Value = CreateObject((DataType)item.DataType, item.Value) - }; - } - - public static DataStoreItem CreateDbDataStoreItem(IDataStoreItem item) - { - return new DataStoreItem() - { - Guid = item.Guid, - LastUpdated = item.Date, - IsSynchronized = item.IsSynchronized, - Key = item.Key, - DataType = (int)item.Type, - Value = CreateBytes(item.Type, item.Value) - }; - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreItem.cs b/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreItem.cs deleted file mode 100644 index 6bcb97d17..000000000 --- a/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreItem.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.EF -{ - public class EFDataStoreItem : IDataStoreItem - { - public string Guid { get; set; } - public string Key { get; set; } - public DataType Type { get; set; } - public object Value { get; set; } - public DateTime Date { get; set; } - public bool IsSynchronized { get; set; } - - public EFDataStoreItem() - { - Guid = System.Guid.NewGuid().ToString(); - } - - public override string ToString() - { - return DataStoreHelper.FormatDataStoreItem(this); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreManager.cs b/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreManager.cs deleted file mode 100644 index 4314a25f9..000000000 --- a/Software/Visual_Studio/Tango.DataStore.EF/EFDataStoreManager.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL; - -namespace Tango.DataStore.EF -{ - public class EFDataStoreManager : IDataStoreManager - { - public IDataStoreCollection GetCollection(string name) - { - using (var db = ObservablesContext.CreateDefault()) - { - return new EFDataStoreCollection(name); - } - } - - public List GetCollectionNames() - { - using (var db = ObservablesContext.CreateDefault()) - { - return db.DataStoreItems.Select(x => x.CollectionName).Distinct().ToList(); - } - } - - public void Dispose() - { - //DO Nothing. - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.EF/ExtensionMethods.cs b/Software/Visual_Studio/Tango.DataStore.EF/ExtensionMethods.cs deleted file mode 100644 index 9f09ae658..000000000 --- a/Software/Visual_Studio/Tango.DataStore.EF/ExtensionMethods.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Entities; -using Tango.DataStore; -using Tango.DataStore.EF; - -public static class ExtensionMethods -{ - public static IDataStoreItem ToDataStoreItem(this DataStoreItem item) - { - return EFDataStoreHelper.CreateDataStoreItem(item); - } - - public static IDataStoreItem ToDataStoreItem(this GlobalDataStoreItem item) - { - return EFDataStoreHelper.CreateDataStoreItem(item); - } - - public static DataStoreItem ToDbDataStoreItem(this IDataStoreItem item) - { - return EFDataStoreHelper.CreateDbDataStoreItem(item); - } -} - diff --git a/Software/Visual_Studio/Tango.DataStore.EF/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.DataStore.EF/Properties/AssemblyInfo.cs deleted file mode 100644 index c59e45461..000000000 --- a/Software/Visual_Studio/Tango.DataStore.EF/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Tango - Data Store Entity Framework Implementation")] -[assembly: AssemblyVersion("2.0.4.1608")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.EF/Tango.DataStore.EF.csproj b/Software/Visual_Studio/Tango.DataStore.EF/Tango.DataStore.EF.csproj deleted file mode 100644 index 96ecb5ad1..000000000 --- a/Software/Visual_Studio/Tango.DataStore.EF/Tango.DataStore.EF.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Debug - AnyCPU - {88D9906B-8FC4-4FE0-B7EB-127A0A8FCEE4} - Library - Properties - Tango.DataStore.EF - Tango.DataStore.EF - v4.6.1 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll - - - ..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll - - - ..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll - - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - - - - - - - - - - - - - - GlobalVersionInfo.cs - - - - - - - - - - - - - - {f441feee-322a-4943-b566-110e12fd3b72} - Tango.BL - - - {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} - Tango.Core - - - {e0364dfa-0721-4637-9d32-9d22aac109d6} - Tango.DataStore - - - {e4927038-348d-4295-aaf4-861c58cb3943} - Tango.PMR - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.EF/packages.config b/Software/Visual_Studio/Tango.DataStore.EF/packages.config deleted file mode 100644 index 13be55da1..000000000 --- a/Software/Visual_Studio/Tango.DataStore.EF/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/CustomControl1.cs b/Software/Visual_Studio/Tango.DataStore.Editing/CustomControl1.cs deleted file mode 100644 index fab0127e8..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/CustomControl1.cs +++ /dev/null @@ -1,25 +0,0 @@ -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.DataStore.Editing -{ - public class CustomControl1 : Control - { - static CustomControl1() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl1), new FrameworkPropertyMetadata(typeof(CustomControl1))); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreCollectionModel.cs b/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreCollectionModel.cs deleted file mode 100644 index 3e58aa4b1..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreCollectionModel.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core; - -namespace Tango.DataStore.Editing -{ - public class DataStoreCollectionModel : ExtendedObject - { - public String Name { get; set; } - public ObservableCollection Items { get; set; } - public bool IsDeleted { get; set; } - - private bool _isSelected; - public bool IsSelected - { - get { return _isSelected; } - set { _isSelected = value; RaisePropertyChangedAuto(); Items.ToList().ForEach(x => x.IsSelected = value); } - } - - public DataStoreCollectionModel() - { - Items = new ObservableCollection(); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreItemModel.cs b/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreItemModel.cs deleted file mode 100644 index 3b1741395..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreItemModel.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core; - -namespace Tango.DataStore.Editing -{ - public class DataStoreItemModel : ExtendedObject, IDataStoreItem - { - public IDataStoreItem GlobalItem { get; set; } - - public DataType OriginalType { get; set; } - public Object OriginalValue { get; set; } - - private Object _value; - public Object Value - { - get { return _value; } - set { _value = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasDifference)); RaisePropertyChanged(nameof(FormattedValue)); } - } - - private bool _isSelected; - public bool IsSelected - { - get { return _isSelected; } - set { _isSelected = value; RaisePropertyChangedAuto(); } - } - - public bool HasDifference - { - get - { - if (OriginalType != Type) - { - return true; - } - - if (OriginalType == DataType.Bytes && Type == DataType.Bytes) - { - if (OriginalValue != null && Value != null) - { - return !Enumerable.SequenceEqual(OriginalValue as byte[], Value as byte[]); - } - } - - if (Value == null && OriginalValue == null) return false; - - return !OriginalValue.ToStringSafe().Equals(Value.ToStringSafe()) || (IsGlobal && GlobalItem.Value != Value); - } - } - - public String FormattedValue - { - get { return this.ToString().ToOneLine(); } - } - - public string Guid { get; set; } - public string Key { get; set; } - - private DataType _type; - public DataType Type - { - get { return _type; } - set { _type = value; RaisePropertyChangedAuto(); } - } - - private DateTime _date; - public DateTime Date - { - get { return _date; } - set { _date = value; RaisePropertyChangedAuto(); } - } - - public bool IsSynchronized { get; set; } - public bool ExistsOnMachine { get; set; } - - private bool _isGlobal; - public bool IsGlobal - { - get { return _isGlobal; } - set { _isGlobal = value; RaisePropertyChangedAuto(); } - } - - private bool _isDeleted; - public bool IsDeleted - { - get { return _isDeleted; } - set { _isDeleted = value; RaisePropertyChangedAuto(); } - } - - public static DataStoreItemModel FromLocalDataStoreItem(IDataStoreItem local, IDataStoreItem globalItem) - { - DataStoreItemModel model = new DataStoreItemModel(); - - model.OriginalValue = local.Value; - model.Value = local.Value; - model.Guid = local.Guid; - model.Key = local.Key; - model.OriginalType = local.Type; - model.Type = local.Type; - model.Date = local.Date; - model.IsGlobal = false; - model.IsSynchronized = local.IsSynchronized; - - model.GlobalItem = globalItem; - - return model; - } - - public static DataStoreItemModel FromGlobalDataStoreItem(IDataStoreItem global) - { - DataStoreItemModel model = new DataStoreItemModel(); - - model.GlobalItem = global; - model.Guid = global.Guid; - model.Key = global.Key; - model.Type = global.Type; - model.OriginalType = global.Type; - model.Date = global.Date; - model.IsGlobal = true; - model.IsSynchronized = global.IsSynchronized; - - return model; - } - - public override string ToString() - { - if (this.Value != null) - { - return DataStoreHelper.FormatDataStoreItem(this); - } - else - { - return null; - } - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreModel.cs b/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreModel.cs deleted file mode 100644 index a68cc0af9..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/DataStoreModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core; - -namespace Tango.DataStore.Editing -{ - public class DataStoreModel : ExtendedObject - { - public ObservableCollection Collections { get; set; } - - public DataStoreModel() - { - Collections = new ObservableCollection(); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.DataStore.Editing/Properties/AssemblyInfo.cs deleted file mode 100644 index 9f04af8ea..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -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.DataStore.Editing")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Tango.DataStore.Editing")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[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 -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the 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/Tango.DataStore.Editing/Properties/Resources.Designer.cs b/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Resources.Designer.cs deleted file mode 100644 index c23f8f4eb..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Resources.Designer.cs +++ /dev/null @@ -1,62 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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.DataStore.Editing.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.DataStore.Editing.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/Tango.DataStore.Editing/Properties/Resources.resx b/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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/Tango.DataStore.Editing/Properties/Settings.Designer.cs b/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Settings.Designer.cs deleted file mode 100644 index 28f49dcd4..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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.DataStore.Editing.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/Tango.DataStore.Editing/Properties/Settings.settings b/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/Tango.DataStore.Editing.csproj b/Software/Visual_Studio/Tango.DataStore.Editing/Tango.DataStore.Editing.csproj deleted file mode 100644 index 4707dca0b..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/Tango.DataStore.Editing.csproj +++ /dev/null @@ -1,106 +0,0 @@ - - - - - Debug - AnyCPU - {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C} - library - Tango.DataStore.Editing - Tango.DataStore.Editing - v4.6.1 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - 4.0 - - - - - - - - - - MSBuild:Compile - Designer - - - Code - - - - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - {f441feee-322a-4943-b566-110e12fd3b72} - Tango.BL - - - {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} - Tango.Core - - - {e0364dfa-0721-4637-9d32-9d22aac109d6} - Tango.DataStore - - - {8491d07b-c1f6-4b62-a412-41b9fd2d6538} - Tango.SharedUI - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/Themes/Generic.xaml b/Software/Visual_Studio/Tango.DataStore.Editing/Themes/Generic.xaml deleted file mode 100644 index 795842292..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/Themes/Generic.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/UpdateDataStoreRequest.cs b/Software/Visual_Studio/Tango.DataStore.Editing/UpdateDataStoreRequest.cs deleted file mode 100644 index dc95ea6ae..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/UpdateDataStoreRequest.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.DTO; - -namespace Tango.DataStore.Editing -{ - public class UpdateDataStoreRequest - { - public List ToDelete { get; set; } - public List ToUpsert { get; set; } - - public UpdateDataStoreRequest() - { - ToDelete = new List(); - ToUpsert = new List(); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Editing/UpdateDataStoreResponse.cs b/Software/Visual_Studio/Tango.DataStore.Editing/UpdateDataStoreResponse.cs deleted file mode 100644 index 697ae341d..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Editing/UpdateDataStoreResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Editing -{ - public class UpdateDataStoreResponse - { - - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.LiteDB/LiteDBDataStoreCollection.cs b/Software/Visual_Studio/Tango.DataStore.LiteDB/LiteDBDataStoreCollection.cs deleted file mode 100644 index c76a3b6d9..000000000 --- a/Software/Visual_Studio/Tango.DataStore.LiteDB/LiteDBDataStoreCollection.cs +++ /dev/null @@ -1,113 +0,0 @@ -using LiteDB; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Lite -{ - public class LiteDBDataStoreCollection : IDataStoreCollection - { - private ILiteCollection _collection; - - public string Name { get; private set; } - - public LiteDBDataStoreCollection(ILiteCollection collection) - { - _collection = collection; - } - - public void Put(string key, T value) - { - Put(key, (object)value); - } - - public void Put(string key, object value) - { - Put(key, DataStoreHelper.GetDataType(value), value); - } - - public void Put(string key, DataType type, object value) - { - _collection.Upsert(new LiteDBDataStoreItem() - { - Key = key, - Date = DateTime.UtcNow, - Type = type, - Value = value, - IsSynchronized = false, - }); - } - - public T Get(string key) - { - return (T)Convert.ChangeType(Get(key), typeof(T)); - } - - public T Get(string key, T defaultValue) - { - return (T)Convert.ChangeType(Get(key, defaultValue), typeof(T)); - } - - public object Get(string key) - { - return Get(key, null); - } - - public object Get(string key, object defaultValue) - { - return GetItem(key, defaultValue).Value; - } - - public IDataStoreItem GetItem(string key) - { - return GetItem(key, null); - } - - public IDataStoreItem GetItem(string key, object defaultValue) - { - var item = _collection.FindById(key); - - if (item == null) - { - if (defaultValue == null) - { - throw new KeyNotFoundException("The specified key was not found on the data store."); - } - else - { - Put(key, defaultValue); - return GetItem(key); - } - } - - return item; - } - - public List GetAll() - { - return _collection.FindAll().ToList(); - } - - public void Delete(string key) - { - _collection.Delete(key); - } - - public void DeleteAll() - { - _collection.DeleteMany(x => true); - } - - public int Count() - { - return _collection.Count(); - } - - public List GetUnsynchronized() - { - return _collection.Find(x => !x.IsSynchronized).ToList(); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.LiteDB/LiteDBDataStoreItem.cs b/Software/Visual_Studio/Tango.DataStore.LiteDB/LiteDBDataStoreItem.cs deleted file mode 100644 index ba2e5748e..000000000 --- a/Software/Visual_Studio/Tango.DataStore.LiteDB/LiteDBDataStoreItem.cs +++ /dev/null @@ -1,30 +0,0 @@ -using LiteDB; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Lite -{ - public class LiteDBDataStoreItem : IDataStoreItem - { - public String Guid { get; set; } - [BsonId] - public string Key { get; set; } - public DataType Type { get; set; } - public object Value { get; set; } - public DateTime Date { get; set; } - public bool IsSynchronized { get; set; } - - public LiteDBDataStoreItem() - { - Guid = System.Guid.NewGuid().ToString(); - } - - public override string ToString() - { - return DataStoreHelper.FormatDataStoreItem(this); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.LiteDB/LiteDBDataStoreManager.cs b/Software/Visual_Studio/Tango.DataStore.LiteDB/LiteDBDataStoreManager.cs deleted file mode 100644 index 25abd91ab..000000000 --- a/Software/Visual_Studio/Tango.DataStore.LiteDB/LiteDBDataStoreManager.cs +++ /dev/null @@ -1,47 +0,0 @@ -using LiteDB; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Lite -{ - public class LiteDBDataStoreManager : IDataStoreManager - { - private bool _disposed; - private LiteDatabase _database; - - public String DatabasePath { get; private set; } - - public LiteDBDataStoreManager(String databasePath) - { - DatabasePath = databasePath; - Directory.CreateDirectory(Path.GetDirectoryName(DatabasePath)); - _database = new LiteDatabase($"Filename={DatabasePath}"); - _database.Pragma("TIMEOUT", 10); //Read Timeout - _database.Pragma("UTC_DATE", true); //Keep time as UTC when getting data - _database.Commit(); - } - - public IDataStoreCollection GetCollection(string name) - { - return new LiteDBDataStoreCollection(_database.GetCollection(name)); - } - - public List GetCollectionNames() - { - return _database.GetCollectionNames().ToList(); - } - - public void Dispose() - { - if (!_disposed) - { - _disposed = true; - _database.Dispose(); - } - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.LiteDB/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.DataStore.LiteDB/Properties/AssemblyInfo.cs deleted file mode 100644 index f1b35f107..000000000 --- a/Software/Visual_Studio/Tango.DataStore.LiteDB/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Tango - Data Store LiteDB Implementation")] -[assembly: AssemblyVersion("2.0.4.1608")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.LiteDB/Tango.DataStore.Lite.csproj b/Software/Visual_Studio/Tango.DataStore.LiteDB/Tango.DataStore.Lite.csproj deleted file mode 100644 index 2bf561432..000000000 --- a/Software/Visual_Studio/Tango.DataStore.LiteDB/Tango.DataStore.Lite.csproj +++ /dev/null @@ -1,66 +0,0 @@ - - - - - Debug - AnyCPU - {FA96BC0C-4055-475C-9DCC-70A5A9436B10} - Library - Properties - Tango.DataStore.Lite - Tango.DataStore.Lite - v4.6.1 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\LiteDB.5.0.4\lib\net45\LiteDB.dll - - - - - - - - - - - - - - GlobalVersionInfo.cs - - - - - - - - - {e0364dfa-0721-4637-9d32-9d22aac109d6} - Tango.DataStore - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.LiteDB/packages.config b/Software/Visual_Studio/Tango.DataStore.LiteDB/packages.config deleted file mode 100644 index 9dcac7837..000000000 --- a/Software/Visual_Studio/Tango.DataStore.LiteDB/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.DataStore.Remote/Properties/AssemblyInfo.cs deleted file mode 100644 index 808b25d41..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Tango - Data Store Remote Messages")] -[assembly: AssemblyVersion("2.0.4.1608")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCollection.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCollection.cs deleted file mode 100644 index e4453fafc..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCollection.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreCollection - { - public String Name { get; set; } - public List Items { get; set; } - - public RemoteDataStoreCollection() - { - Items = new List(); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCountRequest.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCountRequest.cs deleted file mode 100644 index 84ba279fb..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCountRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreCountRequest - { - public String Collection { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCountResponse.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCountResponse.cs deleted file mode 100644 index 71d4e13b2..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreCountResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreCountResponse - { - public int Count { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteAllRequest.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteAllRequest.cs deleted file mode 100644 index ab5406611..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteAllRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreDeleteAllRequest - { - public String Collection { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteAllResponse.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteAllResponse.cs deleted file mode 100644 index b5ddc0b64..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteAllResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreDeleteAllResponse - { - - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteRequest.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteRequest.cs deleted file mode 100644 index 13d400154..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteRequest.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreDeleteRequest - { - public String Collection { get; set; } - public String Key { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteResponse.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteResponse.cs deleted file mode 100644 index 07bb40a8b..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreDeleteResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreDeleteResponse - { - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsRequest.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsRequest.cs deleted file mode 100644 index a285cd5c1..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsRequest.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreGetAllItemsRequest - { - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsResponse.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsResponse.cs deleted file mode 100644 index 3afb22c1e..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllItemsResponse.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreGetAllItemsResponse - { - public List Collections { get; set; } - - public RemoteDataStoreGetAllItemsResponse() - { - Collections = new List(); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllRequest.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllRequest.cs deleted file mode 100644 index 747a5cb2f..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreGetAllRequest - { - public String Collection { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllResponse.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllResponse.cs deleted file mode 100644 index 2d9e0f527..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetAllResponse.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreGetAllResponse - { - public List Items { get; set; } - - public RemoteDataStoreGetAllResponse() - { - Items = new List(); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesRequest.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesRequest.cs deleted file mode 100644 index 6299f7512..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesRequest.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreGetCollectionNamesRequest - { - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesResponse.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesResponse.cs deleted file mode 100644 index fe98b73fc..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetCollectionNamesResponse.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreGetCollectionNamesResponse - { - public List Names { get; set; } - - public RemoteDataStoreGetCollectionNamesResponse() - { - Names = new List(); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetItemRequest.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetItemRequest.cs deleted file mode 100644 index 7d16a0f38..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetItemRequest.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreGetItemRequest - { - public String Collection { get; set; } - public String Key { get; set; } - public Object DefaultValue { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetItemResponse.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetItemResponse.cs deleted file mode 100644 index 82393a786..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetItemResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreGetItemResponse - { - public RemoteDataStoreItem Item { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetRequest.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetRequest.cs deleted file mode 100644 index 4b8e9ee47..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetRequest.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreGetRequest - { - public String Collection { get; set; } - public String Key { get; set; } - public Object DefaultValue { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetResponse.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetResponse.cs deleted file mode 100644 index cc3b157e8..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreGetResponse.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreGetResponse - { - public DataType DataType { get; set; } - - private Object _value; - public Object Value - { - get - { - return DataType == DataType.Proto ? ProtoObject : _value; - } - set - { - if (value is DataStoreProtoObject protoValue) - { - ProtoObject = protoValue; - } - else - { - _value = value; - } - } - } - - public DataStoreProtoObject ProtoObject { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreItem.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreItem.cs deleted file mode 100644 index 4327a0bd6..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreItem.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreItem : IDataStoreItem - { - public string Guid { get; set; } - public string Key { get; set; } - public DataType Type { get; set; } - - private object _value; - public object Value - { - get - { - if (_value is JObject jObject) - { - return (jObject.ToObject()); - } - else - { - return _value; - } - } - set { _value = value; } - } - - public DateTime Date { get; set; } - public bool IsSynchronized { get; set; } - - public RemoteDataStoreItem() - { - Guid = System.Guid.NewGuid().ToString(); - Date = DateTime.UtcNow; - } - - public override string ToString() - { - return DataStoreHelper.FormatDataStoreItem(this); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStorePutRequest.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStorePutRequest.cs deleted file mode 100644 index 77aa5e41f..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStorePutRequest.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStorePutRequest - { - public String Collection { get; set; } - public DataType DataType { get; set; } - public String Key { get; set; } - - private Object _value; - public Object Value - { - get - { - return DataType == DataType.Proto ? ProtoObject : _value; - } - set - { - if (value is DataStoreProtoObject protoValue) - { - ProtoObject = protoValue; - } - else - { - _value = value; - } - } - } - - public DataStoreProtoObject ProtoObject { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStorePutResponse.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStorePutResponse.cs deleted file mode 100644 index 7dd92490a..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStorePutResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStorePutResponse - { - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreStartListenRequest.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreStartListenRequest.cs deleted file mode 100644 index b8da17012..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreStartListenRequest.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public class RemoteDataStoreStartListenRequest - { - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreStartListenResponse.cs b/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreStartListenResponse.cs deleted file mode 100644 index c2a6c24a6..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/RemoteDataStoreStartListenResponse.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore.Remote -{ - public enum RemoteDataStoreChangeType - { - None, - Modified - } - - public class RemoteDataStoreStartListenResponse - { - public RemoteDataStoreChangeType ChangeType { get; set; } - public String CollectionName { get; set; } - public RemoteDataStoreItem Item { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/Tango.DataStore.Remote.csproj b/Software/Visual_Studio/Tango.DataStore.Remote/Tango.DataStore.Remote.csproj deleted file mode 100644 index 8618affdd..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/Tango.DataStore.Remote.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - - Debug - AnyCPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA} - Library - Properties - Tango.DataStore.Remote - Tango.DataStore.Remote - v4.6.1 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll - - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - - - - - - - - - - - - - GlobalVersionInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - {e0364dfa-0721-4637-9d32-9d22aac109d6} - Tango.DataStore - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore.Remote/packages.config b/Software/Visual_Studio/Tango.DataStore.Remote/packages.config deleted file mode 100644 index 026e719c3..000000000 --- a/Software/Visual_Studio/Tango.DataStore.Remote/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore/DataStoreHelper.cs b/Software/Visual_Studio/Tango.DataStore/DataStoreHelper.cs deleted file mode 100644 index 0ca8e484e..000000000 --- a/Software/Visual_Studio/Tango.DataStore/DataStoreHelper.cs +++ /dev/null @@ -1,160 +0,0 @@ -using Google.Protobuf; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.ExtensionMethods; -using Tango.PMR; -using Tango.PMR.Common; - -namespace Tango.DataStore -{ - /// - /// Contains data store helper methods. - /// - public static class DataStoreHelper - { - /// - /// Gets the data store data type by the specified object type. - /// - /// The value. - /// - public static DataType GetDataType(Object value) - { - return GetDataType(value.GetType()); - } - - /// - /// Gets data store data type by the specified .net type. - /// - /// The type. - /// - /// - public static DataType GetDataType(Type type) - { - if (type == typeof(int)) - { - return DataType.Int32; - } - else if (type == typeof(Int64)) - { - return DataType.Int32; - } - else if (type == typeof(float)) - { - return DataType.Float; - } - else if (type == typeof(double)) - { - return DataType.Double; - } - else if (type == typeof(String)) - { - return DataType.String; - } - else if (type == typeof(bool)) - { - return DataType.Boolean; - } - else if (type == typeof(byte[])) - { - return DataType.Bytes; - } - else if (type == typeof(DataStoreProtoObject)) - { - return DataType.Proto; - } - else if (typeof(IMessage).IsAssignableFrom(type)) - { - return DataType.Proto; - } - - throw new NotSupportedException($"The specified type '{type.Name}' is not supported by the data store."); - } - - /// - /// Formats the data store item as a string. - /// - /// The item. - /// - public static String FormatDataStoreItem(IDataStoreItem item) - { - if (item.Type == DataType.Bytes) - { - return GetByteArrayHexString((byte[])item.Value); - } - else if (item.Type == DataType.Proto) - { - return (item.Value as DataStoreProtoObject).Message.ToJsonString(); - } - else - { - return item.Value.ToStringSafe(); - } - } - - /// - /// Returns a byte array string representation in hex format. - /// - /// The data. - /// - public static String GetByteArrayHexString(byte[] data) - { - StringBuilder hex = new StringBuilder(); - foreach (byte b in data) - { - hex.Append(b.ToString("X2") + " "); - } - return hex.ToString(); - } - - /// - /// Parses a data store value from a string. - /// - /// The type. - /// The string. - /// Type of the proto message (if type is Proto). - /// - /// No PMR message type specified. - /// The specified data store type is not supported. - public static Object ParseDataStoreValue(DataType type, String text, MessageType? protoMessageType = null) - { - switch (type) - { - case DataType.String: - return text; - case DataType.Int32: - return int.Parse(text); - case DataType.Float: - return float.Parse(text); - case DataType.Double: - return double.Parse(text); - case DataType.Boolean: - return bool.Parse(text); - case DataType.Proto: - if (protoMessageType == null) throw new ArgumentNullException("No PMR message type specified."); - var messageType = MessageFactory.GetPMRTypeFromMessageType(protoMessageType.Value); - var instance = Activator.CreateInstance(messageType) as IMessage; - instance = instance.GetParser().ParseJson(text); - return DataStoreProtoObject.FromMessage(instance); - case DataType.Bytes: - string[] hexValuesSplit = text.Split(' '); - List bytes = new List(); - foreach (string hex in hexValuesSplit) - { - if (hex.IsNotNullOrEmpty()) - { - byte b = (byte)Convert.ToInt32(hex.Trim(), 16); - bytes.Add(b); - } - } - return bytes.ToArray(); - } - - throw new NotSupportedException("The specified data store type is not supported."); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore/DataStoreProtoObject.cs b/Software/Visual_Studio/Tango.DataStore/DataStoreProtoObject.cs deleted file mode 100644 index 5aa7c5342..000000000 --- a/Software/Visual_Studio/Tango.DataStore/DataStoreProtoObject.cs +++ /dev/null @@ -1,83 +0,0 @@ -using Google.Protobuf; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.Bson; -using Tango.Core.ExtensionMethods; -using Tango.PMR; -using Tango.PMR.Common; -using Tango.PMR.DataStore; - -namespace Tango.DataStore -{ - public class DataStoreProtoObject - { - public MessageType MessageType { get; set; } - public Type Type { get; set; } - public byte[] Data { get; set; } - - - private IMessage _message; - [JsonIgnore] - public IMessage Message - { - get - { - if (_message == null) - { - _message = MessageFactory.ParseProtoMessage(Data, Type); - } - - return _message; - } - private set { _message = value; } - } - - public byte[] ToBytes() - { - return BsonConvert.Serialize(this); - } - - public static DataStoreProtoObject FromBytes(byte[] data) - { - var instance = BsonConvert.Deserialize(data); - instance.Message = MessageFactory.ParseProtoMessage(instance.Data, instance.Type); - - return instance; - } - - public static DataStoreProtoObject FromMessage(IMessage message) - { - DataStoreProtoObject proto = new DataStoreProtoObject(); - proto.Type = message.GetType(); - proto.MessageType = MessageFactory.ParseMessageType(proto.Type.Name); - proto.Data = message.ToByteArray(); - proto.Message = message; - return proto; - } - - public static DataStoreProtoObject FromJObject(JObject obj) - { - return (obj.ToObject()); - } - - public static DataStoreProtoObject FromPMRDataStoreItem(DataStoreItem item) - { - DataStoreProtoObject proto = new DataStoreProtoObject(); - proto.MessageType = item.ProtoType; - proto.Type = MessageFactory.GetPMRTypeFromMessageType(item.ProtoType); - proto.Data = item.BytesValue.ToByteArray(); - return proto; - } - - public override string ToString() - { - return Message?.ToJsonString(); - } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore/DataType.cs b/Software/Visual_Studio/Tango.DataStore/DataType.cs deleted file mode 100644 index 132bff28e..000000000 --- a/Software/Visual_Studio/Tango.DataStore/DataType.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore -{ - /// - /// Represents a data store item type. - /// - public enum DataType - { - Int32, - Float, - Double, - Boolean, - String, - Bytes, - Proto - } -} diff --git a/Software/Visual_Studio/Tango.DataStore/ExtensionMethods.cs b/Software/Visual_Studio/Tango.DataStore/ExtensionMethods.cs deleted file mode 100644 index acc381a61..000000000 --- a/Software/Visual_Studio/Tango.DataStore/ExtensionMethods.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Google.Protobuf; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.DataStore; - -public static class ExtensionMethods -{ - public static DataStoreProtoObject ToDataStoreProtoObject(IMessage message) - { - return DataStoreProtoObject.FromMessage(message); - } -} - diff --git a/Software/Visual_Studio/Tango.DataStore/IDataStoreCollection.cs b/Software/Visual_Studio/Tango.DataStore/IDataStoreCollection.cs deleted file mode 100644 index baca95c67..000000000 --- a/Software/Visual_Studio/Tango.DataStore/IDataStoreCollection.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore -{ - /// - /// Represents a data store collection. - /// - public interface IDataStoreCollection - { - /// - /// Gets the collection name. - /// - String Name { get; } - - /// - /// Upserts the specified key and value. - /// - /// The key. - /// The value. - void Put(String key, Object value); - - /// - /// Upserts the specified key and value of type T. - /// - /// - /// The key. - /// The value. - void Put(String key, T value); - - /// - /// Upserts the specified key and value. - /// The value must be of the specified DataType. - /// - /// The key. - /// The type. - /// The value. - void Put(String key, DataType type, Object value); - - /// - /// Gets the value by the specified key - /// - /// The key. - /// - Object Get(String key); - - /// - /// Gets the value by the specified key - /// - /// The key. - /// Will execute put when the key was not found. - /// - Object Get(String key, Object defaultValue); - - /// - /// Gets the value of type T by the specified key - /// - /// - /// The key. - /// - T Get(String key); - - /// - /// Gets the value of type T by the specified key - /// - /// - /// The key. - /// Will execute put when the key was not found. - /// - T Get(String key, T defaultValue); - - /// - /// Gets the full data store item by the specified key. - /// - /// The key. - /// - IDataStoreItem GetItem(String key); - - /// - /// Gets the full data store item by the specified key. - /// - /// The key. - /// Will execute put when the key was not found. - /// - IDataStoreItem GetItem(String key, Object defaultValue); - - /// - /// Gets all the data store items in the collection. - /// - /// - List GetAll(); - - /// - /// Gets all the data store unsynchronized items in the collection. - /// - /// - List GetUnsynchronized(); - - /// - /// Deleted an item by the specified key. - /// - /// The key. - void Delete(String key); - - /// - /// Deletes all items in the collection. - /// - void DeleteAll(); - - /// - /// Returns the number of items in the collection. - /// - /// - int Count(); - } -} diff --git a/Software/Visual_Studio/Tango.DataStore/IDataStoreItem.cs b/Software/Visual_Studio/Tango.DataStore/IDataStoreItem.cs deleted file mode 100644 index 9c03f40ee..000000000 --- a/Software/Visual_Studio/Tango.DataStore/IDataStoreItem.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore -{ - /// - /// Represents a data store item. - /// - public interface IDataStoreItem - { - /// - /// Gets or sets the unique identifier (Use only for synchronization). - /// - String Guid { get; set; } - - /// - /// Gets or sets item id. - /// - String Key { get; set; } - - /// - /// Gets or sets the item type. - /// - DataType Type { get; set; } - - /// - /// Gets or sets the item value. - /// - Object Value { get; set; } - - /// - /// Gets or sets the item update UTC date. - /// - DateTime Date { get; set; } - - /// - /// Gets or sets a value indicating whether this item is synchronized with the remote service. - /// - bool IsSynchronized { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DataStore/IDataStoreManager.cs b/Software/Visual_Studio/Tango.DataStore/IDataStoreManager.cs deleted file mode 100644 index 5443f12e2..000000000 --- a/Software/Visual_Studio/Tango.DataStore/IDataStoreManager.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.DataStore -{ - /// - /// Represents a key/value data store manager. - /// - /// - public interface IDataStoreManager : IDisposable - { - /// - /// Gets the data store collection by name. - /// - /// The name. - /// - IDataStoreCollection GetCollection(String name); - - /// - /// Gets all the collection names. - /// - /// - List GetCollectionNames(); - } -} diff --git a/Software/Visual_Studio/Tango.DataStore/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.DataStore/Properties/AssemblyInfo.cs deleted file mode 100644 index 8e9365e03..000000000 --- a/Software/Visual_Studio/Tango.DataStore/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Tango - Data Store Library")] -[assembly: AssemblyVersion("2.0.4.1608")] -[assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore/Tango.DataStore.csproj b/Software/Visual_Studio/Tango.DataStore/Tango.DataStore.csproj deleted file mode 100644 index c12abe9e8..000000000 --- a/Software/Visual_Studio/Tango.DataStore/Tango.DataStore.csproj +++ /dev/null @@ -1,78 +0,0 @@ - - - - - Debug - AnyCPU - {E0364DFA-0721-4637-9D32-9D22AAC109D6} - Library - Properties - Tango.DataStore - Tango.DataStore - v4.6.1 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Tango.DataStore.xml - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Tango.DataStore.xml - - - - ..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll - - - ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll - - - - - - - - - - - - - GlobalVersionInfo.cs - - - - - - - - - - - - - - - - {A34EE0F0-649D-41C8-8489-B6F1CC6924EE} - Tango.Core - - - {e4927038-348d-4295-aaf4-861c58cb3943} - Tango.PMR - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.DataStore/packages.config b/Software/Visual_Studio/Tango.DataStore/packages.config deleted file mode 100644 index 026e719c3..000000000 --- a/Software/Visual_Studio/Tango.DataStore/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index b24079da0..4d76daabc 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -173,6 +173,22 @@ + + {88d9906b-8fc4-4fe0-b7eb-127a0a8fcee4} + Tango.DataStore.EF + + + {fa96bc0c-4055-475c-9dcc-70a5a9436b10} + Tango.DataStore.Lite + + + {29448f3c-9b3e-4da6-8555-46a8b9a6b3aa} + Tango.DataStore.Remote + + + {e0364dfa-0721-4637-9d32-9d22aac109d6} + Tango.DataStore + {1674f726-0e66-414f-b9fd-c6f20d7f07c7} Tango.MachineStudio.Logging @@ -213,22 +229,6 @@ {38197109-8610-4d3f-92b9-16d48df94d7c} Tango.DAL.Remote - - {88d9906b-8fc4-4fe0-b7eb-127a0a8fcee4} - Tango.DataStore.EF - - - {fa96bc0c-4055-475c-9dcc-70a5a9436b10} - Tango.DataStore.Lite - - - {29448f3c-9b3e-4da6-8555-46a8b9a6b3aa} - Tango.DataStore.Remote - - - {e0364dfa-0721-4637-9d32-9d22aac109d6} - Tango.DataStore - {ca87a608-7b17-4c98-88f2-42abee10f4c1} Tango.Documents @@ -323,7 +323,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 64f19da67..3fe0dea56 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -419,17 +419,19 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Git", "Tango.Git\Tang EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.PPC.Packages.Auth2", "PPC\UpdatePackages\Tango.PPC.Packages.Auth2\Tango.PPC.Packages.Auth2.csproj", "{EA4233F1-4B7B-4CCF-A6DE-2D17612EBA90}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore", "Tango.DataStore\Tango.DataStore.csproj", "{E0364DFA-0721-4637-9D32-9D22AAC109D6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.MachineConfiguration", "FSE\Modules\Tango.FSE.MachineConfiguration\Tango.FSE.MachineConfiguration.csproj", "{15BCB5BB-731E-4E2D-AA28-75485050A8DC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.Lite", "Tango.DataStore.LiteDB\Tango.DataStore.Lite.csproj", "{FA96BC0C-4055-475C-9DCC-70A5A9436B10}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataStore", "DataStore", "{3F723D53-3539-42D1-8570-395BF660928D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.Remote", "Tango.DataStore.Remote\Tango.DataStore.Remote.csproj", "{29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore", "DataStore\Tango.DataStore\Tango.DataStore.csproj", "{E0364DFA-0721-4637-9D32-9D22AAC109D6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.EF", "Tango.DataStore.EF\Tango.DataStore.EF.csproj", "{88D9906B-8FC4-4FE0-B7EB-127A0A8FCEE4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.Lite", "DataStore\Tango.DataStore.LiteDB\Tango.DataStore.Lite.csproj", "{FA96BC0C-4055-475C-9DCC-70A5A9436B10}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.MachineConfiguration", "FSE\Modules\Tango.FSE.MachineConfiguration\Tango.FSE.MachineConfiguration.csproj", "{15BCB5BB-731E-4E2D-AA28-75485050A8DC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.EF", "DataStore\Tango.DataStore.EF\Tango.DataStore.EF.csproj", "{88D9906B-8FC4-4FE0-B7EB-127A0A8FCEE4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.Remote", "DataStore\Tango.DataStore.Remote\Tango.DataStore.Remote.csproj", "{29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.Editing", "Tango.DataStore.Editing\Tango.DataStore.Editing.csproj", "{EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.Editing", "DataStore\Tango.DataStore.Editing\Tango.DataStore.Editing.csproj", "{EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -3958,6 +3960,26 @@ Global {EA4233F1-4B7B-4CCF-A6DE-2D17612EBA90}.Release|x64.Build.0 = Release|Any CPU {EA4233F1-4B7B-4CCF-A6DE-2D17612EBA90}.Release|x86.ActiveCfg = Release|Any CPU {EA4233F1-4B7B-4CCF-A6DE-2D17612EBA90}.Release|x86.Build.0 = Release|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|ARM.ActiveCfg = Debug|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|ARM.Build.0 = Debug|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|ARM64.Build.0 = Debug|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|x64.ActiveCfg = Debug|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|x64.Build.0 = Debug|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|x86.ActiveCfg = Debug|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|x86.Build.0 = Debug|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|ARM.ActiveCfg = Release|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|ARM.Build.0 = Release|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|ARM64.ActiveCfg = Release|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|ARM64.Build.0 = Release|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|x64.ActiveCfg = Release|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|x64.Build.0 = Release|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|x86.ActiveCfg = Release|Any CPU + {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|x86.Build.0 = Release|Any CPU {E0364DFA-0721-4637-9D32-9D22AAC109D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E0364DFA-0721-4637-9D32-9D22AAC109D6}.Debug|Any CPU.Build.0 = Debug|Any CPU {E0364DFA-0721-4637-9D32-9D22AAC109D6}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -3998,26 +4020,6 @@ Global {FA96BC0C-4055-475C-9DCC-70A5A9436B10}.Release|x64.Build.0 = Release|Any CPU {FA96BC0C-4055-475C-9DCC-70A5A9436B10}.Release|x86.ActiveCfg = Release|Any CPU {FA96BC0C-4055-475C-9DCC-70A5A9436B10}.Release|x86.Build.0 = Release|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|ARM.ActiveCfg = Debug|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|ARM.Build.0 = Debug|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|ARM64.Build.0 = Debug|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|x64.ActiveCfg = Debug|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|x64.Build.0 = Debug|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|x86.ActiveCfg = Debug|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|x86.Build.0 = Debug|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|Any CPU.Build.0 = Release|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|ARM.ActiveCfg = Release|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|ARM.Build.0 = Release|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|ARM64.ActiveCfg = Release|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|ARM64.Build.0 = Release|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|x64.ActiveCfg = Release|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|x64.Build.0 = Release|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|x86.ActiveCfg = Release|Any CPU - {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|x86.Build.0 = Release|Any CPU {88D9906B-8FC4-4FE0-B7EB-127A0A8FCEE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {88D9906B-8FC4-4FE0-B7EB-127A0A8FCEE4}.Debug|Any CPU.Build.0 = Debug|Any CPU {88D9906B-8FC4-4FE0-B7EB-127A0A8FCEE4}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -4038,26 +4040,26 @@ Global {88D9906B-8FC4-4FE0-B7EB-127A0A8FCEE4}.Release|x64.Build.0 = Release|Any CPU {88D9906B-8FC4-4FE0-B7EB-127A0A8FCEE4}.Release|x86.ActiveCfg = Release|Any CPU {88D9906B-8FC4-4FE0-B7EB-127A0A8FCEE4}.Release|x86.Build.0 = Release|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|ARM.ActiveCfg = Debug|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|ARM.Build.0 = Debug|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|ARM64.Build.0 = Debug|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|x64.ActiveCfg = Debug|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|x64.Build.0 = Debug|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|x86.ActiveCfg = Debug|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Debug|x86.Build.0 = Debug|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|Any CPU.Build.0 = Release|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|ARM.ActiveCfg = Release|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|ARM.Build.0 = Release|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|ARM64.ActiveCfg = Release|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|ARM64.Build.0 = Release|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|x64.ActiveCfg = Release|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|x64.Build.0 = Release|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|x86.ActiveCfg = Release|Any CPU - {15BCB5BB-731E-4E2D-AA28-75485050A8DC}.Release|x86.Build.0 = Release|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|ARM.ActiveCfg = Debug|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|ARM.Build.0 = Debug|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|ARM64.Build.0 = Debug|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|x64.ActiveCfg = Debug|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|x64.Build.0 = Debug|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|x86.ActiveCfg = Debug|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Debug|x86.Build.0 = Debug|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|Any CPU.Build.0 = Release|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|ARM.ActiveCfg = Release|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|ARM.Build.0 = Release|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|ARM64.ActiveCfg = Release|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|ARM64.Build.0 = Release|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|x64.ActiveCfg = Release|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|x64.Build.0 = Release|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|x86.ActiveCfg = Release|Any CPU + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA}.Release|x86.Build.0 = Release|Any CPU {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|Any CPU.Build.0 = Debug|Any CPU {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -4222,6 +4224,11 @@ Global {69168924-9AA8-447D-AD64-F07DBF4F0909} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760} {EA4233F1-4B7B-4CCF-A6DE-2D17612EBA90} = {E728CBD9-1AF4-4814-A218-E4BD26E7EDEA} {15BCB5BB-731E-4E2D-AA28-75485050A8DC} = {4EE6DBA1-71BC-49E2-8DC7-266487E61050} + {E0364DFA-0721-4637-9D32-9D22AAC109D6} = {3F723D53-3539-42D1-8570-395BF660928D} + {FA96BC0C-4055-475C-9DCC-70A5A9436B10} = {3F723D53-3539-42D1-8570-395BF660928D} + {88D9906B-8FC4-4FE0-B7EB-127A0A8FCEE4} = {3F723D53-3539-42D1-8570-395BF660928D} + {29448F3C-9B3E-4DA6-8555-46A8B9A6B3AA} = {3F723D53-3539-42D1-8570-395BF660928D} + {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C} = {3F723D53-3539-42D1-8570-395BF660928D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution BuildVersion_UseGlobalSettings = False -- cgit v1.3.1 From c39d31f1095bda6bda2755100f9f8df3da1eb93d Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 16 Nov 2020 16:13:30 +0200 Subject: Implemented workaround for none twine users testing on FSE login. --- .../FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'Software/Visual_Studio/FSE') diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs index 70a68918a..67b8a1145 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LoginViewVM.cs @@ -69,6 +69,11 @@ namespace Tango.FSE.UI.ViewModels set { _email = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(DisplayEnvironment)); InvalidateRelayCommands(); } } + public String ProcessedEmail + { + get { return Email.ToStringOrEmpty().EndsWith("TEST") ? Email.Replace("TEST", "") : Email; } + } + private String _password; /// /// Gets or sets the user password. @@ -158,7 +163,7 @@ namespace Tango.FSE.UI.ViewModels /// public bool DisplayEnvironment { - get { return Email.IsNotNullOrEmpty() && Email.ToLower().EndsWith("@twine-s.com"); } + get { return Email.IsNotNullOrEmpty() && (Email.ToLower().EndsWith("@twine-s.com") || Email.EndsWith("TEST")); } } #endregion @@ -288,7 +293,7 @@ namespace Tango.FSE.UI.ViewModels { try { - LogManager.Log($"Logging in user '{Email}'..."); + LogManager.Log($"Logging in user '{ProcessedEmail}'..."); if (!Validate()) { @@ -303,7 +308,7 @@ namespace Tango.FSE.UI.ViewModels } SelectedView = LoginViews.Logging; - var result = await AuthenticationProvider.Login(Email, Password, SelectedEnvironment, (status) => Status = status); + var result = await AuthenticationProvider.Login(ProcessedEmail, Password, SelectedEnvironment, (status) => Status = status); if (result.Response.PasswordChangeRequired) { @@ -327,7 +332,7 @@ namespace Tango.FSE.UI.ViewModels } catch (Exception ex) { - LogManager.Log(ex, $"Error occurred while trying to login user '{Email}'."); + LogManager.Log(ex, $"Error occurred while trying to login user '{ProcessedEmail}'."); IsFree = true; SelectedView = LoginViews.Login; await NotificationProvider.ShowError(GetErrorMessage(ex)); @@ -379,7 +384,7 @@ namespace Tango.FSE.UI.ViewModels IsFree = false; SelectedView = LoginViews.ChangingPassword; await Task.Delay(1000); - await AuthenticationProvider.ChangePassword(Email, CurrentPassword, NewPassword); + await AuthenticationProvider.ChangePassword(ProcessedEmail, CurrentPassword, NewPassword); Password = null; SelectedView = LoginViews.Login; Status = "Password changed..."; @@ -387,7 +392,7 @@ namespace Tango.FSE.UI.ViewModels } catch (Exception ex) { - LogManager.Log(ex, $"Error updating password for user '{Email}'."); + LogManager.Log(ex, $"Error updating password for user '{ProcessedEmail}'."); await NotificationProvider.ShowError($"Error updating your password.\n{ex.FlattenMessage()}"); SelectedView = LoginViews.ChangePassword; } @@ -428,7 +433,7 @@ namespace Tango.FSE.UI.ViewModels { IsFree = false; SelectedView = LoginViews.SendingForgotPasswordEmail; - await Services.AuthenticationService.SendForgotPasswordEmail(Email, SelectedEnvironment); + await Services.AuthenticationService.SendForgotPasswordEmail(ProcessedEmail, SelectedEnvironment); SelectedView = LoginViews.Login; await NotificationProvider.ShowSuccess("The email was delivered successfully!\nPlease check your email account."); } -- cgit v1.3.1 From 6f0f2a7908884deab8aca33ec967d03c5e564060 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Mon, 16 Nov 2020 18:32:04 +0200 Subject: Working on DataStore WebAPI. Modified data store bytes parsing to Base64. --- .../Tango.DataStore.EF/EFDataStoreHelper.cs | 16 +++- .../Tango.DataStore.EF/ExtensionMethods.cs | 9 ++- .../Tango.DataStore.Web/DataStoreWebHelper.cs | 16 ++++ .../Tango.DataStore.Web/DataStoreWebItem.cs | 26 +++++++ .../Tango.DataStore.Web/DataStoreWebItemType.cs | 14 ++++ .../Tango.DataStore.Web/DataStoreWebPutItem.cs | 28 +++++++ .../Tango.DataStore.Web/ExtensionMethods.cs | 12 +++ .../Tango.DataStore.Web/Properties/AssemblyInfo.cs | 36 +++++++++ .../Tango.DataStore.Web/Tango.DataStore.Web.csproj | 71 ++++++++++++++++++ .../DataStore/Tango.DataStore.Web/packages.config | 5 ++ .../DataStore/Tango.DataStore/DataStoreHelper.cs | 41 ++++------- .../Dialogs/DataStoreItemEditDialogViewVM.cs | 2 +- .../ViewModels/DataStoreViewVM.cs | 24 ++++-- .../ViewModels/SelectionViewVM.cs | 17 ++++- .../Views/SelectionView.xaml | 2 +- .../DataStore/DefaultDataStoreProvider.cs | 27 ++++++- .../DataStore/DefaultDataStoreService.cs | 33 +++++++++ Software/Visual_Studio/Tango.sln | 23 ++++++ .../Controllers/DataStoreController.cs | 85 ++++++++++++++++++++-- .../DataStore/DataStoreWebItem.cs | 26 ------- .../DataStore/DataStoreWebItemType.cs | 14 ---- .../Tango.MachineService.csproj | 6 +- 22 files changed, 441 insertions(+), 92 deletions(-) create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebHelper.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebItem.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebItemType.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebPutItem.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Web/ExtensionMethods.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Web/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Web/Tango.DataStore.Web.csproj create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.Web/packages.config delete mode 100644 Software/Visual_Studio/Web/Tango.MachineService/DataStore/DataStoreWebItem.cs delete mode 100644 Software/Visual_Studio/Web/Tango.MachineService/DataStore/DataStoreWebItemType.cs (limited to 'Software/Visual_Studio/FSE') diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.EF/EFDataStoreHelper.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.EF/EFDataStoreHelper.cs index 85b3b6731..5e885458b 100644 --- a/Software/Visual_Studio/DataStore/Tango.DataStore.EF/EFDataStoreHelper.cs +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.EF/EFDataStoreHelper.cs @@ -89,11 +89,12 @@ namespace Tango.DataStore.EF }; } - public static DataStoreItem CreateDbDataStoreItem(IDataStoreItem item) + public static DataStoreItem CreateLocalDbDataStoreItem(IDataStoreItem item, String collection) { return new DataStoreItem() { Guid = item.Guid, + CollectionName = collection, LastUpdated = item.Date, IsSynchronized = item.IsSynchronized, Key = item.Key, @@ -101,5 +102,18 @@ namespace Tango.DataStore.EF Value = CreateBytes(item.Type, item.Value) }; } + + public static GlobalDataStoreItem CreateGlobalDbDataStoreItem(IDataStoreItem item, String collection) + { + return new GlobalDataStoreItem() + { + Guid = item.Guid, + CollectionName = collection, + LastUpdated = item.Date, + Key = item.Key, + DataType = (int)item.Type, + Value = CreateBytes(item.Type, item.Value) + }; + } } } diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.EF/ExtensionMethods.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.EF/ExtensionMethods.cs index 9f09ae658..6d45a69e7 100644 --- a/Software/Visual_Studio/DataStore/Tango.DataStore.EF/ExtensionMethods.cs +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.EF/ExtensionMethods.cs @@ -19,9 +19,14 @@ public static class ExtensionMethods return EFDataStoreHelper.CreateDataStoreItem(item); } - public static DataStoreItem ToDbDataStoreItem(this IDataStoreItem item) + public static DataStoreItem ToLocalDbDataStoreItem(this IDataStoreItem item, String collection) { - return EFDataStoreHelper.CreateDbDataStoreItem(item); + return EFDataStoreHelper.CreateLocalDbDataStoreItem(item, collection); + } + + public static GlobalDataStoreItem ToGlobalDbDataStoreItem(this IDataStoreItem item, String collection) + { + return EFDataStoreHelper.CreateGlobalDbDataStoreItem(item, collection); } } diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebHelper.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebHelper.cs new file mode 100644 index 000000000..2353a70fe --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebHelper.cs @@ -0,0 +1,16 @@ +using Google.Protobuf; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PMR; +using Tango.PMR.Common; + +namespace Tango.DataStore.Web +{ + public static class DataStoreWebHelper + { + + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebItem.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebItem.cs new file mode 100644 index 000000000..a847517b1 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebItem.cs @@ -0,0 +1,26 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using Tango.DataStore; +using Tango.PMR.Common; + +namespace Tango.DataStore.Web +{ + public class DataStoreWebItem + { + public String Collection { get; set; } + [JsonConverter(typeof(StringEnumConverter))] + public DataStoreWebItemType Type { get; set; } + public DateTime Date { get; set; } + public String Key { get; set; } + [JsonConverter(typeof(StringEnumConverter))] + public DataType DataType { get; set; } + [JsonConverter(typeof(StringEnumConverter))] + public MessageType ProtoMessageType { get; set; } + public Object LocalValue { get; set; } + public Object GlobalValue { get; set; } + } +} \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebItemType.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebItemType.cs new file mode 100644 index 000000000..684997bf4 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebItemType.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace Tango.DataStore.Web +{ + public enum DataStoreWebItemType + { + Local, + Global, + Overrides + } +} \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebPutItem.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebPutItem.cs new file mode 100644 index 000000000..6b897c82a --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/DataStoreWebPutItem.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PMR.Common; + +namespace Tango.DataStore.Web +{ + public class DataStoreWebPutItem + { + public String MachineSerialNumber { get; set; } + + public String Collection { get; set; } + + public String Key { get; set; } + + [JsonConverter(typeof(StringEnumConverter))] + public DataType DataType { get; set; } + + [JsonConverter(typeof(StringEnumConverter))] + public MessageType ProtoMessageType { get; set; } + + public Object Value { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Web/ExtensionMethods.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/ExtensionMethods.cs new file mode 100644 index 000000000..a0959ae27 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/ExtensionMethods.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.DataStore.Web +{ + public class ExtensionMethods + { + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Web/Properties/AssemblyInfo.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..27f57a100 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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.DataStore.Web")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.DataStore.Web")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[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)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a9828548-af43-4ce4-8b13-50e99f9c9cf7")] + +// 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/DataStore/Tango.DataStore.Web/Tango.DataStore.Web.csproj b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/Tango.DataStore.Web.csproj new file mode 100644 index 000000000..ac4e4a6f8 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/Tango.DataStore.Web.csproj @@ -0,0 +1,71 @@ + + + + + Debug + AnyCPU + {A9828548-AF43-4CE4-8B13-50E99F9C9CF7} + Library + Properties + Tango.DataStore.Web + Tango.DataStore.Web + v4.6.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll + + + ..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + + + {e4927038-348d-4295-aaf4-861c58cb3943} + Tango.PMR + + + {e0364dfa-0721-4637-9d32-9d22aac109d6} + Tango.DataStore + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.Web/packages.config b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/packages.config new file mode 100644 index 000000000..026e719c3 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.Web/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore/DataStoreHelper.cs b/Software/Visual_Studio/DataStore/Tango.DataStore/DataStoreHelper.cs index 0ca8e484e..0ceecd81b 100644 --- a/Software/Visual_Studio/DataStore/Tango.DataStore/DataStoreHelper.cs +++ b/Software/Visual_Studio/DataStore/Tango.DataStore/DataStoreHelper.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using System.Text.RegularExpressions; using System.Threading.Tasks; using Tango.Core.ExtensionMethods; using Tango.PMR; @@ -84,7 +85,7 @@ namespace Tango.DataStore { if (item.Type == DataType.Bytes) { - return GetByteArrayHexString((byte[])item.Value); + return Convert.ToBase64String((byte[])item.Value); } else if (item.Type == DataType.Proto) { @@ -96,21 +97,6 @@ namespace Tango.DataStore } } - /// - /// Returns a byte array string representation in hex format. - /// - /// The data. - /// - public static String GetByteArrayHexString(byte[] data) - { - StringBuilder hex = new StringBuilder(); - foreach (byte b in data) - { - hex.Append(b.ToString("X2") + " "); - } - return hex.ToString(); - } - /// /// Parses a data store value from a string. /// @@ -141,20 +127,21 @@ namespace Tango.DataStore instance = instance.GetParser().ParseJson(text); return DataStoreProtoObject.FromMessage(instance); case DataType.Bytes: - string[] hexValuesSplit = text.Split(' '); - List bytes = new List(); - foreach (string hex in hexValuesSplit) - { - if (hex.IsNotNullOrEmpty()) - { - byte b = (byte)Convert.ToInt32(hex.Trim(), 16); - bytes.Add(b); - } - } - return bytes.ToArray(); + return Convert.FromBase64String(text); } throw new NotSupportedException("The specified data store type is not supported."); } + + /// + /// Validates the name of the collection or key. + /// + /// The name. + /// + public static bool ValidateCollectionOrKeyName(String name) + { + var regexItem = new Regex("^[a-zA-Z0-9_-]*$"); + return regexItem.IsMatch(name); + } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogViewVM.cs index 29ec03942..9cde14c6f 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Dialogs/DataStoreItemEditDialogViewVM.cs @@ -143,7 +143,7 @@ namespace Tango.FSE.MachineConfiguration.Dialogs var bytes = File.ReadAllBytes(result.SelectedItem); Value = bytes; - _editingValue = DataStoreHelper.GetByteArrayHexString(bytes); + _editingValue = Convert.ToBase64String(bytes); RaisePropertyChanged(nameof(EditingValue)); } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs index 7c1fae7ac..ef708afd3 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs @@ -146,6 +146,11 @@ namespace Tango.FSE.MachineConfiguration.ViewModels return "The specified collection already exists."; } + if (!DataStoreHelper.ValidateCollectionOrKeyName(input)) + { + return "Collection name contains invalid characters."; + } + return null; }); @@ -176,14 +181,19 @@ namespace Tango.FSE.MachineConfiguration.ViewModels } var result = await NotificationProvider.ShowInputBox("Add Item", "Please enter the item key", MaterialDesignThemes.Wpf.PackIconKind.KeyAdd, null, null, 20, null, null, (input) => - { - if (SelectedCollection.Items.ToList().Exists(x => x.Key.ToLower() == input.ToLower())) - { - return "The specified key already exists in the collection."; - } + { + if (SelectedCollection.Items.ToList().Exists(x => x.Key.ToLower() == input.ToLower())) + { + return "The specified key already exists in the collection."; + } - return null; - }); + if (!DataStoreHelper.ValidateCollectionOrKeyName(input)) + { + return "Key name contains invalid characters."; + } + + return null; + }); if (result.Confirmed) { diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs index b65ad7102..39772a4cf 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/SelectionViewVM.cs @@ -19,7 +19,13 @@ namespace Tango.FSE.MachineConfiguration.ViewModels public Machine SelectedMachine { get { return _selectedMachine; } - set { _selectedMachine = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + set + { + _selectedMachine = value; + RaisePropertyChangedAuto(); + InvalidateRelayCommands(); + OnSelectedMachineChanged(); + } } public RelayCommand ManageMachineCommand { get; set; } @@ -29,6 +35,15 @@ namespace Tango.FSE.MachineConfiguration.ViewModels ManageMachineCommand = new RelayCommand(ManageSelectedMachine, () => SelectedMachine != null); } + private async void OnSelectedMachineChanged() + { + if (SelectedMachine != null) + { + await Task.Delay(100); + this.SetFocus(() => ManageMachineCommand); + } + } + private void ManageSelectedMachine() { if (SelectedMachine == null) diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml index 69cebf324..51039ca89 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SelectionView.xaml @@ -49,7 +49,7 @@ - - - - - - - - - Machine Counters - - - - - - Total Dye Time: - - - - - Total Dye Meters: - - - - - - - - - - - - - - - Disable Firmware Upgrade - - - - - Force Version Update - - - - - Suspend Version Update - - - - - - - - - Serial Number - - - - - Name - - - - - Organization - - - - - Site - - - - - - - - - Head Type - - - - - Hardware Version - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml.cs deleted file mode 100644 index d25948d2c..000000000 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/ConfigurationView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.FSE.MachineConfiguration.Views -{ - /// - /// Interaction logic for MachineDataStoreView.xaml - /// - public partial class ConfigurationView : UserControl - { - public ConfigurationView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml index ca6470db3..d33966e18 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/MachineView.xaml @@ -35,7 +35,7 @@ - + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml new file mode 100644 index 000000000..88df5a0b3 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + Activate Windows License + + + + License Key + + + + + + Setup Team Viewer + + + + + Activate Disk Protection + + + + + Use Firmware Emulator (Demo Machine) + + + + + + Device Registration + + + + + + Registered: + + + + + Device ID: + + + + + Device Name: + + + + + + + + + + + + + Machine Counters + + + + + + Total Dye Time: + + + + + Total Dye Meters: + + + + + + + + + + + + + + + Disable Firmware Upgrade + + + + + Force Version Update + + + + + Suspend Version Update + + + + + + + + + Serial Number + + + + + Name + + + + + Organization + + + + + Site + + + + + + + + + Head Type + + + + + Hardware Version + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.xaml.cs new file mode 100644 index 000000000..bdf8d904d --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/Views/SettingsView.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.FSE.MachineConfiguration.Views +{ + /// + /// Interaction logic for MachineDataStoreView.xaml + /// + public partial class SettingsView : UserControl + { + public SettingsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs index 9dbfec1db..14cf4c7c4 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs @@ -226,8 +226,6 @@ namespace Tango.FSE.UI.DataStore { foreach (var item in collection.Items) { - - if (item.IsGlobal) { globals.Add(new SaveModel() { CollectionName = collection.Name, Item = item }); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs index 41fb21498..4d2e9c1df 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/DataStore/DefaultDataStoreService.cs @@ -121,6 +121,7 @@ namespace Tango.PPC.Common.DataStore [ExternalBridgeRequestHandlerMethod(typeof(RemoteDataStoreDeleteRequest), RequestHandlerLoggingMode.LogRequestName)] public async Task OnRemoteDataStoreDeleteRequest(RemoteDataStoreDeleteRequest request, String token, ExternalBridgeReceiver receiver) { + throw new InvalidOperationException("Deleting from the data store is not allowed."); GetManager().GetCollection(request.Collection).Delete(request.Key); await receiver.SendGenericResponse(new RemoteDataStoreDeleteResponse(), token); } @@ -128,6 +129,7 @@ namespace Tango.PPC.Common.DataStore [ExternalBridgeRequestHandlerMethod(typeof(RemoteDataStoreDeleteAllRequest), RequestHandlerLoggingMode.LogRequestName)] public async Task OnRemoteDataStoreDeleteAllRequest(RemoteDataStoreDeleteAllRequest request, String token, ExternalBridgeReceiver receiver) { + throw new InvalidOperationException("Deleting from the data store is not allowed."); GetManager().GetCollection(request.Collection).DeleteAll(); await receiver.SendGenericResponse(new RemoteDataStoreDeleteAllResponse(), token); } -- cgit v1.3.1 From 466340a97f8a158570f84fc12238101ca9c124ec Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 19 Nov 2020 01:46:41 +0200 Subject: Data store improvements. Added line number to logs viewer. Added DataStore Create Write Global permission. Added FSE application path to "Path" environment variable for dsUtil. Completed dsUtil. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes .../Advanced Installer Projects/FSE Installer.aip | 52 ++++++-- .../DataStore/Tango.DataStore.CLI/DataStoreUtil.cs | 131 +++++++++++++++++++++ .../Tango.DataStore.CLI/DataStoreUtilSettings.cs | 15 +++ .../DataStore/Tango.DataStore.CLI/Options.cs | 21 +++- .../DataStore/Tango.DataStore.CLI/Program.cs | 66 +---------- .../Tango.DataStore.CLI/Tango.DataStore.CLI.csproj | 6 + .../ViewModels/DataStoreViewVM.cs | 14 +-- .../ViewModels/MachineViewVM.cs | 2 +- .../Help/proc-doc.chm | Bin 245435 -> 245437 bytes .../Views/LogFileTabView.xaml | 5 +- .../FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs | 3 +- .../FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 4 + .../Tango.BL/Enumerations/Permissions.cs | 12 +- .../Controllers/DataStoreController.cs | 20 +++- 16 files changed, 255 insertions(+), 96 deletions(-) create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtil.cs create mode 100644 Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtilSettings.cs (limited to 'Software/Visual_Studio/FSE') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index b80bbc9b0..58fbcac47 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index b06dad7d5..981698cbd 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip index dc6557505..86a02fb0f 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip @@ -63,6 +63,8 @@ + + @@ -303,8 +305,10 @@ - - + + + + @@ -314,6 +318,7 @@ + @@ -361,6 +366,7 @@ + @@ -372,10 +378,10 @@ - - - - + + + + @@ -755,16 +761,27 @@ + + + + + + + + + + + + + + + + + - - - - - - @@ -927,6 +944,9 @@ + + + @@ -1246,13 +1266,19 @@ + - + + + + + + diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtil.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtil.cs new file mode 100644 index 000000000..b18476e3f --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtil.cs @@ -0,0 +1,131 @@ +using ConsoleTables; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Cryptography; +using Tango.DataStore.Web; +using Tango.Settings; +using Tango.Web; + +namespace Tango.DataStore.CLI +{ + public class DataStoreConsole + { + public void Get(GetOptions options) + { + try + { + ApplyAutoLogin(options); + + if (options.MachineSerialNumber != null) + { + Console.WriteLine($"Retrieving data store values for '{options.MachineSerialNumber}'..."); + } + else + { + Console.WriteLine("Retrieving global data store values..."); + } + + var client = CreateClient(options.Email, options.Password, options.Environment); + + var items = client.Get(options.MachineSerialNumber, options.Collection, options.Key).ToList(); + + ConsoleTable table = new ConsoleTable("COLLECTION", "KEY", "DATA TYPE", "PROTO TYPE", "STATE", "GLOBAL", "LOCAL"); + + foreach (var item in items) + { + table.AddRow(item.Collection, item.Key, item.DataType, item.ProtoMessageType != MessageType.None ? item.ProtoMessageType.ToString() : null, item.Type, item.GlobalValue.ToStringSafe().ToOneLine(), item.LocalValue.ToStringSafe().ToOneLine()); + } + + Console.WriteLine(); + Console.WriteLine("DATA STORE RESULTS:"); + Console.WriteLine(); + + table.Write(); + } + catch (Exception ex) + { + Console.WriteLine(ex.FlattenMessage()); + } + } + + public void Put(PutOptions options) + { + try + { + ApplyAutoLogin(options); + + if (options.MachineSerialNumber != null) + { + Console.WriteLine($"Storing data store value for '{options.MachineSerialNumber}'..."); + } + else + { + Console.WriteLine("Storing global data store value..."); + } + + var client = CreateClient(options.Email, options.Password, options.Environment); + + if (options.DataType == Web.DataType.Proto) + { + options.Value = options.Value.ToStringOrEmpty().Replace("'", "\""); + } + + client.Put(new DataStoreWebPutItem() + { + Collection = options.Collection, + Key = options.Key, + DataType = options.DataType, + MachineSerialNumber = options.MachineSerialNumber, + ProtoMessageType = options.ProtoMessageType, + Value = options.Value + }); + + Console.WriteLine($"Item '{options.Key}' stored successfully."); + } + catch (Exception ex) + { + Console.WriteLine(ex.FlattenMessage()); + } + } + + public void AutoLogin(LoginConfig options) + { + MachineLevelCryptographer crypt = new MachineLevelCryptographer(); + var settings = SettingsManager.Default.GetOrCreate(); + settings.Email = options.Email; + settings.Password = crypt.Encrypt(options.Password); + settings.Save(); + } + + private void ApplyAutoLogin(OptionsBase options) + { + if (options.Email == null && options.Password == null) + { + MachineLevelCryptographer crypt = new MachineLevelCryptographer(); + var settings = SettingsManager.Default.GetOrCreate(); + options.Email = settings.Email; + options.Password = crypt.Decrypt(settings.Password); + } + } + + private DataStoreClient CreateClient(String email, String password, DeploymentSlot slot) + { + String token = String.Empty; + + HttpClient http = new HttpClient(); + DataStoreClient dsClient = new DataStoreClient(slot.ToAddress(), http); + var response = dsClient.Login(new LoginRequest() + { + Email = email, + Password = password, + }); + http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", response.Token); + + return dsClient; + } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtilSettings.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtilSettings.cs new file mode 100644 index 000000000..58380d231 --- /dev/null +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/DataStoreUtilSettings.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Settings; + +namespace Tango.DataStore.CLI +{ + public class DataStoreUtilSettings : SettingsBase + { + public String Email { get; set; } + public String Password { get; set; } + } +} diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Options.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Options.cs index 150756671..fd91a5722 100644 --- a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Options.cs +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Options.cs @@ -4,16 +4,17 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.DataStore.Web; using Tango.Web; namespace Tango.DataStore.CLI { public class OptionsBase { - [Option(longName: "email", HelpText = "Email address.", Required = true)] + [Option(longName: "email", HelpText = "Email address.")] public String Email { get; set; } - [Option(longName: "password", HelpText = "Password.", Required = true)] + [Option(longName: "password", HelpText = "Password.")] public String Password { get; set; } [Option(longName: "env", HelpText = "The target environment.", Required = true)] @@ -45,7 +46,23 @@ namespace Tango.DataStore.CLI [Option(longName: "key", HelpText = "New or existing item key", Required = true)] public String Key { get; set; } + [Option(longName: "data-type", HelpText = "Item data type", Required = true)] + public Web.DataType DataType { get; set; } + + [Option(longName: "proto-type", HelpText = "Protobuf message type when data-type is 'Proto'.")] + public MessageType ProtoMessageType { get; set; } + [Option(longName: "value", HelpText = "Item value", Required = true)] public String Value { get; set; } } + + [Verb("login-config", HelpText = "Stores the specified credentials for use with the --auto-login flag.")] + public class LoginConfig + { + [Option(longName: "email", HelpText = "Email address.")] + public String Email { get; set; } + + [Option(longName: "password", HelpText = "Password.")] + public String Password { get; set; } + } } diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs index db4f54620..85dfbb0bb 100644 --- a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs @@ -19,7 +19,7 @@ namespace Tango.DataStore.CLI { var console = new DataStoreConsole(); - var result = Parser.Default.ParseArguments(args) + var result = Parser.Default.ParseArguments(args) .WithParsed((options) => { console.Get(options); @@ -28,6 +28,10 @@ namespace Tango.DataStore.CLI { console.Put(options); }) + .WithParsed((options) => + { + console.AutoLogin(options); + }) .WithNotParsed((errors) => { @@ -41,64 +45,4 @@ namespace Tango.DataStore.CLI } } } - - public class DataStoreConsole - { - public void Get(GetOptions options) - { - try - { - if (options.MachineSerialNumber != null) - { - Console.WriteLine($"Retrieving data store values for '{options.MachineSerialNumber}'..."); - } - else - { - Console.WriteLine("Retrieving global data store values..."); - } - - var client = CreateClient(options.Email, options.Password, options.Environment); - - var items = client.Get(options.MachineSerialNumber, options.Collection, options.Key).ToList(); - - ConsoleTable table = new ConsoleTable("COLLECTION", "KEY", "DATA TYPE", "STATE", "GLOBAL", "LOCAL"); - - foreach (var item in items) - { - table.AddRow(item.Collection, item.Key, item.DataType, item.Type, item.GlobalValue.ToStringSafe().ToOneLine(), item.LocalValue.ToStringSafe().ToOneLine()); - } - - Console.WriteLine(); - Console.WriteLine("DATA STORE RESULTS:"); - Console.WriteLine(); - - table.Write(); - } - catch (Exception ex) - { - Console.WriteLine(ex.FlattenMessage()); - } - } - - public void Put(PutOptions options) - { - - } - - private DataStoreClient CreateClient(String email, String password, DeploymentSlot slot) - { - String token = String.Empty; - - HttpClient http = new HttpClient(); - DataStoreClient dsClient = new DataStoreClient(slot.ToAddress(), http); - var response = dsClient.Login(new LoginRequest() - { - Email = "roy@twine-s.com", - Password = "1Creativity", - }); - http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", response.Token); - - return dsClient; - } - } } diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Tango.DataStore.CLI.csproj b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Tango.DataStore.CLI.csproj index 28aab4ef7..42b0b95dc 100644 --- a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Tango.DataStore.CLI.csproj +++ b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Tango.DataStore.CLI.csproj @@ -63,6 +63,8 @@ + + @@ -85,6 +87,10 @@ {e4927038-348d-4295-aaf4-861c58cb3943} Tango.PMR + + {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} + Tango.Settings + {5001990f-977b-48ff-b217-0236a5022ad8} Tango.Web diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs index d8bd8791a..46f388461 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/DataStoreViewVM.cs @@ -114,7 +114,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void EditItem(DataStoreItemModel item) { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreWrite)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreWrite)) { await NotificationProvider.ShowError("The current user profile does not allow editing of the data store.\nPlease contact your administrator."); return; @@ -133,7 +133,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void AddCollection() { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreCreate)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) { await NotificationProvider.ShowError("The current user profile does not allow creating new data store collections.\nPlease contact your administrator."); return; @@ -174,7 +174,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void AddItem() { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreCreate)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) { await NotificationProvider.ShowError("The current user profile does not allow creating new data store items.\nPlease contact your administrator."); return; @@ -217,7 +217,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void RemoveCollection(DataStoreCollectionModel collection) { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreCreate)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) { await NotificationProvider.ShowError("The current user profile does not allow deleting data store collections.\nPlease contact your administrator."); return; @@ -229,7 +229,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void RemoveItem(DataStoreItemModel item) { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreCreate)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreCreate)) { await NotificationProvider.ShowError("The current user profile does not allow deleting data store items.\nPlease contact your administrator."); return; @@ -263,7 +263,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels private async void SaveModel() { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreWrite)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreWrite)) { await NotificationProvider.ShowError("The current user profile does not allow editing of the data store.\nPlease contact your administrator."); return; @@ -332,7 +332,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels { base.OnNavigatedTo(); - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreRead)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreRead)) { return; } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs index dd2430415..fd953a0b8 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.MachineConfiguration/ViewModels/MachineViewVM.cs @@ -33,7 +33,7 @@ namespace Tango.FSE.MachineConfiguration.ViewModels { if (value == NavigationView.DataStoreView) { - if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.FSE_DataStoreRead)) + if (!CurrentUser.HasPermission(Tango.BL.Enumerations.Permissions.DataStoreRead)) { Task.Delay(500).ContinueWith((x) => { diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm index 8777b5768..ef7ec26c0 100644 Binary files a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm and b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LogFileTabView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LogFileTabView.xaml index 8f06dac0d..92064f9fd 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LogFileTabView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.LogViewer.UI/Views/LogFileTabView.xaml @@ -16,7 +16,7 @@ Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> - + @@ -24,6 +24,7 @@ + @@ -34,7 +35,7 @@ - + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs index fa70e630e..964eb990b 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Properties/AssemblyInfo.cs @@ -8,5 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango FSE")] -[assembly: AssemblyVersion("1.1.1.0")] - +[assembly: AssemblyVersion("1.1.1.0")] diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index 4b4d46a78..2a79629a3 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -601,6 +601,10 @@ + + {6189b8c3-7af9-43dd-8a61-a8a05f526f62} + Tango.DataStore.CLI + {208C8BD8-72C6-4E3C-ACAA-351091A2ACC7} Tango.PPC.Shared diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs b/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs index 5bf6095f5..51e98f6f4 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/Permissions.cs @@ -305,19 +305,19 @@ namespace Tango.BL.Enumerations /// (Allows viewing data store items) /// [Description("Allows viewing data store items")] - FSE_DataStoreRead = 1026, + DataStoreRead = 1026, /// /// (Allows writing to data store items) /// [Description("Allows writing to data store items")] - FSE_DataStoreWrite = 1027, + DataStoreWrite = 1027, /// /// (Allows creating data store items and collections) /// [Description("Allows creating data store items and collections")] - FSE_DataStoreCreate = 1028, + DataStoreCreate = 1028, /// /// (Allows resetting the machine counters) @@ -331,5 +331,11 @@ namespace Tango.BL.Enumerations [Description("Allows resetting the machine device registration")] FSE_ResetMachineDeviceRegistration = 1030, + /// + /// (Allows creating creating and editing the global data store) + /// + [Description("Allows creating creating and editing the global data store")] + DataStoreCreateWriteGlobal = 1031, + } } diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DataStoreController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DataStoreController.cs index 0d35bd776..383a59850 100644 --- a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DataStoreController.cs +++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/DataStoreController.cs @@ -62,6 +62,11 @@ namespace Tango.MachineService.Controllers throw new AuthenticationException("Your account has been disabled. Please contact your administrator."); } + if (!user.HasPermission(Permissions.DataStoreRead)) + { + throw new AuthenticationException("You are not authorized to access the data store."); + } + var token = WebToken.CreateNew(MachineServiceConfig.JWT_TOKEN_SECRET, new TokenObject() { UserGuid = user.Guid, @@ -81,7 +86,7 @@ namespace Tango.MachineService.Controllers { try { - if (!RequestToken.Object.Permissions.Contains(Permissions.FSE_DataStoreRead)) + if (!RequestToken.Object.Permissions.Contains(Permissions.DataStoreRead)) { throw CreateHttpException(new AuthenticationException("The current user was not authorized to read from the data store."), HttpStatusCode.Unauthorized); } @@ -150,9 +155,9 @@ namespace Tango.MachineService.Controllers { try { - if (!RequestToken.Object.Permissions.Contains(Permissions.FSE_DataStoreWrite)) + if (!RequestToken.Object.Permissions.Contains(Permissions.DataStoreWrite)) { - throw CreateHttpException(new AuthenticationException("The current user was not authorized to write to the data store."), HttpStatusCode.BadRequest); + throw CreateHttpException(new AuthenticationException("The current user was not authorized to write to the data store."), HttpStatusCode.Unauthorized); } if (item.Collection == null || item.Key == null) @@ -177,7 +182,7 @@ namespace Tango.MachineService.Controllers if (dbItem == null) { - if (!RequestToken.Object.Permissions.Contains(Permissions.FSE_DataStoreCreate)) + if (!RequestToken.Object.Permissions.Contains(Permissions.DataStoreCreate)) { throw CreateHttpException(new AuthenticationException("The current user was not authorized to create new items on the data store."), HttpStatusCode.Unauthorized); } @@ -197,11 +202,16 @@ namespace Tango.MachineService.Controllers } else { + if (!RequestToken.Object.Permissions.Contains(Permissions.DataStoreCreateWriteGlobal)) + { + throw CreateHttpException(new AuthenticationException("The current user was not authorized to write to the global data store."), HttpStatusCode.Unauthorized); + } + GlobalDataStoreItem dbItem = db.GlobalDataStoreItems.FirstOrDefault(x => x.CollectionName == item.Collection && x.Key == item.Key); if (dbItem == null) { - if (!RequestToken.Object.Permissions.Contains(Permissions.FSE_DataStoreCreate)) + if (!RequestToken.Object.Permissions.Contains(Permissions.DataStoreCreate)) { throw CreateHttpException(new AuthenticationException("The current user was not authorized to create new items on the data store."), HttpStatusCode.Unauthorized); } -- cgit v1.3.1 From bbb32747564cc76a799bff2e24acc1621c6c74ee Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 19 Nov 2020 04:32:11 +0200 Subject: Roles and Permission EDrawMax + csv generator + pdf. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes .../FSE/Roles & Permissions/Administrator.csv | 2 + .../Roles & Permissions/Advanced Technician.csv | 5 ++ .../Roles & Permissions/Roles & Permissions.eddx | Bin 0 -> 19707 bytes .../Roles & Permissions/Roles & Permissions.pdf | Bin 0 -> 25792 bytes .../FSE/Roles & Permissions/Technician.csv | 5 ++ .../Roles & Permissions/Twine Administrator.csv | 3 + .../Twine Data Store Developer.csv | 2 + .../FSE/Roles & Permissions/Twine Developer.csv | 2 + .../Twine Procedure Designer.csv | 2 + .../Twine Procedure Publisher.csv | 2 + .../FSE/Roles & Permissions/Twine Technician.csv | 18 +++++ .../FSE/Tango.FSE.DPGraphGenerator/App.config | 24 ++++++ .../FSE/Tango.FSE.DPGraphGenerator/Program.cs | 88 +++++++++++++++++++++ .../Properties/AssemblyInfo.cs | 36 +++++++++ .../Tango.FSE.DPGraphGenerator.csproj | 75 ++++++++++++++++++ .../FSE/Tango.FSE.DPGraphGenerator/packages.config | 4 + Software/Visual_Studio/Tango.sln | 35 ++++++-- 19 files changed, 297 insertions(+), 6 deletions(-) create mode 100644 Software/Visual_Studio/FSE/Roles & Permissions/Administrator.csv create mode 100644 Software/Visual_Studio/FSE/Roles & Permissions/Advanced Technician.csv create mode 100644 Software/Visual_Studio/FSE/Roles & Permissions/Roles & Permissions.eddx create mode 100644 Software/Visual_Studio/FSE/Roles & Permissions/Roles & Permissions.pdf create mode 100644 Software/Visual_Studio/FSE/Roles & Permissions/Technician.csv create mode 100644 Software/Visual_Studio/FSE/Roles & Permissions/Twine Administrator.csv create mode 100644 Software/Visual_Studio/FSE/Roles & Permissions/Twine Data Store Developer.csv create mode 100644 Software/Visual_Studio/FSE/Roles & Permissions/Twine Developer.csv create mode 100644 Software/Visual_Studio/FSE/Roles & Permissions/Twine Procedure Designer.csv create mode 100644 Software/Visual_Studio/FSE/Roles & Permissions/Twine Procedure Publisher.csv create mode 100644 Software/Visual_Studio/FSE/Roles & Permissions/Twine Technician.csv create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/App.config create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/Program.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/Tango.FSE.DPGraphGenerator.csproj create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/packages.config (limited to 'Software/Visual_Studio/FSE') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 58fbcac47..db2b6ccf6 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 981698cbd..7d54a95db 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/FSE/Roles & Permissions/Administrator.csv b/Software/Visual_Studio/FSE/Roles & Permissions/Administrator.csv new file mode 100644 index 000000000..c889f448e --- /dev/null +++ b/Software/Visual_Studio/FSE/Roles & Permissions/Administrator.csv @@ -0,0 +1,2 @@ +Administrator +Manage Organization Users And Roles diff --git a/Software/Visual_Studio/FSE/Roles & Permissions/Advanced Technician.csv b/Software/Visual_Studio/FSE/Roles & Permissions/Advanced Technician.csv new file mode 100644 index 000000000..35ac5c8ae --- /dev/null +++ b/Software/Visual_Studio/FSE/Roles & Permissions/Advanced Technician.csv @@ -0,0 +1,5 @@ +Advanced Technician +Remote Desktop Control +PPC File System Read +Firmware File System Read +Remote Upgrade Online diff --git a/Software/Visual_Studio/FSE/Roles & Permissions/Roles & Permissions.eddx b/Software/Visual_Studio/FSE/Roles & Permissions/Roles & Permissions.eddx new file mode 100644 index 000000000..dcabc3bf9 Binary files /dev/null and b/Software/Visual_Studio/FSE/Roles & Permissions/Roles & Permissions.eddx differ diff --git a/Software/Visual_Studio/FSE/Roles & Permissions/Roles & Permissions.pdf b/Software/Visual_Studio/FSE/Roles & Permissions/Roles & Permissions.pdf new file mode 100644 index 000000000..f5bf232bd Binary files /dev/null and b/Software/Visual_Studio/FSE/Roles & Permissions/Roles & Permissions.pdf differ diff --git a/Software/Visual_Studio/FSE/Roles & Permissions/Technician.csv b/Software/Visual_Studio/FSE/Roles & Permissions/Technician.csv new file mode 100644 index 000000000..f4a50edef --- /dev/null +++ b/Software/Visual_Studio/FSE/Roles & Permissions/Technician.csv @@ -0,0 +1,5 @@ +Technician +Run FSE +Remote Desktop View +PPC File System Read +Remote Upgrade Offline diff --git a/Software/Visual_Studio/FSE/Roles & Permissions/Twine Administrator.csv b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Administrator.csv new file mode 100644 index 000000000..42d217a67 --- /dev/null +++ b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Administrator.csv @@ -0,0 +1,3 @@ +Twine Administrator +Manage All Organizations Users And Roles +Reset Machine Device Registration diff --git a/Software/Visual_Studio/FSE/Roles & Permissions/Twine Data Store Developer.csv b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Data Store Developer.csv new file mode 100644 index 000000000..b1650e363 --- /dev/null +++ b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Data Store Developer.csv @@ -0,0 +1,2 @@ +Twine Data Store Developer +DataStore Create diff --git a/Software/Visual_Studio/FSE/Roles & Permissions/Twine Developer.csv b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Developer.csv new file mode 100644 index 000000000..93a5fae98 --- /dev/null +++ b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Developer.csv @@ -0,0 +1,2 @@ +Twine Developer +DataStore Create Write Global diff --git a/Software/Visual_Studio/FSE/Roles & Permissions/Twine Procedure Designer.csv b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Procedure Designer.csv new file mode 100644 index 000000000..e0bc0e9f3 --- /dev/null +++ b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Procedure Designer.csv @@ -0,0 +1,2 @@ +Twine Procedure Designer +Run Procedure Designer diff --git a/Software/Visual_Studio/FSE/Roles & Permissions/Twine Procedure Publisher.csv b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Procedure Publisher.csv new file mode 100644 index 000000000..42d81e75e --- /dev/null +++ b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Procedure Publisher.csv @@ -0,0 +1,2 @@ +Twine Procedure Publisher +Publish Procedure Projects diff --git a/Software/Visual_Studio/FSE/Roles & Permissions/Twine Technician.csv b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Technician.csv new file mode 100644 index 000000000..2b1ce91aa --- /dev/null +++ b/Software/Visual_Studio/FSE/Roles & Permissions/Twine Technician.csv @@ -0,0 +1,18 @@ +Twine Technician +Connect Any Machine +PPC File System Write +Firmware File System Write +Execute Remote Console Commands +Edit Diagnostics Project +View FSE Logs +Modify Bug Report +View Internal Published Procedures +Run Procedure Project File +Run Configuration Module +Modify Machine Provisioning +Modify Machine Update +Modify Machine Identity +Modify Machine Hardware +DataStore Read +DataStore Write +Reset Machine Counters diff --git a/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/App.config b/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/App.config new file mode 100644 index 000000000..4ef5218a0 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/App.config @@ -0,0 +1,24 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/Program.cs b/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/Program.cs new file mode 100644 index 000000000..9eb0fb7b6 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/Program.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; +using Tango.CSV; + +namespace Tango.FSE.DPGraphGenerator +{ + class Program + { + private class RolePermission + { + public String Name { get; set; } + + public override string ToString() + { + return Name; + } + } + + private class RoleModel + { + public String Name { get; set; } + public List Permissions { get; set; } + + public RoleModel() + { + Permissions = new List(); + } + } + + static void Main(string[] args) + { + String outputFolder = Path.GetFullPath(@"..\..\..\Roles & Permissions"); + + Console.WriteLine($"Generating roles and permissions csv files to '{outputFolder}'..."); + + List models = new List(); + + using (ObservablesContext db = ObservablesContext.CreateDefault()) + { + var roles = db.Roles.ToList(); + var roles_permissions = db.RolesPermissions.ToList(); + var permissions = db.Permissions.ToList(); + + foreach (var role in roles.Where(x => x.Name.Contains("FSE")).ToList()) + { + RoleModel model = new RoleModel(); + model.Name = role.Description; + + List role_permissions = role.RolesPermissions.Select(x => x.Permission).ToList(); + + foreach (var permission in role_permissions.OrderBy(x => x.Code)) + { + model.Permissions.Add(new RolePermission() { Name = permission.Name.Replace("FSE_", "") }); + } + + models.Add(model); + } + } + + Directory.CreateDirectory(outputFolder); + + foreach (var model in models) + { + Console.WriteLine($"Generating role '{model.Name}'..."); + + using (DynamicCsvFile csvFile = new DynamicCsvFile(Path.Combine(outputFolder, $"{model.Name}.csv"))) + { + csvFile.Columns.Add(new DynamicCsvFileColumn() { Name = model.Name }); + + foreach (var permission in model.Permissions) + { + csvFile.Append(permission); + } + } + } + + Console.WriteLine(); + Console.WriteLine("Done!, press return to exit..."); + Console.ReadLine(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/Properties/AssemblyInfo.cs b/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..4cec0e5fd --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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.FSE.DPGraphGenerator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.FSE.DPGraphGenerator")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[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)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c57d9d68-336c-4665-9ef4-ec1bdbb84885")] + +// 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/FSE/Tango.FSE.DPGraphGenerator/Tango.FSE.DPGraphGenerator.csproj b/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/Tango.FSE.DPGraphGenerator.csproj new file mode 100644 index 000000000..ae2b84d7c --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/Tango.FSE.DPGraphGenerator.csproj @@ -0,0 +1,75 @@ + + + + + Debug + AnyCPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885} + Exe + Tango.FSE.DPGraphGenerator + Tango.FSE.DPGraphGenerator + v4.6.1 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + + + ..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + + + + + + + + + + + + + + + + + + + + + + {f441feee-322a-4943-b566-110e12fd3b72} + Tango.BL + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {58e8825f-0c96-449c-b320-1e82b0aa876b} + Tango.CSV + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/packages.config b/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/packages.config new file mode 100644 index 000000000..b3daf0d6c --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.DPGraphGenerator/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index f163b37ab..2c0063d78 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -437,6 +437,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.CLI", "Data EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.DataStore.Web", "DataStore\Tango.DataStore.Web\Tango.DataStore.Web.csproj", "{A9828548-AF43-4CE4-8B13-50E99F9C9CF7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.FSE.DPGraphGenerator", "FSE\Tango.FSE.DPGraphGenerator\Tango.FSE.DPGraphGenerator.csproj", "{C57D9D68-336C-4665-9EF4-EC1BDBB84885}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -4124,6 +4126,26 @@ Global {A9828548-AF43-4CE4-8B13-50E99F9C9CF7}.Release|x64.Build.0 = Release|Any CPU {A9828548-AF43-4CE4-8B13-50E99F9C9CF7}.Release|x86.ActiveCfg = Release|Any CPU {A9828548-AF43-4CE4-8B13-50E99F9C9CF7}.Release|x86.Build.0 = Release|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Debug|ARM.ActiveCfg = Debug|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Debug|ARM.Build.0 = Debug|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Debug|ARM64.Build.0 = Debug|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Debug|x64.ActiveCfg = Debug|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Debug|x64.Build.0 = Debug|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Debug|x86.ActiveCfg = Debug|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Debug|x86.Build.0 = Debug|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Release|Any CPU.Build.0 = Release|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Release|ARM.ActiveCfg = Release|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Release|ARM.Build.0 = Release|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Release|ARM64.ActiveCfg = Release|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Release|ARM64.Build.0 = Release|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Release|x64.ActiveCfg = Release|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Release|x64.Build.0 = Release|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Release|x86.ActiveCfg = Release|Any CPU + {C57D9D68-336C-4665-9EF4-EC1BDBB84885}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -4275,14 +4297,15 @@ Global {EE088FF7-04D1-41FB-9D6A-CEDEEE7A7B9C} = {3F723D53-3539-42D1-8570-395BF660928D} {6189B8C3-7AF9-43DD-8A61-A8A05F526F62} = {3F723D53-3539-42D1-8570-395BF660928D} {A9828548-AF43-4CE4-8B13-50E99F9C9CF7} = {3F723D53-3539-42D1-8570-395BF660928D} + {C57D9D68-336C-4665-9EF4-EC1BDBB84885} = {004337EB-0761-4D30-B9F5-AE6E1CFC6013} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} - BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear - BuildVersion_UpdateAssemblyVersion = True - BuildVersion_UpdateFileVersion = False - BuildVersion_StartDate = 2000/1/1 - BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs BuildVersion_UseGlobalSettings = False + BuildVersion_AssemblyInfoFilename = Properties\AssemblyInfo.cs + BuildVersion_StartDate = 2000/1/1 + BuildVersion_UpdateFileVersion = False + BuildVersion_UpdateAssemblyVersion = True + BuildVersion_BuildVersioningStyle = None.None.Increment.DeltaBaseYearDayOfYear + SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} EndGlobalSection EndGlobal -- cgit v1.3.1 From e65c37285826b7350c4f93c01901be48c222e50a Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Thu, 19 Nov 2020 16:55:25 +0200 Subject: Redundant. --- .../DataStore/DefaultDataStoreProvider.cs | 51 ++++++++++++---------- 1 file changed, 29 insertions(+), 22 deletions(-) (limited to 'Software/Visual_Studio/FSE') diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs index 14cf4c7c4..7b8e6684d 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/DataStore/DefaultDataStoreProvider.cs @@ -51,7 +51,7 @@ namespace Tango.FSE.UI.DataStore { if (response.ChangeType != RemoteDataStoreChangeType.None) { - LogManager.Log($"Data store change received for '{response.Item.Key}.{response.Item.Key}'..."); + LogManager.Log($"Data store change received for '{response.CollectionName}.{response.Item.Key}'..."); OnDataStoreItemChanged(response); } }, (ex) => @@ -69,34 +69,41 @@ namespace Tango.FSE.UI.DataStore private void OnDataStoreItemChanged(RemoteDataStoreStartListenResponse response) { - if (_lastModel != null && AcceptFirmwareChanges) + try { - DataStoreCollectionModel collectionModel = _lastModel.Collections.FirstOrDefault(x => x.Name == response.CollectionName); - - if (collectionModel == null) + if (_lastModel != null && AcceptFirmwareChanges) { - collectionModel = new DataStoreCollectionModel(); - collectionModel.Name = response.CollectionName; - _lastModel.Collections.Add(collectionModel); - } + DataStoreCollectionModel collectionModel = _lastModel.Collections.FirstOrDefault(x => x.Name == response.CollectionName); - var remoteItem = response.Item; + if (collectionModel == null) + { + collectionModel = new DataStoreCollectionModel(); + collectionModel.Name = response.CollectionName; + _lastModel.Collections.Add(collectionModel); + } - var itemModel = collectionModel.Items.FirstOrDefault(x => x.Guid == remoteItem.Guid); + var remoteItem = response.Item; - if (itemModel == null) - { - itemModel = DataStoreItemModel.FromLocalDataStoreItem(remoteItem, null); - itemModel.ExistsOnMachine = true; - collectionModel.Items.Add(itemModel); - } - else - { - itemModel.Value = remoteItem.Value; - itemModel.Type = remoteItem.Type; - itemModel.Date = remoteItem.Date; + var itemModel = collectionModel.Items.FirstOrDefault(x => x.Guid == remoteItem.Guid); + + if (itemModel == null) + { + itemModel = DataStoreItemModel.FromLocalDataStoreItem(remoteItem, null); + itemModel.ExistsOnMachine = true; + collectionModel.Items.Add(itemModel); + } + else + { + itemModel.Value = remoteItem.Value; + itemModel.Type = remoteItem.Type; + itemModel.Date = remoteItem.Date; + } } } + catch (Exception ex) + { + LogManager.Log(ex, "Error occurred while processing a data store item remote change."); + } } public Task GetDataStoreModel(String machineGuid) -- cgit v1.3.1 From 14b1b42a4dd14f0fbe44cdf4b5072e4d38ba6f63 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 22 Nov 2020 22:12:39 +0200 Subject: TCC android updated pmr files. Fixed type on FSE summery --- .../ApplicationInformationOuterClass.java | 716 +++++++++++++++++++++ .../ConfigureProtocolRequestOuterClass.java | 603 +++++++++++++++++ .../ConfigureProtocolResponseOuterClass.java | 506 +++++++++++++++ .../GenericMessageProtocolOuterClass.java | 153 +++++ .../pmr/integration/GenericRequestOuterClass.java | 645 +++++++++++++++++++ .../pmr/integration/GenericResponseOuterClass.java | 645 +++++++++++++++++++ .../Tango.FSE.UI/Tiles/Events/EventsTileView.xaml | 2 +- .../FSE/Tango.FSE.UI/Views/EventsView.xaml | 2 +- 8 files changed, 3270 insertions(+), 2 deletions(-) create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ApplicationInformationOuterClass.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ConfigureProtocolRequestOuterClass.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ConfigureProtocolResponseOuterClass.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericMessageProtocolOuterClass.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericRequestOuterClass.java create mode 100644 Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericResponseOuterClass.java (limited to 'Software/Visual_Studio/FSE') diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ApplicationInformationOuterClass.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ApplicationInformationOuterClass.java new file mode 100644 index 000000000..a3a1f04b1 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ApplicationInformationOuterClass.java @@ -0,0 +1,716 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ApplicationInformation.proto + +package com.twine.tango.pmr.integration; + +public final class ApplicationInformationOuterClass { + private ApplicationInformationOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ApplicationInformationOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Integration.ApplicationInformation) + com.google.protobuf.MessageOrBuilder { + + /** + * string Version = 1; + */ + java.lang.String getVersion(); + /** + * string Version = 1; + */ + com.google.protobuf.ByteString + getVersionBytes(); + + /** + * string StartupDate = 2; + */ + java.lang.String getStartupDate(); + /** + * string StartupDate = 2; + */ + com.google.protobuf.ByteString + getStartupDateBytes(); + } + /** + * Protobuf type {@code Tango.PMR.Integration.ApplicationInformation} + */ + public static final class ApplicationInformation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Integration.ApplicationInformation) + ApplicationInformationOrBuilder { + private static final long serialVersionUID = 0L; + // Use ApplicationInformation.newBuilder() to construct. + private ApplicationInformation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ApplicationInformation() { + version_ = ""; + startupDate_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ApplicationInformation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + startupDate_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ApplicationInformationOuterClass.internal_static_Tango_PMR_Integration_ApplicationInformation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ApplicationInformationOuterClass.internal_static_Tango_PMR_Integration_ApplicationInformation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation.class, com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation.Builder.class); + } + + public static final int VERSION_FIELD_NUMBER = 1; + private volatile java.lang.Object version_; + /** + * string Version = 1; + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + /** + * string Version = 1; + */ + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STARTUPDATE_FIELD_NUMBER = 2; + private volatile java.lang.Object startupDate_; + /** + * string StartupDate = 2; + */ + public java.lang.String getStartupDate() { + java.lang.Object ref = startupDate_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startupDate_ = s; + return s; + } + } + /** + * string StartupDate = 2; + */ + public com.google.protobuf.ByteString + getStartupDateBytes() { + java.lang.Object ref = startupDate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + startupDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_); + } + if (!getStartupDateBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, startupDate_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, version_); + } + if (!getStartupDateBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, startupDate_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation)) { + return super.equals(obj); + } + com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation other = (com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation) obj; + + boolean result = true; + result = result && getVersion() + .equals(other.getVersion()); + result = result && getStartupDate() + .equals(other.getStartupDate()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (37 * hash) + STARTUPDATE_FIELD_NUMBER; + hash = (53 * hash) + getStartupDate().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Integration.ApplicationInformation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Integration.ApplicationInformation) + com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ApplicationInformationOuterClass.internal_static_Tango_PMR_Integration_ApplicationInformation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ApplicationInformationOuterClass.internal_static_Tango_PMR_Integration_ApplicationInformation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation.class, com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation.Builder.class); + } + + // Construct using com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + version_ = ""; + + startupDate_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.integration.ApplicationInformationOuterClass.internal_static_Tango_PMR_Integration_ApplicationInformation_descriptor; + } + + public com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation getDefaultInstanceForType() { + return com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation.getDefaultInstance(); + } + + public com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation build() { + com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation buildPartial() { + com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation result = new com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation(this); + result.version_ = version_; + result.startupDate_ = startupDate_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation) { + return mergeFrom((com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation other) { + if (other == com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation.getDefaultInstance()) return this; + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + if (!other.getStartupDate().isEmpty()) { + startupDate_ = other.startupDate_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object version_ = ""; + /** + * string Version = 1; + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string Version = 1; + */ + public com.google.protobuf.ByteString + getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string Version = 1; + */ + public Builder setVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * string Version = 1; + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * string Version = 1; + */ + public Builder setVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + + private java.lang.Object startupDate_ = ""; + /** + * string StartupDate = 2; + */ + public java.lang.String getStartupDate() { + java.lang.Object ref = startupDate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + startupDate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string StartupDate = 2; + */ + public com.google.protobuf.ByteString + getStartupDateBytes() { + java.lang.Object ref = startupDate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + startupDate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string StartupDate = 2; + */ + public Builder setStartupDate( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + startupDate_ = value; + onChanged(); + return this; + } + /** + * string StartupDate = 2; + */ + public Builder clearStartupDate() { + + startupDate_ = getDefaultInstance().getStartupDate(); + onChanged(); + return this; + } + /** + * string StartupDate = 2; + */ + public Builder setStartupDateBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + startupDate_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Integration.ApplicationInformation) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Integration.ApplicationInformation) + private static final com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation(); + } + + public static com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ApplicationInformation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ApplicationInformation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.integration.ApplicationInformationOuterClass.ApplicationInformation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Integration_ApplicationInformation_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Integration_ApplicationInformation_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\034ApplicationInformation.proto\022\025Tango.PM" + + "R.Integration\">\n\026ApplicationInformation\022" + + "\017\n\007Version\030\001 \001(\t\022\023\n\013StartupDate\030\002 \001(\tB!\n" + + "\037com.twine.tango.pmr.integrationb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Integration_ApplicationInformation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Integration_ApplicationInformation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Integration_ApplicationInformation_descriptor, + new java.lang.String[] { "Version", "StartupDate", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ConfigureProtocolRequestOuterClass.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ConfigureProtocolRequestOuterClass.java new file mode 100644 index 000000000..4f0f95126 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ConfigureProtocolRequestOuterClass.java @@ -0,0 +1,603 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ConfigureProtocolRequest.proto + +package com.twine.tango.pmr.integration; + +public final class ConfigureProtocolRequestOuterClass { + private ConfigureProtocolRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ConfigureProtocolRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Integration.ConfigureProtocolRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * bool EnableCompression = 1; + */ + boolean getEnableCompression(); + + /** + * .Tango.PMR.Integration.GenericMessageProtocol GenericProtocol = 2; + */ + int getGenericProtocolValue(); + /** + * .Tango.PMR.Integration.GenericMessageProtocol GenericProtocol = 2; + */ + com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol getGenericProtocol(); + } + /** + * Protobuf type {@code Tango.PMR.Integration.ConfigureProtocolRequest} + */ + public static final class ConfigureProtocolRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Integration.ConfigureProtocolRequest) + ConfigureProtocolRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfigureProtocolRequest.newBuilder() to construct. + private ConfigureProtocolRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfigureProtocolRequest() { + enableCompression_ = false; + genericProtocol_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConfigureProtocolRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + enableCompression_ = input.readBool(); + break; + } + case 16: { + int rawValue = input.readEnum(); + + genericProtocol_ = rawValue; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.internal_static_Tango_PMR_Integration_ConfigureProtocolRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.internal_static_Tango_PMR_Integration_ConfigureProtocolRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest.class, com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest.Builder.class); + } + + public static final int ENABLECOMPRESSION_FIELD_NUMBER = 1; + private boolean enableCompression_; + /** + * bool EnableCompression = 1; + */ + public boolean getEnableCompression() { + return enableCompression_; + } + + public static final int GENERICPROTOCOL_FIELD_NUMBER = 2; + private int genericProtocol_; + /** + * .Tango.PMR.Integration.GenericMessageProtocol GenericProtocol = 2; + */ + public int getGenericProtocolValue() { + return genericProtocol_; + } + /** + * .Tango.PMR.Integration.GenericMessageProtocol GenericProtocol = 2; + */ + public com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol getGenericProtocol() { + com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol result = com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol.valueOf(genericProtocol_); + return result == null ? com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (enableCompression_ != false) { + output.writeBool(1, enableCompression_); + } + if (genericProtocol_ != com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol.Json.getNumber()) { + output.writeEnum(2, genericProtocol_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enableCompression_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, enableCompression_); + } + if (genericProtocol_ != com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol.Json.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, genericProtocol_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest other = (com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest) obj; + + boolean result = true; + result = result && (getEnableCompression() + == other.getEnableCompression()); + result = result && genericProtocol_ == other.genericProtocol_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENABLECOMPRESSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableCompression()); + hash = (37 * hash) + GENERICPROTOCOL_FIELD_NUMBER; + hash = (53 * hash) + genericProtocol_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Integration.ConfigureProtocolRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Integration.ConfigureProtocolRequest) + com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.internal_static_Tango_PMR_Integration_ConfigureProtocolRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.internal_static_Tango_PMR_Integration_ConfigureProtocolRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest.class, com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + enableCompression_ = false; + + genericProtocol_ = 0; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.internal_static_Tango_PMR_Integration_ConfigureProtocolRequest_descriptor; + } + + public com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest build() { + com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest buildPartial() { + com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest result = new com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest(this); + result.enableCompression_ = enableCompression_; + result.genericProtocol_ = genericProtocol_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest) { + return mergeFrom((com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest other) { + if (other == com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest.getDefaultInstance()) return this; + if (other.getEnableCompression() != false) { + setEnableCompression(other.getEnableCompression()); + } + if (other.genericProtocol_ != 0) { + setGenericProtocolValue(other.getGenericProtocolValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean enableCompression_ ; + /** + * bool EnableCompression = 1; + */ + public boolean getEnableCompression() { + return enableCompression_; + } + /** + * bool EnableCompression = 1; + */ + public Builder setEnableCompression(boolean value) { + + enableCompression_ = value; + onChanged(); + return this; + } + /** + * bool EnableCompression = 1; + */ + public Builder clearEnableCompression() { + + enableCompression_ = false; + onChanged(); + return this; + } + + private int genericProtocol_ = 0; + /** + * .Tango.PMR.Integration.GenericMessageProtocol GenericProtocol = 2; + */ + public int getGenericProtocolValue() { + return genericProtocol_; + } + /** + * .Tango.PMR.Integration.GenericMessageProtocol GenericProtocol = 2; + */ + public Builder setGenericProtocolValue(int value) { + genericProtocol_ = value; + onChanged(); + return this; + } + /** + * .Tango.PMR.Integration.GenericMessageProtocol GenericProtocol = 2; + */ + public com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol getGenericProtocol() { + com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol result = com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol.valueOf(genericProtocol_); + return result == null ? com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol.UNRECOGNIZED : result; + } + /** + * .Tango.PMR.Integration.GenericMessageProtocol GenericProtocol = 2; + */ + public Builder setGenericProtocol(com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.GenericMessageProtocol value) { + if (value == null) { + throw new NullPointerException(); + } + + genericProtocol_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .Tango.PMR.Integration.GenericMessageProtocol GenericProtocol = 2; + */ + public Builder clearGenericProtocol() { + + genericProtocol_ = 0; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Integration.ConfigureProtocolRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Integration.ConfigureProtocolRequest) + private static final com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest(); + } + + public static com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ConfigureProtocolRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfigureProtocolRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.integration.ConfigureProtocolRequestOuterClass.ConfigureProtocolRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Integration_ConfigureProtocolRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Integration_ConfigureProtocolRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\036ConfigureProtocolRequest.proto\022\025Tango." + + "PMR.Integration\032\034GenericMessageProtocol." + + "proto\"}\n\030ConfigureProtocolRequest\022\031\n\021Ena" + + "bleCompression\030\001 \001(\010\022F\n\017GenericProtocol\030" + + "\002 \001(\0162-.Tango.PMR.Integration.GenericMes" + + "sageProtocolB!\n\037com.twine.tango.pmr.inte" + + "grationb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.getDescriptor(), + }, assigner); + internal_static_Tango_PMR_Integration_ConfigureProtocolRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Integration_ConfigureProtocolRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Integration_ConfigureProtocolRequest_descriptor, + new java.lang.String[] { "EnableCompression", "GenericProtocol", }); + com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ConfigureProtocolResponseOuterClass.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ConfigureProtocolResponseOuterClass.java new file mode 100644 index 000000000..aec962ac4 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/ConfigureProtocolResponseOuterClass.java @@ -0,0 +1,506 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ConfigureProtocolResponse.proto + +package com.twine.tango.pmr.integration; + +public final class ConfigureProtocolResponseOuterClass { + private ConfigureProtocolResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface ConfigureProtocolResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Integration.ConfigureProtocolResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * bool Confirmed = 1; + */ + boolean getConfirmed(); + } + /** + * Protobuf type {@code Tango.PMR.Integration.ConfigureProtocolResponse} + */ + public static final class ConfigureProtocolResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Integration.ConfigureProtocolResponse) + ConfigureProtocolResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfigureProtocolResponse.newBuilder() to construct. + private ConfigureProtocolResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfigureProtocolResponse() { + confirmed_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConfigureProtocolResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + + confirmed_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.internal_static_Tango_PMR_Integration_ConfigureProtocolResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.internal_static_Tango_PMR_Integration_ConfigureProtocolResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse.class, com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse.Builder.class); + } + + public static final int CONFIRMED_FIELD_NUMBER = 1; + private boolean confirmed_; + /** + * bool Confirmed = 1; + */ + public boolean getConfirmed() { + return confirmed_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (confirmed_ != false) { + output.writeBool(1, confirmed_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (confirmed_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, confirmed_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse other = (com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse) obj; + + boolean result = true; + result = result && (getConfirmed() + == other.getConfirmed()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONFIRMED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getConfirmed()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Integration.ConfigureProtocolResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Integration.ConfigureProtocolResponse) + com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.internal_static_Tango_PMR_Integration_ConfigureProtocolResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.internal_static_Tango_PMR_Integration_ConfigureProtocolResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse.class, com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + confirmed_ = false; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.internal_static_Tango_PMR_Integration_ConfigureProtocolResponse_descriptor; + } + + public com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse build() { + com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse buildPartial() { + com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse result = new com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse(this); + result.confirmed_ = confirmed_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse) { + return mergeFrom((com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse other) { + if (other == com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse.getDefaultInstance()) return this; + if (other.getConfirmed() != false) { + setConfirmed(other.getConfirmed()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean confirmed_ ; + /** + * bool Confirmed = 1; + */ + public boolean getConfirmed() { + return confirmed_; + } + /** + * bool Confirmed = 1; + */ + public Builder setConfirmed(boolean value) { + + confirmed_ = value; + onChanged(); + return this; + } + /** + * bool Confirmed = 1; + */ + public Builder clearConfirmed() { + + confirmed_ = false; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Integration.ConfigureProtocolResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Integration.ConfigureProtocolResponse) + private static final com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse(); + } + + public static com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public ConfigureProtocolResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfigureProtocolResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.integration.ConfigureProtocolResponseOuterClass.ConfigureProtocolResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Integration_ConfigureProtocolResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Integration_ConfigureProtocolResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\037ConfigureProtocolResponse.proto\022\025Tango" + + ".PMR.Integration\".\n\031ConfigureProtocolRes" + + "ponse\022\021\n\tConfirmed\030\001 \001(\010B!\n\037com.twine.ta" + + "ngo.pmr.integrationb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Integration_ConfigureProtocolResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Integration_ConfigureProtocolResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Integration_ConfigureProtocolResponse_descriptor, + new java.lang.String[] { "Confirmed", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericMessageProtocolOuterClass.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericMessageProtocolOuterClass.java new file mode 100644 index 000000000..4780d0d16 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericMessageProtocolOuterClass.java @@ -0,0 +1,153 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: GenericMessageProtocol.proto + +package com.twine.tango.pmr.integration; + +public final class GenericMessageProtocolOuterClass { + private GenericMessageProtocolOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code Tango.PMR.Integration.GenericMessageProtocol} + */ + public enum GenericMessageProtocol + implements com.google.protobuf.ProtocolMessageEnum { + /** + * Json = 0; + */ + Json(0), + /** + * Bson = 1; + */ + Bson(1), + /** + * Protobuf = 2; + */ + Protobuf(2), + UNRECOGNIZED(-1), + ; + + /** + * Json = 0; + */ + public static final int Json_VALUE = 0; + /** + * Bson = 1; + */ + public static final int Bson_VALUE = 1; + /** + * Protobuf = 2; + */ + public static final int Protobuf_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static GenericMessageProtocol valueOf(int value) { + return forNumber(value); + } + + public static GenericMessageProtocol forNumber(int value) { + switch (value) { + case 0: return Json; + case 1: return Bson; + case 2: return Protobuf; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + GenericMessageProtocol> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public GenericMessageProtocol findValueByNumber(int number) { + return GenericMessageProtocol.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.twine.tango.pmr.integration.GenericMessageProtocolOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final GenericMessageProtocol[] VALUES = values(); + + public static GenericMessageProtocol valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private GenericMessageProtocol(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:Tango.PMR.Integration.GenericMessageProtocol) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\034GenericMessageProtocol.proto\022\025Tango.PM" + + "R.Integration*:\n\026GenericMessageProtocol\022" + + "\010\n\004Json\020\000\022\010\n\004Bson\020\001\022\014\n\010Protobuf\020\002B!\n\037com" + + ".twine.tango.pmr.integrationb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericRequestOuterClass.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericRequestOuterClass.java new file mode 100644 index 000000000..be6709cf5 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericRequestOuterClass.java @@ -0,0 +1,645 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: GenericRequest.proto + +package com.twine.tango.pmr.integration; + +public final class GenericRequestOuterClass { + private GenericRequestOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface GenericRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Integration.GenericRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string Type = 1; + */ + java.lang.String getType(); + /** + * string Type = 1; + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + * bytes Data = 2; + */ + com.google.protobuf.ByteString getData(); + } + /** + * Protobuf type {@code Tango.PMR.Integration.GenericRequest} + */ + public static final class GenericRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Integration.GenericRequest) + GenericRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenericRequest.newBuilder() to construct. + private GenericRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GenericRequest() { + type_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GenericRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 18: { + + data_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.GenericRequestOuterClass.internal_static_Tango_PMR_Integration_GenericRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.GenericRequestOuterClass.internal_static_Tango_PMR_Integration_GenericRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest.class, com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + * string Type = 1; + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * string Type = 1; + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + /** + * bytes Data = 2; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + if (!data_.isEmpty()) { + output.writeBytes(2, data_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, data_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest)) { + return super.equals(obj); + } + com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest other = (com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest) obj; + + boolean result = true; + result = result && getType() + .equals(other.getType()); + result = result && getData() + .equals(other.getData()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Integration.GenericRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Integration.GenericRequest) + com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.GenericRequestOuterClass.internal_static_Tango_PMR_Integration_GenericRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.GenericRequestOuterClass.internal_static_Tango_PMR_Integration_GenericRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest.class, com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest.Builder.class); + } + + // Construct using com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + type_ = ""; + + data_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.integration.GenericRequestOuterClass.internal_static_Tango_PMR_Integration_GenericRequest_descriptor; + } + + public com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest getDefaultInstanceForType() { + return com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest.getDefaultInstance(); + } + + public com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest build() { + com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest buildPartial() { + com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest result = new com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest(this); + result.type_ = type_; + result.data_ = data_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest) { + return mergeFrom((com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest other) { + if (other == com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest.getDefaultInstance()) return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object type_ = ""; + /** + * string Type = 1; + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string Type = 1; + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string Type = 1; + */ + public Builder setType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * string Type = 1; + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * string Type = 1; + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes Data = 2; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * bytes Data = 2; + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + * bytes Data = 2; + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Integration.GenericRequest) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Integration.GenericRequest) + private static final com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest(); + } + + public static com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public GenericRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenericRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.integration.GenericRequestOuterClass.GenericRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Integration_GenericRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Integration_GenericRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\024GenericRequest.proto\022\025Tango.PMR.Integr" + + "ation\",\n\016GenericRequest\022\014\n\004Type\030\001 \001(\t\022\014\n" + + "\004Data\030\002 \001(\014B!\n\037com.twine.tango.pmr.integ" + + "rationb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Integration_GenericRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Integration_GenericRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Integration_GenericRequest_descriptor, + new java.lang.String[] { "Type", "Data", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericResponseOuterClass.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericResponseOuterClass.java new file mode 100644 index 000000000..984c4421f --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/tango/pmr/integration/GenericResponseOuterClass.java @@ -0,0 +1,645 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: GenericResponse.proto + +package com.twine.tango.pmr.integration; + +public final class GenericResponseOuterClass { + private GenericResponseOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface GenericResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:Tango.PMR.Integration.GenericResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * string Type = 1; + */ + java.lang.String getType(); + /** + * string Type = 1; + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + * bytes Data = 2; + */ + com.google.protobuf.ByteString getData(); + } + /** + * Protobuf type {@code Tango.PMR.Integration.GenericResponse} + */ + public static final class GenericResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:Tango.PMR.Integration.GenericResponse) + GenericResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenericResponse.newBuilder() to construct. + private GenericResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GenericResponse() { + type_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GenericResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 18: { + + data_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.GenericResponseOuterClass.internal_static_Tango_PMR_Integration_GenericResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.GenericResponseOuterClass.internal_static_Tango_PMR_Integration_GenericResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse.class, com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + * string Type = 1; + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * string Type = 1; + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + /** + * bytes Data = 2; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + if (!data_.isEmpty()) { + output.writeBytes(2, data_); + } + unknownFields.writeTo(output); + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, data_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse)) { + return super.equals(obj); + } + com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse other = (com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse) obj; + + boolean result = true; + result = result && getType() + .equals(other.getType()); + result = result && getData() + .equals(other.getData()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code Tango.PMR.Integration.GenericResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:Tango.PMR.Integration.GenericResponse) + com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.twine.tango.pmr.integration.GenericResponseOuterClass.internal_static_Tango_PMR_Integration_GenericResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.twine.tango.pmr.integration.GenericResponseOuterClass.internal_static_Tango_PMR_Integration_GenericResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse.class, com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse.Builder.class); + } + + // Construct using com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + type_ = ""; + + data_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.twine.tango.pmr.integration.GenericResponseOuterClass.internal_static_Tango_PMR_Integration_GenericResponse_descriptor; + } + + public com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse getDefaultInstanceForType() { + return com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse.getDefaultInstance(); + } + + public com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse build() { + com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse buildPartial() { + com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse result = new com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse(this); + result.type_ = type_; + result.data_ = data_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse) { + return mergeFrom((com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse other) { + if (other == com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse.getDefaultInstance()) return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object type_ = ""; + /** + * string Type = 1; + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string Type = 1; + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string Type = 1; + */ + public Builder setType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * string Type = 1; + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * string Type = 1; + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes Data = 2; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * bytes Data = 2; + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + * bytes Data = 2; + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:Tango.PMR.Integration.GenericResponse) + } + + // @@protoc_insertion_point(class_scope:Tango.PMR.Integration.GenericResponse) + private static final com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse(); + } + + public static com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public GenericResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenericResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.twine.tango.pmr.integration.GenericResponseOuterClass.GenericResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_Tango_PMR_Integration_GenericResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_Tango_PMR_Integration_GenericResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\025GenericResponse.proto\022\025Tango.PMR.Integ" + + "ration\"-\n\017GenericResponse\022\014\n\004Type\030\001 \001(\t\022" + + "\014\n\004Data\030\002 \001(\014B!\n\037com.twine.tango.pmr.int" + + "egrationb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_Tango_PMR_Integration_GenericResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_Tango_PMR_Integration_GenericResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_Tango_PMR_Integration_GenericResponse_descriptor, + new java.lang.String[] { "Type", "Data", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Events/EventsTileView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Events/EventsTileView.xaml index 7963cb733..508ebb6b7 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Events/EventsTileView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Events/EventsTileView.xaml @@ -39,7 +39,7 @@ - active events summery: + active events summary: diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.xaml index 98f03a0f1..c3715700b 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.xaml @@ -176,7 +176,7 @@ - active events summery: + active events summary: -- cgit v1.3.1 From a7403d412af2cd6e5402a67d90ece99b5f94408a Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 23 Nov 2020 15:12:44 +0200 Subject: PPC 1.2.3 --- Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 4 +++- .../MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs | 2 +- Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs | 2 +- Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'Software/Visual_Studio/FSE') diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index 2a79629a3..4a1934404 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -943,7 +943,9 @@ if $(ConfigurationName) == Release del *.pdb attrib -r Tango* if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)ProtoCompilers\" -if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)Roslyn\" +if $(ConfigurationName) == Release RD /S /Q "$(TargetDir)Roslyn\" + +if $(ConfigurationName) == Release del WebRtc.NET.pdb diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs index 3e3a5337a..736c2ebca 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ using System.Runtime.InteropServices; [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyTitle("Tango - Machine Studio")] -[assembly: AssemblyVersion("4.2.2.0")] +[assembly: AssemblyVersion("4.2.3.0")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index 89700ae64..b95219ad0 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango PPC Application")] -[assembly: AssemblyVersion("1.2.2.0")] +[assembly: AssemblyVersion("1.2.3.0")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 7f520ecc5..1257fee46 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -753,6 +753,8 @@ if $(ConfigurationName) == Release del "$(TargetDir)firmware_package.tfp" if $(ConfigurationName) == Release del *.xml +if $(ConfigurationName) == Release del WebRtc.NET.pdb + if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)" @@ -761,7 +763,7 @@ if $(ConfigurationName) == Debug copy /Y "$(TargetDir)Packages" "$(TargetDir)" - + \ No newline at end of file -- cgit v1.3.1