Skip to content

Commit 5cbedb6

Browse files
committed
remove remain code lines for serialport function
1 parent d35fb56 commit 5cbedb6

4 files changed

Lines changed: 0 additions & 144 deletions

File tree

package.json

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -311,71 +311,6 @@
311311
"markdownDescription": "%settings.cmsispack.repo.url%",
312312
"default": "github0null/eide-cmsis-pack/contents/packages"
313313
},
314-
"EIDE.SerialPortMonitor.DefaultPort": {
315-
"type": "string",
316-
"scope": "resource",
317-
"markdownDescription": "%settings.serial.def.port%"
318-
},
319-
"EIDE.SerialPortMonitor.ShowStatusBar": {
320-
"type": "boolean",
321-
"scope": "resource",
322-
"markdownDescription": "%settings.serial.show.toolbar%",
323-
"default": true
324-
},
325-
"EIDE.SerialPortMonitor.useUnixLF": {
326-
"type": "boolean",
327-
"scope": "resource",
328-
"markdownDescription": "%settings.serial.use.unix.lf%",
329-
"default": false
330-
},
331-
"EIDE.SerialPortMonitor.BaudRate": {
332-
"type": "integer",
333-
"scope": "resource",
334-
"markdownDescription": "%settings.serial.baud%",
335-
"default": 115200
336-
},
337-
"EIDE.SerialPortMonitor.DataBits": {
338-
"type": "integer",
339-
"scope": "resource",
340-
"markdownDescription": "%settings.serial.data.width%",
341-
"default": 8
342-
},
343-
"EIDE.SerialPortMonitor.Parity": {
344-
"type": "integer",
345-
"scope": "resource",
346-
"markdownDescription": "%settings.serial.parity%",
347-
"default": 0,
348-
"enum": [
349-
0,
350-
1,
351-
2,
352-
3,
353-
4
354-
],
355-
"enumDescriptions": [
356-
"None",
357-
"Odd",
358-
"Even",
359-
"Mark",
360-
"Space"
361-
]
362-
},
363-
"EIDE.SerialPortMonitor.StopBits": {
364-
"type": "integer",
365-
"scope": "resource",
366-
"markdownDescription": "%settings.serial.stop.bits%",
367-
"default": 1,
368-
"enum": [
369-
1,
370-
2,
371-
3
372-
],
373-
"enumDescriptions": [
374-
"One",
375-
"Two",
376-
"OnePointFive"
377-
]
378-
},
379314
"EIDE.IAR.STM8.InstallDirectory": {
380315
"type": "string",
381316
"scope": "resource",

src/OperationExplorer.ts

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,54 +1541,6 @@ export class OperationExplorer {
15411541

15421542
this.locked = false;
15431543
}
1544-
1545-
async onOpenSerialPortMonitor(port?: string) {
1546-
1547-
const resManager = ResManager.GetInstance();
1548-
const option = SettingManager.GetInstance().getPortSerialMonitorOptions();
1549-
1550-
try {
1551-
const portName: string | undefined = port || option.defaultPort;
1552-
if (!portName) {
1553-
return;
1554-
}
1555-
1556-
const paramList: string[] = [
1557-
'-n', portName,
1558-
'-b', option.baudRate.toString(),
1559-
'-d', option.dataBits.toString(),
1560-
'-p', option.parity.toString(),
1561-
'-s', option.stopBits.toString(),
1562-
'-l', option.useUnixCRLF ? '1' : '0'
1563-
];
1564-
1565-
let terminal: vscode.Terminal;
1566-
const terminalName = portName;
1567-
1568-
const cIndex = vscode.window.terminals.findIndex((term) => { return term.name === terminalName; });
1569-
const cmdPath = resManager.getCMDPath();
1570-
1571-
// close exist terminal
1572-
if (cIndex !== -1) { vscode.window.terminals[cIndex].dispose(); }
1573-
1574-
const opts: vscode.TerminalOptions = {
1575-
name: terminalName,
1576-
shellPath: cmdPath,
1577-
env: process.env
1578-
};
1579-
1580-
terminal = vscode.window.createTerminal(opts);
1581-
terminal.show(true);
1582-
1583-
/* send command */
1584-
const exeName = resManager.getSerialPortExe().noSuffixName;
1585-
const cmd = paramList.join(' ');
1586-
terminal.sendText(`${exeName} ${cmd}`);
1587-
1588-
} catch (error) {
1589-
GlobalEvent.emit('error', error);
1590-
}
1591-
}
15921544
}
15931545

15941546
interface UtilToolPickItem extends vscode.QuickPickItem {

src/SettingManager.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -250,38 +250,8 @@ export class SettingManager {
250250
}
251251
}
252252

253-
//-------------------------- Serialport --------------------------------
254-
255-
isShowSerialportStatusbar(): boolean {
256-
return this.getConfiguration().get<boolean>('SerialPortMonitor.ShowStatusBar') || false;
257-
}
258-
259-
getPortSerialMonitorOptions(): PortSerialOption {
260-
return {
261-
defaultPort: this.getConfiguration().get<string>('SerialPortMonitor.DefaultPort') || 'null',
262-
baudRate: this.getConfiguration().get<number>('SerialPortMonitor.BaudRate') || 9600,
263-
dataBits: this.getConfiguration().get<number>('SerialPortMonitor.DataBits') || 8,
264-
parity: this.getConfiguration().get<number>('SerialPortMonitor.Parity') || 0,
265-
stopBits: this.getConfiguration().get<number>('SerialPortMonitor.StopBits') || 0,
266-
useUnixCRLF: this.getConfiguration().get<boolean>('SerialPortMonitor.useUnixLF') || false,
267-
};
268-
}
269-
270-
getSerialBaudrate(): number {
271-
return this.getConfiguration().get<number>('SerialPortMonitor.BaudRate') || 115200
272-
}
273-
274-
setSerialBaudrate(baudrate: number, global?: boolean) {
275-
const region = global ? vscode.ConfigurationTarget.Global : vscode.ConfigurationTarget.Workspace;
276-
return this.getConfiguration().update('SerialPortMonitor.BaudRate', baudrate, region);
277-
}
278-
279253
//--------------------- Global Option ------------------------
280254

281-
/* isEnableAutoUpdateEideBinaries(): boolean {
282-
return this.getConfiguration().get<boolean>('Option.AutoUpdateEideBinaries') || false;
283-
} */
284-
285255
getForceIncludeList(): string[] {
286256
return this.getConfiguration().get<string[]>('Cpptools.ForceInclude') || [];
287257
}

src/extension.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ export async function activate(context: vscode.ExtensionContext) {
125125
subscriptions.push(vscode.commands.registerCommand('_cl.eide.Operation.Import', () => operationExplorer.OnImportProject()));
126126
subscriptions.push(vscode.commands.registerCommand('_cl.eide.Operation.SetToolchainPath', () => operationExplorer.OnSetToolchainPath()));
127127
subscriptions.push(vscode.commands.registerCommand('_cl.eide.Operation.SetupUtilTools', () => operationExplorer.setupUtilTools()));
128-
subscriptions.push(vscode.commands.registerCommand('_cl.eide.Operation.OpenSerialPortMonitor', (port) => operationExplorer.onOpenSerialPortMonitor(port)));
129128
subscriptions.push(vscode.commands.registerCommand('_cl.eide.Operation.openSettings', () => SettingManager.jumpToSettings('@ext:cl.eide')));
130129

131130
// operations user cmds

0 commit comments

Comments
 (0)