use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class LinkCatalogue method onYamcsConnected.
@Override
public void onYamcsConnected() {
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
yamcsClient.subscribe(new WebSocketRequest("links", "subscribe"), this);
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class LinkCatalogue method disableLink.
public CompletableFuture<byte[]> disableLink(String instance, String name) {
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
EditLinkRequest req = EditLinkRequest.newBuilder().setState("disabled").build();
return yamcsClient.patch("/links/" + instance + "/" + name, req);
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class ManagementCatalogue method getCurrentYamcsInstance.
// Careful we must support the case where Yamcs itself changes the instance of our client
// TODO maybe remove this and instead just store an instance field in YamcsClient ?
public static String getCurrentYamcsInstance() {
ManagementCatalogue catalogue = getInstance();
if (catalogue == null) {
return null;
}
ClientInfo ci = catalogue.getCurrentClientInfo();
if (ci != null) {
return ci.getInstance();
} else {
// Fallback (initial connection properties
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
YamcsConnectionProperties props = yamcsClient.getYamcsConnectionProperties();
return (props != null) ? props.getInstance() : null;
}
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class ParameterCatalogue method loadMetaParameters.
private void loadMetaParameters() {
log.fine("Fetching available parameters");
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
String instance = ManagementCatalogue.getCurrentYamcsInstance();
yamcsClient.get("/mdb/" + instance + "/parameters?details", null).whenComplete((data, exc) -> {
if (exc == null) {
try {
ListParameterInfoResponse response = ListParameterInfoResponse.parseFrom(data);
processMetaParameters(response.getParameterList());
} catch (InvalidProtocolBufferException e) {
log.log(Level.SEVERE, "Failed to decode server response", e);
}
}
});
}
use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.
the class ParameterCatalogue method setParameter.
public CompletableFuture<byte[]> setParameter(String processor, NamedObjectId id, Value value) {
String pResource = toURISegments(id);
YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
String instance = ManagementCatalogue.getCurrentYamcsInstance();
return yamcsClient.put("/processors/" + instance + "/" + processor + "/parameters" + pResource, value);
}
Aggregations