mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:36:31 +00:00
add manual Tile Processor
zoom on video on pause (temp image)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Windows;
|
||||
using Azaion.Common;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
@@ -28,7 +29,7 @@ public partial class App
|
||||
var host = Host.CreateDefaultBuilder()
|
||||
.ConfigureAppConfiguration((_, config) => config
|
||||
.AddCommandLine(Environment.GetCommandLineArgs())
|
||||
.AddJsonFile(Constants.CONFIG_JSON_FILE, optional: true))
|
||||
.AddJsonFile(Constants.LOADER_CONFIG_PATH, optional: true))
|
||||
.UseSerilog()
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
@@ -36,7 +37,7 @@ public partial class App
|
||||
services.Configure<DirectoriesConfig>(context.Configuration.GetSection(nameof(DirectoriesConfig)));
|
||||
services.AddHttpClient<IAzaionApi, AzaionApi>((sp, client) =>
|
||||
{
|
||||
client.BaseAddress = new Uri(Constants.API_URL);
|
||||
client.BaseAddress = new Uri(Constants.DEFAULT_API_URL);
|
||||
client.DefaultRequestHeaders.Add("Accept", "application/json");
|
||||
client.DefaultRequestHeaders.Add("User-Agent", "Azaion.LoaderUI");
|
||||
});
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
namespace Azaion.LoaderUI;
|
||||
|
||||
public static class Constants
|
||||
{
|
||||
public const string CONFIG_JSON_FILE = "loaderconfig.json";
|
||||
public const string API_URL = "https://api.azaion.com";
|
||||
public const string AZAION_SUITE_EXE = "Azaion.Suite.exe";
|
||||
public const string SUITE_FOLDER = "suite";
|
||||
public const string INFERENCE_EXE = "azaion-inference";
|
||||
public const string EXTERNAL_LOADER_PATH = "azaion-loader.exe";
|
||||
public const int EXTERNAL_LOADER_PORT = 5020;
|
||||
public const string EXTERNAL_LOADER_HOST = "127.0.0.1";
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Azaion.LoaderUI;
|
||||
|
||||
public static class ConstantsLoader
|
||||
{
|
||||
public const string SUITE_FOLDER = "suite";
|
||||
public const int EXTERNAL_LOADER_PORT = 5020;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public partial class Login
|
||||
|
||||
TbStatus.Foreground = Brushes.Black;
|
||||
var installerVersion = await GetInstallerVer();
|
||||
var localVersion = GetLocalVer();
|
||||
var localVersion = Constants.GetLocalVersion();
|
||||
var credsEncrypted = Security.Encrypt(creds);
|
||||
|
||||
if (installerVersion > localVersion)
|
||||
@@ -81,7 +81,7 @@ public partial class Login
|
||||
Process.Start(Constants.AZAION_SUITE_EXE, $"-c {credsEncrypted}");
|
||||
await Task.Delay(800);
|
||||
TbStatus.Text = "Loading...";
|
||||
while (!Process.GetProcessesByName(Constants.INFERENCE_EXE).Any())
|
||||
while (!Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Constants.EXTERNAL_INFERENCE_PATH)).Any())
|
||||
await Task.Delay(500);
|
||||
await Task.Delay(1500);
|
||||
}
|
||||
@@ -106,12 +106,12 @@ public partial class Login
|
||||
process.StartInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = Constants.EXTERNAL_LOADER_PATH,
|
||||
Arguments = $"--port {Constants.EXTERNAL_LOADER_PORT} --api {Constants.API_URL}",
|
||||
Arguments = $"--port {ConstantsLoader.EXTERNAL_LOADER_PORT} --api {Constants.DEFAULT_API_URL}",
|
||||
CreateNoWindow = true
|
||||
};
|
||||
process.Start();
|
||||
dealer.Options.Identity = Encoding.UTF8.GetBytes(Guid.NewGuid().ToString("N"));
|
||||
dealer.Connect($"tcp://{Constants.EXTERNAL_LOADER_HOST}:{Constants.EXTERNAL_LOADER_PORT}");
|
||||
dealer.Connect($"tcp://{Constants.DEFAULT_ZMQ_INFERENCE_HOST}:{ConstantsLoader.EXTERNAL_LOADER_PORT}");
|
||||
|
||||
var result = SendCommand(dealer, RemoteCommand.Create(CommandType.Login, creds));
|
||||
if (result.CommandType != CommandType.Ok)
|
||||
@@ -164,7 +164,7 @@ public partial class Login
|
||||
{
|
||||
TbStatus.Text = "Checking for the newer version...";
|
||||
var installerDir = string.IsNullOrWhiteSpace(_dirConfig?.SuiteInstallerDirectory)
|
||||
? Constants.SUITE_FOLDER
|
||||
? ConstantsLoader.SUITE_FOLDER
|
||||
: _dirConfig.SuiteInstallerDirectory;
|
||||
var installerName = await _azaionApi.GetLastInstallerName(installerDir);
|
||||
var match = Regex.Match(installerName, @"\d+(\.\d+)+");
|
||||
@@ -172,15 +172,7 @@ public partial class Login
|
||||
throw new Exception($"Can't find version in {installerName}");
|
||||
return new Version(match.Value);
|
||||
}
|
||||
|
||||
private Version GetLocalVer()
|
||||
{
|
||||
var localFileInfo = FileVersionInfo.GetVersionInfo(Constants.AZAION_SUITE_EXE);
|
||||
if (string.IsNullOrWhiteSpace(localFileInfo.ProductVersion))
|
||||
throw new Exception($"Can't find {Constants.AZAION_SUITE_EXE} and its version");
|
||||
return new Version(localFileInfo.FileVersion!);
|
||||
}
|
||||
|
||||
|
||||
private void CloseClick(object sender, RoutedEventArgs e) => Close();
|
||||
|
||||
private void MainMouseMove(object sender, MouseEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user