修改为兼容老版固件
登录界面增加版本号
This commit is contained in:
parent
8938e3aaaa
commit
5296137208
@ -243,12 +243,17 @@ namespace Plane.FormationCreator.Formation
|
|||||||
get { return ledmode; }
|
get { return ledmode; }
|
||||||
set { ledmode = value; }
|
set { ledmode = value; }
|
||||||
}
|
}
|
||||||
|
//为了发布兼容老版本的,用ledInterval当成频率在用,并且不保存LEDInterval到文件
|
||||||
|
[Newtonsoft.Json.JsonIgnore]
|
||||||
public float LEDInterval
|
public float LEDInterval
|
||||||
{
|
{
|
||||||
get { return ledInterval; }
|
get { return ledInterval; }
|
||||||
set { ledInterval = value;
|
set { ledInterval = value;
|
||||||
if (ledInterval != 0)
|
//为了发布兼容老版本的,用ledInterval当成频率在用,并且不保存LEDInterval到文件
|
||||||
ledrate = (int)Math.Round(1 / ledInterval); //用于兼容老版本
|
ledrate = (int)ledInterval;
|
||||||
|
//新版用这个
|
||||||
|
//if (ledInterval != 0)
|
||||||
|
// ledrate = (int)Math.Round(1 / ledInterval); //用于兼容老版本
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,8 +261,12 @@ namespace Plane.FormationCreator.Formation
|
|||||||
{
|
{
|
||||||
get { return ledrate; }
|
get { return ledrate; }
|
||||||
set { ledrate = value;
|
set { ledrate = value;
|
||||||
if ((ledrate!=0)&&(ledInterval==0))
|
//为了发布兼容老版本的,用ledInterval当成频率在用,并且不保存LEDInterval到文件
|
||||||
ledInterval = 1 / ledrate;
|
ledInterval = ledrate;
|
||||||
|
|
||||||
|
//新版用这个
|
||||||
|
// if ((ledrate!=0)&&(ledInterval==0))
|
||||||
|
// ledInterval = 1 / ledrate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1514,7 +1514,7 @@ namespace Plane.FormationCreator.ViewModels
|
|||||||
Color color = (Color)ColorConverter.ConvertFromString("#" + ledInfo.LEDRGB);
|
Color color = (Color)ColorConverter.ConvertFromString("#" + ledInfo.LEDRGB);
|
||||||
int ledMode = ledInfo.LEDMode;
|
int ledMode = ledInfo.LEDMode;
|
||||||
//拉烟任务模式ID是50,需要改为50
|
//拉烟任务模式ID是50,需要改为50
|
||||||
if (ledMode == 11) ledMode = 50;
|
if (ledMode == 8) ledMode = 50;
|
||||||
IMission LEDMission = Mission.CreateLEDControlMission(
|
IMission LEDMission = Mission.CreateLEDControlMission(
|
||||||
(int)(ledInfo.Delay * 10),
|
(int)(ledInfo.Delay * 10),
|
||||||
ledMode,
|
ledMode,
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title=""
|
Title=""
|
||||||
Width="500"
|
Width="500"
|
||||||
Height="300"
|
Height="325.107"
|
||||||
|
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
FontFamily="Microsoft YaHei"
|
FontFamily="Microsoft YaHei"
|
||||||
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
<RowDefinition Height="50" />
|
<RowDefinition Height="50" />
|
||||||
<RowDefinition Height="30" />
|
<RowDefinition Height="30" />
|
||||||
|
<RowDefinition Height="30" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<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" />
|
<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" 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="6" HorizontalAlignment="Right" x:Name="about_buildtm" VerticalAlignment="Bottom" Text="编译日期:2020.12.12" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ namespace Plane.FormationCreator.Views
|
|||||||
|
|
||||||
var version = Assembly.GetExecutingAssembly().GetName().Version;
|
var version = Assembly.GetExecutingAssembly().GetName().Version;
|
||||||
about_ver.Text = "版本:" + version.ToString();
|
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之前固件)";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:ignore="http://www.galasoft.ch/ignore"
|
xmlns:ignore="http://www.galasoft.ch/ignore"
|
||||||
xmlns:Helper="clr-namespace:Plane.Util"
|
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">
|
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
@ -13,6 +13,7 @@
|
|||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
<RowDefinition Height="auto" />
|
<RowDefinition Height="auto" />
|
||||||
|
<RowDefinition Height="auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition></ColumnDefinition>
|
<ColumnDefinition></ColumnDefinition>
|
||||||
@ -31,7 +32,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<PasswordBox
|
<PasswordBox
|
||||||
x:Name="passwordBox"
|
x:Name="passwordBox"
|
||||||
@ -50,6 +51,8 @@
|
|||||||
Command="{Binding LoginCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}" />
|
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"
|
<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}"/>
|
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>
|
</Grid>
|
||||||
|
|
||||||
</Window>
|
</Window>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using Microsoft.Practices.ServiceLocation;
|
using Microsoft.Practices.ServiceLocation;
|
||||||
using Plane.FormationCreator.ViewModels;
|
using Plane.FormationCreator.ViewModels;
|
||||||
|
using System.Reflection;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
@ -18,6 +19,9 @@ namespace Plane.FormationCreator.Views
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
LoginViewModel loginViewModel = ServiceLocator.Current.GetInstance<LoginViewModel>();
|
LoginViewModel loginViewModel = ServiceLocator.Current.GetInstance<LoginViewModel>();
|
||||||
this.DataContext = loginViewModel;
|
this.DataContext = loginViewModel;
|
||||||
|
var version = Assembly.GetExecutingAssembly().GetName().Version;
|
||||||
|
about_ver.Content = "版本:" + version.ToString()+ "(兼容版)";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,6 +457,7 @@
|
|||||||
<Button Content="测试/停止" VerticalAlignment="Center"
|
<Button Content="测试/停止" VerticalAlignment="Center"
|
||||||
Margin="0,5,5,0"
|
Margin="0,5,5,0"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
|
Visibility="Collapsed"
|
||||||
Command="{Binding TestCopterLEDCommand}"
|
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="呼吸灯(单色)" />
|
||||||
<ComboBoxItem Content="呼吸灯(随机)" />
|
<ComboBoxItem Content="同步闪烁(随机)" />
|
||||||
<ComboBoxItem Content="异步呼吸(单色)" />
|
<ComboBoxItem Content="异步闪烁(单色)" />
|
||||||
<ComboBoxItem Content="异步呼吸(随机)" />
|
|
||||||
<ComboBoxItem Content="拉烟"/>
|
<ComboBoxItem Content="拉烟"/>
|
||||||
|
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
@ -521,9 +519,9 @@
|
|||||||
ToolTip="单位:秒,最小设置0.1秒"
|
ToolTip="单位:秒,最小设置0.1秒"
|
||||||
Text="{Binding Delay,UpdateSourceTrigger=PropertyChanged}" />
|
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"
|
<TextBox Height="25" MinWidth="35" MaxWidth="40" Margin="5,0,0,0"
|
||||||
ToolTip="单位:秒,最小设置0.1秒"
|
ToolTip="单位:HZ,最小设置1HZ"
|
||||||
Text="{Binding Path=LEDInterval, UpdateSourceTrigger=PropertyChanged}" />
|
Text="{Binding Path=LEDInterval, UpdateSourceTrigger=PropertyChanged}" />
|
||||||
|
|
||||||
<TextBlock Text="颜色" Margin="12,0,0,0" VerticalAlignment="Center"></TextBlock>
|
<TextBlock Text="颜色" Margin="12,0,0,0" VerticalAlignment="Center"></TextBlock>
|
||||||
|
Loading…
Reference in New Issue
Block a user