From b6a210c5b82c2cf0215e8cdb61e1ab2c1b43f0dd Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 7 May 2019 16:10:45 +0300 Subject: Resolved PPC CPU usage by events. --- .../PPC Installer-cache/cacheIndex.txt | Bin 52 -> 52 bytes .../Advanced Installer Projects/PPC Installer.aip | 106 ++++++++++++++++++++- .../Modules/Tango.PPC.Events/Resources/Styles.xaml | 54 ++++++++++- .../Tango.PPC.Events/ViewModels/MainViewVM.cs | 7 +- .../Modules/Tango.PPC.Events/Views/MainView.xaml | 2 +- .../PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs | 2 +- .../PPC/Tango.PPC.UI/Views/LayoutView.xaml | 2 +- .../PPC/Tango.PPC.UI/Views/MainView.xaml | 2 +- .../Tango.SharedUI/Controls/NavigationControl.cs | 63 ++++++++++-- .../Tango.SharedUI/Tango.SharedUI.csproj | 3 +- .../Adapters/UsbTransportAdapter.cs | 4 +- 11 files changed, 224 insertions(+), 21 deletions(-) (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt index a603ff06b..6d87e9201 100644 Binary files a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt and b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt differ diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip index aa906ba91..7758bafce 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip @@ -18,10 +18,10 @@ - + - + @@ -41,9 +41,11 @@ + + @@ -71,9 +73,17 @@ + + + + + + + + @@ -100,6 +110,7 @@ + @@ -118,20 +129,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -167,14 +204,22 @@ + + + + + + + + - + @@ -209,12 +254,21 @@ + + + + + + + + + @@ -258,12 +312,14 @@ + + @@ -278,17 +334,28 @@ - + + + + + + + + + + + + @@ -302,13 +369,28 @@ + + + + + + + + + + + + + + + @@ -402,9 +484,23 @@ + + + + + + + + + + + + + + @@ -416,7 +512,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Resources/Styles.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Resources/Styles.xaml index 468ba228d..53102d8ec 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Resources/Styles.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Resources/Styles.xaml @@ -4,7 +4,7 @@ xmlns:converters="clr-namespace:Tango.PPC.Events.Converters" xmlns:local="clr-namespace:Tango.PPC.Events.Resources"> - + - + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs index dcf6afb97..997ea70d5 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/ViewModels/MainViewVM.cs @@ -97,7 +97,7 @@ namespace Tango.PPC.Events.ViewModels using (var db = ObservablesContext.CreateDefault()) { var last_week = DateTime.UtcNow.AddDays(-7); - HistoryEvents = (await db.MachinesEvents.Where(x => x.MachineGuid == MachineProvider.Machine.Guid && x.DateTime > last_week).Include(x => x.EventType).Where(x => (EventTypeNotificationTimes)x.EventType.EventNotificationTime != EventTypeNotificationTimes.None).ToListAsync()).OrderByDescending(x => x.DateTime).ToObservableCollection(); + HistoryEvents = (await db.MachinesEvents.Where(x => x.MachineGuid == MachineProvider.Machine.Guid && x.DateTime > last_week).Take(100).Include(x => x.EventType).Where(x => (EventTypeNotificationTimes)x.EventType.EventNotificationTime != EventTypeNotificationTimes.None).ToListAsync()).OrderByDescending(x => x.DateTime).ToObservableCollection(); } MachineProvider.MachineOperator.StatusChanged += MachineOperator_StatusChanged; @@ -177,6 +177,11 @@ namespace Tango.PPC.Events.ViewModels _notifications.Remove(item); NotificationProvider.PopNotification(item.Value); } + + if (HistoryEvents.Count > 100) + { + HistoryEvents.Remove(HistoryEvents.Last()); + } } }); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml index af42a5576..f263e4b7b 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Events/Views/MainView.xaml @@ -135,7 +135,7 @@ - + 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 a6fbaa3ce..24512bf27 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.0.22.0")] +[assembly: AssemblyVersion("1.0.23.0")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 18c8cc7ae..82a57a22b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -283,7 +283,7 @@ - + diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml index 604c79aeb..9899e60d4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -82,7 +82,7 @@ - + diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs index 5ef543347..1ec273e43 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; +using System.Windows.Forms.Integration; using System.Windows.Markup; using System.Windows.Media; using System.Windows.Media.Animation; @@ -294,12 +295,17 @@ namespace Tango.SharedUI.Controls { if (!_loaded) { + _loaded = true; + if (Elements != null) { + //foreach (var element in Elements.Where(x => x != SelectedElement)) + //{ + // LoadVisual(element); + //} + SelectedElement = Elements.FirstOrDefault(); } - - _loaded = true; } } @@ -335,13 +341,35 @@ namespace Tango.SharedUI.Controls var toAdd = Elements.Where(x => !_grid.Children.OfType().Select(y => y.Element).ToList().Contains(x)).ToList(); toRemove.ForEach(x => _grid.Children.Remove(x)); - toAdd.ForEach(x => _grid.Children.Add( - new NavigationElement() + + foreach (var x in toAdd) + { + var navigationElement = new NavigationElement() { RenderTransformOrigin = new Point(0.5, 0.5), Element = x, - Content = KeepElementsAttached ? x : null, - })); + Content = x, + }; + + _grid.Children.Add(navigationElement); + + if (!KeepElementsAttached) + { + bool loaded = false; + + navigationElement.Loaded += (_, __) => + { + if (!loaded) + { + if (x != SelectedElement) + { + loaded = true; + navigationElement.Content = null; + } + } + }; + } + } } if (!Elements.Contains(SelectedElement)) @@ -550,6 +578,29 @@ namespace Tango.SharedUI.Controls return element; } + /// + /// This method needs to be called in order for + // the element to print visibly at the correct size. + /// + private static void LoadVisual(FrameworkElement element) + { + if (element.Parent == null) + { + try + { + System.Windows.Forms.UserControl controlContainer = new System.Windows.Forms.UserControl(); + controlContainer.Width = 100; + controlContainer.Height = 100; + var host = new ElementHost() { Child = element, Dock = System.Windows.Forms.DockStyle.Fill }; + controlContainer.Controls.Add(host); + IntPtr handle = controlContainer.Handle; + host.Child = null; + controlContainer.Dispose(); + } + catch { } + } + } + #endregion } } diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index 53462afbf..4ee00a06e 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -58,6 +58,7 @@ + @@ -237,7 +238,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs b/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs index 1c21723c8..3b9ca7b55 100644 --- a/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs +++ b/Software/Visual_Studio/Tango.Transport/Adapters/UsbTransportAdapter.cs @@ -145,8 +145,8 @@ namespace Tango.Transport.Adapters try { - _serialPort.DiscardOutBuffer(); - _serialPort.DiscardInBuffer(); + //_serialPort.DiscardOutBuffer(); + //_serialPort.DiscardInBuffer(); _serialPort.Close(); _serialPort.Dispose(); -- cgit v1.3.1 From ae628de00d95cfa2982ee9f90ac0d1a44ca80109 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 7 May 2019 19:20:41 +0300 Subject: Working on TCC... --- .../Android_Studio/ColorCapture/app/build.gradle | 107 ++++++++++++--------- Software/Android_Studio/KeyStore/private_key.pepk | Bin 0 -> 1776 bytes Software/Android_Studio/KeyStore/tcc_key.jks | Bin 0 -> 2287 bytes Software/Graphics/Mobile/Google Play/Result.jpg | Bin 0 -> 83864 bytes Software/Graphics/Mobile/Google Play/Snap.jpg | Bin 0 -> 227435 bytes .../Google Play/SnapMatch for play store.docx | Bin 0 -> 108095 bytes Software/Graphics/Mobile/Google Play/Welcome.jpg | Bin 0 -> 181795 bytes Software/Graphics/Mobile/Google Play/feature.png | Bin 0 -> 544662 bytes .../Notes/Tango.Notes/TCC/Play Console.txt | 6 ++ .../Notes/Tango.Notes/Tango.Notes.csproj | 3 +- .../Visual_Studio/TCC/Tango.TCC.Service/Web.config | 1 + .../Tango.BL/ObservablesContextConfiguration.cs | 44 ++++----- .../Tango.BL/ObservablesContextExtension.cs | 2 +- 13 files changed, 94 insertions(+), 69 deletions(-) create mode 100644 Software/Android_Studio/KeyStore/private_key.pepk create mode 100644 Software/Android_Studio/KeyStore/tcc_key.jks create mode 100644 Software/Graphics/Mobile/Google Play/Result.jpg create mode 100644 Software/Graphics/Mobile/Google Play/Snap.jpg create mode 100644 Software/Graphics/Mobile/Google Play/SnapMatch for play store.docx create mode 100644 Software/Graphics/Mobile/Google Play/Welcome.jpg create mode 100644 Software/Graphics/Mobile/Google Play/feature.png create mode 100644 Software/Visual_Studio/Notes/Tango.Notes/TCC/Play Console.txt (limited to 'Software/Visual_Studio') diff --git a/Software/Android_Studio/ColorCapture/app/build.gradle b/Software/Android_Studio/ColorCapture/app/build.gradle index 8a0752b39..3aa149370 100644 --- a/Software/Android_Studio/ColorCapture/app/build.gradle +++ b/Software/Android_Studio/ColorCapture/app/build.gradle @@ -52,63 +52,80 @@ android { } } - splits { - - // Configures multiple APKs based on ABI. +// splits { +// +// // Configures multiple APKs based on ABI. +// abi { +// +// // Enables building multiple APKs per ABI. +// enable true +// +// // By default all ABIs are included, so use reset() and include to specify that we only +// // want APKs for x86 and x86_64. +// +// // Resets the list of ABIs that Gradle should create APKs for to none. +// reset() +// +// // Specifies a list of ABIs that Gradle should create APKs for. +// include "armeabi-v7a", "arm64-v8a", "x86" +// +// // Specifies that we do not want to also generate a universal APK that includes all ABIs. +// universalApk false +// } +// } + + // Add this block and enable/disable the parameters as follows + bundle { + density { + // Different APKs are generated for devices with different screen densities; true by default. + enableSplit false + } abi { - - // Enables building multiple APKs per ABI. - enable true - - // By default all ABIs are included, so use reset() and include to specify that we only - // want APKs for x86 and x86_64. - - // Resets the list of ABIs that Gradle should create APKs for to none. - reset() - - // Specifies a list of ABIs that Gradle should create APKs for. - include "armeabi-v7a", "arm64-v8a", "x86" - - // Specifies that we do not want to also generate a universal APK that includes all ABIs. - universalApk false + // Different APKs are generated for devices with different CPU architectures; true by default. + enableSplit true + } + language { + // This is disabled so that the App Bundle does NOT split the APK for each language. + // We're gonna use the same APK for all languages. + enableSplit false } } } // Map for the version code that gives each ABI a value. -ext.abiCodes = ['armeabi-v7a':1, 'arm64-v8a':2, 'x86':3] +//ext.abiCodes = ['armeabi-v7a':1, 'arm64-v8a':2, 'x86':3] -import com.android.build.OutputFile +//import com.android.build.OutputFile // For each APK output variant, override versionCode with a combination of // ext.abiCodes * 1000 + variant.versionCode. In this example, variant.versionCode // is equal to defaultConfig.versionCode. If you configure product flavors that // define their own versionCode, variant.versionCode uses that value instead. -android.applicationVariants.all { variant -> - - // Assigns a different version code for each output APK - // other than the universal APK. - variant.outputs.each { output -> - - // Stores the value of ext.abiCodes that is associated with the ABI for this variant. - def baseAbiVersionCode = - // Determines the ABI for this variant and returns the mapped value. - project.ext.abiCodes.get(output.getFilter(OutputFile.ABI)) - - // Because abiCodes.get() returns null for ABIs that are not mapped by ext.abiCodes, - // the following code does not override the version code for universal APKs. - // However, because we want universal APKs to have the lowest version code, - // this outcome is desirable. - if (baseAbiVersionCode != null) { - - // Assigns the new version code to versionCodeOverride, which changes the version code - // for only the output APK, not for the variant itself. Skipping this step simply - // causes Gradle to use the value of variant.versionCode for the APK. - output.versionCodeOverride = - baseAbiVersionCode * 1000 + variant.versionCode - } - } -} +//android.applicationVariants.all { variant -> +// +// // Assigns a different version code for each output APK +// // other than the universal APK. +// variant.outputs.each { output -> +// +// // Stores the value of ext.abiCodes that is associated with the ABI for this variant. +// def baseAbiVersionCode = +// // Determines the ABI for this variant and returns the mapped value. +// project.ext.abiCodes.get(output.getFilter(OutputFile.ABI)) +// +// // Because abiCodes.get() returns null for ABIs that are not mapped by ext.abiCodes, +// // the following code does not override the version code for universal APKs. +// // However, because we want universal APKs to have the lowest version code, +// // this outcome is desirable. +// if (baseAbiVersionCode != null) { +// +// // Assigns the new version code to versionCodeOverride, which changes the version code +// // for only the output APK, not for the variant itself. Skipping this step simply +// // causes Gradle to use the value of variant.versionCode for the APK. +// output.versionCodeOverride = +// baseAbiVersionCode * 1000 + variant.versionCode +// } +// } +//} dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') diff --git a/Software/Android_Studio/KeyStore/private_key.pepk b/Software/Android_Studio/KeyStore/private_key.pepk new file mode 100644 index 000000000..a714f2044 Binary files /dev/null and b/Software/Android_Studio/KeyStore/private_key.pepk differ diff --git a/Software/Android_Studio/KeyStore/tcc_key.jks b/Software/Android_Studio/KeyStore/tcc_key.jks new file mode 100644 index 000000000..f0197550f Binary files /dev/null and b/Software/Android_Studio/KeyStore/tcc_key.jks differ diff --git a/Software/Graphics/Mobile/Google Play/Result.jpg b/Software/Graphics/Mobile/Google Play/Result.jpg new file mode 100644 index 000000000..840418b39 Binary files /dev/null and b/Software/Graphics/Mobile/Google Play/Result.jpg differ diff --git a/Software/Graphics/Mobile/Google Play/Snap.jpg b/Software/Graphics/Mobile/Google Play/Snap.jpg new file mode 100644 index 000000000..6a9b01adb Binary files /dev/null and b/Software/Graphics/Mobile/Google Play/Snap.jpg differ diff --git a/Software/Graphics/Mobile/Google Play/SnapMatch for play store.docx b/Software/Graphics/Mobile/Google Play/SnapMatch for play store.docx new file mode 100644 index 000000000..2f792b533 Binary files /dev/null and b/Software/Graphics/Mobile/Google Play/SnapMatch for play store.docx differ diff --git a/Software/Graphics/Mobile/Google Play/Welcome.jpg b/Software/Graphics/Mobile/Google Play/Welcome.jpg new file mode 100644 index 000000000..380deb0bd Binary files /dev/null and b/Software/Graphics/Mobile/Google Play/Welcome.jpg differ diff --git a/Software/Graphics/Mobile/Google Play/feature.png b/Software/Graphics/Mobile/Google Play/feature.png new file mode 100644 index 000000000..71d858c3e Binary files /dev/null and b/Software/Graphics/Mobile/Google Play/feature.png differ diff --git a/Software/Visual_Studio/Notes/Tango.Notes/TCC/Play Console.txt b/Software/Visual_Studio/Notes/Tango.Notes/TCC/Play Console.txt new file mode 100644 index 000000000..ccb3dde0d --- /dev/null +++ b/Software/Visual_Studio/Notes/Tango.Notes/TCC/Play Console.txt @@ -0,0 +1,6 @@ +TCC GMail. + +First Name: Twine +Last Name: TCC +Email: twine.tcc@gmail.com +Password: 1Creativity \ No newline at end of file diff --git a/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj b/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj index 2ce33c1c4..2e8171a87 100644 --- a/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj +++ b/Software/Visual_Studio/Notes/Tango.Notes/Tango.Notes.csproj @@ -51,13 +51,14 @@ + - + \ No newline at end of file diff --git a/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config b/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config index 831e845aa..d84b6b117 100644 --- a/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config +++ b/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config @@ -46,6 +46,7 @@ + diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs index 04d22a7b6..a6cb84c5f 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContextConfiguration.cs @@ -11,29 +11,29 @@ using Tango.Core.Helpers; namespace Tango.BL { - public class ObservablesContextConfiguration : DbConfiguration - { - public static String FolderPath { get; private set; } + //public class ObservablesContextConfiguration : DbConfiguration + //{ + // public static String FolderPath { get; private set; } - static ObservablesContextConfiguration() - { - FolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "EFCache", Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName)); - } + // static ObservablesContextConfiguration() + // { + // FolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Twine", "Tango", "EFCache", Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName)); + // } - public ObservablesContextConfiguration() : base() - { - Directory.CreateDirectory(FolderPath); - var modelStore = new DefaultDbModelStore(FolderPath); - SetModelStore(modelStore); - } + // public ObservablesContextConfiguration() : base() + // { + // Directory.CreateDirectory(FolderPath); + // var modelStore = new DefaultDbModelStore(FolderPath); + // SetModelStore(modelStore); + // } - public static void ClearModelStore() - { - try - { - Directory.Delete(FolderPath); - } - catch { } - } - } + // public static void ClearModelStore() + // { + // try + // { + // Directory.Delete(FolderPath); + // } + // catch { } + // } + //} } diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs index 9f6797b9a..de882c910 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs @@ -227,7 +227,7 @@ namespace Tango.BL /// public static void ClearModelStore() { - ObservablesContextConfiguration.ClearModelStore(); + //ObservablesContextConfiguration.ClearModelStore(); } /// -- cgit v1.3.1