增加保存读取虚拟编号
多次写入参数 加入测试灯光和灯光频率可以为小数---需要升级飞控 修改3D颜色和编号刷新的bug
This commit is contained in:
parent
9b5b3bb22c
commit
e1c81f28ff
@ -1,4 +1,5 @@
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
using Plane.CommunicationManagement;
|
||||
using Plane.Copters;
|
||||
using Plane.Windows.Messages;
|
||||
using System;
|
||||
@ -6,6 +7,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
@ -13,6 +15,7 @@ namespace Plane.FormationCreator.Formation
|
||||
{
|
||||
public partial class FlightTaskSingleCopterInfo
|
||||
{
|
||||
|
||||
public static FlightTaskSingleCopterInfo CreateForFlyToTask(ICopter copter)
|
||||
{
|
||||
var info = new FlightTaskSingleCopterInfo(copter)
|
||||
@ -57,6 +60,7 @@ namespace Plane.FormationCreator.Formation
|
||||
}));
|
||||
}
|
||||
}
|
||||
private CommModuleManager _commModuleManager = CommModuleManager.Instance;
|
||||
|
||||
private ICommand _SetAllCopterLEDCommand;
|
||||
public ICommand SetAllCopterLEDCommand
|
||||
@ -81,8 +85,58 @@ namespace Plane.FormationCreator.Formation
|
||||
}));
|
||||
}
|
||||
}
|
||||
bool LEDTestRun = false;
|
||||
/*
|
||||
private string _TestLEDtxt = "测试";
|
||||
public string TestLEDtxt
|
||||
{
|
||||
get { return _TestLEDtxt; }
|
||||
set { Set(nameof(TestLEDtxt), ref _TestLEDtxt, value); }
|
||||
}
|
||||
|
||||
|
||||
LEDMode 0 = "常亮"
|
||||
1="同步闪烁(单色)" />
|
||||
2 = "异步闪烁(随机)" />
|
||||
3="渐亮" />
|
||||
4 = "渐暗" />
|
||||
5="呼吸灯" />
|
||||
6 = "同步闪烁(随机)" />
|
||||
7="异步闪烁(单色)" />
|
||||
8 = "拉烟" />(飞控是50 ? )
|
||||
*/
|
||||
//测试灯光
|
||||
private ICommand _TestCopterLEDCommand;
|
||||
public ICommand TestCopterLEDCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return _TestCopterLEDCommand ?? (_TestCopterLEDCommand = new RelayCommand<double>(async =>
|
||||
{
|
||||
if (!LEDTestRun)
|
||||
{
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
LEDTestRun = true;
|
||||
foreach (LEDInfo vLEDInfo in LEDInfos)
|
||||
{
|
||||
Thread.Sleep((int)vLEDInfo.Delay * 1000);
|
||||
if (!LEDTestRun) break;
|
||||
_commModuleManager.LED_TaskAsync(vLEDInfo.LEDMode, vLEDInfo.LEDRate, vLEDInfo.LEDTimes, vLEDInfo.LEDRGB, this.Copter);
|
||||
}
|
||||
//LEDTestRun = false;
|
||||
});
|
||||
}else
|
||||
{
|
||||
LEDTestRun = false;
|
||||
_commModuleManager.LED_TaskAsync(99, 0, 0, "000000", this.Copter);
|
||||
}
|
||||
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ICommand _SetSelectedCopterLEDCommand;
|
||||
public ICommand SetSelectedCopterLEDCommand
|
||||
@ -116,7 +170,7 @@ namespace Plane.FormationCreator.Formation
|
||||
{
|
||||
private double delay = 1; //灯光延时 单位:100ms (从当前任务开为0,延时几秒后设置LED)
|
||||
private int ledmode = 0; //灯光模式 0常亮 1闪烁 2随机闪烁(RGB无意义)
|
||||
private int ledrate = 0; //闪烁延时 单位:100ms
|
||||
private float ledRate = 0; //闪烁延时 单位:100ms
|
||||
private int ledtimes = 0; //次数 (预留、暂取消其意义)
|
||||
private string ledRGB = "FFFFFF"; //灯光颜色
|
||||
|
||||
@ -129,7 +183,7 @@ namespace Plane.FormationCreator.Formation
|
||||
{
|
||||
delay = led.delay;
|
||||
ledmode = led.ledmode;
|
||||
ledrate = led.ledrate;
|
||||
ledRate = led.ledRate;
|
||||
ledRGB = led.ledRGB;
|
||||
}
|
||||
public double Delay
|
||||
@ -143,10 +197,10 @@ namespace Plane.FormationCreator.Formation
|
||||
get { return ledmode; }
|
||||
set { ledmode = value; }
|
||||
}
|
||||
public int LEDRate
|
||||
public float LEDRate
|
||||
{
|
||||
get { return ledrate; }
|
||||
set { ledrate = value; }
|
||||
get { return ledRate; }
|
||||
set { ledRate = value; }
|
||||
}
|
||||
public int LEDTimes
|
||||
{
|
||||
|
@ -11,6 +11,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using Microsoft.Practices.ServiceLocation;
|
||||
using System.IO;
|
||||
|
||||
namespace Plane.FormationCreator.ViewModels
|
||||
{
|
||||
@ -52,6 +53,71 @@ namespace Plane.FormationCreator.ViewModels
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 清除所有编号
|
||||
/// </summary>
|
||||
private ICommand _SaveVirtualIdCommand;
|
||||
public ICommand SaveVirtualIdCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return _SaveVirtualIdCommand ?? (_SaveVirtualIdCommand = new RelayCommand(() =>
|
||||
{
|
||||
string Savestr = "";
|
||||
foreach (var c in _copterManager.Copters)
|
||||
{
|
||||
Savestr += c.Id + "=" + c.VirtualId + ';';
|
||||
}
|
||||
StreamWriter writer = new StreamWriter("vid.dat");
|
||||
writer.Write(Savestr);
|
||||
writer.Close();
|
||||
Message.Show($"保存成功");
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 清除所有编号
|
||||
/// </summary>
|
||||
private ICommand _LoadVirtualIdCommand;
|
||||
public ICommand LoadVirtualIdCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return _LoadVirtualIdCommand ?? (_LoadVirtualIdCommand = new RelayCommand(() =>
|
||||
{
|
||||
if (!File.Exists("vid.dat"))
|
||||
return;
|
||||
// string str = System.IO.File.ReadAllText(@"vid.dat");
|
||||
|
||||
string str = File.ReadAllText("vid.dat");
|
||||
|
||||
string[] arr = str.Split(';');
|
||||
foreach (string s in arr)
|
||||
{
|
||||
|
||||
string[] arrs = s.Split('=');
|
||||
|
||||
|
||||
var copter = _copterManager.Copters.FirstOrDefault(c => c.Id == arrs[0]);
|
||||
if (copter != null)
|
||||
{
|
||||
copter.VirtualId = int.Parse(arrs[1]);
|
||||
}
|
||||
}
|
||||
Message.Show($"读入成功");
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 设置单个虚拟ID
|
||||
@ -75,6 +141,7 @@ namespace Plane.FormationCreator.ViewModels
|
||||
copter.VirtualId = SingleVirtualId;
|
||||
Message.Show($"飞机{copter.Name} 设置编号={SingleVirtualId}");
|
||||
}
|
||||
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
@ -652,11 +652,55 @@ namespace Plane.FormationCreator.ViewModels
|
||||
foreach (string name in paramlist.Keys)
|
||||
{
|
||||
float value = float.Parse( paramlist[name].ToString());
|
||||
await Task.WhenAll(_copterManager.AcceptingControlCopters.Select
|
||||
(copter => copter.SetParamAsync(name, value)));
|
||||
//写5次
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
|
||||
if (_copterManager.AcceptingControlCopters.Count() < _copterManager.Copters.Count)
|
||||
await _commModuleManager.SetParamAsync(name, value, _copterManager.AcceptingControlCopters);
|
||||
else if (_copterManager.AcceptingControlCopters.Count() == _copterManager.Copters.Count)
|
||||
{
|
||||
_commModuleManager.SetAllCoptersForWifi(_copterManager.Copters);
|
||||
await _commModuleManager.SetParamAsync(name, value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// await Task.WhenAll(_copterManager.AcceptingControlCopters.Select
|
||||
// (copter => copter.SetParamAsync(name, value)));
|
||||
}
|
||||
await Task.Delay(2000);
|
||||
|
||||
//发送读取5次
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
if (_copterManager.AcceptingControlCopters.Count() < _copterManager.Copters.Count)
|
||||
await _commModuleManager.ReadParamAsnyc(name, _copterManager.AcceptingControlCopters);
|
||||
else if (_copterManager.AcceptingControlCopters.Count() == _copterManager.Copters.Count)
|
||||
await _commModuleManager.ReadParamAsnyc(name);
|
||||
}
|
||||
await Task.Delay(1000);
|
||||
|
||||
//开始检查飞机返回参数是否正确
|
||||
|
||||
foreach (ICopter copter in _copterManager.AcceptingControlCopters)
|
||||
{
|
||||
if (value != copter.RetainInt)
|
||||
{
|
||||
ifallok = false;
|
||||
Alert.Show(copter.Id + "参数[" + name + "]设置失败,读取的值是[" + copter.RetainInt + "]", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
await Task.WhenAll(
|
||||
await Task.WhenAll(
|
||||
|
||||
_copterManager.AcceptingControlCopters.Select(async copter =>
|
||||
{
|
||||
@ -669,7 +713,8 @@ namespace Plane.FormationCreator.ViewModels
|
||||
}
|
||||
|
||||
));
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -702,14 +747,20 @@ namespace Plane.FormationCreator.ViewModels
|
||||
{
|
||||
float paramvalue = Convert.ToSingle(ModifyParamWindow.textParamValue.Text);
|
||||
int num = 0;
|
||||
if (_copterManager.AcceptingControlCopters.Count() < _copterManager.Copters.Count)
|
||||
num = await _commModuleManager.SetParamAsync(paramstr, paramvalue, _copterManager.AcceptingControlCopters);
|
||||
else if (_copterManager.AcceptingControlCopters.Count() == _copterManager.Copters.Count)
|
||||
int writeTime = 0;
|
||||
//连续写5次,为了都写成功
|
||||
for ( writeTime=0; writeTime<5; writeTime++)
|
||||
{
|
||||
_commModuleManager.SetAllCoptersForWifi(_copterManager.Copters);
|
||||
num = await _commModuleManager.SetParamAsync(paramstr, paramvalue);
|
||||
|
||||
if (_copterManager.AcceptingControlCopters.Count() < _copterManager.Copters.Count)
|
||||
num = await _commModuleManager.SetParamAsync(paramstr, paramvalue, _copterManager.AcceptingControlCopters);
|
||||
else if (_copterManager.AcceptingControlCopters.Count() == _copterManager.Copters.Count)
|
||||
{
|
||||
_commModuleManager.SetAllCoptersForWifi(_copterManager.Copters);
|
||||
num = await _commModuleManager.SetParamAsync(paramstr, paramvalue);
|
||||
}
|
||||
}
|
||||
Alert.Show($"广播完成! 当前序列号:{num}");
|
||||
Alert.Show($"广播完成! 序列号从:{num-writeTime+1}到{num}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1462,6 +1513,7 @@ namespace Plane.FormationCreator.ViewModels
|
||||
{
|
||||
Color color = (Color)ColorConverter.ConvertFromString("#" + ledInfo.LEDRGB);
|
||||
int ledMode = ledInfo.LEDMode;
|
||||
//拉烟任务模式ID是50,需要改为50
|
||||
if (ledMode == 8) ledMode = 50;
|
||||
IMission LEDMission = Mission.CreateLEDControlMission(
|
||||
(int)(ledInfo.Delay * 10),
|
||||
|
@ -21,6 +21,7 @@ using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Plane.Windows.Messages;
|
||||
using Plane.Collections;
|
||||
|
||||
namespace Plane.FormationCreator.ViewModels
|
||||
{
|
||||
@ -176,7 +177,8 @@ namespace Plane.FormationCreator.ViewModels
|
||||
copter.DisplayVirtualId = true;
|
||||
copter.DisplayID = false;
|
||||
}
|
||||
|
||||
//强制刷新飞机显示
|
||||
// _copterManager.Copters.ForEach(copter => copter.RefreashLoc());
|
||||
|
||||
|
||||
}));
|
||||
@ -197,6 +199,8 @@ namespace Plane.FormationCreator.ViewModels
|
||||
copter.DisplayVirtualId = false;
|
||||
copter.DisplayID = true;
|
||||
}
|
||||
//强制刷新飞机显示
|
||||
// _copterManager.Copters.ForEach(copter => copter.RefreashLoc());
|
||||
|
||||
}));
|
||||
}
|
||||
@ -252,6 +256,8 @@ namespace Plane.FormationCreator.ViewModels
|
||||
copter.DisplayVirtualId = true;
|
||||
copter.DisplayID = true;
|
||||
}
|
||||
//强制刷新飞机显示
|
||||
// _copterManager.Copters.ForEach(copter => copter.RefreashLoc());
|
||||
|
||||
}));
|
||||
}
|
||||
|
@ -200,13 +200,16 @@ namespace Plane.FormationCreator.ViewModels
|
||||
|
||||
Color color;
|
||||
if (copter.LEDColor != null && copter.LEDColor != "")
|
||||
{
|
||||
color = (Color)ColorConverter.ConvertFromString("#" + copter.LEDColor);
|
||||
else
|
||||
color = (Color)ColorConverter.ConvertFromString("#" + CopterManager.CopterDefaultColor);
|
||||
panle3D.Material = MaterialHelper.CreateMaterial(color);
|
||||
panle3D.BackMaterial = MaterialHelper.CreateMaterial(color);
|
||||
panle3D.Material = MaterialHelper.CreateMaterial(color);
|
||||
panle3D.BackMaterial = MaterialHelper.CreateMaterial(color);
|
||||
}
|
||||
//else
|
||||
// color = (Color)ColorConverter.ConvertFromString("#" + CopterManager.CopterDefaultColor);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Message.Show("添加3D飞机:" + copter.Name);
|
||||
}
|
||||
|
@ -29,9 +29,12 @@
|
||||
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock Margin="10,5" Text="清除所有编号"/>
|
||||
<Button Margin="0,0" Width="100" Content = "清除编号" VerticalAlignment="Center" Command="{Binding ClearVirtualIdCommand}"/>
|
||||
|
||||
<StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
|
||||
<Button Margin="5" Width="95" Content = "清除编号" Command="{Binding ClearVirtualIdCommand}"/>
|
||||
<Button Margin="5" Width="95" Content = "保存编号" Command="{Binding SaveVirtualIdCommand}"/>
|
||||
<Button Margin="5" Width="95" Content = "读入编号" Command="{Binding LoadVirtualIdCommand}"/>
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
|
@ -19,13 +19,13 @@
|
||||
<MenuItem Header="显示所有飞机"
|
||||
Foreground="White"
|
||||
Command="{Binding ShowAllCoptersCommand}"/>
|
||||
<MenuItem Header="显示所有编号"
|
||||
<MenuItem Header="所有编号(虚拟排序)"
|
||||
Foreground="White"
|
||||
Command="{Binding ShowAllIDCommand}"/>
|
||||
<MenuItem Header="显示虚拟编号"
|
||||
<MenuItem Header="虚拟编号(虚拟排序)"
|
||||
Foreground="White"
|
||||
Command="{Binding SortbyVIdCommand}"/>
|
||||
<MenuItem Header="显示飞机编号"
|
||||
<MenuItem Header="真实编号(真实排序)"
|
||||
Foreground="White"
|
||||
Command="{Binding SortbyIdCommand}"/>
|
||||
</ContextMenu>
|
||||
|
@ -73,7 +73,7 @@
|
||||
<Button Margin="0,5,5,0" Content="优化路线" Width="105" Command="{Binding OptimizeRouteCommand}"
|
||||
/>
|
||||
<Button Margin="0,5,5,0" Content="导出到C4D" Width="105" Command="{Binding ExportWayPointCommand}"/>
|
||||
<Button Margin="0,5,5,0" Content="估计飞行时间" Width="105" Command="{Binding AutoWayPointTmCommand}"/>
|
||||
<Button Margin="0,5,5,0" Content="估计时间" Width="105" Command="{Binding AutoWayPointTmCommand}"/>
|
||||
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
@ -85,7 +85,7 @@
|
||||
<Button Content="回前一高度"
|
||||
Margin="0,5,5,0" Width="105"
|
||||
Command="{Binding PrealtCommand}" />
|
||||
|
||||
|
||||
<Button Content="回起飞点"
|
||||
Margin="0,5,5,0" Width="105"
|
||||
Command="{Binding BackTakeOffPointCommand}" />
|
||||
@ -109,7 +109,7 @@
|
||||
<Button Content="垂直均分"
|
||||
Margin="0,5,5,0"
|
||||
Command="{Binding VerticlAverageCommand}" />
|
||||
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
@ -144,7 +144,7 @@
|
||||
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
|
||||
<StackPanel>
|
||||
<Button Content="调整高度"
|
||||
@ -333,7 +333,7 @@
|
||||
<Button Width="80" Content="跑马灯" Margin="10,0,0,0"
|
||||
Command="{Binding SetStrokesLampCommamd}" HorizontalAlignment="Right"/>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
</Grid>
|
||||
<Separator Margin="5,5,5,5" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@ -349,36 +349,46 @@
|
||||
<Separator Margin="5,5,5,5" />
|
||||
</StackPanel>
|
||||
<StackPanel DataContext="{Binding FlightTaskManager.SelectedTask.ModifyingSingleCopterInfo}">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="灯光控制" Margin="5, 10, 5, 0" VerticalAlignment="Center"/>
|
||||
<Grid Grid.Column="1" Grid.ColumnSpan="3" VerticalAlignment="Center">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="33*"/>
|
||||
<ColumnDefinition Width="89*"/>
|
||||
<ColumnDefinition Width="61*"/>
|
||||
<ColumnDefinition Width="61*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="应用到全部" VerticalAlignment="Center"
|
||||
<TextBlock Text="灯光控制" Margin="5,7,5,2" VerticalAlignment="Center" Height="15"/>
|
||||
<Grid Grid.Column="1" Grid.ColumnSpan="3" VerticalAlignment="Center" Height="34">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="应用到全部" VerticalAlignment="Center"
|
||||
Margin="0,5,5,0"
|
||||
Command="{Binding SetAllCopterLEDCommand}" />
|
||||
<Button Content="应用到所选" VerticalAlignment="Center"
|
||||
<Button Content="应用到所选" VerticalAlignment="Center"
|
||||
Margin="0,5,5,0"
|
||||
Grid.Column="1"
|
||||
Command="{Binding SetSelectedCopterLEDCommand}" />
|
||||
<Button Content="添加" VerticalAlignment="Center"
|
||||
Grid.Column="2"
|
||||
|
||||
|
||||
<Button Content="测试/停止" VerticalAlignment="Center"
|
||||
Margin="0,5,5,0"
|
||||
Grid.Column="2"
|
||||
Command="{Binding TestCopterLEDCommand}"
|
||||
/>
|
||||
|
||||
|
||||
<Button Content="添加" VerticalAlignment="Center"
|
||||
Grid.Column="3"
|
||||
Margin="0,5,5,0"
|
||||
Command="{Binding AddLEDCommand}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
<ItemsControl Name="LEDItems" Margin="5"
|
||||
<ItemsControl Name="LEDItems" Margin="5"
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="2"
|
||||
MinHeight="100"
|
||||
@ -387,63 +397,63 @@
|
||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ItemsSource="{Binding Path= LEDInfos}">
|
||||
<ItemsControl.Template>
|
||||
<ControlTemplate>
|
||||
<ScrollViewer x:Name="ScrollViewer" Padding="{TemplateBinding Padding}">
|
||||
<ItemsPresenter />
|
||||
</ScrollViewer>
|
||||
</ControlTemplate>
|
||||
</ItemsControl.Template>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="0,5,0,0" Orientation="Horizontal" >
|
||||
<TextBlock Text="类型" Margin="0,0,0,0" VerticalAlignment="Center" ></TextBlock>
|
||||
<ComboBox MinWidth="125" Width="125" Margin="5,0,0,0" Foreground="White" VerticalContentAlignment="Center"
|
||||
<ItemsControl.Template>
|
||||
<ControlTemplate>
|
||||
<ScrollViewer x:Name="ScrollViewer" Padding="{TemplateBinding Padding}">
|
||||
<ItemsPresenter />
|
||||
</ScrollViewer>
|
||||
</ControlTemplate>
|
||||
</ItemsControl.Template>
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="0,5,0,0" Orientation="Horizontal" >
|
||||
<TextBlock Text="类型" Margin="0,0,0,0" VerticalAlignment="Center" ></TextBlock>
|
||||
<ComboBox MinWidth="125" Width="125" Margin="5,0,0,0" Foreground="White" VerticalContentAlignment="Center"
|
||||
SelectedIndex="{Binding Path=LEDMode}">
|
||||
<ComboBox.ItemContainerStyle>
|
||||
<Style>
|
||||
<Setter Property="ComboBoxItem.Foreground" Value="White"/>
|
||||
</Style>
|
||||
</ComboBox.ItemContainerStyle>
|
||||
<ComboBoxItem Content="常亮" />
|
||||
<ComboBoxItem Content="同步闪烁(单色)" />
|
||||
<ComboBoxItem Content="异步闪烁(随机)" />
|
||||
<ComboBoxItem Content="渐亮" />
|
||||
<ComboBoxItem Content="渐暗" />
|
||||
<ComboBoxItem Content="呼吸灯" />
|
||||
<ComboBoxItem Content="同步闪烁(随机)" />
|
||||
<ComboBoxItem Content="异步闪烁(单色)" />
|
||||
<ComboBoxItem Content="拉烟"/>
|
||||
</ComboBox>
|
||||
<ComboBox.ItemContainerStyle>
|
||||
<Style>
|
||||
<Setter Property="ComboBoxItem.Foreground" Value="White"/>
|
||||
</Style>
|
||||
</ComboBox.ItemContainerStyle>
|
||||
<ComboBoxItem Content="常亮" />
|
||||
<ComboBoxItem Content="同步闪烁(单色)" />
|
||||
<ComboBoxItem Content="异步闪烁(随机)" />
|
||||
<ComboBoxItem Content="渐亮" />
|
||||
<ComboBoxItem Content="渐暗" />
|
||||
<ComboBoxItem Content="呼吸灯" />
|
||||
<ComboBoxItem Content="同步闪烁(随机)" />
|
||||
<ComboBoxItem Content="异步闪烁(单色)" />
|
||||
<ComboBoxItem Content="拉烟"/>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Text="时间" Margin="12,0,0,0" VerticalAlignment="Center"></TextBlock>
|
||||
<TextBox MinWidth="40" MaxWidth="45" Margin="5,0,0,0"
|
||||
<TextBlock Text="时间" Margin="12,0,0,0" VerticalAlignment="Center"></TextBlock>
|
||||
<TextBox MinWidth="40" MaxWidth="45" Margin="5,0,0,0"
|
||||
ToolTip="单位:秒,最小设置0.1秒"
|
||||
Text="{Binding Delay,UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<TextBlock Text="频率" Margin="12,0,0,0" VerticalAlignment="Center"></TextBlock>
|
||||
<TextBox MinWidth="40" MaxWidth="45" Margin="5,0,0,0"
|
||||
<TextBlock Text="频率" Margin="12,0,0,0" VerticalAlignment="Center"></TextBlock>
|
||||
<TextBox MinWidth="40" MaxWidth="45" Margin="5,0,0,0"
|
||||
Text="{Binding Path=LEDRate, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<TextBlock Text="颜色" Margin="12,0,0,0" VerticalAlignment="Center"></TextBlock>
|
||||
<TextBox Margin="5,0,0,0" MinWidth="50" Width="50"
|
||||
<TextBlock Text="颜色" Margin="12,0,0,0" VerticalAlignment="Center"></TextBlock>
|
||||
<TextBox Margin="5,0,0,0" MinWidth="50" Width="50"
|
||||
Text="{Binding LEDRGB, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
<Button Content="删除" Margin="12,0,0,0"
|
||||
<Button Content="删除" Margin="12,0,0,0"
|
||||
Command="{Binding RemoveLEDCommand}"/>
|
||||
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
|
||||
|
||||
|
||||
</ItemsControl>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
@ -518,7 +528,7 @@
|
||||
|
||||
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user