Commit 51fcbec2 authored by 潘栩锋's avatar 潘栩锋 🚴

Merge remote-tracking branch 'origin/feature-feng-autoDieGraph-20220409' into dev7.autodie

parents 0ce0c0e1 72a516b2
......@@ -36,7 +36,16 @@
<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.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>
......@@ -88,29 +97,13 @@
<lvc:CartesianChart Height="300" Margin="5,2,2,2"
DisableAnimations="True" Hoverable="False" DataTooltip="{x:Null}" >
<lvc:CartesianChart.Series>
<!--<lvc1:Column2Series
PointGeometry="{x:Null}"
StrokeThickness ="1"
Stroke="Black"
Fill="{StaticResource Brushes.PreHeat}"
Values="{Binding HeatDiffs}"
Configuration="{Binding MapperHeats}"/>-->
<lvc1:Column2Series
<lvc1:Column2Series
PointGeometry="{x:Null}"
StrokeThickness ="1"
Stroke="Black"
Fill="{StaticResource Brushes.PreHeat}"
Values="{Binding HeatDiffEffects}"
Configuration="{Binding MapperHeats}"/>
<!--<lvc:LineSeries
PointGeometry="{x:Null}"
StrokeThickness ="3"
Stroke="{StaticResource Brushes.Heat}"
Fill="Transparent"
Values="{Binding HeatDiffEffects}"
Configuration="{Binding MapperHeats}"/>-->
<lvc:LineSeries
PointGeometry="{x:Null}"
StrokeThickness ="3"
......@@ -136,9 +129,9 @@
<lvc:CartesianChart.AxisY>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
LabelFormatter="{Binding YFormatter}" FontFamily="Courier New"
MinValue="-100" MaxValue="100">
MinValue="{Binding YMinOffset}" MaxValue="{Binding YMaxOffset}">
<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>
</lvc:CartesianChart.AxisY>
......@@ -153,6 +146,20 @@
Command="{Binding ApplyCmd}"/>
<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}" >
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="加热效果" />
<StackPanel Orientation="Horizontal">
......@@ -180,6 +187,21 @@
<iconPacks:PackIconMaterial Kind="ArrowExpandVertical" />
</Button>
</StackPanel>
<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 UniformShrinkPercent,Converter={StaticResource percentconv}}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="%" />
</StackPanel>
</StackPanel>
<Button Style="{StaticResource Styles.Button.Icon.Rectangle}" Command="{Binding UspCollapseCmd}" >
<iconPacks:PackIconMaterial Kind="ArrowCollapseHorizontal" />
</Button>
<Button Style="{StaticResource Styles.Button.Icon.Rectangle}" Command="{Binding UspExpandCmd}" >
<iconPacks:PackIconMaterial Kind="ArrowExpandHorizontal" />
</Button>
</StackPanel>
</WrapPanel>
</WrapPanel>
</Grid>
......
......@@ -22,6 +22,13 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
#region 图表控制
public Func<double, string> YFormatter { get; private 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
......@@ -43,6 +50,11 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
/// 比例因子
/// </summary>
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>
/// 复位区号
......@@ -95,14 +107,18 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
#endregion
public RelayCommand KpCollapseCmd { get; }
public RelayCommand KpExpandCmd { get; }
public RelayCommand KpCollapseCmd { get; private set; }
public RelayCommand KpExpandCmd { get; private set; }
public RelayCommand ApplyCmd { get; private set; }
public RelayCommand ApplyCmd { get; }
public RelayCommand TestMapCmd { get; private set; }
public RelayCommand TestMapCmd { get; }
public RelayCommand DelMapCmd { get; private set; }
public RelayCommand UspCollapseCmd { get; private set; }
public RelayCommand UspExpandCmd { get; private set; }
public RelayCommand DelMapCmd { get; }
public UcThickHeatVm[] ucThickHeatVms;
......@@ -140,7 +156,8 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
KpCollapseCmd = new RelayCommand(KpCollapse);
KpExpandCmd = new RelayCommand(KpExpand);
UspCollapseCmd = new RelayCommand(UspCollapse);
UspExpandCmd = new RelayCommand(UspExpand);
ApplyCmd = new RelayCommand(Apply);
TestMapCmd = new RelayCommand(TestMap);
DelMapCmd = new RelayCommand(DelMap);
......@@ -163,6 +180,14 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
this.heatCell, nameof(this.heatCell.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(
this.heatBuf, nameof(this.heatBuf.HeatEffectCurve),
this, nameof(HeatEffectCurve));
......@@ -188,8 +213,12 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
for (int i = 0; i < 2; i++)
{
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(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;
}
......@@ -204,13 +233,20 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
}
private void PgHeatAnalyseVm_FrameUpdated()
private void PgHeatAnalyseVm_FrameUpdated(object sender)
{
if (sender == ucThickHeatVms[1])
{
var ucThickHeatVm = ucThickHeatVms[1];
if (ucThickHeatVm.frame !=null && ucThickHeatVm.frame.BoltMapInfo!=null)
UniformShrinkPercent = ucThickHeatVm.frame.BoltMapInfo.UniformShrinkPercent;
}
UpdateD();
}
string[] propertyNames_updateD = new string[] {
nameof(Kp), nameof(HeatEffectCurve), nameof(IsUsedMap) };
nameof(Kp), nameof(HeatEffectCurve), nameof(IsUsedMap), nameof(UniformShrinkPercent) };
private void PgHeatAnalyseVm_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (propertyNames_updateD.Contains(e.PropertyName))
......@@ -277,7 +313,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
public double kp;
}
CallDiffResult CalDiff(IEnumerable<BoltMapCell> boltmap, IEnumerable<double> heatEffectCurve)
CallDiffResult CalDiff(IEnumerable<BoltMapCell> boltmap, double uniformShrinkPercent,IEnumerable<double> heatEffectCurve)
{
if (!IsValid())
{
......@@ -286,10 +322,10 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
}
CallDiffResult result = new CallDiffResult();
double[] thickpercents0 = ucThickHeatVms[0].GetThickPercents(boltmap);
double[] thickpercents0 = ucThickHeatVms[0].GetThickPercents(boltmap, uniformShrinkPercent);
int[] heats0 = ucThickHeatVms[0].GetHeats();
double[] thickpercents1 = ucThickHeatVms[1].GetThickPercents(boltmap);
double[] thickpercents1 = ucThickHeatVms[1].GetThickPercents(boltmap, uniformShrinkPercent);
int[] heats1 = ucThickHeatVms[1].GetHeats();
int channelCnt = feedback.ChannelCnt;
......@@ -333,7 +369,10 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
HeatDiffs.Clear();
HeatDiffEffects.Clear();
var result = CalDiff(IsUsedMap ? BoltMap.ToArray() : null, HeatEffectCurve == null ? null : HeatEffectCurve.Select(d => (double)d));
var result = CalDiff(
IsUsedMap ? BoltMap.ToArray() : null,
UniformShrinkPercent,
HeatEffectCurve == null ? null : HeatEffectCurve.Select(d => (double)d));
if (result != null)
{
......@@ -360,6 +399,17 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
private void TestMap()
{
var list = BoltMap.ToList();
list.Sort((b1, b2) =>
{
return b1.OldNo.CompareTo(b2.OldNo);
});
BoltMap.Clear();
foreach (var b in list)
BoltMap.Add(b);
if (!checkValid_map())
{
FLY.ControlLibrary.Window_WarningTip.Show("异常", "分区表格式出错");
......@@ -473,6 +523,20 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
if (!WdPassword.Authorize("AutoDie"))
return;
var ucThickHeatVm = ucThickHeatVms[1];
if (ucThickHeatVm.frame != null && ucThickHeatVm.frame.BoltMapInfo != null)
{
if (UniformShrinkPercent != ucThickHeatVm.frame.BoltMapInfo.UniformShrinkPercent)
{
//收缩率被修改,请到产品界面 设置
FLY.ControlLibrary.Window_WarningTip.Show("警告","收缩率被修改,请到产品界面 设置", TimeSpan.FromSeconds(2));
return;
}
}
if (IsUsedMap && BoltMap.Count() > 0)
{
this.heatBuf.Boltmap = BoltMap.ToArray();
......@@ -488,6 +552,8 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
heatBuf.Apply();
heatCell.Kp = Kp;
heatCell.MaxHeat = MaxHeat;
heatCell.RangeOfOffset = RangeOfOffset;
heatCell.Apply();
FLY.ControlLibrary.Window_Tip.Show("通知", "应用成功", TimeSpan.FromSeconds(2));
......@@ -505,5 +571,15 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
if (Kp > 0.2)
Kp -= 0.1;
}
private void UspCollapse()
{
UniformShrinkPercent -= 0.01;
}
private void UspExpand()
{
UniformShrinkPercent += 0.01;
}
}
}
......@@ -63,9 +63,9 @@
<lvc:CartesianChart.AxisY>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
LabelFormatter="{Binding YFormatter}" FontFamily="Courier New"
MinValue="0" MaxValue="100">
MinValue="{Binding YMin}" MaxValue="{Binding YMax}">
<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>
</lvc:CartesianChart.AxisY>
......@@ -132,9 +132,9 @@
<TextBlock Style="{StaticResource Text.FieldContent2}" Text="未起效" Foreground="Red" Visibility="{Binding IsStable,Converter={StaticResource visbilityconv}, ConverterParameter=HiddenWhenTrue}"/>
</StackPanel>
</StackPanel>
<!--<StackPanel Orientation="Horizontal" Visibility="{Binding IsVaild,Converter={StaticResource visbilityconv}}">
<StackPanel Orientation="Horizontal" Visibility="{Binding IsVaild,Converter={StaticResource visbilityconv}}">
<StackPanel Orientation="Horizontal" Background="{StaticResource Badges.Background}" Margin="{StaticResource Badges.Margin}">
<!--<StackPanel Orientation="Horizontal" Background="{StaticResource Badges.Background}" Margin="{StaticResource Badges.Margin}">
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="左无效:" />
<TextBlock Style="{StaticResource Text.FieldContent2}" Text="{Binding LeftEmptyBolts}" />
<TextBlock Style="{StaticResource Text.FieldContentMm2}" Text="螺丝"/>
......@@ -143,17 +143,17 @@
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="右无效:" />
<TextBlock Style="{StaticResource Text.FieldContent2}" Text="{Binding RightEmptyBolts}" />
<TextBlock Style="{StaticResource Text.FieldContentMm2}" Text="螺丝"/>
</StackPanel>
</StackPanel>-->
<StackPanel Orientation="Horizontal" Background="{StaticResource Badges.Background}" Margin="{StaticResource Badges.Margin}">
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="收缩率:" />
<TextBlock Style="{StaticResource Text.FieldContent2}" Text="{Binding UniformShrinkPercent,StringFormat={}{0:P1}}" />
<TextBlock Style="{StaticResource Text.FieldContent2}" Text="{Binding CurrUsp,StringFormat={}{0:P1}}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Background="{StaticResource Badges.Background}" Margin="{StaticResource Badges.Margin}">
<!--<StackPanel Orientation="Horizontal" Background="{StaticResource Badges.Background}" Margin="{StaticResource Badges.Margin}">
<TextBlock Style="{StaticResource Text.FieldHeader2}" Text="偏移:" />
<TextBlock Style="{StaticResource Text.FieldContent2}" Text="{Binding MidOffset}" />
<TextBlock Style="{StaticResource Text.FieldContentMm2}" Text="mm"/>
</StackPanel>
</StackPanel>-->
</StackPanel>-->
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
......
......@@ -23,6 +23,11 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
#region 图表控制
public Func<double, string> YFormatter { get; protected set; }
public int XMax { get; set; } = 88;
public double YMax => MaxHeat;
public double YMin => 0;
public double YStep => MaxHeat / 10;
#endregion
/// <summary>
......@@ -32,6 +37,16 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
public ChartValues<int> Heats { get; } = new ChartValues<int>();
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; }
......@@ -91,6 +106,10 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
/// </summary>
public double FilmWidth { get; set; }
/// <summary>
/// 当前收缩率
/// </summary>
public double CurrUsp { get; set; }
/// <summary>
/// 纵向速度
/// </summary>
......@@ -140,7 +159,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
})
.Y((value) =>
{
return value * Kp + 50;
return value * Kp + MaxHeat /2 ;
});
PreCmd = new RelayCommand(Pre);
......@@ -150,16 +169,34 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
NewestCmd = new RelayCommand(Newest);
}
public void Init(string title,
IBulkDbService bulkDbService,
int number)
{
this.bulkDbService = bulkDbService;
Title = title;
Misc.BindingOperations.SetBinding(bulkDbService, nameof(bulkDbService.LastId), this, nameof(LastId));
Number = number;
UpdateFrame();
this.PropertyChanged += UcThickHeatVm_PropertyChanged;
}
public void Init(string title,
IBulkDbService bulkDbService,
int number, double kp)
int number, double kp, int maxHeat)
{
this.bulkDbService = bulkDbService;
Title = title;
Kp = kp;
MaxHeat = maxHeat;
Misc.BindingOperations.SetBinding(bulkDbService, nameof(bulkDbService.LastId), this, nameof(LastId));
Number = number;
UpdateFrame();
......@@ -178,12 +215,12 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
UpdateFrame();
}
}
public event Action FrameUpdated;
public event Action<object> FrameUpdated;
public void UpdateFrame()
{
PollModule.Current.Poll_JustOnce(() =>
{
_updateFrame();
bulkDbService.GetFrame(Number, my_GetFrameReponse, null);
}, this, MARKNO_UPDATEFRAME);
}
......@@ -199,6 +236,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
EndTime = frame.EndTime;
FilmWidth = frame.FilmWidth;
FilmVelocity = frame.FilmVelocity;
CurrUsp = frame.BoltMapInfo.UniformShrinkPercent;
Average = frame.Thicks.AverageNoNull();
Sigma2Percent = frame.Thicks.Sigma() / Average * 2;
......@@ -225,31 +263,9 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
IsVaild = false;
}
FrameUpdated?.Invoke();
FrameUpdated?.Invoke(this);
}
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()
{
if (Number < bulkDbService.LastId)
......@@ -259,14 +275,14 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
{
Number--;
}
bool IsGetStableFrame;
bool IsPre;
bool IsSkipNumberChanged;
private void NextStable()
{
IsGetStableFrame = true;
IsPre = false;
Number++;
PollModule.Current.Poll_JustOnce(() =>
{
bulkDbService.GetFrameAdv(Number, false, IsMoveByTakeEffect, IsMoveByDiffCTime, my_GetFrameReponse, null);
}, this, MARKNO_UPDATEFRAME);
}
private void Newest()
{
......@@ -274,18 +290,28 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
}
private void PreStable()
{
IsGetStableFrame = true;
IsPre = true;
Number--;
PollModule.Current.Poll_JustOnce(() =>
{
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(this);
}
/// <summary>
/// 以指定分区表 导出厚度%
/// </summary>
/// <param name="boltmap">分区表</param>
/// <returns></returns>
public double[] GetThickPercents(IEnumerable<BoltMapCell> boltmap)
public double[] GetThickPercents(IEnumerable<BoltMapCell> boltmap, double uniformShrinkPercent)
{
if (frame == null)
return null;
......@@ -294,20 +320,26 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
double[] thks_x10 = FLY.FilmCasting.AutoDie.Common.MyMath.ZoomIn(thks, 10);
//偏移量
//int midOffsetIdx_x10 = (int)(frame.BoltMapInfo.MidOffset / (frame.BoltMapInfo.BoltWidth * (1 - frame.BoltMapInfo.UniformShrinkPercent)) * 10);
int midOffsetIdx_x10 = (int)(frame.BoltMapInfo.MidOffset / (frame.BoltMapInfo.BoltWidth * (1 - frame.BoltMapInfo.UniformShrinkPercent)) * 10);
//计算 thks_x10 中间的螺丝序号
//int r_l = frame.BoltMapInfo.RightEmptyBolts - frame.BoltMapInfo.LeftEmptyBolts;
//int midBoltIdx_x10 = 10 * (frame.BoltMapInfo.BoltCnt - r_l * 2) / 2;
int r_l = frame.BoltMapInfo.RightEmptyBolts - frame.BoltMapInfo.LeftEmptyBolts;
int midBoltIdx_x10 = 10 * (frame.BoltMapInfo.BoltCnt - r_l * 2) / 2;
//偏移后
//midBoltIdx_x10 += midOffsetIdx_x10;
midBoltIdx_x10 += midOffsetIdx_x10;
//收缩率 =0,每个分区,就是原始螺丝宽度25.4mm
//收缩率 =10%, 每个分区,就是原始螺丝宽度25.4mm * (100%-10%), 由于 分区是固定了,所以看起来图会横向拉宽了 新数据是原来的 100%/(100%-10%) 倍
//收缩率 =-10%, 每个分区,就是原始螺丝宽度25.4mm * (100%+10%), 由于 分区是固定了,所以看起来图会横向收窄了 新数据是原来的 100%/(100%+10%) 倍
//if (Math.Abs(frame.BoltMapInfo.UniformShrinkPercent - uniformShrinkPercent) > 0.01) //大于1%以上
//{
// //放大
// thks_x10 = FLY.FilmCasting.AutoDie.Common.MyMath.ZoomX(thks_x10, midBoltIdx_x10, uniformShrinkPercent / frame.BoltMapInfo.UniformShrinkPercent);
//}
if (Math.Abs(frame.BoltMapInfo.UniformShrinkPercent - uniformShrinkPercent) > 0.01) //大于1%以上
{
//放大
double scale =(1 - frame.BoltMapInfo.UniformShrinkPercent) / (1 - uniformShrinkPercent);
//所以需要新数据 比原来要横向拉宽 scale倍 新的 收缩率 = uniformShrinkPercent = 1 - ((1 - frame.BoltMapInfo.UniformShrinkPercent)/scale)
thks_x10 = FLY.FilmCasting.AutoDie.Common.MyMath.ZoomX(thks_x10, midBoltIdx_x10, scale);
}
//新的偏移量
//int midOffsetIdx_new_x10 = (int)(midOffset / (frame.BoltMapInfo.BoltWidth * (1 - frame.BoltMapInfo.UniformShrinkPercent)) * 10.0);
......@@ -350,7 +382,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
public double[] GetThickPercents()
{
//return GetThickPercents(frame.BoltMapInfo.UniformShrinkPercent, frame.BoltMapInfo.MidOffset, frame.Boltmap);
return GetThickPercents(frame.Boltmap);
return GetThickPercents(frame.Boltmap, frame.BoltMapInfo.UniformShrinkPercent);
}
public int[] GetHeats()
{
......
......@@ -52,7 +52,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
ScanDataId = 1121;
FilmWidth = 2130;
FilmVelocity = 30.2;
CurrUsp = 0;
Average = datas.AverageNoNull();
Sigma2Percent = datas.Sigma() / Average * 2;
......
......@@ -95,6 +95,13 @@
<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}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="步进" />
......
......@@ -73,7 +73,12 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
/// <summary>
/// 最大功率
/// </summary>
public int MaxHeat { get; set; }
public int MaxHeat { get; set; } = 100;
/// <summary>
/// 偏移量界面的显示范围
/// </summary>
public int RangeOfOffset { get; set; } = 50;
/// <summary>
/// 混合数
......@@ -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.Kp), this, nameof(Kp));
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.HasCheck), this, nameof(HasCheck));
......@@ -223,7 +229,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client
HeatCell.CtrlLine = this.CtrlLine;
HeatCell.Kp = this.Kp;
HeatCell.MaxHeat = this.MaxHeat;
HeatCell.RangeOfOffset = this.RangeOfOffset;
Feedback.Step=this.Step;
Feedback.HasCheckFilmVelocity=this.HasCheckFilmVelocity;
......
......@@ -51,7 +51,7 @@ using System.Windows;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.0.0.0")]
[assembly: AssemblyFileVersion("7.0.0.0")]
[assembly: AssemblyVersion("7.0.1.0")]
[assembly: AssemblyFileVersion("7.0.1.0")]
[assembly: Guid("281B0472-B641-4FA9-BF3B-5180E745AEFC")]
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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 Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>
......@@ -54,4 +53,24 @@
<SolidColorBrush x:Key="Badges.AccentBackground">#99008BE5</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>
\ No newline at end of file
......@@ -50,11 +50,11 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
</ResourceDictionary>
</UserControl.Resources>
<Border Style="{StaticResource BorderStyle_module}" >
<Border Style="{StaticResource Styles.Module.Border}" >
<Grid Name="grid" d:DataContext="{StaticResource viewModel}">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="258*" />
<RowDefinition />
</Grid.RowDefinitions>
<Border Background="#F0579aab" Height="20" VerticalAlignment="Top" CornerRadius="3,3,0,0"/>
<Grid>
......@@ -279,13 +279,6 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
Fill="Transparent"
Values="{Binding ThickPercents}"
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.AxisX>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
......@@ -304,10 +297,10 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
LabelFormatter="{Binding YFormatter}"
MinValue="-50" MaxValue="50" FontFamily="Courier New" >
LabelFormatter="{Binding YFormatter}" FontFamily="Courier New"
MinValue="{Binding YMinOffset}" MaxValue="{Binding YMaxOffset}" >
<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>
</lvc:CartesianChart.AxisY>
......@@ -349,9 +342,9 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
<lvc:CartesianChart.AxisY>
<lvc:Axis Foreground="{StaticResource Brushes.AxisLabel}"
LabelFormatter="{Binding YFormatter}"
MinValue="0" MaxValue="100" FontFamily="Courier New" >
MinValue="{Binding YMin}" MaxValue="{Binding YMax}" FontFamily="Courier New">
<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>
</lvc:CartesianChart.AxisY>
......
......@@ -20,6 +20,14 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
public Func<double, string> YFormatter { get; private set; }
public double XMax { 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
/// <summary>
......@@ -37,12 +45,13 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
[PropertyChanged.DependsOn(nameof(Kp))]
public object MapperThickPercents { get; private set; }
[PropertyChanged.DependsOn(nameof(Kp))]
public object MapperThickPercentsWithIsStable { 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;
/// <summary>
/// 当前选择加热通道
/// </summary>
......@@ -75,7 +84,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
YFormatter = (y) =>
{
string text = y + "%";
string text = Math.Round(y) + "%";
return $"{text,6}";
};
......@@ -117,23 +126,6 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
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>()
.X((value, index) =>
......@@ -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.MaxHeat), this, nameof(MaxHeat));
Misc.BindingOperations.SetBinding(mHeatCell, nameof(mHeatCell.RangeOfOffset), this, nameof(RangeOfOffset));
this.btnClearH = button_clear_h;
LPress.Init(btnClearH);
......
......@@ -51,7 +51,7 @@ using System.Windows;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.0.2.0")]
[assembly: AssemblyFileVersion("7.0.2.0")]
[assembly: AssemblyVersion("7.0.5.0")]
[assembly: AssemblyFileVersion("7.0.5.0")]
[assembly: Guid("CC6F2BB4-E648-47BE-8223-B6157E35403D")]
......@@ -42,6 +42,12 @@ namespace FLY.FilmCasting.AutoDie.Client
/// 最大加热量 默认100%
/// </summary>
public int MaxHeat { get; set; }
/// <summary>
/// 偏移量界面的显示范围
/// </summary>
public int RangeOfOffset { get; set; }
#endregion
......
......@@ -957,22 +957,30 @@ namespace FLY.FilmCasting.AutoDie.Common
for (int i = 0; i < map.Count(); i++)
{
//第0组
int old_idx0 = map.Keys.ElementAt(i);
int new_idx0 = map[old_idx0];
int old_idx1 = map.Keys.ElementAt(i);
int new_idx1 = map[old_idx1];
if (i == 0)
{
MapX(data, data_new, 0, 0, old_idx0, new_idx0);
MapX(data, data_new, 0, 0, old_idx1, new_idx1);
}
else if(i== map.Count()-1)
{
MapX(data, data_new, old_idx0, new_idx0, data.Count()-1, data.Count() - 1);
{
//最后一组
int old_idx0 = map.Keys.ElementAt(i - 1);
int new_idx0 = map[old_idx0];
MapX(data, data_new, old_idx0, new_idx0, old_idx1, new_idx1);
//后面的
MapX(data, data_new, old_idx1, new_idx1, data.Count()-1, data.Count() - 1);
}
else
{
//第1组
int old_idx1 = map.Keys.ElementAt(i+1);
int new_idx1 = map[old_idx1];
int old_idx0 = map.Keys.ElementAt(i-1);
int new_idx0 = map[old_idx0];
MapX(data, data_new, old_idx0, new_idx0, old_idx1, new_idx1);
}
......
......@@ -31,10 +31,15 @@ namespace FLY.FilmCasting.AutoDie.IService
int CtrlLine { get; set; }
/// <summary>
/// 最大加热量 默认100%
/// 最大加热量 默认100%, 也是 当前量界面的显示范围
/// </summary>
int MaxHeat { get; set; }
/// <summary>
/// 偏移量界面的显示范围
/// </summary>
int RangeOfOffset { get; set; }
#endregion
#region 状态
......
......@@ -689,8 +689,8 @@ namespace FLY.FilmCasting.AutoDie.Server
//工作的螺丝数
int workBolts = lc_ScanData.BoltMapInfo.BoltCnt - (lc_ScanData.BoltMapInfo.LeftEmptyBolts + lc_ScanData.BoltMapInfo.RightEmptyBolts);
if (invalid_cnt > workBolts / 2)//有一半数据都是无效的
return;
//if (invalid_cnt > workBolts / 2)//有一半数据都是无效的
// return;
if (lc_ScanData.FilmVelocity < INVALID_VELOCITY)
{
......
......@@ -24,7 +24,7 @@ namespace FLY.FilmCasting.AutoDie.Server
/// <summary>
/// HeatOffset = ThickPercent * Kp
/// </summary>
public double Kp { get; set; } = 3;
public double Kp { get; set; } = 1;
/// <summary>
......@@ -49,7 +49,10 @@ namespace FLY.FilmCasting.AutoDie.Server
/// 最大加热量 默认100%
/// </summary>
public int MaxHeat { get; set; } = 100;
/// <summary>
/// 偏移量界面的显示范围
/// </summary>
public int RangeOfOffset { get; set; } = 50;
#endregion
#region 状态
......@@ -122,9 +125,9 @@ namespace FLY.FilmCasting.AutoDie.Server
}
void checkParamErr()
{
if (Kp < 1 || Kp > 10)
if (Kp < 0.2 || Kp > 10)
{
Kp = 3;
Kp = 1;
}
if (ThresholdHeatSigma < 1 || ThresholdHeatSigma > 50)
......@@ -136,6 +139,7 @@ namespace FLY.FilmCasting.AutoDie.Server
{
CtrlLine = 2;
}
}
public void Init(HeatBuf heatBuf)
{
......@@ -611,7 +615,7 @@ namespace FLY.FilmCasting.AutoDie.Server
/// <summary>
/// HeatOffset = ThickPercent * Kp
/// </summary>
public double Kp = 3;
public double Kp = 1;
/// <summary>
......@@ -624,6 +628,11 @@ namespace FLY.FilmCasting.AutoDie.Server
/// </summary>
public int MaxHeat = 100;
/// <summary>
/// 偏移量界面的显示范围
/// </summary>
public int RangeOfOffset = 50;
/// <summary>
/// 平滑的阀值,只有超出阀值,才平滑
/// </summary>
......
......@@ -51,6 +51,6 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.5.5.0")]
[assembly: AssemblyFileVersion("7.5.5.0")]
[assembly: AssemblyVersion("7.5.7.0")]
[assembly: AssemblyFileVersion("7.5.7.0")]
[assembly: Guid("BD20A921-953E-44CA-8FAB-4619D3CBCD06")]
......@@ -51,6 +51,6 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.3.5")]
[assembly: AssemblyFileVersion("7.3.5")]
[assembly: AssemblyVersion("7.3.6")]
[assembly: AssemblyFileVersion("7.3.6")]
[assembly: Guid("E7D930E0-C871-4001-A31A-DC748ED5817C")]
......@@ -133,7 +133,7 @@ fi
# 进入安装包内 用7z压缩
cd ${install_dir_root}
"C:\Program Files (x86)\7-Zip\7z.exe" a ../${fileName7z} ./*
"C:\Program Files\7-Zip\7z.exe" a ../${fileName7z} ./*
cd ..
......
{
"InstallZipVersion":"7.5.5",
"InstallZipUrl":"http://server.flyautomation.net:8889/download/流延测厚仪安装包_v7.5.5_20220308.7z"
"InstallZipVersion":"7.5.7",
"InstallZipUrl":"http://server.flyautomation.net:8889/download/流延测厚仪安装包_v7.5.7_20220510.7z"
}
\ No newline at end of file
# 流延测厚仪安装包_v7.5.6_20220411
## 流延测厚仪服务器 v7.3.6
## 流延测厚仪客户端 v7.5.6
## 自动模头服务器 v7.0.3
## 称重服务器 v7.0.0
## 数据浏览器 v7.0.0
## LP3 v3.0.0
## 软件管理器 v0.9.1
<br/>
<br/>
<br/>
# 流延测厚仪安装包_v7.5.5_20220308
## 流延测厚仪服务器 v7.3.5
## 流延测厚仪客户端 v7.5.5
1. 添加 支持称重, 支持自动模头
2. 修复 即时图 Y轴 公差没有与产品不一致
......@@ -7,8 +29,6 @@
## 自动模头服务器 v7.0.0
## 称重服务器 v7.0.0
## 流延测厚仪服务器 v7.3.5
## 数据浏览器 v7.0.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