Commit 56140104 authored by 潘栩锋's avatar 潘栩锋 🚴

修改 收卷 速度设置,旋转频率设置样色

parent 0603f778
......@@ -99,11 +99,8 @@
<Compile Include="UiModule\WdMeasure.xaml.cs">
<DependentUpon>WdMeasure.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\WdFreq.xaml.cs">
<DependentUpon>WdFreq.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\WdVelocity.xaml.cs">
<DependentUpon>WdVelocity.xaml</DependentUpon>
<Compile Include="UiModule\WdSetValue.xaml.cs">
<DependentUpon>WdSetValue.xaml</DependentUpon>
</Compile>
<Compile Include="UnitTests\WinderSystemUt.cs" />
<Compile Include="UiModule\WdManual\WdManual.xaml.cs">
......@@ -193,11 +190,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\WdFreq.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\WdVelocity.xaml">
<Page Include="UiModule\WdSetValue.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
......
......@@ -23,5 +23,10 @@
M510.707071 140.282828C343.973495 140.282828 208.808081 275.448242 208.808081 442.181818c0 166.734869 135.165414 301.89899 301.89899 301.89899 166.734869 0 301.89899-135.164121 301.89899-301.89899 0-166.733576-135.164121-301.89899-301.89899-301.89899z
m217.056969 314.181818c-18.531556 0-34.417778-15.896566-34.417777-31.79701 0-50.344081-18.531556-90.096485-55.59596-121.890909-37.064404-31.800889-76.774141-47.696162-119.135677-47.696161-21.178182 0-34.412606-13.252525-34.412606-34.450101 0-18.548364 13.234424-31.802182 34.412606-31.802182 63.539717 0 119.135677 21.202747 169.439677 63.597899 50.298828 42.397737 74.127515 100.693333 74.127515 172.240161 0 15.901737-13.239596 31.798303-34.417778 31.798303z
</Geometry>
<Style x:Key="AccentedSquareButtonStyle2" TargetType="Button" BasedOn="{StaticResource AccentedSquareButtonStyle}">
<Setter Property="FontSize" Value="20"/>
<Setter Property="Width" Value="200"/>
<Setter Property="Height" Value="50"/>
<Setter Property="Margin" Value="5"/>
</Style>
</ResourceDictionary>
\ No newline at end of file
......@@ -99,9 +99,15 @@ namespace FLY.Winder.UI.Client.UiModule
}
private void button_v_set_Click(object sender, RoutedEventArgs e)
{
var w = container.Resolve<WdVelocity>();
WdSetValue w = new WdSetValue();
w.Init(winderSystem.Accessory.VelocitySet, 200, 1, 1, "速度设置", "m/min");
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.ShowDialog();
if (w.ShowDialog() == true) {
winderSystem.Accessory.VelocitySet = w.Value;
winderSystem.Accessory.IsVelocityChanged = true;
winderSystem.Accessory.IsVelocityChanged = false;
}
}
private void button_manual_Click(object sender, RoutedEventArgs e)
......@@ -113,9 +119,15 @@ namespace FLY.Winder.UI.Client.UiModule
private void button_freq_Click(object sender, RoutedEventArgs e)
{
var w = container.Resolve<WdFreq>();
WdSetValue w = new WdSetValue();
w.Init(winderSystem.Accessory.RotaryFreqSet, 50, 0.1f, 0.1f, "旋转频率", "Hz");
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.ShowDialog();
if (w.ShowDialog() == true)
{
winderSystem.Accessory.RotaryFreqSet = w.Value;
winderSystem.Accessory.IsRotaryFreqChanged = true;
}
}
private void button_measure_Click(object sender, RoutedEventArgs e)
......
......@@ -99,9 +99,16 @@ namespace FLY.Winder.UI.Client.UiModule
}
private void button_v_set_Click(object sender, RoutedEventArgs e)
{
var w = container.Resolve<WdVelocity>();
WdSetValue w = new WdSetValue();
w.Init(winderSystem.Accessory.VelocitySet, 200, 1, 1, "速度设置", "m/min");
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.ShowDialog();
if (w.ShowDialog() == true)
{
winderSystem.Accessory.VelocitySet = w.Value;
winderSystem.Accessory.IsVelocityChanged = true;
winderSystem.Accessory.IsVelocityChanged = false;
}
}
private void button_manual_Click(object sender, RoutedEventArgs e)
......@@ -113,9 +120,15 @@ namespace FLY.Winder.UI.Client.UiModule
private void button_freq_Click(object sender, RoutedEventArgs e)
{
var w = container.Resolve<WdFreq>();
WdSetValue w = new WdSetValue();
w.Init(winderSystem.Accessory.RotaryFreqSet, 50, 0.1f, 0.1f, "旋转频率", "Hz");
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.ShowDialog();
if (w.ShowDialog() == true)
{
winderSystem.Accessory.RotaryFreqSet = w.Value;
winderSystem.Accessory.IsRotaryFreqChanged = true;
}
}
private void button_measure_Click(object sender, RoutedEventArgs e)
......
<flyctrllib:WindowBigClose x:Class="FLY.Winder.UI.Client.WdFreq"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
xmlns:local="clr-namespace:FLY.Winder.UI.Client"
mc:Ignorable="d"
Title="Window_Frequency" WindowStartupLocation="CenterScreen" d:DesignWidth="334.492" d:DesignHeight="318.246" >
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<StackPanel Orientation="Vertical" Margin="5,20">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeader}" Text="频率设置" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" />
</StackPanel>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="1">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="旋转频率" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding RotaryFreqSet,StringFormat={}{0:F1}}"/>
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="Hz" />
</StackPanel>
</StackPanel>
<Button Style="{StaticResource ButtonStyle_empty}" Background="Transparent" Click="button_minus_Click" Margin="5">
<Path Data="{StaticResource Geometry_minus-circle}" Fill="{StaticResource Color_theme_activity}" Stretch="Fill" Height="80" Width="80" />
</Button>
<Button Style="{StaticResource ButtonStyle_empty}" Background="Transparent" Click="button_plus_Click" Margin="5">
<Path Data="{StaticResource Geometry_plus-circle}" Fill="{StaticResource Color_theme_activity}" Stretch="Fill" Height="80" Width="80" />
</Button>
</StackPanel>
</Grid>
<Button x:Name="button_ok" Style="{StaticResource ButtonStyle2}" Content="确定" Width="auto" Margin="5" Click="button_ok_Click" />
</StackPanel>
</flyctrllib:WindowBigClose>
......@@ -6,18 +6,19 @@
xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
xmlns:local="clr-namespace:FLY.Winder.UI.Client"
mc:Ignorable="d"
Title="Window_Frequency" WindowStartupLocation="CenterScreen" d:DesignWidth="334.492" d:DesignHeight="318.246" >
Title="Window_Frequency" WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight" >
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.Winder.UI.Client;component/Themes/Dictionary_MyStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<StackPanel Orientation="Vertical" Margin="5,20">
<StackPanel Margin="5,20">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeader}" Text="计量设置" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" />
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="计量设置" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" />
</StackPanel>
<Grid >
<Grid.ColumnDefinitions>
......@@ -26,25 +27,25 @@
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="1">
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="设定" />
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="设定" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding MeasureLenSet,StringFormat={}{0:F0}}" Foreground="#FF005083"/>
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="mm" />
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding MeasureLenSet,StringFormat={}{0:F0}}" Foreground="#FF005083"/>
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="mm" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5">
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="预警" Foreground="Red" />
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="预警" Foreground="Red" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding MeasurePreWarning,StringFormat={}{0:F0}}" Foreground="DarkRed"/>
<TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="mm" />
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding MeasurePreWarning,StringFormat={}{0:F0}}" Foreground="DarkRed"/>
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="mm" />
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
<Button x:Name="button_ok" Style="{StaticResource ButtonStyle2}" Content="确定" Width="auto" Margin="5" Click="button_ok_Click" />
<Button Style="{StaticResource ButtonStyle_apply}" Click="button_ok_Click" VerticalAlignment="Bottom"/>
</StackPanel>
</flyctrllib:WindowBigClose>
<flyctrllib:WindowBigClose x:Class="FLY.Winder.UI.Client.UiModule.WdVelocity"
<flyctrllib:WindowBigClose x:Class="FLY.Winder.UI.Client.UiModule.WdSetValue"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
xmlns:iCommon="clr-namespace:FLY.Winder.Common;assembly=FLY.Winder"
d:DataContext="{d:DesignInstance iCommon:WinderAccessory}"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d"
Title="Window_Frequency" WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight" >
xmlns:local="clr-namespace:FLY.Winder.UI.Client.UiModule"
d:DataContext="{d:DesignInstance local:WdSetValueVm}"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
SizeToContent="WidthAndHeight"
>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.Winder.UI.Client;component/Themes/Dictionary_MyStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<StackPanel Margin="5,20">
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="速度设置" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" />
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="{Binding Title}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" Foreground="#FF0083D7"/>
</StackPanel>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition />
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="设定速度" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding VelocitySet,StringFormat={}{0:F1}}" MinWidth="60"/>
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="m/min" />
<StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}" Width="200">
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding Value,StringFormat={}{0:F1}}" MaxWidth="120" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="{Binding Unit}" />
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource AccentColorBrush}"
<StackPanel Orientation="Horizontal" Margin="{StaticResource ControlMargin}">
<Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource AccentColorBrush}"
VerticalAlignment="Top"
Click="btnPlusClick" >
<Grid Style="{StaticResource GridStyle_ButtonShadow}">
<Ellipse Fill="{StaticResource WhiteBrush}" Stretch="Fill" Margin="1"/>
<iconPacks:PackIconMaterial Kind="PlusCircle" Width="60"/>
</Grid>
</Button>
<Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource ValidationSummaryColor5}"
Command="{Binding PlusCmd}" >
<iconPacks:PackIconMaterial Kind="PlusCircle"/>
</Button>
<Button Style="{StaticResource ButtonStyle_largeIcon}" Foreground="{StaticResource ValidationSummaryColor5}"
VerticalAlignment="Top"
Click="btnMinusClick" >
<Grid Style="{StaticResource GridStyle_ButtonShadow}">
<Ellipse Fill="{StaticResource WhiteBrush}" Stretch="Fill" Margin="1"/>
<iconPacks:PackIconMaterial Kind="MinusCircle" Width="60">
</iconPacks:PackIconMaterial>
</Grid>
</Button>
</StackPanel>
Command="{Binding MinusCmd}" >
<iconPacks:PackIconMaterial Kind="MinusCircle"/>
</Button>
</StackPanel>
</StackPanel>
<Button Grid.Column="1" Style="{StaticResource ButtonStyle_apply}" Click="btnOkClick" VerticalAlignment="Bottom"/>
</Grid>
</StackPanel>
</flyctrllib:WindowBigClose>
using FLY.Winder.IService;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.ComponentModel;
......@@ -15,50 +16,89 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Unity;
namespace FLY.Winder.UI.Client
namespace FLY.Winder.UI.Client.UiModule
{
/// <summary>
/// Window_Frequency.xaml 的交互逻辑
/// </summary>
public partial class WdFreq : FLY.ControlLibrary.WindowBigClose
public partial class WdSetValue : FLY.ControlLibrary.WindowBigClose
{
IWinderSystemService winderSystem;
public WdFreq()
WdSetValueVm viewModel;
public float Value {
get {
return viewModel.Value;
}
}
public WdSetValue()
{
InitializeComponent();
viewModel = new WdSetValueVm();
}
[InjectionMethod]
public void Init(
IWinderSystemService winderSystem)
float value, float max, float min, float step, string title, string unit)
{
this.winderSystem = winderSystem;
this.DataContext = winderSystem.Accessory;
viewModel.Init(value, max, min, step, title, unit);
this.DataContext = viewModel;
}
private void button_minus_Click(object sender, RoutedEventArgs e)
private void btnOkClick(object sender, RoutedEventArgs e)
{
if (winderSystem.Accessory.RotaryFreqSet >= 0.1)
{
winderSystem.Accessory.RotaryFreqSet -= 0.1f;
}
this.DialogResult = true;
this.Close();
}
}
private void button_plus_Click(object sender, RoutedEventArgs e)
{
if(winderSystem.Accessory.RotaryFreqSet < 50)
winderSystem.Accessory.RotaryFreqSet += 0.1f;
public class WdSetValueVm : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public float Value { get; set; }
public string Title { get; private set; } = "速度设置";
public string Unit { get; private set; } = "m/min";
#region Command
public RelayCommand PlusCmd { get; }
public RelayCommand MinusCmd { get; }
public RelayCommand OkCmd { get; }
#endregion
float max;
float min;
float step;
public WdSetValueVm() {
PlusCmd = new RelayCommand(Plus);
MinusCmd = new RelayCommand(Minus);
}
private void button_ok_Click(object sender, RoutedEventArgs e)
public void Init(
float value, float max, float min, float step, string title, string unit)
{
winderSystem.Accessory.IsRotaryFreqChanged = true;
this.DialogResult = true;
Value = value;
Title = title;
Unit = unit;
this.max = max;
this.min = min;
this.step = step;
this.Close();
}
private void Minus()
{
if (Value > min)
Value -= step;
}
private void Plus()
{
if (Value < max)
Value += step;
}
}
}
using FLY.Winder.IService;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Unity;
namespace FLY.Winder.UI.Client.UiModule
{
/// <summary>
/// Window_Frequency.xaml 的交互逻辑
/// </summary>
public partial class WdVelocity : FLY.ControlLibrary.WindowBigClose
{
IWinderSystemService winderSystem;
public WdVelocity()
{
InitializeComponent();
}
[InjectionMethod]
public void Init(
IWinderSystemService winderSystem)
{
this.winderSystem = winderSystem;
this.DataContext = winderSystem.Accessory;
}
private void btnPlusClick(object sender, RoutedEventArgs e)
{
if (winderSystem.Accessory.VelocitySet < 200)
winderSystem.Accessory.VelocitySet += 0.1f;
}
private void btnMinusClick(object sender, RoutedEventArgs e)
{
if (winderSystem.Accessory.VelocitySet >= 0.1)
winderSystem.Accessory.VelocitySet -= 0.1f;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment