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

添加 flyad7 添加 HardwareVersion 字段,用于AD盒版本标识。 v3 为伟的大AD盒。 区分IO口定义

parent 3ce2bec7
......@@ -1009,6 +1009,10 @@ namespace FlyADBase
}
}
/// <summary>
/// 硬件版本,设置的!!!
/// </summary>
public int HardwareVersion { get; set; } = 2;
/// <summary>
/// 脉冲
/// </summary>
......@@ -1893,6 +1897,15 @@ namespace FlyADBase
public Int16 Backup_PosOffset = 0;
public UInt32 Backup_JogVelocity = 5000;
/// <summary>
/// 硬件版本
/// version = 1,不支持 systick
/// version = 2,支持 timeGridAdv
/// version = 3,伟的大AD盒, io口定义不一样
/// </summary>
public int HardwareVersion = 2;
public static string[] GetMemberNames() {
var type = typeof(FlyAD7JsonDb);
return type.GetMembers().Select(mi => mi.Name).ToArray();
......
......@@ -26,9 +26,15 @@ namespace FlyADBase
/// <summary>
/// AD盒版本号 版本1 没有systick;版本2 有systick;
/// 通过通讯读取
/// </summary>
int Version { get; }
/// <summary>
/// 硬件版本,设置的!!!
/// </summary>
int HardwareVersion { get; set; }
/// <summary>
/// 脉冲
/// </summary>
......
......@@ -37,7 +37,7 @@
</StackPanel>
<local:CtMicroGage Grid.Column="1" x:Name="mircoGage" Background="Transparent" VerticalAlignment="Bottom"/>
</Grid>
<ScrollViewer CanContentScroll="True" PanningMode="Both" Grid.Row="1" >
<ScrollViewer PanningMode="Both" Grid.Row="1" >
<StackPanel Margin="{StaticResource ControlMargin}">
<Border Style="{StaticResource Styles.Card.Border}">
<StackPanel>
......@@ -161,6 +161,17 @@
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="*1.28ms"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="{StaticResource ControlMargin}" >
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="AD盒版本" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="v"/>
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding HardwareVersion}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}">
通讯版本:v<Run Text="{Binding Version}"/>
</TextBlock>
</StackPanel>
</StackPanel>
</WrapPanel>
<StackPanel Orientation="Horizontal" FlowDirection="RightToLeft">
<Button Style="{StaticResource Styles.Button.Square.Accent2}" Content="应用" Command="{Binding ApplyCmd}"/>
......
......@@ -73,6 +73,9 @@ namespace FLY.Thick.Base.UI
public bool IsJogVelocityModified => JogVelocity != Backup_JogVelocity;
#endregion
public int Version { get; set; }
public int HardwareVersion { get; set; }
#region initparam
public double Encoder1_mmpp { get; set; }
public int PosLength { get; set; }
......@@ -130,6 +133,7 @@ namespace FLY.Thick.Base.UI
public PgFlyAdVm()
{
ApplyCmd = new RelayCommand(Apply);
Apply2Cmd = new RelayCommand(Apply2);
RunToCmd = new RelayCommand(RunTo);
BackwCmd = new RelayCommand(Backw);
ForwCmd = new RelayCommand(Forw);
......@@ -144,7 +148,7 @@ namespace FLY.Thick.Base.UI
{
this.flyAdService = flyAdService;
this.gageService = gageService;
this.initParamService = initParamService;
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.HasCRC), this, nameof(HasCRC));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.Addr), () =>
{
......@@ -171,17 +175,19 @@ namespace FLY.Thick.Base.UI
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.flyAdService, nameof(this.flyAdService.Verson), this, nameof(Version));
Misc.BindingOperations.SetBinding(this.flyAdService, nameof(this.flyAdService.HardwareVersion), this, nameof(HardwareVersion));
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.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));
Misc.BindingOperations.SetBinding(this.initParamService, nameof(this.initParamService.VJOG), this, nameof(VJOG));
Misc.BindingOperations.SetBinding(this.initParamService, nameof(this.initParamService.SVelocity), this, nameof(SVelocity));
Misc.BindingOperations.SetBinding(this.initParamService, nameof(this.initParamService.ATime), this, nameof(ATime));
Misc.BindingOperations.SetBinding(this.initParamService, nameof(this.initParamService.DTime), this, nameof(DTime));
Misc.BindingOperations.SetBinding(this.initParamService, nameof(this.initParamService.HVelocity1), this, nameof(HVelocity1));
Misc.BindingOperations.SetBinding(this.initParamService, nameof(this.initParamService.HVelocity2), this, nameof(HVelocity2));
}
private void Apply()
{
......@@ -218,6 +224,7 @@ namespace FLY.Thick.Base.UI
flyAdService.Backup_PosOffset = this.PosOffset;
flyAdService.Backup_JogVelocity = this.JogVelocity;
flyAdService.HardwareVersion = HardwareVersion;
FLY.ControlLibrary.Window_Tip.Show("应用成功",
null,
......
......@@ -65,6 +65,11 @@ namespace FLY.Thick.Base.Client
public UInt32 Backup_JogVelocity { get; set; }
#endregion
public int Verson { get; set; }
public int HardwareVersion { get; set; }
/// <summary>
/// 参数应用
/// </summary>
......
......@@ -40,6 +40,8 @@ namespace FLY.Thick.Base.IService
UInt32 Backup_JogVelocity { get; set; }
#endregion
int Verson { get; }
int HardwareVersion { get; set; }
/// <summary>
/// 获取序列码
/// </summary>
......
......@@ -223,7 +223,16 @@ namespace FLY.Thick.Base.Server
}
}
public int Verson
{
get { return flyad.Version; }
}
public int HardwareVersion {
get { return flyad.HardwareVersion; }
set {
flyad.HardwareVersion = 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