Skip to content

Commit

Permalink
plugins/remote-actions-extra: Only change mode in take control button.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulosousadias committed Nov 8, 2023
1 parent 8e53c07 commit 0dc3044
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ enum ActionTypeEnum {
private String lastCmdBuilt = "";

private TakeControlMonitor takeControlMonitor;
private TakeControlMonitor takeControlMonitor2;

@NeptusProperty(name = "OBS Entity Name", userLevel = NeptusProperty.LEVEL.ADVANCED,
description = "Used to check the state of the OBS take control status.")
Expand All @@ -137,8 +136,6 @@ public RemoteActionsExtra(ConsoleLayout console, boolean usedInsideAnotherConsol
super(console, usedInsideAnotherConsolePanel);
takeControlMonitor = new TakeControlMonitor(this);
takeControlMonitor.setEntityName(obsEntityName);
takeControlMonitor2 = new TakeControlMonitor(this);
takeControlMonitor2.setEntityName(obsEntityName);
}

@Override
Expand All @@ -149,18 +146,15 @@ public void initSubPanel() {
@Override
public void cleanSubPanel() {
takeControlMonitor.setButton(null);
takeControlMonitor2.setButton(null);
}

@Override
public void propertiesChanged() {
takeControlMonitor.setEntityName(obsEntityName);
takeControlMonitor2.setEntityName(obsEntityName);
}

private synchronized void resetUIWithActions() {
takeControlMonitor.setButton(null);
takeControlMonitor2.setButton(null);

removeAll();
setLayout(new MigLayout("insets 10px"));
Expand Down Expand Up @@ -198,11 +192,7 @@ private synchronized void resetUIWithActions() {
if ("Take Control".equalsIgnoreCase(action)) {
takeControlMonitor.setButton(button);
takeControlMonitor.askedControl();
} else if ("Relinquish Control".equalsIgnoreCase(action)) {
takeControlMonitor2.setButton(button);
takeControlMonitor2.askedControl();
}

break;
case AXIS:
case SLIDER:
Expand All @@ -221,7 +211,6 @@ private synchronized void resetUIWithActions() {
public void on(ConsoleEventMainSystemChange evt) {
configureActions("", defaultAxisDecimalVal, false);
takeControlMonitor.on(evt);
takeControlMonitor2.on(evt);
}

@Subscribe
Expand All @@ -238,13 +227,11 @@ public void on(RemoteActionsRequest msg) {
@Subscribe
public void on(EntityState msg) {
takeControlMonitor.on(msg);
takeControlMonitor2.on(msg);
}

@Subscribe
public void on(VehicleState msg) {
takeControlMonitor.on(msg);
takeControlMonitor2.on(msg);
}

@Periodic(millisBetweenUpdates = 1_000)
Expand Down

0 comments on commit 0dc3044

Please sign in to comment.