Update: 更新WebSocket模式

This commit is contained in:
王立帮
2024-12-01 14:44:49 +08:00
parent 134f2c99ae
commit 9bbd0e6720
13 changed files with 611 additions and 520 deletions

View File

@@ -16,6 +16,7 @@ goog.require('Mixly.StatusBarSerialOutput');
goog.require('Mixly.StatusBarSerialChart');
goog.require('Mixly.Electron.Serial');
goog.require('Mixly.Web.Serial');
goog.require('Mixly.WebSocket.Serial');
goog.provide('Mixly.StatusBarSerial');
const {
@@ -32,10 +33,23 @@ const {
StatusBarSerialOutput,
StatusBarSerialChart,
Electron = {},
Web = {}
Web = {},
WebSocket = {}
} = Mixly;
const { Serial } = goog.isElectron ? Electron : Web;
let currentObj = null;
if (goog.isElectron) {
currentObj = Electron;
} else {
if (Env.hasSocketServer) {
currentObj = WebSocket;
} else {
currentObj = Web;
}
}
const { Serial } = currentObj;
const { SELECTED_BOARD } = Config;