feat: 完成debugger前后端交互

This commit is contained in:
2025-07-29 19:10:21 +08:00
parent 23d4459406
commit 3da0f284f3
5 changed files with 359 additions and 17 deletions

View File

@@ -1649,18 +1649,24 @@ export class DebuggerClient {
/**
* 设置捕获模式
* @param channelNum (optional)
* @param mode (optional)
*/
setMode(mode: string): Promise<boolean> {
let url_ = this.baseUrl + "/api/Debugger/SetMode";
setMode(channelNum: number | undefined, mode: CaptureMode | undefined): Promise<boolean> {
let url_ = this.baseUrl + "/api/Debugger/SetMode?";
if (channelNum === null)
throw new Error("The parameter 'channelNum' cannot be null.");
else if (channelNum !== undefined)
url_ += "channelNum=" + encodeURIComponent("" + channelNum) + "&";
if (mode === null)
throw new Error("The parameter 'mode' cannot be null.");
else if (mode !== undefined)
url_ += "mode=" + encodeURIComponent("" + mode) + "&";
url_ = url_.replace(/[?&]$/, "");
const content_ = JSON.stringify(mode);
let options_: RequestInit = {
body: content_,
method: "POST",
headers: {
"Content-Type": "application/json",
"Accept": "application/json"
}
};
@@ -5508,6 +5514,15 @@ export interface IArgumentException extends ISystemException {
paramName?: string | undefined;
}
/** 信号捕获模式枚举 */
export enum CaptureMode {
None = 0,
Logic0 = 1,
Logic1 = 2,
Rise = 3,
Fall = 4,
}
/** 逻辑分析仪运行状态枚举 */
export enum CaptureStatus {
None = 0,