small ux fixes

This commit is contained in:
Alex Bezdieniezhnykh
2025-03-04 13:30:13 +02:00
parent a493606f64
commit 792abce8c4
8 changed files with 305 additions and 14 deletions
+56 -2
View File
@@ -297,7 +297,8 @@
<ColumnDefinition Width="28" /> <!-- 8 --> <ColumnDefinition Width="28" /> <!-- 8 -->
<ColumnDefinition Width="56" /> <!-- 9 --> <ColumnDefinition Width="56" /> <!-- 9 -->
<ColumnDefinition Width="28" /> <!-- 10 --> <ColumnDefinition Width="28" /> <!-- 10 -->
<ColumnDefinition Width="*" /> <!-- 11 --> <ColumnDefinition Width="28" /> <!-- 11 -->
<ColumnDefinition Width="*" /> <!-- 12-->
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Grid.Column="0" Padding="5" ToolTip="Включити програвання" Background="Black" BorderBrush="Black" <Button Grid.Column="0" Padding="5" ToolTip="Включити програвання" Background="Black" BorderBrush="Black"
Click="PlayClick"> Click="PlayClick">
@@ -509,8 +510,61 @@
21.333 5.494 5.493 13.058 8.907 21.343 8.907h223.368c8.273 0 15.833-3.421 21.326-8.914s8.915-13.053 21.333 5.494 5.493 13.058 8.907 21.343 8.907h223.368c8.273 0 15.833-3.421 21.326-8.914s8.915-13.053
8.915-21.326V141.338c0-8.283-3.414-15.848-8.908-21.341v-.049c-5.454-5.456-13.006-8.851-21.333-8.851z" /> 8.915-21.326V141.338c0-8.283-3.414-15.848-8.908-21.341v-.049c-5.454-5.456-13.006-8.851-21.333-8.851z" />
</Button> </Button>
<Button Grid.Column="11"
Padding="2"
Width="25"
Height="25"
ToolTip="Показати обєкти по аудіоаналізу. Клавіша: [R]" Background="Black" BorderBrush="Black"
Click="SoundDetections">
<Image>
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup>
<GeometryDrawing Geometry="m19.05,171.43v152.38">
<GeometryDrawing.Pen>
<Pen Brush="LightGray" Thickness="38.1" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="m95.24,95.24v342.86">
<GeometryDrawing.Pen>
<Pen Brush="LightGray" Thickness="38.1" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="m171.43,209.52v76.19">
<GeometryDrawing.Pen>
<Pen Brush="LightGray" Thickness="38.1" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="m247.62,133.33v259.58">
<GeometryDrawing.Pen>
<Pen Brush="LightGray" Thickness="38.1" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<StatusBar Grid.Column="11" <GeometryDrawing Geometry="m323.81,19.05v457.14">
<GeometryDrawing.Pen>
<Pen Brush="LightGray" Thickness="38.1" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="m401.43,86.69v342.86">
<GeometryDrawing.Pen>
<Pen Brush="LightGray" Thickness="38.1" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="m473.43,209.02v76.19">
<GeometryDrawing.Pen>
<Pen Brush="LightGray" Thickness="38.1" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Button>
<StatusBar Grid.Column="12"
Background="#252525" Background="#252525"
Foreground="White"> Foreground="White">
<StatusBar.ItemsPanel> <StatusBar.ItemsPanel>
+5
View File
@@ -586,4 +586,9 @@ public partial class Annotator
} }
}); });
} }
private void SoundDetections(object sender, RoutedEventArgs e)
{
throw new NotImplementedException();
}
} }
+8
View File
@@ -82,4 +82,12 @@ public class Constants
#endregion #endregion
#region Mode Captions
public const string REGULAR_MODE_CAPTION = "Норма";
public const string WINTER_MODE_CAPTION = "Зима";
public const string NIGHT_MODE_CAPTION = "Ніч";
#endregion
} }
+10 -10
View File
@@ -87,7 +87,7 @@
Tag="0" Tag="0"
GroupName="Mode" GroupName="Mode"
Checked="ModeRadioButton_Checked" Checked="ModeRadioButton_Checked"
IsChecked="{Binding IsChecked}" IsChecked="True"
Style="{StaticResource ButtonRadioButtonStyle}"> Style="{StaticResource ButtonRadioButtonStyle}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Image Height="16" Width="16"> <Image Height="16" Width="16">
@@ -111,9 +111,9 @@
</DrawingImage> </DrawingImage>
</Image.Source> </Image.Source>
</Image> </Image>
<TextBlock Text="Норма" <TextBlock Name="RegularModeButton"
Padding="7" Padding="3"
/> />
</StackPanel> </StackPanel>
</RadioButton> </RadioButton>
<RadioButton x:Name="EveningModeRadioButton" <RadioButton x:Name="EveningModeRadioButton"
@@ -142,9 +142,9 @@
</DrawingImage> </DrawingImage>
</Image.Source> </Image.Source>
</Image> </Image>
<TextBlock Text="Зима" <TextBlock Name="WinterModeButton"
Padding="7" Padding="3"
/> />
</StackPanel> </StackPanel>
</RadioButton> </RadioButton>
<RadioButton x:Name="NightModeRadioButton" <RadioButton x:Name="NightModeRadioButton"
@@ -173,9 +173,9 @@
</DrawingImage> </DrawingImage>
</Image.Source> </Image.Source>
</Image> </Image>
<TextBlock Text="Ніч" <TextBlock Name="NightModeButton"
Padding="7" Padding="3"
/> />
</StackPanel> </StackPanel>
</RadioButton> </RadioButton>
</StackPanel> </StackPanel>
@@ -13,11 +13,26 @@ public class DetectionClassChangedEventArgs(DetectionClass detectionClass, int c
public partial class DetectionClasses public partial class DetectionClasses
{ {
public event EventHandler<DetectionClassChangedEventArgs>? DetectionClassChanged; public event EventHandler<DetectionClassChangedEventArgs>? DetectionClassChanged;
public bool IsChecked = true; private const int CaptionedMinWidth = 230;
public DetectionClasses() public DetectionClasses()
{ {
InitializeComponent(); InitializeComponent();
SizeChanged += (sender, args) =>
{
if (args.NewSize.Width < CaptionedMinWidth)
{
RegularModeButton.Text = "";
WinterModeButton.Text = "";
NightModeButton.Text = "";
}
else
{
RegularModeButton.Text = Constants.REGULAR_MODE_CAPTION;
WinterModeButton.Text= Constants.WINTER_MODE_CAPTION;
NightModeButton.Text= Constants.NIGHT_MODE_CAPTION;
}
};
} }
public void Init(List<DetectionClass> detectionClasses) public void Init(List<DetectionClass> detectionClasses)
+1
View File
@@ -28,6 +28,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CF141A48
build\requirements.txt = build\requirements.txt build\requirements.txt = build\requirements.txt
build\build_downloader.cmd = build\build_downloader.cmd build\build_downloader.cmd = build\build_downloader.cmd
build\installer.iss = build\installer.iss build\installer.iss = build\installer.iss
build\cdn_manager.py = build\cdn_manager.py
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"PythonConfig": { "PythonConfig": {
"ZeroMqHost": "127.0.0.1", "ZeroMqHost": "127.0.0.1",
"ZeroMqPort": 5128, "ZeroMqPort": 5127,
"RetryCount": 25, "RetryCount": 25,
"TimeoutSeconds": 5, "TimeoutSeconds": 5,
"ResourcesFolder": "stage" "ResourcesFolder": "stage"
+208
View File
@@ -0,0 +1,208 @@
[Setup]
AppName=Azaion Suite
AppVersion=1.3.2
DefaultDirName={localappdata}\Azaion\Azaion Suite
DefaultGroupName=Azaion Suite
OutputDir=..\
OutputBaseFilename=AzaionSuiteInstaller
SetupIconFile=..\dist\logo.ico
UninstallDisplayName=Azaion Suite
UninstallDisplayIcon={app}\Azaion.Suite.exe
Compression=lzma2/fast
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "..\dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs;
[Icons]
Name: "{group}\Azaion Suite"; Filename: "{app}\Azaion.Suite.exe"
Name: "{commondesktop}\Azaion Suite"; Filename: "{app}\Azaion.Suite.exe"; Tasks: desktopicon
[Constants]
CUDA12_URL=https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda_12.8.0_571.96_windows.exe
CUDNN9_URL=https://developer.download.nvidia.com/compute/cudnn/9.7.1/local_installers/cudnn_9.7.1_windows.exe
function GetEnvironmentVariable(const Name: string): string;
var
Buffer: array[0..2047] of Char;
Size: DWORD;
begin
Size := SizeOf(Buffer) - 1;
if GetEnvironmentVariableW(PChar(Name), Buffer, Size) = 0 then
Result := ''
else
Result := Buffer;
end;
function CheckCUDAGPU(): Boolean;
var
ResultCode: Integer;
Output: string;
GPUInfo: string;
begin
Result := False;
if not Exec('wmic', 'path win32_VideoController get name, caption', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
MsgBox('Error checking GPU information.', mbError, MB_OK);
Exit;
end;
Output := GetShellOutput('wmic path win32_VideoController get name, caption');
Output := LowerCase(Output);
if (Pos('nvidia', Output) > 0) or (Pos('amd', Output) > 0) then
Result := True
else
MsgBox('No CUDA-compatible GPU detected. This application requires a CUDA-capable GPU to run.', mbError, MB_OK);
end;
function CheckCUDA12(): Boolean;
var
CUDA_PATH: string;
begin
Result := False;
CUDA_PATH := GetEnvironmentVariable('CUDA_PATH');
if CUDA_PATH <> '' then
Result := True
else
MsgBox('CUDA 12.x is not detected. Please ensure CUDA Toolkit 12.x is installed and CUDA_PATH environment variable is set.', mbError, MB_OK);
end;
function CheckcuDNN9(): Boolean;
var
ResultCode: Integer;
Output: string;
begin
Result := False;
if not Exec('where', 'cudnn*', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
MsgBox('Error checking for cuDNN.', mbError, MB_OK);
Exit;
end;
Output := GetShellOutput('where cudnn*');
Output := LowerCase(Output);
if Pos('v9', Output) > 0 then
Result := True
else
MsgBox('cuDNN 9.x is not detected. Please ensure cuDNN 9.x is installed and accessible in your system path.', mbError, MB_OK);
end;
function DownloadFileSilent(const URL, LocalFile: string): Boolean;
var
ResultCode: Integer;
begin
Result := URLDownloadToFile(nil, PChar(URL), PChar(LocalFile), 0, nil) = 0;
if not Result then
MsgBox('Error downloading file from: ' + URL, mbError, MB_OK);
end;
function InstallExecutableSilent(const ExecutablePath: string; const Parameters: string): Boolean;
var
ResultCode: Integer;
begin
Result := Exec(ExecutablePath, Parameters, '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
if not Result then
MsgBox('Error executing: ' + ExecutablePath, mbError, MB_OK);
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
NeedsCUDA12, NeedscuDNN9: Boolean;
CUDA12InstallerURL, cuDNN9InstallerURL, CUDA12InstallerLocal, cuDNN9InstallerLocal: string;
DownloadSuccess, InstallSuccess: Boolean;
begin
if CurStep = ssInstall then
begin
if not CheckCUDAGPU() then
begin
Abort();
Exit;
end;
NeedsCUDA12 := not CheckCUDA12();
NeedscuDNN9 := not CheckcuDNN9();
if NeedsCUDA12 or NeedscuDNN9 then
begin
SuppressMessages(True);
SuppressMovieModalMessages(True);
MsgBox('Required dependencies (CUDA and/or cuDNN) are missing. Installer will attempt to download and install them silently.', mbInformation, MB_OK);
CUDA12InstallerURL := '{const:CUDA12_URL}';
cuDNN9InstallerURL := '{const:CUDNN9_URL}';
CUDA12InstallerLocal := ExpandConstant('{tmp}\cuda_installer.exe');
cuDNN9InstallerLocal := ExpandConstant('{tmp}\cudnn_installer.exe');
if NeedsCUDA12 then
begin
Log('Downloading CUDA 12 installer...');
if DownloadFileSilent(CUDA12InstallerURL, CUDA12InstallerLocal) then
begin
Log('Installing CUDA 12 silently...');
if InstallExecutableSilent(CUDA12InstallerLocal, '-s') then
Log('CUDA 12 installed successfully.')
else
begin
Log('CUDA 12 installation failed.');
MsgBox('CUDA 12 installation failed. Please install CUDA Toolkit 12.x manually and restart the installer.', mbCriticalError, MB_OK);
Abort();
Exit;
end;
else
begin
MsgBox('Failed to download CUDA 12 installer. Please download and install CUDA Toolkit 12.x manually and restart the installer.', mbCriticalError, MB_OK);
Abort();
Exit;
end;
end;
if NeedscuDNN9 then
begin
Log('Downloading cuDNN 9 installer...');
if DownloadFileSilent(cuDNN9InstallerURL, cuDNN9InstallerLocal) then
begin
Log('Installing cuDNN 9 silently...');
if InstallExecutableSilent(cuDNN9InstallerLocal, '-s') then
Log('cuDNN 9 installed successfully.')
else
begin
Log('cuDNN 9 installation failed.');
MsgBox('cuDNN 9 installation failed. Please install cuDNN 9.x manually and restart the installer.', mbCriticalError, MB_OK);
Abort();
Exit;
end;
else
begin
MsgBox('Failed to download cuDNN 9 installer. Please download and install cuDNN 9.x manually and restart the installer.', mbCriticalError, MB_OK);
Abort();
Exit;
end;
end;
SuppressMessages(False);
SuppressMovieModalMessages(False);
if NeedsCUDA12 or NeedscuDNN9 then
begin
MsgBox('CUDA and cuDNN dependencies installation completed.', mbInformation, MB_OK);
if not CheckCUDA12() or not CheckcuDNN9() then
MsgBox('Dependencies installation finished, but still not detected correctly. Please verify your CUDA and cuDNN installation.', mbWarning, MB_OK);
end;
end;
end;
end;
procedure InitializeSetup();
begin
end;
[UninstallRun]