修改为兼容老版固件

登录界面增加版本号
This commit is contained in:
xu 2020-05-05 18:59:09 +08:00
parent 8938e3aaaa
commit 5296137208
7 changed files with 34 additions and 19 deletions

View File

@ -243,12 +243,17 @@ namespace Plane.FormationCreator.Formation
get { return ledmode; }
set { ledmode = value; }
}
//为了发布兼容老版本的用ledInterval当成频率在用并且不保存LEDInterval到文件
[Newtonsoft.Json.JsonIgnore]
public float LEDInterval
{
get { return ledInterval; }
set { ledInterval = value;
if (ledInterval != 0)
ledrate = (int)Math.Round(1 / ledInterval); //用于兼容老版本
//为了发布兼容老版本的用ledInterval当成频率在用并且不保存LEDInterval到文件
ledrate = (int)ledInterval;
//新版用这个
//if (ledInterval != 0)
// ledrate = (int)Math.Round(1 / ledInterval); //用于兼容老版本
}
}
@ -256,8 +261,12 @@ namespace Plane.FormationCreator.Formation
{
get { return ledrate; }
set { ledrate = value;
if ((ledrate!=0)&&(ledInterval==0))
ledInterval = 1 / ledrate;
//为了发布兼容老版本的用ledInterval当成频率在用并且不保存LEDInterval到文件
ledInterval = ledrate;
//新版用这个
// if ((ledrate!=0)&&(ledInterval==0))
// ledInterval = 1 / ledrate;
}
}

View File

@ -1514,7 +1514,7 @@ namespace Plane.FormationCreator.ViewModels
Color color = (Color)ColorConverter.ConvertFromString("#" + ledInfo.LEDRGB);
int ledMode = ledInfo.LEDMode;
//拉烟任务模式ID是50需要改为50
if (ledMode == 11) ledMode = 50;
if (ledMode == 8) ledMode = 50;
IMission LEDMission = Mission.CreateLEDControlMission(
(int)(ledInfo.Delay * 10),
ledMode,

View File

@ -9,7 +9,7 @@
mc:Ignorable="d"
Title=""
Width="500"
Height="300"
Height="325.107"
WindowStartupLocation="CenterScreen"
FontFamily="Microsoft YaHei"
@ -28,6 +28,7 @@
<RowDefinition Height="50" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@ -84,8 +85,8 @@
<Image Margin="0,0,0,0" x:Name="image1" Grid.RowSpan="2" Grid.Row="4" Source="/Resources/Logo_small.png" HorizontalAlignment="Left" />
<TextBlock Margin="5" Grid.Row="4" x:Name="about_ver" HorizontalAlignment="Right" VerticalAlignment="Bottom" Text="版本V2.0.1213" />
<TextBlock Margin="5" Grid.Row="5" HorizontalAlignment="Right" x:Name="about_buildtm" VerticalAlignment="Bottom" Text="编译日期2020.12.12" />
<TextBlock Margin="5" Grid.Row="5" x:Name="about_ver" HorizontalAlignment="Right" VerticalAlignment="Bottom" Text="版本V2.0.1213" />
<TextBlock Margin="5" Grid.Row="6" HorizontalAlignment="Right" x:Name="about_buildtm" VerticalAlignment="Bottom" Text="编译日期2020.12.12" />

View File

@ -49,7 +49,7 @@ namespace Plane.FormationCreator.Views
var version = Assembly.GetExecutingAssembly().GetName().Version;
about_ver.Text = "版本:" + version.ToString();
about_buildtm .Text= "编译时间:" + System.IO.File.GetLastWriteTime(this.GetType().Assembly.Location).ToString() ;
about_buildtm .Text= "编译时间:" + System.IO.File.GetLastWriteTime(this.GetType().Assembly.Location).ToString()+"(兼容4.1.2之前固件)";

View File

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ignore="http://www.galasoft.ch/ignore"
xmlns:Helper="clr-namespace:Plane.Util"
mc:Ignorable="d ignore" Height="253.421" Width="463.894" Title="登录系统" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
mc:Ignorable="d ignore" Height="253.421" Width="463.894" Title="飞行魔方地面控制中心" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
>
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
@ -13,6 +13,7 @@
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
@ -31,7 +32,7 @@
<PasswordBox
x:Name="passwordBox"
@ -50,6 +51,8 @@
Command="{Binding LoginCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}" />
<CheckBox x:Name="checkBox" Content="保存密码" Grid.Column="1" HorizontalAlignment="Right" Margin="0,18.033,-85.353,12.168" Grid.Row="1" Width="75.353"
IsChecked="{Binding SavePassword}"/>
<Label x:Name="about_ver" Content="版本:" HorizontalContentAlignment="Right" Margin="0,10,-85,0" Grid.Row="3" VerticalAlignment="Top" Grid.ColumnSpan="2"/>
</Grid>
</Window>

View File

@ -1,5 +1,6 @@
using Microsoft.Practices.ServiceLocation;
using Plane.FormationCreator.ViewModels;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
@ -18,6 +19,9 @@ namespace Plane.FormationCreator.Views
InitializeComponent();
LoginViewModel loginViewModel = ServiceLocator.Current.GetInstance<LoginViewModel>();
this.DataContext = loginViewModel;
var version = Assembly.GetExecutingAssembly().GetName().Version;
about_ver.Content = "版本:" + version.ToString()+ "(兼容版)";
}
}

View File

@ -457,6 +457,7 @@
<Button Content="测试/停止" VerticalAlignment="Center"
Margin="0,5,5,0"
Grid.Column="2"
Visibility="Collapsed"
Command="{Binding TestCopterLEDCommand}"
/>
@ -504,14 +505,11 @@
<ComboBoxItem Content="常亮" />
<ComboBoxItem Content="同步闪烁(单色)" />
<ComboBoxItem Content="异步闪烁(随机)" />
<ComboBoxItem Content="同步闪烁(随机)" />
<ComboBoxItem Content="异步闪烁(单色)" />
<ComboBoxItem Content="渐亮" />
<ComboBoxItem Content="渐暗" />
<ComboBoxItem Content="呼吸灯(单色)" />
<ComboBoxItem Content="呼吸灯(随机)" />
<ComboBoxItem Content="异步呼吸(单色)" />
<ComboBoxItem Content="异步呼吸(随机)" />
<ComboBoxItem Content="同步闪烁(随机)" />
<ComboBoxItem Content="异步闪烁(单色)" />
<ComboBoxItem Content="拉烟"/>
</ComboBox>
@ -521,9 +519,9 @@
ToolTip="单位:秒最小设置0.1秒"
Text="{Binding Delay,UpdateSourceTrigger=PropertyChanged}" />
<TextBlock Text="间隔" Margin="12,0,0,0" VerticalAlignment="Center"></TextBlock>
<TextBlock Text="频率" Margin="12,0,0,0" VerticalAlignment="Center"></TextBlock>
<TextBox Height="25" MinWidth="35" MaxWidth="40" Margin="5,0,0,0"
ToolTip="单位:最小设置0.1秒"
ToolTip="单位:HZ最小设置1HZ"
Text="{Binding Path=LEDInterval, UpdateSourceTrigger=PropertyChanged}" />
<TextBlock Text="颜色" Margin="12,0,0,0" VerticalAlignment="Center"></TextBlock>