From 27817754ce7b06eb214890f106e1cd8c7a60884d Mon Sep 17 00:00:00 2001 From: Egor Date: Thu, 26 Mar 2026 23:47:58 +0200 Subject: [PATCH] disable voice --- .idea/.idea.VisionAsist/.idea/.name | 1 - ModuleWeather/MainWindow.axaml.cs | 7 ++----- ModuleWeather/Module.cs | 16 +--------------- ModuleWeather/ModuleWeather.csproj | 4 ++-- VisionAsist.sln.DotSettings.user | 3 +++ VisionAsist/ViewModels/MainWindowViewModel.cs | 19 +++++++++++++++++++ VisionAsist/Views/MainWindow.axaml | 18 +++++++++++++++++- 7 files changed, 44 insertions(+), 24 deletions(-) delete mode 100644 .idea/.idea.VisionAsist/.idea/.name diff --git a/.idea/.idea.VisionAsist/.idea/.name b/.idea/.idea.VisionAsist/.idea/.name deleted file mode 100644 index 9977108..0000000 --- a/.idea/.idea.VisionAsist/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -VisionAsist \ No newline at end of file diff --git a/ModuleWeather/MainWindow.axaml.cs b/ModuleWeather/MainWindow.axaml.cs index da0ba4c..7bab0bb 100644 --- a/ModuleWeather/MainWindow.axaml.cs +++ b/ModuleWeather/MainWindow.axaml.cs @@ -1,7 +1,6 @@ using Avalonia.Controls; using Avalonia.Interactivity; using Avalonia.Media; -using System.IO.Ports; using System.Reflection; namespace ModuleWeather; @@ -12,13 +11,11 @@ public partial class WeatherView : UserControl private void Update(object? sender, RoutedEventArgs e) { - var ports = SerialPort.GetPortNames(); - PortComboBox.ItemsSource = ports; // Привязываем массив к списку - + } private void OnPortChanged(object sender, SelectionChangedEventArgs e) { - WeatherModule.port = PortComboBox.SelectedItem as string; + } } \ No newline at end of file diff --git a/ModuleWeather/Module.cs b/ModuleWeather/Module.cs index acab438..e778984 100644 --- a/ModuleWeather/Module.cs +++ b/ModuleWeather/Module.cs @@ -1,11 +1,10 @@ using Avalonia.Controls; using VisionAsist.SDK; -using System.IO.Ports; namespace ModuleWeather; public class WeatherModule : IModule { - public SerialPort myPort = new (); + public static string port; public WeatherModule() { @@ -38,11 +37,7 @@ public class WeatherModule : IModule public object Execute(string command) { - myPort.Close(); - myPort = new SerialPort(port, 9600); - myPort.Open(); - @@ -51,15 +46,6 @@ public class WeatherModule : IModule case "погода": return "Погода хорошая!"; - - case "поверни на *": - myPort.WriteLine("178"); - - return "Повернул на 180"; - case "верни *": - myPort.WriteLine("0"); - - return "Вернул в 0"; default: return "Команда не найдена"; } diff --git a/ModuleWeather/ModuleWeather.csproj b/ModuleWeather/ModuleWeather.csproj index 09fae81..7c3c75f 100644 --- a/ModuleWeather/ModuleWeather.csproj +++ b/ModuleWeather/ModuleWeather.csproj @@ -27,12 +27,12 @@ diff --git a/VisionAsist.sln.DotSettings.user b/VisionAsist.sln.DotSettings.user index 56408d8..5095d3f 100644 --- a/VisionAsist.sln.DotSettings.user +++ b/VisionAsist.sln.DotSettings.user @@ -1,4 +1,7 @@  ForceIncluded ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded ForceIncluded \ No newline at end of file diff --git a/VisionAsist/ViewModels/MainWindowViewModel.cs b/VisionAsist/ViewModels/MainWindowViewModel.cs index b31f100..db65799 100644 --- a/VisionAsist/ViewModels/MainWindowViewModel.cs +++ b/VisionAsist/ViewModels/MainWindowViewModel.cs @@ -22,6 +22,25 @@ public partial class MainWindowViewModel : ViewModelBase private bool isListening; [ObservableProperty] private string recognizedtext; + [ObservableProperty] + private string commandText; + + [RelayCommand] + private void Send() + { + if (!string.IsNullOrWhiteSpace(CommandText)) + { + // Эмулируем распознанный текст для отображения в логе + Recognizedtext = CommandText; + + // Отправляем в селектор + Selector.selector(CommandText); + + // Очищаем поле ввода + CommandText = string.Empty; + } + } + private Action? _coreHandler; partial void OnIsListeningChanged(bool value) diff --git a/VisionAsist/Views/MainWindow.axaml b/VisionAsist/Views/MainWindow.axaml index 7876ad4..b60952a 100644 --- a/VisionAsist/Views/MainWindow.axaml +++ b/VisionAsist/Views/MainWindow.axaml @@ -20,10 +20,26 @@ + + + + + + + +