feat: fullscreen argument

This commit is contained in:
2026-02-26 06:55:14 +03:00
parent 6248d556f3
commit 252201c930
6 changed files with 41 additions and 16 deletions
+15 -11
View File
@@ -15,6 +15,10 @@ public partial class Program
private static string[]? _args = null;
private static readonly RootCommand _rootCommand = new("Run UI application");
private static readonly Option<bool> _fullscreen = new("--fullscreen")
{
Description = "Run in fullscreen mode"
};
private static readonly Command _cameraTuningCommand = new("camera-tuning")
{
@@ -76,15 +80,15 @@ public partial class Program
DefaultValueFactory = (_) => 0
};
private static readonly Option<RenderingMode> _renderingModeArgument = new("--rendering-mode")
private static readonly Option<RenderingMode> _renderingMode = new("--rendering-mode")
{
Description = "Rendering mode to use",
DefaultValueFactory = (_) => RenderingMode.X11
};
private static readonly Option<bool> _hideConsoleArgument = new("--hide-console")
private static readonly Option<bool> _hideConsole = new("--hide-console")
{
Description = "Suppress console output",
DefaultValueFactory = (result) => result.GetRequiredValue(_renderingModeArgument) == RenderingMode.DRM
DefaultValueFactory = (result) => result.GetRequiredValue(_renderingMode) == RenderingMode.DRM
};
public static event ConsoleCancelEventHandler? ShutdownRequested;
@@ -94,7 +98,13 @@ public partial class Program
{
_args = args;
_rootCommand.SetAction(Ui);
_rootCommand.Add(_fullscreen);
_rootCommand.Add(_renderingMode);
_rootCommand.Add(_hideConsole);
_rootCommand.Add(_cameraTuningCommand);
_cameraTuningCommand.SetAction(CameraTuning);
_cameraTuningCommand.Add(_cameraTuningOutputFile);
_cameraTuningCommand.Add(_cameraTuningGainR);
_cameraTuningCommand.Add(_cameraTuningGainG);
@@ -102,18 +112,12 @@ public partial class Program
_cameraTuningCommand.Add(_cameraTuningThreshold);
_cameraTuningCommand.Add(_cameraTuningSteps);
_rootCommand.Add(_captureCommand);
_captureCommand.SetAction(Capture);
_captureCommand.Add(_captureOutputFile);
_captureCommand.Add(_captureIntencityWhite);
_captureCommand.Add(_captureIntencityUv365nm);
_captureCommand.Add(_captureIntencityUv254nm);
_rootCommand.Add(_captureCommand);
_rootCommand.Add(_renderingModeArgument);
_rootCommand.Add(_hideConsoleArgument);
_rootCommand.SetAction(Ui);
_cameraTuningCommand.SetAction(CameraTuning);
_captureCommand.SetAction(Capture);
Console.CancelKeyPress += new ConsoleCancelEventHandler(OnProgramShutdown);
Console.WriteLine("Press Ctrl+C to shut down.");