Skip to content

Commit 4e85c76

Browse files
registry serial plotter in toolbar (wrong icon)
1 parent a3ec6b3 commit 4e85c76

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ import { ArduinoMenus } from './menu/arduino-menus';
4646
import { MonitorViewContribution } from './serial/monitor/monitor-view-contribution';
4747
import { ArduinoToolbar } from './toolbar/arduino-toolbar';
4848
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
49+
import { SerialPlotterContribution } from './serial/plotter/plotter-frontend-contribution';
50+
51+
const INIT_LIBS_AND_PACKAGES = 'initializedLibsAndPackages';
52+
export const SKIP_IDE_VERSION = 'skipIDEVersion';
4953

5054
@injectable()
5155
export class ArduinoFrontendContribution
@@ -130,6 +134,11 @@ export class ArduinoFrontendContribution
130134
ArduinoToolbar.is(widget) && widget.side === 'left',
131135
priority: 7,
132136
});
137+
registry.registerItem({
138+
id: 'toggle-serial-plotter',
139+
command: SerialPlotterContribution.Commands.OPEN_TOOLBAR.id,
140+
tooltip: nls.localize('arduino/common/serialPlotter', 'Serial Plotter'),
141+
});
133142
registry.registerItem({
134143
id: 'toggle-serial-monitor',
135144
command: MonitorViewContribution.TOGGLE_SERIAL_MONITOR_TOOLBAR,

arduino-ide-extension/src/browser/serial/plotter/plotter-frontend-contribution.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { ipcRenderer } from '@theia/electron/shared/electron';
1313
import { MonitorManagerProxyClient } from '../../../common/protocol';
1414
import { BoardsServiceProvider } from '../../boards/boards-service-provider';
1515
import { MonitorModel } from '../../monitor-model';
16+
import { ArduinoToolbar } from '../../toolbar/arduino-toolbar';
1617

1718
const queryString = require('query-string');
1819

@@ -30,6 +31,11 @@ export namespace SerialPlotterContribution {
3031
export const RESET: Command = {
3132
id: 'serial-plotter-reset',
3233
};
34+
export const OPEN_TOOLBAR: Command = {
35+
id: 'serial-plotter-open-toolbar',
36+
label: 'Serial Plotter Toolbar',
37+
category: 'Arduino',
38+
};
3339
}
3440
}
3541

@@ -71,6 +77,14 @@ export class PlotterFrontendContribution extends Contribution {
7177
registry.registerCommand(SerialPlotterContribution.Commands.RESET, {
7278
execute: () => this.reset(),
7379
});
80+
registry.registerCommand(
81+
{ id: SerialPlotterContribution.Commands.OPEN_TOOLBAR.id },
82+
{
83+
isVisible: (widget) =>
84+
ArduinoToolbar.is(widget) && widget.side === 'right',
85+
execute: this.startPlotter.bind(this),
86+
}
87+
);
7488
}
7589

7690
override registerMenus(menus: MenuModelRegistry): void {

0 commit comments

Comments
 (0)