disable voice
This commit is contained in:
1
.idea/.idea.VisionAsist/.idea/.name
generated
1
.idea/.idea.VisionAsist/.idea/.name
generated
@@ -1 +0,0 @@
|
||||
VisionAsist
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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,10 +37,6 @@ 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 "Команда не найдена";
|
||||
}
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
<Message Text="Копирую файлы модуля и нативные библиотеки..." Importance="high" />
|
||||
|
||||
<Copy SourceFiles="@(ModuleFiles)"
|
||||
DestinationFolder="/home/egor/RiderProjects/Vision/VisionAsist/bin/Debug/net10.0/Modules/ModuleWeather/"
|
||||
DestinationFolder="E:\Project\Visual\VisionAsist\VisionAsist\bin\Debug\net10.0\Modules\ModuleWeather"
|
||||
OverwriteReadOnlyFiles="true" />
|
||||
|
||||
<!-- Копируем .so файлы ПРЯМО в корень папки модуля -->
|
||||
<Copy SourceFiles="@(NativeLibs)"
|
||||
DestinationFolder="/home/egor/RiderProjects/Vision/VisionAsist/bin/Debug/net10.0/Modules/ModuleWeather/"
|
||||
DestinationFolder="E:\Project\Visual\VisionAsist\VisionAsist\bin\Debug\net10.0\Modules\ModuleWeather"
|
||||
OverwriteReadOnlyFiles="true" />
|
||||
</Target>
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AInitHelpers_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F3bfb329b50ab4b719e770a577377990fdba600_003F92_003F7acfd65c_003FInitHelpers_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APorcupine_002Ecs_002Fl_003AC_0021_003FUsers_003Fmarin_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F395b25d8175b43798becf32fa73896954c00_003Fa6_003F28640b1d_003FPorcupine_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASerialPort_002EUnix_002Ecs_002Fl_003AC_0021_003FUsers_003Fmarin_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FSourcesCache_003F955be2f0e9f11ba554df3fb7b4d1c16483286c82bb3b26ac164fc3657e4477_003FSerialPort_002EUnix_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASoundIO_002Ecs_002Fl_003AC_0021_003FUsers_003Fmarin_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F2ac0091ca0084789a96acdec8e3a9449d000_003F84_003Fd6e02c94_003FSoundIO_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASoundIOInStream_002Ecs_002Fl_003AC_0021_003FUsers_003Fmarin_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F2ac0091ca0084789a96acdec8e3a9449d000_003F37_003F2b136ae3_003FSoundIOInStream_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASoundIO_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F2ac0091ca0084789a96acdec8e3a9449d000_003F84_003Fd6e02c94_003FSoundIO_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
||||
@@ -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<string>? _coreHandler;
|
||||
|
||||
partial void OnIsListeningChanged(bool value)
|
||||
|
||||
@@ -20,10 +20,26 @@
|
||||
<ToggleButton IsChecked="{Binding IsListening, Mode=TwoWay}"
|
||||
Content="Запуск асистента"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="10,0"
|
||||
/>
|
||||
</StackPanel>
|
||||
|
||||
<ScrollViewer Height="350" CornerRadius="5" Background="Black">
|
||||
<Grid ColumnDefinitions="*, Auto" Margin="10,0,10,10">
|
||||
<TextBox Grid.Column="0"
|
||||
Text="{Binding CommandText}"
|
||||
Watermark="Введите команду (например: вижен погода)..."
|
||||
VerticalAlignment="Center">
|
||||
<TextBox.KeyBindings>
|
||||
<KeyBinding Gesture="Enter" Command="{Binding SendCommand}"/>
|
||||
</TextBox.KeyBindings>
|
||||
</TextBox>
|
||||
<Button Grid.Column="1"
|
||||
Content="Отправить"
|
||||
Command="{Binding SendCommand}"
|
||||
Margin="5,0,0,0"/>
|
||||
</Grid>
|
||||
|
||||
<ScrollViewer Height="300" CornerRadius="5" Background="Black">
|
||||
<TextBlock Text="{Binding Recognizedtext}"
|
||||
TextWrapping="Wrap"
|
||||
Padding="10"
|
||||
|
||||
Reference in New Issue
Block a user