Skip to content

Commit d654116

Browse files
registry serial plotter in toolbar (wrong icon)
1 parent 3d8c3db commit d654116

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ import { IDEUpdaterDialog } from './dialogs/ide-updater/ide-updater-dialog';
7676
import { IDEUpdater } from '../common/protocol/ide-updater';
7777
import { FileSystemFrontendContribution } from '@theia/filesystem/lib/browser/filesystem-frontend-contribution';
7878
import { HostedPluginEvents } from './hosted-plugin-events';
79+
import { SerialPlotterContribution } from './serial/plotter/plotter-frontend-contribution';
7980

8081
const INIT_LIBS_AND_PACKAGES = 'initializedLibsAndPackages';
8182
export const SKIP_IDE_VERSION = 'skipIDEVersion';
@@ -443,6 +444,11 @@ export class ArduinoFrontendContribution
443444
ArduinoToolbar.is(widget) && widget.side === 'left',
444445
priority: 7,
445446
});
447+
registry.registerItem({
448+
id: 'toggle-serial-plotter',
449+
command: SerialPlotterContribution.Commands.OPEN_TOOLBAR.id,
450+
tooltip: nls.localize('arduino/common/serialPlotter', 'Serial Plotter'),
451+
});
446452
registry.registerItem({
447453
id: 'toggle-serial-monitor',
448454
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

@@ -28,6 +29,11 @@ export namespace SerialPlotterContribution {
2829
label: 'Reset Serial Plotter',
2930
category: 'Arduino',
3031
};
32+
export const OPEN_TOOLBAR: Command = {
33+
id: 'serial-plotter-open-toolbar',
34+
label: 'Serial Plotter Toolbar',
35+
category: 'Arduino',
36+
};
3137
}
3238
}
3339

@@ -69,6 +75,14 @@ export class PlotterFrontendContribution extends Contribution {
6975
registry.registerCommand(SerialPlotterContribution.Commands.RESET, {
7076
execute: () => this.reset(),
7177
});
78+
registry.registerCommand(
79+
{ id: SerialPlotterContribution.Commands.OPEN_TOOLBAR.id },
80+
{
81+
isVisible: (widget) =>
82+
ArduinoToolbar.is(widget) && widget.side === 'right',
83+
execute: this.startPlotter.bind(this),
84+
}
85+
);
7286
}
7387

7488
override registerMenus(menus: MenuModelRegistry): void {

0 commit comments

Comments
 (0)