Commit cde056df authored by 潘栩锋's avatar 潘栩锋 🚴

添加 追边测厚仪支持 用编码器测量旋转位置

parent ab1a5771
......@@ -324,6 +324,10 @@
</TextBlock>
</StackPanel>
</StackPanel>
<StackPanel Margin="5" >
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="使用编码器测量旋转" />
<ToggleButton Style="{StaticResource ToggleButtonStyle1}" HorizontalAlignment="Left" IsChecked="{Binding IsUsedEncoder}"/>
</StackPanel>
......
......@@ -113,7 +113,7 @@ namespace FLY.Thick.Blowing.UI.Fix.Client
/// 当人字架复位时,探头在右边
/// </summary>
public bool IsProbeRight { get; set; } = true;
public bool IsUsedEncoder { get; set; } = false;
/// <summary>
/// 分区1号 对应时钟的位置 1 ~ 12
/// </summary>
......@@ -174,6 +174,8 @@ namespace FLY.Thick.Blowing.UI.Fix.Client
Misc.BindingOperations.SetBinding(bDetect, nameof(bDetect.Is3D), this, nameof(Is3D));
Misc.BindingOperations.SetBinding(renZiJiaService, nameof(renZiJiaService.IsProbeRight), this, nameof(IsProbeRight));
Misc.BindingOperations.SetBinding(renZiJiaService, nameof(renZiJiaService.IsUsedEncoder), this, nameof(IsUsedEncoder));
Misc.BindingOperations.SetBinding(renZiJiaService, nameof(renZiJiaService.ChannelCnt), this, nameof(ChannelCnt));
Misc.BindingOperations.SetBinding(renZiJiaService, nameof(renZiJiaService.BPC), this, nameof(BPC));
Misc.BindingOperations.SetBinding(renZiJiaService, nameof(renZiJiaService.OrgBoltNo), this, nameof(OrgBoltNo));
......@@ -326,6 +328,7 @@ namespace FLY.Thick.Blowing.UI.Fix.Client
renZiJiaService.OrgBoltNo=this.OrgBoltNo;
renZiJiaService.IsUsedMap=this.IsUsedMap;
renZiJiaService.IsProbeRight = this.IsProbeRight;
renZiJiaService.IsUsedEncoder = this.IsUsedEncoder;
renZiJiaService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功",
......@@ -373,7 +376,7 @@ namespace FLY.Thick.Blowing.UI.Fix.Client
message = "加热通道数";
return false;
}
if (this.BPC < 1 || this.BPC > 4)
if (this.BPC < 1 || this.BPC > 10)
{
message = "分区数/加热通道数";
return false;
......
......@@ -57,7 +57,7 @@ namespace FLY.Thick.Blowing.Client
/// </summary>
public BlowingType BType { get; set; }
public bool IsProbeRight { get; set; }
public bool IsUsedEncoder { get; set; }
#endregion
/// <summary>
......
......@@ -53,6 +53,11 @@ namespace FLY.Thick.Blowing.IService
/// </summary>
BlowingType BType { get; }
/// <summary>
/// 使用编码器测量旋转架位置
/// </summary>
bool IsUsedEncoder { get; set; }
/// <summary>
/// 参数应用
/// </summary>
......
......@@ -120,6 +120,8 @@ namespace FLY.Thick.Blowing.Server
/// 测厚仪测量点位置方向:Left, Right (也就是三角形在左还是右)
/// </summary>
public bool IsProbeRight { get; set; } = true;
public bool IsUsedEncoder { get; set; } = false;
/// <summary>
/// 应用
/// </summary>
......
......@@ -302,7 +302,10 @@
</Border>
<WrapPanel Orientation="Horizontal" Grid.Column="1">
<StackPanel Orientation="Horizontal">
<StackPanel Margin="5" >
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="使用编码器测量旋转" />
<ToggleButton Style="{StaticResource ToggleButtonStyle1}" HorizontalAlignment="Left" IsChecked="{Binding IsUsedEncoder}"/>
</StackPanel>
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="旋转1圈总脉冲" />
<StackPanel Orientation="Horizontal">
......@@ -317,6 +320,7 @@
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="脉冲" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" DataContext="{Binding bDetect}">
<StackPanel Margin="5">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="全局位置" />
......@@ -332,6 +336,7 @@
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="脉冲/s" />
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</WrapPanel>
......
......@@ -61,7 +61,7 @@ namespace FLY.Thick.Blowing360.UI
/// 当人字架复位时,探头在右边
/// </summary>
public bool IsProbeRight { get; set; } = true;
public bool IsUsedEncoder { get; set; } = true;
/// <summary>
/// 分区1号 对应时钟的位置 1 ~ 12
/// </summary>
......@@ -114,6 +114,7 @@ namespace FLY.Thick.Blowing360.UI
Misc.BindingOperations.SetBinding(bDetect, nameof(bDetect.RollPerimeter), this, nameof(RollPerimeter));
Misc.BindingOperations.SetBinding(renZiJiaService, nameof(renZiJiaService.IsProbeRight), this, nameof(IsProbeRight));
Misc.BindingOperations.SetBinding(renZiJiaService, nameof(renZiJiaService.IsUsedEncoder), this, nameof(IsUsedEncoder));
Misc.BindingOperations.SetBinding(renZiJiaService, nameof(renZiJiaService.ChannelCnt), this, nameof(ChannelCnt));
Misc.BindingOperations.SetBinding(renZiJiaService, nameof(renZiJiaService.BPC), this, nameof(BPC));
Misc.BindingOperations.SetBinding(renZiJiaService, nameof(renZiJiaService.OrgBoltNo), this, nameof(OrgBoltNo));
......@@ -308,6 +309,7 @@ namespace FLY.Thick.Blowing360.UI
renZiJiaService.OrgBoltNo = this.OrgBoltNo;
renZiJiaService.IsUsedMap = this.IsUsedMap;
renZiJiaService.IsProbeRight = this.IsProbeRight;
renZiJiaService.IsUsedEncoder = this.IsUsedEncoder;
renZiJiaService.Apply();
FLY.ControlLibrary.Window_Tip.Show("应用成功",
......
......@@ -12,6 +12,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using FLY.Thick.Base.UI;
using FLY.Thick.Blowing.IService;
using FLY.Thick.Blowing.UI.Fix.Client;
using Unity;
using PgFlyAd = FLY.Thick.Blowing.UI.Fix.Client.PgFlyAd;
......@@ -24,15 +25,18 @@ namespace FLY.Thick.Blowing360.UI
/// </summary>
public partial class PgMenu : Page
{
IBlowingService blowingService;
IUnityContainer container;
public PgMenu()
{
InitializeComponent();
}
[InjectionMethod]
public void Init(IUnityContainer container)
public void Init(IUnityContainer container,
IBlowingService blowingService)
{
this.container = container;
this.blowingService = blowingService;
}
......@@ -74,10 +78,17 @@ namespace FLY.Thick.Blowing360.UI
private void button_blowing_Click(object sender, RoutedEventArgs e)
{
PgBlowing p = new PgBlowing();
container.BuildUp(p);
if (this.blowingService.IsUsedEncoder)
{
var p = container.Resolve<PgBlowing>();
NavigationService.Navigate(p);
}
else
{
var p = container.Resolve<FLY.Thick.Blowing.UI.Fix.Client.PgBlowing>();
NavigationService.Navigate(p);
}
}
private void button_scanwarning_Click(object sender, RoutedEventArgs e)
{
......
......@@ -16,8 +16,9 @@ namespace FLY.Thick.Blowing360.UI.UiModule
/// </summary>
public partial class DynAreaBlowing : UserControl
{
//IBlowingFixService blowingFixService;
//IBlowingDetectService blowingDetectService;
IBlowingService blowingService;
IBlowingDetectService blowingDetectService;
IBlowingDetect360EncoderService blowingDetect360EncoderService;
IUnityContainer container;
public DynAreaBlowing()
{
......@@ -27,18 +28,42 @@ namespace FLY.Thick.Blowing360.UI.UiModule
[InjectionMethod]
public void Init(
IUnityContainer container,
IBlowingDetect360EncoderService blowingDetectService)
IBlowingService blowingService,
IBlowingDetect360EncoderService blowingDetect360EncoderService,
IBlowingDetectService blowingDetectService
)
{
this.container = container;
this.blowingService = blowingService;
this.blowingDetect360EncoderService = blowingDetect360EncoderService;
this.blowingDetectService = blowingDetectService;
Misc.BindingOperations.SetBinding(this.blowingService, nameof(this.blowingService.IsUsedEncoder), updateDataContext);
}
void updateDataContext() {
if (this.blowingService.IsUsedEncoder)
{
this.DataContext = blowingDetect360EncoderService;
}
else
{
this.DataContext = blowingDetectService;
}
}
private void Border_Blowing_Click(object sender, RoutedEventArgs e)
{
if (this.blowingService.IsUsedEncoder)
{
var p = container.Resolve<PgBlowing>();
MultiLayout.FlyLayoutManager.NavigationService.Navigate(p);
}
else
{
var p = container.Resolve<FLY.Thick.Blowing.UI.Fix.Client.PgBlowing>();
MultiLayout.FlyLayoutManager.NavigationService.Navigate(p);
}
}
}
public class DynAreaBlowingVmUt : INotifyPropertyChanged
{
......
......@@ -26,8 +26,14 @@ namespace FLY.Thick.Blowing360.Server.OBJProxy
var blowingOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.RENZIJIA_ID, typeof(IBlowingFixService), mGage.gmRenZiJiaFix);
if (mGage.gmRenZiJiaFix.IsUsedEncoder)
{
var bDetectOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.BDETECT360EN_ID, typeof(IBlowingDetect360EncoderService), mGage.blowingDetect);
}
else
{
var bDetectOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.BDETECT_ID, typeof(IBlowingDetectService), mGage.blowingDetect);
}
var scanWarningOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.SCANWARNING_ID, typeof(IScanWarningService), mGage.scanWarning);
......
using AutoMapper;
using FLY.Thick.Blowing.IService;
using FLY.Thick.Blowing360.IService;
using FObjBase;
using Misc;
using Newtonsoft.Json;
......@@ -20,7 +21,7 @@ namespace FLY.Thick.Blowing360.Server
/// <para>RenZiJiaPeriod预留10s的余量,避免不断修正</para>
/// <para>并且触发FilmInfoChangedEvent 时间为上一次限位信号</para>
/// </summary>
public class BlowingDetect360 : IBlowingDetectService, INotifyPropertyChanged
public class BlowingDetect360 : IBlowingDetectInServer, IBlowingDetectService, INotifyPropertyChanged
{
#region 输入口定义
/// <summary>
......@@ -653,29 +654,29 @@ namespace FLY.Thick.Blowing360.Server
}
public class FilmInfo
{
/// <summary>
/// 上层 位于膜泡的角度 0~360°
/// </summary>
public double angle1;
/// <summary>
/// 下层 位于膜泡的角度 0~360°
/// </summary>
public double angle2;
/// <summary>
/// 膜泡旋转方向
/// </summary>
public Misc.DIRECTION direction;
/// <summary>
/// 线速度
/// </summary>
public double filmVelocity;
/// <summary>
/// 累计旋转次数
/// </summary>
public int rotationCnt;
}
//public class FilmInfo
//{
// /// <summary>
// /// 上层 位于膜泡的角度 0~360°
// /// </summary>
// public double angle1;
// /// <summary>
// /// 下层 位于膜泡的角度 0~360°
// /// </summary>
// public double angle2;
// /// <summary>
// /// 膜泡旋转方向
// /// </summary>
// public Misc.DIRECTION direction;
// /// <summary>
// /// 线速度
// /// </summary>
// public double filmVelocity;
// /// <summary>
// /// 累计旋转次数
// /// </summary>
// public int rotationCnt;
//}
......@@ -740,6 +741,7 @@ namespace FLY.Thick.Blowing360.Server
return GetFilmInfo(out filminfo, dt, filmWidth, filmPosH, filmlen);
}
int GetFilmInfo(out FilmInfo filminfo, DateTime dt, double filmWidth, double filmPosH, double filmLen)
{
filminfo = null;
......@@ -1196,26 +1198,26 @@ namespace FLY.Thick.Blowing360.Server
{
Save();
}
public class FilmInfoChangedEventArgs : EventArgs
{
public FilmInfoChangedEventArgs(DateTime time)
{
Time = time;
}
/// <summary>
/// 开始时间点
/// </summary>
public DateTime Time
{
get;
set;
}
}
public delegate void FilmInfoChangedEventHandler(object sender, FilmInfoChangedEventArgs e);
//public class FilmInfoChangedEventArgs : EventArgs
//{
// public FilmInfoChangedEventArgs(DateTime time)
// {
// Time = time;
// }
// /// <summary>
// /// 开始时间点
// /// </summary>
// public DateTime Time
// {
// get;
// set;
// }
//}
//public delegate void FilmInfoChangedEventHandler(object sender, FilmInfoChangedEventArgs e);
public event FilmInfoChangedEventHandler FilmInfoChangedEvent;
public delegate void ClearEventHandler(object sender);
//public delegate void ClearEventHandler(object sender);
public event ClearEventHandler ClearEvent;
......
......@@ -114,6 +114,11 @@ namespace FLY.Thick.Blowing360.Server
/// 测厚仪测量点位置方向:Left, Right (也就是三角形在左还是右)
/// </summary>
public bool IsProbeRight { get; set; } = true;
/// <summary>
/// 使用编码器测量旋转架位置
/// </summary>
public bool IsUsedEncoder { get; set; } = false;
/// <summary>
/// 应用
/// </summary>
......@@ -1364,5 +1369,6 @@ namespace FLY.Thick.Blowing360.Server
public bool IsUsedMap;
public BoltMapCell[] Map;
public bool IsProbeRight = true;
public bool IsUsedEncoder = false;
}
}
......@@ -169,7 +169,10 @@ namespace FLY.Thick.Blowing360.Server
gmManager = new GageModeManager();
gmFix = new GM_Fix(flyAd);
gmRenZiJiaFix = new GM_BlowingFix360(flyAd);
if (gmRenZiJiaFix.IsUsedEncoder)
blowingDetect = new BlowingDetect360Encoder();
else
blowingDetect = new BlowingDetect360();
#endregion
......@@ -268,11 +271,16 @@ namespace FLY.Thick.Blowing360.Server
//---------------------------------------------------------------------------------------------------------------
//Bulkdate_Create
if(blowingDetect is BlowingDetect360Encoder)
if (blowingDetect is BlowingDetect360Encoder)
{
var blowingDetect360Encoder = blowingDetect as BlowingDetect360Encoder;
blowingDetect360Encoder.Init(flyAd);
var blowingDetect360 = blowingDetect as BlowingDetect360Encoder;
blowingDetect360.Init(flyAd);
}
else {
var blowingDetect360 = blowingDetect as BlowingDetect360;
blowingDetect360.Init(flyAd);
}
gmRenZiJiaFix.Init(blowingDetect, Ad2Thk, dynArea, profile.Param, historyDb, bulkDb);
gmRenZiJiaFix.Start();
......
......@@ -765,6 +765,8 @@ namespace FLY.Thick.BlowingScan.Server
/// 测厚仪测量点位置方向:Left, Right (也就是三角形在左还是右)
/// </summary>
public bool IsProbeRight { get; set; } = true;
public bool IsUsedEncoder { get; set; }
/// <summary>
/// 应用
/// </summary>
......
Subproject commit 7ea0eeb2e57b0c5c27c90e0d5f60e7ee7d8cf1c4
Subproject commit 2d5a6d3985d9e31ec384e92f00b97075f1fb762a
......@@ -74,6 +74,13 @@
<param name="connName" dependencyName="cn0" />
</constructor>
</register>
<register type="IBlowingDetectService" mapTo="BlowingDetectServiceClient">
<lifetime type="singleton" />
<constructor>
<param name="serviceId" value="30010" />
<param name="connName" dependencyName="cn0" />
</constructor>
</register>
<register type="IScanWarningService" mapTo="ScanWarningServiceClient">
<lifetime type="singleton" />
<constructor>
......
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