Commit 0458a2a4 authored by 潘栩锋's avatar 潘栩锋 🚴

添加 flyad添加电脑备份AD盒参数。

parent 87cb1e4e
......@@ -232,6 +232,7 @@
<TextBox Style="{StaticResource TextBoxStyle_itemContent}" Text="{Binding HVelocity2}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<Button Content="设置" Command="{Binding SetVelocityParamCmd}" Style="{StaticResource ButtonStyle}"/>
<Button Content="保存" Click="button_save_velocity_Click" Style="{StaticResource ButtonStyle}"/>
<Button Content="加载" Click="button_load_velocity_Click" Style="{StaticResource ButtonStyle}"/>
</StackPanel>
......
......@@ -24,6 +24,7 @@ using Microsoft.Win32;
using System.IO;
using System.Threading.Tasks;
using Unity;
using GalaSoft.MvvmLight.Command;
namespace Flyad7_WPF
{
......@@ -40,6 +41,8 @@ namespace Flyad7_WPF
AutoSync mAutoSync;
AutoGetGridAdv autoGetGridAdv;
GridAdvVm gridAdvVm;
MainWindowVm viewModel;
public MainWindow()
{
InitializeComponent();
......@@ -61,6 +64,7 @@ namespace Flyad7_WPF
gridAdvVm = Container.Resolve<GridAdvVm>();
gridAdvVm.Init(chart3);
viewModel = new MainWindowVm();
this.DataContext = flyad;
this.grid_viewModel.DataContext = this;
......@@ -73,6 +77,7 @@ namespace Flyad7_WPF
flyad.GridEvent += flyad_GridEvent;
flyad.TimeGridEvent += flyad_TimeGridEvent;
groupBox4.DataContext = viewModel;
FObjBase.PollModule.Current.Start();
}
......@@ -638,4 +643,64 @@ namespace Flyad7_WPF
}
}
public class MainWindowVm : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// runto 速度 pps
/// </summary>
public UInt32 Velocity { get; set; } = 8000;
/// <summary>
/// 开始速度 pps
/// </summary>
public UInt32 SVelocity { get; set; } = 200;
/// <summary>
/// 加速时间 ms
/// </summary>
public UInt32 ATime { get; set; } = 300;
/// <summary>
/// 减速时间 ms
/// </summary>
public UInt32 DTime { get; set; } = 200;
/// <summary>
/// 归0 第1段速 pps
/// </summary>
public UInt32 HVelocity1 { get; set; } = 4000;
/// <summary>
/// 归0 第2段速 pps
/// </summary>
public UInt32 HVelocity2 { get; set; } = 500;
public RelayCommand SetVelocityParamCmd { get; private set; }
FlyAD7 flyAD7;
public MainWindowVm() {
SetVelocityParamCmd = new RelayCommand(SetVelocityParam);
}
public void Init(FlyAD7 flyAD7)
{
this.flyAD7 = flyAD7;
Misc.BindingOperations.SetBinding(this.flyAD7, nameof(this.flyAD7.Velocity), this, nameof(Velocity));
Misc.BindingOperations.SetBinding(this.flyAD7, nameof(this.flyAD7.SVelocity), this, nameof(SVelocity));
Misc.BindingOperations.SetBinding(this.flyAD7, nameof(this.flyAD7.ATime), this, nameof(ATime));
Misc.BindingOperations.SetBinding(this.flyAD7, nameof(this.flyAD7.DTime), this, nameof(DTime));
Misc.BindingOperations.SetBinding(this.flyAD7, nameof(this.flyAD7.HVelocity1), this, nameof(HVelocity1));
Misc.BindingOperations.SetBinding(this.flyAD7, nameof(this.flyAD7.HVelocity2), this, nameof(HVelocity2));
}
private void SetVelocityParam()
{
flyAD7.SetPosParam(Velocity, SVelocity, ATime, DTime, HVelocity1, HVelocity2);
}
}
}
......@@ -66,18 +66,6 @@
<Button Content="纵向偏移设置" Click="button_setPos2Shift_Click" />
<TextBox Text="{Binding Pos2Shift}" />
</StackPanel>
<StackPanel Orientation="Vertical" Margin="3">
<TextBlock Margin="3" Name="textBlock_pos2Comp" FontSize="16">
<Run Text="纵向补偿:" />
<Run Text="{Binding Pos2Comp, Mode=OneWay}" />
</TextBlock>
<StackPanel Orientation="Horizontal">
<Button Content="设置" Click="button_pos2comp_Click"/>
<TextBox Text="{Binding Pos2Comp}"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Button Content="进入同步状态" Click="button_syncBegin_Click" />
......
......@@ -40,7 +40,6 @@ namespace Flyad7_WPF
this.flyad = flyad;
this.mAutoSync = mAutoSync;
textBlock_pos1LCShift.DataContext = this.flyad;
textBlock_pos2Comp.DataContext = this.flyad;
textBlock_position2.DataContext = this.flyad;
textBlock_marker.DataContext = this.flyad;
......@@ -113,8 +112,7 @@ namespace Flyad7_WPF
private void button_pos2comp_Click(object sender, RoutedEventArgs e)
{
flyad.Pos2Comp = Pos2Comp;
MessageBox.Show("flyad.Pos2Comp = " + Pos2Comp.ToString() );
}
private void button_clear_Click(object sender, RoutedEventArgs e)
......
......@@ -16,6 +16,9 @@
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Converter/Dictionary_MyConv.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style TargetType="TextBlock" BasedOn="{StaticResource Styles.Text.FieldContent.Unit}" x:Key="Styles.Text.FieldContent.Error">
<Setter Property="Foreground" Value="{StaticResource Brushes.Validation}"/>
</Style>
</ResourceDictionary>
</Page.Resources>
<Grid >
......@@ -39,7 +42,7 @@
<Border Style="{StaticResource Styles.Card.Border}">
<StackPanel>
<TextBlock Style="{StaticResource Styles.Card.Title}"
Text="参数"/>
Text="AD盒参数"/>
<StackPanel >
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="IP地址:端口" />
......@@ -58,16 +61,27 @@
</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 PosOfGrid}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsPosOfGridModified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_PosOfGrid}"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}" >
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="数据平滑" />
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding GridSmooth}" />
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="电机类型" />
<ComboBox Width="191" HorizontalAlignment="Left" MinHeight="40">
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsMotorTypeModified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_MotorType}"/>
</StackPanel>
<ComboBox Width="191" HorizontalAlignment="Left" MinHeight="40">
<ComboBoxItem IsSelected="{Binding MotorType, Converter={StaticResource e2bconv}, ConverterParameter={x:Static common:MOTORTYPE.SERVO}}">
<TextBlock Style="{StaticResource Styles.Text.FieldContent}" FontSize="32" Text="伺服"/>
</ComboBoxItem>
......@@ -81,23 +95,64 @@
</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 Ratio01}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsRatio01Modified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_Ratio01}"/>
</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 Ratio02}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsRatio02Modified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_Ratio02}"/>
</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 PosOffset}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="脉冲"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsPosOffsetModified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_PosOffset}"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="JOG速度" />
<TextBlock Style="{StaticResource ResourceKey=Styles.Text.FieldHeader.Editable}" Text="独立位置范围" />
<ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding HasPosMaxMin}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Visibility="{Binding HasPosMaxMin,Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}">
<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 PosMin}" />
<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 PosMax}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="脉冲"/>
</StackPanel>
</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 JogVelocity}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Error}"
Visibility="{Binding IsJogVelocityModified, Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}"
Text="{Binding Backup_JogVelocity}"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}" >
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="AD延时" />
......@@ -107,9 +162,143 @@
</StackPanel>
</StackPanel>
</WrapPanel>
<StackPanel Orientation="Horizontal" FlowDirection="RightToLeft">
<Button Style="{StaticResource Styles.Button.Square.Accent2}" Content="应用" Command="{Binding ApplyCmd}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Border>
<Border Style="{StaticResource Styles.Card.Border}">
<StackPanel>
<Button Style="{StaticResource ButtonStyle_apply}" VerticalAlignment="Bottom" Margin="0,0,20,20"
Command="{Binding ApplyCmd}"/>
<TextBlock Style="{StaticResource Styles.Card.Title}"
Text="系统参数"/>
<StackPanel >
<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 PosLength}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}" Text="|"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
<Run>
<MultiBinding Converter="{StaticResource p2mmconv}" Mode="OneWay" StringFormat="{}{0:F0}">
<Binding Path="PosLength" />
<Binding Path="Encoder1_mmpp"/>
</MultiBinding>
</Run>
<Run Text="mm"/>
</TextBlock>
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="编码器1比例" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Encoder1_mmpp}" HorizontalAlignment="Left"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="mm/脉冲"/>
</StackPanel>
</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 VJOG}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}" Text="|" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
<Run>
<MultiBinding Converter="{StaticResource outsp2mpminconv}" Mode="OneWay" StringFormat="{}{0:F1}">
<Binding Path="VJOG" />
<Binding Path="Encoder1_mmpp" />
<Binding Path="Speed1Scale" />
</MultiBinding>
</Run>
<Run Text="m/min" />
</TextBlock>
</StackPanel>
</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 SVelocity}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}" Text="|" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
<Run >
<MultiBinding Converter="{StaticResource outsp2mpminconv}" Mode="OneWay" StringFormat="{}{0:F1}">
<Binding Path="SVelocity" />
<Binding Path="Encoder1_mmpp" />
<Binding Path="Speed1Scale" />
</MultiBinding>
</Run>
<Run Text="m/min" />
</TextBlock>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="归零速度1" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding HVelocity1}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}" Text="|" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
<Run >
<MultiBinding Converter="{StaticResource outsp2mpminconv}" Mode="OneWay" StringFormat="{}{0:F1}">
<Binding Path="HVelocity1" />
<Binding Path="Encoder1_mmpp" />
<Binding Path="Speed1Scale" />
</MultiBinding>
</Run>
<Run Text="m/min" />
</TextBlock>
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="归零速度2" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding HVelocity2}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}" Text="|" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
<Run >
<MultiBinding Converter="{StaticResource outsp2mpminconv}" Mode="OneWay" StringFormat="{}{0:F1}">
<Binding Path="HVelocity2" />
<Binding Path="Encoder1_mmpp" />
<Binding Path="Speed1Scale" />
</MultiBinding>
</Run>
<Run Text="m/min" />
</TextBlock>
</StackPanel>
</StackPanel>
</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 ATime}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
<Run Text="ms" />
</TextBlock>
</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 DTime}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
<Run Text="ms" />
</TextBlock>
</StackPanel>
</StackPanel>
</StackPanel>
</WrapPanel>
<StackPanel Orientation="Horizontal" FlowDirection="RightToLeft">
<Button Style="{StaticResource Styles.Button.Square.Accent2}" Content="应用" Command="{Binding Apply2Cmd}"/>
</StackPanel>
</StackPanel>
</StackPanel>
......
......@@ -24,10 +24,11 @@ namespace FLY.Thick.Base.UI
public void Init(
IUnityContainer container,
IFlyADService flyAdService,
ITDGageService gageService)
ITDGageService gageService,
IInitParamService initParamService)
{
viewModel = new PgFlyAdVm();
viewModel.Init(flyAdService, gageService);
viewModel.Init(flyAdService, gageService, initParamService);
this.DataContext = viewModel;
container.BuildUp(mircoGage);
}
......@@ -49,12 +50,72 @@ namespace FLY.Thick.Base.UI
public int GridSmooth { get; set; }
public bool IsCalSpeed { get; set; }
public int ADLag { get; set; }
public bool HasPosMaxMin { get; set; }
public int PosMin { get; set; }
public int PosMax { get; set; }
#endregion
#region 备份参数
public MOTORTYPE Backup_MotorType { get; set; } = MOTORTYPE.SERVO;
public UInt16 Backup_PosOfGrid { get; set; } = 10;
public UInt16 Backup_Ratio01 { get; set; } = 4;
public UInt16 Backup_Ratio02 { get; set; } = 1;
public Int16 Backup_PosOffset { get; set; } = 0;
public UInt32 Backup_JogVelocity { get; set; } = 300;
#endregion
#region 备份参数
public bool IsMotorTypeModified => MotorType != Backup_MotorType;
public bool IsPosOfGridModified => PosOfGrid != Backup_PosOfGrid;
public bool IsRatio01Modified => Ratio01 != Backup_Ratio01;
public bool IsRatio02Modified => Ratio02 != Backup_Ratio02;
public bool IsPosOffsetModified => PosOffset != Backup_PosOffset;
public bool IsJogVelocityModified => JogVelocity != Backup_JogVelocity;
#endregion
#region initparam
public double Encoder1_mmpp { get; set; }
public int PosLength { get; set; }
/// <summary>
/// 设置的速度,与 实际速度比例 Speed1 = VScan*Speed1Scale
/// </summary>
public double Speed1Scale { get; set; }
#region 速度
/// <summary>
/// 调试时速度,向前走,向后走 Velocity Of JOG
/// </summary>
public UInt32 VJOG { get; set; }
/// <summary>
/// 开始速度 Start Velocity
/// </summary>
public UInt32 SVelocity { set; get; }
/// <summary>
/// 加速时间
/// </summary>
public UInt32 ATime { set; get; }
/// <summary>
/// 减速时间
/// </summary>
public UInt32 DTime { set; get; }
/// <summary>
/// 归0速度1
/// </summary>
public UInt32 HVelocity1 { set; get; }
/// <summary>
/// 归0速度2
/// </summary>
public UInt32 HVelocity2 { set; get; }
#endregion
#endregion
public int TargetPos { get; set; }
#region Command
public RelayCommand ApplyCmd { get; }
public RelayCommand Apply2Cmd { get; }
public RelayCommand RunToCmd { get; }
public RelayCommand BackwCmd { get; }
public RelayCommand ForwCmd { get; }
......@@ -64,6 +125,7 @@ namespace FLY.Thick.Base.UI
IFlyADService flyAdService;
ITDGageService gageService;
IInitParamService initParamService;
public PgFlyAdVm()
{
......@@ -77,7 +139,8 @@ namespace FLY.Thick.Base.UI
public void Init(
IFlyADService flyAdService,
ITDGageService gageService)
ITDGageService gageService,
IInitParamService initParamService)
{
this.flyAdService = flyAdService;
this.gageService = gageService;
......@@ -97,6 +160,28 @@ namespace FLY.Thick.Base.UI
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.IsCalSpeed), this, nameof(IsCalSpeed));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.ADLag), this, nameof(ADLag));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.HasPosMaxMin), this, nameof(HasPosMaxMin));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.PosMin), this, nameof(PosMin));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.PosMax), this, nameof(PosMax));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.Backup_MotorType), this, nameof(Backup_MotorType));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.Backup_PosOfGrid), this, nameof(Backup_PosOfGrid));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.Backup_Ratio01), this, nameof(Backup_Ratio01));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.Backup_Ratio02), this, nameof(Backup_Ratio02));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.Backup_PosOffset), this, nameof(Backup_PosOffset));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.Backup_JogVelocity), this, nameof(Backup_JogVelocity));
Misc.BindingOperations.SetBinding(this.initParamService, nameof(this.initParamService.Encoder1_mmpp), this, nameof(Encoder1_mmpp));
Misc.BindingOperations.SetBinding(initParamService, nameof(initParamService.Speed1Scale), this, nameof(Speed1Scale));
Misc.BindingOperations.SetBinding(this.initParamService, nameof(this.initParamService.PosLength), this, nameof(PosLength));
Misc.BindingOperations.SetBinding(initParamService, nameof(initParamService.VJOG), this, nameof(VJOG));
Misc.BindingOperations.SetBinding(initParamService, nameof(initParamService.SVelocity), this, nameof(SVelocity));
Misc.BindingOperations.SetBinding(initParamService, nameof(initParamService.ATime), this, nameof(ATime));
Misc.BindingOperations.SetBinding(initParamService, nameof(initParamService.DTime), this, nameof(DTime));
Misc.BindingOperations.SetBinding(initParamService, nameof(initParamService.HVelocity1), this, nameof(HVelocity1));
Misc.BindingOperations.SetBinding(initParamService, nameof(initParamService.HVelocity2), this, nameof(HVelocity2));
}
private void Apply()
{
......@@ -121,11 +206,46 @@ namespace FLY.Thick.Base.UI
flyAdService.IsCalSpeed = this.IsCalSpeed;
flyAdService.ADLag = this.ADLag;
flyAdService.HasPosMaxMin = this.HasPosMaxMin;
flyAdService.PosMin = this.PosMin;
flyAdService.PosMax = this.PosMax;
flyAdService.Backup_MotorType = this.MotorType;
flyAdService.Backup_PosOfGrid = this.PosOfGrid;
flyAdService.Backup_Ratio01 = this.Ratio01;
flyAdService.Backup_Ratio02 = this.Ratio02;
flyAdService.Backup_PosOffset = this.PosOffset;
flyAdService.Backup_JogVelocity = this.JogVelocity;
FLY.ControlLibrary.Window_Tip.Show("应用成功",
null,
TimeSpan.FromSeconds(2));
}
private void Apply2()
{
if (!WdPassword.Authorize("InitParam"))
return;
initParamService.Encoder1_mmpp = Encoder1_mmpp;
initParamService.PosLength = PosLength;
initParamService.VJOG = this.VJOG;
initParamService.SVelocity = this.SVelocity;
initParamService.ATime = this.ATime;
initParamService.DTime = this.DTime;
initParamService.HVelocity1 = this.HVelocity1;
initParamService.HVelocity2 = this.HVelocity2;
FLY.ControlLibrary.Window_Tip.Show("应用成功",
null,
TimeSpan.FromSeconds(2));
}
private void RunTo()
{
gageService.StartP2(STARTP2_MODE.RUNTO, TargetPos);
......
......@@ -52,6 +52,19 @@ namespace FLY.Thick.Base.Client
/// </summary>
public UInt32 JogVelocity { get; set; }
public int ADLag { get; set; }
public bool HasPosMaxMin { get; set; }
public int PosMin { get; set; }
public int PosMax { get; set; }
#region 备份参数
public MOTORTYPE Backup_MotorType { get; set; }
public UInt16 Backup_PosOfGrid { get; set; }
public UInt16 Backup_Ratio01 { get; set; }
public UInt16 Backup_Ratio02 { get; set; }
public Int16 Backup_PosOffset { get; set; }
public UInt32 Backup_JogVelocity { get; set; }
#endregion
/// <summary>
/// 参数应用
/// </summary>
......
......@@ -27,6 +27,19 @@ namespace FLY.Thick.Base.IService
bool IsCalSpeed { get; set; }
int ADLag { get; set; }
bool HasPosMaxMin { get; set; }
int PosMin { get; set; }
int PosMax { get; set; }
#region 备份参数
MOTORTYPE Backup_MotorType { get; set; }
UInt16 Backup_PosOfGrid { get; set; }
UInt16 Backup_Ratio01 { get; set; }
UInt16 Backup_Ratio02 { get; set; }
Int16 Backup_PosOffset { get; set; }
UInt32 Backup_JogVelocity { get; set; }
#endregion
/// <summary>
/// 获取序列码
/// </summary>
......
......@@ -149,6 +149,81 @@ namespace FLY.Thick.Base.Server
flyad.ADLag = value;
}
}
public bool HasPosMaxMin
{
get { return flyad.HasPosMaxMin; }
set
{
flyad.HasPosMaxMin = value;
}
}
public int PosMin
{
get { return flyad.PosMin; }
set
{
flyad.PosMin = value;
}
}
public int PosMax
{
get { return flyad.PosMax; }
set
{
flyad.PosMax = value;
}
}
public MOTORTYPE Backup_MotorType
{
get { return (MOTORTYPE)flyad.Backup_MotorType; }
set
{
flyad.Backup_MotorType = (FlyADBase.MOTORTYPE)value;
}
}
public UInt16 Backup_PosOfGrid
{
get { return flyad.Backup_PosOfGrid; }
set
{
flyad.Backup_PosOfGrid = value;
}
}
public UInt16 Backup_Ratio01
{
get { return flyad.Backup_Ratio01; }
set
{
flyad.Backup_Ratio01 = value;
}
}
public UInt16 Backup_Ratio02
{
get { return flyad.Backup_Ratio02; }
set
{
flyad.Backup_Ratio02 = value;
}
}
public Int16 Backup_PosOffset
{
get { return flyad.Backup_PosOffset; }
set
{
flyad.Backup_PosOffset = value;
}
}
public UInt32 Backup_JogVelocity
{
get { return flyad.Backup_JogVelocity; }
set
{
flyad.Backup_JogVelocity = value;
}
}
FlyAD7 flyad;
AD2ThkHandler ad2thk;
public FlyAdService()
......
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