mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:56:31 +00:00
add list files for autoupdate feature
put new Versioning fix bugs
This commit is contained in:
+88
-82
@@ -106,100 +106,106 @@ public partial class App
|
||||
|
||||
private void Start(ApiCredentials credentials)
|
||||
{
|
||||
new ConfigUpdater().CheckConfig();
|
||||
var initConfig = SecurityConstants.ReadInitConfig();
|
||||
var apiDir = initConfig.DirectoriesConfig.ApiResourcesDirectory;
|
||||
_loaderClient = new LoaderClient(initConfig.LoaderClientConfig, Log.Logger, _mainCTokenSource.Token);
|
||||
try
|
||||
{
|
||||
new ConfigUpdater().CheckConfig();
|
||||
var initConfig = SecurityConstants.ReadInitConfig();
|
||||
var apiDir = initConfig.DirectoriesConfig.ApiResourcesDirectory;
|
||||
_loaderClient = new LoaderClient(initConfig.LoaderClientConfig, Log.Logger, _mainCTokenSource.Token);
|
||||
|
||||
#if DEBUG
|
||||
_loaderClient.StartClient();
|
||||
#endif
|
||||
_loaderClient.Connect(); //Client app should be already started by LoaderUI
|
||||
_loaderClient.Login(credentials);
|
||||
_loaderClient.StartClient();
|
||||
_loaderClient.Connect(); //Client app should be already started by LoaderUI
|
||||
_loaderClient.Login(credentials);
|
||||
|
||||
var azaionApi = new AzaionApi(new HttpClient { BaseAddress = new Uri(initConfig.InferenceClientConfig.ApiUrl) }, _cache, credentials);
|
||||
var azaionApi = new AzaionApi(new HttpClient { BaseAddress = new Uri(initConfig.InferenceClientConfig.ApiUrl) }, _cache, credentials);
|
||||
|
||||
_host = Host.CreateDefaultBuilder()
|
||||
.ConfigureAppConfiguration((_, config) => config
|
||||
.AddCommandLine(Environment.GetCommandLineArgs())
|
||||
.AddJsonFile(SecurityConstants.CONFIG_PATH, optional: true, reloadOnChange: true)
|
||||
.AddJsonStream(GetSystemConfig(_loaderClient, apiDir))
|
||||
.AddJsonStream(GetSecuredConfig(_loaderClient, apiDir)))
|
||||
.UseSerilog()
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
services.AddSingleton<MainSuite>();
|
||||
|
||||
services.Configure<AppConfig>(context.Configuration);
|
||||
services.ConfigureSection<QueueConfig>(context.Configuration);
|
||||
services.ConfigureSection<DirectoriesConfig>(context.Configuration);
|
||||
services.ConfigureSection<AnnotationConfig>(context.Configuration);
|
||||
services.ConfigureSection<AIRecognitionConfig>(context.Configuration);
|
||||
services.ConfigureSection<ThumbnailConfig>(context.Configuration);
|
||||
services.ConfigureSection<UIConfig>(context.Configuration);
|
||||
services.ConfigureSection<MapConfig>(context.Configuration);
|
||||
|
||||
#region External Services
|
||||
|
||||
services.ConfigureSection<LoaderClientConfig>(context.Configuration);
|
||||
services.AddSingleton(_loaderClient);
|
||||
|
||||
services.ConfigureSection<InferenceClientConfig>(context.Configuration);
|
||||
services.AddSingleton<IInferenceClient, InferenceClient>();
|
||||
services.AddSingleton<IInferenceService, InferenceService>();
|
||||
|
||||
services.ConfigureSection<GpsDeniedClientConfig>(context.Configuration);
|
||||
services.AddSingleton<IGpsMatcherClient, GpsMatcherClient>();
|
||||
services.AddSingleton<IGpsMatcherService, GpsMatcherService>();
|
||||
services.AddSingleton<ISatelliteDownloader, SatelliteDownloader>();
|
||||
|
||||
services.AddHttpClient();
|
||||
services.AddSingleton<IAzaionApi>(azaionApi);
|
||||
#endregion
|
||||
|
||||
services.AddSingleton<IConfigUpdater, ConfigUpdater>();
|
||||
services.AddSingleton<Annotator.Annotator>();
|
||||
services.AddSingleton<DatasetExplorer>();
|
||||
services.AddSingleton<HelpWindow>();
|
||||
services.AddMediatR(c => c.RegisterServicesFromAssemblies(
|
||||
typeof(Annotator.Annotator).Assembly,
|
||||
typeof(DatasetExplorer).Assembly,
|
||||
typeof(AnnotationService).Assembly));
|
||||
services.AddSingleton<LibVLC>(_ => new LibVLC());
|
||||
services.AddSingleton<FormState>();
|
||||
services.AddSingleton<MediaPlayer>(sp =>
|
||||
_host = Host.CreateDefaultBuilder()
|
||||
.ConfigureAppConfiguration((_, config) => config
|
||||
.AddCommandLine(Environment.GetCommandLineArgs())
|
||||
.AddJsonFile(SecurityConstants.CONFIG_PATH, optional: true, reloadOnChange: true)
|
||||
.AddJsonStream(GetSystemConfig(_loaderClient, apiDir))
|
||||
.AddJsonStream(GetSecuredConfig(_loaderClient, apiDir)))
|
||||
.UseSerilog()
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
var libVLC = sp.GetRequiredService<LibVLC>();
|
||||
return new MediaPlayer(libVLC);
|
||||
});
|
||||
services.AddSingleton<AnnotatorEventHandler>();
|
||||
services.AddSingleton<IDbFactory, DbFactory>();
|
||||
services.AddSingleton<MainSuite>();
|
||||
|
||||
services.AddSingleton<FailsafeAnnotationsProducer>();
|
||||
services.Configure<AppConfig>(context.Configuration);
|
||||
services.ConfigureSection<QueueConfig>(context.Configuration);
|
||||
services.ConfigureSection<DirectoriesConfig>(context.Configuration);
|
||||
services.ConfigureSection<AnnotationConfig>(context.Configuration);
|
||||
services.ConfigureSection<AIRecognitionConfig>(context.Configuration);
|
||||
services.ConfigureSection<ThumbnailConfig>(context.Configuration);
|
||||
services.ConfigureSection<UIConfig>(context.Configuration);
|
||||
services.ConfigureSection<MapConfig>(context.Configuration);
|
||||
|
||||
services.AddSingleton<IAnnotationService, AnnotationService>();
|
||||
#region External Services
|
||||
|
||||
services.AddSingleton<DatasetExplorer>();
|
||||
services.AddSingleton<IGalleryService, GalleryService>();
|
||||
services.ConfigureSection<LoaderClientConfig>(context.Configuration);
|
||||
services.AddSingleton(_loaderClient);
|
||||
|
||||
services.AddSingleton<IAzaionModule, AnnotatorModule>();
|
||||
services.AddSingleton<IAzaionModule, DatasetExplorerModule>();
|
||||
})
|
||||
.Build();
|
||||
services.ConfigureSection<InferenceClientConfig>(context.Configuration);
|
||||
services.AddSingleton<IInferenceClient, InferenceClient>();
|
||||
services.AddSingleton<IInferenceService, InferenceService>();
|
||||
|
||||
Annotation.InitializeDirs(_host.Services.GetRequiredService<IOptions<DirectoriesConfig>>().Value);
|
||||
_host.Services.GetRequiredService<DatasetExplorer>();
|
||||
// datasetExplorer.Show();
|
||||
// datasetExplorer.Hide();
|
||||
services.ConfigureSection<GpsDeniedClientConfig>(context.Configuration);
|
||||
services.AddSingleton<IGpsMatcherClient, GpsMatcherClient>();
|
||||
services.AddSingleton<IGpsMatcherService, GpsMatcherService>();
|
||||
services.AddSingleton<ISatelliteDownloader, SatelliteDownloader>();
|
||||
|
||||
_mediator = _host.Services.GetRequiredService<IMediator>();
|
||||
services.AddHttpClient();
|
||||
services.AddSingleton<IAzaionApi>(azaionApi);
|
||||
#endregion
|
||||
|
||||
_formState = _host.Services.GetRequiredService<FormState>();
|
||||
DispatcherUnhandledException += OnDispatcherUnhandledException;
|
||||
services.AddSingleton<IConfigUpdater, ConfigUpdater>();
|
||||
services.AddSingleton<Annotator.Annotator>();
|
||||
services.AddSingleton<DatasetExplorer>();
|
||||
services.AddSingleton<HelpWindow>();
|
||||
services.AddMediatR(c => c.RegisterServicesFromAssemblies(
|
||||
typeof(Annotator.Annotator).Assembly,
|
||||
typeof(DatasetExplorer).Assembly,
|
||||
typeof(AnnotationService).Assembly));
|
||||
services.AddSingleton<LibVLC>(_ => new LibVLC());
|
||||
services.AddSingleton<FormState>();
|
||||
services.AddSingleton<MediaPlayer>(sp =>
|
||||
{
|
||||
var libVLC = sp.GetRequiredService<LibVLC>();
|
||||
return new MediaPlayer(libVLC);
|
||||
});
|
||||
services.AddSingleton<AnnotatorEventHandler>();
|
||||
services.AddSingleton<IDbFactory, DbFactory>();
|
||||
|
||||
_host.Start();
|
||||
EventManager.RegisterClassHandler(typeof(UIElement), UIElement.PreviewKeyDownEvent, new RoutedEventHandler(GlobalKeyHandler));
|
||||
_host.Services.GetRequiredService<MainSuite>().Show();
|
||||
services.AddSingleton<FailsafeAnnotationsProducer>();
|
||||
|
||||
services.AddSingleton<IAnnotationService, AnnotationService>();
|
||||
|
||||
services.AddSingleton<DatasetExplorer>();
|
||||
services.AddSingleton<IGalleryService, GalleryService>();
|
||||
|
||||
services.AddSingleton<IAzaionModule, AnnotatorModule>();
|
||||
services.AddSingleton<IAzaionModule, DatasetExplorerModule>();
|
||||
})
|
||||
.Build();
|
||||
|
||||
Annotation.InitializeDirs(_host.Services.GetRequiredService<IOptions<DirectoriesConfig>>().Value);
|
||||
_host.Services.GetRequiredService<DatasetExplorer>();
|
||||
// datasetExplorer.Show();
|
||||
// datasetExplorer.Hide();
|
||||
|
||||
_mediator = _host.Services.GetRequiredService<IMediator>();
|
||||
|
||||
_formState = _host.Services.GetRequiredService<FormState>();
|
||||
DispatcherUnhandledException += OnDispatcherUnhandledException;
|
||||
|
||||
_host.Start();
|
||||
EventManager.RegisterClassHandler(typeof(UIElement), UIElement.PreviewKeyDownEvent, new RoutedEventHandler(GlobalKeyHandler));
|
||||
_host.Services.GetRequiredService<MainSuite>().Show();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Logger.Error(e, e.Message);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private void GlobalKeyHandler(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionDate>$([System.DateTime]::UtcNow.ToString("yyyy.MM.dd"))</VersionDate>
|
||||
<VersionSeconds>$([System.Convert]::ToInt32($([System.DateTime]::UtcNow.TimeOfDay.TotalSeconds)))</VersionSeconds>
|
||||
<VersionSeconds>$([System.Convert]::ToInt32($([System.DateTime]::UtcNow.TimeOfDay.TotalMinutes)))</VersionSeconds>
|
||||
|
||||
<AssemblyVersion>$(VersionDate).$(VersionSeconds)</AssemblyVersion>
|
||||
<FileVersion>$(AssemblyVersion)</FileVersion>
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
{
|
||||
"LoaderClientConfig": {
|
||||
"ZeroMqHost": "127.0.0.1",
|
||||
"ZeroMqPort": 5025,
|
||||
"ApiUrl": "https://api.azaion.com"
|
||||
},
|
||||
"InferenceClientConfig": {
|
||||
"ZeroMqHost": "127.0.0.1",
|
||||
"ZeroMqPort": 5131,
|
||||
"RetryCount": 25,
|
||||
"TimeoutSeconds": 5,
|
||||
"ZeroMqPort": 5127,
|
||||
"ApiUrl": "https://api.azaion.com"
|
||||
},
|
||||
"GpsDeniedClientConfig": {
|
||||
"ZeroMqHost": "127.0.0.1",
|
||||
"ZeroMqPort": 5555,
|
||||
"ZeroMqReceiverPort": 5556,
|
||||
"RetryCount": 25,
|
||||
"TimeoutSeconds": 5
|
||||
"ZeroMqReceiverPort": 5556
|
||||
},
|
||||
"DirectoriesConfig": {
|
||||
"ApiResourcesDirectory": "",
|
||||
|
||||
Reference in New Issue
Block a user