Skip to content

Commit

Permalink
params/SystemProperty: System property synchronization state is now e…
Browse files Browse the repository at this point in the history
…valuated on its own public method.
  • Loading branch information
miguel-paz committed Jan 6, 2025
1 parent 077a129 commit fb6523f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/java/pt/lsts/neptus/params/SystemProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,19 +319,26 @@ public void setTimeDirty(long timeDirty) {
updatePropRenderer();
}

public boolean inSync() {
boolean sync;
if (timeDirty > timeSync || timeSync <= 0) {
sync = false;
}
else {
sync = true;
}
return sync;
}

private void updatePropRenderer() {
if (this.renderer == null)
return;

if (!(renderer instanceof SystemPropertyRenderer))
return;

if (timeDirty > timeSync || timeSync <= 0) {
((SystemPropertyRenderer) renderer).setPropertyInSync(false);
}
else {
((SystemPropertyRenderer) renderer).setPropertyInSync(true);
}
boolean sync = inSync();
((SystemPropertyRenderer) renderer).setPropertyInSync(sync);
}

/* (non-Javadoc)
Expand Down

0 comments on commit fb6523f

Please sign in to comment.