Search in sources :

Example 16 with YamcsClient

use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.

the class ArchiveCatalogue method listTags.

public CompletableFuture<byte[]> listTags(TimeInterval interval) {
    String instance = ManagementCatalogue.getCurrentYamcsInstance();
    URLBuilder urlb = new URLBuilder("/archive/" + instance + "/tags");
    if (interval.hasStart())
        urlb.setParam("start", interval.getStartUTC());
    if (interval.hasStop())
        urlb.setParam("stop", interval.getStopUTC());
    YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
    return yamcsClient.get(urlb.toString(), null);
}
Also used : YamcsClient(org.yamcs.studio.core.client.YamcsClient) URLBuilder(org.yamcs.studio.core.client.URLBuilder)

Example 17 with YamcsClient

use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.

the class ArchiveCatalogue method deleteTag.

public CompletableFuture<byte[]> deleteTag(long tagTime, int tagId) {
    YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
    String instance = ManagementCatalogue.getCurrentYamcsInstance();
    return yamcsClient.delete("/archive/" + instance + "/tags/" + tagTime + "/" + tagId, null);
}
Also used : YamcsClient(org.yamcs.studio.core.client.YamcsClient)

Example 18 with YamcsClient

use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.

the class CommandingCatalogue method updateCommandComment.

public CompletableFuture<byte[]> updateCommandComment(String processor, CommandId cmdId, String newComment) {
    String instance = ManagementCatalogue.getCurrentYamcsInstance();
    YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
    KeyValue keyValue = KeyValue.newBuilder().setKey("Comment").setValue(newComment).build();
    UpdateCommandHistoryRequest request = UpdateCommandHistoryRequest.newBuilder().setCmdId(cmdId).addHistoryEntry(keyValue).build();
    return yamcsClient.post("/processors/" + instance + "/" + processor + "/commandhistory" + cmdId.getCommandName(), request);
}
Also used : YamcsClient(org.yamcs.studio.core.client.YamcsClient) KeyValue(org.yamcs.protobuf.Rest.UpdateCommandHistoryRequest.KeyValue) UpdateCommandHistoryRequest(org.yamcs.protobuf.Rest.UpdateCommandHistoryRequest)

Example 19 with YamcsClient

use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.

the class CommandingCatalogue method editQueue.

public CompletableFuture<byte[]> editQueue(CommandQueueInfo queue, EditCommandQueueRequest request) {
    String instance = ManagementCatalogue.getCurrentYamcsInstance();
    YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
    return yamcsClient.patch("/processors/" + instance + "/" + queue.getProcessorName() + "/cqueues/" + queue.getName(), request);
}
Also used : YamcsClient(org.yamcs.studio.core.client.YamcsClient)

Example 20 with YamcsClient

use of org.yamcs.studio.core.client.YamcsClient in project yamcs-studio by yamcs.

the class CommandingCatalogue method editQueuedCommand.

public CompletableFuture<byte[]> editQueuedCommand(CommandQueueEntry entry, EditCommandQueueEntryRequest request) {
    String instance = ManagementCatalogue.getCurrentYamcsInstance();
    YamcsClient yamcsClient = YamcsPlugin.getYamcsClient();
    return yamcsClient.patch("/processors/" + instance + "/" + entry.getProcessorName() + "/cqueues/" + entry.getQueueName() + "/entries/" + entry.getUuid(), request);
}
Also used : YamcsClient(org.yamcs.studio.core.client.YamcsClient)

Aggregations

YamcsClient (org.yamcs.studio.core.client.YamcsClient)31 WebSocketRequest (org.yamcs.api.ws.WebSocketRequest)6 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)4 URLBuilder (org.yamcs.studio.core.client.URLBuilder)3 YamcsConnectionProperties (org.yamcs.api.YamcsConnectionProperties)2 EditLinkRequest (org.yamcs.protobuf.Rest.EditLinkRequest)2 ArchiveCatalogue (org.yamcs.studio.core.model.ArchiveCatalogue)2 TimeCatalogue (org.yamcs.studio.core.model.TimeCatalogue)2 Calendar (java.util.Calendar)1 List (java.util.List)1 IDialogConstants (org.eclipse.jface.dialogs.IDialogConstants)1 MessageDialog (org.eclipse.jface.dialogs.MessageDialog)1 TitleAreaDialog (org.eclipse.jface.dialogs.TitleAreaDialog)1 SWT (org.eclipse.swt.SWT)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 RowLayout (org.eclipse.swt.layout.RowLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Control (org.eclipse.swt.widgets.Control)1 DateTime (org.eclipse.swt.widgets.DateTime)1