From 47aa8b862b44cee7cc5e56bce8483ca5911d4da9 Mon Sep 17 00:00:00 2001 From: Alex Bezdieniezhnykh Date: Sun, 27 Apr 2025 21:43:45 +0300 Subject: [PATCH] add silent detection - don't send to queue if enable --- Azaion.Common/DTO/Config/UIConfig.cs | 1 + Azaion.Common/Services/AnnotationService.cs | 2 +- Azaion.Suite/App.xaml.cs | 8 ++++++-- Azaion.Suite/MainSuite.xaml.cs | 6 +++--- Azaion.Suite/config.json | 3 ++- Azaion.Suite/config.production.json | 3 ++- Dummy/Azaion.Dataset/DatasetExplorer.xaml | 2 +- build/installer.iss | 4 ++-- build/publish.cmd | 1 - 9 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Azaion.Common/DTO/Config/UIConfig.cs b/Azaion.Common/DTO/Config/UIConfig.cs index 9b4036e..d1f75e7 100644 --- a/Azaion.Common/DTO/Config/UIConfig.cs +++ b/Azaion.Common/DTO/Config/UIConfig.cs @@ -5,4 +5,5 @@ public class UIConfig public double LeftPanelWidth { get; set; } public double RightPanelWidth { get; set; } public bool GenerateAnnotatedImage { get; set; } + public bool SilentDetection { get; set; } } diff --git a/Azaion.Common/Services/AnnotationService.cs b/Azaion.Common/Services/AnnotationService.cs index 8271588..a9859cd 100644 --- a/Azaion.Common/Services/AnnotationService.cs +++ b/Azaion.Common/Services/AnnotationService.cs @@ -176,7 +176,7 @@ public class AnnotationService : INotificationHandler if (_uiConfig.GenerateAnnotatedImage) await _galleryService.CreateAnnotatedImage(annotation, token); - if (!fromQueue) //Send to queue only if we're not getting from queue already + if (!fromQueue && !_uiConfig.SilentDetection) //Send to queue only if we're not getting from queue already await _producer.SendToInnerQueue(annotation, token); await _mediator.Publish(new AnnotationCreatedEvent(annotation), token); diff --git a/Azaion.Suite/App.xaml.cs b/Azaion.Suite/App.xaml.cs index 88d463c..a397029 100644 --- a/Azaion.Suite/App.xaml.cs +++ b/Azaion.Suite/App.xaml.cs @@ -147,7 +147,11 @@ public partial class App EventManager.RegisterClassHandler(typeof(UIElement), UIElement.KeyDownEvent, new RoutedEventHandler(GlobalClick)); _host.Services.GetRequiredService().Show(); }; - + login.Closed += (sender, args) => + { + if (!login.MainSuiteOpened) + _inferenceClient.Stop(); + }; login.ShowDialog(); } @@ -246,4 +250,4 @@ public partial class App base.OnExit(e); await _host.StopAsync(); } -} \ No newline at end of file +} diff --git a/Azaion.Suite/MainSuite.xaml.cs b/Azaion.Suite/MainSuite.xaml.cs index 761dcf4..4b16c7d 100644 --- a/Azaion.Suite/MainSuite.xaml.cs +++ b/Azaion.Suite/MainSuite.xaml.cs @@ -119,9 +119,6 @@ public partial class MainSuite if (_openedWindows.Any()) return; - _inferenceClient.Stop(); - _gpsMatcherClient.Stop(); - Close(); }; window.Show(); @@ -145,6 +142,9 @@ public partial class MainSuite _dbFactory.SaveToDisk(); foreach (var window in _openedWindows) window.Value.Close(); + + _inferenceClient.Stop(); + _gpsMatcherClient.Stop(); Application.Current.Shutdown(); } diff --git a/Azaion.Suite/config.json b/Azaion.Suite/config.json index 2fa431d..64eeb8c 100644 --- a/Azaion.Suite/config.json +++ b/Azaion.Suite/config.json @@ -25,6 +25,7 @@ "UIConfig": { "LeftPanelWidth": 220.0, "RightPanelWidth": 230.0, - "GenerateAnnotatedImage": true + "GenerateAnnotatedImage": true, + "SilentDetection": true } } \ No newline at end of file diff --git a/Azaion.Suite/config.production.json b/Azaion.Suite/config.production.json index 5c34cc2..148b50e 100644 --- a/Azaion.Suite/config.production.json +++ b/Azaion.Suite/config.production.json @@ -25,6 +25,7 @@ "UIConfig": { "LeftPanelWidth": 170.0, "RightPanelWidth": 120.0, - "GenerateAnnotatedImage": true + "GenerateAnnotatedImage": true, + "SilentDetection": false } } \ No newline at end of file diff --git a/Dummy/Azaion.Dataset/DatasetExplorer.xaml b/Dummy/Azaion.Dataset/DatasetExplorer.xaml index 9b78e59..01caff8 100644 --- a/Dummy/Azaion.Dataset/DatasetExplorer.xaml +++ b/Dummy/Azaion.Dataset/DatasetExplorer.xaml @@ -15,7 +15,7 @@ TextAlignment="Center"> Будь ласка перевірте правильність email чи паролю! Також зауважте, що запуск можливий лише з одного конкретного компьютера, копіювання заборонене! - Для подальшого вирішення проблеми ви моежете зв'язатися з нами: hi@azaion.com + Для подальшого вирішення проблеми ви можете зв'язатися з нами: hi@azaion.com Please check your email or password! The program is restricted to start only from particular hardware, copying is forbidden! diff --git a/build/installer.iss b/build/installer.iss index bfdf40d..0ad09ed 100644 --- a/build/installer.iss +++ b/build/installer.iss @@ -1,12 +1,12 @@ [Setup] AppId={{CCFEC8E2-0FCC-4B03-8EEA-00AF20D265E5}} AppName=Azaion Suite -AppVersion=1.4.4 +AppVersion=1.4.5 AppPublisher=Azaion Ukraine DefaultDirName={localappdata}\Azaion\Azaion Suite DefaultGroupName=Azaion Suite OutputDir=..\ -OutputBaseFilename=AzaionSuite1.4.4 +OutputBaseFilename=AzaionSuite1.4.5 SetupIconFile=..\dist\logo.ico UninstallDisplayName=Azaion Suite UninstallDisplayIcon={app}\Azaion.Suite.exe diff --git a/build/publish.cmd b/build/publish.cmd index 0e4f6b2..84db8fd 100644 --- a/build/publish.cmd +++ b/build/publish.cmd @@ -6,7 +6,6 @@ dotnet build -c Release cd Azaion.Suite call postbuild.cmd Release -echo %cd% call upload-file %cd%\config.secured.json call upload-file %cd%\config.system.json