From 5e226d422dbc41b1c9c88bf52dd3cedc857c20f7 Mon Sep 17 00:00:00 2001 From: Oleksandr Bezdieniezhnykh Date: Wed, 1 Oct 2025 20:04:45 +0300 Subject: [PATCH] fix textbox keyboard global handling add CameraConfig to prod json add launch and tasks jsons to vscode folder --- .vscode/launch.json | 33 ++++++++++++++++ .vscode/tasks.json | 41 ++++++++++++++++++++ Azaion.Common/Controls/NumericUpDown.xaml.cs | 10 ++--- Azaion.Loader/azaion-loader-safe.spec | 6 +-- Azaion.Loader/version_info.txt | 30 ++++++++++++++ Azaion.Suite/App.xaml.cs | 6 ++- Azaion.Suite/config.production.json | 5 +++ 7 files changed, 121 insertions(+), 10 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 Azaion.Loader/version_info.txt diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..ab75543 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,33 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Azaion.Suite (with credentials)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/Azaion.Suite/bin/Debug/net8.0-windows/Azaion.Suite.dll", + "args": ["credsManual", "-e", "test-admin@azaion.com", "-p", "Az@1on1000TestT-addminn11"], + "cwd": "${workspaceFolder}/Azaion.Suite/bin/Debug/net8.0-windows", + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": "Launch Azaion.Suite", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/Azaion.Suite/bin/Debug/net8.0-windows/Azaion.Suite.dll", + "args": [], + "cwd": "${workspaceFolder}/Azaion.Suite/bin/Debug/net8.0-windows", + "console": "internalConsole", + "stopAtEntry": false + }, + { + "name": "Attach to Azaion.Suite", + "type": "coreclr", + "request": "attach", + "processName": "Azaion.Suite" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..5dda56b --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/Azaion.Suite.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/Azaion.Suite.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/Azaion.Suite.sln" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/Azaion.Common/Controls/NumericUpDown.xaml.cs b/Azaion.Common/Controls/NumericUpDown.xaml.cs index a59ca0b..96404a7 100644 --- a/Azaion.Common/Controls/NumericUpDown.xaml.cs +++ b/Azaion.Common/Controls/NumericUpDown.xaml.cs @@ -49,11 +49,11 @@ public partial class NumericUpDown : UserControl private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - if (d is NumericUpDown control) - { - control.NudTextBox.Text = ((decimal)e.NewValue).ToString(CultureInfo.InvariantCulture); - control.NudTextBox.SelectionStart = control.NudTextBox.Text.Length; - } + if (d is not NumericUpDown control) + return; + + control.NudTextBox.Text = ((decimal)e.NewValue).ToString(CultureInfo.InvariantCulture); + control.NudTextBox.SelectionStart = control.NudTextBox.Text.Length; } private void NudButtonUp_OnClick(object sender, RoutedEventArgs e) diff --git a/Azaion.Loader/azaion-loader-safe.spec b/Azaion.Loader/azaion-loader-safe.spec index a69d6b8..1480d39 100644 --- a/Azaion.Loader/azaion-loader-safe.spec +++ b/Azaion.Loader/azaion-loader-safe.spec @@ -48,10 +48,10 @@ exe = EXE( disable_windowed_traceback=False, argv_emulation=False, target_arch=None, - codesign_identity=None, # Set this to your code signing certificate + codesign_identity=None, entitlements_file=None, - # version='version_info.txt', # Temporarily disabled - file doesn't exist - icon=None, # Add icon if available + version='version_info.txt', + icon=None, ) coll = COLLECT( diff --git a/Azaion.Loader/version_info.txt b/Azaion.Loader/version_info.txt new file mode 100644 index 0000000..0575aec --- /dev/null +++ b/Azaion.Loader/version_info.txt @@ -0,0 +1,30 @@ +VSVersionInfo( + ffi=FixedFileInfo( + filevers=(1, 0, 0, 0), + prodvers=(1, 0, 0, 0), + mask=0x3f, + flags=0x0, + OS=0x40004, + fileType=0x1, + subtype=0x0, + date=(0, 0) + ), + kids=[ + StringFileInfo( + [ + StringTable( + u'040904B0', + [StringStruct(u'CompanyName', u'Azaion'), + StringStruct(u'FileDescription', u'Azaion Loader'), + StringStruct(u'FileVersion', u'1.0.0.0'), + StringStruct(u'InternalName', u'azaion-loader'), + StringStruct(u'LegalCopyright', u'Copyright (c) 2025 Azaion'), + StringStruct(u'OriginalFilename', u'azaion-loader.exe'), + StringStruct(u'ProductName', u'Azaion Loader'), + StringStruct(u'ProductVersion', u'1.0.0.0')]) + ]), + VarFileInfo([VarStruct(u'Translation', [1033, 1200])]) + ] +) + + diff --git a/Azaion.Suite/App.xaml.cs b/Azaion.Suite/App.xaml.cs index 865d5c9..555e520 100644 --- a/Azaion.Suite/App.xaml.cs +++ b/Azaion.Suite/App.xaml.cs @@ -1,7 +1,7 @@ using System.IO; using System.Net.Http; -using System.Text; using System.Windows; +using System.Windows.Controls; using System.Windows.Threading; using Azaion.Annotator; using Azaion.Common; @@ -20,7 +20,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; -using Newtonsoft.Json; using Serilog; using KeyEventArgs = System.Windows.Input.KeyEventArgs; @@ -200,6 +199,9 @@ public partial class App private void GlobalKeyHandler(object sender, RoutedEventArgs e) { var args = (KeyEventArgs)e; + if (args.OriginalSource is TextBox) + return; + var keyEvent = new KeyEvent(sender, args, _formState.ActiveWindow); ThrottleExt.Throttle(() => _mediator.Publish(keyEvent, _mainCTokenSource.Token), KeyPressTaskId, TimeSpan.FromMilliseconds(50)); //e.Handled = true; diff --git a/Azaion.Suite/config.production.json b/Azaion.Suite/config.production.json index 71dfe6f..8283a96 100644 --- a/Azaion.Suite/config.production.json +++ b/Azaion.Suite/config.production.json @@ -29,5 +29,10 @@ "RightPanelWidth": 120.0, "GenerateAnnotatedImage": true, "SilentDetection": false + }, + "CameraConfig": { + "Altitude": 400, + "CameraSensorWidth": 23.5, + "CameraFocalLength": 24 } } \ No newline at end of file