Search in sources :

Example 1 with ManagementListener

use of org.yamcs.studio.core.model.ManagementListener in project yamcs-studio by yamcs.

the class YamcsUIPlugin method postWorkbenchStartup.

/**
 * Hook called by application layer to bootstrap connection state
 */
public void postWorkbenchStartup(IWorkbench workbench) {
    // Listen to processing-info updates
    // Trigger initial state
    doUpdateGlobalProcessingState(workbench, null);
    ManagementCatalogue.getInstance().addManagementListener(new ManagementListener() {

        @Override
        public void processorUpdated(ProcessorInfo processorInfo) {
            updateGlobalProcessingState(processorInfo);
        }

        @Override
        public void processorClosed(ProcessorInfo processorInfo) {
            updateGlobalProcessingState(processorInfo);
        }

        @Override
        public void statisticsUpdated(Statistics stats) {
        }

        @Override
        public void clientUpdated(ClientInfo clientInfo) {
            updateGlobalProcessingState(clientInfo);
        }

        @Override
        public void clientDisconnected(ClientInfo clientInfo) {
            updateGlobalProcessingState(clientInfo);
        }

        @Override
        public void instanceUpdated(ConnectionInfo connectionInfo) {
        }

        @Override
        public void clearAllManagementData() {
        }
    });
    // Request connection to Yamcs server
    boolean singleConnectionMode = getPreferenceStore().getBoolean("singleConnectionMode");
    if (!singleConnectionMode && ConnectionPreferences.isAutoConnect()) {
        RCPUtils.runCommand("org.yamcs.studio.core.ui.autoconnect");
    }
}
Also used : ProcessorInfo(org.yamcs.protobuf.YamcsManagement.ProcessorInfo) ManagementListener(org.yamcs.studio.core.model.ManagementListener) ClientInfo(org.yamcs.protobuf.YamcsManagement.ClientInfo) ConnectionInfo(org.yamcs.protobuf.Web.ConnectionInfo) Statistics(org.yamcs.protobuf.YamcsManagement.Statistics)

Aggregations

ConnectionInfo (org.yamcs.protobuf.Web.ConnectionInfo)1 ClientInfo (org.yamcs.protobuf.YamcsManagement.ClientInfo)1 ProcessorInfo (org.yamcs.protobuf.YamcsManagement.ProcessorInfo)1 Statistics (org.yamcs.protobuf.YamcsManagement.Statistics)1 ManagementListener (org.yamcs.studio.core.model.ManagementListener)1