Skip to content

Commit

Permalink
broadcastState "should have" always returned state
Browse files Browse the repository at this point in the history
  • Loading branch information
supertick committed May 27, 2024
1 parent 8bd6cd4 commit 9556b0f
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/myrobotlab/framework/Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,9 @@ public void purgeTasks() {
}

@Override
public void broadcastState() {
public Service broadcastState() {
invoke("publishState");
return this;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package org.myrobotlab.framework.interfaces;

import org.myrobotlab.framework.Service;
import org.myrobotlab.framework.Status;

public interface ServiceStatus {

public void broadcastState();
public Service broadcastState();

public Status getLastError();
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ public interface StatePublisher {

public Service publishState();

public void broadcastState();
public Service broadcastState();

}
3 changes: 2 additions & 1 deletion src/main/java/org/myrobotlab/service/InMoov2Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void stopService() {
}

@Override
public void broadcastState() {
public Service broadcastState() {
super.broadcastState();
if (bicep != null)
bicep.broadcastState();
Expand All @@ -144,6 +144,7 @@ public void broadcastState() {
shoulder.broadcastState();
if (omoplate != null)
omoplate.broadcastState();
return this;
}

public void disable() {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/myrobotlab/service/InMoov2Hand.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void bird() {
}

@Override
public void broadcastState() {
public Service broadcastState() {
if (thumb != null)
thumb.broadcastState();
if (index != null)
Expand All @@ -148,6 +148,7 @@ public void broadcastState() {
pinky.broadcastState();
if (wrist != null)
wrist.broadcastState();
return this;
}

public void close() {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/myrobotlab/service/InMoov2Head.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void enable() {
}

@Override
public void broadcastState() {
public Service broadcastState() {
if (rothead != null)
rothead.broadcastState();
if (rollNeck != null)
Expand All @@ -104,6 +104,7 @@ public void broadcastState() {
eyelidLeft.broadcastState();
if (eyelidRight != null)
eyelidRight.broadcastState();
return this;
}

public void stop() {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/myrobotlab/service/InMoov2Torso.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ public void setAutoDisable(Boolean param) {
}

@Override
public void broadcastState() {
public Service broadcastState() {
if (topStom != null)
topStom.broadcastState();
if (midStom != null)
midStom.broadcastState();
if (lowStom != null)
lowStom.broadcastState();
return this;
}

public void disable() {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/myrobotlab/service/OculusRift.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@ public OculusRift(String n, String id) {

// Boradcast the state of the peers to notify the gui.
@Override
public void broadcastState() {
public Service broadcastState() {
// notify the gui
if (leftOpenCV != null)
leftOpenCV.broadcastState();
if (rightOpenCV != null)
rightOpenCV.broadcastState();
return this;
}

private void setupRift() {
Expand Down

0 comments on commit 9556b0f

Please sign in to comment.