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

修复 当AD盒 Loading 时,会把 backup 的参数 设置到AD盒。 我不想这样。

parent 6644d9a9
...@@ -84,7 +84,7 @@ namespace FlyADBase ...@@ -84,7 +84,7 @@ namespace FlyADBase
this.PropertyChanged += new PropertyChangedEventHandler(FlyAD7_PropertyChanged); this.PropertyChanged += new PropertyChangedEventHandler(FlyAD7_PropertyChanged);
PollModule.Current.Poll_Config(PollModule.POLL_CONFIG.ADD, new PollModule.PollHandler(OnPoll)); PollModule.Current.Poll_Config(PollModule.POLL_CONFIG.ADD, new PollModule.PollHandler(OnPoll));
//每隔一个小时 //每隔一个小时,改变剩下时间
PollModule.Current.Poll_Config(PollModule.POLL_CONFIG.ADD, () => PollModule.Current.Poll_Config(PollModule.POLL_CONFIG.ADD, () =>
{ {
if (!IsConnected) if (!IsConnected)
...@@ -1817,19 +1817,33 @@ namespace FlyADBase ...@@ -1817,19 +1817,33 @@ namespace FlyADBase
this.jsonDbPath = jsonDbPath; this.jsonDbPath = jsonDbPath;
this.PropertyChanged -= FlyAD7_PropertyChanged2; this.PropertyChanged -= FlyAD7_PropertyChanged2;
//不需要设置到 AD盒
bShieldSetValueEx = true;
bool ret = FlyAD7JsonDb.Load(jsonDbPath, this); bool ret = FlyAD7JsonDb.Load(jsonDbPath, this);
//还没连到 AD盒前, 有比较正常的 默认值,不需要设置到AD盒
PosOfGrid = Backup_PosOfGrid; PosOfGrid = Backup_PosOfGrid;
MotorType = Backup_MotorType; MotorType = Backup_MotorType;
Ratio01 = Backup_Ratio01; Ratio01 = Backup_Ratio01;
Ratio02 = Backup_Ratio02; Ratio02 = Backup_Ratio02;
PosOffset = Backup_PosOffset; PosOffset = Backup_PosOffset;
JogVelocity = Backup_JogVelocity; JogVelocity = Backup_JogVelocity;
bShieldSetValueEx = false;
this.PropertyChanged += FlyAD7_PropertyChanged2; this.PropertyChanged += FlyAD7_PropertyChanged2;
return ret; return ret;
} }
/// <summary>
/// 属性改变,自动保存
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void FlyAD7_PropertyChanged2(object sender, PropertyChangedEventArgs e) private void FlyAD7_PropertyChanged2(object sender, PropertyChangedEventArgs e)
{ {
if (propertyName_save.Contains(e.PropertyName)) if (propertyName_save.Contains(e.PropertyName))
......
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