Commit 944e758a authored by 潘栩锋's avatar 潘栩锋 🚴

添加 自动模头图表的Y轴可以设置。

添加 自动模头的对位分析 可以快速查找加热量不同的图
parent 3be7f334
...@@ -36,7 +36,16 @@ ...@@ -36,7 +36,16 @@
<Button Style="{StaticResource Styles.TitleBar.BackButton2}" Command="BrowseBack"/> <Button Style="{StaticResource Styles.TitleBar.BackButton2}" Command="BrowseBack"/>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"> <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Style="{StaticResource Styles.TitleBar.Text}" Text="对位分析"/> <TextBlock Style="{StaticResource Styles.TitleBar.Text}" Text="对位分析"/>
<TextBlock Style="{StaticResource Styles.TitleBar.Text.Sub}" Text="加热与厚度"/> <StackPanel>
<StackPanel Orientation="Horizontal" >
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="有效数据" Foreground="LightGray"/>
<ToggleButton Style="{StaticResource CheckStyle}" HorizontalAlignment="Left" IsChecked="{Binding IsMoveByTakeEffect}" Width="30" Height="auto" Foreground="White" Background="#02FFFFFF" />
</StackPanel>
<StackPanel Orientation="Horizontal" >
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="模头改变" Foreground="LightGray"/>
<ToggleButton Style="{StaticResource CheckStyle}" HorizontalAlignment="Left" IsChecked="{Binding IsMoveByDiffCTime}" Width="30" Height="auto" Foreground="White" Background="#02FFFFFF" />
</StackPanel>
</StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
...@@ -88,29 +97,13 @@ ...@@ -88,29 +97,13 @@
<lvc:CartesianChart Height="300" Margin="5,2,2,2" <lvc:CartesianChart Height="300" Margin="5,2,2,2"
DisableAnimations="True" Hoverable="False" DataTooltip="{x:Null}" > DisableAnimations="True" Hoverable="False" DataTooltip="{x:Null}" >
<lvc:CartesianChart.Series> <lvc:CartesianChart.Series>
<!--<lvc1:Column2Series <lvc1:Column2Series
PointGeometry="{x:Null}"
StrokeThickness ="1"
Stroke="Black"
Fill="{StaticResource Brushes.PreHeat}"
Values="{Binding HeatDiffs}"
Configuration="{Binding MapperHeats}"/>-->
<lvc1:Column2Series
PointGeometry="{x:Null}" PointGeometry="{x:Null}"
StrokeThickness ="1" StrokeThickness ="1"
Stroke="Black" Stroke="Black"
Fill="{StaticResource Brushes.PreHeat}" Fill="{StaticResource Brushes.PreHeat}"
Values="{Binding HeatDiffEffects}" Values="{Binding HeatDiffEffects}"
Configuration="{Binding MapperHeats}"/> Configuration="{Binding MapperHeats}"/>
<!--<lvc:LineSeries
PointGeometry="{x:Null}"
StrokeThickness ="3"
Stroke="{StaticResource Brushes.Heat}"
Fill="Transparent"
Values="{Binding HeatDiffEffects}"
Configuration="{Binding MapperHeats}"/>-->
<lvc:LineSeries <lvc:LineSeries
PointGeometry="{x:Null}" PointGeometry="{x:Null}"
StrokeThickness ="3" StrokeThickness ="3"
...@@ -136,9 +129,9 @@ ...@@ -136,9 +129,9 @@
<lvc:CartesianChart.AxisY> <lvc:CartesianChart.AxisY>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}" <lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
LabelFormatter="{Binding YFormatter}" FontFamily="Courier New" LabelFormatter="{Binding YFormatter}" FontFamily="Courier New"
MinValue="-100" MaxValue="100"> MinValue="{Binding YMinOffset}" MaxValue="{Binding YMaxOffset}">
<lvc:Axis.Separator> <lvc:Axis.Separator>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="10"/> <lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="{Binding YStepOffset}"/>
</lvc:Axis.Separator> </lvc:Axis.Separator>
</lvc:Axis> </lvc:Axis>
</lvc:CartesianChart.AxisY> </lvc:CartesianChart.AxisY>
...@@ -153,6 +146,20 @@ ...@@ -153,6 +146,20 @@
Command="{Binding ApplyCmd}"/> Command="{Binding ApplyCmd}"/>
<WrapPanel Orientation="Horizontal"> <WrapPanel Orientation="Horizontal">
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="最大功率" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding MaxHeat}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="%" />
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="增量界面显示范围" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding RangeOfOffset}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="%" />
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}" > <StackPanel Margin="{StaticResource ControlMargin}" >
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="加热效果" /> <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="加热效果" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
......
...@@ -22,6 +22,13 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -22,6 +22,13 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
#region 图表控制 #region 图表控制
public Func<double, string> YFormatter { get; private set; } public Func<double, string> YFormatter { get; private set; }
public int XMax { get; protected set; } public int XMax { get; protected set; }
public double YMax => MaxHeat;
public double YMin => 0;
public double YStep => MaxHeat / 10;
public double YStepOffset => RangeOfOffset / 10;
public double YMaxOffset => RangeOfOffset / 2;
public double YMinOffset => -RangeOfOffset / 2;
#endregion #endregion
...@@ -43,6 +50,11 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -43,6 +50,11 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
/// 比例因子 /// 比例因子
/// </summary> /// </summary>
public double Kp { get; set; } = 3; public double Kp { get; set; } = 3;
public int MaxHeat { get; set; } = 100;
public int RangeOfOffset { get; set; } = 50;
public bool IsMoveByTakeEffect { get; set; } = true;
public bool IsMoveByDiffCTime { get; set; } = true;
/// <summary> /// <summary>
/// 复位区号 /// 复位区号
...@@ -163,6 +175,14 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -163,6 +175,14 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
this.heatCell, nameof(this.heatCell.Kp), this.heatCell, nameof(this.heatCell.Kp),
this, nameof(Kp)); this, nameof(Kp));
Misc.BindingOperations.SetBinding(
this.heatCell, nameof(this.heatCell.MaxHeat),
this, nameof(MaxHeat));
Misc.BindingOperations.SetBinding(
this.heatCell, nameof(this.heatCell.RangeOfOffset),
this, nameof(RangeOfOffset));
Misc.BindingOperations.SetBinding( Misc.BindingOperations.SetBinding(
this.heatBuf, nameof(this.heatBuf.HeatEffectCurve), this.heatBuf, nameof(this.heatBuf.HeatEffectCurve),
this, nameof(HeatEffectCurve)); this, nameof(HeatEffectCurve));
...@@ -188,8 +208,11 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -188,8 +208,11 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
ucThickHeatVms[i] = new UcThickHeatVm(); ucThickHeatVms[i] = new UcThickHeatVm();
ucThickHeatVms[i].Init($"记录{i + 1}", bulkDbService, 0 - i, Kp); ucThickHeatVms[i].Init($"记录{i + 1}", bulkDbService, 0 - i, Kp, MaxHeat);
Misc.BindingOperations.SetBinding(this, nameof(Kp), ucThickHeatVms[i], nameof(UcThickHeatVm.Kp)); Misc.BindingOperations.SetBinding(this, nameof(Kp), ucThickHeatVms[i], nameof(UcThickHeatVm.Kp));
Misc.BindingOperations.SetBinding(this, nameof(MaxHeat), ucThickHeatVms[i], nameof(UcThickHeatVm.MaxHeat));
Misc.BindingOperations.SetBinding(this, nameof(IsMoveByTakeEffect), ucThickHeatVms[i], nameof(UcThickHeatVm.IsMoveByTakeEffect));
Misc.BindingOperations.SetBinding(this, nameof(IsMoveByDiffCTime), ucThickHeatVms[i], nameof(UcThickHeatVm.IsMoveByDiffCTime));
ucThickHeatVms[i].FrameUpdated += PgHeatAnalyseVm_FrameUpdated; ucThickHeatVms[i].FrameUpdated += PgHeatAnalyseVm_FrameUpdated;
} }
...@@ -488,6 +511,8 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -488,6 +511,8 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
heatBuf.Apply(); heatBuf.Apply();
heatCell.Kp = Kp; heatCell.Kp = Kp;
heatCell.MaxHeat = MaxHeat;
heatCell.RangeOfOffset = RangeOfOffset;
heatCell.Apply(); heatCell.Apply();
FLY.ControlLibrary.Window_Tip.Show("通知", "应用成功", TimeSpan.FromSeconds(2)); FLY.ControlLibrary.Window_Tip.Show("通知", "应用成功", TimeSpan.FromSeconds(2));
......
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
<lvc:CartesianChart.AxisY> <lvc:CartesianChart.AxisY>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}" <lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
LabelFormatter="{Binding YFormatter}" FontFamily="Courier New" LabelFormatter="{Binding YFormatter}" FontFamily="Courier New"
MinValue="0" MaxValue="100"> MinValue="{Binding YMin}" MaxValue="{Binding YMax}">
<lvc:Axis.Separator> <lvc:Axis.Separator>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="10"/> <lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="{Binding YStep}"/>
</lvc:Axis.Separator> </lvc:Axis.Separator>
</lvc:Axis> </lvc:Axis>
</lvc:CartesianChart.AxisY> </lvc:CartesianChart.AxisY>
......
...@@ -23,6 +23,11 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -23,6 +23,11 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
#region 图表控制 #region 图表控制
public Func<double, string> YFormatter { get; protected set; } public Func<double, string> YFormatter { get; protected set; }
public int XMax { get; set; } = 88; public int XMax { get; set; } = 88;
public double YMax => MaxHeat;
public double YMin => 0;
public double YStep => MaxHeat / 10;
#endregion #endregion
/// <summary> /// <summary>
...@@ -32,6 +37,16 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -32,6 +37,16 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
public ChartValues<int> Heats { get; } = new ChartValues<int>(); public ChartValues<int> Heats { get; } = new ChartValues<int>();
public double Kp { get; set; } = 3; public double Kp { get; set; } = 3;
public int MaxHeat { get; set; } = 100;
/// <summary>
/// 急速移动,功能: 移动到下一个数据有效
/// </summary>
public bool IsMoveByTakeEffect { get; set; } = true;
/// <summary>
/// 急速移动,功能: 移动到下一个加热不同
/// </summary>
public bool IsMoveByDiffCTime { get; set; } = true;
public object MapperHeats { get; private set; } public object MapperHeats { get; private set; }
...@@ -154,12 +169,15 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -154,12 +169,15 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
public void Init(string title, public void Init(string title,
IBulkDbService bulkDbService, IBulkDbService bulkDbService,
int number, double kp) int number, double kp, int maxHeat)
{ {
this.bulkDbService = bulkDbService; this.bulkDbService = bulkDbService;
Title = title; Title = title;
Kp = kp; Kp = kp;
MaxHeat = maxHeat;
Misc.BindingOperations.SetBinding(bulkDbService, nameof(bulkDbService.LastId), this, nameof(LastId)); Misc.BindingOperations.SetBinding(bulkDbService, nameof(bulkDbService.LastId), this, nameof(LastId));
Number = number; Number = number;
UpdateFrame(); UpdateFrame();
...@@ -183,7 +201,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -183,7 +201,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
{ {
PollModule.Current.Poll_JustOnce(() => PollModule.Current.Poll_JustOnce(() =>
{ {
_updateFrame(); bulkDbService.GetFrame(Number, my_GetFrameReponse, null);
}, this, MARKNO_UPDATEFRAME); }, this, MARKNO_UPDATEFRAME);
} }
...@@ -227,29 +245,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -227,29 +245,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
FrameUpdated?.Invoke(); FrameUpdated?.Invoke();
} }
void _updateFrame()
{
if (IsGetStableFrame)
{
IsGetStableFrame = false;
bulkDbService.GetStableFrame(Number, IsPre, (asyncContext, retData) =>
{
var reponce = retData as GetStableFrameReponse;
SetFrame(reponce.thickHeat);
}, null);
}
else
{
bulkDbService.GetFrame(Number, (asyncContext, retData) =>
{
var reponce = retData as GetFrameReponse;
SetFrame(reponce.thickHeat);
}, null);
}
}
private void Next() private void Next()
{ {
if (Number < bulkDbService.LastId) if (Number < bulkDbService.LastId)
...@@ -259,14 +255,14 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -259,14 +255,14 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
{ {
Number--; Number--;
} }
bool IsGetStableFrame;
bool IsPre;
bool IsSkipNumberChanged; bool IsSkipNumberChanged;
private void NextStable() private void NextStable()
{ {
IsGetStableFrame = true; PollModule.Current.Poll_JustOnce(() =>
IsPre = false; {
Number++; bulkDbService.GetFrameAdv(Number, false, IsMoveByTakeEffect, IsMoveByDiffCTime, my_GetFrameReponse, null);
}, this, MARKNO_UPDATEFRAME);
} }
private void Newest() private void Newest()
{ {
...@@ -274,12 +270,22 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -274,12 +270,22 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
} }
private void PreStable() private void PreStable()
{ {
IsGetStableFrame = true; PollModule.Current.Poll_JustOnce(() =>
IsPre = true; {
Number--; bulkDbService.GetFrameAdv(Number, true, IsMoveByTakeEffect, IsMoveByDiffCTime, my_GetFrameReponse, null);
}, this, MARKNO_UPDATEFRAME);
} }
void my_GetFrameReponse(object asyncContext, object retData)
{
var reponse = retData as GetFrameReponse;
if (reponse.thickHeat != null)
SetFrame(reponse.thickHeat);
else
IsVaild = false;
FrameUpdated?.Invoke();
}
/// <summary> /// <summary>
/// 以指定分区表 导出厚度% /// 以指定分区表 导出厚度%
/// </summary> /// </summary>
......
...@@ -95,6 +95,13 @@ ...@@ -95,6 +95,13 @@
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="%" /> <TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="%" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="增量界面显示范围" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding RangeOfOffset}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="%" />
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}"> <StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="步进" /> <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="步进" />
......
...@@ -73,7 +73,12 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -73,7 +73,12 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
/// <summary> /// <summary>
/// 最大功率 /// 最大功率
/// </summary> /// </summary>
public int MaxHeat { get; set; } public int MaxHeat { get; set; } = 100;
/// <summary>
/// 偏移量界面的显示范围
/// </summary>
public int RangeOfOffset { get; set; } = 50;
/// <summary> /// <summary>
/// 混合数 /// 混合数
...@@ -126,6 +131,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -126,6 +131,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
Misc.BindingOperations.SetBinding(this.HeatCell, nameof(IHeatCellService.CtrlLine), this, nameof(CtrlLine)); Misc.BindingOperations.SetBinding(this.HeatCell, nameof(IHeatCellService.CtrlLine), this, nameof(CtrlLine));
Misc.BindingOperations.SetBinding(this.HeatCell, nameof(IHeatCellService.Kp), this, nameof(Kp)); Misc.BindingOperations.SetBinding(this.HeatCell, nameof(IHeatCellService.Kp), this, nameof(Kp));
Misc.BindingOperations.SetBinding(this.HeatCell, nameof(IHeatCellService.MaxHeat), this, nameof(MaxHeat)); Misc.BindingOperations.SetBinding(this.HeatCell, nameof(IHeatCellService.MaxHeat), this, nameof(MaxHeat));
Misc.BindingOperations.SetBinding(this.HeatCell, nameof(IHeatCellService.RangeOfOffset), this, nameof(RangeOfOffset));
Misc.BindingOperations.SetBinding(this.Feedback, nameof(IFeedbackHeatService.Step), this, nameof(Step)); Misc.BindingOperations.SetBinding(this.Feedback, nameof(IFeedbackHeatService.Step), this, nameof(Step));
Misc.BindingOperations.SetBinding(this.Feedback, nameof(IFeedbackHeatService.HasCheck), this, nameof(HasCheck)); Misc.BindingOperations.SetBinding(this.Feedback, nameof(IFeedbackHeatService.HasCheck), this, nameof(HasCheck));
...@@ -223,7 +229,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client ...@@ -223,7 +229,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
HeatCell.CtrlLine = this.CtrlLine; HeatCell.CtrlLine = this.CtrlLine;
HeatCell.Kp = this.Kp; HeatCell.Kp = this.Kp;
HeatCell.MaxHeat = this.MaxHeat; HeatCell.MaxHeat = this.MaxHeat;
HeatCell.RangeOfOffset = this.RangeOfOffset;
Feedback.Step=this.Step; Feedback.Step=this.Step;
Feedback.HasCheckFilmVelocity=this.HasCheckFilmVelocity; Feedback.HasCheckFilmVelocity=this.HasCheckFilmVelocity;
......
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks">
>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/> <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/> <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>
...@@ -54,4 +53,24 @@ ...@@ -54,4 +53,24 @@
<SolidColorBrush x:Key="Badges.AccentBackground">#99008BE5</SolidColorBrush> <SolidColorBrush x:Key="Badges.AccentBackground">#99008BE5</SolidColorBrush>
<SolidColorBrush x:Key="Badges.AccentForeground">White</SolidColorBrush> <SolidColorBrush x:Key="Badges.AccentForeground">White</SolidColorBrush>
<Style TargetType="{x:Type ToggleButton}" x:Key="CheckStyle" >
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Background="{TemplateBinding Background}" CornerRadius="2" >
<iconPacks:PackIconMaterial x:Name="icon" Kind="CheckboxBlankOutline" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="icon" Property="Kind" Value="CheckboxMarkedOutline"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary> </ResourceDictionary>
\ No newline at end of file
...@@ -50,11 +50,11 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr ...@@ -50,11 +50,11 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
</ResourceDictionary> </ResourceDictionary>
</UserControl.Resources> </UserControl.Resources>
<Border Style="{StaticResource BorderStyle_module}" > <Border Style="{StaticResource Styles.Module.Border}" >
<Grid Name="grid" d:DataContext="{StaticResource viewModel}"> <Grid Name="grid" d:DataContext="{StaticResource viewModel}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
<RowDefinition Height="258*" /> <RowDefinition />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Background="#F0579aab" Height="20" VerticalAlignment="Top" CornerRadius="3,3,0,0"/> <Border Background="#F0579aab" Height="20" VerticalAlignment="Top" CornerRadius="3,3,0,0"/>
<Grid> <Grid>
...@@ -279,13 +279,6 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr ...@@ -279,13 +279,6 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
Fill="Transparent" Fill="Transparent"
Values="{Binding ThickPercents}" Values="{Binding ThickPercents}"
Configuration="{Binding MapperThickPercents}"/> Configuration="{Binding MapperThickPercents}"/>
<!--<lvc:ScatterSeries
PointGeometry="{StaticResource Geometry.Close}"
StrokeThickness ="1"
Stroke="{StaticResource Brushes.Thick}"
Fill="{StaticResource WhiteBrush}"
Values="{Binding ThickPercents}"
Configuration="{Binding MapperThickPercentsWithIsStable}"/>-->
</lvc:CartesianChart.Series> </lvc:CartesianChart.Series>
<lvc:CartesianChart.AxisX> <lvc:CartesianChart.AxisX>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}" <lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
...@@ -304,10 +297,10 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr ...@@ -304,10 +297,10 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
</lvc:CartesianChart.AxisX> </lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY> <lvc:CartesianChart.AxisY>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}" <lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
LabelFormatter="{Binding YFormatter}" LabelFormatter="{Binding YFormatter}" FontFamily="Courier New"
MinValue="-50" MaxValue="50" FontFamily="Courier New" > MinValue="{Binding YMinOffset}" MaxValue="{Binding YMaxOffset}" >
<lvc:Axis.Separator> <lvc:Axis.Separator>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="10"/> <lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="{Binding YStepOffset}"/>
</lvc:Axis.Separator> </lvc:Axis.Separator>
</lvc:Axis> </lvc:Axis>
</lvc:CartesianChart.AxisY> </lvc:CartesianChart.AxisY>
...@@ -349,9 +342,9 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr ...@@ -349,9 +342,9 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
<lvc:CartesianChart.AxisY> <lvc:CartesianChart.AxisY>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}" <lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
LabelFormatter="{Binding YFormatter}" LabelFormatter="{Binding YFormatter}"
MinValue="0" MaxValue="100" FontFamily="Courier New" > MinValue="{Binding YMin}" MaxValue="{Binding YMax}" FontFamily="Courier New">
<lvc:Axis.Separator> <lvc:Axis.Separator>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="10"/> <lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="{Binding YStep}"/>
</lvc:Axis.Separator> </lvc:Axis.Separator>
</lvc:Axis> </lvc:Axis>
</lvc:CartesianChart.AxisY> </lvc:CartesianChart.AxisY>
......
...@@ -20,6 +20,14 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule ...@@ -20,6 +20,14 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
public Func<double, string> YFormatter { get; private set; } public Func<double, string> YFormatter { get; private set; }
public double XMax { get; protected set; } = double.NaN; public double XMax { get; protected set; } = double.NaN;
public double XMin { get; protected set; } = double.NaN; public double XMin { get; protected set; } = double.NaN;
public double YMax => MaxHeat;
public double YMin => 0;
public double YStep => MaxHeat / 10;
public double YStepOffset => RangeOfOffset / 10;
public double YMaxOffset => RangeOfOffset / 2;
public double YMinOffset => -RangeOfOffset / 2;
#endregion #endregion
/// <summary> /// <summary>
...@@ -37,12 +45,13 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule ...@@ -37,12 +45,13 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
[PropertyChanged.DependsOn(nameof(Kp))] [PropertyChanged.DependsOn(nameof(Kp))]
public object MapperThickPercents { get; private set; } public object MapperThickPercents { get; private set; }
[PropertyChanged.DependsOn(nameof(Kp))]
public object MapperThickPercentsWithIsStable { get; private set; }
public object Mapper { get; private set; } public object Mapper { get; private set; }
public int MaxHeat { get; set; } = 100;
public int RangeOfOffset { get; set; } = 50;
public double Kp { get; protected set; } = 3; public double Kp { get; protected set; } = 3;
/// <summary> /// <summary>
/// 当前选择加热通道 /// 当前选择加热通道
/// </summary> /// </summary>
...@@ -75,7 +84,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule ...@@ -75,7 +84,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
YFormatter = (y) => YFormatter = (y) =>
{ {
string text = y + "%"; string text = Math.Round(y) + "%";
return $"{text,6}"; return $"{text,6}";
}; };
...@@ -117,23 +126,6 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule ...@@ -117,23 +126,6 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
return value * Kp; return value * Kp;
}); });
MapperThickPercentsWithIsStable = Mappers.Xy<double>()
.X((value, index) =>
{
return index + 1;
})
.Y((value, index) =>
{
if (index < IsStables.Count() && index >= 0)
{
if (!IsStables[index])
{
return value * Kp;
}
}
return double.NaN;
});
Mapper = Mappers.Xy<int>() Mapper = Mappers.Xy<int>()
.X((value, index) => .X((value, index) =>
...@@ -189,7 +181,8 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule ...@@ -189,7 +181,8 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
Misc.BindingOperations.SetBinding(mHeatCell, nameof(mHeatCell.Kp), this, nameof(Kp)); Misc.BindingOperations.SetBinding(mHeatCell, nameof(mHeatCell.Kp), this, nameof(Kp));
Misc.BindingOperations.SetBinding(mHeatCell, nameof(mHeatCell.MaxHeat), this, nameof(MaxHeat));
Misc.BindingOperations.SetBinding(mHeatCell, nameof(mHeatCell.RangeOfOffset), this, nameof(RangeOfOffset));
this.btnClearH = button_clear_h; this.btnClearH = button_clear_h;
LPress.Init(btnClearH); LPress.Init(btnClearH);
......
...@@ -42,6 +42,12 @@ namespace FLY.FilmCasting.AutoDie.Client ...@@ -42,6 +42,12 @@ namespace FLY.FilmCasting.AutoDie.Client
/// 最大加热量 默认100% /// 最大加热量 默认100%
/// </summary> /// </summary>
public int MaxHeat { get; set; } public int MaxHeat { get; set; }
/// <summary>
/// 偏移量界面的显示范围
/// </summary>
public int RangeOfOffset { get; set; }
#endregion #endregion
......
...@@ -31,10 +31,15 @@ namespace FLY.FilmCasting.AutoDie.IService ...@@ -31,10 +31,15 @@ namespace FLY.FilmCasting.AutoDie.IService
int CtrlLine { get; set; } int CtrlLine { get; set; }
/// <summary> /// <summary>
/// 最大加热量 默认100% /// 最大加热量 默认100%, 也是 当前量界面的显示范围
/// </summary> /// </summary>
int MaxHeat { get; set; } int MaxHeat { get; set; }
/// <summary>
/// 偏移量界面的显示范围
/// </summary>
int RangeOfOffset { get; set; }
#endregion #endregion
#region 状态 #region 状态
......
...@@ -49,7 +49,10 @@ namespace FLY.FilmCasting.AutoDie.Server ...@@ -49,7 +49,10 @@ namespace FLY.FilmCasting.AutoDie.Server
/// 最大加热量 默认100% /// 最大加热量 默认100%
/// </summary> /// </summary>
public int MaxHeat { get; set; } = 100; public int MaxHeat { get; set; } = 100;
/// <summary>
/// 偏移量界面的显示范围
/// </summary>
public int RangeOfOffset { get; set; } = 50;
#endregion #endregion
#region 状态 #region 状态
...@@ -136,6 +139,7 @@ namespace FLY.FilmCasting.AutoDie.Server ...@@ -136,6 +139,7 @@ namespace FLY.FilmCasting.AutoDie.Server
{ {
CtrlLine = 2; CtrlLine = 2;
} }
} }
public void Init(HeatBuf heatBuf) public void Init(HeatBuf heatBuf)
{ {
...@@ -624,6 +628,11 @@ namespace FLY.FilmCasting.AutoDie.Server ...@@ -624,6 +628,11 @@ namespace FLY.FilmCasting.AutoDie.Server
/// </summary> /// </summary>
public int MaxHeat = 100; public int MaxHeat = 100;
/// <summary>
/// 偏移量界面的显示范围
/// </summary>
public int RangeOfOffset = 50;
/// <summary> /// <summary>
/// 平滑的阀值,只有超出阀值,才平滑 /// 平滑的阀值,只有超出阀值,才平滑
/// </summary> /// </summary>
......
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