mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-29 14:16:39 +00:00
Implement MonitorService to handle pluggable monitor lifetime
This commit is contained in:
parent
ebab0b226f
commit
3133b01c4a
@ -13,3 +13,4 @@ export * from './examples-service';
|
||||
export * from './executable-service';
|
||||
export * from './response-service';
|
||||
export * from './notification-service';
|
||||
export * from './monitor-service';
|
||||
|
30
arduino-ide-extension/src/common/protocol/monitor-service.ts
Normal file
30
arduino-ide-extension/src/common/protocol/monitor-service.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { Event, JsonRpcServer } from "@theia/core";
|
||||
import { Board, Port } from './boards-service';
|
||||
|
||||
export const MonitorManagerProxyPath = '/services/monitor-manager-proxy';
|
||||
export const MonitorManagerProxy = Symbol('MonitorManagerProxy');
|
||||
export interface MonitorManagerProxy extends JsonRpcServer<MonitorManagerProxyClient> {
|
||||
//set the monitor settings, which includes address, port and other monitor-specific settings
|
||||
setMonitorSettings(board: Board, port: Port, settings: MonitorSettings): Promise<void>;
|
||||
}
|
||||
|
||||
export const MonitorManagerProxyClient = Symbol('MonitorManagerProxyClient');
|
||||
export interface MonitorManagerProxyClient {
|
||||
onWebSocketChanged: Event<string>;
|
||||
notifyWebSocketChanged(message: string): void;
|
||||
}
|
||||
|
||||
export interface MonitorSetting {
|
||||
// The setting identifier
|
||||
readonly id: string;
|
||||
// A human-readable label of the setting (to be displayed on the GUI)
|
||||
readonly label: string;
|
||||
// The setting type (at the moment only "enum" is avaiable)
|
||||
readonly type: string;
|
||||
// The values allowed on "enum" types
|
||||
readonly values: string[];
|
||||
// The selected value
|
||||
selectedValue: string;
|
||||
}
|
||||
|
||||
export type MonitorSettings = Record<string, MonitorSetting>;
|
Loading…
x
Reference in New Issue
Block a user