Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…dded into dev
  • Loading branch information
Fatou Mounzeo committed Aug 22, 2019
2 parents 1892c02 + 0534322 commit 7d26a83
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ export enum TelemetryEventName {
COMMAND_RUN_SIMULATOR_BUTTON = "COMMAND.RUN.SIMULATOR_BUTTON",
COMMAND_RUN_PALETTE = "COMMAND.RUN.PALETTE",
COMMAND_RUN_EDITOR_ICON = "COMMAND.RUN.EDITOR_ICON",
COMMAND_SERIAL_MONITOR_CHOOSE_PORT = "COMMAND.SERIAL_MONITOR.CHOOSE_PORT",
COMMAND_SERIAL_MONITOR_OPEN = "COMMAND.SERIAL_MONITOR.OPEN",
COMMAND_SERIAL_MONITOR_BAUD_RATE = "COMMAND.SERIAL_MONITOR.BAUD_RATE",
COMMAND_SERIAL_MONITOR_CLOSE = "COMMAND.SERIAL_MONITOR.CLOSE",

// Simulator interaction
SIMULATOR_BUTTON_A = "SIMULATOR.BUTTON.A",
Expand Down
22 changes: 17 additions & 5 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ export async function activate(context: vscode.ExtensionContext) {
case "print":
console.log(
`Process print statement output = ${
messageToWebview.data
messageToWebview.data
}`
);
utils.logToOutputChannel(
Expand Down Expand Up @@ -644,7 +644,10 @@ export async function activate(context: vscode.ExtensionContext) {
"pacifica.selectSerialPort",
() => {
if (serialMonitor) {
serialMonitor.selectSerialPort(null, null);
telemetryAI.runWithLatencyMeasure(
() => { serialMonitor.selectSerialPort(null, null); },
TelemetryEventName.COMMAND_SERIAL_MONITOR_CHOOSE_PORT
);
} else {
vscode.window.showErrorMessage(CONSTANTS.ERROR.NO_FOLDER_OPENED);
console.info("Serial monitor is not defined.");
Expand All @@ -656,7 +659,10 @@ export async function activate(context: vscode.ExtensionContext) {
"pacifica.openSerialMonitor",
() => {
if (serialMonitor) {
serialMonitor.openSerialMonitor();
telemetryAI.runWithLatencyMeasure(
serialMonitor.openSerialMonitor.bind(serialMonitor),
TelemetryEventName.COMMAND_SERIAL_MONITOR_OPEN
);
} else {
vscode.window.showErrorMessage(CONSTANTS.ERROR.NO_FOLDER_OPENED);
console.info("Serial monitor is not defined.");
Expand All @@ -668,7 +674,10 @@ export async function activate(context: vscode.ExtensionContext) {
"pacifica.changeBaudRate",
() => {
if (serialMonitor) {
serialMonitor.changeBaudRate();
telemetryAI.runWithLatencyMeasure(
serialMonitor.changeBaudRate.bind(serialMonitor),
TelemetryEventName.COMMAND_SERIAL_MONITOR_BAUD_RATE
);
} else {
vscode.window.showErrorMessage(CONSTANTS.ERROR.NO_FOLDER_OPENED);
console.info("Serial monitor is not defined.");
Expand All @@ -680,7 +689,10 @@ export async function activate(context: vscode.ExtensionContext) {
"pacifica.closeSerialMonitor",
(port, showWarning = true) => {
if (serialMonitor) {
serialMonitor.closeSerialMonitor(port, showWarning);
telemetryAI.runWithLatencyMeasure(
() => { serialMonitor.closeSerialMonitor(port, showWarning); },
TelemetryEventName.COMMAND_SERIAL_MONITOR_CLOSE
)
} else {
vscode.window.showErrorMessage(CONSTANTS.ERROR.NO_FOLDER_OPENED);
console.info("Serial monitor is not defined.");
Expand Down

0 comments on commit 7d26a83

Please sign in to comment.