增加抛物测试功能,(测试可以,但功能未完成)

自适应屏幕分辨率
This commit is contained in:
xu 2021-07-22 15:37:53 +08:00
parent 4b54e56ebc
commit 3a8662548f
4 changed files with 34 additions and 8 deletions

View File

@ -161,8 +161,9 @@
</Menu>
</c:WindowCommands>
</c:MetroWindow.RightWindowCommands>
<Grid>
<Viewbox Stretch="Fill">
<DockPanel>
<Grid>
<Grid.Background>
<ImageBrush ImageSource=".\bg.jpg" />
</Grid.Background>
@ -317,5 +318,8 @@
</Grid>
</DockPanel>
</Viewbox>
</c:MetroWindow>

View File

@ -270,6 +270,27 @@ namespace Plane.FormationCreator.ViewModels
}
}
private ICommand _TestPWMCommandAsync;
public ICommand TestPWMCommandAsync
{
get
{
return _TestPWMCommandAsync ?? (_TestPWMCommandAsync = new RelayCommand(async () =>
{
try
{
int channel = 10; //固定10是控制PWM舵机
await commModule.TestFire((short)CopterNum, channel);
}
catch
{ }
}
));
}
}
private ICommand _TestFireCommandAsync;
public ICommand TestFireCommandAsync
{

View File

@ -44,9 +44,10 @@
<TextBox Width="30" VerticalContentAlignment="Center" Text="{Binding CopterNum}" Margin="5,5,5,5" />
<TextBlock Margin="5" VerticalAlignment="Center" Text="参数:" />
<TextBox Width="56" VerticalContentAlignment="Center" Text="{Binding CopterColor}" Margin="5,5,5,5"/>
<Button Content="对频" Width="67" Margin="5,5,5,5" Command="{Binding Path=WriteIdCommand}" />
<Button Content="闪灯 " Width="67" Margin="5,5,5,5" Command="{Binding CommDataAsync}"/>
<Button Content="拉烟" Width="67" Margin="5,5,5,5" Command="{Binding TestFireCommandAsync}"/>
<Button Content="对频" Width="67" Margin="5,5,5,5" Command="{Binding Path=WriteIdCommand}" ToolTip="ID框输入新编号" />
<Button Content="闪灯 " Width="67" Margin="5,5,5,5" Command="{Binding CommDataAsync}" ToolTip="参数为十六进制颜色"/>
<Button Content="拉烟" Width="67" Margin="5,5,5,5" Command="{Binding TestFireCommandAsync}" ToolTip="参数为通道号1-4"/>
<Button Content="抛物" Width="67" Margin="5,5,5,5" Command="{Binding TestPWMCommandAsync}" ToolTip="接入舵机控制"/>
</StackPanel>
@ -58,7 +59,7 @@
<TextBlock Margin="5" VerticalAlignment="Center" Text="比例/模块号:" />
<TextBox Width="30" VerticalContentAlignment="Center" Text="{Binding scale3d}" Margin="5,5,5,5" />
<Button Content="更改密码" Width="90" Margin="5,5,5,5" Command="{Binding ChangepasswordCommand}"></Button>
<Button Content="测试模块" Width="90" Margin="5,5,5,5" Command="{Binding TestModuleCommand}"></Button>
<Button Content="测试模块" Width="90" Margin="5,5,5,5" Command="{Binding TestModuleCommand}" ToolTip="测试地面站通讯模块1-8"></Button>
</StackPanel>

View File

@ -31,9 +31,9 @@
</ContextMenu>
</UserControl.Resources>
<Grid>
<Grid Width="550">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="540"/>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>