Commit 5ed48454 authored by 潘栩锋's avatar 潘栩锋 🚴

Merge remote-tracking branch 'remotes/gitlab/dev7.0' into dev7.0-battery

parents ff3e2be2 7ff61276
......@@ -11,6 +11,27 @@
<!--标准图标按钮 内部为iconPacks的按键,下方可带文字 -->
<Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Base" >
<Setter Property="Width" Value="36"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Small" >
<Setter Property="Width" Value="25"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Large" >
<Setter Property="Width" Value="50"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Rectangle" >
<Setter Property="Width" Value="20"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="Button" x:Key="Styles.Button.Icon" BasedOn="{StaticResource Styles.Button.Empty}">
<Style.Resources>
<Style TargetType="TextBlock" >
......@@ -21,12 +42,7 @@
<Setter Property="FontFamily" Value="Microsoft Sans Serif"/>
<Setter Property="Margin" Value="3"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" >
<Setter Property="Width" Value="36"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Base}"/>
</Style.Resources>
<Style.Setters>
<Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/>
......@@ -38,11 +54,7 @@
<!--小型图标按钮 内部为iconPacks的按键,下方不带文字 -->
<Style TargetType="Button" x:Key="Styles.Button.Icon.Small" BasedOn="{StaticResource Styles.Button.Empty}">
<Style.Resources>
<Style TargetType="iconPacks:PackIconMaterial" >
<Setter Property="Width" Value="25"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Small}"/>
</Style.Resources>
<Style.Setters>
<Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/>
......@@ -59,11 +71,7 @@
<Setter Property="Foreground" Value="{StaticResource MahApps.Brushes.Text}"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" >
<Setter Property="Width" Value="50"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Large}"/>
</Style.Resources>
<Style.Setters>
<Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/>
......@@ -123,12 +131,7 @@
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Margin" Value="{StaticResource ControlMargin}"/>
<Style.Resources>
<Style TargetType="iconPacks:PackIconMaterial" >
<Setter Property="Width" Value="20"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Rectangle}"/>
</Style.Resources>
</Style>
</ResourceDictionary>
\ No newline at end of file
......@@ -212,6 +212,51 @@ namespace Misc
}
return System.Linq.Enumerable.SequenceEqual(first, second, comparer);
}
/// <summary>
/// 对数列平滑;
/// 数列的两端,平滑量只有 radius;中间数据平滑量 = radius*2+1
/// </summary>
/// <param name="data">数列</param>
/// <param name="radius">平滑半径</param>
/// <returns></returns>
public static double[] Smooth(this IEnumerable<double> frame, int radius)
{
if (radius > 0)
{
double[] frame2 = new double[frame.Count()];
for (int i = 0; i < frame.Count(); i++)
{
double sum = 0;
int cnt = 0;
int index_b = i - radius;
int index_e = i + radius;
for (int j = index_b; j <= index_e; j++)
{
if ((j >= 0) && (j < frame.Count()))
{
double v = frame.ElementAt(j);
if (!double.IsNaN(v))
{
sum += v;
cnt++;
}
}
}
if (cnt > 0)
frame2[i] = sum / cnt;
else
frame2[i] = double.NaN;
}
return frame2;
}
else
{
return frame.ToArray();
}
}
}
/// <summary>
/// X Y 组合
......
......@@ -64,7 +64,7 @@ namespace FLY.Thick.Base.UI.CustomSection
/// <summary>
/// X轴间隔
/// </summary>
public int XStep { get; set; }
public int XStep { get; set; } = 5;
public UcSectionScanGraphVm()
{
......@@ -73,7 +73,7 @@ namespace FLY.Thick.Base.UI.CustomSection
public void Init(ParamDictionary paramDictionary)
{
paramDictionary.SetBinding(this, nameof(XStep), XStep);
paramDictionary.SetBinding(this, nameof(XStep), ParamDistItemKeys.XStep, XStep);
}
}
......
......@@ -7,6 +7,9 @@ using System.Threading.Tasks;
namespace FLY.Thick.Base.UI
{
/// <summary>
/// LCUS1 绑定 全局参数字典ParamDictionary 的配置
/// </summary>
public class LCUS1_dependOn:LCUS1
{
ParamDictionary paramDictionary;
......
......@@ -7,6 +7,10 @@ using System.Threading.Tasks;
namespace FLY.Thick.Base.UI
{
/// <summary>
/// 报警服务 的带设备名称 版本
/// </summary>
public class WarningSystem2ServiceClientWithName : WarningSystem2ServiceClient
{
public string DevName { get; private set; }
......
......@@ -248,6 +248,9 @@
<DependentUpon>PgFixAnalyze.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\FixGraph\UiModule2_FixGraph.cs" />
<Compile Include="UiModule\MenuMotion2.xaml.cs">
<DependentUpon>MenuMotion2.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\MenuMotion.xaml.cs">
<DependentUpon>MenuMotion.xaml</DependentUpon>
</Compile>
......@@ -400,6 +403,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Themes\GraphStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\String.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
......@@ -440,6 +447,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\MenuMotion2.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\MenuMotion.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......
......@@ -9,6 +9,9 @@ using System.Threading.Tasks;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 显示 自动扫描 提示, 只是负责显示而已
/// </summary>
public class OnInitAutoScan : IOnInit
{
FLY.OBJComponents.IService.IWarningSystem2Service warningService;
......
......@@ -14,6 +14,12 @@ using FLY.Thick.Base.Common;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// ERRNOs.Instance.SCAN_ERRNO_OVERCTRL
/// ERRNOs.Instance.SCAN_ERRNO_OVERTOL
/// 扫描报警时,全屏显示
/// </summary>
public class OnInitError : IOnInit
{
#region 延时推送 MARKNO
......
......@@ -13,6 +13,9 @@ using FLY.Thick.Base.UI;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// F1~F5 动作
/// </summary>
public class OnInitGageCommand : IOnInit
{
Window window;
......
......@@ -11,6 +11,9 @@ using System.Windows;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 语言切换,现在没法用 UI没做英语翻译
/// </summary>
public class OnInitLanguage : IOnInit
{
ParamDictionary paramDictionary;
......
......@@ -9,6 +9,9 @@ using Unity;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// LCUS1 USB继电器模块, 监听 WarningSystemManager
/// </summary>
public class OnInitLcus1_Multi : IOnInit
{
public int Level { get; private set; }
......
......@@ -9,6 +9,9 @@ using Unity;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// LCUS1 USB继电器模块, 监听 单个报警服务 IWarningSystem2Service
/// </summary>
public class OnInitLcus1_One : IOnInit
{
public int Level { get; private set; }
......
......@@ -11,6 +11,9 @@ using Unity;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 虚拟键盘
/// </summary>
public class OnInitOSK : IOnInit
{
ParamDictionary paramDictionary;
......
......@@ -18,6 +18,9 @@ using System.Collections.ObjectModel;
namespace FLY.Thick.Base.UI.OnInit
{
/// <summary>
/// 监听 WarningSystemManager 的报警。 周期一个个显示 报警列表的内容
/// </summary>
public class OnInitWarnings : IOnInit
{
public int Level { get; private set; }
......@@ -98,6 +101,10 @@ namespace FLY.Thick.Base.UI.OnInit
}
}
/// <summary>
/// 从 warnings.service 容器获取全部 报警服务, 把 全部报警服务的报警内容 整合到 Errors
/// </summary>
public class WarningSystemManager : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
......
......@@ -18,5 +18,6 @@ namespace FLY.Thick.Base.UI
public const string LCUS1_Enable = "LCUS1_Enable";
public const string WindowSize = "WindowSize";
public const string SkipWarningUnityNames = "SkipWarningUnityNames";
public const string XStep = "XStep";
}
}
......@@ -26,17 +26,14 @@
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="授权码" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding Access, Converter={StaticResource bytesconv}}" Tag="Full"/>
</StackPanel>
</StackPanel>
<Button Style="{StaticResource ButtonStyle2}" Content="应用" Margin="{StaticResource ControlMargin}" Width="auto" Command="{Binding ApplyCmd}" />
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="授权码" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Access, Converter={StaticResource bytesconv}}" Tag="Full"/>
</StackPanel>
</StackPanel>
<Button Style="{StaticResource Styles.Button.Apply}" Command="{Binding ApplyCmd}" />
</StackPanel>
</Grid>
</flyctrllib:WindowBigClose>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf">
<!--颜色-->
<SolidColorBrush x:Key="TextBrush" Color="#4C4949" />
<SolidColorBrush x:Key="GrayBrush1" Color="#FF727272"/>
<SolidColorBrush x:Key="GrayBrush2" Color="#FF858484" />
<SolidColorBrush x:Key="SemiTransparentGreyBrush2" Color="#99FFFFFF"/>
<SolidColorBrush x:Key="SemiTransparentGreyBrush" Color="#99F0F0F0"/>
<SolidColorBrush x:Key="SemiTransparentActiveBrush" Color="#50008BE5"/>
<SolidColorBrush x:Key="WhiteBrush" Color="White"/>
<!--尺寸-->
<sys:Double x:Key="FontSize.Title">16</sys:Double>
<sys:Double x:Key="FontSize.Value">20</sys:Double>
<sys:Double x:Key="FontSize.Unit">15</sys:Double>
<Thickness x:Key="TextMargin">5,0</Thickness>
<!--字体-->
<Style x:Key="TitleStyle" TargetType="TextBlock">
<Setter Property="Width" Value="50"/>
<Setter Property="Foreground" Value="{StaticResource GrayBrush1}"/>
<Setter Property="FontSize" Value="{StaticResource FontSize.Title}"/>
<Setter Property="TextAlignment" Value="Right"/>
</Style>
<Style x:Key="ValueStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
<Setter Property="FontSize" Value="{StaticResource FontSize.Value}"/>
<Setter Property="Padding" Value="{StaticResource TextMargin}"/>
</Style>
<Style x:Key="UnitStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource GrayBrush2}"/>
<Setter Property="FontSize" Value="{StaticResource FontSize.Unit}"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
</Style>
<!--Axis.Section-->
<Style x:Key="Styles.Axis.Section.Selected" TargetType="lvc:AxisSection" >
<Setter Property="StrokeThickness" Value="1"/>
<Setter Property="DataLabel" Value="False"/>
<Setter Property="DisableAnimations" Value="True"/>
<Setter Property="DataLabelForeground" Value="White"/>
<Setter Property="Opacity" Value="0.1"/>
<Setter Property="Stroke" Value="#FFCA000C"/>
<Setter Property="Fill" Value="#59CA000C"/>
<!--<Setter Property="Stroke" Value="#FFFDC8C8"/>-->
<!--<Setter Property="Fill" Value="#59F7D8D8"/>-->
</Style>
<!--扫描图,纵向趋势图Y轴 标签-->
<Style x:Key="AxisSectionStyle" TargetType="lvc:AxisSection" >
<Setter Property="StrokeThickness" Value="1"/>
<Setter Property="DataLabel" Value="True"/>
<Setter Property="DisableAnimations" Value="True"/>
<Setter Property="DataLabelForeground" Value="White"/>
<Setter Property="Opacity" Value="0.5"/>
<Setter Property="Panel.ZIndex" Value="1"/>
</Style>
</ResourceDictionary>
\ No newline at end of file
......@@ -25,14 +25,14 @@
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="混合数" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding Mix}" />
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Mix}" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="间隔" />
<StackPanel Orientation="Horizontal">
<ComboBox x:Name="combox_intervalopt" Width="140" HorizontalAlignment="Left" FontSize="32"
<ComboBox x:Name="combox_intervalopt" Width="140" HorizontalAlignment="Left" FontSize="{StaticResource FontSize.FieldContent}"
ItemsSource="{Binding DataContext.IntervalOpt, ElementName=grid_null}"
DisplayMemberPath="Title" SelectedValuePath="Interval"
SelectedValue="{Binding Interval}"/>
......@@ -41,7 +41,7 @@
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="数据量" />
<StackPanel Orientation="Horizontal">
<ComboBox x:Name="combox_datalenopt" Width="140" HorizontalAlignment="Left" FontSize="32"
<ComboBox x:Name="combox_datalenopt" Width="140" HorizontalAlignment="Left" FontSize="{StaticResource FontSize.FieldContent}"
ItemsSource="{Binding DataContext.DataLenOpt, ElementName=grid_null}"
SelectedValue="{Binding Len}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}" />
......@@ -75,19 +75,17 @@
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}" Visibility="{Binding IsAutoTarget,Converter={StaticResource visbilityconv}, ConverterParameter=HiddenWhenTrue}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="Y轴中值" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding YTarget}" />
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding YTarget}" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="Y轴范围" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding YRange}" />
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding YRange}" />
</StackPanel>
</StackPanel>
</StackPanel>
<Button Style="{StaticResource Styles.Button.Empty}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="button_save_Click" Margin="5,-100,5,0" Background="White">
<Path Data="{StaticResource Geometry_check-circle}" Fill="{StaticResource Color_theme_activity}" Stretch="Fill" Height="80" Width="80" />
</Button>
<Button Style="{StaticResource Styles.Button.Apply}" Click="button_save_Click" />
</StackPanel>
</Grid>
......
......@@ -34,8 +34,7 @@
<lvc:LineSeries
Values="{Binding Values}"
StrokeThickness = "3"
Stroke = "{StaticResource Color_theme_static}"
Stroke = "{StaticResource Brushes.Static}"
Fill = "Transparent"
PointGeometry ="{x:Null}"
/>
......@@ -51,7 +50,7 @@
<lvc:AxisSection Value="{Binding XPointer}"
DataLabel="True"
StrokeThickness="1"
Stroke="#ff5722"
Stroke="Orange"
DisableAnimations="True"
DataLabelForeground="White"
Panel.ZIndex="1"/>
......@@ -91,23 +90,15 @@
</Grid>
</Grid>
<Grid Background="{StaticResource Brush_theme_bar}" Height="80">
<Grid Background="{StaticResource Brushes.TitleBar.Background}" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Button Style="{StaticResource Styles.Button.Empty}" Command="BrowseBack" Margin="10">
<Grid>
<Rectangle Width="60" Height="60" Fill="White"/>
<Path Fill="{StaticResource Brush_theme_bar}" Data="{StaticResource Geometry_arrow-left-bold}"
SnapsToDevicePixels ="True"
Stretch="Fill"
Height="30" Width="30" />
</Grid>
</Button>
<TextBlock Grid.Column="1" FontWeight="Bold" FontFamily="Arial" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="35" Text="FFT分析"/>
<StackPanel Orientation="Horizontal" >
<Button Style="{StaticResource Styles.TitleBar.BackButton2}" Command="BrowseBack"/>
<TextBlock Style="{StaticResource Styles.TitleBar.Text}" Text="FFT分析"/>
</StackPanel>
</Grid>
</Grid>
</Page>
......@@ -179,7 +179,7 @@ namespace FLY.Thick.Base.UI.UiModule
XFormatter = (d) =>
{
int n = (int)d;
return ((n) * MinFs).ToString("F1");
return ((n) * MinFs).ToString("F2");
};
Values.Clear();
//
......
......@@ -5,50 +5,103 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FLY.Thick.Base.UI.UiModule"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:common="clr-namespace:FLY.Thick.Base.Common;assembly=FLY.Thick.Base"
mc:Ignorable="d" >
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="ActivatedBrush" Color="#FF23d96e" />
<SolidColorBrush x:Key="ActivatedBrush2" Color="Red" />
<SolidColorBrush x:Key="NoActivatedBrush" Color="White" />
<SolidColorBrush x:Key="TextBrush" Color="White" />
</ResourceDictionary>
</UserControl.Resources>
<StackPanel>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnScanClick">
<Button Click="btnScanClick">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon}">
<Setter Property="Foreground" Value="{StaticResource NoActivatedBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.SCAN}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel >
<iconPacks:PackIconMaterial Kind="Rotate3dVariant" />
<!--<iconPacks:PackIconMaterial Kind="TapeMeasure" />-->
<!--<iconPacks:PackIconMaterial Kind="TransitTransfer" />-->
<TextBlock Text="扫描" Foreground="White"/>
<TextBlock Text="扫描" Foreground="{StaticResource TextBrush}"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="Red"
Click="btnStopClick">
<Button Click="btnStopClick">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon}">
<Setter Property="Foreground" Value="{StaticResource NoActivatedBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.FIX}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush2}"/>
</DataTrigger>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.STOP}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush2}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel >
<iconPacks:PackIconMaterial Kind="CloseCircle" />
<TextBlock Text="停止" Foreground="Red"/>
<TextBlock Text="停止" Foreground="{StaticResource TextBrush}"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnOrgClick">
<Button Click="btnOrgClick">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon}">
<Setter Property="Foreground" Value="{StaticResource NoActivatedBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.ORG}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel >
<iconPacks:PackIconMaterial Kind="Adjust" />
<TextBlock Text="归零" Foreground="White"/>
<TextBlock Text="归零" Foreground="{StaticResource TextBrush}"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnForwClick">
<Button Click="btnForwClick">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon}">
<Setter Property="Foreground" Value="{StaticResource NoActivatedBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.FORW}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel >
<iconPacks:PackIconMaterial Kind="ArrowRightBoldCircle" />
<TextBlock Text="正行" Foreground="White"/>
<TextBlock Text="正行" Foreground="{StaticResource TextBrush}"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnBackwClick">
<Button Click="btnBackwClick">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon}">
<Setter Property="Foreground" Value="{StaticResource NoActivatedBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.BACKW}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel >
<iconPacks:PackIconMaterial Kind="ArrowLeftBoldCircle" />
<TextBlock Text="反行" Foreground="White"/>
<TextBlock Text="反行" Foreground="{StaticResource TextBrush}"/>
</StackPanel>
</Button>
</StackPanel>
......
......@@ -11,46 +11,48 @@ namespace FLY.Thick.Base.UI.UiModule
/// </summary>
public partial class MenuMotion : UserControl
{
ITDGageService tDGageService;
ITDGageService gageService;
public MenuMotion()
{
InitializeComponent();
}
[InjectionMethod]
public void Init(ITDGageService tDGageService)
public void Init(ITDGageService gageService)
{
this.tDGageService = tDGageService;
this.gageService = gageService;
this.DataContext = gageService;
//gageService.DynArea.ControllerState
}
private void btnBackwClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.BACKW);
gageService.StartP2(Base.Common.STARTP2_MODE.BACKW);
}
private void btnForwClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.FORW);
gageService.StartP2(Base.Common.STARTP2_MODE.FORW);
}
private void btnOrgClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.ORG);
gageService.StartP2(Base.Common.STARTP2_MODE.ORG);
}
private void btnStopClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.STOP);
gageService.StartP2(Base.Common.STARTP2_MODE.STOP);
}
private void btnScanClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP1();
gageService.StartP1();
}
}
public class UiModule2_MenuMotion : IUiModule2
{
public string Title => "扫描运行";
public string Title => "测厚.扫描运行";
public ComponentType Type => ComponentType.Menu;
......
<UserControl x:Class="FLY.Thick.Base.UI.UiModule.MenuMotion2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FLY.Thick.Base.UI.UiModule"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d" >
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<StackPanel>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnScanClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="Rotate3dVariant" />
<!--<iconPacks:PackIconMaterial Kind="TapeMeasure" />-->
<!--<iconPacks:PackIconMaterial Kind="TransitTransfer" />-->
<TextBlock Text="扫描" Foreground="White"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="Red"
Click="btnStopClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="CloseCircle" />
<TextBlock Text="停止" Foreground="Red"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnOrgClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="Adjust" />
<TextBlock Text="归零" Foreground="White"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnForwClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="ArrowRightBoldCircle" />
<TextBlock Text="正行" Foreground="White"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnBackwClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="ArrowLeftBoldCircle" />
<TextBlock Text="反行" Foreground="White"/>
</StackPanel>
</Button>
</StackPanel>
</UserControl>
using FLY.Thick.Base.IService;
using MultiLayout.UiModule;
using System.Windows;
using System.Windows.Controls;
using Unity;
namespace FLY.Thick.Base.UI.UiModule
{
/// <summary>
/// MenuMotion.xaml 的交互逻辑
/// </summary>
public partial class MenuMotion2 : UserControl
{
ITDGageService tDGageService;
public MenuMotion2()
{
InitializeComponent();
}
[InjectionMethod]
public void Init(ITDGageService tDGageService)
{
this.tDGageService = tDGageService;
}
private void btnBackwClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.BACKW);
}
private void btnForwClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.FORW);
}
private void btnOrgClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.ORG);
}
private void btnStopClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.STOP);
}
private void btnScanClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP1();
}
}
public class UiModule2_MenuMotion2 : IUiModule2
{
public string Title => "测厚.扫描运行2";
public ComponentType Type => ComponentType.Menu;
public bool IsUnique => true;
public FrameworkElement GetComponent(int id, IUnityContainer container)
{
MenuMotion2 menu = new MenuMotion2();
container.BuildUp(menu);
return menu;
}
public FrameworkElement GetThumbnail()
{
return new System.Windows.Controls.Grid();
}
public void MatchParam(int[] IDs)
{
}
}
}
......@@ -266,8 +266,10 @@ namespace FLY.Thick.Base.Server
double v = MmOfR / 1000.0 / (dt - dtRound).TotalMinutes;
if (v < (FilmVelocity - 1))
FilmVelocity = v;
if (v >= (FilmVelocity - 1))
return;
FilmVelocity = v;
double p1 = RCnt * MmOfR / 1000.0;
......
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