Commit 9d5a09cf authored by 潘栩锋's avatar 潘栩锋 🚴

添加 追边测厚服务器 添加界面查找辊速信号间隔时间

parent a00f625a
......@@ -51,6 +51,6 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.0.0")]
[assembly: AssemblyFileVersion("7.0.0")]
[assembly: AssemblyVersion("7.0.1")]
[assembly: AssemblyFileVersion("7.0.1")]
[assembly: Guid("D12087A7-EEC4-4D9F-9269-8F20324F4B04")]
......@@ -101,6 +101,9 @@
<DependentUpon>WdPicHistory.xaml</DependentUpon>
</Compile>
<Compile Include="Themes\Colors.cs" />
<Compile Include="WdBlowingDetect.xaml.cs">
<DependentUpon>WdBlowingDetect.xaml</DependentUpon>
</Compile>
<Compile Include="WdSetup.xaml.cs">
<DependentUpon>WdSetup.xaml</DependentUpon>
</Compile>
......@@ -152,6 +155,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="WdBlowingDetect.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="WdSetup.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
......
......@@ -22,6 +22,8 @@
Content="设置" Command="{Binding SetupCmd}"/>
<Button Style="{StaticResource Styles.Button.Square.Accent2}" Width="auto"
Content="图片数据" Command="{Binding PicSetupCmd}"/>
<Button Style="{StaticResource Styles.Button.Square.Accent2}"
Content="调试" Command="{Binding DebugCmd}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="{StaticResource ControlMargin}" >
<StackPanel Margin="{StaticResource ControlMargin}" DataContext="{Binding SysParam}">
......
......@@ -49,11 +49,22 @@ namespace FLY.Thick.Blowing.UI.Fix.Server
public RelayCommand SetupCmd { get; private set; }
public RelayCommand PicSetupCmd { get; private set; }
public RelayCommand DebugCmd { get; private set; }
PicHistory picHistory;
TDGage mGage;
public PgMainVm()
{
SetupCmd = new RelayCommand(Setup);
PicSetupCmd = new RelayCommand(PicSetup);
DebugCmd = new RelayCommand(OpenWdDebug);
}
private void OpenWdDebug()
{
WdBlowingDetect w = new WdBlowingDetect();
w.Init(mGage.gmRenZiJiaFix.mPDetect);
w.ShowDialog();
}
private void PicSetup()
......@@ -66,6 +77,7 @@ namespace FLY.Thick.Blowing.UI.Fix.Server
public void Init(TDGage mGage, PicHistory picHistory)
{
this.mGage = mGage;
SysParam = mGage.sysParam;
InitParam = mGage.initParam;
FlyAd = mGage.flyAd;
......
......@@ -51,6 +51,6 @@ using System.Windows;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.0.0")]
[assembly: AssemblyFileVersion("7.0.0")]
[assembly: AssemblyVersion("7.0.1")]
[assembly: AssemblyFileVersion("7.0.1")]
[assembly: Guid("72FBA808-FA10-43BF-8504-C6E814E031E7")]
<Window x:Class="FLY.Thick.Blowing.UI.Fix.Server.WdBlowingDetect"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FLY.Thick.Blowing.UI.Fix.Server"
mc:Ignorable="d"
Title="WdBlowingDetect" MinHeight="450" MinWidth="400" SizeToContent="WidthAndHeight" >
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid>
<GroupBox Header="辊信号">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Margin="{StaticResource ControlMargin}">
<Button Style="{StaticResource Styles.Button.Square.Accent2}"
Content="获取" Click="btnGetListClick"/>
</StackPanel>
<ListBox Grid.Row="1" x:Name="lb"/>
</Grid>
</GroupBox>
</Grid>
</Window>
using FLY.Thick.Blowing.IService;
using FLY.Thick.Blowing.Server;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace FLY.Thick.Blowing.UI.Fix.Server
{
/// <summary>
/// WdBlowingDetect.xaml 的交互逻辑
/// </summary>
public partial class WdBlowingDetect : Window
{
BlowingDetect blowingDetect;
ObservableCollection<RollCell2> RollList = new ObservableCollection<RollCell2>();
public WdBlowingDetect()
{
InitializeComponent();
this.lb.ItemsSource = RollList;
}
public void Init(BlowingDetect blowingDetect)
{
this.blowingDetect = blowingDetect;
}
private void btnGetListClick(object sender, RoutedEventArgs e)
{
var rollCells = blowingDetect.mRollList.ToList();
RollList.Clear();
//只要最新的100个
RollList.Clear();
for (int i = 0; i < 100 && i < rollCells.Count(); i++)
{
RollList.Add(rollCells[rollCells.Count() - 1 - i]);
}
}
}
}
......@@ -415,7 +415,7 @@ namespace FLY.Thick.Blowing.UI
return false;
}
if ((this.RollPerimeter < 100) || (this.RollPerimeter > 1000))
if ((this.RollPerimeter < 20) || (this.RollPerimeter > 1000))
{
message = "辊周长";
return false;
......
......@@ -304,6 +304,10 @@ namespace FLY.Thick.Blowing.IService
public DateTime Time { get; set; }
public DateTime SysTime { get; set; }
/// <summary>
/// 与上一个时间点的间隔
/// </summary>
public TimeSpan Interval { get; set; }
/// <summary>
/// 角度
/// </summary>
public double Angle { get; set; } = double.NaN;
......@@ -312,7 +316,7 @@ namespace FLY.Thick.Blowing.IService
public override string ToString()
{
return $"{SysTime}";
return $"{SysTime} [{Interval.TotalSeconds}s]";
}
}
......
......@@ -200,7 +200,7 @@ namespace FLY.Thick.Blowing.Server
/// <summary>
/// 辊信号列表,保存一个小时数据
/// </summary>
RList<RollCell2> mRollList;
public RList<RollCell2> mRollList;
/// <summary>
/// 转向信号列表
......@@ -346,7 +346,7 @@ namespace FLY.Thick.Blowing.Server
FilmLength = 25;
}
if ((RollPerimeter < 100) || (RollPerimeter > 1000))
if ((RollPerimeter < 20) || (RollPerimeter > 1000))
{
RollPerimeter = 314;
}
......@@ -580,11 +580,17 @@ namespace FLY.Thick.Blowing.Server
if (status)//1->0 触发!!!
{
TimeSpan interval = TimeSpan.Zero;
if (mRollList.Count() > 0)
{
interval = e.Time - mRollList.Last().SysTime;
}
mRollList.RAdd(
new RollCell2()
{
Time = DateTime.Now,//用于时间定位
SysTime = e.Time,//用于算速度
SysTime = e.Time,//用于算速度,
Interval = interval
});
//触发修正事件!!!!!
......@@ -787,8 +793,24 @@ namespace FLY.Thick.Blowing.Server
int cnt = 5;//5次均值
if (cnt > mRollList.Count)
cnt = mRollList.Count;
//最少2秒
DateTime sysTime2 = mRollList[mRollList.Count - cnt].SysTime;//5次前的sysTime
if (sysTime2 - sysTime1 < TimeSpan.FromSeconds(2))
{
cnt++;
for (;cnt<= mRollList.Count;cnt++) {
sysTime2 = mRollList[mRollList.Count - cnt].SysTime;
if (sysTime2 - sysTime1 >= TimeSpan.FromSeconds(2)) {
break;
}
}
if (cnt > mRollList.Count)
cnt = mRollList.Count;
sysTime2 = mRollList[mRollList.Count - cnt].SysTime;
}
TimeSpan ts_last = TimeSpan.FromTicks((sysTime1 - sysTime2).Ticks / (cnt - 1));//5次的平均滤波, 使用AD盒的时间算出来的时间差,最准
DateTime dt11 = mRollList[mRollList.Count - (cnt - 1)].Time;//4次前的PC时间
......
......@@ -454,7 +454,7 @@ namespace FLY.Thick.BlowingScan.UI.Client
return false;
}
if ((this.RollPerimeter < 100) || (this.RollPerimeter > 1000))
if ((this.RollPerimeter < 20) || (this.RollPerimeter > 1000))
{
message = "辊周长";
return false;
......
{
"InstallZipVersion":"7.0.1",
"InstallZipUrl":"http://server.flyautomation.net:8889/download/和美安装包_v7.0.1_20220415.7z"
"InstallZipUrl":"http://server.flyautomation.net:8889/download/和美安装包_v7.0.1_20220416.7z"
}
\ No newline at end of file
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