Commit 75681a18 authored by 潘栩锋's avatar 潘栩锋 🚴

优化 自动模头客户端UI 整理 Style

parent 5818924c
......@@ -23,35 +23,33 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
/// </summary>
public partial class PgHeatAnalyse : Page
{
//PgHeatAnalyseVm viewModel;
PgHeatAnalyseVm viewModel;
public PgHeatAnalyse()
{
InitializeComponent();
}
//[InjectionMethod]
//public void Init(
// IFeedbackHeatService feedback,
// IHeatBufService heatBuf,
// IHeatCellService heatCell,
// IBulkDbService bulkDbService,
// FLY.Thick.Blowing.IService.IBlowingService blowingService,
// FLY.Thick.Blowing.IService.IBlowingDetectService blowingDetectService)
//{
[InjectionMethod]
public void Init(
IFeedbackHeatService feedback,
IHeatBufService heatBuf,
IHeatCellService heatCell,
IBulkDbService bulkDbService)
{
// viewModel = new PgHeatAnalyseVm();
// viewModel.Init(feedback, heatBuf, heatCell, bulkDbService, blowingService, blowingDetectService);
// ucThickHeat0.Init(viewModel.ucThickHeatVms[0]);
// ucThickHeat1.Init(viewModel.ucThickHeatVms[1]);
// this.DataContext = viewModel;
viewModel = new PgHeatAnalyseVm();
viewModel.Init(feedback, heatBuf, heatCell, bulkDbService);
ucThickHeat0.Init(viewModel.ucThickHeatVms[0]);
ucThickHeat1.Init(viewModel.ucThickHeatVms[1]);
this.DataContext = viewModel;
//}
}
public void SetNumber(long number0, long number1)
{
//viewModel.ucThickHeatVms[0].Number = number0;
//viewModel.ucThickHeatVms[1].Number = number1;
viewModel.ucThickHeatVms[0].Number = number0;
viewModel.ucThickHeatVms[1].Number = number1;
}
}
}
......@@ -12,10 +12,10 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
InitializeComponent();
}
//public void Init(UcThickHeatVm viewModel)
//{
// this.DataContext = viewModel;
//}
public void Init(UcThickHeatVm viewModel)
{
this.DataContext = viewModel;
}
}
}
......@@ -34,7 +34,7 @@
<StackPanel Orientation="Horizontal" Background="{StaticResource Brushes.TitleBar.Background}" >
<Button Style="{StaticResource Styles.TitleBar.BackButton2}" Command="BrowseBack"/>
<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>
......@@ -103,6 +103,22 @@
<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 Mix}"/>
<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 FilmLength,StringFormat={}{0:0.#}}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="m" />
</StackPanel>
</StackPanel>
</StackPanel >
<StackPanel Orientation="Horizontal" >
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="检测线速度" />
<ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding HasCheckFilmVelocity}"/>
......@@ -115,7 +131,7 @@
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="电流" />
<TextBlock>
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource Text.FieldContent}">
<Style TargetType="TextBlock" BasedOn="{StaticResource Styles.Text.FieldContent}">
<Setter Property="Text" Value="Off"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasElectricity}" Value="True">
......@@ -131,7 +147,7 @@
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="风机" />
<TextBlock>
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource Text.FieldContent}">
<Style TargetType="TextBlock" BasedOn="{StaticResource Styles.Text.FieldContent}">
<Setter Property="Text" Value="Off"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasFan}" Value="True">
......@@ -148,7 +164,7 @@
<StackPanel Margin="{StaticResource ControlMargin}" DataContext="{Binding HeatBuf}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="测量时间" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding CurrTime,StringFormat={}{0:HH:mm:ss}}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding CurrTime,StringFormat={}{0:HH:mm:ss}}" />
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}" >
......@@ -161,14 +177,14 @@
<StackPanel Margin="{StaticResource ControlMargin}" DataContext="{Binding HeatBuf}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="总起效时间" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding Delay, Converter={StaticResource ts2secconv}}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding Delay, Converter={StaticResource ts2secconv}}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="秒" />
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}" DataContext="{Binding Feedback}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="加热修改时间" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding LastChangedTime,StringFormat={}{0:HH:mm:ss}}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding LastChangedTime,StringFormat={}{0:HH:mm:ss}}" />
</StackPanel>
</StackPanel>
</StackPanel>
......@@ -182,7 +198,7 @@
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}" DataContext="{Binding HeatBuf}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="2σ当前值" />
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding Curr2Sigma, StringFormat={}{0:F1}}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding Curr2Sigma, StringFormat={}{0:F1}}"/>
</StackPanel>
......@@ -211,13 +227,13 @@
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="稳定性" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding CurrR, StringFormat={}{0:F2}}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding CurrR, StringFormat={}{0:F2}}" />
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="稳定状态" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text.FieldContent}" Text="{Binding Stability, Converter={StaticResource stableconv}}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding Stability, Converter={StaticResource stableconv}}" />
</StackPanel>
</StackPanel>
</StackPanel>
......
......@@ -74,6 +74,16 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
/// 最大功率
/// </summary>
public int MaxHeat { get; set; }
/// <summary>
/// 混合数
/// </summary>
public int Mix { get; set; }
/// <summary>
/// 膜距离
/// </summary>
public double FilmLength { get; set; } = 20;
#endregion
#region Command
......@@ -121,6 +131,8 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
Misc.BindingOperations.SetBinding(this.Feedback, nameof(IFeedbackHeatService.HasCheck), this, nameof(HasCheck));
Misc.BindingOperations.SetBinding(this.Feedback, nameof(IFeedbackHeatService.Delay), this, nameof(Delay));
Misc.BindingOperations.SetBinding(this.Feedback, nameof(IFeedbackHeatService.HasCheckFilmVelocity), this, nameof(HasCheckFilmVelocity));
Misc.BindingOperations.SetBinding(this.Feedback, nameof(IFeedbackHeatService.FilmLength), this, nameof(FilmLength));
Misc.BindingOperations.SetBinding(this.Feedback, nameof(IFeedbackHeatService.Mix), this, nameof(Mix));
Misc.BindingOperations.SetBinding(this.HeatBuf, nameof(IHeatBufService.ThresholdSigmaMax), this, nameof(ThresholdSigmaMax));
......@@ -134,6 +146,9 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
});
Misc.BindingOperations.SetBinding(this.HeatBuf, nameof(IHeatBufService.ThresholdR), this, nameof(ThresholdR));
#endregion
}
......@@ -178,12 +193,25 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
{
if (CheckValid_HeatEffectCurve() == false)
return false;
if (Mix < 2) {
FLY.ControlLibrary.Window_WarningTip.Show(
"参数异常", "混合数<2", TimeSpan.FromSeconds(2));
return false;
}
if (FilmLength < 2)
{
FLY.ControlLibrary.Window_WarningTip.Show(
"参数异常", "模头到测厚仪距离<2m", TimeSpan.FromSeconds(2));
return false;
}
return true;
}
private void Apply()
{
if (!WdPassword.Authorize("AirRing"))
if (!WdPassword.Authorize("AutoDie"))
return;
if (!CheckValid())
......@@ -201,6 +229,8 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
Feedback.HasCheckFilmVelocity=this.HasCheckFilmVelocity;
Feedback.HasCheck=this.HasCheck;
Feedback.Delay=this.Delay;
Feedback.FilmLength = FilmLength;
Feedback.Mix = Mix;
......
......@@ -10,47 +10,6 @@
<ResourceDictionary Source="pack://application:,,,/FLY.FilmCasting.AutoDie.UI.Client;component/Themes/Colors.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="Button.AccentedSquare2" TargetType="Button" BasedOn="{StaticResource MahApps.Styles.Button.Square.Accent}">
<Setter Property="FontSize" Value="18"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="40"/>
<Setter Property="Margin" Value="5"/>
</Style>
<Style x:Key="Button.Square2" TargetType="Button" BasedOn="{StaticResource MahApps.Styles.Button.Square}">
<Setter Property="FontSize" Value="18"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="40"/>
<Setter Property="Margin" Value="5"/>
</Style>
<Style x:Key="Button.HighlightedSquare2" TargetType="Button" BasedOn="{StaticResource MahApps.Styles.Button.Square.Highlight}">
<Setter Property="FontSize" Value="18"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="40"/>
<Setter Property="Margin" Value="5"/>
</Style>
<DropShadowEffect x:Key="Card.Shadow" Color="#303030" Opacity=".25" BlurRadius="5" ShadowDepth="3"/>
<Style x:Key="Card.Title" TargetType="TextBlock">
<Setter Property="Background" Value="#FFC107"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Padding" Value="20 5"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="VerticalAlignment" Value="Top"/>
</Style>
<Style x:Key="Card.Border" TargetType="Border">
<Setter Property="Margin" Value="5"/>
<Setter Property="Background" Value="White"/>
<Setter Property="CornerRadius" Value="3"/>
<Setter Property="Padding" Value="5"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="#EBEBEB"/>
<Setter Property="Effect" Value="{StaticResource Card.Shadow}"/>
</Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource TextBlockStyle_FieldHeader}" x:Key="Text.FieldHeader2">
<Setter Property="FontSize" Value="14" />
</Style>
......
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