Commit 2caca8bf authored by 潘栩锋's avatar 潘栩锋 🚴

添加 内标加热

parent 51fcbec2
......@@ -235,19 +235,6 @@
<ItemGroup>
<Resource Include="Images\checkmark.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\close1.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\download.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\upload.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\connect.png" />
<Resource Include="Images\disconnect.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\up.png" />
</ItemGroup>
......@@ -285,18 +272,7 @@
<Resource Include="Images\cancel.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\add_gray.png" />
<Resource Include="Images\aim_gray.png" />
<Resource Include="Images\cancel_gray.png" />
<Resource Include="Images\close_gray.png" />
<Resource Include="Images\down_gray.png" />
<Resource Include="Images\nurse_gray.png" />
<Resource Include="Images\open_folder_gray.png" />
<Resource Include="Images\previous_gray.png" />
<Resource Include="Images\up_gray.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\checkmark_gray.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Converter\" />
......@@ -321,6 +297,9 @@
<ItemGroup>
<Resource Include="Images\apache_server.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\push_pin.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
......
......@@ -91,8 +91,7 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
<TextBlock Text="设置" />
</StackPanel>
</Button>
<StackPanel Orientation="Horizontal" Grid.Column="1" Visibility="{Binding CheckEnable, Converter={StaticResource visbilityconv},ConverterParameter=HiddenWhenTrue}" >
<StackPanel Orientation="Horizontal" Grid.Column="1" Visibility="{Binding FeedbackHeat.CheckEnable, Converter={StaticResource visbilityconv},ConverterParameter=HiddenWhenTrue}" >
<Button Command="{Binding BaseUpCmd}" >
<StackPanel>
<Image Source="/FLY.FilmCasting.AutoDie.UI.Client;component/Images/up.png"/>
......@@ -200,7 +199,12 @@ xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" xmlns:lvc1="clr
<TextBlock Text="读取" />
</StackPanel>
</Button>
<Button Command="{Binding LocationCmd}" >
<StackPanel>
<Image Source="/FLY.FilmCasting.AutoDie.UI.Client;component/Images/push_pin.png" />
<TextBlock Text="定位" />
</StackPanel>
</Button>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="3">
......
......@@ -60,6 +60,24 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
/// 当前选择加热通道数量
/// </summary>
public int SelectBoltNoWidth { get; set; } = 0;
public RelayCommand AddCmd { get; private set; }
public RelayCommand SubCmd { get; private set; }
public RelayCommand UndoCmd { get; private set; }
public RelayCommand CalCmd { get; private set; }
public RelayCommand BaseUpCmd { get; private set; }
public RelayCommand BaseDownCmd { get; private set; }
public RelayCommand ApplyCmd { get; private set; }
public RelayCommand SaveCmd { get; private set; }
public RelayCommand LoadCmd { get; private set; }
public RelayCommand EnableCmd { get; private set; }
public RelayCommand CheckCmd { get; private set; }
public RelayCommand SmoothCmd { get; private set; }
public RelayCommand ClearCmd { get; private set; }
public RelayCommand LocationCmd { get; private set; }
/// <summary>
/// 长按驱动器
/// </summary>
......@@ -152,9 +170,10 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
CheckCmd = new RelayCommand(Check);
SmoothCmd = new RelayCommand(() => mHeatCell.Smooth());
ClearCmd = new RelayCommand(Clear);
LocationCmd = new RelayCommand(Location);
}
public void Init(
IFeedbackHeatService feedback,
......@@ -285,20 +304,7 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
}
public RelayCommand AddCmd { get; }
public RelayCommand SubCmd { get; }
public RelayCommand UndoCmd { get; }
public RelayCommand CalCmd { get; }
public RelayCommand BaseUpCmd { get; }
public RelayCommand BaseDownCmd { get; }
public RelayCommand ApplyCmd { get; }
public RelayCommand SaveCmd { get; }
public RelayCommand LoadCmd { get; }
public RelayCommand EnableCmd { get; }
public RelayCommand CheckCmd { get; }
public RelayCommand SmoothCmd { get; }
public RelayCommand ClearCmd { get; }
private void Save()
{
......@@ -395,7 +401,10 @@ namespace FLY.FilmCasting.AutoDie.UI.Client.UiModule
}
}
}
private void Location()
{
mFeedback.Location();
}
/// <summary>
/// 设置选择范围。 在ScanMmGraph 中调用
......
......@@ -187,7 +187,13 @@ namespace FLY.FilmCasting.AutoDie.Client
#endregion
/// <summary>
/// 对位加热
/// </summary>
public void Location()
{
Call(nameof(Location));
}
}
}
......@@ -135,6 +135,12 @@ namespace FLY.FilmCasting.AutoDie.IService
/// <param name="filename"></param>
void LoadHeatsFile(string productname);
/// <summary>
/// 对位加热
/// </summary>
void Location();
#region 撤销
/// <summary>
......
......@@ -79,6 +79,7 @@ namespace FLY.FilmCasting.AutoDie.IService
/// 参数应用
/// </summary>
void Apply();
/// <summary>
/// 手动调整加热增量
/// </summary>
......
......@@ -471,8 +471,48 @@ namespace FLY.FilmCasting.AutoDie.Server
resetUndo();
}
//int[] getSingleHeat_100(int channelcnt, int index)
//{
// int[] heats = new int[channelcnt];
// Array.Clear(heats, 0, heats.Count());
// heats[index] = 100;
// return heats;
//}
public void Location()
{
if (lastLcThickHeat == null)
return;
//加热 2/3 位置
int midBoltIndex = (lastLcThickHeat.DataEnd + lastLcThickHeat.DataBegin) / 2;
int dis = (int)((lastLcThickHeat.DataEnd - lastLcThickHeat.DataBegin) * 0.7) / 2;
int boltIndex1 = midBoltIndex - dis;
int boltIndex2 = midBoltIndex + dis; ;
if (boltIndex1 < 0 || boltIndex1 >= ChannelCnt)
return;//异常
if (boltIndex2 < 0 || boltIndex2 >= ChannelCnt)
return;//异常
//定位加热
int[] heats = new int[mHeatCell.ChannelCnt];
Array.Clear(heats, 0, heats.Count());
heats[boltIndex1-1] = 80;
heats[boltIndex1] = 80;
heats[boltIndex1+1] = 80;
heats[boltIndex2 - 1] = 80;
heats[boltIndex2] = 80;
heats[boltIndex2 + 1] = 80;
mHeatCell.ModifyPreHeats(heats);
mHeatCell.HeatApply();
}
void mHeatCell_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
......@@ -681,17 +721,20 @@ namespace FLY.FilmCasting.AutoDie.Server
if (lc_ScanData.Thicks.Count() != ChannelCnt)
return;//非常异常!!!
//检测数据有效性
int invalid_cnt = lc_ScanData.Thicks.Count(
(_d) => { return double.IsNaN(_d); }
);
//工作的螺丝数
int workBolts = lc_ScanData.BoltMapInfo.BoltCnt - (lc_ScanData.BoltMapInfo.LeftEmptyBolts + lc_ScanData.BoltMapInfo.RightEmptyBolts);
//把数据范围外 的全部删除
for (int i = 0; i < lc_ScanData.DataBegin; i++)
lc_ScanData.Thicks[i] = double.NaN;
//if (invalid_cnt > workBolts / 2)//有一半数据都是无效的
// return;
for (int i = lc_ScanData.DataEnd+1; i < ChannelCnt; i++)
lc_ScanData.Thicks[i] = double.NaN;
//检测数据有效性,其中一个无效
for (int i = lc_ScanData.DataBegin; i <= lc_ScanData.DataEnd; i++)
{
if (double.IsNaN(lc_ScanData.Thicks[i]))
return;
}
if (lc_ScanData.FilmVelocity < INVALID_VELOCITY)
{
//速度太慢,异常
......@@ -712,6 +755,8 @@ namespace FLY.FilmCasting.AutoDie.Server
FilmVelocity = lc_ScanData.FilmVelocity,
FilmWidth = lc_ScanData.FilmWidth,
Avg = lc_ScanData.Avg,
DataBegin = lc_ScanData.DataBegin,
DataEnd = lc_ScanData.DataEnd,
Thicks = lc_ScanData.Thicks,
SampleADs = lc_ScanData.SampleADs,
BoltMapInfo = lc_ScanData.BoltMapInfo,
......
......@@ -381,7 +381,6 @@ namespace FLY.FilmCasting.AutoDie.Server
Offsets = offsets;
UpdatePreHeats();
}
#region PreHeats 平滑处理
double[] GetHeatSigmas(int[] heats)
{
......
......@@ -74,43 +74,55 @@ namespace FLY.FilmCasting.AutoDie.Server.Model
[PropertyIndex(12)]
public double Avg { get; set; }
/// <summary>
/// 数据范围 开始
/// </summary>
[PropertyIndex(13)]
public string Thicks { get; set; }
public int DataBegin { get; set; }
/// <summary>
/// 数据范围 结束
/// </summary>
[PropertyIndex(14)]
public string SampleADs { get; set; }
public int DataEnd { get; set; }
[PropertyIndex(15)]
public string Thicks { get; set; }
[PropertyIndex(16)]
public string SampleADs { get; set; }
[PropertyIndex(17)]
public string BoltMapInfo { get; set; }
/// <summary>
/// 膜距离 m
/// </summary>
[PropertyIndex(16)]
[PropertyIndex(18)]
public double FilmLength { get; set; }
/// <summary>
/// 分区表, Thicks 是还没分区前的数据
/// </summary>
[PropertyIndex(17)]
[PropertyIndex(19)]
public string Boltmap { get; set; }
/// <summary>
/// 加热生效
/// </summary>
[PropertyIndex(18)]
[PropertyIndex(20)]
public bool IsStable { get; set; }
/// <summary>
/// 开始改变加热时间
/// </summary>
[PropertyIndex(19)]
[PropertyIndex(21)]
public DateTime HTime { get; set; }
/// <summary>
/// 1幅加热数据 %
/// </summary>
[PropertyIndex(20)]
[PropertyIndex(22)]
public string Heats { get; set; }
}
}
......@@ -53,6 +53,16 @@ namespace FLY.FilmCasting.AutoDie.Server.Model
/// 厚度均值
/// </summary>
public double Avg { get; set; }
/// <summary>
/// 数据范围 开始
/// </summary>
public int DataBegin { get; set; }
/// <summary>
/// 数据范围 结束
/// </summary>
public int DataEnd { get; set; }
public double[] Thicks { get; set; }
......
Subproject commit 998a571336d5903963f36090a026501467e90f68
Subproject commit cabcd8ecbb065fad133c7fb786fb771bfe1c2fe0
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