forked from amkovkov/GranuSightSoftware2
comprehensive update
1) remove unused components: camera view (due it causes segmentation faults), compute resources and all related, illuminator controller (due in useless without camera view), image storage service, temperature and humidity service 2) database schema - reduce tables references, features storing in records themselves in compressed form, add records creation and editing date and time, add separator comment column 3) analysis - rework of pipeline and ui, now database storing only raw data and all display values calculated from it 4) lights service - add reconnection if disconnected 5) add width and height command line arguments 6) fix some typos and other issues
This commit is contained in:
+23
-7
@@ -28,6 +28,8 @@ public static class UI
|
||||
public static readonly Option<RenderingModes> RenderingMode;
|
||||
public static readonly Option<bool> HideConsole;
|
||||
public static readonly Option<bool> Mock;
|
||||
public static readonly Option<int> Width;
|
||||
public static readonly Option<int> Height;
|
||||
|
||||
static UI()
|
||||
{
|
||||
@@ -56,6 +58,16 @@ public static class UI
|
||||
Description = "Запуск в фиктивном режиме без инициализации и использования периферии",
|
||||
DefaultValueFactory = (result) => false
|
||||
};
|
||||
Width = new("--width")
|
||||
{
|
||||
Description = "Ширина окна, если меньше или равна 0, то устанавливается ширина по-умолчанию",
|
||||
DefaultValueFactory = (result) => 0
|
||||
};
|
||||
Height = new("--height")
|
||||
{
|
||||
Description = "Высота окна, если меньше или равна 0, то устанавливается высота по-умолчанию",
|
||||
DefaultValueFactory = (result) => 0
|
||||
};
|
||||
|
||||
// Изменяем описания стандартных опций
|
||||
Helper.TranslateDefaultOptionDescriptions(RootCommand);
|
||||
@@ -65,12 +77,16 @@ public static class UI
|
||||
RootCommand.Add(RenderingMode);
|
||||
RootCommand.Add(HideConsole);
|
||||
RootCommand.Add(Mock);
|
||||
RootCommand.Add(Width);
|
||||
RootCommand.Add(Height);
|
||||
RootCommand.SetAction(CommandAction);
|
||||
|
||||
Command.Add(Fullscreen);
|
||||
Command.Add(RenderingMode);
|
||||
Command.Add(HideConsole);
|
||||
Command.Add(Mock);
|
||||
Command.Add(Width);
|
||||
Command.Add(Height);
|
||||
Command.SetAction(CommandAction);
|
||||
}
|
||||
|
||||
@@ -92,6 +108,8 @@ public static class UI
|
||||
var renderingMode = result.GetValue(RenderingMode);
|
||||
var hideConsole = result.GetValue(HideConsole);
|
||||
var mock = result.GetValue(Mock);
|
||||
var width = result.GetValue(Width);
|
||||
var height = result.GetValue(Height);
|
||||
|
||||
// Если выбран режим рендеринга DRM, то приложение будет рисоваться вместе с консолью,
|
||||
// поэтому если не перехватить консоль, то вывод в неё будет рисоваться вместе с интерфейсом
|
||||
@@ -105,7 +123,7 @@ public static class UI
|
||||
_ = host.RunAsync();
|
||||
|
||||
// Собираем графическое приложение
|
||||
var ui = BuildApplication(host, fullscreen);
|
||||
var ui = BuildApplication(host, fullscreen, width, height);
|
||||
switch (renderingMode)
|
||||
{
|
||||
case RenderingModes.X11:
|
||||
@@ -160,15 +178,13 @@ public static class UI
|
||||
builder.Services.AddAmineContentContext(builder.Configuration);
|
||||
|
||||
// Добавляем сервисы аппаратной части и прочее
|
||||
builder.Services.AddLightsService("Hardware:Lights");
|
||||
if (!mock)
|
||||
{
|
||||
builder.Services.AddLightsService("Hardware:Lights");
|
||||
builder.Services.AddTemperatureHumidityService("Hardware:TemperatureHumidity");
|
||||
// builder.Services.AddTemperatureHumidityService("Hardware:TemperatureHumidity");
|
||||
builder.Services.AddIlluminatorService("Hardware:Illuminator");
|
||||
builder.Services.AddCameraService("Hardware:Camera", true);
|
||||
builder.Services.AddComputeResourcesService();
|
||||
}
|
||||
builder.Services.AddImageStorageService(new DirectoryInfo(builder.Configuration.GetValue<string>("ImageStorage") ?? "images"));
|
||||
builder.Services.AddAmineContentImageCapturerService(mock);
|
||||
builder.Services.AddAmineContentAnalyzerService();
|
||||
|
||||
@@ -193,8 +209,8 @@ public static class UI
|
||||
return host;
|
||||
}
|
||||
|
||||
private static AppBuilder BuildApplication(IHost host, bool fullscreen) =>
|
||||
AppBuilder.Configure(() => new Application(host.Services, fullscreen))
|
||||
private static AppBuilder BuildApplication(IHost host, bool fullscreen, int width, int height) =>
|
||||
AppBuilder.Configure(() => new Application(host.Services, fullscreen, width, height))
|
||||
.UsePlatformDetect()
|
||||
.UseSkia()
|
||||
.LogToTrace()
|
||||
|
||||
Reference in New Issue
Block a user