Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
thick-casting
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
thick-casting
Commits
a3480b55
Commit
a3480b55
authored
May 30, 2022
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 自动模头多级控制
parent
c87c3df7
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
446 additions
and
108 deletions
+446
-108
PgSetup.xaml
...ng.AutoDie/FLY.FilmCasting.AutoDie.UI.Client/PgSetup.xaml
+22
-9
PgSetup.xaml.cs
...AutoDie/FLY.FilmCasting.AutoDie.UI.Client/PgSetup.xaml.cs
+113
-10
Styles.xaml
...oDie/FLY.FilmCasting.AutoDie.UI.Client/Themes/Styles.xaml
+1
-0
AutoDieGraph.xaml
...AutoDie.UI.Client/UiModule/AutoDieGraph/AutoDieGraph.xaml
+84
-23
AutoDieGraphVm.cs
...AutoDie.UI.Client/UiModule/AutoDieGraph/AutoDieGraphVm.cs
+11
-1
FeedbackHeatServiceClient.cs
...Y.FilmCasting.AutoDie/Client/FeedbackHeatServiceClient.cs
+1
-4
HeatCellServiceClient.cs
...e/FLY.FilmCasting.AutoDie/Client/HeatCellServiceClient.cs
+14
-1
FlyData_FeedbackHeat.cs
...ie/FLY.FilmCasting.AutoDie/Common/FlyData_FeedbackHeat.cs
+3
-15
IFeedbackHeatService.cs
.../FLY.FilmCasting.AutoDie/IService/IFeedbackHeatService.cs
+0
-5
IHeatCellService.cs
...oDie/FLY.FilmCasting.AutoDie/IService/IHeatCellService.cs
+28
-0
FeedbackHeat.cs
...ng.AutoDie/FLY.FilmCasting.AutoDie/Server/FeedbackHeat.cs
+2
-7
HeatCell.cs
...asting.AutoDie/FLY.FilmCasting.AutoDie/Server/HeatCell.cs
+167
-33
No files found.
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie.UI.Client/PgSetup.xaml
View file @
a3480b55
...
...
@@ -7,8 +7,7 @@
xmlns:misc="clr-namespace:Misc;assembly=MISC"
mc:Ignorable="d"
d:DesignWidth="1024"
Background="WhiteSmoke"
d:DataContext="{d:DesignInstance local:PgSetupVm}">
Background="WhiteSmoke">
<Page.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
...
...
@@ -22,15 +21,16 @@
<local:HeatEffectConverter x:Key="heconv"/>
<local:MaxR2VisConverter x:Key="maxR2VisConv"/>
<local:Id2VisConverter x:Key="id2VisConv"/>
<local:PgSetupVmUt x:Key="viewModel"/>
</ResourceDictionary>
</Page.Resources>
<Grid >
<Grid
d:DataContext="{StaticResource viewModel}"
>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid x:Name="grid_viewModel"/>
<Grid x:Name="grid_viewModel"
/>
<StackPanel Orientation="Horizontal" Background="{StaticResource Brushes.TitleBar.Background}" >
<Button Style="{StaticResource Styles.TitleBar.BackButton2}" Command="BrowseBack"/>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
...
...
@@ -53,7 +53,7 @@
<ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding IsForbidUpDown}"/>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="控制线" />
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="
基本
控制线" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding CtrlLine,StringFormat={}{0:0.#}}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="%" />
...
...
@@ -89,7 +89,20 @@
</StackPanel>
</Border>
<Border Style="{StaticResource Styles.Card.Border}" >
<StackPanel>
<TextBlock Grid.Column="1" Style="{StaticResource Styles.Card.Title}" Text="分级控制"/>
<StackPanel>
<DataGrid AutoGenerateColumns="False" ItemsSource="{Binding LvCtrlLines}" MinWidth="204" MinHeight="100" TextBlock.FontSize="18" TextBlock.FontWeight="Normal">
<DataGrid.Columns>
<DataGridTextColumn Header="控制线%" Binding="{Binding CtrlLine}" Width="150"/>
<DataGridTextColumn Header="厚度混合数" Binding="{Binding Mix}" Width="150"/>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</StackPanel>
</Border>
<Border Style="{StaticResource Styles.Card.Border}">
<StackPanel >
...
...
@@ -118,7 +131,7 @@
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="厚度混合数" />
<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="次" />
...
...
@@ -232,20 +245,20 @@
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal"
DataContext="{Binding HeatBuf}"
>
<StackPanel 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 ThresholdR,StringFormat={}{0:F2}}"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<StackPanel Margin="{StaticResource ControlMargin}"
DataContext="{Binding HeatBuf}"
>
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="稳定性" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding CurrR, StringFormat={}{0:F2}}" />
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<StackPanel Margin="{StaticResource ControlMargin}"
DataContext="{Binding HeatBuf}"
>
<TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="稳定状态" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" Text="{Binding Stability, Converter={StaticResource stableconv}}" />
...
...
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie.UI.Client/PgSetup.xaml.cs
View file @
a3480b55
...
...
@@ -18,6 +18,7 @@ using FLY.FilmCasting.AutoDie.IService;
using
System.ComponentModel
;
using
Unity
;
using
GalaSoft.MvvmLight.Command
;
using
System.Collections.ObjectModel
;
namespace
FLY.FilmCasting.AutoDie.UI.Client
{
...
...
@@ -93,6 +94,11 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
/// 膜距离
/// </summary>
public
double
FilmLength
{
get
;
set
;
}
=
20
;
/// <summary>
/// 分级控制
/// </summary>
public
ObservableCollection
<
LvCtrlLine
>
LvCtrlLines
{
get
;
}
=
new
ObservableCollection
<
LvCtrlLine
>();
#
endregion
#
region
Command
...
...
@@ -137,6 +143,18 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
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
.
HeatCell
,
nameof
(
IHeatCellService
.
CenterTarget
),
this
,
nameof
(
CenterTarget
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
HeatCell
,
nameof
(
IHeatCellService
.
LvCtrlLines
),
()=>
{
LvCtrlLines
.
Clear
();
if
(
this
.
HeatCell
.
LvCtrlLines
==
null
)
return
;
if
(
this
.
HeatCell
.
LvCtrlLines
.
Count
()
==
0
)
return
;
foreach
(
var
lvCtrlLine
in
this
.
HeatCell
.
LvCtrlLines
)
{
LvCtrlLines
.
Add
(
new
LvCtrlLine
()
{
CtrlLine
=
lvCtrlLine
.
CtrlLine
,
Mix
=
lvCtrlLine
.
Mix
});
}
});
Misc
.
BindingOperations
.
SetBinding
(
this
.
HeatCell
,
nameof
(
IHeatCellService
.
Mix
),
this
,
nameof
(
Mix
));
Misc
.
BindingOperations
.
SetBinding
(
this
.
Feedback
,
nameof
(
IFeedbackHeatService
.
Step
),
this
,
nameof
(
Step
));
...
...
@@ -144,7 +162,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
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
));
...
...
@@ -158,7 +176,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
});
Misc
.
BindingOperations
.
SetBinding
(
this
.
HeatBuf
,
nameof
(
IHeatBufService
.
ThresholdR
),
this
,
nameof
(
ThresholdR
));
#
endregion
...
...
@@ -201,10 +219,53 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
}
return
true
;
}
bool
CheckValid_LvCtrlLines
()
{
for
(
int
i
=
0
;
i
<
LvCtrlLines
.
Count
();
i
++)
{
var
lvCtrlLine
=
LvCtrlLines
[
i
];
if
(
lvCtrlLine
.
CtrlLine
>=
CtrlLine
)
{
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
"参数异常"
,
"多级控制 的每级控制线 必须小于 基本控制线"
,
TimeSpan
.
FromSeconds
(
2
));
return
false
;
}
if
(
lvCtrlLine
.
Mix
<=
Mix
)
{
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
"参数异常"
,
"多级控制 的每级厚度混合数 必须大于 基本厚度混合数"
,
TimeSpan
.
FromSeconds
(
2
));
return
false
;
}
if
(
i
+
1
<
LvCtrlLines
.
Count
())
{
var
lvCtrlLine1
=
LvCtrlLines
[
i
+
1
];
if
(
lvCtrlLine
.
CtrlLine
<=
lvCtrlLine1
.
CtrlLine
)
{
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
"参数异常"
,
"多级控制 的每级控制线 必须 从大到小排列"
,
TimeSpan
.
FromSeconds
(
2
));
return
false
;
}
if
(
lvCtrlLine
.
Mix
>=
lvCtrlLine1
.
Mix
)
{
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
"参数异常"
,
"多级控制 的每级混合数 必须 从小到大排列"
,
TimeSpan
.
FromSeconds
(
2
));
return
false
;
}
}
}
return
true
;
}
bool
CheckValid
()
{
if
(
CheckValid_HeatEffectCurve
()
==
false
)
return
false
;
if
(
CheckValid_LvCtrlLines
()==
false
)
return
false
;
if
(
Mix
<
2
)
{
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
...
...
@@ -218,6 +279,8 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
"参数异常"
,
"模头到测厚仪距离<2m"
,
TimeSpan
.
FromSeconds
(
2
));
return
false
;
}
return
true
;
}
...
...
@@ -237,13 +300,29 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
HeatCell
.
MaxHeat
=
this
.
MaxHeat
;
HeatCell
.
RangeOfOffset
=
this
.
RangeOfOffset
;
HeatCell
.
CenterTarget
=
Math
.
Round
(
this
.
CenterTarget
,
1
);
if
(
LvCtrlLines
.
Count
()
>
0
)
{
var
lvCtrlLines
=
new
LvCtrlLine
[
LvCtrlLines
.
Count
()];
for
(
int
i
=
0
;
i
<
LvCtrlLines
.
Count
();
i
++)
{
var
lvCtrlLine
=
LvCtrlLines
[
i
];
lvCtrlLines
[
i
]
=
new
LvCtrlLine
()
{
CtrlLine
=
lvCtrlLine
.
CtrlLine
,
Mix
=
lvCtrlLine
.
Mix
};
}
HeatCell
.
LvCtrlLines
=
lvCtrlLines
;
}
else
{
HeatCell
.
LvCtrlLines
=
null
;
}
HeatCell
.
Mix
=
Mix
;
Feedback
.
Step
=
this
.
Step
;
Feedback
.
HasCheckFilmVelocity
=
this
.
HasCheckFilmVelocity
;
Feedback
.
HasCheck
=
this
.
HasCheck
;
Feedback
.
Delay
=
this
.
Delay
;
Feedback
.
FilmLength
=
FilmLength
;
Feedback
.
Mix
=
Mix
;
...
...
@@ -260,6 +339,36 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
}
}
public
class
PgSetupVmUt
:
PgSetupVm
{
public
PgSetupVmUt
()
{
ThresholdHeatSigma
=
7
;
Step
=
5
;
HasCheckFilmVelocity
=
true
;
HasCheck
=
true
;
Delay
=
60
;
ThresholdSigmaMax
=
4
;
StableRange
=
4
;
HeatEffectCurve
=
new
int
[]
{
2
,
3
,
7
,
3
,
2
};
IsForbidUpDown
=
true
;
CtrlLine
=
5
;
Kp
=
0.8
;
ThresholdR
=
0.7
;
MaxHeat
=
50
;
RangeOfOffset
=
30
;
CenterTarget
=
2
;
Mix
=
3
;
FilmLength
=
12
;
LvCtrlLines
.
Add
(
new
LvCtrlLine
()
{
CtrlLine
=
3
,
Mix
=
6
});
LvCtrlLines
.
Add
(
new
LvCtrlLine
()
{
CtrlLine
=
1
,
Mix
=
100
});
}
}
public
class
HeatEffectConverter
:
IValueConverter
{
#
region
IValueConverter
成员
...
...
@@ -339,22 +448,16 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
return
"等待"
;
case
STABILITY
.
ERROR_NO_ARRIVE
:
return
"等待:加热点还没到达测厚仪"
;
case
STABILITY
.
ERROR_POSITION_NOTSURE
:
return
"等待:位置不能确定"
;
case
STABILITY
.
ERROR_SIGMA_OVERSIZE
:
return
"等待:2σ太大 "
;
case
STABILITY
.
ERROR_ROTATE_CHANGED
:
return
"等待:旋转速度波动大 "
;
case
STABILITY
.
ERROR_PARAM_CHANGED
:
return
"等待:膜
距离旋转角度被改变
"
;
return
"等待:膜
宽变化大于100mm
"
;
case
STABILITY
.
ERROR_THICK_CHANGED
:
return
"等待:厚度均值波动大"
;
case
STABILITY
.
ERROR_CORREL
:
return
"等待:相关性不够"
;
case
STABILITY
.
OK_CORREL
:
return
"稳定:相关性高"
;
case
STABILITY
.
OK_HEAT_AND_THICK_CORREL
:
return
"稳定:加热相关性高"
;
default
:
return
"???"
;
}
...
...
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie.UI.Client/Themes/Styles.xaml
View file @
a3480b55
...
...
@@ -6,6 +6,7 @@
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Converter/Dictionary_MyConv.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/Styles.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/GraphStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.FilmCasting.AutoDie.UI.Client;component/Themes/Colors.xaml"/>
</ResourceDictionary.MergedDictionaries>
...
...
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie.UI.Client/UiModule/AutoDieGraph/AutoDieGraph.xaml
View file @
a3480b55
...
...
@@ -16,7 +16,7 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.FilmCasting.AutoDie.UI.Client;component/Themes/Colors.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.FilmCasting.AutoDie.UI.Client;component/Themes/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<ControlTemplate x:Key="picture_button" TargetType="Button">
<Border Name="border" BorderThickness="1" CornerRadius="5">
...
...
@@ -268,47 +268,108 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
</Grid.RowDefinitions>
<lvc:CartesianChart Hoverable="False" DisableAnimations="True" DataTooltip="{x:Null}" Margin="5,2,2,2"
MouseMove="UIElement_OnMouseMove" MouseDown="UIElement_MouseDown" MouseUp="UIElement_MouseUp">
<lvc:CartesianChart.Series>
<lvc1:Column2Series
<lvc:CartesianChart.Series>
<lvc1:Column2Series
PointGeometry="{x:Null}"
StrokeThickness ="1"
Stroke="Black"
Fill="{StaticResource Brushes.PreHeat}"
Values="{Binding HeatOffsets}"
Configuration="{Binding Mapper}"/>
<lvc:LineSeries
<lvc:LineSeries
PointGeometry="{x:Null}"
StrokeThickness ="3"
Stroke="{StaticResource Brushes.Thick}"
Fill="Transparent"
Values="{Binding ThickPercents}"
Configuration="{Binding MapperThickPercents}"/>
</lvc:CartesianChart.Series>
<lvc:CartesianChart.AxisX>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
</lvc:CartesianChart.Series>
<lvc:CartesianChart.AxisX>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
MinValue="{Binding XMin}" MaxValue="{Binding XMax}"
>
<lvc:Axis.Separator>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step ="5"/>
</lvc:Axis.Separator>
<lvc:Axis.Sections>
<lvc:AxisSection Style="{StaticResource AxisSectionStyle}"
<lvc:Axis.Separator>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step ="5"/>
</lvc:Axis.Separator>
<lvc:Axis.Sections>
<lvc:AxisSection Style="{StaticResource AxisSectionStyle}"
Value="{Binding SelectBoltNo}" SectionWidth="{Binding SelectBoltNoWidth}"
/>
</lvc:Axis.Sections>
</lvc:Axis>
</lvc:Axis.Sections>
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
LabelFormatter="{Binding YFormatter}" FontFamily="Courier New"
MinValue="{Binding YMinOffset}" MaxValue="{Binding YMaxOffset}" >
<lvc:Axis.Separator>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="{Binding YStepOffset}"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
<lvc:Axis.Separator>
<lvc:Separator Stroke="{StaticResource Brushes.AxisSeparator}" Step="{Binding YStepOffset}"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="400*"/>
<ColumnDefinition Width="280*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="2" Grid.RowSpan="2" Panel.ZIndex="1"
Margin="10,0" VerticalAlignment="Top" HorizontalAlignment="Right">
<Viewbox MaxHeight="25">
<StackPanel Margin="{StaticResource ControlMargin}">
<StackPanel.Resources>
<Style TargetType="Viewbox">
<Setter Property="Height" Value="25"/>
<Setter Property="Width" Value="120"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Top"/>
</Style>
</StackPanel.Resources>
<StackPanel Orientation="Horizontal">
<Viewbox >
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TitleStyle}"
Foreground="{StaticResource WhiteBrush}"
Background="{StaticResource TextBrush}"
Opacity="0.8"
Text="混合: "
/>
<TextBlock Style="{StaticResource ValueStyle}"
Foreground="{StaticResource WhiteBrush}"
Background="{StaticResource TextBrush}"
Text="{Binding CurrMix,Mode=OneWay}"
/>
</StackPanel>
</Viewbox>
<Viewbox>
<StackPanel Orientation="Horizontal" >
<TextBlock Style="{StaticResource TitleStyle}"
Foreground="{StaticResource WhiteBrush}"
Background="{StaticResource TextBrush}"
Text=" 2σ: "
/>
<TextBlock Style="{StaticResource ValueStyle}"
Foreground="{StaticResource WhiteBrush}"
Background="{StaticResource TextBrush}"
>
<Run Text="{Binding CurrSigma2,Mode=OneWay, StringFormat={}{0:F1}}"/>%
</TextBlock>
</StackPanel>
</Viewbox>
</StackPanel>
</StackPanel>
</Viewbox>
</Grid>
</Grid>
<lvc:CartesianChart Grid.Row="1" Hoverable="False" DisableAnimations="True" DataTooltip="{x:Null}" Margin="5,2,2,2"
MouseMove="UIElement_OnMouseMove" MouseDown="UIElement_MouseDown" MouseUp="UIElement_MouseUp">
<lvc:CartesianChart.Series>
...
...
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie.UI.Client/UiModule/AutoDieGraph/AutoDieGraphVm.cs
View file @
a3480b55
...
...
@@ -2,6 +2,7 @@
using
GalaSoft.MvvmLight.Command
;
using
LiveCharts
;
using
LiveCharts.Configurations
;
using
Misc
;
using
System
;
using
System.ComponentModel
;
using
System.Linq
;
...
...
@@ -60,6 +61,8 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
/// </summary>
public
int
SelectBoltNoWidth
{
get
;
set
;
}
=
0
;
public
int
CurrMix
{
get
;
protected
set
;
}
=
1
;
public
double
CurrSigma2
{
get
;
protected
set
;
}
=
0
;
public
RelayCommand
AddCmd
{
get
;
private
set
;
}
public
RelayCommand
SubCmd
{
get
;
private
set
;
}
...
...
@@ -201,7 +204,8 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
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
));
Misc
.
BindingOperations
.
SetBinding
(
mHeatCell
,
nameof
(
mHeatCell
.
CurrMix
),
this
,
nameof
(
CurrMix
));
this
.
btnClearH
=
button_clear_h
;
LPress
.
Init
(
btnClearH
);
LPress
.
LongClick
+=
(
s
,
e
)
=>
...
...
@@ -257,7 +261,13 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
{
ThickPercents
.
Clear
();
if
(
mHeatCell
.
ThickPercents
!=
null
)
{
ThickPercents
.
AddRange
(
mHeatCell
.
ThickPercents
);
CurrSigma2
=
mHeatCell
.
ThickPercents
.
Sigma
()
*
2
;
}
else
{
CurrSigma2
=
0
;
}
}
void
DataBindAll_Heats
()
...
...
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie/Client/FeedbackHeatServiceClient.cs
View file @
a3480b55
...
...
@@ -33,10 +33,7 @@ namespace FLY.FilmCasting.AutoDie.Client
/// </summary>
public
double
FilmLength
{
get
;
set
;
}
=
20
;
/// <summary>
/// 测厚仪厚度数据混合数
/// </summary>
public
int
Mix
{
get
;
set
;
}
=
8
;
/// <summary>
/// 检测功能使能
...
...
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie/Client/HeatCellServiceClient.cs
View file @
a3480b55
...
...
@@ -21,6 +21,11 @@ namespace FLY.FilmCasting.AutoDie.Client
/// </summary>
public
double
Kp
{
get
;
set
;
}
=
3
;
/// <summary>
/// 测厚仪厚度数据混合数
/// </summary>
public
int
Mix
{
get
;
set
;
}
=
3
;
/// <summary>
/// 平滑的阀值,只有超出阀值,才平滑
/// </summary>
...
...
@@ -52,6 +57,11 @@ namespace FLY.FilmCasting.AutoDie.Client
/// 中心目标厚度 ,希望生产出来的产品中心比较厚点
/// </summary>
public
double
CenterTarget
{
get
;
set
;
}
/// <summary>
/// 分级控制线
/// </summary>
public
LvCtrlLine
[]
LvCtrlLines
{
get
;
set
;
}
#
endregion
...
...
@@ -94,7 +104,10 @@ namespace FLY.FilmCasting.AutoDie.Client
/// </summary>
public
double
MaxHeatSigma
{
get
;
set
;
}
/// <summary>
/// 当前 thickPercents 混合数
/// </summary>
public
int
CurrMix
{
get
;
set
;
}
=
1
;
#
endregion
#
endregion
...
...
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie/Common/FlyData_FeedbackHeat.cs
View file @
a3480b55
...
...
@@ -42,38 +42,26 @@ namespace FLY.FilmCasting.AutoDie.Common
/// 加热点,还没到达测厚仪。 其它状态都是加热已经起效了,顶多不稳定而已。
/// </summary>
ERROR_NO_ARRIVE
=
-
1
,
/// <summary>
/// 旋转次数太少,位置不能确定
/// </summary>
ERROR_POSITION_NOTSURE
=
-
2
,
/// <summary>
/// 一副数据,Sigma > 15% : 不稳定,变化太大,超出控制范围
/// </summary>
ERROR_SIGMA_OVERSIZE
=
-
3
,
/// <summary>
/// 连续两幅图旋转时间变化 > 10%:不稳定,旋转速度波动大,测量不准确
/// </summary>
ERROR_ROTATE_CHANGED
=
-
4
,
/// <summary>
/// 连续两幅图厚度均值变化 > 10%: 不稳定,厚度波动大
/// </summary>
ERROR_THICK_CHANGED
=
-
5
,
/// <summary>
/// 膜
距离,旋转角度被改变,无法判断
/// 膜
宽变化大于100mm
/// </summary>
ERROR_PARAM_CHANGED
=
-
7
,
/// <summary>
/// 不稳定,不相关
/// </summary>
ERROR_CORREL
=
-
6
,
/// <summary>
/// 加热与厚度差,相关性很高
/// </summary>
OK_HEAT_AND_THICK_CORREL
=
3
,
/// <summary>
/// 加热为0,加热与厚度差,相关性很高
/// </summary>
...
...
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie/IService/IFeedbackHeatService.cs
View file @
a3480b55
...
...
@@ -33,11 +33,6 @@ namespace FLY.FilmCasting.AutoDie.IService
/// </summary>
double
FilmLength
{
get
;
set
;
}
/// <summary>
/// 测厚仪厚度数据混合数
/// </summary>
int
Mix
{
get
;
set
;
}
/// <summary>
/// 有检测功能
/// </summary>
...
...
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie/IService/IHeatCellService.cs
View file @
a3480b55
...
...
@@ -4,6 +4,7 @@ using System.Linq;
using
System.Text
;
using
System.ComponentModel
;
using
System.Collections.ObjectModel
;
using
FObjBase.Reflect
;
namespace
FLY.FilmCasting.AutoDie.IService
{
...
...
@@ -15,6 +16,10 @@ namespace FLY.FilmCasting.AutoDie.IService
/// </summary>
double
Kp
{
get
;
set
;
}
/// <summary>
/// 测厚仪数据混合数
/// </summary>
int
Mix
{
get
;
set
;
}
/// <summary>
/// 输出平滑的阀值,只有超出阀值,才平滑
/// </summary>
...
...
@@ -44,6 +49,12 @@ namespace FLY.FilmCasting.AutoDie.IService
/// 中心目标厚度 ,希望生产出来的产品中心比较厚点
/// </summary>
double
CenterTarget
{
get
;
set
;
}
/// <summary>
/// 分级控制线
/// </summary>
[
PropertyPush
]
LvCtrlLine
[]
LvCtrlLines
{
get
;
set
;
}
#
endregion
#
region
状态
...
...
@@ -56,6 +67,7 @@ namespace FLY.FilmCasting.AutoDie.IService
/// 当前加热策略改变的时间
/// </summary>
DateTime
LastHeatsChangedTime
{
get
;
}
/// <summary>
/// 当前加热策略,必须保证 0~100
/// </summary>
...
...
@@ -76,6 +88,10 @@ namespace FLY.FilmCasting.AutoDie.IService
/// </summary>
double
MaxHeatSigma
{
get
;
}
/// <summary>
/// 当前 thickPercents 混合数
/// </summary>
int
CurrMix
{
get
;
}
#
endregion
#
region
功能
...
...
@@ -122,6 +138,18 @@ namespace FLY.FilmCasting.AutoDie.IService
/// Heats = PreHeats, Offsets = 0, Base = 0
/// </summary>
void
HeatApply
();
#
endregion
}
/// <summary>
/// 分级控制线
/// </summary>
public
class
LvCtrlLine
:
INotifyPropertyChanged
{
public
event
PropertyChangedEventHandler
PropertyChanged
;
public
double
CtrlLine
{
get
;
set
;
}
public
int
Mix
{
get
;
set
;
}
}
}
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie/Server/FeedbackHeat.cs
View file @
a3480b55
...
...
@@ -50,11 +50,6 @@ namespace FLY.FilmCasting.AutoDie.Server
/// </summary>
public
double
FilmLength
{
get
;
set
;
}
=
20
;
/// <summary>
/// 测厚仪厚度数据混合数
/// </summary>
public
int
Mix
{
get
;
set
;
}
=
8
;
/// <summary>
/// 检测功能使能
/// </summary>
...
...
@@ -217,7 +212,7 @@ namespace FLY.FilmCasting.AutoDie.Server
//-------------------------------------------------------------------
//HeatCell
mHeatCell
.
Init
(
mHeatBuf
);
mHeatCell
.
PreHeatApplyEvent
=
(
c
)
=>
{
//有开风机才能加热
...
...
@@ -577,7 +572,7 @@ namespace FLY.FilmCasting.AutoDie.Server
{
//有新数据,向bulkDb获取
bulkDb
.
GetFrame
(
new
Pack_GetFrameRequest
()
{
Id
=
0
,
Mix
=
Mix
},
new
Pack_GetFrameRequest
()
{
Id
=
0
,
Mix
=
mHeatCell
.
Mix
},
(
asyncContext
,
retData
)
=>
{
var
reponse
=
retData
as
Pack_GetFrameReponse
;
...
...
Project.FLY.FilmCasting.AutoDie/FLY.FilmCasting.AutoDie/Server/HeatCell.cs
View file @
a3480b55
...
...
@@ -26,7 +26,10 @@ namespace FLY.FilmCasting.AutoDie.Server
/// </summary>
public
double
Kp
{
get
;
set
;
}
=
1
;
/// <summary>
/// 测厚仪厚度数据混合数
/// </summary>
public
int
Mix
{
get
;
set
;
}
=
3
;
/// <summary>
/// 平滑的阀值,只有超出阀值,才平滑
/// </summary>
...
...
@@ -58,6 +61,11 @@ namespace FLY.FilmCasting.AutoDie.Server
/// 中心目标厚度 ,希望生产出来的产品中心比较厚点
/// </summary>
public
double
CenterTarget
{
get
;
set
;
}
/// <summary>
/// 分级控制线
/// </summary>
public
LvCtrlLine
[]
LvCtrlLines
{
get
;
set
;
}
#
endregion
#
region
状态
...
...
@@ -104,7 +112,10 @@ namespace FLY.FilmCasting.AutoDie.Server
/// </summary>
public
double
MaxHeatSigma
{
get
;
set
;
}
=
0
;
/// <summary>
/// 当前 thickPercents 混合数
/// </summary>
public
int
CurrMix
{
get
;
private
set
;
}
=
1
;
#
endregion
#
endregion
...
...
@@ -120,11 +131,17 @@ namespace FLY.FilmCasting.AutoDie.Server
int
dataBegin
;
int
dataEnd
;
/// <summary>
/// 全部稳定的厚度%数据
/// </summary>
List
<
double
[
]>
thickPercentsCollection
=
new
List
<
double
[
]>
();
public
Func
<
object
,
bool
>
PreHeatApplyEvent
;
public
event
Action
<
object
>
AfterHeatApplyEvent
;
public
event
Action
<
object
>
AfterClearOffsetsEvent
;
public
HeatCell
()
{
if
(!
Load
())
...
...
@@ -195,6 +212,7 @@ namespace FLY.FilmCasting.AutoDie.Server
PreHeats
=
new
double
[
ChannelCnt
];
Offsets
=
new
double
[
ChannelCnt
];
create_thickPercentTargets
();
thickPercentsCollection
.
Clear
();
}
void
create_thickPercentTargets
()
{
...
...
@@ -226,7 +244,15 @@ namespace FLY.FilmCasting.AutoDie.Server
this
.
dataBegin
=
dataBegin
;
this
.
dataEnd
=
dataEnd
;
}
/// <summary>
/// 初始化 分级控制
/// </summary>
void
init_lvCtrl
()
{
}
/// <summary>
/// 自动模式!!!!!
/// </summary>
...
...
@@ -234,42 +260,128 @@ namespace FLY.FilmCasting.AutoDie.Server
{
if
(
mHeatBuf
.
mData
.
Count
()
==
0
)
return
;
//&& mHeatBuf.IsStable()
if
(
mHeatBuf
.
Stability
==
STABILITY
.
OK_CORREL
)
//稳定 与 待定时 加热
if
(
mHeatBuf
.
Stability
!=
STABILITY
.
OK_CORREL
)
//稳定 与 待定时 加热
return
;
double
ctrlLine
=
CtrlLine
;
if
(
IsLvCtrlLinesValid
())
{
//转为 加热棒数量
var
thickPercents
=
ThickPercents
;
double
[]
offsets
=
new
double
[
ChannelCnt
];
for
(
int
i
=
0
;
i
<
ChannelCnt
;
i
++)
for
(
int
i
=
0
;
i
<
LvCtrlLines
.
Count
();
i
++)
{
if
(!
double
.
IsNaN
(
thickPercents
[
i
])
&&
!
double
.
IsNaN
(
thickPercentTargets
[
i
])
&&
mHeatBuf
.
BoltIsStable
[
i
]
&&
//稳定
(
Math
.
Abs
(
thickPercents
[
i
])
>
CtrlLine
))
//在控制线已外
int
index
=
LvCtrlLines
.
Count
()
-
1
-
i
;
if
(
thickPercentsCollection
.
Count
()
>=
LvCtrlLines
[
index
].
Mix
)
{
offsets
[
i
]
=
(
thickPercents
[
i
]
-
thickPercentTargets
[
i
])
*
Kp
;
//保留一位小数
ctrlLine
=
LvCtrlLines
[
index
].
CtrlLine
;
break
;
}
}
}
Offsets
=
offsets
;
UpdatePreHeats
();
//这句一定要加!!!! 不然没法平滑,没法加热
//转为 加热棒数量
var
thickPercents
=
ThickPercents
;
if
(!
IsForbidUpDown
)
//禁止整体上移下降
ModifyBase
();
//自动整体上移下降
double
[]
offsets
=
new
double
[
ChannelCnt
];
for
(
int
i
=
0
;
i
<
ChannelCnt
;
i
++)
{
if
(!
double
.
IsNaN
(
thickPercents
[
i
])
&&
!
double
.
IsNaN
(
thickPercentTargets
[
i
]))
{
double
delta
=
(
thickPercents
[
i
]
-
thickPercentTargets
[
i
]);
double
d
=
Math
.
Abs
(
delta
);
Smooth
();
//平滑,它会导致Offset被修改,<0的都被删除掉
if
(
d
>=
ctrlLine
)
{
HeatApply
();
//执行加热
}
else
if
(
d
>=
ctrlLine
*
2
/
3
)
{
d
=
(
d
-
ctrlLine
*
2
/
3
)
*
2
+
(
ctrlLine
*
1
/
3
);
}
else
if
(
d
>=
ctrlLine
*
1
/
3
)
{
d
=
(
d
-
ctrlLine
*
1
/
3
)
*
1
+
(
ctrlLine
*
0
/
3
);
}
else
{
d
=
0
;
}
double
offset
=
d
*
Kp
;
offsets
[
i
]
=
delta
>=
0
?
offset
:
-
offset
;
}
}
Offsets
=
offsets
;
UpdatePreHeats
();
//这句一定要加!!!! 不然没法平滑,没法加热
if
(!
IsForbidUpDown
)
//禁止整体上移下降
ModifyBase
();
//自动整体上移下降
Smooth
();
//平滑,它会导致Offset被修改,<0的都被删除掉
HeatApply
();
//执行加热
}
public
void
SetThickPercents
(
double
[]
thkpercents
)
{
ThickPercents
=
thkpercents
.
ToArray
();
var
thkPercents
=
thkpercents
.
ToArray
();
if
(
mHeatBuf
.
Stability
!=
STABILITY
.
OK_CORREL
||
IsLvCtrlLinesValid
())
{
//数据非稳定, 清空列表
thickPercentsCollection
.
Clear
();
CurrMix
=
Mix
;
}
else
{
thickPercentsCollection
.
Add
(
thkPercents
);
int
currMix
=
thickPercentsCollection
.
Count
()
+
Mix
-
1
;
int
maxMix
=
LvCtrlLines
.
Max
(
lv
=>
lv
.
Mix
);
if
(
currMix
>
maxMix
)
{
int
removeCnt
=
maxMix
-
currMix
;
thickPercentsCollection
.
RemoveRange
(
0
,
thickPercentsCollection
.
Count
()-
removeCnt
);
currMix
=
maxMix
;
}
//计算均值
if
(
thickPercentsCollection
.
Count
()
>
1
)
{
thkpercents
=
new
double
[
ChannelCnt
];
int
[]
cnts
=
new
int
[
ChannelCnt
];
for
(
int
j
=
0
;
j
<
thickPercentsCollection
.
Count
();
j
++)
{
for
(
int
i
=
0
;
i
<
ChannelCnt
;
i
++)
{
if
(!
double
.
IsNaN
(
thickPercentsCollection
[
j
][
i
]))
{
thkpercents
[
i
]
+=
thickPercentsCollection
[
j
][
i
];
cnts
[
i
]++;
}
}
}
for
(
int
i
=
0
;
i
<
ChannelCnt
;
i
++)
{
if
(
cnts
[
i
]
>
0
)
thkpercents
[
i
]
=
thkpercents
[
i
]
/
cnts
[
i
];
else
thkpercents
[
i
]
=
double
.
NaN
;
}
}
CurrMix
=
currMix
;
}
ThickPercents
=
thkPercents
;
updateThickPercentTargets
();
}
bool
IsLvCtrlLinesValid
()
{
if
(
LvCtrlLines
!=
null
&&
LvCtrlLines
.
Count
()
>
0
&&
LvCtrlLines
.
All
(
lv
=>
lv
!=
null
))
{
return
true
;
}
return
false
;
}
void
updateThickPercentTargets
()
{
...
...
@@ -577,10 +689,15 @@ namespace FLY.FilmCasting.AutoDie.Server
return
;
}
}
bool
isHeatsChanged
=
false
;
bool
isOffsetsChanged
=
false
;
for
(
int
i
=
0
;
i
<
ChannelCnt
;
i
++)
{
Offsets
[
i
]
=
0
;
if
(
Offsets
[
i
]
!=
0
)
{
Offsets
[
i
]
=
0
;
isOffsetsChanged
=
true
;
}
var
h
=
Math
.
Round
(
PreHeats
[
i
],
1
);
...
...
@@ -594,15 +711,24 @@ namespace FLY.FilmCasting.AutoDie.Server
//需要整体调低
h
=
100
;
}
Heats
[
i
]
=
h
;
if
(
Heats
[
i
]
!=
h
)
{
Heats
[
i
]
=
h
;
isHeatsChanged
=
true
;
}
}
NotifyPropertyChanged
(
nameof
(
Offsets
));
NotifyPropertyChanged
(
nameof
(
Heats
));
LastHeatsChangedTime
=
DateTime
.
Now
;
Base
=
0
;
if
(
isOffsetsChanged
)
NotifyPropertyChanged
(
nameof
(
Offsets
));
AfterHeatApplyEvent
?.
Invoke
(
this
);
if
(
isHeatsChanged
)
{
NotifyPropertyChanged
(
nameof
(
Heats
));
LastHeatsChangedTime
=
DateTime
.
Now
;
AfterHeatApplyEvent
?.
Invoke
(
this
);
}
Base
=
0
;
}
/// <summary>
...
...
@@ -618,7 +744,7 @@ namespace FLY.FilmCasting.AutoDie.Server
h
=
100
;
else
if
(
h
<
0
)
h
=
0
;
PreHeats
[
i
]
=
h
;
PreHeats
[
i
]
=
h
;
}
UpdateHeatSigmas
();
NotifyPropertyChanged
(
nameof
(
PreHeats
));
...
...
@@ -694,7 +820,10 @@ namespace FLY.FilmCasting.AutoDie.Server
/// </summary>
public
double
Kp
=
1
;
/// <summary>
/// 测厚仪数据混合数
/// </summary>
public
int
Mix
=
3
;
/// <summary>
/// 自动对位
/// </summary>
...
...
@@ -730,6 +859,11 @@ namespace FLY.FilmCasting.AutoDie.Server
public
double
CenterTarget
=
0
;
/// <summary>
/// 分级控制线
/// </summary>
public
LvCtrlLine
[]
LvCtrlLines
;
#
endregion
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment