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

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

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